Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
eb749b95
Commit
eb749b95
authored
Nov 30, 2020
by
Sarah Groff Hennigh-Palermo
Committed by
Andrew Fontaine
Nov 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create legacy linked pipelines
Includes specs as well
parent
2bb6d7d1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
132 additions
and
8 deletions
+132
-8
app/assets/javascripts/pipelines/components/graph/graph_component_legacy.vue
...pts/pipelines/components/graph/graph_component_legacy.vue
+5
-5
app/assets/javascripts/pipelines/components/graph/linked_pipelines_column_legacy.vue
...lines/components/graph/linked_pipelines_column_legacy.vue
+84
-0
spec/frontend/pipelines/graph/graph_component_legacy_spec.js
spec/frontend/pipelines/graph/graph_component_legacy_spec.js
+3
-3
spec/frontend/pipelines/graph/linked_pipelines_column_legacy_spec.js
...nd/pipelines/graph/linked_pipelines_column_legacy_spec.js
+40
-0
No files found.
app/assets/javascripts/pipelines/components/graph/graph_component_legacy.vue
View file @
eb749b95
...
...
@@ -3,16 +3,16 @@ import { escape, capitalize } from 'lodash';
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
StageColumnComponentLegacy
from
'
./stage_column_component_legacy.vue
'
;
import
GraphWidthMixin
from
'
../../mixins/graph_width_mixin
'
;
import
LinkedPipelinesColumn
from
'
./linked_pipelines_column
.vue
'
;
import
LinkedPipelinesColumn
Legacy
from
'
./linked_pipelines_column_legacy
.vue
'
;
import
GraphBundleMixin
from
'
../../mixins/graph_pipeline_bundle_mixin
'
;
import
{
UPSTREAM
,
DOWNSTREAM
,
MAIN
}
from
'
./constants
'
;
export
default
{
name
:
'
PipelineGraphLegacy
'
,
components
:
{
StageColumnComponentLegacy
,
GlLoadingIcon
,
LinkedPipelinesColumn
,
LinkedPipelinesColumnLegacy
,
StageColumnComponentLegacy
,
},
mixins
:
[
GraphWidthMixin
,
GraphBundleMixin
],
props
:
{
...
...
@@ -204,7 +204,7 @@ export default {
@refreshPipelineGraph="requestRefreshPipelineGraph"
/>
<linked-pipelines-column
<linked-pipelines-column
-legacy
v-if=
"hasUpstream"
:type=
"$options.upstream"
:linked-pipelines=
"upstreamPipelines"
...
...
@@ -240,7 +240,7 @@ export default {
/>
</ul>
<linked-pipelines-column
<linked-pipelines-column
-legacy
v-if=
"hasDownstream"
:type=
"$options.downstream"
:linked-pipelines=
"downstreamPipelines"
...
...
app/assets/javascripts/pipelines/components/graph/linked_pipelines_column_legacy.vue
0 → 100644
View file @
eb749b95
<
script
>
import
LinkedPipeline
from
'
./linked_pipeline.vue
'
;
import
{
UPSTREAM
}
from
'
./constants
'
;
export
default
{
components
:
{
LinkedPipeline
,
},
props
:
{
columnTitle
:
{
type
:
String
,
required
:
true
,
},
linkedPipelines
:
{
type
:
Array
,
required
:
true
,
},
type
:
{
type
:
String
,
required
:
true
,
},
projectId
:
{
type
:
Number
,
required
:
true
,
},
},
computed
:
{
columnClass
()
{
const
positionValues
=
{
right
:
'
gl-ml-11
'
,
left
:
'
gl-mr-7
'
,
};
return
`graph-position-
${
this
.
graphPosition
}
${
positionValues
[
this
.
graphPosition
]}
`
;
},
graphPosition
()
{
return
this
.
isUpstream
?
'
left
'
:
'
right
'
;
},
// Refactor string match when BE returns Upstream/Downstream indicators
isUpstream
()
{
return
this
.
type
===
UPSTREAM
;
},
},
methods
:
{
onPipelineClick
(
downstreamNode
,
pipeline
,
index
)
{
this
.
$emit
(
'
linkedPipelineClick
'
,
pipeline
,
index
,
downstreamNode
);
},
onDownstreamHovered
(
jobName
)
{
this
.
$emit
(
'
downstreamHovered
'
,
jobName
);
},
onPipelineExpandToggle
(
jobName
,
expanded
)
{
// Highlighting only applies to downstream pipelines
if
(
this
.
isUpstream
)
{
return
;
}
this
.
$emit
(
'
pipelineExpandToggle
'
,
jobName
,
expanded
);
},
},
};
</
script
>
<
template
>
<div
:class=
"columnClass"
class=
"stage-column linked-pipelines-column"
>
<div
class=
"stage-name linked-pipelines-column-title"
>
{{
columnTitle
}}
</div>
<div
v-if=
"isUpstream"
class=
"cross-project-triangle"
></div>
<ul>
<linked-pipeline
v-for=
"(pipeline, index) in linkedPipelines"
:key=
"pipeline.id"
:class=
"
{
active: pipeline.isExpanded,
'left-connector': pipeline.isExpanded
&&
graphPosition === 'left',
}"
:pipeline="pipeline"
:column-title="columnTitle"
:project-id="projectId"
:type="type"
@pipelineClicked="onPipelineClick($event, pipeline, index)"
@downstreamHovered="onDownstreamHovered"
@pipelineExpandToggle="onPipelineExpandToggle"
/>
</ul>
</div>
</
template
>
spec/frontend/pipelines/graph/graph_component_legacy_spec.js
View file @
eb749b95
...
...
@@ -4,7 +4,7 @@ import { setHTMLFixture } from 'helpers/fixtures';
import
PipelineStore
from
'
~/pipelines/stores/pipeline_store
'
;
import
GraphComponentLegacy
from
'
~/pipelines/components/graph/graph_component_legacy.vue
'
;
import
StageColumnComponentLegacy
from
'
~/pipelines/components/graph/stage_column_component_legacy.vue
'
;
import
linkedPipelinesColumn
from
'
~/pipelines/components/graph/linked_pipelines_column
.vue
'
;
import
LinkedPipelinesColumnLegacy
from
'
~/pipelines/components/graph/linked_pipelines_column_legacy
.vue
'
;
import
graphJSON
from
'
./mock_data_legacy
'
;
import
linkedPipelineJSON
from
'
./linked_pipelines_mock_data
'
;
import
PipelinesMediator
from
'
~/pipelines/pipeline_details_mediator
'
;
...
...
@@ -146,14 +146,14 @@ describe('graph component', () => {
});
it
(
'
should render an upstream pipelines column at first position
'
,
()
=>
{
expect
(
wrapper
.
find
(
linkedPipelinesColumn
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
LinkedPipelinesColumnLegacy
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
'
.stage-column .stage-name
'
).
text
()).
toBe
(
'
Upstream
'
);
});
it
(
'
should render a downstream pipelines column at last position
'
,
()
=>
{
const
stageColumnNames
=
wrapper
.
findAll
(
'
.stage-column .stage-name
'
);
expect
(
wrapper
.
find
(
linkedPipelinesColumn
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
LinkedPipelinesColumnLegacy
).
exists
()).
toBe
(
true
);
expect
(
stageColumnNames
.
at
(
stageColumnNames
.
length
-
1
).
text
()).
toBe
(
'
Downstream
'
);
});
...
...
spec/frontend/pipelines/graph/linked_pipelines_column_legacy_spec.js
0 → 100644
View file @
eb749b95
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
LinkedPipelinesColumnLegacy
from
'
~/pipelines/components/graph/linked_pipelines_column_legacy.vue
'
;
import
LinkedPipeline
from
'
~/pipelines/components/graph/linked_pipeline.vue
'
;
import
{
UPSTREAM
}
from
'
~/pipelines/components/graph/constants
'
;
import
mockData
from
'
./linked_pipelines_mock_data
'
;
describe
(
'
Linked Pipelines Column
'
,
()
=>
{
const
propsData
=
{
columnTitle
:
'
Upstream
'
,
linkedPipelines
:
mockData
.
triggered
,
graphPosition
:
'
right
'
,
projectId
:
19
,
type
:
UPSTREAM
,
};
let
wrapper
;
beforeEach
(()
=>
{
wrapper
=
shallowMount
(
LinkedPipelinesColumnLegacy
,
{
propsData
});
});
afterEach
(()
=>
{
wrapper
.
destroy
();
});
it
(
'
renders the pipeline orientation
'
,
()
=>
{
const
titleElement
=
wrapper
.
find
(
'
.linked-pipelines-column-title
'
);
expect
(
titleElement
.
text
()).
toBe
(
propsData
.
columnTitle
);
});
it
(
'
renders the correct number of linked pipelines
'
,
()
=>
{
const
linkedPipelineElements
=
wrapper
.
findAll
(
LinkedPipeline
);
expect
(
linkedPipelineElements
.
length
).
toBe
(
propsData
.
linkedPipelines
.
length
);
});
it
(
'
renders cross project triangle when column is upstream
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.cross-project-triangle
'
).
exists
()).
toBe
(
true
);
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment