debian-mirror-gitlab/app/assets/javascripts/jira_connect/subscriptions/index.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.1 KiB
JavaScript
Raw Normal View History

2022-06-21 17:19:12 +05:30
import '~/webpack';
2021-09-04 01:27:46 +05:30
2021-03-08 18:12:59 +05:30
import setConfigs from '@gitlab/ui/dist/config';
2021-03-11 19:13:27 +05:30
import Vue from 'vue';
2021-03-08 18:12:59 +05:30
import GlFeatureFlagsPlugin from '~/vue_shared/gl_feature_flags_plugin';
2021-03-11 19:13:27 +05:30
import Translate from '~/vue_shared/translate';
2021-03-08 18:12:59 +05:30
import JiraConnectApp from './components/app.vue';
import createStore from './store';
2022-01-26 12:08:38 +05:30
import { sizeToParent } from './utils';
2021-03-08 18:12:59 +05:30
2022-01-26 12:08:38 +05:30
export function initJiraConnect() {
2021-03-11 19:13:27 +05:30
const el = document.querySelector('.js-jira-connect-app');
2021-03-08 18:12:59 +05:30
if (!el) {
return null;
}
setConfigs();
Vue.use(Translate);
Vue.use(GlFeatureFlagsPlugin);
2022-05-07 20:08:51 +05:30
const {
groupsPath,
subscriptions,
2022-07-16 23:28:13 +05:30
addSubscriptionsPath,
2022-05-07 20:08:51 +05:30
subscriptionsPath,
usersPath,
gitlabUserPath,
oauthMetadata,
} = el.dataset;
2021-04-29 21:17:54 +05:30
sizeToParent();
2021-03-08 18:12:59 +05:30
2022-07-16 23:28:13 +05:30
const store = createStore({ subscriptions: JSON.parse(subscriptions) });
2021-01-29 00:20:46 +05:30
return new Vue({
el,
2021-03-08 18:12:59 +05:30
store,
provide: {
groupsPath,
2022-07-16 23:28:13 +05:30
addSubscriptionsPath,
2021-03-11 19:13:27 +05:30
subscriptionsPath,
usersPath,
2022-01-26 12:08:38 +05:30
gitlabUserPath,
2022-05-07 20:08:51 +05:30
oauthMetadata: oauthMetadata ? JSON.parse(oauthMetadata) : null,
2021-02-22 17:27:13 +05:30
},
2021-01-29 00:20:46 +05:30
render(createElement) {
2021-03-08 18:12:59 +05:30
return createElement(JiraConnectApp);
2021-01-29 00:20:46 +05:30
},
});
}
2022-06-21 17:19:12 +05:30
initJiraConnect();