Commit 7d993f12 authored by Doug Stull's avatar Doug Stull

Remove invite members link from sidebar

- no longer needed.
parent 3196d6cc
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation'; import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation';
import { ACTIVE_TAB_SHARED, ACTIVE_TAB_ARCHIVED } from '~/groups/constants'; import { ACTIVE_TAB_SHARED, ACTIVE_TAB_ARCHIVED } from '~/groups/constants';
import initInviteMembersBanner from '~/groups/init_invite_members_banner'; import initInviteMembersBanner from '~/groups/init_invite_members_banner';
import initInviteMembersModal from '~/invite_members/init_invite_members_modal';
import initInviteMembersTrigger from '~/invite_members/init_invite_members_trigger';
import { getPagePath, getDashPath } from '~/lib/utils/common_utils'; import { getPagePath, getDashPath } from '~/lib/utils/common_utils';
import initNotificationsDropdown from '~/notifications'; import initNotificationsDropdown from '~/notifications';
import ProjectsList from '~/projects_list'; import ProjectsList from '~/projects_list';
...@@ -26,6 +24,4 @@ export default function initGroupDetails(actionName = 'show') { ...@@ -26,6 +24,4 @@ export default function initGroupDetails(actionName = 'show') {
new ProjectsList(); new ProjectsList();
initInviteMembersBanner(); initInviteMembersBanner();
initInviteMembersModal();
initInviteMembersTrigger();
} }
...@@ -3,8 +3,6 @@ import Activities from '~/activities'; ...@@ -3,8 +3,6 @@ import Activities from '~/activities';
import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation'; import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation';
import BlobViewer from '~/blob/viewer/index'; import BlobViewer from '~/blob/viewer/index';
import { initUploadForm } from '~/blob_edit/blob_bundle'; import { initUploadForm } from '~/blob_edit/blob_bundle';
import initInviteMembersModal from '~/invite_members/init_invite_members_modal';
import initInviteMembersTrigger from '~/invite_members/init_invite_members_trigger';
import leaveByUrl from '~/namespaces/leave_by_url'; import leaveByUrl from '~/namespaces/leave_by_url';
import initVueNotificationsDropdown from '~/notifications'; import initVueNotificationsDropdown from '~/notifications';
import initReadMore from '~/read_more'; import initReadMore from '~/read_more';
...@@ -43,6 +41,3 @@ leaveByUrl('project'); ...@@ -43,6 +41,3 @@ leaveByUrl('project');
initVueNotificationsDropdown(); initVueNotificationsDropdown();
new ShortcutsNavigation(); // eslint-disable-line no-new new ShortcutsNavigation(); // eslint-disable-line no-new
initInviteMembersTrigger();
initInviteMembersModal();
...@@ -16,11 +16,6 @@ ...@@ -16,11 +16,6 @@
= content_for :meta_tags do = content_for :meta_tags do
= auto_discovery_link_tag(:atom, group_url(@group, rss_url_options), title: "#{@group.name} activity") = auto_discovery_link_tag(:atom, group_url(@group, rss_url_options), title: "#{@group.name} activity")
= content_for :invite_members_sidebar do
- if can_invite_members_for_group?(@group)
%li
.js-invite-members-trigger{ data: { icon: 'plus', classes: 'gl-text-decoration-none! gl-shadow-none!', display_text: _('Invite team members') } }
= render partial: 'flash_messages' = render partial: 'flash_messages'
= render_if_exists 'trials/banner', namespace: @group = render_if_exists 'trials/banner', namespace: @group
......
...@@ -137,8 +137,6 @@ ...@@ -137,8 +137,6 @@
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
= _('Members') = _('Members')
= content_for :invite_members_sidebar
- if group_sidebar_link?(:settings) - if group_sidebar_link?(:settings)
= nav_link(path: group_settings_nav_link_paths) do = nav_link(path: group_settings_nav_link_paths) do
= link_to edit_group_path(@group) do = link_to edit_group_path(@group) do
......
...@@ -378,8 +378,6 @@ ...@@ -378,8 +378,6 @@
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
= _('Members') = _('Members')
= content_for :invite_members_sidebar
- if project_nav_tab? :settings - if project_nav_tab? :settings
= nav_link(path: sidebar_settings_paths) do = nav_link(path: sidebar_settings_paths) do
= link_to edit_project_path(@project) do = link_to edit_project_path(@project) do
......
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
- max_project_topic_length = 15 - max_project_topic_length = 15
- emails_disabled = @project.emails_disabled? - emails_disabled = @project.emails_disabled?
= render 'projects/invite_members_modal', project: @project
.project-home-panel.js-show-on-project-root.gl-my-5{ class: [("empty-project" if empty_repo)] } .project-home-panel.js-show-on-project-root.gl-my-5{ class: [("empty-project" if empty_repo)] }
.row.gl-mb-3 .row.gl-mb-3
.home-panel-title-row.col-md-12.col-lg-6.d-flex .home-panel-title-row.col-md-12.col-lg-6.d-flex
......
- return unless can_invite_members_for_project?(@project)
%li
.js-invite-members-trigger{ data: { icon: 'plus', classes: 'gl-text-decoration-none! gl-shadow-none!', display_text: _('Invite team members') } }
...@@ -2,9 +2,6 @@ ...@@ -2,9 +2,6 @@
- default_branch_name = @project.default_branch_or_master - default_branch_name = @project.default_branch_or_master
- @skip_current_level_breadcrumb = true - @skip_current_level_breadcrumb = true
= content_for :invite_members_sidebar do
= render partial: 'projects/invite_members_link'
= render partial: 'flash_messages', locals: { project: @project } = render partial: 'flash_messages', locals: { project: @project }
= render "home_panel" = render "home_panel"
......
...@@ -12,8 +12,6 @@ ...@@ -12,8 +12,6 @@
#{ _('This means you can not push code until you create an empty repository or import existing one.') } #{ _('This means you can not push code until you create an empty repository or import existing one.') }
%hr %hr
= render 'projects/invite_members_modal', project: @project
.no-repo-actions .no-repo-actions
= link_to project_repository_path(@project), method: :post, class: 'btn gl-button btn-confirm' do = link_to project_repository_path(@project), method: :post, class: 'btn gl-button btn-confirm' do
#{ _('Create empty repository') } #{ _('Create empty repository') }
......
...@@ -6,9 +6,6 @@ ...@@ -6,9 +6,6 @@
= content_for :meta_tags do = content_for :meta_tags do
= auto_discovery_link_tag(:atom, project_path(@project, rss_url_options), title: "#{@project.name} activity") = auto_discovery_link_tag(:atom, project_path(@project, rss_url_options), title: "#{@project.name} activity")
= content_for :invite_members_sidebar do
= render partial: 'projects/invite_members_link'
= render partial: 'flash_messages', locals: { project: @project } = render partial: 'flash_messages', locals: { project: @project }
= render "projects/last_push" = render "projects/last_push"
......
...@@ -16458,9 +16458,6 @@ msgstr "" ...@@ -16458,9 +16458,6 @@ msgstr ""
msgid "Invite members" msgid "Invite members"
msgstr "" msgstr ""
msgid "Invite team members"
msgstr ""
msgid "Invite your team" msgid "Invite your team"
msgstr "" msgstr ""
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'groups/show.html.haml' do
let_it_be(:user) { build(:user) }
let_it_be(:group) { create(:group) }
before do
assign(:group, group)
end
context 'when rendering with the layout' do
subject(:render_page) { render template: 'groups/show.html.haml', layout: 'layouts/group' }
describe 'invite team members' do
before do
allow(view).to receive(:session).and_return({})
allow(view).to receive(:current_user_mode).and_return(Gitlab::Auth::CurrentUserMode.new(user))
allow(view).to receive(:current_user).and_return(user)
allow(view).to receive(:experiment_enabled?).and_return(false)
allow(view).to receive(:group_path).and_return('')
allow(view).to receive(:group_shared_path).and_return('')
allow(view).to receive(:group_archived_path).and_return('')
end
context 'when invite team members is not available in sidebar' do
before do
allow(view).to receive(:can_invite_members_for_group?).and_return(false)
end
it 'does not display the js-invite-members-trigger' do
render_page
expect(rendered).not_to have_selector('.js-invite-members-trigger')
end
end
context 'when invite team members is available' do
before do
allow(view).to receive(:can_invite_members_for_group?).and_return(true)
end
it 'includes the div for js-invite-members-trigger' do
render_page
expect(rendered).to have_selector('.js-invite-members-trigger')
end
end
end
end
end
...@@ -79,41 +79,4 @@ RSpec.describe 'projects/empty' do ...@@ -79,41 +79,4 @@ RSpec.describe 'projects/empty' do
it_behaves_like 'no invite member info' it_behaves_like 'no invite member info'
end end
end end
context 'when rendering with the layout' do
subject(:render_page) { render template: 'projects/empty.html.haml', layout: 'layouts/project' }
describe 'invite team members' do
before do
allow(view).to receive(:session).and_return({})
allow(view).to receive(:current_user_mode).and_return(Gitlab::Auth::CurrentUserMode.new(user))
allow(view).to receive(:current_user).and_return(user)
allow(view).to receive(:experiment_enabled?).and_return(false)
end
context 'when invite team members is not available in sidebar' do
before do
allow(view).to receive(:can_invite_members_for_project?).and_return(false)
end
it 'does not display the js-invite-members-trigger' do
render_page
expect(rendered).not_to have_selector('.js-invite-members-trigger')
end
end
context 'when invite team members is available' do
before do
allow(view).to receive(:can_invite_members_for_project?).and_return(true)
end
it 'includes the div for js-invite-members-trigger' do
render_page
expect(rendered).to have_selector('.js-invite-members-trigger')
end
end
end
end
end end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'projects/show.html.haml' do
let_it_be(:user) { build(:user) }
let_it_be(:project) { ProjectPresenter.new(create(:project, :repository), current_user: user) }
before do
assign(:project, project)
end
context 'when rendering with the layout' do
subject(:render_page) { render template: 'projects/show.html.haml', layout: 'layouts/project' }
describe 'invite team members' do
before do
allow(view).to receive(:event_filter_link)
allow(view).to receive(:session).and_return({})
allow(view).to receive(:current_user_mode).and_return(Gitlab::Auth::CurrentUserMode.new(user))
allow(view).to receive(:current_user).and_return(user)
allow(view).to receive(:experiment_enabled?).and_return(false)
allow(view).to receive(:add_page_startup_graphql_call)
end
context 'when invite team members is not available in sidebar' do
before do
allow(view).to receive(:can_invite_members_for_project?).and_return(false)
end
it 'does not display the js-invite-members-trigger' do
render_page
expect(rendered).not_to have_selector('.js-invite-members-trigger')
end
end
context 'when invite team members is available' do
before do
allow(view).to receive(:can_invite_members_for_project?).and_return(true)
end
it 'includes the div for js-invite-members-trigger' do
render_page
expect(rendered).to have_selector('.js-invite-members-trigger')
end
end
end
end
end
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