Commit 83dede41 authored by Simon Knox's avatar Simon Knox

Merge branch '254844-reload-issues-when-switching-back-from-swimlanes-view-to-board' into 'master'

Reload when Switching from Swimlanes to Board

See merge request gitlab-org/gitlab!43366
parents 75da09d7 429fae4b
...@@ -132,6 +132,7 @@ export default () => { ...@@ -132,6 +132,7 @@ export default () => {
eventHub.$on('clearDetailIssue', this.clearDetailIssue); eventHub.$on('clearDetailIssue', this.clearDetailIssue);
sidebarEventHub.$on('toggleSubscription', this.toggleSubscription); sidebarEventHub.$on('toggleSubscription', this.toggleSubscription);
eventHub.$on('performSearch', this.performSearch); eventHub.$on('performSearch', this.performSearch);
eventHub.$on('initialBoardLoad', this.initialBoardLoad);
}, },
beforeDestroy() { beforeDestroy() {
eventHub.$off('updateTokens', this.updateTokens); eventHub.$off('updateTokens', this.updateTokens);
...@@ -139,6 +140,7 @@ export default () => { ...@@ -139,6 +140,7 @@ export default () => {
eventHub.$off('clearDetailIssue', this.clearDetailIssue); eventHub.$off('clearDetailIssue', this.clearDetailIssue);
sidebarEventHub.$off('toggleSubscription', this.toggleSubscription); sidebarEventHub.$off('toggleSubscription', this.toggleSubscription);
eventHub.$off('performSearch', this.performSearch); eventHub.$off('performSearch', this.performSearch);
eventHub.$off('initialBoardLoad', this.initialBoardLoad);
}, },
mounted() { mounted() {
this.filterManager = new FilteredSearchBoards(boardsStore.filter, true, boardsStore.cantEdit); this.filterManager = new FilteredSearchBoards(boardsStore.filter, true, boardsStore.cantEdit);
...@@ -149,6 +151,12 @@ export default () => { ...@@ -149,6 +151,12 @@ export default () => {
boardsStore.disabled = this.disabled; boardsStore.disabled = this.disabled;
if (!gon.features.graphqlBoardLists) { if (!gon.features.graphqlBoardLists) {
this.initialBoardLoad();
}
},
methods: {
...mapActions(['setInitialBoardData', 'setFilters', 'fetchEpicsSwimlanes', 'resetIssues']),
initialBoardLoad() {
boardsStore boardsStore
.all() .all()
.then(res => res.data) .then(res => res.data)
...@@ -161,10 +169,7 @@ export default () => { ...@@ -161,10 +169,7 @@ export default () => {
.catch(() => { .catch(() => {
Flash(__('An error occurred while fetching the board lists. Please try again.')); Flash(__('An error occurred while fetching the board lists. Please try again.'));
}); });
}
}, },
methods: {
...mapActions(['setInitialBoardData', 'setFilters', 'fetchEpicsSwimlanes', 'resetIssues']),
updateTokens() { updateTokens() {
this.filterManager.updateTokens(); this.filterManager.updateTokens();
}, },
......
...@@ -11,6 +11,7 @@ import boardsStoreEE from './boards_store_ee'; ...@@ -11,6 +11,7 @@ import boardsStoreEE from './boards_store_ee';
import * as types from './mutation_types'; import * as types from './mutation_types';
import { fullEpicId } from '../boards_util'; import { fullEpicId } from '../boards_util';
import { formatListIssues, fullBoardId } from '~/boards/boards_util'; import { formatListIssues, fullBoardId } from '~/boards/boards_util';
import eventHub from '~/boards/eventhub';
import createDefaultClient from '~/lib/graphql'; import createDefaultClient from '~/lib/graphql';
import epicsSwimlanesQuery from '../queries/epics_swimlanes.query.graphql'; import epicsSwimlanesQuery from '../queries/epics_swimlanes.query.graphql';
...@@ -220,6 +221,9 @@ export default { ...@@ -220,6 +221,9 @@ export default {
} }
}) })
.catch(() => commit(types.RECEIVE_SWIMLANES_FAILURE)); .catch(() => commit(types.RECEIVE_SWIMLANES_FAILURE));
} else if (!gon.features.graphqlBoardLists) {
boardsStore.create();
eventHub.$emit('initialBoardLoad');
} }
}, },
}; };
...@@ -18,6 +18,7 @@ let mock; ...@@ -18,6 +18,7 @@ let mock;
beforeEach(() => { beforeEach(() => {
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
window.gon = { features: {} };
}); });
afterEach(() => { afterEach(() => {
......
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