Commit 429fae4b authored by Florie Guibert's avatar Florie Guibert

Reload when Switching from Swimlanes to Board

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