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
191d7c67
Commit
191d7c67
authored
Jan 08, 2019
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renames variable to simplify pipelines code
Renames isCollapsed with isExpanded to reduce code complexity
parent
16b00297
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
35 deletions
+35
-35
ee/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue
...ts/pipelines/components/graph/linked_pipelines_column.vue
+2
-2
ee/app/assets/javascripts/pipelines/mixins/graph_pipeline_bundle_mixin.js
...vascripts/pipelines/mixins/graph_pipeline_bundle_mixin.js
+1
-1
ee/app/assets/javascripts/pipelines/stores/pipeline_store.js
ee/app/assets/javascripts/pipelines/stores/pipeline_store.js
+16
-16
ee/spec/javascripts/pipelines/stores/pipeline_store.js
ee/spec/javascripts/pipelines/stores/pipeline_store.js
+14
-14
spec/javascripts/pipelines/graph/graph_component_spec.js
spec/javascripts/pipelines/graph/graph_component_spec.js
+2
-2
No files found.
ee/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue
View file @
191d7c67
...
...
@@ -37,8 +37,8 @@ export default {
:key=
"pipeline.id"
:class=
"
{
'flat-connector-before': index === 0
&&
graphPosition === 'right',
active:
!pipeline.isCollaps
ed || pipeline.isLoading,
'left-connector':
!pipeline.isCollaps
ed
&&
graphPosition === 'left',
active:
pipeline.isExpand
ed || pipeline.isLoading,
'left-connector':
pipeline.isExpand
ed
&&
graphPosition === 'left',
}"
:pipeline-id="pipeline.id"
:project-name="pipeline.project.name"
...
...
ee/app/assets/javascripts/pipelines/mixins/graph_pipeline_bundle_mixin.js
View file @
191d7c67
...
...
@@ -14,7 +14,7 @@ export default {
* @param {Object} pipeline The clicked pipeline
*/
clickPipeline
(
method
,
storeKey
,
resetStoreKey
,
pipeline
,
pollKey
)
{
if
(
pipeline
.
isCollaps
ed
)
{
if
(
!
pipeline
.
isExpand
ed
)
{
this
.
mediator
[
method
](
pipeline
);
}
else
{
this
.
mediator
.
resetPipeline
(
storeKey
,
pipeline
,
resetStoreKey
,
pollKey
);
...
...
ee/app/assets/javascripts/pipelines/stores/pipeline_store.js
View file @
191d7c67
...
...
@@ -22,9 +22,9 @@ export default class PipelineStore extends CePipelineStore {
}
/**
* For the triggered pipelines, parses them to add `isLoading` and `is
Collaps
ed` keys
* For the triggered pipelines, parses them to add `isLoading` and `is
Expand
ed` keys
*
* For the triggered_by pipeline, parsed the object to add `isLoading` and `is
Collaps
ed` keys
* For the triggered_by pipeline, parsed the object to add `isLoading` and `is
Expand
ed` keys
* and saves it as an array
*
* @param {Object} pipeline
...
...
@@ -40,7 +40,7 @@ export default class PipelineStore extends CePipelineStore {
);
return
Object
.
assign
({},
triggered
,
{
is
Collapsed
:
oldPipeline
?
oldPipeline
.
isCollapsed
:
tru
e
,
is
Expanded
:
oldPipeline
?
oldPipeline
.
isExpanded
:
fals
e
,
isLoading
:
oldPipeline
?
oldPipeline
.
isLoading
:
false
,
});
});
...
...
@@ -49,9 +49,9 @@ export default class PipelineStore extends CePipelineStore {
if
(
pipeline
.
triggered_by
)
{
this
.
state
.
triggeredByPipelines
=
[
Object
.
assign
({},
pipeline
.
triggered_by
,
{
is
Collaps
ed
:
this
.
state
.
triggeredByPipelines
.
length
?
this
.
state
.
triggeredByPipelines
[
0
].
is
Collaps
ed
:
tru
e
,
is
Expand
ed
:
this
.
state
.
triggeredByPipelines
.
length
?
this
.
state
.
triggeredByPipelines
[
0
].
is
Expand
ed
:
fals
e
,
isLoading
:
this
.
state
.
triggeredByPipelines
.
length
?
this
.
state
.
triggeredByPipelines
[
0
].
isLoading
:
false
,
...
...
@@ -67,7 +67,7 @@ export default class PipelineStore extends CePipelineStore {
/**
* Called when the user clicks on a pipeline that was triggered by the main one.
*
* Resets is
Collaps
ed and isLoading props for all triggered (downstream) pipelines
* Resets is
Expand
ed and isLoading props for all triggered (downstream) pipelines
* Sets isLoading to true for the requested one.
*
* @param {Object} pipeline
...
...
@@ -89,7 +89,7 @@ export default class PipelineStore extends CePipelineStore {
this
.
updatePipeline
(
pipelinesKeys
.
triggeredPipelines
,
pipeline
,
{
isLoading
:
false
,
is
Collapsed
:
fals
e
},
{
isLoading
:
false
,
is
Expanded
:
tru
e
},
pipelinesKeys
.
triggered
,
response
,
);
...
...
@@ -106,7 +106,7 @@ export default class PipelineStore extends CePipelineStore {
this
.
updatePipeline
(
pipelinesKeys
.
triggeredPipelines
,
pipeline
,
{
isLoading
:
false
,
is
Collapsed
:
tru
e
},
{
isLoading
:
false
,
is
Expanded
:
fals
e
},
pipelinesKeys
.
triggered
,
{},
);
...
...
@@ -120,7 +120,7 @@ export default class PipelineStore extends CePipelineStore {
* Called when the user clicks on the pipeline that triggered the main one.
*
* Handle the request for the upstream pipeline
* Updates the given pipeline with isLoading: true and is
collapsed: fals
e
* Updates the given pipeline with isLoading: true and is
Expanded: tru
e
*
* @param {Object} pipeline
*/
...
...
@@ -138,7 +138,7 @@ export default class PipelineStore extends CePipelineStore {
this
.
updatePipeline
(
pipelinesKeys
.
triggeredByPipelines
,
pipeline
,
{
isLoading
:
false
,
is
Collapsed
:
fals
e
},
{
isLoading
:
false
,
is
Expanded
:
tru
e
},
pipelinesKeys
.
triggeredBy
,
response
,
);
...
...
@@ -152,7 +152,7 @@ export default class PipelineStore extends CePipelineStore {
this
.
updatePipeline
(
pipelinesKeys
.
triggeredByPipelines
,
pipeline
,
{
isLoading
:
false
,
is
Collapsed
:
tru
e
},
{
isLoading
:
false
,
is
Expanded
:
fals
e
},
pipelinesKeys
.
triggeredBy
,
{},
);
...
...
@@ -173,7 +173,7 @@ export default class PipelineStore extends CePipelineStore {
*/
static
parsePipeline
(
pipeline
)
{
return
Object
.
assign
({},
pipeline
,
{
is
Collapsed
:
tru
e
,
is
Expanded
:
fals
e
,
isLoading
:
false
,
});
}
...
...
@@ -190,7 +190,7 @@ export default class PipelineStore extends CePipelineStore {
/**
* Updates the pipelines to reflect which one was requested.
* It sets isLoading to true and is
Collaps
ed to false
* It sets isLoading to true and is
Expand
ed to false
*
* @param {String} storeKey which property to update: `triggeredPipelines|triggeredByPipelines`
* @param {Object} pipeline the requested pipeline
...
...
@@ -198,7 +198,7 @@ export default class PipelineStore extends CePipelineStore {
updateStoreOnRequest
(
storeKey
,
pipeline
)
{
this
.
state
[
storeKey
]
=
this
.
state
[
storeKey
].
map
(
triggered
=>
{
if
(
triggered
.
id
===
pipeline
.
id
)
{
return
Object
.
assign
({},
triggered
,
{
isLoading
:
true
,
is
Collapsed
:
fals
e
});
return
Object
.
assign
({},
triggered
,
{
isLoading
:
true
,
is
Expanded
:
tru
e
});
}
// reset the others, in case another was one opened
return
PipelineStore
.
parsePipeline
(
triggered
);
...
...
@@ -238,7 +238,7 @@ export default class PipelineStore extends CePipelineStore {
pipeline
,
{
isLoading
:
false
,
is
Collapsed
:
tru
e
,
is
Expanded
:
fals
e
,
},
visiblePipelineKey
,
{},
...
...
ee/spec/javascripts/pipelines/stores/pipeline_store.js
View file @
191d7c67
...
...
@@ -73,16 +73,16 @@ describe('EE Pipeline store', () => {
expect
(
store
.
triggeredPipelines
[
0
].
isLoading
).
toEqual
(
true
);
});
it
(
'
sets is
Collapsed to fals
e for the requested pipeline
'
,
()
=>
{
expect
(
store
.
triggeredPipelines
[
0
].
is
Collapsed
).
toEqual
(
fals
e
);
it
(
'
sets is
Expanded to tru
e for the requested pipeline
'
,
()
=>
{
expect
(
store
.
triggeredPipelines
[
0
].
is
Expanded
).
toEqual
(
tru
e
);
});
it
(
'
sets isLoading to false for the other pipelines
'
,
()
=>
{
expect
(
store
.
triggeredPipelines
[
1
].
isLoading
).
toEqual
(
false
);
});
it
(
'
sets is
Collapsed to tru
e for the other pipelines
'
,
()
=>
{
expect
(
store
.
triggeredPipelines
[
1
].
is
Collapsed
).
toEqual
(
tru
e
);
it
(
'
sets is
Expanded to fals
e for the other pipelines
'
,
()
=>
{
expect
(
store
.
triggeredPipelines
[
1
].
is
Expanded
).
toEqual
(
fals
e
);
});
});
...
...
@@ -104,7 +104,7 @@ describe('EE Pipeline store', () => {
store
.
receiveTriggeredPipelineError
(
receivedPipeline
);
expect
(
store
.
triggeredPipelines
[
0
].
isLoading
).
toEqual
(
false
);
expect
(
store
.
triggeredPipelines
[
0
].
is
Collapsed
).
toEqual
(
tru
e
);
expect
(
store
.
triggeredPipelines
[
0
].
is
Expanded
).
toEqual
(
fals
e
);
expect
(
store
.
triggered
).
toEqual
({});
});
...
...
@@ -121,8 +121,8 @@ describe('EE Pipeline store', () => {
expect
(
store
.
triggeredByPipelines
[
0
].
isLoading
).
toEqual
(
true
);
});
it
(
'
sets is
Collapsed to fals
e for the requested pipeline
'
,
()
=>
{
expect
(
store
.
triggeredByPipelines
[
0
].
is
Collapsed
).
toEqual
(
fals
e
);
it
(
'
sets is
Expanded to tru
e for the requested pipeline
'
,
()
=>
{
expect
(
store
.
triggeredByPipelines
[
0
].
is
Expanded
).
toEqual
(
tru
e
);
});
});
...
...
@@ -144,7 +144,7 @@ describe('EE Pipeline store', () => {
store
.
receiveTriggeredByPipelineError
(
receivedPipeline
);
expect
(
store
.
triggeredByPipelines
[
0
].
isLoading
).
toEqual
(
false
);
expect
(
store
.
triggeredByPipelines
[
0
].
is
Collapsed
).
toEqual
(
tru
e
);
expect
(
store
.
triggeredByPipelines
[
0
].
is
Expanded
).
toEqual
(
fals
e
);
expect
(
store
.
triggeredBy
).
toEqual
({});
});
...
...
@@ -162,8 +162,8 @@ describe('EE Pipeline store', () => {
expect
(
parsed
.
isLoading
).
toEqual
(
false
);
});
it
(
'
adds is
Collapsed key set to tru
e
'
,
()
=>
{
expect
(
parsed
.
is
Collapsed
).
toEqual
(
tru
e
);
it
(
'
adds is
Expanded key set to fals
e
'
,
()
=>
{
expect
(
parsed
.
is
Expanded
).
toEqual
(
fals
e
);
});
});
...
...
@@ -188,10 +188,10 @@ describe('EE Pipeline store', () => {
expect
(
store
.
triggeredPipelines
[
1
].
isLoading
).
isLoading
(
true
);
});
it
(
'
sets clicked pipeline is
Collapsed to fals
e
'
,
()
=>
{
it
(
'
sets clicked pipeline is
Expanded to tru
e
'
,
()
=>
{
store
.
updateStoreOnRequest
(
'
triggeredPipelines
'
,
store
.
triggeredPipelines
[
1
]);
expect
(
store
.
triggeredPipelines
[
1
].
is
Collapsed
).
isLoading
(
fals
e
);
expect
(
store
.
triggeredPipelines
[
1
].
is
Expanded
).
isLoading
(
tru
e
);
});
});
...
...
@@ -225,12 +225,12 @@ describe('EE Pipeline store', () => {
const
clickedPipeline
=
store
.
triggeredPipelines
[
1
];
// open it first
clickedPipeline
.
is
Collapsed
=
fals
e
;
clickedPipeline
.
is
Expanded
=
tru
e
;
store
.
triggered
=
clickedPipeline
;
store
.
closePipeline
(
'
triggeredPipelines
'
,
clickedPipeline
,
'
triggered
'
);
expect
(
store
.
triggeredPipelines
[
1
].
is
Collapsed
).
toEqual
(
fals
e
);
expect
(
store
.
triggeredPipelines
[
1
].
is
Expanded
).
toEqual
(
tru
e
);
expect
(
store
.
triggered
).
toEqual
({});
});
});
...
...
spec/javascripts/pipelines/graph/graph_component_spec.js
View file @
191d7c67
...
...
@@ -122,7 +122,7 @@ describe('graph component', () => {
isLoading
:
false
,
pipeline
:
graphJSON
,
triggeredByPipelines
:
[
Object
.
assign
({},
linkedPipelineJSON
.
triggered_by
,
{
is
Collapsed
:
fals
e
}),
Object
.
assign
({},
linkedPipelineJSON
.
triggered_by
,
{
is
Expanded
:
tru
e
}),
],
triggeredPipelines
:
linkedPipelineJSON
.
triggered
,
triggeredBy
:
linkedPipelineJSON
.
triggered_by
,
...
...
@@ -151,7 +151,7 @@ describe('graph component', () => {
pipeline
:
graphJSON
,
triggeredByPipelines
:
[
linkedPipelineJSON
.
triggered_by
],
triggeredPipelines
:
[
Object
.
assign
({},
linkedPipelineJSON
.
triggered
[
0
],
{
is
Collapsed
:
fals
e
}),
Object
.
assign
({},
linkedPipelineJSON
.
triggered
[
0
],
{
is
Expanded
:
tru
e
}),
],
triggered
:
linkedPipelineJSON
.
triggered
[
0
],
});
...
...
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