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 {
iid: mergeRequest.iid,
title: mergeRequest.title,
projectId: mergeRequest.project_id,
projectPathWithNamespace: mergeRequest.web_url
.replace(`${gon.gitlab_url}/`, '')
.replace(`/merge_requests/${mergeRequest.iid}`, ''),
projectPathWithNamespace: mergeRequest.references.full.replace(
mergeRequest.references.short,
'',
),
}));
},
[types.RESET_MERGE_REQUESTS](state) {
......
......@@ -165,7 +165,11 @@ export const mergeRequests = [
iid: 1,
title: 'Test merge request',
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