Skip to content
代码片段 群组 项目
提交 f15df709 编辑于 作者: Anna Vovchenko's avatar Anna Vovchenko
浏览文件

Merge branch '413438-trial-invite-members-button-does-not-work-for-new-sidebar' into 'master'

Fix Trial invite members button showing with new nav

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122053



Merged-by: default avatarAnna Vovchenko <avovchenko@gitlab.com>
Approved-by: default avatarRoss Byrne <robyrne@gitlab.com>
Approved-by: default avatarAnna Vovchenko <avovchenko@gitlab.com>
Co-authored-by: default avatarDoug Stull <dstull@gitlab.com>
No related branches found
No related tags found
无相关合并请求
显示
47 个添加50 个删除
......@@ -108,27 +108,5 @@ export default class ContextualSidebar {
const collapse = parseBoolean(getCookie('sidebar_collapsed'));
this.toggleCollapsedSidebar(collapse, true);
}
const modalEl = document.querySelector('.js-invite-members-modal');
if (modalEl) {
import(
/* webpackChunkName: 'initInviteMembersModal' */ '~/invite_members/init_invite_members_modal'
)
.then(({ default: initInviteMembersModal }) => {
initInviteMembersModal();
})
.catch(() => {});
const inviteTriggers = document.querySelectorAll('.js-invite-members-trigger');
if (inviteTriggers) {
import(
/* webpackChunkName: 'initInviteMembersTrigger' */ '~/invite_members/init_invite_members_trigger'
)
.then(({ default: initInviteMembersTrigger }) => {
initInviteMembersTrigger();
})
.catch(() => {});
}
}
}
}
......@@ -64,9 +64,31 @@ export function initScrollingTabs() {
});
}
function initDeferred() {
initScrollingTabs();
function initInviteMembers() {
const modalEl = document.querySelector('.js-invite-members-modal');
if (!modalEl) return;
import(
/* webpackChunkName: 'initInviteMembersModal' */ '~/invite_members/init_invite_members_modal'
)
.then(({ default: initInviteMembersModal }) => {
initInviteMembersModal();
})
.catch(() => {});
const inviteTriggers = document.querySelectorAll('.js-invite-members-trigger');
if (!inviteTriggers) return;
import(
/* webpackChunkName: 'initInviteMembersTrigger' */ '~/invite_members/init_invite_members_trigger'
)
.then(({ default: initInviteMembersTrigger }) => {
initInviteMembersTrigger();
})
.catch(() => {});
}
function initWhatsNewComponent() {
const appEl = document.getElementById('whats-new-app');
if (!appEl) return;
......@@ -84,6 +106,12 @@ function initDeferred() {
});
}
function initDeferred() {
initScrollingTabs();
initWhatsNewComponent();
initInviteMembers();
}
export default function initLayoutNav() {
if (!gon.use_new_navigation) {
const contextualSidebar = new ContextualSidebar();
......
import { groupMemberRequestFormatter } from '~/groups/members/utils';
import initInviteGroupTrigger from '~/invite_members/init_invite_group_trigger';
import initInviteGroupsModal from '~/invite_members/init_invite_groups_modal';
import initInviteMembersModal from '~/invite_members/init_invite_members_modal';
import initInviteMembersTrigger from '~/invite_members/init_invite_members_trigger';
import { s__ } from '~/locale';
import { initMembersApp } from '~/members';
import { MEMBER_TYPES, EE_APP_OPTIONS } from 'ee_else_ce/members/constants';
......@@ -60,7 +58,5 @@ const APP_OPTIONS = {
initMembersApp(document.querySelector('.js-group-members-list-app'), APP_OPTIONS);
initInviteMembersModal();
initInviteGroupsModal();
initInviteMembersTrigger();
initInviteGroupTrigger();
import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation';
import initInviteMembersBanner from '~/groups/init_invite_members_banner';
import initInviteMembersModal from '~/invite_members/init_invite_members_modal';
import initNotificationsDropdown from '~/notifications';
import ProjectsList from '~/projects_list';
......@@ -12,5 +11,4 @@ export default function initGroupDetails() {
new ProjectsList(); // eslint-disable-line no-new
initInviteMembersBanner();
initInviteMembersModal();
}
import initImportProjectMembersTrigger from '~/invite_members/init_import_project_members_trigger';
import initImportProjectMembersModal from '~/invite_members/init_import_project_members_modal';
import initInviteGroupTrigger from '~/invite_members/init_invite_group_trigger';
import initInviteMembersModal from '~/invite_members/init_invite_members_modal';
import initInviteGroupsModal from '~/invite_members/init_invite_groups_modal';
import initInviteMembersTrigger from '~/invite_members/init_invite_members_trigger';
import { s__ } from '~/locale';
import { initMembersApp } from '~/members';
import { MEMBER_TYPES } from '~/members/constants';
......@@ -11,9 +9,7 @@ import { groupLinkRequestFormatter } from '~/members/utils';
import { projectMemberRequestFormatter } from '~/projects/members/utils';
initImportProjectMembersModal();
initInviteMembersModal();
initInviteGroupsModal();
initInviteMembersTrigger();
initInviteGroupTrigger();
initImportProjectMembersTrigger();
......
import ShortcutsNavigation from '~/behaviors/shortcuts/shortcuts_navigation';
import initInviteMembersModal from '~/invite_members/init_invite_members_modal';
import initInviteMembersTrigger from '~/invite_members/init_invite_members_trigger';
import initClustersDeprecationAlert from '~/projects/clusters_deprecation_alert';
import leaveByUrl from '~/namespaces/leave_by_url';
import initVueNotificationsDropdown from '~/notifications';
......@@ -42,8 +40,6 @@ initVueNotificationsDropdown();
new ShortcutsNavigation(); // eslint-disable-line no-new
initUploadFileTrigger();
initInviteMembersModal();
initInviteMembersTrigger();
initClustersDeprecationAlert();
initTerraformNotification();
......
import { initWorkItemsRoot } from '~/work_items/index';
import initInviteMembersModal from '~/invite_members/init_invite_members_modal';
initWorkItemsRoot();
initInviteMembersModal();
......@@ -2,8 +2,6 @@ import Vue from 'vue';
import VueApollo from 'vue-apollo';
import { TYPENAME_ISSUE, TYPENAME_MERGE_REQUEST } from '~/graphql_shared/constants';
import { convertToGraphQLId, getIdFromGraphQLId } from '~/graphql_shared/utils';
import initInviteMembersModal from '~/invite_members/init_invite_members_modal';
import initInviteMembersTrigger from '~/invite_members/init_invite_members_trigger';
import { TYPE_ISSUE, TYPE_MERGE_REQUEST, WORKSPACE_PROJECT } from '~/issues/constants';
import { gqlClient } from '~/issues/list/graphql';
import {
......@@ -805,8 +803,6 @@ const isAssigneesWidgetShown =
(isInIssuePage() || isInDesignPage() || isInMRPage()) && gon.features.issueAssigneesWidget;
export function mountSidebar(mediator, store) {
initInviteMembersModal();
initInviteMembersTrigger();
mountSidebarTodoWidget();
if (isAssigneesWidgetShown) {
mountSidebarAssigneesWidget();
......
import Vue from 'vue';
import initInviteMembersModal from '~/invite_members/init_invite_members_modal';
import initInviteMembersTrigger from '~/invite_members/init_invite_members_trigger';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import LearnGitlab from '../components/learn_gitlab.vue';
......@@ -26,6 +25,4 @@ function initLearnGitlab() {
}
initInviteMembersModal();
initInviteMembersTrigger();
initLearnGitlab();
......@@ -78,10 +78,8 @@
expect(page).to have_current_path(project_issues_path(project))
end
context 'with invite_for_help_continuous_onboarding candidate experience' do
context 'with invite members link opening invite modal' do
before do
stub_experiments(invite_for_help_continuous_onboarding: :candidate)
sign_in(user)
visit namespace_project_learn_gitlab_path(namespace, project)
end
......
......@@ -33,4 +33,20 @@
expect(page).to have_content('Subgroups and projects').or have_content('Project information')
expect(page).not_to have_selector(alert_selector)
end
context 'when new nav is enabled' do
let_it_be(:user) { create(:user, use_new_navigation: true) }
it 'displays alert with Explore paid plans link and Invite more members button on other pages' do
visit page_path
expect(page).to have_selector(alert_selector)
expect(page).to have_link(text: 'Explore paid plans', href: group_billings_path(group))
expect(page).to have_button('Invite more members')
click_button 'Invite more members'
expect(page).to have_selector(invite_modal_selector)
end
end
end
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册