Welcome to mirror list, hosted at ThFree Co, Russian Federation.

index.js « ci_lint « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e4cda4cb36929594d028f94e0c0c97ac7d1aee64 (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
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
import CiLint from './components/ci_lint.vue';
import resolvers from './graphql/resolvers';

Vue.use(VueApollo);

const apolloProvider = new VueApollo({
  defaultClient: createDefaultClient(resolvers),
});

export default (containerId = '#js-ci-lint') => {
  const containerEl = document.querySelector(containerId);
  const { endpoint, lintHelpPagePath, pipelineSimulationHelpPagePath } = containerEl.dataset;

  return new Vue({
    el: containerEl,
    apolloProvider,
    render(createElement) {
      return createElement(CiLint, {
        props: {
          endpoint,
          lintHelpPagePath,
          pipelineSimulationHelpPagePath,
        },
      });
    },
  });
};