From c2b25cbbdd6462876259273cc94e696a6738baeb Mon Sep 17 00:00:00 2001 From: "Doberer, Johannes" Date: Wed, 20 Oct 2021 20:30:13 +0200 Subject: [PATCH 1/4] changeable-config-properties --- core/src/Authorization.html | 2 +- core/src/AuthorizationSimpleProfileMenu.html | 15 ++++++++---- core/src/TopNavDropDown.html | 2 +- core/src/navigation/ContextSwitcher.html | 4 ++-- core/src/navigation/GlobalNav.html | 3 ++- core/src/navigation/LogoTitle.html | 19 ++++++++------- core/src/navigation/ProductSwitcher.html | 6 ++--- core/src/navigation/TopNav.html | 23 +++++++++++++++---- .../src/luigi-config/extended/settings.js | 10 ++++---- 9 files changed, 52 insertions(+), 32 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 884304849b..0973aeb4ac 100644 --- a/core/src/AuthorizationSimpleProfileMenu.html +++ b/core/src/AuthorizationSimpleProfileMenu.html @@ -37,13 +37,18 @@ {/each} {#if hasUserSettings}
  • - + {#if profileNav.settings.icon} {#if hasOpenUIicon(profileNav.settings)} {:else} @@ -104,6 +109,7 @@ const dispatch = createEventDispatcher(); export let isHidden = false; + export let addNavHrefForAnchor; let idpProviderInstance; let userInfo; @@ -119,7 +125,6 @@ let getUnsavedChangesModalPromise = getContext('getUnsavedChangesModalPromise'); let openViewInModal = getContext('openViewInModal'); let initialsOfUser; - const addNavHrefForAnchor = LuigiConfig.getConfigBooleanValue('navigation.addNavHrefs'); onMount(async () => { if (!LuigiAuth.isAuthorizationEnabled()) { @@ -296,10 +301,10 @@ } li > button.fd-menu__link { - background-color: var(--sapList_Background,#fff); + background-color: var(--sapList_Background, #fff); &:hover { - background-color: var(--sapList_Hover_Background,#f5f5f5); + background-color: var(--sapList_Hover_Background, #f5f5f5); } } 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/LogoTitle.html b/core/src/navigation/LogoTitle.html index 27771e25a3..0677958b55 100644 --- a/core/src/navigation/LogoTitle.html +++ b/core/src/navigation/LogoTitle.html @@ -1,4 +1,4 @@ -{#if LuigiConfig.getConfigBooleanValue('navigation.addNavHrefs')} +{#if addNavHrefForAnchor}
    - {#if LuigiConfig.getConfigBooleanValue('navigation.addNavHrefs')} {#if - appSwitcherItems && appSwitcherItems.length > 0} {#each appSwitcherItems as item} {#if - item === selectedItem && hasValidLink(item, pathParams)} + {#if addNavHrefForAnchor} {#if appSwitcherItems && appSwitcherItems.length > 0} {#each + appSwitcherItems as item} {#if item === selectedItem && hasValidLink(item, + pathParams)} - {/if}{/each}{/if} {#if appSwitcherItems.length > 0 && !selectedItem} + {/if} {/each} {/if} {#if appSwitcherItems.length > 0 && !selectedItem} { diff --git a/core/src/navigation/ProductSwitcher.html b/core/src/navigation/ProductSwitcher.html index 2d89e883ac..5a35112471 100644 --- a/core/src/navigation/ProductSwitcher.html +++ b/core/src/navigation/ProductSwitcher.html @@ -39,9 +39,9 @@ on:click="{() => onActionClick(productSwitcherItem)}" data-testid="{getTestId(productSwitcherItem)}" > - {#if LuigiConfig.getConfigBooleanValue('navigation.addNavHrefs')} + {#if addNavHrefForAnchor} @@ -131,7 +131,7 @@ let store = getContext('store'); let getUnsavedChangesModalPromise = getContext('getUnsavedChangesModalPromise'); let columnsClass; - const addNavHrefForAnchor = LuigiConfig.getConfigBooleanValue('navigation.addNavHrefs'); + export let addNavHrefForAnchor; onMount(async () => { StateHelpers.doOnStoreChange( diff --git a/core/src/navigation/TopNav.html b/core/src/navigation/TopNav.html index 35d2cebd1e..363a7eaa27 100644 --- a/core/src/navigation/TopNav.html +++ b/core/src/navigation/TopNav.html @@ -16,6 +16,7 @@ {/if} {#if isGlobalSearchAvailable || (children && pathData.length > 0)} {#if (children && pathData.length > 0)} {#each children as node, i} {#if !(node.hideFromNav @@ -66,7 +68,12 @@ aria-hidden="{!(dropDownStates[`dropDownPopover-${i}`] || false)}" id="dropDownPopover-{i}" > - +
    @@ -74,9 +81,9 @@