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

utils.js « info « commit_box « projects « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ea7eb35cbaf930c89b2ae5217a79c78ec05abfd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
export const formatStages = (graphQLStages = [], restStages = []) => {
  if (graphQLStages.length !== restStages.length) {
    throw new Error('Rest stages and graphQl stages must be the same length');
  }

  return graphQLStages.map((stage, index) => {
    return {
      name: stage.name,
      status: stage.detailedStatus,
      dropdown_path: restStages[index]?.dropdown_path || '',
      title: restStages[index].title || '',
    };
  });
};