Skip to content

Commit

Permalink
more work
Browse files Browse the repository at this point in the history
  • Loading branch information
farhatahmad committed Dec 11, 2023
1 parent 473a89b commit e424f37
Show file tree
Hide file tree
Showing 7 changed files with 3,719 additions and 3,107 deletions.
3 changes: 2 additions & 1 deletion app/assets/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@
"manage_roles": "Allow users with this role to edit other roles",
"shared_list": "Include users with this role in the dropdown for sharing rooms",
"room_limit": "Room Limit",
"email_on_signup": "Receive an email when a new user signs up"
"email_on_signup": "Receive an email when a new user signs up",
"allowed_recording_visibility": "Allowed recording visibilities"
}
}
},
Expand Down
23 changes: 23 additions & 0 deletions app/javascript/components/admin/roles/forms/EditRoleForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { useAuth } from '../../../../contexts/auth/AuthProvider';
import RolePermissionRowPlaceHolder from '../RolePermissionRowPlaceHolder';
import useEditRoleNameForm from '../../../../hooks/forms/admin/roles/useEditRoleNameForm';
import useEditRoleLimitForm from '../../../../hooks/forms/admin/roles/useEditRoleLimitForm';
import Select from "react-select";

export default function EditRoleForm({ role }) {
const { t } = useTranslation();
Expand Down Expand Up @@ -137,6 +138,28 @@ export default function EditRoleForm({ role }) {
defaultValue={rolePermissions?.EmailOnSignup === 'true'}
/>

<Form className="pb-3">
<Stack direction="horizontal">
<div className="text-muted me-auto">
{t('admin.roles.edit.allowed_recording_visibility')}
</div>
<div>
<Select
className="float-end"
isMulti
filterOption={false}
options={[
{ value: 'Published', label: 'Published' },
{ value: 'Unpublished', label: 'Unpublished' },
{ value: 'Protected', label: 'Protected' },
{ value: 'Public', label: 'Public' },
{ value: 'Public/Protected', label: 'Public/Protected' }
]}
/>
</div>
</Stack>
</Form>

<Form methods={methodsLimit} onBlur={methodsLimit.handleSubmit(updatePermissionAPI.mutate)}>
<Stack direction="horizontal">
<div className="text-muted me-auto">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import { ChevronDownIcon } from '@heroicons/react/20/solid';

export default function SimpleSelect({ defaultValue, dropUp, children }) {
// Get the currently selected option and set the dropdown toggle to that value
console.log(children)
const defaultString = children?.filter((item) => item.props.value === defaultValue)[0];
const defaultString = children?.filter(Boolean)?.filter((item) => item.props.value === defaultValue)[0];

return (
<Dropdown className="simple-select" drop={dropUp ? 'up' : undefined}>
Expand Down
1 change: 0 additions & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e424f37

Please sign in to comment.