Commit e2216b67 authored by Florie Guibert's avatar Florie Guibert Committed by Kushal Pandya

Fix epic fetch timeframe on Roadmap

Fix an issue when scrolling horizontally
on Roadmap and new epics are getting added
to the Roadmap
parent ea151df8
...@@ -54,7 +54,7 @@ export default { ...@@ -54,7 +54,7 @@ export default {
computed: { computed: {
...mapState(['bufferSize', 'epicIid', 'childrenEpics', 'childrenFlags', 'epicIds']), ...mapState(['bufferSize', 'epicIid', 'childrenEpics', 'childrenFlags', 'epicIds']),
emptyRowContainerVisible() { emptyRowContainerVisible() {
return this.epics.length < this.bufferSize; return this.displayedEpics.length < this.bufferSize;
}, },
sectionContainerStyles() { sectionContainerStyles() {
return { return {
......
...@@ -107,13 +107,13 @@ export const receiveEpicsSuccess = ( ...@@ -107,13 +107,13 @@ export const receiveEpicsSuccess = (
}, []); }, []);
commit(types.UPDATE_EPIC_IDS, epicIds); commit(types.UPDATE_EPIC_IDS, epicIds);
dispatch('initItemChildrenFlags', { epics });
if (timeframeExtended) { if (timeframeExtended) {
const updatedEpics = state.epics.concat(epics); const updatedEpics = state.epics.concat(epics);
sortEpics(updatedEpics, state.sortedBy); sortEpics(updatedEpics, state.sortedBy);
commit(types.RECEIVE_EPICS_FOR_TIMEFRAME_SUCCESS, updatedEpics); commit(types.RECEIVE_EPICS_FOR_TIMEFRAME_SUCCESS, updatedEpics);
} else { } else {
dispatch('initItemChildrenFlags', { epics });
commit(types.RECEIVE_EPICS_SUCCESS, epics); commit(types.RECEIVE_EPICS_SUCCESS, epics);
} }
}; };
......
...@@ -155,7 +155,21 @@ describe('Roadmap Vuex Actions', () => { ...@@ -155,7 +155,21 @@ describe('Roadmap Vuex Actions', () => {
payload: [{ ...mockFormattedEpic, newEpic: true }], payload: [{ ...mockFormattedEpic, newEpic: true }],
}, },
], ],
[], [
{
type: 'initItemChildrenFlags',
payload: {
epics: [
{
...mockFormattedEpic,
startDateOutOfRange: true,
endDateOutOfRange: false,
newEpic: true,
},
],
},
},
],
); );
}); });
}); });
......
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