Commit 0dfe7d74 authored by NataliaTepluhina's avatar NataliaTepluhina Committed by Natalia Tepluhina

Added cloneDeep to prevent mutating cache

Changelog: changed
parent 9ea25a71
<script>
import { GlAlert, GlButton, GlButtonGroup } from '@gitlab/ui';
import dateFormat from 'dateformat';
import { cloneDeep } from 'lodash';
import BurnupQuery from 'shared_queries/burndown_chart/burnup.query.graphql';
import createFlash from '~/flash';
import axios from '~/lib/utils/axios_utils';
......@@ -200,10 +201,12 @@ export default {
setIssueSelected(selected) {
this.issuesSelected = selected;
},
padSparseBurnupData(sparseBurnupData) {
padSparseBurnupData(data) {
// if we don't have data for the startDate, we still want to draw a point at 0
// on the chart, so add an item to the start of the array
const sparseBurnupData = cloneDeep(data);
const hasDataForStartDate = sparseBurnupData.find((d) => d.date === this.startDate);
if (!hasDataForStartDate) {
sparseBurnupData.unshift({
date: this.startDate,
......
......@@ -9,7 +9,7 @@ import BurnCharts from './components/burn_charts.vue';
Vue.use(VueApollo);
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(),
defaultClient: createDefaultClient({}, { assumeImmutableResults: true }),
});
export default () => {
......
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