summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pipelines/pipeline_details_notification.js
blob: 0061be843c564fe6a3be5c5a7e36b5291802f95d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import DeprecatedKeywordNotification from './components/notification/deprecated_type_keyword_notification.vue';

Vue.use(VueApollo);

export const createPipelineNotificationApp = (elSelector, apolloProvider) => {
  const el = document.querySelector(elSelector);

  if (!el) {
    return;
  }

  const { deprecatedKeywordsDocPath, fullPath, pipelineIid } = el?.dataset;
  // eslint-disable-next-line no-new
  new Vue({
    el,
    components: {
      DeprecatedKeywordNotification,
    },
    provide: {
      deprecatedKeywordsDocPath,
      fullPath,
      pipelineIid,
    },
    apolloProvider,
    render(createElement) {
      return createElement('deprecated-keyword-notification');
    },
  });
};