Commit 32b8b8df authored by Bryce Johnson's avatar Bryce Johnson

Remove mock code and fix refs to triggered and triggeredBy.

parent 92198c69
......@@ -13,14 +13,6 @@
type: Object,
required: true,
},
triggered: {
type: Array,
required: true,
},
triggeredBy: {
type: Array,
required: true,
},
},
components: {
linkedPipelinesColumn,
......@@ -31,11 +23,17 @@
graph() {
return this.pipeline.details && this.pipeline.details.stages;
},
triggered() {
return this.pipeline.triggered || [];
},
triggeredBy() {
return this.pipeline.triggeredBy || [];
},
hasTriggered() {
return this.triggered.length;
return !!this.triggered.length;
},
hasTriggeredBy() {
return this.triggeredBy.length;
return !!this.triggeredBy.length;
},
},
methods: {
......
......@@ -24,8 +24,6 @@ document.addEventListener('DOMContentLoaded', () => {
props: {
isLoading: this.mediator.state.isLoading,
pipeline: this.mediator.store.state.pipeline,
triggeredBy: this.mediator.store.state.triggeredBy,
triggered: this.mediator.store.state.triggered,
},
});
},
......
......@@ -39,7 +39,6 @@ export default class pipelinesMediator {
successCallback(response) {
const data = response.json();
this.state.isLoading = false;
this.store.storePipeline(data);
}
......
const mockTriggerers = [
{ id: 111, path: 'hello/world/tho', project: { name: 'GitLab Shell' }, details: { status: { icon: 'icon_status_pending', group: 'pending', label: 'pending' } } },
];
const mockTriggereds = [
{ id: 111, path: 'hello/world/tho', project: { name: 'GitLab EE' }, details: { status: { icon: 'icon_status_failed', group: 'failed', label: 'failed' } } },
{ id: 111, path: 'hello/world/tho', project: { name: 'Gitaly' }, details: { status: { icon: 'icon_status_pending', group: 'pending', label: 'pending' } } },
{ id: 111, path: 'hello/world/tho', project: { name: 'GitHub' }, details: { status: { icon: 'icon_status_success', group: 'success', label: 'success' } } },
];
export default class PipelineStore {
constructor() {
this.state = {};
this.state.pipeline = {};
this.state.triggered = [];
this.state.triggeredBy = [];
}
storePipeline(pipeline = {}) {
// single job in first stage
pipeline.details.stages[3].groups = [pipeline.details.stages[0].groups[0]];
// multiple jobs in last stage
// pipeline.details.stages[3].groups.push(pipeline.details.stages[0].groups[0]);
this.state.pipeline = pipeline;
this.state.triggeredBy = mockTriggerers;
// single triggered
// this.state.triggered = [mockTriggereds[0]];
this.state.triggered = mockTriggereds;
}
}
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