debian-mirror-gitlab/app/assets/javascripts/projects/terraform_notification/index.js

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

30 lines
637 B
JavaScript
Raw Normal View History

2021-09-30 23:02:18 +05:30
import Vue from 'vue';
2021-11-11 11:23:49 +05:30
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
2021-09-30 23:02:18 +05:30
import TerraformNotification from './components/terraform_notification.vue';
2021-11-11 11:23:49 +05:30
Vue.use(VueApollo);
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(),
});
2021-09-30 23:02:18 +05:30
export default () => {
const el = document.querySelector('.js-terraform-notification');
2021-11-11 11:23:49 +05:30
if (!el) {
2021-09-30 23:02:18 +05:30
return false;
}
2021-10-27 15:23:28 +05:30
const { terraformImagePath } = el.dataset;
2021-09-30 23:02:18 +05:30
return new Vue({
el,
2021-11-11 11:23:49 +05:30
apolloProvider,
2021-10-27 15:23:28 +05:30
provide: {
terraformImagePath,
},
render: (createElement) => createElement(TerraformNotification),
2021-09-30 23:02:18 +05:30
});
};