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

getters.js « store « statistics_panel « admin « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1c1868b5bcad5d3ef85e5e267fc0299e20b6fadc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/**
 * Merges the statisticsLabels with the state's data
 * and returns an array of the following form:
 * [{ key: "forks", label: "Forks", value: 50 }]
 */
export const getStatistics = state => labels =>
  Object.keys(labels).map(key => {
    const result = {
      key,
      label: labels[key],
      value: state.statistics && state.statistics[key] ? state.statistics[key] : null,
    };
    return result;
  });