From c6a22282f7a400b08532ad0cab91d492e2511896 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Tue, 28 Feb 2023 16:21:54 +0000 Subject: [PATCH] Fix default oidc icons --- packages/bbui/src/Form/Core/Picker.svelte | 12 +++++++++++- packages/bbui/src/Form/Core/Select.svelte | 2 ++ packages/bbui/src/Form/Select.svelte | 2 ++ .../builder/portal/settings/auth/index.svelte | 18 +++++++++++------- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/packages/bbui/src/Form/Core/Picker.svelte b/packages/bbui/src/Form/Core/Picker.svelte index 5cef0f9213..2c37aadb6d 100644 --- a/packages/bbui/src/Form/Core/Picker.svelte +++ b/packages/bbui/src/Form/Core/Picker.svelte @@ -24,6 +24,7 @@ export let getOptionLabel = option => option export let getOptionValue = option => option export let getOptionIcon = () => null + export let useOptionIconImage = false export let getOptionColour = () => null export let open = false export let readonly = false @@ -186,7 +187,16 @@ > {#if getOptionIcon(option, idx)} - + {#if useOptionIconImage} + icon + {:else} + + {/if} {/if} {#if getOptionColour(option, idx)} diff --git a/packages/bbui/src/Form/Core/Select.svelte b/packages/bbui/src/Form/Core/Select.svelte index 721083e3a6..09c2e35f82 100644 --- a/packages/bbui/src/Form/Core/Select.svelte +++ b/packages/bbui/src/Form/Core/Select.svelte @@ -11,6 +11,7 @@ export let getOptionLabel = option => option export let getOptionValue = option => option export let getOptionIcon = () => null + export let useOptionIconImage = false export let getOptionColour = () => null export let isOptionEnabled export let readonly = false @@ -69,6 +70,7 @@ {getOptionLabel} {getOptionValue} {getOptionIcon} + {useOptionIconImage} {getOptionColour} {isOptionEnabled} {autocomplete} diff --git a/packages/bbui/src/Form/Select.svelte b/packages/bbui/src/Form/Select.svelte index 76fe613c92..e1500c6a6c 100644 --- a/packages/bbui/src/Form/Select.svelte +++ b/packages/bbui/src/Form/Select.svelte @@ -14,6 +14,7 @@ export let getOptionLabel = option => extractProperty(option, "label") export let getOptionValue = option => extractProperty(option, "value") export let getOptionIcon = option => option?.icon + export let useOptionIconImage = false export let getOptionColour = option => option?.colour export let isOptionEnabled export let quiet = false @@ -52,6 +53,7 @@ {getOptionValue} {getOptionIcon} {getOptionColour} + {useOptionIconImage} {isOptionEnabled} {autocomplete} {customPopoverHeight} diff --git a/packages/builder/src/pages/builder/portal/settings/auth/index.svelte b/packages/builder/src/pages/builder/portal/settings/auth/index.svelte index 236636ecd5..af272b5d7c 100644 --- a/packages/builder/src/pages/builder/portal/settings/auth/index.svelte +++ b/packages/builder/src/pages/builder/portal/settings/auth/index.svelte @@ -305,14 +305,17 @@ } if (oidcLogos?.config) { const logoKeys = Object.keys(oidcLogos.config) - logoKeys.map(logoKey => { - const logoUrl = oidcLogos.config[logoKey] - iconDropdownOptions.unshift({ - label: logoKey, - value: logoKey, - icon: logoUrl, + logoKeys + // don't include the etag entry in the logo config + .filter(key => !key.toLowerCase().includes("etag")) + .map(logoKey => { + const logoUrl = oidcLogos.config[logoKey] + iconDropdownOptions.unshift({ + label: logoKey, + value: logoKey, + icon: logoUrl, + }) }) - }) } // Fetch OIDC config @@ -484,6 +487,7 @@