summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/ide/stores/modules/pipelines/mutations.js
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-05-29 13:09:19 +0100
committerPhil Hughes <me@iamphill.com>2018-05-29 13:09:19 +0100
commit66bf2de830c421c06bef571a87f8d3d48edcad76 (patch)
tree50235dec4a3595e76c5bebe43a64aecdfc20f93c /app/assets/javascripts/ide/stores/modules/pipelines/mutations.js
parentdd17a4840659467628d9390139e4430a05349175 (diff)
downloadgitlab-ce-66bf2de830c421c06bef571a87f8d3d48edcad76.tar.gz
added component specs
Diffstat (limited to 'app/assets/javascripts/ide/stores/modules/pipelines/mutations.js')
-rw-r--r--app/assets/javascripts/ide/stores/modules/pipelines/mutations.js38
1 files changed, 21 insertions, 17 deletions
diff --git a/app/assets/javascripts/ide/stores/modules/pipelines/mutations.js b/app/assets/javascripts/ide/stores/modules/pipelines/mutations.js
index 419be989901..39552c548ea 100644
--- a/app/assets/javascripts/ide/stores/modules/pipelines/mutations.js
+++ b/app/assets/javascripts/ide/stores/modules/pipelines/mutations.js
@@ -38,16 +38,18 @@ export default {
}
},
[types.REQUEST_JOBS](state, id) {
- state.stages = state.stages.map(stage => ({
- ...stage,
- isLoading: id === stage.id ? true : stage.isLoading,
- }));
+ state.stages = state.stages.map(stage =>
+ Object.assign(stage, {
+ isLoading: id === stage.id ? true : stage.isLoading,
+ }),
+ );
},
[types.RECEIVE_JOBS_ERROR](state, id) {
- state.stages = state.stages.map(stage => ({
- ...stage,
- isLoading: id === stage.id ? true : stage.isLoading,
- }));
+ state.stages = state.stages.map(stage =>
+ Object.assign(stage, {
+ isLoading: id === stage.id ? true : stage.isLoading,
+ }),
+ );
},
[types.RECEIVE_JOBS_SUCCESS](state, { id, data }) {
const normalizeData = job => ({
@@ -57,16 +59,18 @@ export default {
path: job.build_path,
});
- state.stages = state.stages.map(stage => ({
- ...stage,
- isLoading: id === stage.id ? false : stage.isLoading,
- jobs: id === stage.id ? data.latest_statuses.map(normalizeData) : stage.jobs,
- }));
+ state.stages = state.stages.map(stage =>
+ Object.assign(stage, {
+ isLoading: id === stage.id ? false : stage.isLoading,
+ jobs: id === stage.id ? data.latest_statuses.map(normalizeData) : stage.jobs,
+ }),
+ );
},
[types.TOGGLE_STAGE_COLLAPSE](state, id) {
- state.stages = state.stages.map(stage => ({
- ...stage,
- isCollapsed: stage.id === id ? !stage.isCollapsed : stage.isCollapsed,
- }));
+ state.stages = state.stages.map(stage =>
+ Object.assign(stage, {
+ isCollapsed: stage.id === id ? !stage.isCollapsed : stage.isCollapsed,
+ }),
+ );
},
};