This commit is contained in:
Jan Prochazka
2021-12-09 13:20:10 +01:00
parent 60333cbbd7
commit fd531cfd1f
4 changed files with 26 additions and 19 deletions

View File

@@ -1,3 +1,4 @@
import _ from 'lodash';
import { GridDisplay, ChangeCacheFunc, ChangeConfigFunc } from './GridDisplay';
import { QueryResultColumn } from 'dbgate-types';
import { GridConfig, GridCache } from './GridConfig';
@@ -18,21 +19,24 @@ export class JslGridDisplay extends GridDisplay {
this.filterable = true;
if (structure.columns) {
this.columns = structure.columns
.map(col => ({
columnName: col.columnName,
headerText: col.columnName,
uniqueName: col.columnName,
uniquePath: [col.columnName],
notNull: col.notNull,
autoIncrement: col.autoIncrement,
pureName: null,
schemaName: null,
}))
?.map(col => ({
...col,
isChecked: this.isColumnChecked(col),
}));
this.columns = _.uniqBy(
structure.columns
.map(col => ({
columnName: col.columnName,
headerText: col.columnName,
uniqueName: col.columnName,
uniquePath: [col.columnName],
notNull: col.notNull,
autoIncrement: col.autoIncrement,
pureName: null,
schemaName: null,
}))
?.map(col => ({
...col,
isChecked: this.isColumnChecked(col),
})),
col => col.uniqueName
);
}
if (structure.__isDynamicStructure) {