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

mount_branch_rules.js « branch_rules « repository « settings « projects « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a8736c87e223ebb92d175fc4855449891c13cc4a (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
37
38
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
import BranchRulesApp from '~/projects/settings/repository/branch_rules/app.vue';
import { parseBoolean } from '~/lib/utils/common_utils';

Vue.use(VueApollo);

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

export default function mountBranchRules(el) {
  if (!el) return null;

  const {
    projectPath,
    branchRulesPath,
    showCodeOwners,
    showStatusChecks,
    showApprovers,
  } = el.dataset;

  return new Vue({
    el,
    apolloProvider,
    provide: {
      projectPath,
      branchRulesPath,
      showCodeOwners: parseBoolean(showCodeOwners),
      showStatusChecks: parseBoolean(showStatusChecks),
      showApprovers: parseBoolean(showApprovers),
    },
    render(createElement) {
      return createElement(BranchRulesApp);
    },
  });
}