mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-23 03:26:00 +00:00
inplace editing
This commit is contained in:
@@ -22,18 +22,21 @@ export function createChangeSet(): ChangeSet {
|
||||
};
|
||||
}
|
||||
|
||||
export interface ChangeSetFieldDefinition {
|
||||
export interface ChangeSetRowDefinition {
|
||||
pureName: string;
|
||||
schemaName: string;
|
||||
uniqueName: string;
|
||||
columnName: string;
|
||||
insertedRowIndex?: number;
|
||||
condition?: { [column: string]: string };
|
||||
}
|
||||
|
||||
function findExistingChangeSetItem(
|
||||
export interface ChangeSetFieldDefinition extends ChangeSetRowDefinition {
|
||||
uniqueName: string;
|
||||
columnName: string;
|
||||
}
|
||||
|
||||
export function findExistingChangeSetItem(
|
||||
changeSet: ChangeSet,
|
||||
definition: ChangeSetFieldDefinition
|
||||
definition: ChangeSetRowDefinition
|
||||
): [keyof ChangeSet, ChangeSetItem] {
|
||||
if (definition.insertedRowIndex != null) {
|
||||
return [
|
||||
|
||||
@@ -4,7 +4,7 @@ import { ForeignKeyInfo, TableInfo, ColumnInfo, DbType } from '@dbgate/types';
|
||||
import { parseFilter, getFilterType } from '@dbgate/filterparser';
|
||||
import { filterName } from './filterName';
|
||||
import { Select, Expression } from '@dbgate/sqltree';
|
||||
import { ChangeSetFieldDefinition } from './ChangeSet';
|
||||
import { ChangeSetFieldDefinition, ChangeSetRowDefinition } from './ChangeSet';
|
||||
|
||||
export interface DisplayColumn {
|
||||
schemaName: string;
|
||||
@@ -372,4 +372,13 @@ export abstract class GridDisplay {
|
||||
condition: this.getChangeSetCondition(row),
|
||||
};
|
||||
}
|
||||
|
||||
getChangeSetRow(row): ChangeSetRowDefinition {
|
||||
if (!this.baseTable) return null;
|
||||
return {
|
||||
pureName: this.baseTable.pureName,
|
||||
schemaName: this.baseTable.schemaName,
|
||||
condition: this.getChangeSetCondition(row),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user