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({
list.removeIssue(issue);
});
boardsStore.detail.issue = {};
boardsStore.clearDetailIssue();
},
/**
* Build the default patch request.
......
......@@ -167,7 +167,7 @@ export default () => {
boardsStore.detail.issue = newIssue;
},
clearDetailIssue() {
boardsStore.detail.issue = {};
boardsStore.clearDetailIssue();
},
toggleSubscription(id) {
const { issue } = boardsStore.detail;
......
......@@ -188,6 +188,10 @@ const boardsStore = {
updateFiltersUrl() {
window.history.pushState(null, null, `?${this.filter.path}`);
},
clearDetailIssue() {
this.detail.issue = {};
},
};
BoardsStoreEE.initEESpecific(boardsStore);
......
......@@ -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