Commit c2c04242 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'xanf/fix-anomaly-vue' into 'master'

Fix props mutation in anomaly.vue

See merge request gitlab-org/gitlab!50095
parents 48e4f3fa d11585f9
<script>
import produce from 'immer';
import { flattenDeep, isNumber } from 'lodash';
import { GlChartSeriesLabel } from '@gitlab/ui/dist/charts';
import { roundOffFloat } from '~/lib/utils/common_utils';
......@@ -84,11 +85,13 @@ export default {
metricData() {
const originalMetricQuery = this.graphData.metrics[0];
const metricQuery = { ...originalMetricQuery };
metricQuery.result[0].values = metricQuery.result[0].values.map(([x, y]) => [
x,
y + this.yOffset,
]);
const metricQuery = produce(originalMetricQuery, draftQuery => {
// eslint-disable-next-line no-param-reassign
draftQuery.result[0].values = draftQuery.result[0].values.map(([x, y]) => [
x,
y + this.yOffset,
]);
});
return {
...this.graphData,
type: panelTypes.LINE_CHART,
......
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