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);
},
});
}
|