mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 10:16:00 +00:00
perspective fix
This commit is contained in:
@@ -15,6 +15,8 @@ import {
|
||||
MultipleDatabaseInfo,
|
||||
PerspectiveConfig,
|
||||
PerspectiveCustomJoinConfig,
|
||||
PerspectiveDatabaseConfig,
|
||||
PerspectiveDatabaseEngineType,
|
||||
PerspectiveFilterColumnInfo,
|
||||
PerspectiveNodeConfig,
|
||||
PerspectiveReferenceConfig,
|
||||
@@ -28,11 +30,7 @@ import _uniqBy from 'lodash/uniqBy';
|
||||
import _sortBy from 'lodash/sortBy';
|
||||
import _cloneDeepWith from 'lodash/cloneDeepWith';
|
||||
import _findIndex from 'lodash/findIndex';
|
||||
import {
|
||||
PerspectiveDatabaseConfig,
|
||||
PerspectiveDataLoadProps,
|
||||
PerspectiveDataProvider,
|
||||
} from './PerspectiveDataProvider';
|
||||
import { PerspectiveDataLoadProps, PerspectiveDataProvider } from './PerspectiveDataProvider';
|
||||
import stableStringify from 'json-stable-stringify';
|
||||
import { getFilterType, parseFilter } from 'dbgate-filterparser';
|
||||
import { FilterType } from 'dbgate-filterparser/lib/types';
|
||||
@@ -119,6 +117,9 @@ export abstract class PerspectiveTreeNode {
|
||||
}
|
||||
return this.parentNode.parentTableNode;
|
||||
}
|
||||
get engineType(): PerspectiveDatabaseEngineType {
|
||||
return null;
|
||||
}
|
||||
abstract getNodeLoadProps(parentRows: any[]): PerspectiveDataLoadProps;
|
||||
get isRoot() {
|
||||
return this.parentNode == null;
|
||||
@@ -426,7 +427,9 @@ export abstract class PerspectiveTreeNode {
|
||||
return (
|
||||
(this.parentNode?.isRoot || this.parentNode?.supportsParentFilter) &&
|
||||
this.parentNode?.databaseConfig?.conid == this.databaseConfig?.conid &&
|
||||
this.parentNode?.databaseConfig?.database == this.databaseConfig?.database
|
||||
this.parentNode?.databaseConfig?.database == this.databaseConfig?.database &&
|
||||
this.engineType == 'sqldb' &&
|
||||
this.parentNode?.engineType == 'sqldb'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -532,6 +535,10 @@ export class PerspectiveTableColumnNode extends PerspectiveTreeNode {
|
||||
);
|
||||
}
|
||||
|
||||
get engineType() {
|
||||
return this.parentNode.engineType;
|
||||
}
|
||||
|
||||
matchChildRow(parentRow: any, childRow: any): boolean {
|
||||
if (!this.foreignKey) return false;
|
||||
return parentRow[this.foreignKey.columns[0].columnName] == childRow[this.foreignKey.columns[0].refColumnName];
|
||||
@@ -942,6 +949,10 @@ export class PerspectiveTableNode extends PerspectiveTreeNode {
|
||||
super(dbs, config, setConfig, parentNode, dataProvider, databaseConfig, designerId);
|
||||
}
|
||||
|
||||
get engineType(): PerspectiveDatabaseEngineType {
|
||||
return isCollectionInfo(this.table) ? 'docdb' : 'sqldb';
|
||||
}
|
||||
|
||||
getNodeLoadProps(parentRows: any[]): PerspectiveDataLoadProps {
|
||||
const isMongo = isCollectionInfo(this.table);
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user