From 80bad5cf7364b09b235acd8d1ac35bd2db2986c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20N=C3=A4sman?= Date: Wed, 20 Apr 2022 13:54:27 +0200 Subject: [PATCH] log error if not github or gitlab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Otto Sichert Signed-off-by: Anders Näsman --- .../src/ReportIssue/hooks.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/techdocs-module-addons-contrib/src/ReportIssue/hooks.ts b/plugins/techdocs-module-addons-contrib/src/ReportIssue/hooks.ts index a124f2978f..19cb47ec40 100644 --- a/plugins/techdocs-module-addons-contrib/src/ReportIssue/hooks.ts +++ b/plugins/techdocs-module-addons-contrib/src/ReportIssue/hooks.ts @@ -32,8 +32,14 @@ import { PAGE_EDIT_LINK_SELECTOR } from './constants'; const resolveBlobUrl = (url: string, type: string) => { if (type === 'github') { return replaceGitHubUrlType(url, 'blob'); + } else if (type === 'gitlab') { + return replaceGitLabUrlType(url, 'blob'); } - return replaceGitLabUrlType(url, 'blob'); + // eslint-disable-next-line no-console + console.error( + `Invalid SCM type ${type} found in ReportIssue addon for URL ${url}!`, + ); + return url; }; export const getTitle = (selection: Selection) => {