Commit 7f5ae2e8 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Changed how the backend response is handled for when instead of series

parent 851ada82
......@@ -68,8 +68,8 @@ export default function createTimeSeries(queryData, graphWidth, graphHeight, gra
.y1(d => timeSeriesScaleY(d.value));
const timeSeriesMetricLabel = timeSeries.metric[Object.keys(timeSeries.metric)[0]];
const seriesCustomizationData = queryData.series != null &&
_.findWhere(queryData.series[0].series,
const seriesCustomizationData = queryData.when != null &&
_.findWhere(queryData.when[0].series,
{ value: timeSeriesMetricLabel });
if (seriesCustomizationData != null) {
metricTag = seriesCustomizationData.value || timeSeriesMetricLabel;
......@@ -90,4 +90,3 @@ export default function createTimeSeries(queryData, graphWidth, graphHeight, gra
};
});
}
......@@ -93,7 +93,7 @@ describe('GraphLegend', () => {
const component = createComponent(defaultValuesComponent);
const titles = component.$el.querySelectorAll('.legend-metric-title');
expect(titles[0].textContent.indexOf('hundred(s)')).not.toEqual(-1);
expect(titles[0].textContent.indexOf('1xx')).not.toEqual(-1);
expect(titles[1].textContent.indexOf('2xx')).not.toEqual(-1);
expect(getTextFromNode(component, '.y-label-text')).toEqual(component.yAxisLabel);
});
......
......@@ -27,9 +27,9 @@ describe('Monitoring Paths', () => {
const metricArea = component.$el.querySelector('.metric-area');
const metricLine = component.$el.querySelector('.metric-line');
expect(metricArea.getAttribute('fill')).toBe('#8dd5aa');
expect(metricArea.getAttribute('fill')).toBe('#8fbce8');
expect(metricArea.getAttribute('d')).toBe(firstTimeSeries.areaPath);
expect(metricLine.getAttribute('stroke')).toBe('#1aaa55');
expect(metricLine.getAttribute('stroke')).toBe('#1f78d1');
expect(metricLine.getAttribute('d')).toBe(firstTimeSeries.linePath);
});
});
......@@ -6347,7 +6347,7 @@ export const singleRowMetricsMultipleSeries = [
]
},
],
'series': [
'when': [
{
'value': 'hundred(s)',
'color': 'green',
......
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