WIP modal

This commit is contained in:
jenny-s51 2021-01-08 13:04:58 -05:00
parent f669be1d78
commit 50db2c73d7
4 changed files with 29 additions and 5 deletions

View file

@ -79,7 +79,7 @@ export const ConfirmDialogModal = ({
<Button
id="modal-cancel"
key="cancel"
variant={ButtonVariant.secondary}
variant={ButtonVariant.link}
onClick={() => {
if (onCancel) onCancel();
toggleDialog();

View file

@ -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={[
{

View file

@ -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",