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
a82bcc89
Commit
a82bcc89
authored
Jan 22, 2021
by
Sarah Groff Hennigh-Palermo
Committed by
Scott Hampton
Jan 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pipeline Graph: Scroll downstream pipeline into view on load
parent
933a0b75
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
3 deletions
+30
-3
app/assets/javascripts/pipelines/components/graph/constants.js
...ssets/javascripts/pipelines/components/graph/constants.js
+6
-0
app/assets/javascripts/pipelines/components/graph/graph_component.vue
...avascripts/pipelines/components/graph/graph_component.vue
+10
-1
app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue
...ts/pipelines/components/graph/linked_pipelines_column.vue
+14
-2
No files found.
app/assets/javascripts/pipelines/components/graph/constants.js
View file @
a82bcc89
...
@@ -2,5 +2,11 @@ export const DOWNSTREAM = 'downstream';
...
@@ -2,5 +2,11 @@ export const DOWNSTREAM = 'downstream';
export
const
MAIN
=
'
main
'
;
export
const
MAIN
=
'
main
'
;
export
const
UPSTREAM
=
'
upstream
'
;
export
const
UPSTREAM
=
'
upstream
'
;
/*
this value is based on the gl-pipeline-job-width class
plus some extra for the margins
*/
export
const
ONE_COL_WIDTH
=
180
;
export
const
REST
=
'
rest
'
;
export
const
REST
=
'
rest
'
;
export
const
GRAPHQL
=
'
graphql
'
;
export
const
GRAPHQL
=
'
graphql
'
;
app/assets/javascripts/pipelines/components/graph/graph_component.vue
View file @
a82bcc89
...
@@ -3,7 +3,7 @@ import LinkedGraphWrapper from '../graph_shared/linked_graph_wrapper.vue';
...
@@ -3,7 +3,7 @@ import LinkedGraphWrapper from '../graph_shared/linked_graph_wrapper.vue';
import
LinksLayer
from
'
../graph_shared/links_layer.vue
'
;
import
LinksLayer
from
'
../graph_shared/links_layer.vue
'
;
import
LinkedPipelinesColumn
from
'
./linked_pipelines_column.vue
'
;
import
LinkedPipelinesColumn
from
'
./linked_pipelines_column.vue
'
;
import
StageColumnComponent
from
'
./stage_column_component.vue
'
;
import
StageColumnComponent
from
'
./stage_column_component.vue
'
;
import
{
DOWNSTREAM
,
MAIN
,
UPSTREAM
}
from
'
./constants
'
;
import
{
DOWNSTREAM
,
MAIN
,
UPSTREAM
,
ONE_COL_WIDTH
}
from
'
./constants
'
;
import
{
reportToSentry
}
from
'
./utils
'
;
import
{
reportToSentry
}
from
'
./utils
'
;
export
default
{
export
default
{
...
@@ -101,6 +101,13 @@ export default {
...
@@ -101,6 +101,13 @@ export default {
setJob
(
jobName
)
{
setJob
(
jobName
)
{
this
.
hoveredJobName
=
jobName
;
this
.
hoveredJobName
=
jobName
;
},
},
slidePipelineContainer
()
{
this
.
$refs
.
mainPipelineContainer
.
scrollBy
({
left
:
ONE_COL_WIDTH
,
top
:
0
,
behavior
:
'
smooth
'
,
});
},
togglePipelineExpanded
(
jobName
,
expanded
)
{
togglePipelineExpanded
(
jobName
,
expanded
)
{
this
.
pipelineExpanded
=
{
this
.
pipelineExpanded
=
{
expanded
,
expanded
,
...
@@ -116,6 +123,7 @@ export default {
...
@@ -116,6 +123,7 @@ export default {
<
template
>
<
template
>
<div
class=
"js-pipeline-graph"
>
<div
class=
"js-pipeline-graph"
>
<div
<div
ref=
"mainPipelineContainer"
class=
"gl-display-flex gl-position-relative gl-bg-gray-10 gl-white-space-nowrap"
class=
"gl-display-flex gl-position-relative gl-bg-gray-10 gl-white-space-nowrap"
:class=
"
{ 'gl-pipeline-min-h gl-py-5 gl-overflow-auto': !isLinkedPipeline }"
:class=
"
{ 'gl-pipeline-min-h gl-py-5 gl-overflow-auto': !isLinkedPipeline }"
>
>
...
@@ -165,6 +173,7 @@ export default {
...
@@ -165,6 +173,7 @@ export default {
:type=
"$options.pipelineTypeConstants.DOWNSTREAM"
:type=
"$options.pipelineTypeConstants.DOWNSTREAM"
@
downstreamHovered=
"setJob"
@
downstreamHovered=
"setJob"
@
pipelineExpandToggle=
"togglePipelineExpanded"
@
pipelineExpandToggle=
"togglePipelineExpanded"
@
scrollContainer=
"slidePipelineContainer"
@
error=
"onError"
@
error=
"onError"
/>
/>
</
template
>
</
template
>
...
...
app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue
View file @
a82bcc89
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
getPipelineDetails
from
'
shared_queries/pipelines/get_pipeline_details.query.graphql
'
;
import
getPipelineDetails
from
'
shared_queries/pipelines/get_pipeline_details.query.graphql
'
;
import
LinkedPipeline
from
'
./linked_pipeline.vue
'
;
import
LinkedPipeline
from
'
./linked_pipeline.vue
'
;
import
{
LOAD_FAILURE
}
from
'
../../constants
'
;
import
{
LOAD_FAILURE
}
from
'
../../constants
'
;
import
{
UPSTREAM
}
from
'
./constants
'
;
import
{
ONE_COL_WIDTH
,
UPSTREAM
}
from
'
./constants
'
;
import
{
unwrapPipelineData
,
toggleQueryPollingByVisibility
,
reportToSentry
}
from
'
./utils
'
;
import
{
unwrapPipelineData
,
toggleQueryPollingByVisibility
,
reportToSentry
}
from
'
./utils
'
;
export
default
{
export
default
{
...
@@ -28,6 +28,7 @@ export default {
...
@@ -28,6 +28,7 @@ export default {
return
{
return
{
currentPipeline
:
null
,
currentPipeline
:
null
,
loadingPipelineId
:
null
,
loadingPipelineId
:
null
,
minWidth
:
0
,
pipelineExpanded
:
false
,
pipelineExpanded
:
false
,
};
};
},
},
...
@@ -79,6 +80,7 @@ export default {
...
@@ -79,6 +80,7 @@ export default {
},
},
result
()
{
result
()
{
this
.
loadingPipelineId
=
null
;
this
.
loadingPipelineId
=
null
;
this
.
$emit
(
'
scrollContainer
'
);
},
},
error
(
err
,
_vm
,
_key
,
type
)
{
error
(
err
,
_vm
,
_key
,
type
)
{
this
.
$emit
(
'
error
'
,
LOAD_FAILURE
);
this
.
$emit
(
'
error
'
,
LOAD_FAILURE
);
...
@@ -103,6 +105,7 @@ export default {
...
@@ -103,6 +105,7 @@ export default {
if
(
this
.
currentPipeline
?.
id
===
pipeline
.
id
)
{
if
(
this
.
currentPipeline
?.
id
===
pipeline
.
id
)
{
this
.
pipelineExpanded
=
false
;
this
.
pipelineExpanded
=
false
;
this
.
currentPipeline
=
null
;
this
.
currentPipeline
=
null
;
this
.
minWidth
=
0
;
return
;
return
;
}
}
...
@@ -117,6 +120,11 @@ export default {
...
@@ -117,6 +120,11 @@ export default {
*/
*/
this
.
pipelineExpanded
=
true
;
this
.
pipelineExpanded
=
true
;
/*
Min-width is set manually for timing reasons.
*/
this
.
minWidth
=
`
${
ONE_COL_WIDTH
}
px`
;
this
.
getPipelineData
(
pipeline
);
this
.
getPipelineData
(
pipeline
);
},
},
onDownstreamHovered
(
jobName
)
{
onDownstreamHovered
(
jobName
)
{
...
@@ -158,7 +166,11 @@ export default {
...
@@ -158,7 +166,11 @@ export default {
@
pipelineClicked=
"onPipelineClick(pipeline)"
@
pipelineClicked=
"onPipelineClick(pipeline)"
@
pipelineExpandToggle=
"onPipelineExpandToggle"
@
pipelineExpandToggle=
"onPipelineExpandToggle"
/>
/>
<div
v-if=
"isExpanded(pipeline.id)"
class=
"gl-display-inline-block"
>
<div
v-if=
"isExpanded(pipeline.id) && !isUpstream"
:style=
"
{ minWidth }"
class="gl-display-inline-block"
>
<pipeline-graph
<pipeline-graph
v-if=
"currentPipeline"
v-if=
"currentPipeline"
:type=
"type"
:type=
"type"
...
...
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