Skip to content

Change button text from "Create/add new role" to "New role"

Daniel Tian requested to merge 451170-change-create-new-role-to-create-role into master

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
ksnip_20240320-163610 ksnip_20240320-164845

How to set up and validate locally

There are 4 places to test.

Empty roles page, old version

  1. Go to a top-level group that doesn't have any custom roles, or delete all custom roles for the group.
  2. Go to Settings -> Roles and Permissions.
  3. Verify that the description text for the empty state and the button on the upper right both say New role:
ksnip_20240320-165306

Roles and Permissions page, old version

  1. On the Roles and Permissions page, click on New role to bring up the create role form.
  2. Verify that the blue submit button at the bottom says Create role.
  3. Fill out the form and create a new role.
  4. 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();
  1. Go to a top-level group that doesn't have any custom roles, or delete all custom roles for the group.
  2. Verify that the blue button in the empty state says New role.

Roles and Permissions page, new version

  1. Go to a top-level group that has custom roles.
  2. Verify that the button on the upper right says New role.

Related to #451170 (closed)

Edited by Daniel Tian

Merge request reports

Loading