diff options
author | Stan Hu <stanhu@gmail.com> | 2019-06-02 08:19:22 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-06-02 08:19:22 +0300 |
commit | 5aa08c6938f88077e6be08f1a76b66121d660af7 (patch) | |
tree | e13df16bccfdd0d1903105d8ba9a0dc94827c74c | |
parent | 2ad5b30b6c02a3e3f84275121a709f5de75dac48 (diff) |
Reconcile CE and EE differences in members/_member.html.haml
This file conflicts quite frequently with any changes in the file.
-rw-r--r-- | app/presenters/member_presenter.rb | 5 | ||||
-rw-r--r-- | app/views/shared/members/_member.html.haml | 13 |
2 files changed, 17 insertions, 1 deletions
diff --git a/app/presenters/member_presenter.rb b/app/presenters/member_presenter.rb index 9e9b6973b8e..2561c3f0244 100644 --- a/app/presenters/member_presenter.rb +++ b/app/presenters/member_presenter.rb @@ -32,6 +32,11 @@ class MemberPresenter < Gitlab::View::Presenter::Delegated request? && can_update? end + # This functionality is only available in EE. + def can_override? + false + end + private def admin_member_permission diff --git a/app/views/shared/members/_member.html.haml b/app/views/shared/members/_member.html.haml index 2db1f67a793..afcb2b71472 100644 --- a/app/views/shared/members/_member.html.haml +++ b/app/views/shared/members/_member.html.haml @@ -4,8 +4,9 @@ - member = local_assigns.fetch(:member) - user = local_assigns.fetch(:user, member.user) - source = member.source +- override = member.try(:override) -%li.member{ class: dom_class(member), id: dom_id(member) } +%li.member{ class: [dom_class(member), ("is-overridden" if override)], id: dom_id(member) } %span.list-item-name - if user = image_tag avatar_icon_for_user(user, 40), class: "avatar s40", alt: '' @@ -54,6 +55,7 @@ - if show_roles - current_resource = @project || @group .controls.member-controls + = render_if_exists 'shared/members/ee/ldap_tag', can_override: member.can_override? - if show_controls && member.source == current_resource - if member.can_resend_invite? @@ -67,6 +69,7 @@ = f.hidden_field :access_level .member-form-control.dropdown.append-right-5 %button.dropdown-menu-toggle.js-member-permissions-dropdown{ type: "button", + disabled: member.can_override? && !override, data: { toggle: "dropdown", field_name: "#{f.object_name}[access_level]" } } %span.dropdown-toggle-text = member.human_access @@ -80,8 +83,13 @@ = link_to role, "javascript:void(0)", class: ("is-active" if member.access_level == role_id), data: { id: role_id, el_id: dom_id(member) } + = render_if_exists 'shared/members/ee/revert_ldap_group_sync_option', + group: @group, + member: member, + can_override: member.can_override? .prepend-left-5.clearable-input.member-form-control = f.text_field :expires_at, + disabled: member.can_override? && !override, class: 'form-control js-access-expiration-date js-member-update-control', placeholder: _('Expiration date'), id: "member_expires_at_#{member.id}", @@ -116,5 +124,8 @@ = _("Delete") - unless force_mobile_view = icon('trash', class: 'd-none d-sm-block') + = 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= 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? |