renamed groupId => pairingId

This commit is contained in:
Jan Prochazka
2021-06-17 07:22:44 +02:00
parent 870e3ad666
commit b4cc211763
4 changed files with 14 additions and 14 deletions

View File

@@ -37,12 +37,12 @@
if (columnInfo) {
setTableInfo(tbl => ({
...tbl,
columns: tbl.columns.map(col => (col.groupId == columnInfo.groupId ? e.detail : col)),
columns: tbl.columns.map(col => (col.pairingId == columnInfo.pairingId ? e.detail : col)),
}));
} else {
setTableInfo(tbl => ({
...tbl,
columns: [...tbl.columns, { ...e.detail, groupId: uuidv1() }],
columns: [...tbl.columns, { ...e.detail, pairingId: uuidv1() }],
}));
}
// onConfirm();
@@ -57,7 +57,7 @@
closeCurrentModal();
setTableInfo(tbl => ({
...tbl,
columns: tbl.columns.filter(col => col.groupId != columnInfo.groupId),
columns: tbl.columns.filter(col => col.pairingId != columnInfo.pairingId),
}));
}}
/>

View File

@@ -5,7 +5,7 @@
</script>
<script lang="ts">
import { generateTableGroupId } from 'dbgate-tools';
import { generateTablePairingId } from 'dbgate-tools';
import _ from 'lodash';
@@ -27,11 +27,11 @@
export let objectTypeField = 'tables';
$: tableInfo = useDbCore({ conid, database, schemaName, pureName, objectTypeField });
$: tableInfoWithGroupId = $tableInfo ? generateTableGroupId($tableInfo) : null;
$: tableInfoWithPairingId = $tableInfo ? generateTablePairingId($tableInfo) : null;
const { editorState, editorValue, setEditorData } = useEditorData({ tabid });
$: showTable = $editorValue || tableInfoWithGroupId;
$: showTable = $editorValue || tableInfoWithPairingId;
</script>
@@ -41,7 +41,7 @@
? tableInfoUpdater =>
setEditorData(tbl => {
if (tbl) return tableInfoUpdater(tbl);
return tableInfoUpdater(tableInfoWithGroupId);
return tableInfoUpdater(tableInfoWithPairingId);
})
: null}
/>