Commit a2843c82 authored by Denys Mishunov's avatar Denys Mishunov

Fixed snippet URLs for sub-folders

parent 56614675
......@@ -90,7 +90,7 @@ export default {
if (this.newSnippet) {
return this.projectPath
? `${gon.relative_url_root}${this.projectPath}/-/snippets`
: `${gon.relative_url_root}-/snippets`;
: `${gon.relative_url_root}/-/snippets`;
}
return this.snippet.webUrl;
},
......
......@@ -97,7 +97,7 @@ export default {
text: __('New snippet'),
href: this.snippet.project
? `${this.snippet.project.webUrl}/-/snippets/new`
: `${gon.relative_url_root}-/snippets/new`,
: `${gon.relative_url_root}/-/snippets/new`,
variant: 'success',
category: 'secondary',
cssClass: 'ml-2',
......
......@@ -200,7 +200,7 @@ describe('Snippet Edit app', () => {
it.each`
projectPath | snippetArg | expectation
${''} | ${[]} | ${`${relativeUrlRoot}-/snippets`}
${''} | ${[]} | ${`${relativeUrlRoot}/-/snippets`}
${'project/path'} | ${[]} | ${`${relativeUrlRoot}project/path/-/snippets`}
${''} | ${[createTestSnippet()]} | ${TEST_WEB_URL}
${'project/path'} | ${[createTestSnippet()]} | ${TEST_WEB_URL}
......
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