feat(techdocs): add edit button support for bitbucketServer

Signed-off-by: Ömer Faruk Doğan <8117265+omerfarukdogan@users.noreply.github.com>
This commit is contained in:
Ömer Faruk Doğan
2022-07-27 18:31:13 +03:00
parent 593a5e57bb
commit ad35364e97
6 changed files with 77 additions and 28 deletions
@@ -101,9 +101,12 @@ export const getRepoUrlFromLocationAnnotation = (
if (locationType === 'url') {
const integration = scmIntegrations.byUrl(target);
// We only support it for github and gitlab for now as the edit_uri
// We only support it for github, gitlab and bitbucketServer for now as the edit_uri
// is not properly supported for others yet.
if (integration && ['github', 'gitlab'].includes(integration.type)) {
if (
integration &&
['github', 'gitlab', 'bitbucketServer'].includes(integration.type)
) {
// handle the case where a user manually writes url:https://github.com/backstage/backstage i.e. without /blob/...
const { filepathtype } = gitUrlParse(target);
if (filepathtype === '') {