Commit f101d410 authored by Paul Slaughter's avatar Paul Slaughter

Fix URL parsing in IDE MRs

**Why?**
A recent MR moved the `merge_requests` route under
the `/-/` namespace. This broke our URL parsing for the
project path.

https://gitlab.com/gitlab-org/gitlab/issues/200087#note_280354290
parent 6c350a8a
...@@ -14,9 +14,10 @@ export default { ...@@ -14,9 +14,10 @@ export default {
iid: mergeRequest.iid, iid: mergeRequest.iid,
title: mergeRequest.title, title: mergeRequest.title,
projectId: mergeRequest.project_id, projectId: mergeRequest.project_id,
projectPathWithNamespace: mergeRequest.web_url projectPathWithNamespace: mergeRequest.references.full.replace(
.replace(`${gon.gitlab_url}/`, '') mergeRequest.references.short,
.replace(`/merge_requests/${mergeRequest.iid}`, ''), '',
),
})); }));
}, },
[types.RESET_MERGE_REQUESTS](state) { [types.RESET_MERGE_REQUESTS](state) {
......
...@@ -165,7 +165,11 @@ export const mergeRequests = [ ...@@ -165,7 +165,11 @@ export const mergeRequests = [
iid: 1, iid: 1,
title: 'Test merge request', title: 'Test merge request',
project_id: 1, project_id: 1,
web_url: `${TEST_HOST}/namespace/project-path/merge_requests/1`, web_url: `${TEST_HOST}/namespace/project-path/-/merge_requests/1`,
references: {
short: '!1',
full: 'namespace/project-path!1',
},
}, },
]; ];
......
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