ux: admin/accounts: clarify inheritance

Massimo Melina committed Apr 14, 2023 at 10:59 UTC 77336c6d98e42e052f04aa9b38d3dafc0e2645b3
1 file changed +6 -4
admin/src/AccountForm.ts
+6 -4
@@ -2,7 +2,7 @@
2
3 import { createElement as h, ReactNode, useEffect, useRef, useState } from 'react'
4 import { BoolField, Form, MultiSelectField } from '@hfs/mui-grid-form'
5 -import { Box } from '@mui/material'
5 +import { Alert, Box } from '@mui/material'
6 import { apiCall } from './api'
7 import { alertDialog, toast, useDialogBarColors } from './dialog'
8 import { IconBtn, isEqualLax, modifiedSx } from './misc'
@@ -59,9 +59,11 @@ export default function AccountForm({ account, done, groups, addToBar, reload }:
59 helperText: "To access THIS interface you are using right now",
60 ...!account.admin && account.adminActualAccess && { value: true, helperText: "This permission is inherited" },
61 },
62 - { k: 'belongs', comp: MultiSelectField, label: "Inherits from", options: belongsOptions,
63 - helperText: "Specify groups to inherit permissions from."
64 - + (belongsOptions.length ? '' : " There are no groups available, create one first.")
62 + group && h(Alert, { severity: 'info' }, `To add users to this group, select the user and then click "Inherit"`),
63 + { k: 'belongs', comp: MultiSelectField, label: "Inherit from groups", options: belongsOptions,
64 + helperText: "Specify groups to inherit permissions from"
65 + + (!group ? '' : ". A group can inherit from another group")
66 + + (belongsOptions.length ? '' : ". Now disabled because there are no groups to select, create one first.")
67 },
68 { k: 'redirect', helperText: "If you want this account to be redirected to a specific folder/address at login time" },
69 ],