Change button text from "Create/add new role" to "New role"
What does this MR do and why?
On the Settings -> Roles and Permissions page, there is a Create new role button.
As per !147237 (diffs), we should drop the word new and switch all places that use the word Add to use the word Create, since we're creating a new item instead of adding an existing one. This MR changes the text in all places that it's used.
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
There are 4 places to test.
Empty roles page, old version
- Go to a top-level group that doesn't have any custom roles, or delete all custom roles for the group.
- Go to
Settings->Roles and Permissions. - Verify that the description text for the empty state and the button on the upper right both say
New role:
![]() |
Roles and Permissions page, old version
- On the
Roles and Permissionspage, click onNew roleto bring up the create role form. - Verify that the blue submit button at the bottom says
Create role. - Fill out the form and create a new role.
- Verify that the table view is shown, and that the button on the upper right says
Create role.
Empty roles page, new version
Apply this patch:
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();
- Go to a top-level group that doesn't have any custom roles, or delete all custom roles for the group.
- Verify that the blue button in the empty state says
New role.
Roles and Permissions page, new version
- Go to a top-level group that has custom roles.
- Verify that the button on the upper right says
New role.
Related to #451170 (closed)
Edited by Daniel Tian


