Commit 41a096e7 authored by Miguel Rincon's avatar Miguel Rincon

Merge branch 'tz-fix-invite-members-modal' into 'master'

Make the Invite Modal load conditional

See merge request gitlab-org/gitlab!83128
parents ee710197 72b8bb6c
......@@ -2,8 +2,6 @@ import { GlBreakpointInstance as bp, breakpoints } from '@gitlab/ui/dist/utils';
import $ from 'jquery';
import { debounce } from 'lodash';
import { getCookie, setCookie, parseBoolean } from '~/lib/utils/common_utils';
import initInviteMembersModal from '~/invite_members/init_invite_members_modal';
import initInviteMembersTrigger from '~/invite_members/init_invite_members_trigger';
export const SIDEBAR_COLLAPSED_CLASS = 'js-sidebar-collapsed';
......@@ -114,7 +112,26 @@ export default class ContextualSidebar {
this.toggleCollapsedSidebar(collapse, true);
}
initInviteMembersModal();
initInviteMembersTrigger();
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(() => {});
}
}
}
}
import Vue from 'vue';
import { GlToast } from '@gitlab/ui';
import { convertObjectPropsToCamelCase, parseBoolean } from '~/lib/utils/common_utils';
import IntegrationForm from './components/integration_form.vue';
import { createStore } from './store';
Vue.use(GlToast);
function parseBooleanInData(data) {
const result = {};
Object.entries(data).forEach(([key, value]) => {
......
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';
......@@ -24,5 +25,7 @@ function initLearnGitlab() {
});
}
initLearnGitlab();
initInviteMembersModal();
initInviteMembersTrigger();
initLearnGitlab();
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