@backstage-community/plugin-rbac 1.50.2 → 1.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/dist/alpha/pages.esm.js +4 -1
- package/dist/alpha/pages.esm.js.map +1 -1
- package/dist/alpha/routes.esm.js +18 -0
- package/dist/alpha/routes.esm.js.map +1 -0
- package/dist/alpha/translations/de.esm.js +2 -0
- package/dist/alpha/translations/de.esm.js.map +1 -1
- package/dist/alpha/translations/es.esm.js +2 -0
- package/dist/alpha/translations/es.esm.js.map +1 -1
- package/dist/alpha/translations/fr.esm.js +2 -0
- package/dist/alpha/translations/fr.esm.js.map +1 -1
- package/dist/alpha/translations/it.esm.js +2 -0
- package/dist/alpha/translations/it.esm.js.map +1 -1
- package/dist/alpha/translations/ref.esm.js +2 -0
- package/dist/alpha/translations/ref.esm.js.map +1 -1
- package/dist/alpha.d.ts +10 -32
- package/dist/alpha.esm.js +2 -3
- package/dist/alpha.esm.js.map +1 -1
- package/dist/components/Administration.esm.js +1 -4
- package/dist/components/Administration.esm.js.map +1 -1
- package/dist/components/CreateRole/EditRolePage.esm.js +3 -0
- package/dist/components/CreateRole/EditRolePage.esm.js.map +1 -1
- package/dist/components/EditRole.esm.js +2 -3
- package/dist/components/EditRole.esm.js.map +1 -1
- package/dist/components/RoleOverview/MembersCard.esm.js +8 -4
- package/dist/components/RoleOverview/MembersCard.esm.js.map +1 -1
- package/dist/components/RoleOverview/PermissionsCard.esm.js +18 -5
- package/dist/components/RoleOverview/PermissionsCard.esm.js.map +1 -1
- package/dist/components/RoleOverview/RoleOverviewPage.esm.js +2 -1
- package/dist/components/RoleOverview/RoleOverviewPage.esm.js.map +1 -1
- package/dist/components/RolesList/DeleteRole.esm.js +2 -3
- package/dist/components/RolesList/DeleteRole.esm.js.map +1 -1
- package/dist/components/RolesList/RolesListColumns.esm.js +23 -17
- package/dist/components/RolesList/RolesListColumns.esm.js.map +1 -1
- package/dist/hooks/useActionPermissionTooltip.esm.js +1 -1
- package/dist/hooks/useActionPermissionTooltip.esm.js.map +1 -1
- package/dist/hooks/useMembers.esm.js +3 -1
- package/dist/hooks/useMembers.esm.js.map +1 -1
- package/dist/hooks/useRoles.esm.js +2 -1
- package/dist/hooks/useRoles.esm.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/package.json.esm.js +15 -15
- package/package.json +16 -16
- package/dist/alpha/navItems.esm.js +0 -15
- package/dist/alpha/navItems.esm.js.map +0 -1
|
@@ -17,6 +17,7 @@ const rbacMessages = {
|
|
|
17
17
|
accessiblePlugins: "Accessible plugins",
|
|
18
18
|
actions: "Actions"
|
|
19
19
|
},
|
|
20
|
+
defaultRoleUsersAndGroups: "All users and all groups",
|
|
20
21
|
emptyContent: "No records found"
|
|
21
22
|
},
|
|
22
23
|
toolbar: {
|
|
@@ -46,6 +47,7 @@ const rbacMessages = {
|
|
|
46
47
|
createRole: "Unable to create role.",
|
|
47
48
|
editRole: "Unable to edit the role.",
|
|
48
49
|
deleteRole: "Unable to delete the role.",
|
|
50
|
+
defaultRoleReadOnly: "Default role is read-only.",
|
|
49
51
|
roleCreatedSuccess: "Role was created successfully but unable to add permission policies to the role.",
|
|
50
52
|
roleCreatedConditionsSuccess: "Role created successfully but unable to add conditions to the role."
|
|
51
53
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ref.esm.js","sources":["../../../src/alpha/translations/ref.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nexport const rbacMessages = {\n page: {\n title: 'RBAC',\n createRole: 'Create role',\n editRole: 'Edit role',\n },\n table: {\n searchPlaceholder: 'Filter',\n labelRowsSelect: 'Rows',\n title: 'All roles',\n titleWithCount: 'All roles ({{count}})',\n headers: {\n name: 'Name',\n usersAndGroups: 'Users and groups',\n accessiblePlugins: 'Accessible plugins',\n actions: 'Actions',\n },\n emptyContent: 'No records found',\n },\n toolbar: {\n createButton: 'Create',\n warning: {\n title: 'Unable to create role.',\n message:\n 'To enable create/edit role button, make sure required users/groups are available in catalog as a role cannot be created without users/groups and also the role associated with your user should have the permission policies mentioned <link>here</link>.',\n linkText: 'here',\n note: 'Note',\n noteText:\n 'Even after ingesting users/groups in catalog and applying above permissions if the create/edit button is still disabled then please contact your administrator as you might be conditionally restricted from accessing the create/edit button.',\n },\n },\n errors: {\n notFound: 'Not Found',\n notAllowed: 'Insufficient permissions to access this page',\n unauthorized: 'Unauthorized to create role',\n rbacDisabled: 'Enable the RBAC backend plugin to use this feature.',\n rbacDisabledInfo:\n 'To enable RBAC, set `permission.enabled` to `true` in the app-config file.',\n fetchRoles: 'Something went wrong while fetching the roles',\n fetchRole: 'Something went wrong while fetching the role',\n fetchPoliciesErr: 'Error fetching the policies. {{error}}',\n fetchPolicies:\n 'Something went wrong while fetching the permission policies',\n fetchPlugins: 'Error fetching the plugins. {{error}}',\n fetchConditionalPermissionPolicies:\n 'Error fetching the conditional permission policies. {{error}}',\n fetchConditions: 'Something went wrong while fetching the role conditions',\n fetchUsersAndGroups:\n 'Something went wrong while fetching the users and groups',\n createRole: 'Unable to create role.',\n editRole: 'Unable to edit the role.',\n deleteRole: 'Unable to delete the role.',\n roleCreatedSuccess:\n 'Role was created successfully but unable to add permission policies to the role.',\n roleCreatedConditionsSuccess:\n 'Role created successfully but unable to add conditions to the role.',\n },\n roleForm: {\n titles: {\n createRole: 'Create Role',\n editRole: 'Edit Role',\n nameAndDescription: 'Enter name and description of role',\n usersAndGroups: 'Add users and groups',\n permissionPolicies: 'Add permission policies',\n },\n review: {\n reviewAndCreate: 'Review and create',\n reviewAndSave: 'Review and save',\n nameDescriptionOwner: 'Name, description, and owner of role',\n permissionPoliciesWithCount: 'Permission policies ({{count}})',\n },\n steps: {\n next: 'Next',\n back: 'Back',\n cancel: 'Cancel',\n reset: 'Reset',\n create: 'Create',\n save: 'Save',\n },\n fields: {\n name: {\n label: 'Name',\n helperText: 'Enter name of the role',\n },\n description: {\n label: 'Description',\n helperText:\n 'Enter a brief description about the role (The purpose of the role)',\n },\n owner: {\n label: 'Owner',\n helperText:\n 'Optional: Enter a user or group who will have permission to edit this role and create additional roles. In the next step, specify which users they can assign to their roles and which plugins they can grant access to. If left blank, automatically assigns the author at creation.',\n },\n },\n },\n deleteDialog: {\n title: 'Delete Role',\n question: 'Delete this role?',\n confirmation:\n 'Are you sure you want to delete the role **{{roleName}}**?\\n\\nDeleting this role is irreversible and will remove its functionality from the system. Proceed with caution.\\n\\nThe **{{members}}** associated with this role will lose access to all the **{{permissions}} permission policies** specified in this role.',\n roleNameLabel: 'Role name',\n roleNameHelper: 'Type the name of the role to confirm',\n deleteButton: 'Delete',\n cancelButton: 'Cancel',\n successMessage: 'Role {{roleName}} deleted successfully',\n },\n snackbar: {\n success: 'Success',\n },\n dialog: {\n cancelRoleCreation: 'Cancel role creation',\n exitRoleCreation: 'Exit role creation?',\n exitRoleEditing: 'Exit role editing?',\n exitWarning:\n '\\n\\nExiting this page will permanently discard the information you entered.\\n\\nAre you sure you want to exit?',\n discard: 'Discard',\n cancel: 'Cancel',\n },\n conditionalAccess: {\n condition: 'Condition',\n allOf: 'AllOf',\n anyOf: 'AnyOf',\n not: 'Not',\n addNestedCondition: 'Add nested condition',\n addRule: 'Add rule',\n nestedConditionTooltip:\n 'Nested conditions are **1 layer rules within a main condition**. It lets you allow appropriate access by using detailed permissions based on various conditions. You can add multiple nested conditions.',\n nestedConditionExample:\n 'For example, you can allow access to all entity types in the main condition and use a nested condition to limit the access to entities owned by the user.',\n },\n permissionPolicies: {\n helperText:\n 'By default, users are not granted access to any plugins. To grant user access, select the plugins you want to enable. Then, select which actions you would like to give user permission to.',\n allPlugins: 'All plugins ({{count}})',\n errorFetchingPolicies: 'Error fetching the permission policies: {{error}}',\n resourceTypeTooltip: 'resource type: {{resourceType}}',\n advancedPermissionsTooltip:\n 'Use advanced customized permissions to allow access to specific parts of the selected resource type.',\n noAdvancedPermissionsTooltip:\n 'Advanced customization is not supported for this resource type.',\n pluginsSelected: '{{count}} plugins',\n noPluginsSelected: 'No plugins selected',\n search: 'Search',\n noRecordsToDisplay: 'No records to display.',\n selectedPluginsAppearHere: 'Selected plugins appear here.',\n selectPlugins: 'Select plugins',\n noPluginsFound: 'No plugins found.',\n plugin: 'Plugin',\n permission: 'Permission',\n policies: 'Policies',\n conditional: 'Conditional',\n rules: 'rules',\n rule: 'rule',\n permissionPolicies: 'Permission Policies',\n permissions: 'permissions',\n },\n common: {\n noResults: 'No results for this date range.',\n exportCSV: 'Export CSV',\n csvFilename: 'data-export.csv',\n noMembers: 'No members',\n groups: 'groups',\n group: 'group',\n users: 'users',\n user: 'user',\n use: 'Use',\n refresh: 'Refresh',\n edit: 'Edit',\n unauthorizedToEdit: 'Unauthorized to edit',\n noRecordsFound: 'No records found',\n selectUsersAndGroups: 'Select users and groups',\n clearSearch: 'clear search',\n closeDrawer: 'Close the drawer',\n remove: 'Remove',\n addRule: 'Add rule',\n selectRule: 'Select a rule',\n rule: 'Rule',\n removeNestedCondition: 'Remove nested condition',\n overview: 'Overview',\n about: 'About',\n description: 'Description',\n modifiedBy: 'Modified By',\n lastModified: 'Last Modified',\n owner: 'Owner',\n noUsersAndGroupsSelected: 'No users and groups selected',\n selectedUsersAndGroupsAppearHere: 'Selected users and groups appear here.',\n name: 'Name',\n type: 'Type',\n members: 'Members',\n actions: 'Actions',\n removeMember: 'Remove member',\n delete: 'Delete',\n deleteRole: 'Delete Role',\n update: 'Update',\n editRole: 'Edit Role',\n checkingPermissions: 'Checking permissions…',\n unauthorizedTo: 'Unauthorized to {{action}}',\n performThisAction: 'perform this action',\n unableToCreatePermissionPolicies:\n 'Unable to create the permission policies.',\n unableToDeletePermissionPolicies:\n 'Unable to delete the permission policies.',\n unableToRemoveConditions: 'Unable to remove conditions from the role.',\n unableToUpdateConditions: 'Unable to update conditions.',\n unableToAddConditions: 'Unable to add conditions to the role.',\n roleActionSuccessfully: 'Role {{roleName}} {{action}} successfully',\n unableToFetchRole: 'Unable to fetch role: {{error}}',\n unableToFetchMembers: 'Unable to fetch members: {{error}}',\n roleAction: '{{action}} role',\n membersCount: '{{count}} members',\n parentGroupCount: '{{count}} parent group',\n childGroupsCount: '{{count}} child groups',\n searchAndSelectUsersGroups:\n 'Search and select users and groups to be added. Selected users and groups will appear in the table below.',\n noUsersAndGroupsFound: 'No users and groups found.',\n errorFetchingUserGroups: 'Error fetching user and groups: {{error}}',\n nameRequired: 'Name is required',\n noMemberSelected: 'No member selected',\n noPluginSelected: 'No plugin selected',\n pluginRequired: 'Plugin is required',\n permissionRequired: 'Permission is required',\n editCell: 'Edit...',\n selectCell: 'Select...',\n expandRow: 'expand row',\n configureAccessFor: 'Configure access for the',\n defaultResourceTypeVisible:\n 'By default, the selected resource type is visible to all added users. If you want to restrict or grant permission to specific plugin rules, select them and add the parameters.',\n },\n};\n\n/**\n * Translation reference for RBAC plugin\n * @public\n */\nexport const rbacTranslationRef = createTranslationRef({\n id: 'plugin.rbac',\n messages: rbacMessages,\n});\n"],"names":[],"mappings":";;AAiBO,MAAM,YAAe,GAAA;AAAA,EAC1B,IAAM,EAAA;AAAA,IACJ,KAAO,EAAA,MAAA;AAAA,IACP,UAAY,EAAA,aAAA;AAAA,IACZ,QAAU,EAAA;AAAA,GACZ;AAAA,EACA,KAAO,EAAA;AAAA,IACL,iBAAmB,EAAA,QAAA;AAAA,IACnB,eAAiB,EAAA,MAAA;AAAA,IACjB,KAAO,EAAA,WAAA;AAAA,IACP,cAAgB,EAAA,u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YAAc,EAAA,mBAAA;AAAA,IACd,gBAAkB,EAAA,wBAAA;AAAA,IAClB,gBAAkB,EAAA,wBAAA;AAAA,IAClB,0BACE,EAAA,2GAAA;AAAA,IACF,qBAAuB,EAAA,4BAAA;AAAA,IACvB,uBAAyB,EAAA,2CAAA;AAAA,IACzB,YAAc,EAAA,kBAAA;AAAA,IACd,gBAAkB,EAAA,oBAAA;AAAA,IAClB,gBAAkB,EAAA,oBAAA;AAAA,IAClB,cAAgB,EAAA,oBAAA;AAAA,IAChB,kBAAoB,EAAA,wBAAA;AAAA,IACpB,QAAU,EAAA,SAAA;AAAA,IACV,UAAY,EAAA,WAAA;AAAA,IACZ,SAAW,EAAA,YAAA;AAAA,IACX,kBAAoB,EAAA,0BAAA;AAAA,IACpB,0BACE,EAAA;AAAA;AAEN;AAMO,MAAM,qBAAqB,oBAAqB,CAAA;AAAA,EACrD,EAAI,EAAA,aAAA;AAAA,EACJ,QAAU,EAAA;AACZ,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"ref.esm.js","sources":["../../../src/alpha/translations/ref.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nexport const rbacMessages = {\n page: {\n title: 'RBAC',\n createRole: 'Create role',\n editRole: 'Edit role',\n },\n table: {\n searchPlaceholder: 'Filter',\n labelRowsSelect: 'Rows',\n title: 'All roles',\n titleWithCount: 'All roles ({{count}})',\n headers: {\n name: 'Name',\n usersAndGroups: 'Users and groups',\n accessiblePlugins: 'Accessible plugins',\n actions: 'Actions',\n },\n defaultRoleUsersAndGroups: 'All users and all groups',\n emptyContent: 'No records found',\n },\n toolbar: {\n createButton: 'Create',\n warning: {\n title: 'Unable to create role.',\n message:\n 'To enable create/edit role button, make sure required users/groups are available in catalog as a role cannot be created without users/groups and also the role associated with your user should have the permission policies mentioned <link>here</link>.',\n linkText: 'here',\n note: 'Note',\n noteText:\n 'Even after ingesting users/groups in catalog and applying above permissions if the create/edit button is still disabled then please contact your administrator as you might be conditionally restricted from accessing the create/edit button.',\n },\n },\n errors: {\n notFound: 'Not Found',\n notAllowed: 'Insufficient permissions to access this page',\n unauthorized: 'Unauthorized to create role',\n rbacDisabled: 'Enable the RBAC backend plugin to use this feature.',\n rbacDisabledInfo:\n 'To enable RBAC, set `permission.enabled` to `true` in the app-config file.',\n fetchRoles: 'Something went wrong while fetching the roles',\n fetchRole: 'Something went wrong while fetching the role',\n fetchPoliciesErr: 'Error fetching the policies. {{error}}',\n fetchPolicies:\n 'Something went wrong while fetching the permission policies',\n fetchPlugins: 'Error fetching the plugins. {{error}}',\n fetchConditionalPermissionPolicies:\n 'Error fetching the conditional permission policies. {{error}}',\n fetchConditions: 'Something went wrong while fetching the role conditions',\n fetchUsersAndGroups:\n 'Something went wrong while fetching the users and groups',\n createRole: 'Unable to create role.',\n editRole: 'Unable to edit the role.',\n deleteRole: 'Unable to delete the role.',\n defaultRoleReadOnly: 'Default role is read-only.',\n roleCreatedSuccess:\n 'Role was created successfully but unable to add permission policies to the role.',\n roleCreatedConditionsSuccess:\n 'Role created successfully but unable to add conditions to the role.',\n },\n roleForm: {\n titles: {\n createRole: 'Create Role',\n editRole: 'Edit Role',\n nameAndDescription: 'Enter name and description of role',\n usersAndGroups: 'Add users and groups',\n permissionPolicies: 'Add permission policies',\n },\n review: {\n reviewAndCreate: 'Review and create',\n reviewAndSave: 'Review and save',\n nameDescriptionOwner: 'Name, description, and owner of role',\n permissionPoliciesWithCount: 'Permission policies ({{count}})',\n },\n steps: {\n next: 'Next',\n back: 'Back',\n cancel: 'Cancel',\n reset: 'Reset',\n create: 'Create',\n save: 'Save',\n },\n fields: {\n name: {\n label: 'Name',\n helperText: 'Enter name of the role',\n },\n description: {\n label: 'Description',\n helperText:\n 'Enter a brief description about the role (The purpose of the role)',\n },\n owner: {\n label: 'Owner',\n helperText:\n 'Optional: Enter a user or group who will have permission to edit this role and create additional roles. In the next step, specify which users they can assign to their roles and which plugins they can grant access to. If left blank, automatically assigns the author at creation.',\n },\n },\n },\n deleteDialog: {\n title: 'Delete Role',\n question: 'Delete this role?',\n confirmation:\n 'Are you sure you want to delete the role **{{roleName}}**?\\n\\nDeleting this role is irreversible and will remove its functionality from the system. Proceed with caution.\\n\\nThe **{{members}}** associated with this role will lose access to all the **{{permissions}} permission policies** specified in this role.',\n roleNameLabel: 'Role name',\n roleNameHelper: 'Type the name of the role to confirm',\n deleteButton: 'Delete',\n cancelButton: 'Cancel',\n successMessage: 'Role {{roleName}} deleted successfully',\n },\n snackbar: {\n success: 'Success',\n },\n dialog: {\n cancelRoleCreation: 'Cancel role creation',\n exitRoleCreation: 'Exit role creation?',\n exitRoleEditing: 'Exit role editing?',\n exitWarning:\n '\\n\\nExiting this page will permanently discard the information you entered.\\n\\nAre you sure you want to exit?',\n discard: 'Discard',\n cancel: 'Cancel',\n },\n conditionalAccess: {\n condition: 'Condition',\n allOf: 'AllOf',\n anyOf: 'AnyOf',\n not: 'Not',\n addNestedCondition: 'Add nested condition',\n addRule: 'Add rule',\n nestedConditionTooltip:\n 'Nested conditions are **1 layer rules within a main condition**. It lets you allow appropriate access by using detailed permissions based on various conditions. You can add multiple nested conditions.',\n nestedConditionExample:\n 'For example, you can allow access to all entity types in the main condition and use a nested condition to limit the access to entities owned by the user.',\n },\n permissionPolicies: {\n helperText:\n 'By default, users are not granted access to any plugins. To grant user access, select the plugins you want to enable. Then, select which actions you would like to give user permission to.',\n allPlugins: 'All plugins ({{count}})',\n errorFetchingPolicies: 'Error fetching the permission policies: {{error}}',\n resourceTypeTooltip: 'resource type: {{resourceType}}',\n advancedPermissionsTooltip:\n 'Use advanced customized permissions to allow access to specific parts of the selected resource type.',\n noAdvancedPermissionsTooltip:\n 'Advanced customization is not supported for this resource type.',\n pluginsSelected: '{{count}} plugins',\n noPluginsSelected: 'No plugins selected',\n search: 'Search',\n noRecordsToDisplay: 'No records to display.',\n selectedPluginsAppearHere: 'Selected plugins appear here.',\n selectPlugins: 'Select plugins',\n noPluginsFound: 'No plugins found.',\n plugin: 'Plugin',\n permission: 'Permission',\n policies: 'Policies',\n conditional: 'Conditional',\n rules: 'rules',\n rule: 'rule',\n permissionPolicies: 'Permission Policies',\n permissions: 'permissions',\n },\n common: {\n noResults: 'No results for this date range.',\n exportCSV: 'Export CSV',\n csvFilename: 'data-export.csv',\n noMembers: 'No members',\n groups: 'groups',\n group: 'group',\n users: 'users',\n user: 'user',\n use: 'Use',\n refresh: 'Refresh',\n edit: 'Edit',\n unauthorizedToEdit: 'Unauthorized to edit',\n noRecordsFound: 'No records found',\n selectUsersAndGroups: 'Select users and groups',\n clearSearch: 'clear search',\n closeDrawer: 'Close the drawer',\n remove: 'Remove',\n addRule: 'Add rule',\n selectRule: 'Select a rule',\n rule: 'Rule',\n removeNestedCondition: 'Remove nested condition',\n overview: 'Overview',\n about: 'About',\n description: 'Description',\n modifiedBy: 'Modified By',\n lastModified: 'Last Modified',\n owner: 'Owner',\n noUsersAndGroupsSelected: 'No users and groups selected',\n selectedUsersAndGroupsAppearHere: 'Selected users and groups appear here.',\n name: 'Name',\n type: 'Type',\n members: 'Members',\n actions: 'Actions',\n removeMember: 'Remove member',\n delete: 'Delete',\n deleteRole: 'Delete Role',\n update: 'Update',\n editRole: 'Edit Role',\n checkingPermissions: 'Checking permissions…',\n unauthorizedTo: 'Unauthorized to {{action}}',\n performThisAction: 'perform this action',\n unableToCreatePermissionPolicies:\n 'Unable to create the permission policies.',\n unableToDeletePermissionPolicies:\n 'Unable to delete the permission policies.',\n unableToRemoveConditions: 'Unable to remove conditions from the role.',\n unableToUpdateConditions: 'Unable to update conditions.',\n unableToAddConditions: 'Unable to add conditions to the role.',\n roleActionSuccessfully: 'Role {{roleName}} {{action}} successfully',\n unableToFetchRole: 'Unable to fetch role: {{error}}',\n unableToFetchMembers: 'Unable to fetch members: {{error}}',\n roleAction: '{{action}} role',\n membersCount: '{{count}} members',\n parentGroupCount: '{{count}} parent group',\n childGroupsCount: '{{count}} child groups',\n searchAndSelectUsersGroups:\n 'Search and select users and groups to be added. Selected users and groups will appear in the table below.',\n noUsersAndGroupsFound: 'No users and groups found.',\n errorFetchingUserGroups: 'Error fetching user and groups: {{error}}',\n nameRequired: 'Name is required',\n noMemberSelected: 'No member selected',\n noPluginSelected: 'No plugin selected',\n pluginRequired: 'Plugin is required',\n permissionRequired: 'Permission is required',\n editCell: 'Edit...',\n selectCell: 'Select...',\n expandRow: 'expand row',\n configureAccessFor: 'Configure access for the',\n defaultResourceTypeVisible:\n 'By default, the selected resource type is visible to all added users. If you want to restrict or grant permission to specific plugin rules, select them and add the parameters.',\n },\n};\n\n/**\n * Translation reference for RBAC plugin\n * @public\n */\nexport const rbacTranslationRef = createTranslationRef({\n id: 'plugin.rbac',\n messages: rbacMessages,\n});\n"],"names":[],"mappings":";;AAiBO,MAAM,YAAe,GAAA;AAAA,EAC1B,IAAM,EAAA;AAAA,IACJ,KAAO,EAAA,MAAA;AAAA,IACP,UAAY,EAAA,aAAA;AAAA,IACZ,QAAU,EAAA;AAAA,GACZ;AAAA,EACA,KAAO,EAAA;AAAA,IACL,iBAAmB,EAAA,QAAA;AAAA,IACnB,eAAiB,EAAA,MAAA;AAAA,IACjB,KAAO,EAAA,WAAA;AAAA,IACP,cAAgB,EAAA,uBAAA;AAAA,IAChB,OAAS,EAAA;AAAA,MACP,IAAM,EAAA,MAAA;AAAA,MACN,cAAgB,EAAA,kBAAA;AAAA,MAChB,iBAAmB,EAAA,oBAAA;AAAA,MACnB,OAAS,EAAA;AAAA,KACX;AAAA,IACA,yBAA2B,E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GAAA;AAAA,IACF,qBAAuB,EAAA,4BAAA;AAAA,IACvB,uBAAyB,EAAA,2CAAA;AAAA,IACzB,YAAc,EAAA,kBAAA;AAAA,IACd,gBAAkB,EAAA,oBAAA;AAAA,IAClB,gBAAkB,EAAA,oBAAA;AAAA,IAClB,cAAgB,EAAA,oBAAA;AAAA,IAChB,kBAAoB,EAAA,wBAAA;AAAA,IACpB,QAAU,EAAA,SAAA;AAAA,IACV,UAAY,EAAA,WAAA;AAAA,IACZ,SAAW,EAAA,YAAA;AAAA,IACX,kBAAoB,EAAA,0BAAA;AAAA,IACpB,0BACE,EAAA;AAAA;AAEN;AAMO,MAAM,qBAAqB,oBAAqB,CAAA;AAAA,EACrD,EAAI,EAAA,aAAA;AAAA,EACJ,QAAU,EAAA;AACZ,CAAC;;;;"}
|
package/dist/alpha.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import * as react from 'react';
|
|
3
2
|
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
4
|
-
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
5
3
|
|
|
6
4
|
/**
|
|
7
5
|
* Translation reference for RBAC plugin
|
|
@@ -22,6 +20,7 @@ declare const rbacTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
|
|
|
22
20
|
readonly "table.headers.usersAndGroups": string;
|
|
23
21
|
readonly "table.headers.accessiblePlugins": string;
|
|
24
22
|
readonly "table.headers.actions": string;
|
|
23
|
+
readonly "table.defaultRoleUsersAndGroups": string;
|
|
25
24
|
readonly "table.emptyContent": string;
|
|
26
25
|
readonly "page.title": string;
|
|
27
26
|
readonly "page.createRole": string;
|
|
@@ -48,6 +47,7 @@ declare const rbacTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
|
|
|
48
47
|
readonly "errors.fetchConditions": string;
|
|
49
48
|
readonly "errors.fetchUsersAndGroups": string;
|
|
50
49
|
readonly "errors.deleteRole": string;
|
|
50
|
+
readonly "errors.defaultRoleReadOnly": string;
|
|
51
51
|
readonly "errors.roleCreatedSuccess": string;
|
|
52
52
|
readonly "errors.roleCreatedConditionsSuccess": string;
|
|
53
53
|
readonly "roleForm.titles.createRole": string;
|
|
@@ -187,7 +187,7 @@ declare const rbacTranslations: _backstage_frontend_plugin_api.TranslationResour
|
|
|
187
187
|
* @alpha
|
|
188
188
|
*/
|
|
189
189
|
declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin<{
|
|
190
|
-
root:
|
|
190
|
+
root: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
191
191
|
}, {}, {
|
|
192
192
|
"api:rbac/licensed-users": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
193
193
|
kind: "api";
|
|
@@ -196,9 +196,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
196
196
|
configInput: {};
|
|
197
197
|
output: _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>;
|
|
198
198
|
inputs: {};
|
|
199
|
-
params: <TApi, TImpl extends TApi, TDeps extends {
|
|
200
|
-
[x: string]: unknown;
|
|
201
|
-
}>(params: _backstage_frontend_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_frontend_plugin_api.AnyApiFactory>;
|
|
199
|
+
params: <TApi, TImpl extends TApi, TDeps extends { [name in string]: unknown; }>(params: _backstage_frontend_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_frontend_plugin_api.AnyApiFactory>;
|
|
202
200
|
}>;
|
|
203
201
|
"api:rbac/rbac": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
204
202
|
kind: "api";
|
|
@@ -207,26 +205,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
207
205
|
configInput: {};
|
|
208
206
|
output: _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>;
|
|
209
207
|
inputs: {};
|
|
210
|
-
params: <TApi, TImpl extends TApi, TDeps extends {
|
|
211
|
-
[x: string]: unknown;
|
|
212
|
-
}>(params: _backstage_frontend_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_frontend_plugin_api.AnyApiFactory>;
|
|
213
|
-
}>;
|
|
214
|
-
"nav-item:rbac": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
215
|
-
kind: "nav-item";
|
|
216
|
-
name: undefined;
|
|
217
|
-
config: {};
|
|
218
|
-
configInput: {};
|
|
219
|
-
output: _backstage_frontend_plugin_api.ExtensionDataRef<{
|
|
220
|
-
title: string;
|
|
221
|
-
icon: _backstage_frontend_plugin_api.IconComponent;
|
|
222
|
-
routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
223
|
-
}, "core.nav-item.target", {}>;
|
|
224
|
-
inputs: {};
|
|
225
|
-
params: {
|
|
226
|
-
title: string;
|
|
227
|
-
icon: _backstage_frontend_plugin_api.IconComponent;
|
|
228
|
-
routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
229
|
-
};
|
|
208
|
+
params: <TApi, TImpl extends TApi, TDeps extends { [name in string]: unknown; }>(params: _backstage_frontend_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_frontend_plugin_api.AnyApiFactory>;
|
|
230
209
|
}>;
|
|
231
210
|
"page:rbac": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
232
211
|
kind: "page";
|
|
@@ -260,13 +239,12 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
260
239
|
}>;
|
|
261
240
|
};
|
|
262
241
|
params: {
|
|
263
|
-
defaultPath?: [Error: "Use the 'path' param instead"] | undefined;
|
|
264
242
|
path: string;
|
|
265
|
-
title?: string
|
|
266
|
-
icon?: _backstage_frontend_plugin_api.IconElement
|
|
267
|
-
loader?: (
|
|
268
|
-
routeRef?: _backstage_frontend_plugin_api.RouteRef
|
|
269
|
-
noHeader?: boolean
|
|
243
|
+
title?: string;
|
|
244
|
+
icon?: _backstage_frontend_plugin_api.IconElement;
|
|
245
|
+
loader?: () => Promise<react.JSX.Element>;
|
|
246
|
+
routeRef?: _backstage_frontend_plugin_api.RouteRef;
|
|
247
|
+
noHeader?: boolean;
|
|
270
248
|
};
|
|
271
249
|
}>;
|
|
272
250
|
}>;
|
package/dist/alpha.esm.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { createFrontendPlugin, createFrontendModule } from '@backstage/frontend-plugin-api';
|
|
2
2
|
import { TranslationBlueprint } from '@backstage/plugin-app-react';
|
|
3
3
|
import { rbacApi, licensedUsersApi } from './alpha/apis.esm.js';
|
|
4
|
-
import { rbacNavItem } from './alpha/navItems.esm.js';
|
|
5
4
|
import { rbacPage } from './alpha/pages.esm.js';
|
|
6
|
-
import { rootRouteRef } from './routes.esm.js';
|
|
5
|
+
import { rootRouteRef } from './alpha/routes.esm.js';
|
|
7
6
|
import { rbacTranslations } from './alpha/translations/index.esm.js';
|
|
8
7
|
export { rbacTranslationRef } from './alpha/translations/ref.esm.js';
|
|
9
8
|
|
|
10
9
|
var index = createFrontendPlugin({
|
|
11
10
|
pluginId: "rbac",
|
|
12
11
|
info: { packageJson: () => import('./package.json.esm.js') },
|
|
13
|
-
extensions: [rbacApi, licensedUsersApi, rbacPage
|
|
12
|
+
extensions: [rbacApi, licensedUsersApi, rbacPage],
|
|
14
13
|
routes: {
|
|
15
14
|
root: rootRouteRef
|
|
16
15
|
}
|
package/dist/alpha.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha/index.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createFrontendPlugin,\n createFrontendModule,\n} from '@backstage/frontend-plugin-api';\nimport { TranslationBlueprint } from '@backstage/plugin-app-react';\nimport { rbacApi, licensedUsersApi } from './apis';\nimport
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha/index.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createFrontendPlugin,\n createFrontendModule,\n} from '@backstage/frontend-plugin-api';\nimport { TranslationBlueprint } from '@backstage/plugin-app-react';\nimport { rbacApi, licensedUsersApi } from './apis';\nimport rbacPage from './pages';\nimport { rootRouteRef } from './routes';\nimport { rbacTranslations } from './translations';\n\n/**\n * RBAC plugin\n * @alpha\n */\n\nexport default createFrontendPlugin({\n pluginId: 'rbac',\n info: { packageJson: () => import('../../package.json') },\n extensions: [rbacApi, licensedUsersApi, rbacPage],\n routes: {\n root: rootRouteRef,\n },\n});\n\n/**\n * Translation module for the rbac plugin\n * @alpha\n */\n\nconst rbacTranslationsModule = createFrontendModule({\n pluginId: 'app',\n extensions: [\n TranslationBlueprint.make({\n name: 'rbac-translations',\n params: {\n resource: rbacTranslations,\n },\n }),\n ],\n});\n\nexport { rbacTranslationsModule };\n\nexport { rbacTranslationRef, rbacTranslations } from './translations';\n"],"names":[],"mappings":";;;;;;;;AA+BA,YAAe,oBAAqB,CAAA;AAAA,EAClC,QAAU,EAAA,MAAA;AAAA,EACV,MAAM,EAAE,WAAA,EAAa,MAAM,OAAO,uBAAoB,CAAE,EAAA;AAAA,EACxD,UAAY,EAAA,CAAC,OAAS,EAAA,gBAAA,EAAkB,QAAQ,CAAA;AAAA,EAChD,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA;AAAA;AAEV,CAAC,CAAA;AAOD,MAAM,yBAAyB,oBAAqB,CAAA;AAAA,EAClD,QAAU,EAAA,KAAA;AAAA,EACV,UAAY,EAAA;AAAA,IACV,qBAAqB,IAAK,CAAA;AAAA,MACxB,IAAM,EAAA,mBAAA;AAAA,MACN,MAAQ,EAAA;AAAA,QACN,QAAU,EAAA;AAAA;AACZ,KACD;AAAA;AAEL,CAAC;;;;"}
|
|
@@ -14,10 +14,7 @@ const Administration = () => {
|
|
|
14
14
|
const config = useApi(configApiRef);
|
|
15
15
|
const isRBACPluginEnabled = config.getOptionalBoolean("permission.enabled");
|
|
16
16
|
if (!isUserLoading && isRBACPluginEnabled) {
|
|
17
|
-
return result?.status === "Authorized" ? (
|
|
18
|
-
// FIXME: improve icon type in Backstage 1.49, currently the icon type is deprecated but there is no change in the SidebarItem!?
|
|
19
|
-
/* @__PURE__ */ jsx(SidebarItem, { text: "RBAC", to: "rbac", icon: RbacIcon })
|
|
20
|
-
) : null;
|
|
17
|
+
return result?.status === "Authorized" ? /* @__PURE__ */ jsx(SidebarItem, { text: "RBAC", to: "rbac", icon: RbacIcon }) : null;
|
|
21
18
|
}
|
|
22
19
|
return null;
|
|
23
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Administration.esm.js","sources":["../../src/components/Administration.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useAsync } from 'react-use';\n\nimport { SidebarItem } from '@backstage/core-components';\nimport { configApiRef, useApi } from '@backstage/core-plugin-api';\n\nimport { default as RbacIcon } from '@mui/icons-material/VpnKeyOutlined';\n\nimport { rbacApiRef } from '../api/RBACBackendClient';\n\nexport const Administration = () => {\n const rbacApi = useApi(rbacApiRef);\n const { loading: isUserLoading, value: result } = useAsync(\n async () => await rbacApi.getUserAuthorization(),\n [],\n );\n\n const config = useApi(configApiRef);\n const isRBACPluginEnabled = config.getOptionalBoolean('permission.enabled');\n\n if (!isUserLoading && isRBACPluginEnabled) {\n return result?.status === 'Authorized' ? (\n
|
|
1
|
+
{"version":3,"file":"Administration.esm.js","sources":["../../src/components/Administration.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useAsync } from 'react-use';\n\nimport { SidebarItem } from '@backstage/core-components';\nimport { configApiRef, useApi } from '@backstage/core-plugin-api';\n\nimport { default as RbacIcon } from '@mui/icons-material/VpnKeyOutlined';\n\nimport { rbacApiRef } from '../api/RBACBackendClient';\n\nexport const Administration = () => {\n const rbacApi = useApi(rbacApiRef);\n const { loading: isUserLoading, value: result } = useAsync(\n async () => await rbacApi.getUserAuthorization(),\n [],\n );\n\n const config = useApi(configApiRef);\n const isRBACPluginEnabled = config.getOptionalBoolean('permission.enabled');\n\n if (!isUserLoading && isRBACPluginEnabled) {\n return result?.status === 'Authorized' ? (\n <SidebarItem text=\"RBAC\" to=\"rbac\" icon={RbacIcon} />\n ) : null;\n }\n return null;\n};\n"],"names":[],"mappings":";;;;;;;AAwBO,MAAM,iBAAiB,MAAM;AAClC,EAAM,MAAA,OAAA,GAAU,OAAO,UAAU,CAAA;AACjC,EAAA,MAAM,EAAE,OAAA,EAAS,aAAe,EAAA,KAAA,EAAO,QAAW,GAAA,QAAA;AAAA,IAChD,YAAY,MAAM,OAAA,CAAQ,oBAAqB,EAAA;AAAA,IAC/C;AAAC,GACH;AAEA,EAAM,MAAA,MAAA,GAAS,OAAO,YAAY,CAAA;AAClC,EAAM,MAAA,mBAAA,GAAsB,MAAO,CAAA,kBAAA,CAAmB,oBAAoB,CAAA;AAE1E,EAAI,IAAA,CAAC,iBAAiB,mBAAqB,EAAA;AACzC,IAAO,OAAA,MAAA,EAAQ,MAAW,KAAA,YAAA,mBACvB,GAAA,CAAA,WAAA,EAAA,EAAY,IAAK,EAAA,MAAA,EAAO,EAAG,EAAA,MAAA,EAAO,IAAM,EAAA,QAAA,EAAU,CACjD,GAAA,IAAA;AAAA;AAEN,EAAO,OAAA,IAAA;AACT;;;;"}
|
|
@@ -44,6 +44,9 @@ const EditRolePage = () => {
|
|
|
44
44
|
if (roleError.name) {
|
|
45
45
|
return /* @__PURE__ */ jsx(ErrorPage, { status: roleError.name, statusMessage: roleError.message });
|
|
46
46
|
}
|
|
47
|
+
if (role?.metadata?.isDefault) {
|
|
48
|
+
return /* @__PURE__ */ jsx(ErrorPage, { statusMessage: t("errors.defaultRoleReadOnly") });
|
|
49
|
+
}
|
|
47
50
|
if (!canReadUsersAndGroups) {
|
|
48
51
|
return /* @__PURE__ */ jsx(ErrorPage, { statusMessage: t("errors.unauthorized") });
|
|
49
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditRolePage.esm.js","sources":["../../../src/components/CreateRole/EditRolePage.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useParams } from 'react-router-dom';\n\nimport {\n Content,\n ErrorPage,\n Header,\n Page,\n Progress,\n useQueryParamState,\n} from '@backstage/core-components';\n\nimport { usePermissionPolicies } from '../../hooks/usePermissionPolicies';\nimport { useSelectedMembers } from '../../hooks/useSelectedMembers';\nimport { RoleForm } from './RoleForm';\nimport { RoleFormValues } from './types';\nimport { capitalizeFirstLetter } from '../../utils/string-utils';\nimport { useTranslation } from '../../hooks/useTranslation';\n\nexport const EditRolePage = () => {\n const { roleName, roleNamespace, roleKind } = useParams();\n const { t } = useTranslation();\n const [queryParamState] = useQueryParamState<number>('activeStep');\n const {\n selectedMembers,\n members,\n role,\n loading: loadingMembers,\n roleError,\n membersError,\n canReadUsersAndGroups,\n } = useSelectedMembers(\n roleName ? `${roleKind}:${roleNamespace}/${roleName}` : '',\n );\n\n const { data, loading: loadingPolicies } = usePermissionPolicies(\n `${roleKind}:${roleNamespace}/${roleName}`,\n );\n\n const initialValues: RoleFormValues = {\n name: roleName || '',\n namespace: roleNamespace || 'default',\n kind: roleKind || 'role',\n description: role?.metadata?.description ?? '',\n owner: role?.metadata?.owner ?? '',\n selectedMembers,\n selectedPlugins: data\n .map(pp => pp.plugin)\n .filter((p, i, ar) => ar.indexOf(p) === i)\n .map(sp => ({\n label: capitalizeFirstLetter(sp),\n value: sp,\n })),\n permissionPoliciesRows: data,\n };\n\n if (loadingMembers || loadingPolicies) {\n return <Progress />;\n }\n if (roleError.name) {\n return (\n <ErrorPage status={roleError.name} statusMessage={roleError.message} />\n );\n }\n if (!canReadUsersAndGroups) {\n return <ErrorPage statusMessage={t('errors.unauthorized')} />;\n }\n\n return (\n <Page themeId=\"tool\">\n <Header title={t('page.editRole')} type=\"RBAC\" typeLink=\"..\" />\n <Content>\n <RoleForm\n initialValues={initialValues}\n titles={{\n formTitle: t('roleForm.titles.editRole'),\n nameAndDescriptionTitle: t('roleForm.titles.nameAndDescription'),\n usersAndGroupsTitle: t('roleForm.titles.usersAndGroups'),\n permissionPoliciesTitle: t('roleForm.titles.permissionPolicies'),\n }}\n roleName={roleName ? `${roleKind}:${roleNamespace}/${roleName}` : ''}\n step={Number(queryParamState)}\n membersData={{\n members,\n loading: loadingMembers,\n error: membersError,\n }}\n submitLabel={t('roleForm.steps.save')}\n />\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAiCO,MAAM,eAAe,MAAM;AAChC,EAAA,MAAM,EAAE,QAAA,EAAU,aAAe,EAAA,QAAA,KAAa,SAAU,EAAA;AACxD,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA;AAC7B,EAAA,MAAM,CAAC,eAAe,CAAI,GAAA,kBAAA,CAA2B,YAAY,CAAA;AACjE,EAAM,MAAA;AAAA,IACJ,eAAA;AAAA,IACA,OAAA;AAAA,IACA,IAAA;AAAA,IACA,OAAS,EAAA,cAAA;AAAA,IACT,SAAA;AAAA,IACA,YAAA;AAAA,IACA;AAAA,GACE,GAAA,kBAAA;AAAA,IACF,WAAW,CAAG,EAAA,QAAQ,IAAI,aAAa,CAAA,CAAA,EAAI,QAAQ,CAAK,CAAA,GAAA;AAAA,GAC1D;AAEA,EAAA,MAAM,EAAE,IAAA,EAAM,OAAS,EAAA,eAAA,EAAoB,GAAA,qBAAA;AAAA,IACzC,CAAG,EAAA,QAAQ,CAAI,CAAA,EAAA,aAAa,IAAI,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CAAA;AAAA,wBAC5D,OACC,EAAA,EAAA,QAAA,kBAAA,GAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,aAAA;AAAA,QACA,MAAQ,EAAA;AAAA,UACN,SAAA,EAAW,EAAE,0BAA0B,CAAA;AAAA,UACvC,uBAAA,EAAyB,EAAE,oCAAoC,CAAA;AAAA,UAC/D,mBAAA,EAAqB,EAAE,gCAAgC,CAAA;AAAA,UACvD,uBAAA,EAAyB,EAAE,oCAAoC;AAAA,SACjE;AAAA,QACA,QAAA,EAAU,WAAW,CAAG,EAAA,QAAQ,IAAI,aAAa,CAAA,CAAA,EAAI,QAAQ,CAAK,CAAA,GAAA,EAAA;AAAA,QAClE,IAAA,EAAM,OAAO,eAAe,CAAA;AAAA,QAC5B,WAAa,EAAA;AAAA,UACX,OAAA;AAAA,UACA,OAAS,EAAA,cAAA;AAAA,UACT,KAAO,EAAA;AAAA,SACT;AAAA,QACA,WAAA,EAAa,EAAE,qBAAqB;AAAA;AAAA,KAExC,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"EditRolePage.esm.js","sources":["../../../src/components/CreateRole/EditRolePage.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useParams } from 'react-router-dom';\n\nimport {\n Content,\n ErrorPage,\n Header,\n Page,\n Progress,\n useQueryParamState,\n} from '@backstage/core-components';\n\nimport { usePermissionPolicies } from '../../hooks/usePermissionPolicies';\nimport { useSelectedMembers } from '../../hooks/useSelectedMembers';\nimport { RoleForm } from './RoleForm';\nimport { RoleFormValues } from './types';\nimport { capitalizeFirstLetter } from '../../utils/string-utils';\nimport { useTranslation } from '../../hooks/useTranslation';\n\nexport const EditRolePage = () => {\n const { roleName, roleNamespace, roleKind } = useParams();\n const { t } = useTranslation();\n const [queryParamState] = useQueryParamState<number>('activeStep');\n const {\n selectedMembers,\n members,\n role,\n loading: loadingMembers,\n roleError,\n membersError,\n canReadUsersAndGroups,\n } = useSelectedMembers(\n roleName ? `${roleKind}:${roleNamespace}/${roleName}` : '',\n );\n\n const { data, loading: loadingPolicies } = usePermissionPolicies(\n `${roleKind}:${roleNamespace}/${roleName}`,\n );\n\n const initialValues: RoleFormValues = {\n name: roleName || '',\n namespace: roleNamespace || 'default',\n kind: roleKind || 'role',\n description: role?.metadata?.description ?? '',\n owner: role?.metadata?.owner ?? '',\n selectedMembers,\n selectedPlugins: data\n .map(pp => pp.plugin)\n .filter((p, i, ar) => ar.indexOf(p) === i)\n .map(sp => ({\n label: capitalizeFirstLetter(sp),\n value: sp,\n })),\n permissionPoliciesRows: data,\n };\n\n if (loadingMembers || loadingPolicies) {\n return <Progress />;\n }\n if (roleError.name) {\n return (\n <ErrorPage status={roleError.name} statusMessage={roleError.message} />\n );\n }\n if (role?.metadata?.isDefault) {\n return <ErrorPage statusMessage={t('errors.defaultRoleReadOnly')} />;\n }\n if (!canReadUsersAndGroups) {\n return <ErrorPage statusMessage={t('errors.unauthorized')} />;\n }\n\n return (\n <Page themeId=\"tool\">\n <Header title={t('page.editRole')} type=\"RBAC\" typeLink=\"..\" />\n <Content>\n <RoleForm\n initialValues={initialValues}\n titles={{\n formTitle: t('roleForm.titles.editRole'),\n nameAndDescriptionTitle: t('roleForm.titles.nameAndDescription'),\n usersAndGroupsTitle: t('roleForm.titles.usersAndGroups'),\n permissionPoliciesTitle: t('roleForm.titles.permissionPolicies'),\n }}\n roleName={roleName ? `${roleKind}:${roleNamespace}/${roleName}` : ''}\n step={Number(queryParamState)}\n membersData={{\n members,\n loading: load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,CAAG,EAAA,QAAQ,IAAI,aAAa,CAAA,CAAA,EAAI,QAAQ,CAAK,CAAA,GAAA,EAAA;AAAA,QAClE,IAAA,EAAM,OAAO,eAAe,CAAA;AAAA,QAC5B,WAAa,EAAA;AAAA,UACX,OAAA;AAAA,UACA,OAAS,EAAA,cAAA;AAAA,UACT,KAAO,EAAA;AAAA,SACT;AAAA,QACA,WAAA,EAAa,EAAE,qBAAqB;AAAA;AAAA,KAExC,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -26,7 +26,7 @@ const EditRole = ({
|
|
|
26
26
|
dataTestId,
|
|
27
27
|
fallbackTooltip: tooltip
|
|
28
28
|
});
|
|
29
|
-
return /* @__PURE__ */ jsx(Tooltip, { title: tooltipText, children: /* @__PURE__ */ jsx(
|
|
29
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: tooltipText, children: /* @__PURE__ */ jsx("span", { style: { display: "inline-flex" }, children: /* @__PURE__ */ jsx(
|
|
30
30
|
IconButton,
|
|
31
31
|
{
|
|
32
32
|
onClick: () => {
|
|
@@ -35,7 +35,6 @@ const EditRole = ({
|
|
|
35
35
|
"data-testid": testIdText,
|
|
36
36
|
"aria-label": t("common.update"),
|
|
37
37
|
disabled: disable,
|
|
38
|
-
title: tooltip ?? t("common.editRole"),
|
|
39
38
|
sx: {
|
|
40
39
|
p: 1,
|
|
41
40
|
borderRadius: "50%",
|
|
@@ -43,7 +42,7 @@ const EditRole = ({
|
|
|
43
42
|
},
|
|
44
43
|
children: /* @__PURE__ */ jsx(EditIcon, {})
|
|
45
44
|
}
|
|
46
|
-
) });
|
|
45
|
+
) }) });
|
|
47
46
|
};
|
|
48
47
|
|
|
49
48
|
export { EditRole as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditRole.esm.js","sources":["../../src/components/EditRole.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { parseEntityRef } from '@backstage/catalog-model';\n\nimport EditIcon from '@mui/icons-material/Edit';\nimport IconButton from '@mui/material/IconButton';\nimport Tooltip from '@mui/material/Tooltip';\nimport { policyEntityUpdatePermission } from '@backstage-community/plugin-rbac-common';\nimport { useNavigate } from 'react-router-dom';\nimport { useActionPermissionTooltip } from '../hooks/useActionPermissionTooltip';\nimport { useTranslation } from '../hooks/useTranslation';\n\ntype EditRoleProps = {\n roleName: string;\n canEdit: boolean;\n dataTestId?: string;\n tooltip?: string;\n to?: string;\n};\n\nconst EditRole = ({\n roleName,\n canEdit,\n dataTestId,\n tooltip,\n to,\n}: EditRoleProps) => {\n const { t } = useTranslation();\n const navigate = useNavigate();\n const { name, namespace, kind } = parseEntityRef(roleName);\n\n const { disable, tooltipText, testIdText } = useActionPermissionTooltip({\n permission: policyEntityUpdatePermission,\n resourceRef: roleName,\n canAct: canEdit,\n action: 'edit',\n dataTestId: dataTestId,\n fallbackTooltip: tooltip,\n });\n\n return (\n <Tooltip title={tooltipText}>\n <IconButton\n
|
|
1
|
+
{"version":3,"file":"EditRole.esm.js","sources":["../../src/components/EditRole.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { parseEntityRef } from '@backstage/catalog-model';\n\nimport EditIcon from '@mui/icons-material/Edit';\nimport IconButton from '@mui/material/IconButton';\nimport Tooltip from '@mui/material/Tooltip';\nimport { policyEntityUpdatePermission } from '@backstage-community/plugin-rbac-common';\nimport { useNavigate } from 'react-router-dom';\nimport { useActionPermissionTooltip } from '../hooks/useActionPermissionTooltip';\nimport { useTranslation } from '../hooks/useTranslation';\n\ntype EditRoleProps = {\n roleName: string;\n canEdit: boolean;\n dataTestId?: string;\n tooltip?: string;\n to?: string;\n};\n\nconst EditRole = ({\n roleName,\n canEdit,\n dataTestId,\n tooltip,\n to,\n}: EditRoleProps) => {\n const { t } = useTranslation();\n const navigate = useNavigate();\n const { name, namespace, kind } = parseEntityRef(roleName);\n\n const { disable, tooltipText, testIdText } = useActionPermissionTooltip({\n permission: policyEntityUpdatePermission,\n resourceRef: roleName,\n canAct: canEdit,\n action: 'edit',\n dataTestId: dataTestId,\n fallbackTooltip: tooltip,\n });\n\n return (\n <Tooltip title={tooltipText}>\n <span style={{ display: 'inline-flex' }}>\n <IconButton\n onClick={() => {\n navigate(to ?? `../role/${kind}/${namespace}/${name}`);\n }}\n data-testid={testIdText}\n aria-label={t('common.update')}\n disabled={disable}\n sx={{\n p: 1,\n borderRadius: '50%',\n '&:hover': { borderRadius: '50%' },\n }}\n >\n <EditIcon />\n </IconButton>\n </span>\n </Tooltip>\n );\n};\n\nexport default EditRole;\n"],"names":[],"mappings":";;;;;;;;;;AAiCA,MAAM,WAAW,CAAC;AAAA,EAChB,QAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAqB,KAAA;AACnB,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA;AAC7B,EAAA,MAAM,WAAW,WAAY,EAAA;AAC7B,EAAA,MAAM,EAAE,IAAM,EAAA,SAAA,EAAW,IAAK,EAAA,GAAI,eAAe,QAAQ,CAAA;AAEzD,EAAA,MAAM,EAAE,OAAA,EAAS,WAAa,EAAA,UAAA,KAAe,0BAA2B,CAAA;AAAA,IACtE,UAAY,EAAA,4BAAA;AAAA,IACZ,WAAa,EAAA,QAAA;AAAA,IACb,MAAQ,EAAA,OAAA;AAAA,IACR,MAAQ,EAAA,MAAA;AAAA,IACR,UAAA;AAAA,IACA,eAAiB,EAAA;AAAA,GAClB,CAAA;AAED,EACE,uBAAA,GAAA,CAAC,OAAQ,EAAA,EAAA,KAAA,EAAO,WACd,EAAA,QAAA,kBAAA,GAAA,CAAC,UAAK,KAAO,EAAA,EAAE,OAAS,EAAA,aAAA,EACtB,EAAA,QAAA,kBAAA,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,SAAS,MAAM;AACb,QAAA,QAAA,CAAS,MAAM,CAAW,QAAA,EAAA,IAAI,IAAI,SAAS,CAAA,CAAA,EAAI,IAAI,CAAE,CAAA,CAAA;AAAA,OACvD;AAAA,MACA,aAAa,EAAA,UAAA;AAAA,MACb,YAAA,EAAY,EAAE,eAAe,CAAA;AAAA,MAC7B,QAAU,EAAA,OAAA;AAAA,MACV,EAAI,EAAA;AAAA,QACF,CAAG,EAAA,CAAA;AAAA,QACH,YAAc,EAAA,KAAA;AAAA,QACd,SAAA,EAAW,EAAE,YAAA,EAAc,KAAM;AAAA,OACnC;AAAA,MAEA,8BAAC,QAAS,EAAA,EAAA;AAAA;AAAA,KAEd,CACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -13,7 +13,7 @@ import { getColumns } from './MembersListColumns.esm.js';
|
|
|
13
13
|
import { StyledTableWrapper } from './StyledTableWrapper.esm.js';
|
|
14
14
|
|
|
15
15
|
const getRefreshIcon = () => /* @__PURE__ */ jsx(CachedIcon, {});
|
|
16
|
-
const getEditIcon = (isAllowed, roleName) => {
|
|
16
|
+
const getEditIcon = (isAllowed, roleName, tooltip) => {
|
|
17
17
|
const { kind, name, namespace } = parseEntityRef(roleName);
|
|
18
18
|
return /* @__PURE__ */ jsx(
|
|
19
19
|
EditRole,
|
|
@@ -21,7 +21,8 @@ const getEditIcon = (isAllowed, roleName) => {
|
|
|
21
21
|
dataTestId: isAllowed ? "update-members" : "disable-update-members",
|
|
22
22
|
canEdit: isAllowed,
|
|
23
23
|
roleName,
|
|
24
|
-
to: `../../role/${kind}/${namespace}/${name}?activeStep=${1}
|
|
24
|
+
to: `../../role/${kind}/${namespace}/${name}?activeStep=${1}`,
|
|
25
|
+
tooltip
|
|
25
26
|
}
|
|
26
27
|
);
|
|
27
28
|
};
|
|
@@ -30,6 +31,7 @@ const MembersCard = ({ roleName, membersInfo }) => {
|
|
|
30
31
|
const locale = useLanguage();
|
|
31
32
|
const { data, loading, retry, error, canReadUsersAndGroups } = membersInfo;
|
|
32
33
|
const [searchText, setSearchText] = useState();
|
|
34
|
+
const editTooltip = canReadUsersAndGroups ? t("common.edit") : t("common.unauthorizedToEdit");
|
|
33
35
|
const actions = [
|
|
34
36
|
{
|
|
35
37
|
icon: getRefreshIcon,
|
|
@@ -41,8 +43,7 @@ const MembersCard = ({ roleName, membersInfo }) => {
|
|
|
41
43
|
}
|
|
42
44
|
},
|
|
43
45
|
{
|
|
44
|
-
icon: () => getEditIcon(canReadUsersAndGroups, roleName),
|
|
45
|
-
tooltip: canReadUsersAndGroups ? t("common.edit") : t("common.unauthorizedToEdit"),
|
|
46
|
+
icon: () => getEditIcon(canReadUsersAndGroups, roleName, editTooltip),
|
|
46
47
|
isFreeAction: true,
|
|
47
48
|
onClick: () => {
|
|
48
49
|
}
|
|
@@ -53,6 +54,9 @@ const MembersCard = ({ roleName, membersInfo }) => {
|
|
|
53
54
|
() => filterTableData({ data, columns, searchText, locale }),
|
|
54
55
|
[data, searchText, locale, columns]
|
|
55
56
|
);
|
|
57
|
+
if (membersInfo.isDefaultRole) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
56
60
|
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
57
61
|
!loading && error && /* @__PURE__ */ jsx(Box, { style: { paddingBottom: "16px" }, children: /* @__PURE__ */ jsx(
|
|
58
62
|
WarningPanel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MembersCard.esm.js","sources":["../../../src/components/RoleOverview/MembersCard.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState, useMemo } from 'react';\n\nimport { parseEntityRef } from '@backstage/catalog-model';\nimport { Table, WarningPanel } from '@backstage/core-components';\n\nimport CachedIcon from '@mui/icons-material/Cached';\nimport Box from '@mui/material/Box';\n\nimport { MembersInfo } from '../../hooks/useMembers';\nimport { filterTableData } from '../../utils/filter-table-data';\nimport { getMembers } from '../../utils/rbac-utils';\nimport { useTranslation } from '../../hooks/useTranslation';\nimport { useLanguage } from '../../hooks/useLanguage';\nimport EditRole from '../EditRole';\nimport { getColumns } from './MembersListColumns';\nimport { StyledTableWrapper } from './StyledTableWrapper';\n\ntype MembersCardProps = {\n roleName: string;\n membersInfo: MembersInfo;\n};\n\nconst getRefreshIcon = () => <CachedIcon />;\nconst getEditIcon = (isAllowed: boolean
|
|
1
|
+
{"version":3,"file":"MembersCard.esm.js","sources":["../../../src/components/RoleOverview/MembersCard.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState, useMemo } from 'react';\n\nimport { parseEntityRef } from '@backstage/catalog-model';\nimport { Table, WarningPanel } from '@backstage/core-components';\n\nimport CachedIcon from '@mui/icons-material/Cached';\nimport Box from '@mui/material/Box';\n\nimport { MembersInfo } from '../../hooks/useMembers';\nimport { filterTableData } from '../../utils/filter-table-data';\nimport { getMembers } from '../../utils/rbac-utils';\nimport { useTranslation } from '../../hooks/useTranslation';\nimport { useLanguage } from '../../hooks/useLanguage';\nimport EditRole from '../EditRole';\nimport { getColumns } from './MembersListColumns';\nimport { StyledTableWrapper } from './StyledTableWrapper';\n\ntype MembersCardProps = {\n roleName: string;\n membersInfo: MembersInfo;\n};\n\nconst getRefreshIcon = () => <CachedIcon />;\nconst getEditIcon = (\n isAllowed: boolean,\n roleName: string,\n tooltip?: string,\n) => {\n const { kind, name, namespace } = parseEntityRef(roleName);\n\n return (\n <EditRole\n dataTestId={isAllowed ? 'update-members' : 'disable-update-members'}\n canEdit={isAllowed}\n roleName={roleName}\n to={`../../role/${kind}/${namespace}/${name}?activeStep=${1}`}\n tooltip={tooltip}\n />\n );\n};\n\nexport const MembersCard = ({ roleName, membersInfo }: MembersCardProps) => {\n const { t } = useTranslation();\n const locale = useLanguage();\n const { data, loading, retry, error, canReadUsersAndGroups } = membersInfo;\n const [searchText, setSearchText] = useState<string>();\n\n const editTooltip = canReadUsersAndGroups\n ? t('common.edit')\n : t('common.unauthorizedToEdit');\n\n const actions = [\n {\n icon: getRefreshIcon,\n tooltip: t('common.refresh'),\n isFreeAction: true,\n onClick: () => {\n retry.roleRetry();\n retry.membersRetry();\n },\n },\n {\n icon: () => getEditIcon(canReadUsersAndGroups, roleName, editTooltip),\n isFreeAction: true,\n onClick: () => {},\n },\n ];\n const columns = useMemo(() => getColumns(t), [t]);\n const filteredData = useMemo(\n () => filterTableData({ data, columns, searchText, locale }),\n [data, searchText, locale, columns],\n );\n\n if (membersInfo.isDefaultRole) {\n return null;\n }\n\n return (\n <Box>\n {!loading && error && (\n <Box style={{ paddingBottom: '16px' }}>\n <WarningPanel\n message={(error as Error)?.message || (error as Error)?.name}\n title={t('errors.fetchUsersAndGroups')}\n severity=\"error\"\n />\n </Box>\n )}\n <StyledTableWrapper>\n <Table\n title={\n !loading && data?.length\n ? `${getMembers(filteredData, t)}`\n : t('table.headers.usersAndGroups')\n }\n actions={actions}\n options={{ padding: 'default', search: true, paging: true }}\n data={data ?? []}\n isLoading={loading}\n columns={getColumns(t)}\n emptyContent={\n <Box\n data-testid=\"members-table-empty\"\n sx={{ display: 'flex', justifyContent: 'center', p: 2 }}\n >\n {t('common.noRecordsFound')}\n </Box>\n }\n localization={{\n toolbar: { searchPlaceholder: t('table.searchPlaceholder') },\n pagination: { labelRowsSelect: t('table.labelRowsSelect') },\n }}\n onSearchChange={setSearchText}\n />\n </StyledTableWrapper>\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAqCA,MAAM,cAAA,GAAiB,sBAAM,GAAA,CAAC,UAAW,EAAA,EAAA,CAAA;AACzC,MAAM,WAAc,GAAA,CAClB,SACA,EAAA,QAAA,EACA,OACG,KAAA;AACH,EAAA,MAAM,EAAE,IAAM,EAAA,IAAA,EAAM,SAAU,EAAA,GAAI,eAAe,QAAQ,CAAA;AAEzD,EACE,uBAAA,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,UAAA,EAAY,YAAY,gBAAmB,GAAA,wBAAA;AAAA,MAC3C,OAAS,EAAA,SAAA;AAAA,MACT,QAAA;AAAA,MACA,EAAA,EAAI,cAAc,IAAI,CAAA,CAAA,EAAI,SAAS,CAAI,CAAA,EAAA,IAAI,eAAe,CAAC,CAAA,CAAA;AAAA,MAC3D;AAAA;AAAA,GACF;AAEJ,CAAA;AAEO,MAAM,WAAc,GAAA,CAAC,EAAE,QAAA,EAAU,aAAoC,KAAA;AAC1E,EAAM,MAAA,EAAE,CAAE,EAAA,GAA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stLetter } from '../../utils/string-utils.esm.js';
|
|
15
15
|
|
|
16
16
|
const getRefreshIcon = () => /* @__PURE__ */ jsx(CachedIcon, {});
|
|
17
|
-
const getEditIcon = (isAllowed, roleName) => {
|
|
17
|
+
const getEditIcon = (isAllowed, roleName, tooltip) => {
|
|
18
18
|
const { kind, name, namespace } = parseEntityRef(roleName);
|
|
19
19
|
return /* @__PURE__ */ jsx(
|
|
20
20
|
EditRole,
|
|
@@ -22,13 +22,15 @@ const getEditIcon = (isAllowed, roleName) => {
|
|
|
22
22
|
dataTestId: isAllowed ? "update-policies" : "disable-update-policies",
|
|
23
23
|
canEdit: isAllowed,
|
|
24
24
|
roleName,
|
|
25
|
-
to: `../../role/${kind}/${namespace}/${name}?activeStep=${2}
|
|
25
|
+
to: `../../role/${kind}/${namespace}/${name}?activeStep=${2}`,
|
|
26
|
+
tooltip
|
|
26
27
|
}
|
|
27
28
|
);
|
|
28
29
|
};
|
|
29
30
|
const PermissionsCard = ({
|
|
30
31
|
entityReference,
|
|
31
|
-
canReadUsersAndGroups
|
|
32
|
+
canReadUsersAndGroups,
|
|
33
|
+
isDefaultRole = false
|
|
32
34
|
}) => {
|
|
33
35
|
const { t } = useTranslation();
|
|
34
36
|
const { data, loading, retry, error } = usePermissionPolicies(entityReference);
|
|
@@ -52,6 +54,14 @@ const PermissionsCard = ({
|
|
|
52
54
|
});
|
|
53
55
|
return policies;
|
|
54
56
|
}, [data, searchText, columns, locale]);
|
|
57
|
+
let editTooltip;
|
|
58
|
+
if (isDefaultRole) {
|
|
59
|
+
editTooltip = t("errors.defaultRoleReadOnly");
|
|
60
|
+
} else if (canReadUsersAndGroups) {
|
|
61
|
+
editTooltip = t("common.edit");
|
|
62
|
+
} else {
|
|
63
|
+
editTooltip = t("common.unauthorizedToEdit");
|
|
64
|
+
}
|
|
55
65
|
const actions = [
|
|
56
66
|
{
|
|
57
67
|
icon: getRefreshIcon,
|
|
@@ -64,8 +74,11 @@ const PermissionsCard = ({
|
|
|
64
74
|
}
|
|
65
75
|
},
|
|
66
76
|
{
|
|
67
|
-
icon: () => getEditIcon(
|
|
68
|
-
|
|
77
|
+
icon: () => getEditIcon(
|
|
78
|
+
!isDefaultRole && canReadUsersAndGroups,
|
|
79
|
+
entityReference,
|
|
80
|
+
editTooltip
|
|
81
|
+
),
|
|
69
82
|
isFreeAction: true,
|
|
70
83
|
onClick: () => {
|
|
71
84
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PermissionsCard.esm.js","sources":["../../../src/components/RoleOverview/PermissionsCard.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState, useMemo } from 'react';\n\nimport { parseEntityRef } from '@backstage/catalog-model';\nimport { Table, WarningPanel } from '@backstage/core-components';\n\nimport CachedIcon from '@mui/icons-material/Cached';\nimport Box from '@mui/material/Box';\n\nimport { usePermissionPolicies } from '../../hooks/usePermissionPolicies';\nimport { filterTableData } from '../../utils/filter-table-data';\nimport EditRole from '../EditRole';\nimport { getColumns } from './PermissionsListColumns';\nimport { StyledTableWrapper } from './StyledTableWrapper';\nimport { useLanguage } from '../../hooks/useLanguage';\nimport { useTranslation } from '../../hooks/useTranslation';\nimport { capitalizeFirstLetter } from '../../utils/string-utils';\n\ntype PermissionsCardProps = {\n entityReference: string;\n canReadUsersAndGroups: boolean;\n};\n\nconst getRefreshIcon = () => <CachedIcon />;\nconst getEditIcon = (isAllowed: boolean
|
|
1
|
+
{"version":3,"file":"PermissionsCard.esm.js","sources":["../../../src/components/RoleOverview/PermissionsCard.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useState, useMemo } from 'react';\n\nimport { parseEntityRef } from '@backstage/catalog-model';\nimport { Table, WarningPanel } from '@backstage/core-components';\n\nimport CachedIcon from '@mui/icons-material/Cached';\nimport Box from '@mui/material/Box';\n\nimport { usePermissionPolicies } from '../../hooks/usePermissionPolicies';\nimport { filterTableData } from '../../utils/filter-table-data';\nimport EditRole from '../EditRole';\nimport { getColumns } from './PermissionsListColumns';\nimport { StyledTableWrapper } from './StyledTableWrapper';\nimport { useLanguage } from '../../hooks/useLanguage';\nimport { useTranslation } from '../../hooks/useTranslation';\nimport { capitalizeFirstLetter } from '../../utils/string-utils';\n\ntype PermissionsCardProps = {\n entityReference: string;\n canReadUsersAndGroups: boolean;\n /** When true, the role is read-only (default role). */\n isDefaultRole?: boolean;\n};\n\nconst getRefreshIcon = () => <CachedIcon />;\nconst getEditIcon = (\n isAllowed: boolean,\n roleName: string,\n tooltip?: string,\n) => {\n const { kind, name, namespace } = parseEntityRef(roleName);\n\n return (\n <EditRole\n dataTestId={isAllowed ? 'update-policies' : 'disable-update-policies'}\n canEdit={isAllowed}\n roleName={roleName}\n to={`../../role/${kind}/${namespace}/${name}?activeStep=${2}`}\n tooltip={tooltip}\n />\n );\n};\n\nexport const PermissionsCard = ({\n entityReference,\n canReadUsersAndGroups,\n isDefaultRole = false,\n}: PermissionsCardProps) => {\n const { t } = useTranslation();\n const { data, loading, retry, error } =\n usePermissionPolicies(entityReference);\n const locale = useLanguage();\n const [searchText, setSearchText] = useState<string>();\n\n const columns = useMemo(() => getColumns(t), [t]);\n\n const numberOfPolicies = useMemo(() => {\n const filteredPermissions = filterTableData({\n data,\n columns,\n searchText,\n locale,\n });\n let policies = 0;\n filteredPermissions.forEach(p => {\n if (p.conditions) {\n policies++;\n return;\n }\n policies += p.policies.filter(pol => pol.effect === 'allow').length;\n });\n return policies;\n }, [data, searchText, columns, locale]);\n\n let editTooltip: string;\n\n if (isDefaultRole) {\n editTooltip = t('errors.defaultRoleReadOnly');\n } else if (canReadUsersAndGroups) {\n editTooltip = t('common.edit');\n } else {\n editTooltip = t('common.unauthorizedToEdit');\n }\n\n const actions = [\n {\n icon: getRefreshIcon,\n tooltip: t('common.refresh'),\n isFreeAction: true,\n onClick: () => {\n retry.permissionPoliciesRetry();\n retry.policiesRetry();\n retry.conditionalPoliciesRetry();\n },\n },\n {\n icon: () =>\n getEditIcon(\n !isDefaultRole && canReadUsersAndGroups,\n entityReference,\n editTooltip,\n ),\n isFreeAction: true,\n onClick: () => {},\n },\n ];\n\n let title = t('permissionPolicies.permissionPolicies');\n if (!loading && data.length > 0) {\n title = capitalizeFirstLetter(\n `${numberOfPolicies} ${numberOfPolicies !== 1 ? t('permissionPolicies.permissions') : t('permissionPolicies.permission')}`,\n );\n }\n\n return (\n <Box>\n {error?.name && error.name !== 404 && (\n <Box style={{ paddingBottom: '16px' }}>\n <WarningPanel\n message={error?.message}\n title={t('errors.fetchPolicies')}\n severity=\"error\"\n />\n </Box>\n )}\n <StyledTableWrapper>\n <Table\n title={title}\n actions={actions}\n options={{ padding: 'default', search: true, paging: true }}\n data={data}\n columns={columns}\n isLoading={loading}\n emptyContent={\n <Box\n data-testid=\"permission-table-empty\"\n sx={{ display: 'flex', justifyContent: 'center', p: 2 }}\n >\n {t('common.noRecordsFound')}\n </Box>\n }\n onSearchChange={setSearchText}\n localization={{\n toolbar: { searchPlaceholder: t('table.searchPlaceholder') },\n pagination: { labelRowsSelect: t('table.labelRowsSelect') },\n }}\n />\n </StyledTableWrapper>\n </Box>\n );\n};\n"],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AAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -56,7 +56,8 @@ const RoleOverviewPage = () => {
|
|
|
56
56
|
PermissionsCard,
|
|
57
57
|
{
|
|
58
58
|
entityReference: `${roleKind}:${roleNamespace}/${roleName}`,
|
|
59
|
-
canReadUsersAndGroups: membersInfo.canReadUsersAndGroups
|
|
59
|
+
canReadUsersAndGroups: membersInfo.canReadUsersAndGroups,
|
|
60
|
+
isDefaultRole: membersInfo.isDefaultRole
|
|
60
61
|
}
|
|
61
62
|
) })
|
|
62
63
|
] }) }) })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoleOverviewPage.esm.js","sources":["../../../src/components/RoleOverview/RoleOverviewPage.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useParams } from 'react-router-dom';\n\nimport { Header, Page, TabbedLayout } from '@backstage/core-components';\n\nimport Grid from '@mui/material/Grid';\n\nimport { useLocationToast } from '../../hooks/useLocationToast';\nimport { useMembers } from '../../hooks/useMembers';\nimport { SnackbarAlert } from '../SnackbarAlert';\nimport { useToast } from '../ToastContext';\nimport { AboutCard } from './AboutCard';\nimport { MembersCard } from './MembersCard';\nimport { PermissionsCard } from './PermissionsCard';\nimport { useTranslation } from '../../hooks/useTranslation';\nimport { RequirePermission } from '@backstage/plugin-permission-react';\nimport { policyEntityReadPermission } from '@backstage-community/plugin-rbac-common';\n\nexport const RoleOverviewPage = () => {\n const { t } = useTranslation();\n const { roleName, roleNamespace, roleKind } = useParams();\n const { toastMessage, setToastMessage } = useToast();\n const membersInfo = useMembers(`${roleKind}:${roleNamespace}/${roleName}`);\n\n useLocationToast(setToastMessage);\n\n const onAlertClose = () => {\n setToastMessage('');\n };\n\n return (\n <RequirePermission\n permission={policyEntityReadPermission}\n resourceRef={`${roleKind}:${roleNamespace}/${roleName}`}\n >\n <SnackbarAlert toastMessage={toastMessage} onAlertClose={onAlertClose} />\n <Page themeId=\"tool\">\n <Header\n title={`${roleKind}:${roleNamespace}/${roleName}`}\n type=\"RBAC\"\n typeLink=\"..\"\n />\n <TabbedLayout>\n <TabbedLayout.Route path=\"\" title={t('common.overview')}>\n <Grid container direction=\"row\" spacing={2}>\n <Grid item lg={12} xs={12}>\n <AboutCard\n roleName={`${roleKind}:${roleNamespace}/${roleName}`}\n />\n </Grid>\n <Grid item lg={6} xs={12}>\n <MembersCard\n roleName={`${roleKind}:${roleNamespace}/${roleName}`}\n membersInfo={membersInfo}\n />\n </Grid>\n <Grid item lg={6} xs={12}>\n <PermissionsCard\n entityReference={`${roleKind}:${roleNamespace}/${roleName}`}\n canReadUsersAndGroups={membersInfo.canReadUsersAndGroups}\n />\n </Grid>\n </Grid>\n </TabbedLayout.Route>\n </TabbedLayout>\n </Page>\n </RequirePermission>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAgCO,MAAM,mBAAmB,MAAM;AACpC,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA;AAC7B,EAAA,MAAM,EAAE,QAAA,EAAU,aAAe,EAAA,QAAA,KAAa,SAAU,EAAA;AACxD,EAAA,MAAM,EAAE,YAAA,EAAc,eAAgB,EAAA,GAAI,QAAS,EAAA;AACnD,EAAM,MAAA,WAAA,GAAc,WAAW,CAAG,EAAA,QAAQ,IAAI,aAAa,CAAA,CAAA,EAAI,QAAQ,CAAE,CAAA,CAAA;AAEzE,EAAA,gBAAA,CAAiB,eAAe,CAAA;AAEhC,EAAA,MAAM,eAAe,MAAM;AACzB,IAAA,eAAA,CAAgB,EAAE,CAAA;AAAA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I,CAAA,EAAA,aAAa,IAAI,QAAQ,CAAA,CAAA;AAAA,gBAClD;AAAA;AAAA,aAEJ,EAAA,CAAA;AAAA,gCACC,IAAK,EAAA,EAAA,IAAA,EAAI,MAAC,EAAI,EAAA,CAAA,EAAG,IAAI,EACpB,EAAA,QAAA,kBAAA,GAAA;AAAA,cAAC,eAAA;AAAA,cAAA;AAAA,gBACC,iBAAiB,CAAG,EAAA,QAAQ,CAAI,CAAA,EAAA,aAAa,IAAI,QAAQ,CAAA,CAAA;AAAA,gBACzD,uBAAuB,WAAY,CAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"RoleOverviewPage.esm.js","sources":["../../../src/components/RoleOverview/RoleOverviewPage.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useParams } from 'react-router-dom';\n\nimport { Header, Page, TabbedLayout } from '@backstage/core-components';\n\nimport Grid from '@mui/material/Grid';\n\nimport { useLocationToast } from '../../hooks/useLocationToast';\nimport { useMembers } from '../../hooks/useMembers';\nimport { SnackbarAlert } from '../SnackbarAlert';\nimport { useToast } from '../ToastContext';\nimport { AboutCard } from './AboutCard';\nimport { MembersCard } from './MembersCard';\nimport { PermissionsCard } from './PermissionsCard';\nimport { useTranslation } from '../../hooks/useTranslation';\nimport { RequirePermission } from '@backstage/plugin-permission-react';\nimport { policyEntityReadPermission } from '@backstage-community/plugin-rbac-common';\n\nexport const RoleOverviewPage = () => {\n const { t } = useTranslation();\n const { roleName, roleNamespace, roleKind } = useParams();\n const { toastMessage, setToastMessage } = useToast();\n const membersInfo = useMembers(`${roleKind}:${roleNamespace}/${roleName}`);\n\n useLocationToast(setToastMessage);\n\n const onAlertClose = () => {\n setToastMessage('');\n };\n\n return (\n <RequirePermission\n permission={policyEntityReadPermission}\n resourceRef={`${roleKind}:${roleNamespace}/${roleName}`}\n >\n <SnackbarAlert toastMessage={toastMessage} onAlertClose={onAlertClose} />\n <Page themeId=\"tool\">\n <Header\n title={`${roleKind}:${roleNamespace}/${roleName}`}\n type=\"RBAC\"\n typeLink=\"..\"\n />\n <TabbedLayout>\n <TabbedLayout.Route path=\"\" title={t('common.overview')}>\n <Grid container direction=\"row\" spacing={2}>\n <Grid item lg={12} xs={12}>\n <AboutCard\n roleName={`${roleKind}:${roleNamespace}/${roleName}`}\n />\n </Grid>\n <Grid item lg={6} xs={12}>\n <MembersCard\n roleName={`${roleKind}:${roleNamespace}/${roleName}`}\n membersInfo={membersInfo}\n />\n </Grid>\n <Grid item lg={6} xs={12}>\n <PermissionsCard\n entityReference={`${roleKind}:${roleNamespace}/${roleName}`}\n canReadUsersAndGroups={membersInfo.canReadUsersAndGroups}\n isDefaultRole={membersInfo.isDefaultRole}\n />\n </Grid>\n </Grid>\n </TabbedLayout.Route>\n </TabbedLayout>\n </Page>\n </RequirePermission>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAgCO,MAAM,mBAAmB,MAAM;AACpC,EAAM,MAAA,EAAE,CAAE,EAAA,GAAI,cAAe,EAAA;AAC7B,EAAA,MAAM,EAAE,QAAA,EAAU,aAAe,EAAA,QAAA,KAAa,SAAU,EAAA;AACxD,EAAA,MAAM,EAAE,YAAA,EAAc,eAAgB,EAAA,GAAI,QAAS,EAAA;AACnD,EAAM,MAAA,WAAA,GAAc,WAAW,CAAG,EAAA,QAAQ,IAAI,aAAa,CAAA,CAAA,EAAI,QAAQ,CAAE,CAAA,CAAA;AAEzE,EAAA,gBAAA,CAAiB,eAAe,CAAA;AAEhC,EAAA,MAAM,eAAe,MAAM;AACzB,IAAA,eAAA,CAA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AG,EAAA,QAAQ,CAAI,CAAA,EAAA,aAAa,IAAI,QAAQ,CAAA,CAAA;AAAA,gBAClD;AAAA;AAAA,aAEJ,EAAA,CAAA;AAAA,gCACC,IAAK,EAAA,EAAA,IAAA,EAAI,MAAC,EAAI,EAAA,CAAA,EAAG,IAAI,EACpB,EAAA,QAAA,kBAAA,GAAA;AAAA,cAAC,eAAA;AAAA,cAAA;AAAA,gBACC,iBAAiB,CAAG,EAAA,QAAQ,CAAI,CAAA,EAAA,aAAa,IAAI,QAAQ,CAAA,CAAA;AAAA,gBACzD,uBAAuB,WAAY,CAAA,qBAAA;AAAA,gBACnC,eAAe,WAAY,CAAA;AAAA;AAAA,aAE/B,EAAA;AAAA,WAAA,EACF,GACF,CACF,EAAA;AAAA,SACF,EAAA;AAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -27,14 +27,13 @@ const DeleteRole = ({
|
|
|
27
27
|
dataTestId,
|
|
28
28
|
fallbackTooltip: tooltip
|
|
29
29
|
});
|
|
30
|
-
return /* @__PURE__ */ jsx(Tooltip, { title: tooltipText, children: /* @__PURE__ */ jsx(
|
|
30
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: tooltipText, children: /* @__PURE__ */ jsx("span", { style: { display: "inline-flex" }, children: /* @__PURE__ */ jsx(
|
|
31
31
|
IconButton,
|
|
32
32
|
{
|
|
33
33
|
onClick: () => openDialog(roleName),
|
|
34
34
|
"data-testid": testIdText,
|
|
35
35
|
"aria-label": t("common.delete"),
|
|
36
36
|
disabled: disable,
|
|
37
|
-
title: tooltip ?? t("common.deleteRole"),
|
|
38
37
|
sx: {
|
|
39
38
|
p: 1,
|
|
40
39
|
borderRadius: "50%",
|
|
@@ -42,7 +41,7 @@ const DeleteRole = ({
|
|
|
42
41
|
},
|
|
43
42
|
children: /* @__PURE__ */ jsx(Delete, {})
|
|
44
43
|
}
|
|
45
|
-
) });
|
|
44
|
+
) }) });
|
|
46
45
|
};
|
|
47
46
|
|
|
48
47
|
export { DeleteRole as default };
|