Commit a4d3ac40 authored by Mike Greiling's avatar Mike Greiling

simplify storeMetrics method

parent ce06927b
import _ from 'underscore';
const sortMetrics = metrics => _.chain(metrics).sortBy('weight').sortBy('title').value();
class MonitoringStore {
constructor() {
this.groups = [];
......@@ -43,12 +45,10 @@ class MonitoringStore {
}
storeMetrics(groups = []) {
this.groups = groups.map((group) => {
const currentGroup = group;
currentGroup.metrics = _.chain(group.metrics).sortBy('weight').sortBy('title').value();
currentGroup.metrics = this.createArrayRows(currentGroup.metrics);
return currentGroup;
});
this.groups = groups.map(group => ({
...group,
metrics: this.createArrayRows(sortMetrics(group.metrics)),
}));
}
storeDeploymentData(deploymentData = []) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment