From b4aade59c04f1b3f0a29eeb523419835518cee65 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Mon, 26 Jun 2017 21:52:14 +0100 Subject: [PATCH] First iteration --- .../components/graph/graph_component.vue | 27 ++++---- .../components/graph/linked_pipeline.vue | 17 +++++ .../graph/linked_pipelines_column.vue | 59 +++++++++++------- app/assets/javascripts/pipelines/constants.js | 2 + .../pipelines/pipeline_details_bundle.js | 4 +- .../javascripts/pipelines/stores/mock.js | 1 + .../pipelines/stores/pipeline_store.js | 62 ++++++++++++++++++- 7 files changed, 138 insertions(+), 34 deletions(-) create mode 100644 app/assets/javascripts/pipelines/constants.js create mode 100644 app/assets/javascripts/pipelines/stores/mock.js diff --git a/app/assets/javascripts/pipelines/components/graph/graph_component.vue b/app/assets/javascripts/pipelines/components/graph/graph_component.vue index e645a1f41837a0..aa47c88db69dc5 100644 --- a/app/assets/javascripts/pipelines/components/graph/graph_component.vue +++ b/app/assets/javascripts/pipelines/components/graph/graph_component.vue @@ -2,6 +2,7 @@ import linkedPipelinesColumn from './linked_pipelines_column.vue'; import stageColumnComponent from './stage_column_component.vue'; import loadingIcon from '../../../vue_shared/components/loading_icon.vue'; + import { UPSTREAM, DOWNSTREAM } from '../../constants'; export default { props: { @@ -14,23 +15,27 @@ required: true, }, }, - components: { linkedPipelinesColumn, stageColumnComponent, loadingIcon, }, + data() { + return { + UPSTREAM, + DOWNSTREAM, + }; + }, + created() { + console.log(this.pipeline); + }, computed: { - graph() { - return this.pipeline.details && this.pipeline.details.stages; - }, triggered() { - return this.pipeline.triggered || []; + return this.pipeline.downstreams || []; }, triggeredBy() { - const response = this.pipeline.triggered_by; - return response ? [response] : []; + return this.pipeline.upstreams; }, hasTriggered() { return !!this.triggered.length; @@ -79,7 +84,7 @@ v-if="hasTriggeredBy" :linked-pipelines="triggeredBy" column-title="Upstream" - graph-position="left" + :type="UPSTREAM" />