Commit 7861503c authored by Fatih Acet's avatar Fatih Acet

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

Extract setListDetail() into issue boards store

See merge request gitlab-org/gitlab-ce!29063
parents 7922270b 89ea4a63
...@@ -66,7 +66,7 @@ export default { ...@@ -66,7 +66,7 @@ export default {
eventHub.$emit('clearDetailIssue'); eventHub.$emit('clearDetailIssue');
} else { } else {
eventHub.$emit('newDetailIssue', this.issue); eventHub.$emit('newDetailIssue', this.issue);
boardsStore.detail.list = this.list; boardsStore.setListDetail(this.list);
} }
} }
}, },
......
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
$(this.$refs.submitButton).enable(); $(this.$refs.submitButton).enable();
boardsStore.setIssueDetail(issue); boardsStore.setIssueDetail(issue);
boardsStore.detail.list = this.list; boardsStore.setListDetail(this.list);
}) })
.catch(() => { .catch(() => {
// Need this because our jQuery very kindly disables buttons on ALL form submissions // Need this because our jQuery very kindly disables buttons on ALL form submissions
......
...@@ -207,6 +207,10 @@ const boardsStore = { ...@@ -207,6 +207,10 @@ const boardsStore = {
eventHub.$emit('updateTokens'); eventHub.$emit('updateTokens');
}, },
setListDetail(newList) {
this.detail.list = newList;
},
updateFiltersUrl() { updateFiltersUrl() {
window.history.pushState(null, null, `?${this.filter.path}`); window.history.pushState(null, null, `?${this.filter.path}`);
}, },
......
...@@ -312,6 +312,17 @@ describe('Store', () => { ...@@ -312,6 +312,17 @@ describe('Store', () => {
}); });
}); });
describe('setListDetail', () => {
it('sets the list detail', () => {
boardsStore.detail.list = 'not a list';
const dummyValue = 'new list';
boardsStore.setListDetail(dummyValue);
expect(boardsStore.detail.list).toEqual(dummyValue);
});
});
describe('clearDetailIssue', () => { describe('clearDetailIssue', () => {
it('resets issue details', () => { it('resets issue details', () => {
boardsStore.detail.issue = 'something'; boardsStore.detail.issue = 'something';
......
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