Commit b819d38d authored by Phil Hughes's avatar Phil Hughes

Merge branch 'winh-issue-boards-clearDetailIssue' into 'master'

Extract clearDetailIssue() to issue boards store

See merge request gitlab-org/gitlab-ce!28825
parents 101733b5 ed5ecec1
...@@ -48,7 +48,7 @@ export default Vue.extend({ ...@@ -48,7 +48,7 @@ export default Vue.extend({
list.removeIssue(issue); list.removeIssue(issue);
}); });
boardsStore.detail.issue = {}; boardsStore.clearDetailIssue();
}, },
/** /**
* Build the default patch request. * Build the default patch request.
......
...@@ -167,7 +167,7 @@ export default () => { ...@@ -167,7 +167,7 @@ export default () => {
boardsStore.detail.issue = newIssue; boardsStore.detail.issue = newIssue;
}, },
clearDetailIssue() { clearDetailIssue() {
boardsStore.detail.issue = {}; boardsStore.clearDetailIssue();
}, },
toggleSubscription(id) { toggleSubscription(id) {
const { issue } = boardsStore.detail; const { issue } = boardsStore.detail;
......
...@@ -188,6 +188,10 @@ const boardsStore = { ...@@ -188,6 +188,10 @@ const boardsStore = {
updateFiltersUrl() { updateFiltersUrl() {
window.history.pushState(null, null, `?${this.filter.path}`); window.history.pushState(null, null, `?${this.filter.path}`);
}, },
clearDetailIssue() {
this.detail.issue = {};
},
}; };
BoardsStoreEE.initEESpecific(boardsStore); BoardsStoreEE.initEESpecific(boardsStore);
......
...@@ -268,4 +268,14 @@ describe('Store', () => { ...@@ -268,4 +268,14 @@ describe('Store', () => {
}); });
}); });
}); });
describe('clearDetailIssue', () => {
it('resets issue details', () => {
boardsStore.detail.issue = 'something';
boardsStore.clearDetailIssue();
expect(boardsStore.detail.issue).toEqual({});
});
});
}); });
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