Commit f006fea3 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch '284399-vue_group_members_list-feature-flag-cleanup' into 'master'

Remove `vue_group_members_list` feature flag

See merge request gitlab-org/gitlab!49612
parents 33468656 dc6b7f1e
......@@ -364,7 +364,6 @@ linters:
- 'ee/app/views/shared/issuable/_board_create_list_dropdown.html.haml'
- 'ee/app/views/shared/issuable/_filter_weight.html.haml'
- 'ee/app/views/shared/members/ee/_ldap_tag.html.haml'
- 'ee/app/views/shared/members/ee/_override_member_buttons.html.haml'
- 'ee/app/views/shared/members/ee/_sso_badge.html.haml'
- 'ee/app/views/shared/milestones/_burndown.html.haml'
- 'ee/app/views/shared/milestones/_weight.html.haml'
......
import Vue from 'vue';
import Members from 'ee_else_ce/members';
import memberExpirationDate from '~/member_expiration_date';
import UsersSelect from '~/users_select';
import groupsSelect from '~/groups_select';
......@@ -66,5 +65,4 @@ memberExpirationDate();
memberExpirationDate('.js-access-expiration-date-groups');
mountRemoveMemberModal();
new Members(); // eslint-disable-line no-new
new UsersSelect(); // eslint-disable-line no-new
import Vue from 'vue';
import Members from 'ee_else_ce/members';
import Members from '~/members';
import memberExpirationDate from '~/member_expiration_date';
import UsersSelect from '~/users_select';
import groupsSelect from '~/groups_select';
......
......@@ -3,10 +3,7 @@
- show_invited_members = can_manage_members && @invited_members.exists?
- show_access_requests = can_manage_members && @requesters.exists?
- invited_active = params[:search_invited].present? || params[:invited_members_page].present?
- vue_members_list_enabled = Feature.enabled?(:vue_group_members_list, @group, default_enabled: true)
- filtered_search_enabled = Feature.enabled?(:group_members_filtered_search, @group, default_enabled: true)
- current_user_is_group_owner = @group && @group.has_owner?(current_user)
- form_item_label_css_class = 'label-bold gl-mr-2 gl-mb-0 gl-py-2 align-self-md-center'
.js-remove-member-modal
......@@ -70,17 +67,9 @@
= render 'groups/group_members/tab_pane/form_item' do
= label_tag :sort_by, _('Sort by'), class: form_item_label_css_class
= render 'shared/members/sort_dropdown'
- if vue_members_list_enabled
.js-group-members-list{ data: group_members_list_data_attributes(@group, @members) }
.loading
.spinner.spinner-md
- else
%ul.content-list.members-list{ data: { qa_selector: 'members_list' } }
= render partial: 'shared/members/member',
collection: @members, as: :member,
locals: { membership_source: @group,
group: @group,
current_user_is_group_owner: current_user_is_group_owner }
= paginate @members, theme: 'gitlab', params: { invited_members_page: nil, search_invited: nil }
- if @group.shared_with_group_links.any?
#tab-groups.tab-pane
......@@ -89,14 +78,9 @@
= render 'groups/group_members/tab_pane/header' do
= render 'groups/group_members/tab_pane/title' do
= html_escape(_('Groups with access to %{strong_start}%{group_name}%{strong_end}')) % { group_name: @group.name, strong_start: '<strong>'.html_safe, strong_end: '</strong>'.html_safe }
- if vue_members_list_enabled
.js-group-linked-list{ data: linked_groups_list_data_attributes(@group) }
.loading
.spinner.spinner-md
- else
%ul.content-list.members-list{ data: { qa_selector: 'groups_list' } }
- @group.shared_with_group_links.each do |group_link|
= render 'shared/members/group', group_link: group_link, can_admin_member: can_manage_members, group_link_path: group_group_link_path(@group, group_link)
- if show_invited_members
#tab-invited-members.tab-pane{ class: ('active' if invited_active) }
.card.card-without-border
......@@ -106,17 +90,9 @@
= html_escape(_('Members invited to %{strong_start}%{group_name}%{strong_end}')) % { group_name: @group.name, strong_start: '<strong>'.html_safe, strong_end: '</strong>'.html_safe }
= form_tag group_group_members_path(@group), method: :get, class: 'user-search-form', data: { testid: 'user-search-form' } do
= render 'shared/members/search_field', name: 'search_invited'
- if vue_members_list_enabled
.js-group-invited-members-list{ data: group_members_list_data_attributes(@group, @invited_members) }
.loading
.spinner.spinner-md
- else
%ul.content-list.members-list
= render partial: 'shared/members/member',
collection: @invited_members, as: :member,
locals: { membership_source: @group,
group: @group,
current_user_is_group_owner: current_user_is_group_owner }
= paginate @invited_members, param_name: 'invited_members_page', theme: 'gitlab', params: { page: nil }
- if show_access_requests
#tab-access-requests.tab-pane
......@@ -125,14 +101,6 @@
= render 'groups/group_members/tab_pane/header' do
= render 'groups/group_members/tab_pane/title' do
= html_escape(_('Users requesting access to %{strong_start}%{group_name}%{strong_end}')) % { group_name: @group.name, strong_start: '<strong>'.html_safe, strong_end: '</strong>'.html_safe }
- if vue_members_list_enabled
.js-group-access-requests-list{ data: group_members_list_data_attributes(@group, @requesters) }
.loading
.spinner.spinner-md
- else
%ul.content-list.members-list
= render partial: 'shared/members/member',
collection: @requesters, as: :member,
locals: { membership_source: @group,
group: @group,
current_user_is_group_owner: current_user_is_group_owner }
......@@ -127,8 +127,5 @@
= _("Delete")
- unless force_mobile_view
= sprite_icon('remove', css_class: 'd-none d-sm-block gl-icon')
= render_if_exists 'shared/members/ee/override_member_buttons', group: group, member: member, user: user, action: :edit, can_override: member.can_override?
- else
%span.member-access-text.user-access-role= member.human_access
= render_if_exists 'shared/members/ee/override_member_buttons', group: group, member: member, user: user, action: :confirm, can_override: member.can_override?
---
name: vue_group_members_list
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/40548
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/241194
milestone: '13.4'
type: development
group: group::access
default_enabled: true
import $ from 'jquery';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import { __ } from '~/locale';
import axios from '~/lib/utils/axios_utils';
import Members from '~/members';
export default class MembersEE extends Members {
addListeners() {
super.addListeners();
// eslint-disable-next-line @gitlab/no-global-event-off
$('.js-ldap-permissions').off('click').on('click', this.showLDAPPermissionsWarning.bind(this));
// eslint-disable-next-line @gitlab/no-global-event-off
$('.js-ldap-override').off('click').on('click', this.toggleMemberAccessToggle.bind(this));
}
dropdownClicked(options) {
options.e.preventDefault();
const $link = options.$el;
if (!$link.data('revert')) {
this.formSubmit(null, $link);
} else {
const { $memberListItem, $toggle, $dateInput } = this.getMemberListItems($link);
$toggle.disable();
$dateInput.disable();
MembersEE.overrideLdap($memberListItem, $link.data('endpoint'), false).catch(() => {
$toggle.enable();
$dateInput.enable();
});
}
}
dropdownToggleLabel(selected, $el, $btn) {
if ($el.data('revert')) {
return $btn.text();
}
return super.dropdownToggleLabel(selected, $el, $btn);
}
dropdownIsSelectable(selected, $el) {
if ($el.data('revert')) {
return false;
}
return super.dropdownIsSelectable(selected, $el);
}
showLDAPPermissionsWarning(e) {
const $btn = $(e.currentTarget);
const { $memberListItem } = this.getMemberListItems($btn);
const $ldapPermissionsElement = $memberListItem.next();
$ldapPermissionsElement.toggle();
}
toggleMemberAccessToggle(e) {
const $btn = $(e.currentTarget);
const { $memberListItem, $toggle, $dateInput } = this.getMemberListItems($btn);
$btn.disable();
MembersEE.overrideLdap($memberListItem, $btn.data('endpoint'), true)
.then(() => {
this.showLDAPPermissionsWarning(e);
$toggle.enable();
$dateInput.enable();
})
.catch((xhr) => {
$btn.enable();
if (xhr.status === 403) {
createFlash(
__(
'You do not have the correct permissions to override the settings from the LDAP group sync.',
),
);
} else {
createFlash(__('An error occurred while saving LDAP override status. Please try again.'));
}
});
}
static overrideLdap($memberListitem, endpoint, override) {
return axios
.patch(endpoint, {
group_member: {
override,
},
})
.then(() => {
$memberListitem.toggleClass('is-overridden', override);
});
}
}
- group = local_assigns.fetch(:group)
- member = local_assigns.fetch(:member)
- user = local_assigns.fetch(:user)
- action = local_assigns.fetch(:action, :edit).to_s.inquiry
- can_override = local_assigns.fetch(:can_override, false)
- if group && can_override
- if action.edit?
%button.btn.btn-default.btn-ldap-override.js-ldap-permissions{ type: 'button',
'aria-label' => 'Edit permissions',
class: 'btn align-self-center m-0 ml-sm-2',
data: { name: user.name, el_id: dom_id(member) } }
%span.d-block.d-md-none
Edit permissions
= sprite_icon('pencil', css_class: 'd-none d-md-inline-block')
- else
%li.alert.alert-member-ldap{ style: 'display: none;' }
%p
= user.name
is currently an LDAP user. Editing their permissions will override the settings from the LDAP group sync.
.controls
%button.btn.btn-warning.btn-loading.js-ldap-override{ type: 'button',
'aria-label' => 'Change LDAP member permissions',
data: { el_id: dom_id(member), endpoint: override_group_group_member_path(group, member) } }
.spinner.mr-1
Change permissions
%button.btn.btn-default.btn-icon.gl-button.js-ldap-permissions{ type: 'button',
'aria-label' => 'Close permissions override',
data: { el_id: dom_id(member) } }
= sprite_icon('close', size: 16, css_class: 'gl-icon gl-text-black-normal!')
......@@ -3312,9 +3312,6 @@ msgstr ""
msgid "An error occurred while retrieving projects."
msgstr ""
msgid "An error occurred while saving LDAP override status. Please try again."
msgstr ""
msgid "An error occurred while saving assignees"
msgstr ""
......@@ -32008,9 +32005,6 @@ msgstr ""
msgid "You do not have permissions to run the import."
msgstr ""
msgid "You do not have the correct permissions to override the settings from the LDAP group sync."
msgstr ""
msgid "You don't have any U2F devices registered yet."
msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment