From a778b5fb90247c1c3cfa55868f2e3ee5d532d2ed Mon Sep 17 00:00:00 2001 From: qwerty287 <80460567+qwerty287@users.noreply.github.com> Date: Thu, 13 Jul 2023 15:57:50 +0200 Subject: [PATCH] Do not use `window.WOODPECKER_*` variables directly (#1992) use the config helper instead --- web/src/components/atomic/DocsLink.vue | 3 ++- web/src/components/layout/header/Navbar.vue | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/web/src/components/atomic/DocsLink.vue b/web/src/components/atomic/DocsLink.vue index 5bdd16f90..cb07c66ce 100644 --- a/web/src/components/atomic/DocsLink.vue +++ b/web/src/components/atomic/DocsLink.vue @@ -12,13 +12,14 @@ import { computed, toRef } from 'vue'; import Icon from '~/components/atomic/Icon.vue'; +import useConfig from '~/compositions/useConfig'; const props = defineProps<{ url: string; topic: string; }>(); -const docsBaseUrl = window.WOODPECKER_DOCS; +const docsBaseUrl = useConfig().docs; const url = toRef(props, 'url'); const topic = toRef(props, 'topic'); const docsUrl = computed(() => (url.value.startsWith('http') ? url.value : `${docsBaseUrl}${url.value}`)); diff --git a/web/src/components/layout/header/Navbar.vue b/web/src/components/layout/header/Navbar.vue index f26b44196..685ec4332 100644 --- a/web/src/components/layout/header/Navbar.vue +++ b/web/src/components/layout/header/Navbar.vue @@ -69,7 +69,7 @@ export default defineComponent({ const route = useRoute(); const authentication = useAuthentication(); const { darkMode } = useDarkMode(); - const docsUrl = window.WOODPECKER_DOCS; + const docsUrl = config.docs || undefined; function doLogin() { authentication.authenticate(route.fullPath);