fix(frontend): postgres remove selectedTable (#5386)

* remove selectedTable

* add deletion options

* fix select

* add delete option for replication slot and fixed type conversion for timestampz

* fix delete active slot

* fix undefined error and add schema display

---------

Co-authored-by: dieriba <t.dieriba@gmail.com>
Co-authored-by: dieriba <dieriba.pro@gmail.com>
This commit is contained in:
Guilhem
2025-04-16 23:21:00 +01:00
committed by GitHub
parent 11e3165191
commit bd7c6a2a46
4 changed files with 11 additions and 11 deletions
@@ -30,9 +30,10 @@ use windmill_common::{
};
use super::{
create_logical_replication_slot_query, create_publication_query, drop_publication_query,
generate_random_string, get_database_connection, get_raw_postgres_connection,
ERROR_PUBLICATION_NAME_NOT_EXISTS, ERROR_REPLICATION_SLOT_NOT_EXISTS,
create_logical_replication_slot_query, create_publication_query,
drop_logical_replication_slot_query, drop_publication_query, generate_random_string,
get_database_connection, get_raw_postgres_connection, ERROR_PUBLICATION_NAME_NOT_EXISTS,
ERROR_REPLICATION_SLOT_NOT_EXISTS,
};
use lazy_static::lazy_static;
@@ -35,7 +35,6 @@
export let publication: PublicationData = DEFAULT_PUBLICATION
function updateValidity(publication: PublicationData) {
console.log({ publication })
isValid =
!emptyString(postgres_resource_path) &&
(!publication.table_to_track || publication.table_to_track.length === 0)
@@ -45,7 +45,7 @@
let postgres_resource_path = ''
let publication_name: string = ''
let replication_slot_name: string = ''
let relations: Relations[] = []
let relations: Relations[] | undefined = []
let transaction_to_track: string[] = []
let language: Language = 'Typescript'
let loading = false
@@ -247,11 +247,10 @@
}
const getTemplateScript = async () => {
if (relations.length === 0 || emptyString(postgres_resource_path)) {
if (!relations || relations.length === 0 || emptyString(postgres_resource_path)) {
sendUserToast('You must pick a database resource and choose at least one schema', true)
return
}
try {
loading = true
let templateId = await PostgresTriggerService.createTemplateScript({
@@ -359,7 +358,7 @@
allowRefresh
/>
{#if script_path === undefined && is_flow === false}
{#if emptyStringTrimmed(script_path) && is_flow === false}
<div class="flex">
<Button
disabled={!can_write}
@@ -13,7 +13,7 @@
export let relations: Relations[] | undefined = undefined
export let can_write: boolean = true
let selected: 'all' | 'specific' = relations && relations.length > 0 ? 'specific' : 'all'
let cached: Relations[] | undefined = relations
function addTable(name: string, index: number) {
@@ -49,7 +49,7 @@
]
}
}}
selected={relations ? 'specific' : 'all'}
bind:selected
let:item
>
<ToggleButton value="all" label="All Tables" {item} />
@@ -235,7 +235,8 @@
</div>
{/each}
</div>
{:else if relations}
{/if}
{#if selected === 'specific'}
<div class="grow min-w-0 pr-10">
<AddPropertyFormV2
customName="Schema"