Modify FE for No access role
- fix user settings modal - CurrentUserModal - TODO: refactor UserModal and CurrentUserModal - it's same thing
This commit is contained in:
parent
d0edc5b2bc
commit
bc8db8d248
6 changed files with 48 additions and 17 deletions
|
|
@ -83,6 +83,7 @@ export const CurrentUserModal = ({ open, onClose, user }: UserModalProps) => {
|
|||
name={`app_roles.${index}.role`}
|
||||
label="Role"
|
||||
options={[
|
||||
{ value: UserRole.NoAccess, name: 'No access' },
|
||||
{ value: UserRole.Admin, name: 'Admin' },
|
||||
{ value: UserRole.User, name: 'User' },
|
||||
]}
|
||||
|
|
@ -121,9 +122,12 @@ export const CurrentUserModal = ({ open, onClose, user }: UserModalProps) => {
|
|||
<div>
|
||||
<div className="flow-root mt-6">
|
||||
<ul className="-my-5 divide-y divide-gray-200 ">
|
||||
{fields
|
||||
.filter((field) => field.name !== 'dashboard')
|
||||
.map((item, index) => (
|
||||
{fields.map((item, index) => {
|
||||
if (item.name === 'dashboard') {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<li className="py-4" key={item.name}>
|
||||
<div className="flex items-center space-x-4">
|
||||
<div className="flex-shrink-0 flex-1 flex items-center">
|
||||
|
|
@ -142,6 +146,7 @@ export const CurrentUserModal = ({ open, onClose, user }: UserModalProps) => {
|
|||
control={control}
|
||||
name={`app_roles.${index}.role`}
|
||||
options={[
|
||||
{ value: UserRole.NoAccess, name: 'No access' },
|
||||
{ value: UserRole.Admin, name: 'Admin' },
|
||||
{ value: UserRole.User, name: 'User' },
|
||||
]}
|
||||
|
|
@ -149,7 +154,8 @@ export const CurrentUserModal = ({ open, onClose, user }: UserModalProps) => {
|
|||
</div>
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ export const appAccessList = [
|
|||
label: 'Wordpress',
|
||||
},
|
||||
{
|
||||
name: 'next-cloud',
|
||||
name: 'nextcloud',
|
||||
image: '/assets/nextcloud.svg',
|
||||
label: 'NextCloud',
|
||||
},
|
||||
|
|
@ -30,19 +30,19 @@ const initialAppRoles = [
|
|||
},
|
||||
{
|
||||
name: 'wekan',
|
||||
role: UserRole.User,
|
||||
role: UserRole.NoAccess,
|
||||
},
|
||||
{
|
||||
name: 'wordpress',
|
||||
role: UserRole.User,
|
||||
role: UserRole.NoAccess,
|
||||
},
|
||||
{
|
||||
name: 'next-cloud',
|
||||
role: UserRole.User,
|
||||
name: 'nextcloud',
|
||||
role: UserRole.NoAccess,
|
||||
},
|
||||
{
|
||||
name: 'zulip',
|
||||
role: UserRole.User,
|
||||
role: UserRole.NoAccess,
|
||||
},
|
||||
];
|
||||
|
||||
|
|
|
|||
Reference in a new issue