Welcome to mirror list, hosted at ThFree Co, Russian Federation.

utils.js « failure_widget « pipelines_list « components « pipelines « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3f395fff7e048e69de3386da406a719dd2770558 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
export const isFailedJob = (job = {}) => {
  return job?.detailedStatus?.group === 'failed' || false;
};

export const sortJobsByStatus = (jobs = []) => {
  const newJobs = [...jobs];

  return newJobs.sort((a) => {
    if (isFailedJob(a)) {
      return -1;
    }

    return 1;
  });
};