Fix TechDocs Edit URL link when trailing slash not present
Signed-off-by: Kamil Markow <kamilmarkow@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-techdocs-node': patch
|
||||
---
|
||||
|
||||
Fix TechDocs Edit URL for nexted docs
|
||||
@@ -115,6 +115,7 @@ describe('helpers', () => {
|
||||
url | repo_url | edit_uri
|
||||
${'https://github.com/backstage/backstage'} | ${'https://github.com/backstage/backstage'} | ${undefined}
|
||||
${'https://github.com/backstage/backstage/tree/main/examples/techdocs/'} | ${'https://github.com/backstage/backstage/tree/main/examples/techdocs/'} | ${'https://github.com/backstage/backstage/edit/main/examples/techdocs/docs'}
|
||||
${'https://github.com/backstage/backstage/tree/main/examples/techdocs'} | ${'https://github.com/backstage/backstage/tree/main/examples/techdocs'} | ${'https://github.com/backstage/backstage/edit/main/examples/techdocs/docs'}
|
||||
${'https://github.com/backstage/backstage/tree/main/'} | ${'https://github.com/backstage/backstage/tree/main/'} | ${'https://github.com/backstage/backstage/edit/main/docs'}
|
||||
${'https://gitlab.com/backstage/backstage'} | ${'https://gitlab.com/backstage/backstage'} | ${undefined}
|
||||
${'https://gitlab.com/backstage/backstage/-/blob/main/examples/techdocs/'} | ${'https://gitlab.com/backstage/backstage/-/blob/main/examples/techdocs/'} | ${'https://gitlab.com/backstage/backstage/-/edit/main/examples/techdocs/docs'}
|
||||
|
||||
@@ -117,7 +117,7 @@ export const getRepoUrlFromLocationAnnotation = (
|
||||
|
||||
const sourceFolder = integration.resolveUrl({
|
||||
url: `./${docsFolder}`,
|
||||
base: target,
|
||||
base: target.endsWith('/') ? target : `${target}/`,
|
||||
});
|
||||
return {
|
||||
repo_url: target,
|
||||
|
||||
Reference in New Issue
Block a user