Commit 40a85ded authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'swimlane-dups' into 'master'

Fix swimlanes duplicate epics

See merge request gitlab-org/gitlab!44728
parents 9bc30dc1 4ef0dd4e
import Vue from 'vue';
import { union } from 'lodash';
import { union, unionBy } from 'lodash';
import mutationsCE, { addIssueToList, removeIssueFromList } from '~/boards/stores/mutations';
import { moveIssueListHelper } from '~/boards/boards_util';
import { s__ } from '~/locale';
......@@ -130,7 +130,7 @@ export default {
},
[mutationTypes.RECEIVE_EPICS_SUCCESS]: (state, epics) => {
Vue.set(state, 'epics', union(state.epics || [], epics));
Vue.set(state, 'epics', unionBy(state.epics || [], epics, 'id'));
},
[mutationTypes.RESET_EPICS]: state => {
......
---
title: Fix swimlanes duplicate epics
merge_request: 44728
author:
type: fixed
......@@ -232,6 +232,17 @@ describe('RECEIVE_EPICS_SUCCESS', () => {
expect(state.epics).toEqual(mockEpics);
});
it("doesn't add duplicate epics", () => {
state = {
...state,
epics: mockEpics,
};
mutations.RECEIVE_EPICS_SUCCESS(state, mockEpics);
expect(state.epics).toEqual(mockEpics);
});
});
describe('RESET_EPICS', () => {
......
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