SYNC: new object modal testid

This commit is contained in:
SPRINX0\prochazka
2025-07-16 10:53:16 +02:00
committed by Diflow
parent 2cd56d5041
commit c98a6adb09
2 changed files with 11 additions and 2 deletions

View File

@@ -10,7 +10,7 @@
$: disabled = !enabled; $: disabled = !enabled;
</script> </script>
<div class="new-object-button" on:click class:enabled class:disabled> <div class="new-object-button" on:click class:enabled class:disabled data-testid={$$props['data-testid']}>
<div class="icon"> <div class="icon">
<FontIcon {icon} colorClass={enabled ? colorClass : null} /> <FontIcon {icon} colorClass={enabled ? colorClass : null} />
</div> </div>

View File

@@ -17,6 +17,7 @@
action: () => { action: () => {
newQuery({ multiTabIndex }); newQuery({ multiTabIndex });
}, },
testid: 'NewObjectModal_query',
}, },
{ {
icon: 'icon connection', icon: 'icon connection',
@@ -25,6 +26,7 @@
description: 'Database connection stored locally', description: 'Database connection stored locally',
command: 'new.connection', command: 'new.connection',
changeWidget: 'database', changeWidget: 'database',
testid: 'NewObjectModal_connection',
}, },
{ {
icon: 'icon cloud-connection', icon: 'icon cloud-connection',
@@ -33,6 +35,7 @@
description: 'Database connection stored on DbGate Cloud', description: 'Database connection stored on DbGate Cloud',
command: 'new.connectionOnCloud', command: 'new.connectionOnCloud',
changeWidget: 'cloud-private', changeWidget: 'cloud-private',
testid: 'NewObjectModal_connectionOnCloud',
}, },
{ {
icon: 'icon query-design', icon: 'icon query-design',
@@ -40,6 +43,7 @@
title: 'Query Designer', title: 'Query Designer',
description: 'Design SQL queries visually', description: 'Design SQL queries visually',
command: 'new.queryDesign', command: 'new.queryDesign',
testid: 'NewObjectModal_queryDesign',
}, },
{ {
icon: 'icon diagram', icon: 'icon diagram',
@@ -47,6 +51,7 @@
title: 'ER Diagram', title: 'ER Diagram',
description: 'Visualize database structure', description: 'Visualize database structure',
command: 'new.diagram', command: 'new.diagram',
testid: 'NewObjectModal_diagram',
}, },
{ {
icon: 'icon perspective', icon: 'icon perspective',
@@ -54,6 +59,7 @@
title: 'Perspective', title: 'Perspective',
description: 'Join complex data from multiple databases', description: 'Join complex data from multiple databases',
command: 'new.perspective', command: 'new.perspective',
testid: 'NewObjectModal_perspective',
}, },
{ {
icon: 'icon table', icon: 'icon table',
@@ -61,6 +67,7 @@
title: 'Table', title: 'Table',
description: 'Create table in the current database', description: 'Create table in the current database',
command: 'new.table', command: 'new.table',
testid: 'NewObjectModal_table',
}, },
{ {
icon: 'icon sql-generator', icon: 'icon sql-generator',
@@ -68,6 +75,7 @@
title: 'SQL Generator', title: 'SQL Generator',
description: 'Generate SQL scripts for database objects', description: 'Generate SQL scripts for database objects',
command: 'sql.generator', command: 'sql.generator',
testid: 'NewObjectModal_sqlGenerator',
}, },
]; ];
</script> </script>
@@ -83,8 +91,10 @@
description={item.description} description={item.description}
{enabled} {enabled}
colorClass={item.colorClass} colorClass={item.colorClass}
data-testid={item.testid}
on:click={() => { on:click={() => {
if (!enabled) return; if (!enabled) return;
closeCurrentModal();
if (item.action) { if (item.action) {
item.action(); item.action();
} else if (item.command) { } else if (item.command) {
@@ -93,7 +103,6 @@
if (item.changeWidget) { if (item.changeWidget) {
$selectedWidget = item.changeWidget; $selectedWidget = item.changeWidget;
} }
closeCurrentModal();
}} }}
/> />
{/each} {/each}