Skip to content

Add description column for custom roles

What does this MR do and why?

On the Settings -> Roles and Permissions page, we have an old version of the page (on production) and a new version (in development):

Old page New page
ksnip_20240321-144647 ksnip_20240321-144731

This MR does the following:

  1. On the old page, the description column was added, to match the columns on the new page.
  2. On both pages, when there is no description, No description is shown instead of nothing.

Old page:

Before After
ksnip_20240321-145001 ksnip_20240321-144948

New page:

Before After
ksnip_20240321-144848 ksnip_20240321-144902

How to set up and validate locally

  1. Go to any top level group, Settings -> Roles and Permissions.
  2. Click on Add new role on the upper right. Fill out the form to create a role. Fill out the description.
  3. Create another row, this time with no description.
  4. Verify that in the table, the description shows for the first created role, and No description shows for the second created role.
  5. Apply this patch to switch to the new version of the page:
Patch
Index: ee/app/assets/javascripts/pages/admin/application_settings/roles_and_permissions/index.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/ee/app/assets/javascripts/pages/admin/application_settings/roles_and_permissions/index.js b/ee/app/assets/javascripts/pages/admin/application_settings/roles_and_permissions/index.js
--- a/ee/app/assets/javascripts/pages/admin/application_settings/roles_and_permissions/index.js	(revision b075421643ab545cfee6ed1c20d3a71f309bb6a8)
+++ b/ee/app/assets/javascripts/pages/admin/application_settings/roles_and_permissions/index.js	(date 1710884444267)
@@ -1,3 +1,4 @@
-import { initRolesAndPermissions } from 'ee/roles_and_permissions';
+import { initRolesAndPermissions, initCustomRolesApp } from 'ee/roles_and_permissions';
 
-initRolesAndPermissions();
+initCustomRolesApp();
+// initRolesAndPermissions();
Index: ee/app/assets/javascripts/pages/groups/settings/roles_and_permissions/index.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/ee/app/assets/javascripts/pages/groups/settings/roles_and_permissions/index.js b/ee/app/assets/javascripts/pages/groups/settings/roles_and_permissions/index.js
--- a/ee/app/assets/javascripts/pages/groups/settings/roles_and_permissions/index.js	(revision b075421643ab545cfee6ed1c20d3a71f309bb6a8)
+++ b/ee/app/assets/javascripts/pages/groups/settings/roles_and_permissions/index.js	(date 1710884444283)
@@ -1,3 +1,4 @@
-import { initRolesAndPermissions } from 'ee/roles_and_permissions';
+import { initRolesAndPermissions, initCustomRolesApp } from 'ee/roles_and_permissions';
 
-initRolesAndPermissions();
+initCustomRolesApp();
+// initRolesAndPermissions();
  1. Verify that the description column shows the correct text as in step 4.

Related to #451024 (closed)

Edited by Daniel Tian

Merge request reports