fix(create-role): check isCreator by default when permissioon is checked
This commit is contained in:
@@ -22,14 +22,22 @@ type PermissionSettingsProps = {
|
||||
onClose: () => void;
|
||||
fieldPrefix: string;
|
||||
subject: string;
|
||||
open?: boolean;
|
||||
defaultChecked?: boolean;
|
||||
actions: IPermissionCatalog['actions'];
|
||||
conditions: IPermissionCatalog['conditions'];
|
||||
};
|
||||
|
||||
export default function PermissionSettings(props: PermissionSettingsProps) {
|
||||
const { onClose, fieldPrefix, subject, actions, conditions, defaultChecked } =
|
||||
props;
|
||||
const {
|
||||
onClose,
|
||||
open = false,
|
||||
fieldPrefix,
|
||||
subject,
|
||||
actions,
|
||||
conditions,
|
||||
defaultChecked,
|
||||
} = props;
|
||||
|
||||
const formatMessage = useFormatMessage();
|
||||
const { getValues, resetField } = useFormContext();
|
||||
@@ -58,7 +66,7 @@ export default function PermissionSettings(props: PermissionSettingsProps) {
|
||||
};
|
||||
|
||||
return (
|
||||
<Dialog open onClose={cancel}>
|
||||
<Dialog open onClose={cancel} sx={{ display: open ? 'block' : 'none' }}>
|
||||
<DialogTitle>{formatMessage('permissionSettings.title')}</DialogTitle>
|
||||
|
||||
<DialogContent>
|
||||
|
@@ -93,16 +93,15 @@ const PermissionCatalogField = ({
|
||||
<SettingsIcon />
|
||||
</IconButton>
|
||||
|
||||
{dialogName === subject.key && (
|
||||
<PermissionSettings
|
||||
onClose={() => setDialogName('')}
|
||||
fieldPrefix={`${name}.${subject.key}`}
|
||||
subject={subject.key}
|
||||
actions={permissionCatalog.actions}
|
||||
conditions={permissionCatalog.conditions}
|
||||
defaultChecked={defaultChecked}
|
||||
/>
|
||||
)}
|
||||
<PermissionSettings
|
||||
open={dialogName === subject.key}
|
||||
onClose={() => setDialogName('')}
|
||||
fieldPrefix={`${name}.${subject.key}`}
|
||||
subject={subject.key}
|
||||
actions={permissionCatalog.actions}
|
||||
conditions={permissionCatalog.conditions}
|
||||
defaultChecked={defaultChecked}
|
||||
/>
|
||||
</Stack>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
|
Reference in New Issue
Block a user