create table - changed workflow

This commit is contained in:
Jan Prochazka
2024-09-19 09:00:13 +02:00
parent d1e98e5640
commit f7c5ffa0ce
7 changed files with 85 additions and 85 deletions

View File

@@ -91,6 +91,7 @@
export let dbInfo;
export let driver;
export let resetCounter;
export let isCreateTable;
$: isWritable = !!setTableInfo;
@@ -165,15 +166,14 @@
</script>
<div class="wrapper">
{#if tableFormOptions}
{#if tableInfo && (tableFormOptions || isCreateTable)}
{#key resetCounter}
<ObjectFieldsEditor
title="Table properties"
fieldDefinitions={tableFormOptions}
values={_.pick(
tableInfo,
tableFormOptions.map(x => x.name)
)}
fieldDefinitions={tableFormOptions ?? []}
pureNameTitle="Table name"
schemaList={dbInfo?.schemas?.length >= 0 ? dbInfo?.schemas : null}
values={_.pick(tableInfo, ['schemaName', 'pureName', ...(tableFormOptions ?? []).map(x => x.name)])}
onChangeValues={vals => {
if (!_.isEmpty(vals)) {
setTableInfo(tbl => ({ ...tbl, ...vals }));