From d45599e1609d9c2c1305a700e562e53e6f94a255 Mon Sep 17 00:00:00 2001 From: Darshan Date: Fri, 3 Oct 2025 09:31:55 +0530 Subject: [PATCH] add: menu for inner icon as well. --- .../(suggestions)/empty.svelte | 164 ++++++++++-------- .../(suggestions)/options.svelte | 1 - 2 files changed, 88 insertions(+), 77 deletions(-) diff --git a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/(suggestions)/empty.svelte b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/(suggestions)/empty.svelte index c07686a99..28cc36df7 100644 --- a/src/routes/(console)/project-[region]-[project]/databases/database-[database]/(suggestions)/empty.svelte +++ b/src/routes/(console)/project-[region]-[project]/databases/database-[database]/(suggestions)/empty.svelte @@ -574,7 +574,7 @@ function resetSelectedColumn() { selectedColumnId = null; previousColumnId = null; - selectedColumnName = null; + /*selectedColumnName = null;*/ } function isColumnVisible(columnId: string) { @@ -677,6 +677,16 @@ creatingColumns = true; const client = sdk.forProject(page.params.region, page.params.project); + const isAnyEmpty = customColumns.some((col) => !col.key); + if (isAnyEmpty) { + creatingColumns = false; + addNotification({ + type: 'warning', + message: 'Some columns have invalid keys' + }); + return; + } + try { const results = []; @@ -938,9 +948,9 @@ {:else} {@const columnObj = getColumn(column.id)} - + )?.icon} {@const columnIconColor = !columnObj?.type ? '--non-overlay-icon-color' : '--overlay-icon-color'} @@ -979,88 +989,41 @@ {column.title} - -
- { - if ( - isColumnInteractable && - !$isTabletViewport - ) { - toggle(event); - resetSelectedColumn(); - } - }}> - {#if !columnObj?.isPlaceholder} - - {/if} - -
- -
- - - {#each basicColumnOptions as option} - { - toggle(); - updateColumn(column.id, { - type: option.type, - format: - option.format || null - }); - }}> - - - {option.name} - - - {/each} - - -
-
+ {@render changeColumnTypePopover({ + id: column.id, + columnObj, + iconColor: columnIconColor, + icon: column.icon, + isColumnInteractable, + index + })} {#if !$isTabletViewport} -
+
- +
{/if} @@ -1256,6 +1219,55 @@ {/if}
+{#snippet changeColumnTypePopover({ id, columnObj, iconColor, icon, isColumnInteractable, index })} + +
+ { + if (isColumnInteractable && !$isTabletViewport) { + toggle(event); + resetSelectedColumn(); + } + }}> + {#if !columnObj?.isPlaceholder} + + {/if} + +
+ +
+ + + {#each basicColumnOptions as option} + { + toggle(); + updateColumn(id, { + type: option.type, + format: option.format || null + }); + }}> + + + {option.name} + + + {/each} + + +
+
+{/snippet} +