2022-03-02 08:16:31 +05:30
|
|
|
import Vue from 'vue';
|
2023-01-13 00:05:48 +05:30
|
|
|
import VueApollo from 'vue-apollo';
|
|
|
|
import { gqlClient } from '../../issues/list/graphql';
|
2022-11-25 23:54:43 +05:30
|
|
|
import StatusDropdown from './components/status_dropdown.vue';
|
|
|
|
import SubscriptionsDropdown from './components/subscriptions_dropdown.vue';
|
2023-01-13 00:05:48 +05:30
|
|
|
import MoveIssuesButton from './components/move_issues_button.vue';
|
2022-03-02 08:16:31 +05:30
|
|
|
import issuableBulkUpdateActions from './issuable_bulk_update_actions';
|
|
|
|
import IssuableBulkUpdateSidebar from './issuable_bulk_update_sidebar';
|
|
|
|
|
|
|
|
export function initBulkUpdateSidebar(prefixId) {
|
|
|
|
const el = document.querySelector('.issues-bulk-update');
|
|
|
|
|
|
|
|
if (!el) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
issuableBulkUpdateActions.init({ prefixId });
|
|
|
|
new IssuableBulkUpdateSidebar(); // eslint-disable-line no-new
|
|
|
|
}
|
|
|
|
|
2022-11-25 23:54:43 +05:30
|
|
|
export function initStatusDropdown() {
|
|
|
|
const el = document.querySelector('.js-status-dropdown');
|
2022-03-02 08:16:31 +05:30
|
|
|
|
|
|
|
if (!el) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el,
|
2022-11-25 23:54:43 +05:30
|
|
|
name: 'StatusDropdownRoot',
|
|
|
|
render: (createElement) => createElement(StatusDropdown),
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export function initSubscriptionsDropdown() {
|
|
|
|
const el = document.querySelector('.js-subscriptions-dropdown');
|
|
|
|
|
|
|
|
if (!el) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el,
|
|
|
|
name: 'SubscriptionsDropdownRoot',
|
|
|
|
render: (createElement) => createElement(SubscriptionsDropdown),
|
2022-03-02 08:16:31 +05:30
|
|
|
});
|
|
|
|
}
|
2023-01-13 00:05:48 +05:30
|
|
|
|
|
|
|
export function initMoveIssuesButton() {
|
|
|
|
const el = document.querySelector('.js-move-issues');
|
|
|
|
|
|
|
|
if (!el) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
const { dataset } = el;
|
|
|
|
|
|
|
|
Vue.use(VueApollo);
|
|
|
|
const apolloProvider = new VueApollo({
|
|
|
|
defaultClient: gqlClient,
|
|
|
|
});
|
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el,
|
|
|
|
name: 'MoveIssuesRoot',
|
|
|
|
apolloProvider,
|
|
|
|
render: (createElement) =>
|
|
|
|
createElement(MoveIssuesButton, {
|
|
|
|
props: {
|
|
|
|
projectFullPath: dataset.projectFullPath,
|
|
|
|
projectsFetchPath: dataset.projectsFetchPath,
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
});
|
|
|
|
}
|