fixed jsonl problems, support jsonl without header

This commit is contained in:
Jan Prochazka
2022-02-13 22:05:41 +01:00
parent b8584db48f
commit 8b929f40d2
6 changed files with 50 additions and 13 deletions

View File

@@ -90,6 +90,7 @@ export abstract class GridDisplay {
isLoadedCorrectly = true;
supportsReload = false;
isDynamicStructure = false;
filterTypeOverride = null;
setColumnVisibility(uniquePath: string[], isVisible: boolean) {
const uniqueName = uniquePath.join('.');
@@ -622,16 +623,16 @@ export abstract class GridDisplay {
if (!filters) return null;
const conditions = [];
for (const name in filters) {
const column = this.columns.find(x => (x.columnName = name));
if (!column) continue;
const filterType = getFilterType(column.dataType);
const column = this.isDynamicStructure ? null : this.columns.find(x => x.columnName == name);
if (!this.isDynamicStructure && !column) continue;
const filterType = this.isDynamicStructure ? this.filterTypeOverride ?? 'mongo' : getFilterType(column.dataType);
try {
const condition = parseFilter(filters[name], filterType);
const replaced = _.cloneDeepWith(condition, (expr: Expression) => {
if (expr.exprType == 'placeholder')
return {
exprType: 'column',
columnName: column.columnName,
columnName: this.isDynamicStructure ? name : column.columnName,
};
});
conditions.push(replaced);