Commit 0e078807 authored by Simon Knox's avatar Simon Knox

Merge branch...

Merge branch '331116-refactor-burnup-charts-application-to-update-apollo-cache-in-immutable-way' into 'master'

Refactor Burnup charts application to update Apollo cache immutably

See merge request gitlab-org/gitlab!67762
parents c6384966 0dfe7d74
<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