Commit 24281d62 authored by Martin Wortschack's avatar Martin Wortschack Committed by Filipa Lacerda

Add metric chart component to app

- Leverage MetricChart component in
productivity analytics app
parent 91aea099
......@@ -107,8 +107,7 @@ export const getColumnChartDatazoomOption = state => chartKey => {
};
};
export const isSelectedMetric = state => ({ metric, chartKey }) =>
state.charts[chartKey].params.metricType === metric;
export const getSelectedMetric = state => chartKey => state.charts[chartKey].params.metricType;
export const hasNoAccessError = state =>
state.charts[chartKeys.main].errorCode === httpStatus.FORBIDDEN;
......
......@@ -178,6 +178,19 @@ describe('Productivity analytics chart getters', () => {
});
});
describe('getSelectedMetric', () => {
it('returns the currently selected metric for a given chartKey', () => {
const metricType = 'time_to_last_commit';
state.charts[chartKeys.timeBasedHistogram].params = {
metricType,
};
expect(getters.getSelectedMetric(state)(chartKeys.timeBasedHistogram)).toBe(
'time_to_last_commit',
);
});
});
describe('hasNoAccessError', () => {
it('returns true if errorCode is set to 403', () => {
state.charts[chartKeys.main].errorCode = 403;
......
......@@ -15728,9 +15728,6 @@ msgstr ""
msgid "There is no data available. Please change your selection."
msgstr ""
msgid "There is no data for the selected metric. Please change your selection."
msgstr ""
msgid "There was a problem communicating with your device."
msgstr ""
......@@ -17981,7 +17978,7 @@ msgstr ""
msgid "You can easily install a Runner on a Kubernetes cluster. %{link_to_help_page}"
msgstr ""
msgid "You can filter by \"days to merge\" by clicking on the columns in the chart."
msgid "You can filter by 'days to merge' by clicking on the columns in the chart."
msgstr ""
msgid "You can invite a new member to <strong>%{project_name}</strong> or invite another group."
......
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