From 8ce41788e83d4b831cf6dcd7934ea0fd887e0386 Mon Sep 17 00:00:00 2001 From: 9p4 <17993169+9p4@users.noreply.github.com> Date: Sun, 6 Feb 2022 16:05:02 -0500 Subject: [PATCH] Add repo-link to badge markdown in UI (#753) Co-authored-by: Anbraten --- web/src/components/repo/settings/BadgeTab.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/web/src/components/repo/settings/BadgeTab.vue b/web/src/components/repo/settings/BadgeTab.vue index fe29a37fa..05a3896ad 100644 --- a/web/src/components/repo/settings/BadgeTab.vue +++ b/web/src/components/repo/settings/BadgeTab.vue @@ -20,7 +20,7 @@

Markdown

-
![status-badge]({{ baseUrl }}{{ badgeUrl }})
+
[![status-badge]({{ baseUrl }}{{ badgeUrl }})]({{ baseUrl }}{{ repoUrl }})
@@ -47,8 +47,15 @@ export default defineComponent({ return `/api/badges/${repo.value.owner}/${repo.value.name}/status.svg`; }); + const repoUrl = computed(() => { + if (!repo) { + throw new Error('Unexpected: "repo" should be provided at this place'); + } - return { baseUrl, badgeUrl }; + return `/${repo.value.owner}/${repo.value.name}`; + }); + + return { baseUrl, badgeUrl, repoUrl }; }, });