From 1f7b6325530b6e3e2ba2c3ce625c0ee385bb93e6 Mon Sep 17 00:00:00 2001 From: "SPRINX0\\prochazka" Date: Wed, 18 Sep 2024 14:01:58 +0200 Subject: [PATCH] fix - show schema selector, when no schema is available --- packages/web/src/widgets/SchemaSelector.svelte | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/web/src/widgets/SchemaSelector.svelte b/packages/web/src/widgets/SchemaSelector.svelte index a5d3d630..54ead77f 100644 --- a/packages/web/src/widgets/SchemaSelector.svelte +++ b/packages/web/src/widgets/SchemaSelector.svelte @@ -38,7 +38,9 @@ return res; } - $: schemaList = _.uniq(_.compact(dbinfo?.schemas?.map(x => x.schemaName) ?? [])); + $: schemaList = _.uniq( + _.compact([selectedSchema, ...Object.keys(countBySchema), ...(dbinfo?.schemas?.map(x => x.schemaName) ?? [])]) + ); $: countBySchema = computeCountBySchema(objectList ?? []); function handleAddNewSchema() { @@ -53,8 +55,9 @@ isNative options={[ { label: `All schemas (${objectList?.length ?? 0})`, value: '' }, - ...schemaList.filter(x => countBySchema[x]).map(x => ({ label: `${x} (${countBySchema[x] ?? 0})`, value: x })), - ...schemaList.filter(x => !countBySchema[x]).map(x => ({ label: `${x} (${countBySchema[x] ?? 0})`, value: x })), + ...schemaList.map(x => ({ label: `${x} (${countBySchema[x] ?? 0})`, value: x })), + // ...schemaList.filter(x => countBySchema[x]).map(x => ({ label: `${x} (${countBySchema[x] ?? 0})`, value: x })), + // ...schemaList.filter(x => !countBySchema[x]).map(x => ({ label: `${x} (${countBySchema[x] ?? 0})`, value: x })), ]} value={selectedSchema ?? appliedSchema ?? ''} on:change={e => {