summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pages/projects/pipelines/index/index.js
blob: a84e2790680217be70fd64f6f2a1af9e63918b61 (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
39
40
import Vue from 'vue';
import PipelinesStore from '../../../../pipelines/stores/pipelines_store';
import pipelinesComponent from '../../../../pipelines/components/pipelines.vue';
import Translate from '../../../../vue_shared/translate';
import { convertPermissionToBoolean } from '../../../../lib/utils/common_utils';

Vue.use(Translate);

document.addEventListener('DOMContentLoaded', () => new Vue({
  el: '#pipelines-list-vue',
  components: {
    pipelinesComponent,
  },
  data() {
    return {
      store: new PipelinesStore(),
    };
  },
  created() {
    this.dataset = document.querySelector(this.$options.el).dataset;
  },
  render(createElement) {
    return createElement('pipelines-component', {
      props: {
        store: this.store,
        endpoint: this.dataset.endpoint,
        helpPagePath: this.dataset.helpPagePath,
        emptyStateSvgPath: this.dataset.emptyStateSvgPath,
        errorStateSvgPath: this.dataset.errorStateSvgPath,
        noPipelinesSvgPath: this.dataset.noPipelinesSvgPath,
        autoDevopsPath: this.dataset.helpAutoDevopsPath,
        newPipelinePath: this.dataset.newPipelinePath,
        canCreatePipeline: convertPermissionToBoolean(this.dataset.canCreatePipeline),
        hasGitlabCi: convertPermissionToBoolean(this.dataset.hasGitlabCi),
        ciLintPath: this.dataset.ciLintPath,
        resetCachePath: this.dataset.resetCachePath,
      },
    });
  },
}));