mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-03 00:13:57 +00:00
fixed for shorten names
This commit is contained in:
@@ -24,6 +24,7 @@ export interface DisplayColumn {
|
|||||||
columnName: string;
|
columnName: string;
|
||||||
headerText: string;
|
headerText: string;
|
||||||
uniqueName: string;
|
uniqueName: string;
|
||||||
|
uniqueNameShorten?: string;
|
||||||
uniquePath: string[];
|
uniquePath: string[];
|
||||||
notNull?: boolean;
|
notNull?: boolean;
|
||||||
autoIncrement?: boolean;
|
autoIncrement?: boolean;
|
||||||
@@ -607,7 +608,7 @@ export abstract class GridDisplay {
|
|||||||
return {
|
return {
|
||||||
exprType: 'column',
|
exprType: 'column',
|
||||||
...(!this.dialect.omitTableAliases && {
|
...(!this.dialect.omitTableAliases && {
|
||||||
alias: alias ? shortenIdentifier(alias, this.driver.dialect.maxIdentifierLength) : col.columnName,
|
alias: alias ?? col.columnName,
|
||||||
}),
|
}),
|
||||||
source,
|
source,
|
||||||
...col,
|
...col,
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ export class TableGridDisplay extends GridDisplay {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getDisplayColumns(table: TableInfo, parentPath: string[]) {
|
getDisplayColumns(table: TableInfo, parentPath: string[]): DisplayColumn[] {
|
||||||
return (
|
return (
|
||||||
table?.columns
|
table?.columns
|
||||||
?.map(col => this.getDisplayColumn(table, col, parentPath))
|
?.map(col => this.getDisplayColumn(table, col, parentPath))
|
||||||
@@ -106,6 +106,7 @@ export class TableGridDisplay extends GridDisplay {
|
|||||||
) || null,
|
) || null,
|
||||||
hintColumnDelimiter: this.getFkDictionaryDescription(col.isForeignKeyUnique ? col.foreignKey : null)
|
hintColumnDelimiter: this.getFkDictionaryDescription(col.isForeignKeyUnique ? col.foreignKey : null)
|
||||||
?.delimiter,
|
?.delimiter,
|
||||||
|
uniqueNameShorten: shortenIdentifier(col.uniqueName, this.driver.dialect.maxIdentifierLength),
|
||||||
isExpandable: !!col.foreignKey,
|
isExpandable: !!col.foreignKey,
|
||||||
})) || []
|
})) || []
|
||||||
);
|
);
|
||||||
@@ -307,7 +308,12 @@ export class TableGridDisplay extends GridDisplay {
|
|||||||
for (const column of columns) {
|
for (const column of columns) {
|
||||||
if (this.addAllExpandedColumnsToSelected || this.config.addedColumns.includes(column.uniqueName)) {
|
if (this.addAllExpandedColumnsToSelected || this.config.addedColumns.includes(column.uniqueName)) {
|
||||||
select.columns.push(
|
select.columns.push(
|
||||||
this.createColumnExpression(column, { name: column, alias: parentAlias }, column.uniqueName, 'view')
|
this.createColumnExpression(
|
||||||
|
column,
|
||||||
|
{ name: column, alias: parentAlias },
|
||||||
|
column.uniqueNameShorten ?? column.uniqueName,
|
||||||
|
'view'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
displayedColumnInfo[column.uniqueName] = {
|
displayedColumnInfo[column.uniqueName] = {
|
||||||
...column,
|
...column,
|
||||||
|
|||||||
@@ -38,7 +38,9 @@
|
|||||||
export let overlayValue = null;
|
export let overlayValue = null;
|
||||||
export let isMissingOverlayField = false;
|
export let isMissingOverlayField = false;
|
||||||
|
|
||||||
$: value = col.isStructured ? _.get(rowData || {}, col.uniquePath) : (rowData || {})[col.uniqueName];
|
$: value = col.isStructured
|
||||||
|
? _.get(rowData || {}, col.uniquePath)
|
||||||
|
: (rowData || {})[col.uniqueNameShorten ?? col.uniqueName];
|
||||||
|
|
||||||
function computeStyle(maxWidth, col) {
|
function computeStyle(maxWidth, col) {
|
||||||
let res = '';
|
let res = '';
|
||||||
|
|||||||
Reference in New Issue
Block a user