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

index.js « inherited_ci_variables « ci « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 324aae2a57337deba454e23dcfceee1fddeda371 (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
32
33
34
35
36
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
import { generateCacheConfig, resolvers } from '../ci_variable_list/graphql/settings';
import InheritedCiVariables from './components/inherited_ci_variables_app.vue';

export default (containerId = 'js-inherited-group-ci-variables') => {
  const el = document.getElementById(containerId);

  if (!el) {
    return;
  }

  const { projectPath } = el.dataset;

  Vue.use(VueApollo);
  const apolloProvider = new VueApollo({
    defaultClient: createDefaultClient(
      resolvers,
      generateCacheConfig(false), // set to true if we're using key-set pagination
    ),
  });

  // eslint-disable-next-line consistent-return
  return new Vue({
    el,
    apolloProvider,
    provide: {
      isInheritedGroupVars: true,
      projectPath,
    },
    render(createElement) {
      return createElement(InheritedCiVariables);
    },
  });
};