debian-mirror-gitlab/app/assets/javascripts/pages/projects/pipelines/index/index.js

61 lines
2 KiB
JavaScript
Raw Normal View History

2018-03-27 19:54:05 +05:30
import Vue from 'vue';
2020-03-13 15:44:24 +05:30
import { GlToast } from '@gitlab/ui';
import { doesHashExistInUrl } from '~/lib/utils/url_utility';
import {
parseBoolean,
historyReplaceState,
buildUrlWithCurrentLocation,
} from '~/lib/utils/common_utils';
import { __ } from '~/locale';
2018-03-27 19:54:05 +05:30
import PipelinesStore from '../../../../pipelines/stores/pipelines_store';
2020-07-28 23:09:34 +05:30
import pipelinesComponent from '../../../../pipelines/components/pipelines_list/pipelines.vue';
2018-03-27 19:54:05 +05:30
import Translate from '../../../../vue_shared/translate';
Vue.use(Translate);
2020-03-13 15:44:24 +05:30
Vue.use(GlToast);
2018-03-27 19:54:05 +05:30
2018-12-13 13:39:08 +05:30
document.addEventListener(
'DOMContentLoaded',
() =>
new Vue({
el: '#pipelines-list-vue',
components: {
pipelinesComponent,
2018-03-27 19:54:05 +05:30
},
2018-12-13 13:39:08 +05:30
data() {
return {
store: new PipelinesStore(),
};
},
created() {
this.dataset = document.querySelector(this.$options.el).dataset;
2020-03-13 15:44:24 +05:30
if (doesHashExistInUrl('delete_success')) {
this.$toast.show(__('The pipeline has been deleted'));
historyReplaceState(buildUrlWithCurrentLocation());
}
2018-12-13 13:39:08 +05:30
},
render(createElement) {
return createElement('pipelines-component', {
props: {
store: this.store,
endpoint: this.dataset.endpoint,
2020-07-28 23:09:34 +05:30
pipelineScheduleUrl: this.dataset.pipelineScheduleUrl,
2018-12-13 13:39:08 +05:30
helpPagePath: this.dataset.helpPagePath,
emptyStateSvgPath: this.dataset.emptyStateSvgPath,
errorStateSvgPath: this.dataset.errorStateSvgPath,
noPipelinesSvgPath: this.dataset.noPipelinesSvgPath,
autoDevopsPath: this.dataset.helpAutoDevopsPath,
newPipelinePath: this.dataset.newPipelinePath,
2019-02-15 15:39:39 +05:30
canCreatePipeline: parseBoolean(this.dataset.canCreatePipeline),
hasGitlabCi: parseBoolean(this.dataset.hasGitlabCi),
2018-12-13 13:39:08 +05:30
ciLintPath: this.dataset.ciLintPath,
resetCachePath: this.dataset.resetCachePath,
2020-05-24 23:13:21 +05:30
projectId: this.dataset.projectId,
2020-06-23 00:09:42 +05:30
params: JSON.parse(this.dataset.params),
2018-12-13 13:39:08 +05:30
},
});
},
}),
);