diff options
author | Phil Hughes <me@iamphill.com> | 2018-05-23 16:22:38 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-05-24 12:38:02 +0300 |
commit | 5e79276b53f61cbd727411ed33e71d5b6fa5ca54 (patch) | |
tree | 602b13c443389e18c8471fe2a6041b9a4c966260 /app/assets/javascripts/ide/stores/modules/pipelines/getters.js | |
parent | cfe4d2f29dcdcfad96ae7ba5a5eb822fbe46a9a7 (diff) |
improve API calls by calling internal API to get data
render job items (needs improvements to components)
Diffstat (limited to 'app/assets/javascripts/ide/stores/modules/pipelines/getters.js')
-rw-r--r-- | app/assets/javascripts/ide/stores/modules/pipelines/getters.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/assets/javascripts/ide/stores/modules/pipelines/getters.js b/app/assets/javascripts/ide/stores/modules/pipelines/getters.js index e1f55bcd933..99b4554a96e 100644 --- a/app/assets/javascripts/ide/stores/modules/pipelines/getters.js +++ b/app/assets/javascripts/ide/stores/modules/pipelines/getters.js @@ -1,9 +1,9 @@ export const hasLatestPipeline = state => !state.isLoadingPipeline && !!state.latestPipeline; -export const failedJobs = state => +export const failedJobsCount = state => state.stages.reduce( - (acc, stage) => acc.concat(stage.jobs.filter(job => job.status === 'failed')), - [], + (acc, stage) => acc + stage.jobs.filter(j => j.status.label === 'failed').length, + 0, ); export const jobsCount = state => state.stages.reduce((acc, stage) => acc + stage.jobs.length, 0); |