add VITE_SHOW_API_MANAGER_BUTTON option in env

This commit is contained in:
Nemo Godebski-Pedersen 2025-02-28 09:58:19 +00:00
parent 1569ee6dbc
commit 0f344292cb
2 changed files with 6 additions and 1 deletions

View File

@ -11,7 +11,11 @@ VITE_OBP_API_VERSION=v5.1.0
#The default version of the root page, it has the default value `OBP+VITE_OBP_API_VERSION`
#The format must follow standard+Version, e.g., OBPv5.1.0, BGv1, or BGv1.3.
#VITE_OBP_API_DEFAULT_RESOURCE_DOC_VERSION=OBPv5.1.0
# API Manager
VITE_OBP_API_MANAGER_HOST=https://apimanagersandbox.openbankproject.com
VITE_SHOW_API_MANAGER_BUTTON=false
VITE_OBP_API_EXPLORER_HOST=http://localhost:5173
VITE_OBP_CONSUMER_KEY=your_consumer_key
VITE_OBP_CONSUMER_SECRET=your_consumer_secret

View File

@ -46,6 +46,7 @@ const obpApiPortalHost = ref(import.meta.env.VITE_OBP_API_PORTAL_HOST)
const obpApiHybridPost = computed(() => obpApiPortalHost.value ? obpApiPortalHost.value : obpApiHost.value)
const obpApiManagerHost = ref(import.meta.env.VITE_OBP_API_MANAGER_HOST)
const hasObpApiManagerHost = computed(() => obpApiManagerHost.value ? true : false)
const showObpApiManagerButton = computed(() => import.meta.env.VITE_SHOW_API_MANAGER_BUTTON === 'true')
const loginUsername = ref('')
const logoffurl = ref('')
const obpApiVersions = ref(inject(obpApiActiveVersionsKey)!)
@ -126,7 +127,7 @@ watchEffect(() => {
<RouterLink class="router-link" id="header-nav-glossary" to="/glossary">{{
$t('header.glossary')
}}</RouterLink>
<a v-bind:href="obpApiManagerHost" v-show="hasObpApiManagerHost" class="router-link" id="header-nav-api-manager">
<a v-if="showObpApiManagerButton && hasObpApiManagerHost" v-bind:href="obpApiManagerHost" class="router-link" id="header-nav-api-manager">
{{ $t('header.api_manager') }}
</a>
<span class="el-dropdown-link">