diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2019-05-23 14:27:54 +0100 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2019-05-24 10:04:42 +0100 |
commit | fe225fd9289acb8d50157703849363de39046bca (patch) | |
tree | 2760fb2f4fa80a20257966a9ad6dcc0519b00e4f /app/assets/javascripts/jobs/store/mutations.js | |
parent | 4ae71c2b4fe8e6731fceadc3426cd70491398fe0 (diff) | |
download | gitlab-ce-fe225fd9289acb8d50157703849363de39046bca.tar.gz |
Set up mock data for stages
Diffstat (limited to 'app/assets/javascripts/jobs/store/mutations.js')
-rw-r--r-- | app/assets/javascripts/jobs/store/mutations.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/assets/javascripts/jobs/store/mutations.js b/app/assets/javascripts/jobs/store/mutations.js index 714a8dec4b2..ad08f27b147 100644 --- a/app/assets/javascripts/jobs/store/mutations.js +++ b/app/assets/javascripts/jobs/store/mutations.js @@ -65,7 +65,10 @@ export default { state.isLoading = false; state.job = job; - state.stages = ((job.pipeline || {}).details || {}).stages || []; + state.stages = + job.pipeline && job.pipeline.details && job.pipeline.details.stages + ? job.pipeline.details.stages + : []; /** * We only update it on the first request @@ -103,7 +106,7 @@ export default { state.isScrolledToBottomBeforeReceivingTrace = toggle; }, - [types.REQUEST_JOBS_FOR_STAGE](state, stage) { + [types.REQUEST_JOBS_FOR_STAGE](state, stage = {}) { state.isLoadingJobs = true; state.selectedStage = stage.name; }, |