summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/reports/grouped_test_report/store/mutations.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/reports/grouped_test_report/store/mutations.js')
-rw-r--r--app/assets/javascripts/reports/grouped_test_report/store/mutations.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/app/assets/javascripts/reports/grouped_test_report/store/mutations.js b/app/assets/javascripts/reports/grouped_test_report/store/mutations.js
index 3bb31d71d8f..2b88776815b 100644
--- a/app/assets/javascripts/reports/grouped_test_report/store/mutations.js
+++ b/app/assets/javascripts/reports/grouped_test_report/store/mutations.js
@@ -1,9 +1,10 @@
import * as types from './mutation_types';
-import { countRecentlyFailedTests } from './utils';
+import { countRecentlyFailedTests, formatFilePath } from './utils';
export default {
- [types.SET_ENDPOINT](state, endpoint) {
+ [types.SET_PATHS](state, { endpoint, headBlobPath }) {
state.endpoint = endpoint;
+ state.headBlobPath = headBlobPath;
},
[types.REQUEST_REPORTS](state) {
state.isLoading = true;
@@ -42,17 +43,25 @@ export default {
state.status = null;
},
[types.SET_ISSUE_MODAL_DATA](state, payload) {
- state.modal.title = payload.issue.name;
+ const { issue } = payload;
+ state.modal.title = issue.name;
- Object.keys(payload.issue).forEach((key) => {
+ Object.keys(issue).forEach((key) => {
if (Object.prototype.hasOwnProperty.call(state.modal.data, key)) {
state.modal.data[key] = {
...state.modal.data[key],
- value: payload.issue[key],
+ value: issue[key],
};
}
});
+ if (issue.file) {
+ state.modal.data.filename.value = {
+ text: issue.file,
+ path: `${state.headBlobPath}/${formatFilePath(issue.file)}`,
+ };
+ }
+
state.modal.open = true;
},
[types.RESET_ISSUE_MODAL_DATA](state) {