Merged PR 23077: Added aggregation types.

Changes to models to align interface structure with FE fieldExprPattern.

extract aggregationFunction from IBaseTarget to new interface IAggrTarget.
Renamed HierarchyTarget to HierarchyLevelTarget
This commit is contained in:
May Hartov 2019-04-03 10:36:33 +00:00
Родитель 9abf56eca7
Коммит 9c1cbe6de1
1 изменённых файлов: 35 добавлений и 12 удалений

Просмотреть файл

@ -229,21 +229,19 @@ export interface IBaseTarget {
export interface IColumnTarget extends IBaseTarget {
column: string;
aggregationFunction?: string;
}
export interface IKeyColumnsTarget extends IColumnTarget {
keys: string[];
}
export interface IKeyHierarchyTarget extends IHierarchyTarget {
export interface IKeyHierarchyTarget extends IHierarchyLevelTarget {
keys: string[];
}
export interface IHierarchyTarget extends IBaseTarget {
export interface IHierarchyLevelTarget extends IBaseTarget {
hierarchy: string;
hierarchyLevel: string;
aggregationFunction?: string;
}
export interface INotSupportedTarget extends IBaseTarget { }
@ -252,22 +250,39 @@ export interface IMeasureTarget extends IBaseTarget {
measure: string;
}
export interface IAggregationTarget {
aggregationFunction: string;
}
export interface IColumnAggrTarget extends IColumnTarget, IAggregationTarget { }
export interface IHierarchyLevelAggrTarget extends IHierarchyLevelTarget, IAggregationTarget { }
export declare type IKeyTarget = (IKeyColumnsTarget | IKeyHierarchyTarget);
export declare type ITarget = (IColumnTarget | IHierarchyLevelTarget | IMeasureTarget | INotSupportedTarget | IColumnAggrTarget | IHierarchyLevelAggrTarget);
export interface IBaseFilterTarget extends IBaseTarget { }
export interface IFilterColumnTarget extends IBaseFilterTarget, IColumnTarget { }
export interface IFilterKeyColumnsTarget extends IFilterColumnTarget, IKeyColumnsTarget { }
export interface IFilterKeyHierarchyTarget extends IFilterHierarchyTarget, IKeyHierarchyTarget { }
export interface IFilterHierarchyLevelTarget extends IBaseFilterTarget, IHierarchyLevelTarget { }
export interface IFilterHierarchyTarget extends IBaseFilterTarget, IHierarchyTarget { }
export interface IFilterKeyHierarchyTarget extends IFilterHierarchyLevelTarget, IKeyHierarchyTarget { }
export interface INotSupportedFilterTarget extends IBaseFilterTarget, INotSupportedTarget { }
export interface IFilterAggregationTarget extends IBaseFilterTarget, IAggregationTarget { }
export interface IFilterMeasureTarget extends IBaseFilterTarget, IMeasureTarget { }
export interface IFilterColumnAggrTarget extends IFilterColumnTarget, IFilterAggregationTarget { }
export interface IFilterHierarchyAggrTarget extends IFilterHierarchyLevelTarget, IFilterAggregationTarget { }
export declare type IFilterKeyTarget = (IFilterKeyColumnsTarget | IFilterKeyHierarchyTarget);
export declare type IFilterTarget = (IFilterColumnTarget | IFilterHierarchyTarget | IFilterMeasureTarget | INotSupportedFilterTarget);
export declare type IFilterTarget = (IFilterColumnTarget | IFilterHierarchyLevelTarget | IFilterMeasureTarget | INotSupportedFilterTarget | IFilterColumnAggrTarget | IFilterHierarchyAggrTarget);
export type ITupleFilterTarget = IFilterTarget[];
export type IFilterGeneralTarget = IFilterTarget | IFilterKeyTarget | ITupleFilterTarget;
export interface IFilter {
@ -727,16 +742,24 @@ export function getFilterType(filter: IFilter): FilterType {
}
}
export function isMeasure(arg: any): arg is IFilterMeasureTarget {
export function isMeasure(arg: any): arg is IMeasureTarget {
return arg.table !== undefined && arg.measure !== undefined;
}
export function isColumn(arg: any): arg is IFilterColumnTarget {
return arg.table !== undefined && arg.column !== undefined;
export function isColumn(arg: any): arg is IColumnTarget {
return !!(arg.table && arg.column && !arg.aggregationFunction);
}
export function isHierarchy(arg: any): arg is IFilterHierarchyTarget {
return arg.table !== undefined && arg.hierarchy !== undefined && arg.hierarchyLevel !== undefined;
export function isHierarchyLevel(arg: any): arg is IHierarchyLevelTarget {
return !!(arg.table && arg.hierarchy && arg.hierarchyLevel && !arg.aggregationFunction);
}
export function isHierarchyLevelAggr(arg: any): arg is IHierarchyLevelAggrTarget {
return !!(arg.table && arg.hierarchy && arg.hierarchyLevel && arg.aggregationFunction);
}
export function isColumnAggr(arg: any): arg is IColumnAggrTarget {
return !!(arg.table && arg.column && arg.aggregationFunction);
}
export interface IReportLoadConfiguration {