From 60e1967f0a63dde2043dab09915d79444e0a9a35 Mon Sep 17 00:00:00 2001 From: JohannesDoberer Date: Thu, 28 Oct 2021 14:28:44 +0200 Subject: [PATCH] Fix changeable settings config properties (#2333) --- core/src/Authorization.html | 2 +- core/src/AuthorizationSimpleProfileMenu.html | 2 +- core/src/TopNavDropDown.html | 2 +- core/src/navigation/ContextSwitcher.html | 4 ++-- core/src/navigation/GlobalNav.html | 3 ++- core/src/navigation/LeftNav.html | 14 +++++------ core/src/navigation/LogoTitle.html | 19 ++++++++------- core/src/navigation/ProductSwitcher.html | 6 ++--- core/src/navigation/TopNav.html | 23 +++++++++++++++---- .../src/luigi-config/extended/settings.js | 6 ++--- 10 files changed, 47 insertions(+), 34 deletions(-) diff --git a/core/src/Authorization.html b/core/src/Authorization.html index caeb3bb7a0..9affdb4781 100644 --- a/core/src/Authorization.html +++ b/core/src/Authorization.html @@ -154,6 +154,7 @@ const dispatch = createEventDispatcher(); export let isHidden = false; + export let addNavHrefForAnchor; let idpProviderInstance; let userInfo; @@ -169,7 +170,6 @@ let getUnsavedChangesModalPromise = getContext('getUnsavedChangesModalPromise'); let openViewInModal = getContext('openViewInModal'); let initialsOfUser; - const addNavHrefForAnchor = LuigiConfig.getConfigBooleanValue('navigation.addNavHrefs'); onMount(async () => { if (!LuigiAuth.isAuthorizationEnabled()) { diff --git a/core/src/AuthorizationSimpleProfileMenu.html b/core/src/AuthorizationSimpleProfileMenu.html index cf17f0cd8b..0973aeb4ac 100644 --- a/core/src/AuthorizationSimpleProfileMenu.html +++ b/core/src/AuthorizationSimpleProfileMenu.html @@ -109,6 +109,7 @@ const dispatch = createEventDispatcher(); export let isHidden = false; + export let addNavHrefForAnchor; let idpProviderInstance; let userInfo; @@ -124,7 +125,6 @@ let getUnsavedChangesModalPromise = getContext('getUnsavedChangesModalPromise'); let openViewInModal = getContext('openViewInModal'); let initialsOfUser; - const addNavHrefForAnchor = LuigiConfig.getConfigBooleanValue('navigation.addNavHrefs'); onMount(async () => { if (!LuigiAuth.isAuthorizationEnabled()) { diff --git a/core/src/TopNavDropDown.html b/core/src/TopNavDropDown.html index 89109b2e2f..cbd31037ac 100644 --- a/core/src/TopNavDropDown.html +++ b/core/src/TopNavDropDown.html @@ -62,7 +62,7 @@ let pathParams; let getUnsavedChangesModalPromise = getContext('getUnsavedChangesModalPromise'); let openViewInModal = getContext('openViewInModal'); - const addNavHrefForAnchor = LuigiConfig.getConfigBooleanValue('navigation.addNavHrefs'); + let addNavHrefForAnchor; const getNodeSubtitle = () => {}; //TODO refactor diff --git a/core/src/navigation/ContextSwitcher.html b/core/src/navigation/ContextSwitcher.html index 424516b74e..83184dfe89 100644 --- a/core/src/navigation/ContextSwitcher.html +++ b/core/src/navigation/ContextSwitcher.html @@ -4,8 +4,7 @@
- {#if LuigiConfig.getConfigBooleanValue('navigation.addNavHrefs') && (selectedOption - !== config.defaultLabel) } + {#if addNavHrefForAnchor && (selectedOption !== config.defaultLabel) } let getTranslation = getContext('getTranslation'); let prevContextSwitcherToggle = false; let selectedNodePath; + let addNavHrefForAnchor; onMount(async () => { StateHelpers.doOnStoreChange( diff --git a/core/src/navigation/GlobalNav.html b/core/src/navigation/GlobalNav.html index 8466031339..551f283ec5 100644 --- a/core/src/navigation/GlobalNav.html +++ b/core/src/navigation/GlobalNav.html @@ -104,7 +104,7 @@ export let showGlobalNav; export let hideNavComponent; export let responsiveNavSetting; - const addNavHrefForAnchor = LuigiConfig.getConfigBooleanValue('navigation.addNavHrefs'); + let addNavHrefForAnchor = LuigiConfig.getConfigBooleanValue('navigation.addNavHrefs'); const setTopNavData = async () => { if (pathData && 0 < pathData.length) { @@ -136,6 +136,7 @@ if (!previousPathData || previousPathData != pathData) { setTopNavData(); } + addNavHrefForAnchor = LuigiConfig.getConfigBooleanValue('navigation.addNavHrefs'); }); function hasOpenUIicon(node) { diff --git a/core/src/navigation/LeftNav.html b/core/src/navigation/LeftNav.html index 57b434be99..5e31a6082b 100644 --- a/core/src/navigation/LeftNav.html +++ b/core/src/navigation/LeftNav.html @@ -51,7 +51,9 @@
{#if children && pathData.length > 1}
-
@@ -74,9 +81,9 @@