debian-mirror-gitlab/app/assets/javascripts/jobs/job_details_bundle.js

63 lines
1.5 KiB
JavaScript
Raw Normal View History

2017-09-10 17:25:29 +05:30
import Vue from 'vue';
import JobMediator from './job_details_mediator';
import jobHeader from './components/header.vue';
import detailsBlock from './components/sidebar_details_block.vue';
2018-03-27 19:54:05 +05:30
export default () => {
2018-11-08 19:23:39 +05:30
const { dataset } = document.getElementById('js-job-details-vue');
2017-09-10 17:25:29 +05:30
const mediator = new JobMediator({ endpoint: dataset.endpoint });
mediator.fetchJob();
// Header
// eslint-disable-next-line no-new
new Vue({
el: '#js-build-header-vue',
2018-03-17 18:26:18 +05:30
components: {
jobHeader,
},
2017-09-10 17:25:29 +05:30
data() {
return {
mediator,
};
},
mounted() {
this.mediator.initBuildClass();
},
render(createElement) {
return createElement('job-header', {
props: {
isLoading: this.mediator.state.isLoading,
job: this.mediator.store.state.job,
},
});
},
});
// Sidebar information block
2018-10-15 14:42:47 +05:30
const detailsBlockElement = document.getElementById('js-details-block-vue');
const detailsBlockDataset = detailsBlockElement.dataset;
2017-09-10 17:25:29 +05:30
// eslint-disable-next-line
new Vue({
2018-10-15 14:42:47 +05:30
el: detailsBlockElement,
2018-03-17 18:26:18 +05:30
components: {
detailsBlock,
},
2017-09-10 17:25:29 +05:30
data() {
return {
mediator,
};
},
render(createElement) {
return createElement('details-block', {
props: {
isLoading: this.mediator.state.isLoading,
job: this.mediator.store.state.job,
2018-05-09 12:01:36 +05:30
runnerHelpUrl: dataset.runnerHelpUrl,
2018-11-20 20:47:30 +05:30
terminalPath: detailsBlockDataset.terminalPath,
2017-09-10 17:25:29 +05:30
},
});
},
});
2018-03-27 19:54:05 +05:30
};