Skip to content

Migrate user_action_dropdown.vue to GlDisclosureDropdown

What does this MR do and why?

Migrate user_action_dropdown.vue to GlDisclosureDropdown

Migrate GlDropdown on user_action_dropdown.vue to GlDisclosureDropdown

Changelog: changed EE: true

Screenshots or screen recordings

Before After
image image

How to set up and validate locally

  1. Open any group page and go to Manager > Members (e.g. /groups/flightjs/-/group_members)
  2. Apply this patch to show all options (basically remove all v-if):
Index: app/assets/javascripts/members/components/action_dropdowns/user_action_dropdown.vue
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/app/assets/javascripts/members/components/action_dropdowns/user_action_dropdown.vue b/app/assets/javascripts/members/components/action_dropdowns/user_action_dropdown.vue
--- a/app/assets/javascripts/members/components/action_dropdowns/user_action_dropdown.vue	(revision 1ef094b09df3ae7cb5c40ebef869378fbbd15afd)
+++ b/app/assets/javascripts/members/components/action_dropdowns/user_action_dropdown.vue	(date 1686389445507)
@@ -112,20 +112,18 @@
     data-qa-selector="user_action_dropdown"
   >
     <disable-two-factor-dropdown-item
-      v-if="permissions.canDisableTwoFactor"
       :modal-message="modalDisableTwoFactor"
       :user-id="member.user.id"
     >
       {{ $options.i18n.disableTwoFactor }}
     </disable-two-factor-dropdown-item>
 
-    <template v-if="showLeaveOrRemove">
-      <leave-group-dropdown-item v-if="isCurrentUser" :member="member" :permissions="permissions">{{
+    <template>
+      <leave-group-dropdown-item :member="member" :permissions="permissions">{{
         $options.i18n.leaveGroup
       }}</leave-group-dropdown-item>
 
       <remove-member-dropdown-item
-        v-else
         :member-id="member.id"
         :member-model-type="member.type"
         :user-deletion-obstacles="userDeletionObstaclesUserData"
@@ -136,10 +134,10 @@
       </remove-member-dropdown-item>
     </template>
 
-    <ldap-override-dropdown-item v-else-if="showLdapOverride" :member="member">
+    <ldap-override-dropdown-item :member="member">
       {{ $options.i18n.editPermissions }}
     </ldap-override-dropdown-item>
-    <ban-member-dropdown-item v-if="showBan" :member="member">
+    <ban-member-dropdown-item :member="member">
       {{ $options.i18n.banMember }}
     </ban-member-dropdown-item>
   </gl-disclosure-dropdown>

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #413467 (closed)

Merge request reports

Loading