mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-01 19:03:58 +00:00
don't show primary key name when anonymousePrimaryKey=true
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
export let constraintType;
|
export let constraintType;
|
||||||
export let constraintNameLabel = 'Constraint name';
|
export let constraintNameLabel = 'Constraint name';
|
||||||
export let getExtractConstraintProps;
|
export let getExtractConstraintProps;
|
||||||
|
export let hideConstraintName = false;
|
||||||
|
|
||||||
let constraintName = constraintInfo?.constraintName;
|
let constraintName = constraintInfo?.constraintName;
|
||||||
let columns = constraintInfo?.columns || [];
|
let columns = constraintInfo?.columns || [];
|
||||||
@@ -44,17 +45,19 @@
|
|||||||
>
|
>
|
||||||
|
|
||||||
<div class="largeFormMarker">
|
<div class="largeFormMarker">
|
||||||
<div class="row">
|
{#if !hideConstraintName}
|
||||||
<div class="label col-3">{constraintNameLabel}</div>
|
<div class="row">
|
||||||
<div class="col-9">
|
<div class="label col-3">{constraintNameLabel}</div>
|
||||||
<TextField
|
<div class="col-9">
|
||||||
value={constraintName}
|
<TextField
|
||||||
on:input={e => (constraintName = e.target['value'])}
|
value={constraintName}
|
||||||
focused
|
on:input={e => (constraintName = e.target['value'])}
|
||||||
disabled={isReadOnly}
|
focused
|
||||||
/>
|
disabled={isReadOnly}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{/if}
|
||||||
|
|
||||||
{#if $$slots.constraintProps}
|
{#if $$slots.constraintProps}
|
||||||
<slot name="constraintProps" />
|
<slot name="constraintProps" />
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
export let constraintInfo;
|
export let constraintInfo;
|
||||||
export let setTableInfo;
|
export let setTableInfo;
|
||||||
export let tableInfo;
|
export let tableInfo;
|
||||||
|
export let driver;
|
||||||
|
|
||||||
export let constraintLabel = 'primary key';
|
export let constraintLabel = 'primary key';
|
||||||
export let constraintType = 'primaryKey';
|
export let constraintType = 'primaryKey';
|
||||||
@@ -16,4 +17,5 @@
|
|||||||
{constraintInfo}
|
{constraintInfo}
|
||||||
{setTableInfo}
|
{setTableInfo}
|
||||||
{tableInfo}
|
{tableInfo}
|
||||||
|
hideConstraintName={driver?.dialect?.anonymousPrimaryKey}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
export let tableInfo;
|
export let tableInfo;
|
||||||
export let setTableInfo;
|
export let setTableInfo;
|
||||||
export let isWritable;
|
export let isWritable;
|
||||||
|
export let driver;
|
||||||
|
|
||||||
export let constraintLabel = 'primary key';
|
export let constraintLabel = 'primary key';
|
||||||
export let constraintType = 'primaryKey';
|
export let constraintType = 'primaryKey';
|
||||||
@@ -26,6 +27,7 @@
|
|||||||
tableInfo,
|
tableInfo,
|
||||||
constraintLabel,
|
constraintLabel,
|
||||||
constraintType,
|
constraintType,
|
||||||
|
driver,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -35,6 +37,7 @@
|
|||||||
title={_.startCase(constraintLabel)}
|
title={_.startCase(constraintLabel)}
|
||||||
emptyMessage={isWritable ? `No ${constraintLabel} defined` : null}
|
emptyMessage={isWritable ? `No ${constraintLabel} defined` : null}
|
||||||
onAddNew={isWritable && !keyConstraint && columns?.length > 0 ? addKeyConstraint : null}
|
onAddNew={isWritable && !keyConstraint && columns?.length > 0 ? addKeyConstraint : null}
|
||||||
|
hideDisplayName={driver?.dialect?.anonymousPrimaryKey}
|
||||||
clickable
|
clickable
|
||||||
on:clickrow={e =>
|
on:clickrow={e =>
|
||||||
showModal(PrimaryKeyEditorModal, {
|
showModal(PrimaryKeyEditorModal, {
|
||||||
@@ -43,6 +46,7 @@
|
|||||||
setTableInfo,
|
setTableInfo,
|
||||||
constraintLabel,
|
constraintLabel,
|
||||||
constraintType,
|
constraintType,
|
||||||
|
driver,
|
||||||
})}
|
})}
|
||||||
columns={[
|
columns={[
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -118,6 +118,7 @@
|
|||||||
showModal(PrimaryKeyEditorModal, {
|
showModal(PrimaryKeyEditorModal, {
|
||||||
setTableInfo,
|
setTableInfo,
|
||||||
tableInfo,
|
tableInfo,
|
||||||
|
driver,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,8 +147,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$: columns = tableInfo?.columns;
|
$: columns = tableInfo?.columns;
|
||||||
$: primaryKey = tableInfo?.primaryKey;
|
|
||||||
$: sortingKey = tableInfo?.sortingKey;
|
|
||||||
$: foreignKeys = tableInfo?.foreignKeys;
|
$: foreignKeys = tableInfo?.foreignKeys;
|
||||||
$: dependencies = tableInfo?.dependencies;
|
$: dependencies = tableInfo?.dependencies;
|
||||||
$: indexes = tableInfo?.indexes;
|
$: indexes = tableInfo?.indexes;
|
||||||
@@ -263,13 +262,14 @@
|
|||||||
<svelte:fragment slot="name" let:row><ColumnLabel {...row} forceIcon /></svelte:fragment>
|
<svelte:fragment slot="name" let:row><ColumnLabel {...row} forceIcon /></svelte:fragment>
|
||||||
</ObjectListControl>
|
</ObjectListControl>
|
||||||
|
|
||||||
<PrimaryKeyLikeListControl {tableInfo} {setTableInfo} {isWritable} />
|
<PrimaryKeyLikeListControl {tableInfo} {setTableInfo} {isWritable} {driver} />
|
||||||
|
|
||||||
{#if driver?.dialect?.sortingKeys}
|
{#if driver?.dialect?.sortingKeys}
|
||||||
<PrimaryKeyLikeListControl
|
<PrimaryKeyLikeListControl
|
||||||
{tableInfo}
|
{tableInfo}
|
||||||
{setTableInfo}
|
{setTableInfo}
|
||||||
{isWritable}
|
{isWritable}
|
||||||
|
{driver}
|
||||||
constraintLabel="sorting key"
|
constraintLabel="sorting key"
|
||||||
constraintType="sortingKey"
|
constraintType="sortingKey"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user