Commit 163343d6 authored by peterhegman's avatar peterhegman Committed by Enrique Alcántara

Remove unused HAML and CSS in members

Some recent refactoring to Vue has allowed us to remove some unused
HAML and CSS
parent d9fab223
......@@ -149,12 +149,6 @@ ul.content-list {
margin-right: $grid-size;
display: inline-block;
&.btn-ldap-override {
@include media-breakpoint-up(sm) {
margin-bottom: 0;
}
}
&.has-tooltip,
&:last-child {
margin-right: 0;
......
@import 'mixins_and_variables_and_functions';
.project-members-title {
padding-bottom: 10px;
border-bottom: 1px solid $border-color;
}
.invite-users-form {
.btn-success {
margin-right: 10px;
......@@ -12,12 +7,6 @@
}
.member {
&.is-overridden {
.btn-ldap-override {
display: none !important;
}
}
.controls {
@include media-breakpoint-up(sm) {
display: flex;
......@@ -31,111 +20,12 @@
.form-group {
margin-bottom: 0;
}
&.existing-title {
@include media-breakpoint-up(sm) {
float: left;
}
}
}
.member-form-control {
@include media-breakpoint-down(xs) {
margin-right: 0;
width: auto;
}
}
.member-search-btn {
position: absolute;
right: 4px;
top: 0;
height: $input-height;
padding-left: 10px;
padding-right: 10px;
color: $gray-darkest;
background: transparent;
border: 0;
outline: 0;
}
.members-ldap {
align-self: center;
}
.alert-member-ldap {
background-color: $orange-50;
@include media-breakpoint-up(sm) {
line-height: 40px;
}
> p {
float: left;
margin-bottom: 10px;
color: $orange-600;
@include media-breakpoint-up(sm) {
padding-left: 55px;
margin-bottom: 0;
}
}
.controls {
width: 100%;
@include media-breakpoint-up(sm) {
width: auto;
}
}
}
.btn-ldap-override {
width: 100%;
@include media-breakpoint-up(sm) {
margin-left: 10px;
width: auto;
}
}
.flex-project-members-panel {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
@include media-breakpoint-down(sm) {
display: block;
.flex-project-title {
vertical-align: top;
display: inline-block;
max-width: 90%;
}
}
.flex-project-title {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.badge.badge-pill {
height: 17px;
line-height: 16px;
margin-right: 5px;
padding-top: 1px;
padding-bottom: 1px;
}
.flex-users-form {
flex-wrap: nowrap;
white-space: nowrap;
margin-left: auto;
}
}
.card {
.card-header {
.badge.badge-pill {
......@@ -168,33 +58,11 @@
word-break: break-all;
}
.form-control {
width: inherit;
}
.btn {
align-self: flex-start;
}
@include media-breakpoint-down(sm) {
.member-access-text {
margin: 0 0 $gl-padding-4 ($grid-size * 6);
}
}
@include media-breakpoint-down(xs) {
display: block;
.controls > .btn,
.controls .member-form-control {
margin: 0 0 $gl-padding-8;
display: block;
}
.form-control {
width: 100%;
}
}
}
......@@ -231,25 +99,5 @@
float: none;
display: block;
}
.dropdown-menu-toggle,
.dropdown-menu,
.form-control,
.list-item-name {
width: 100%;
}
.dropdown-menu {
margin-top: 0;
}
.member-form-control {
margin: 5px 0;
}
.btn {
width: 100%;
margin-left: 0;
}
}
}
......@@ -134,7 +134,6 @@
collection: @members, as: :member,
locals: { membership_source: @group,
group: @group,
show_controls: false,
current_user_is_group_owner: current_user_is_group_owner }
- unless @members.size < Kaminari.config.default_per_page
.card-footer
......
......@@ -189,7 +189,6 @@
collection: @group_members, as: :member,
locals: { membership_source: @project,
group: @group,
show_controls: false,
current_user_is_group_owner: current_user_is_group_owner }
.card-footer
= paginate @group_members, param_name: 'group_members_page', theme: 'gitlab'
......@@ -207,7 +206,6 @@
collection: @project_members, as: :member,
locals: { membership_source: @project,
group: @group,
show_controls: false,
current_user_is_group_owner: current_user_is_group_owner }
.card-footer
= paginate @project_members, param_name: 'project_members_page', theme: 'gitlab'
- group_link = local_assigns[:group_link]
- group = group_link.shared_with_group
- can_admin_member = local_assigns[:can_admin_member]
- group_link_path = local_assigns[:group_link_path]
- dom_id = "group_member_#{group_link.id}"
-# Note this is just for groups. For individual members please see shared/members/_member
%li.member.js-member.group_member.py-2.px-3.d-flex.flex-column.flex-md-row{ id: dom_id, data: { qa_selector: 'group_row' } }
%span.list-item-name.mb-2.m-md-0
= group_icon(group, class: "avatar s40 flex-shrink-0 flex-grow-0", alt: '')
.user-info
= link_to group.full_name, group_path(group), class: 'member'
.cgray
Given access #{time_ago_with_tooltip(group_link.created_at)}
%span.js-expires-in{ class: ('gl-display-none' unless group_link.expires?) }
&middot;
%span.js-expires-in-text{ class: ('text-warning' if group_link.expires_soon?) }
- if group_link.expires?
= _("Expires in %{expires_at}").html_safe % { expires_at: distance_of_time_in_words_to_now(group_link.expires_at) }
.controls.member-controls.align-items-center
= form_tag group_link_path, method: :put, remote: true, class: 'js-edit-member-form form-group d-sm-flex' do
= hidden_field_tag "group_link[group_access]", group_link.group_access
.member-form-control.dropdown.mr-sm-2.d-sm-inline-block
%button.dropdown-menu-toggle.js-member-permissions-dropdown{ type: "button",
disabled: !can_admin_member,
data: { toggle: "dropdown", field_name: "group_link[group_access]" } }
%span.dropdown-toggle-text
= group_link.human_access
= sprite_icon("chevron-down", css_class: "dropdown-menu-toggle-icon gl-top-3")
.dropdown-menu.dropdown-select.dropdown-menu-right.dropdown-menu-selectable
= dropdown_title(_("Change role"))
.dropdown-content
%ul
- Gitlab::Access.options_with_owner.each do |role, role_id|
%li
= link_to role, '#',
class: ("is-active" if group_link.group_access == role_id),
data: { id: role_id, el_id: dom_id }
.clearable-input.member-form-control.d-sm-inline-block
= text_field_tag 'group_link[expires_at]', group_link.expires_at, class: 'form-control js-access-expiration-date js-member-update-control', placeholder: _('Expiration date'), id: "member_expires_at_#{group.id}", disabled: !can_admin_member
= sprite_icon('close', size: 16, css_class: 'clear-icon js-clear-input gl-text-gray-200')
- if can_admin_member
= link_to group_link_path,
method: :delete,
data: { confirm: _("Are you sure you want to remove %{group_name}?") % { group_name: group.name }, qa_selector: 'delete_group_access_link' },
class: 'gl-button btn btn-danger m-0 ml-sm-2 align-self-center' do
%span.d-block.d-sm-none
= _("Delete")
= sprite_icon('remove', css_class: 'd-none d-sm-block')
- show_roles = local_assigns.fetch(:show_roles, true)
- show_controls = local_assigns.fetch(:show_controls, true)
- force_mobile_view = local_assigns.fetch(:force_mobile_view, false)
- member = local_assigns.fetch(:member)
- current_user_is_group_owner = local_assigns.fetch(:current_user_is_group_owner, false)
......@@ -7,11 +6,10 @@
- group = local_assigns.fetch(:group)
- user = local_assigns.fetch(:user, member.user)
- source = member.source
- override = member.try(:override)
-# Note this is just for individual members. For groups please see shared/members/_group
%li.member.js-member.py-2.px-3.d-flex.flex-column{ class: [dom_class(member), ("is-overridden" if override), ("flex-md-row" unless force_mobile_view)], id: dom_id(member), data: { qa_selector: 'member_row' } }
%li.member.js-member.py-2.px-3.d-flex.flex-column{ class: [dom_class(member), ("flex-md-row" unless force_mobile_view)], id: dom_id(member), data: { qa_selector: 'member_row' } }
%span.list-item-name.mb-2.m-md-0
- if user
= image_tag avatar_icon_for_user(user, 40), class: "avatar s40 flex-shrink-0 flex-grow-0", alt: ''
......@@ -62,70 +60,4 @@
- if show_roles
.controls.member-controls.align-items-center
= render_if_exists 'shared/members/ee/ldap_tag', can_override: member.can_override?
- if show_controls && member.source == membership_source
- if member.can_resend_invite?
= link_to sprite_icon('paper-airplane'), polymorphic_path([:resend_invite, member]),
method: :post,
class: 'gl-button btn btn-default align-self-center mr-sm-2',
title: _('Resend invite')
- if user != current_user && member.can_update?
= form_for member, remote: true, html: { class: "js-edit-member-form form-group #{'d-sm-flex' unless force_mobile_view}" } do |f|
= f.hidden_field :access_level
.member-form-control.dropdown{ class: [("mr-sm-2 d-sm-inline-block" unless force_mobile_view)] }
%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]", qa_selector: "access_level_dropdown" } }
%span.dropdown-toggle-text
= member.human_access
= sprite_icon("chevron-down", css_class: "dropdown-menu-toggle-icon gl-top-3")
.dropdown-menu.dropdown-select.dropdown-menu-right.dropdown-menu-selectable
= dropdown_title(_("Change role"))
.dropdown-content
%ul
- member.valid_level_roles.each do |role, role_id|
%li
= link_to role, '#',
class: ("is-active" if member.access_level == role_id),
data: { id: role_id, el_id: dom_id(member), qa_selector: "#{role.downcase}_access_level_link" }
= render_if_exists 'shared/members/ee/revert_ldap_group_sync_option',
group: group,
member: member,
can_override: member.can_override?
.clearable-input.member-form-control{ class: [("d-sm-inline-block" unless force_mobile_view)] }
= 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}",
data: { el_id: dom_id(member) }
= sprite_icon('close', size: 16, css_class: 'clear-icon js-clear-input gl-text-gray-200')
- else
%span.member-access-text.user-access-role= member.human_access
- if member.can_approve?
= link_to polymorphic_path([:approve_access_request, member]),
method: :post,
class: "btn btn-confirm btn-icon gl-button align-self-center m-0 mb-2 #{'mb-sm-0 ml-sm-2' unless force_mobile_view}",
title: _('Grant access') do
%span{ class: ('d-block d-sm-none' unless force_mobile_view) }
= _('Grant access')
- unless force_mobile_view
= sprite_icon('check', css_class: 'd-none d-sm-block')
- if member.can_remove?
- if current_user == user
= link_to polymorphic_path([:leave, member.source, :members]), method: :delete, data: { confirm: leave_confirmation_message(member.source) }, class: "btn gl-button btn-svg btn-danger align-self-center m-0 #{'ml-sm-2' unless force_mobile_view}" do
= sprite_icon('leave', css_class: 'gl-icon')
= _('Leave')
- else
%button{ data: { member_path: member_path(member.member), member_type: member.type, message: remove_member_message(member), is_access_request: member.request?.to_s, qa_selector: 'delete_member_button' },
class: "js-remove-member-button btn gl-button btn-danger align-self-center m-0 #{'ml-sm-2 btn-icon' unless force_mobile_view}",
title: remove_member_title(member) }
%span{ class: ('d-block d-sm-none' unless force_mobile_view) }
= _("Delete")
- unless force_mobile_view
= sprite_icon('remove', css_class: 'd-none d-sm-block gl-icon')
- else
%span.member-access-text.user-access-role= member.human_access
%span.member-access-text.user-access-role= member.human_access
......@@ -16,5 +16,4 @@
collection: requesters, as: :member,
locals: { membership_source: membership_source,
group: group,
show_controls: false,
current_user_is_group_owner: current_user_is_group_owner }
- name = local_assigns.fetch(:name, :search)
.search-control-wrap.gl-relative
= search_field_tag name, params[name], { placeholder: _('Search'), class: 'form-control', spellcheck: false }
%button.user-search-btn.border-left.gl-display-flex.gl-align-items-center.gl-justify-content-center{ type: 'submit', 'aria': { label: _('Submit search') }, data: { testid: 'user-search-submit' } }
= sprite_icon('search')
- group = local_assigns.fetch(:group)
- member = local_assigns.fetch(:member)
- can_override = local_assigns.fetch(:can_override, false)
- if can_override
%li.divider
%li
= link_to 'Revert to LDAP group sync settings', '#',
data: { revert: 'true', endpoint: override_group_group_member_path(group, member), el_id: dom_id(member) }
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