diff options
Diffstat (limited to 'app/assets/javascripts/reports/store/mutations.js')
-rw-r--r-- | app/assets/javascripts/reports/store/mutations.js | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/app/assets/javascripts/reports/store/mutations.js b/app/assets/javascripts/reports/store/mutations.js index acaa98754b0..3bb31d71d8f 100644 --- a/app/assets/javascripts/reports/store/mutations.js +++ b/app/assets/javascripts/reports/store/mutations.js @@ -9,7 +9,7 @@ export default { state.isLoading = true; }, [types.RECEIVE_REPORTS_SUCCESS](state, response) { - state.hasError = response.suites.some(suite => suite.status === 'error'); + state.hasError = response.suites.some((suite) => suite.status === 'error'); state.isLoading = false; @@ -44,7 +44,7 @@ export default { [types.SET_ISSUE_MODAL_DATA](state, payload) { state.modal.title = payload.issue.name; - Object.keys(payload.issue).forEach(key => { + Object.keys(payload.issue).forEach((key) => { if (Object.prototype.hasOwnProperty.call(state.modal.data, key)) { state.modal.data[key] = { ...state.modal.data[key], @@ -52,5 +52,19 @@ export default { }; } }); + + state.modal.open = true; + }, + [types.RESET_ISSUE_MODAL_DATA](state) { + state.modal.open = false; + + // Resetting modal data + state.modal.title = null; + Object.keys(state.modal.data).forEach((key) => { + state.modal.data[key] = { + ...state.modal.data[key], + value: null, + }; + }); }, }; |