Commit c287c018 authored by Clement Ho's avatar Clement Ho

Remove unnecessary element checks

parent e658ca96
...@@ -16,64 +16,58 @@ export default () => { ...@@ -16,64 +16,58 @@ export default () => {
mediator.fetchPipeline(); mediator.fetchPipeline();
const pipelineGraphEl = document.querySelector('#js-pipeline-graph-vue'); // eslint-disable-next-line
if (pipelineGraphEl) { new Vue({
// eslint-disable-next-line el: '#js-pipeline-graph-vue',
new Vue({ components: {
el: pipelineGraphEl, pipelineGraph,
components: { },
pipelineGraph, data() {
}, return {
data() { mediator,
return { };
mediator, },
}; render(createElement) {
}, return createElement('pipeline-graph', {
render(createElement) { props: {
return createElement('pipeline-graph', { isLoading: this.mediator.state.isLoading,
props: { pipeline: this.mediator.store.state.pipeline,
isLoading: this.mediator.state.isLoading, },
pipeline: this.mediator.store.state.pipeline, });
}, },
}); });
},
});
}
const pipelineHeaderEl = document.querySelector('#js-pipeline-header-vue'); // eslint-disable-next-line
if (pipelineHeaderEl) { new Vue({
// eslint-disable-next-line el: '#js-pipeline-header-vue',
new Vue({ components: {
el: pipelineHeaderEl, pipelineHeader,
components: { },
pipelineHeader, data() {
}, return {
data() { mediator,
return { };
mediator, },
}; created() {
eventHub.$on('headerPostAction', this.postAction);
},
beforeDestroy() {
eventHub.$off('headerPostAction', this.postAction);
},
methods: {
postAction(action) {
this.mediator.service.postAction(action.path)
.then(() => this.mediator.refreshPipeline())
.catch(() => Flash(__('An error occurred while making the request.')));
}, },
created() { },
eventHub.$on('headerPostAction', this.postAction); render(createElement) {
}, return createElement('pipeline-header', {
beforeDestroy() { props: {
eventHub.$off('headerPostAction', this.postAction); isLoading: this.mediator.state.isLoading,
}, pipeline: this.mediator.store.state.pipeline,
methods: {
postAction(action) {
this.mediator.service.postAction(action.path)
.then(() => this.mediator.refreshPipeline())
.catch(() => Flash(__('An error occurred while making the request.')));
}, },
}, });
render(createElement) { },
return createElement('pipeline-header', { });
props: {
isLoading: this.mediator.state.isLoading,
pipeline: this.mediator.store.state.pipeline,
},
});
},
});
}
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment