WIP modal
This commit is contained in:
parent
f669be1d78
commit
50db2c73d7
4 changed files with 29 additions and 5 deletions
|
@ -79,7 +79,7 @@ export const ConfirmDialogModal = ({
|
|||
<Button
|
||||
id="modal-cancel"
|
||||
key="cancel"
|
||||
variant={ButtonVariant.secondary}
|
||||
variant={ButtonVariant.link}
|
||||
onClick={() => {
|
||||
if (onCancel) onCancel();
|
||||
toggleDialog();
|
||||
|
|
|
@ -87,4 +87,4 @@ export const RealmRoleForm = ({
|
|||
</ActionGroup>
|
||||
</FormAccess>
|
||||
);
|
||||
};
|
||||
};
|
|
@ -71,6 +71,26 @@ export const RealmRolesSection = () => {
|
|||
},
|
||||
});
|
||||
|
||||
// const [toggleAssociatedRoleDialog, associatedRolesList] = useConfirmDialog({
|
||||
// titleKey: "roles:associatedRolesModalTitle",
|
||||
// messageKey: t("roles:roleDeleteConfirmDialog", {
|
||||
// selectedRoleName: selectedRole ? selectedRole!.name : "",
|
||||
// }),
|
||||
// continueButtonLabel: t("Add"),
|
||||
// continueButtonVariant: ButtonVariant.danger,
|
||||
// onConfirm: async () => {
|
||||
// try {
|
||||
// await adminClient.roles.delById({
|
||||
// id: selectedRole!.id!,
|
||||
// });
|
||||
// setSelectedRole(undefined);
|
||||
// addAlert(t("roleDeletedSuccess"), AlertVariant.success);
|
||||
// } catch (error) {
|
||||
// addAlert(`${t("roleDeleteError")} ${error}`, AlertVariant.danger);
|
||||
// }
|
||||
// },
|
||||
// });
|
||||
|
||||
const goToCreate = () => history.push(`${url}/add-role`);
|
||||
return (
|
||||
<>
|
||||
|
@ -90,12 +110,12 @@ export const RealmRolesSection = () => {
|
|||
}
|
||||
actions={[
|
||||
{
|
||||
title: t("common:Delete"),
|
||||
title: t("addAssociatedRolesText"),
|
||||
onRowClick: (role) => {
|
||||
setSelectedRole(role);
|
||||
toggleDeleteDialog();
|
||||
},
|
||||
},
|
||||
}
|
||||
]}
|
||||
columns={[
|
||||
{
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
{
|
||||
"roles": {
|
||||
"attributes": "Attributes",
|
||||
"add": "Add",
|
||||
"addAttributeText": "Add an attribute",
|
||||
"deleteAttributeText": "Delete an attribute",
|
||||
"addAssociatedRolesText": "Add associated roles",
|
||||
"addAssociatedRolesSuccess": "Associated roles have been added",
|
||||
"associatedRolesModalTitle": "Add roles to {{name}}",
|
||||
"title": "Realm roles",
|
||||
"createRole": "Create role",
|
||||
"importRole": "Import role",
|
||||
|
@ -24,7 +28,7 @@
|
|||
"roleCreateError": "Could not create role: {{error}}",
|
||||
"roleImportSuccess": "Role import successful",
|
||||
"roleDeleteConfirm": "Delete role?",
|
||||
"roleDeleteConfirmDialog": "This action will permanently delete the role {{selectedRoleName}} and cannot be undone.",
|
||||
"roleDeleteConfirmDialog": "This action will permanently delete the role {{name}} and cannot be undone.",
|
||||
"roleDeletedSuccess": "The role has been deleted",
|
||||
"roleDeleteError": "Could not delete role:",
|
||||
"roleSaveSuccess": "The role has been saved",
|
||||
|
|
Loading…
Reference in a new issue