2018-12-13 13:39:08 +05:30
|
|
|
import Vue from 'vue';
|
2019-03-02 22:35:43 +05:30
|
|
|
import MrWidgetOptions from 'ee_else_ce/vue_merge_request_widget/mr_widget_options.vue';
|
2020-07-28 23:09:34 +05:30
|
|
|
import VueApollo from 'vue-apollo';
|
2020-10-24 23:57:45 +05:30
|
|
|
import Translate from '../vue_shared/translate';
|
2020-07-28 23:09:34 +05:30
|
|
|
import createDefaultClient from '~/lib/graphql';
|
2021-01-29 00:20:46 +05:30
|
|
|
import { registerExtension } from './components/extensions';
|
|
|
|
import issueExtension from './extensions/issues';
|
2018-03-17 18:26:18 +05:30
|
|
|
|
|
|
|
Vue.use(Translate);
|
2020-07-28 23:09:34 +05:30
|
|
|
Vue.use(VueApollo);
|
|
|
|
|
|
|
|
const apolloProvider = new VueApollo({
|
2021-01-29 00:20:46 +05:30
|
|
|
defaultClient: createDefaultClient(
|
|
|
|
{},
|
|
|
|
{
|
|
|
|
assumeImmutableResults: true,
|
|
|
|
},
|
|
|
|
),
|
2020-07-28 23:09:34 +05:30
|
|
|
});
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2018-03-27 19:54:05 +05:30
|
|
|
export default () => {
|
2020-03-13 15:44:24 +05:30
|
|
|
if (gl.mrWidget) return;
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
gl.mrWidgetData.gitlabLogo = gon.gitlab_logo;
|
2020-07-28 23:09:34 +05:30
|
|
|
gl.mrWidgetData.defaultAvatarUrl = gon.default_avatar_url;
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2021-01-29 00:20:46 +05:30
|
|
|
registerExtension(issueExtension);
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
const vm = new Vue({ ...MrWidgetOptions, apolloProvider });
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
window.gl.mrWidget = {
|
|
|
|
checkStatus: vm.checkStatus,
|
|
|
|
};
|
2018-03-27 19:54:05 +05:30
|
|
|
};
|