@finos/legend-query-builder 4.18.1 → 4.18.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/QueryBuilder.d.ts.map +1 -1
- package/lib/components/QueryBuilder.js +0 -1
- package/lib/components/QueryBuilder.js.map +1 -1
- package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
- package/lib/components/QueryBuilderSideBar.js +10 -2
- package/lib/components/QueryBuilderSideBar.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +5 -3
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
- package/lib/components/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
- package/lib/components/filter/QueryBuilderFilterPanel.js +74 -36
- package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
- package/lib/components/result/tds/QueryBuilderTDSCellSelectionStatsBar.d.ts.map +1 -1
- package/lib/components/result/tds/QueryBuilderTDSCellSelectionStatsBar.js +15 -3
- package/lib/components/result/tds/QueryBuilderTDSCellSelectionStatsBar.js.map +1 -1
- package/lib/components/result/tds/QueryBuilderTDSResultShared.d.ts.map +1 -1
- package/lib/components/result/tds/QueryBuilderTDSResultShared.js +5 -3
- package/lib/components/result/tds/QueryBuilderTDSResultShared.js.map +1 -1
- package/lib/components/sql-playground/SQLPlaygroundPanel.d.ts.map +1 -1
- package/lib/components/sql-playground/SQLPlaygroundPanel.js +9 -5
- package/lib/components/sql-playground/SQLPlaygroundPanel.js.map +1 -1
- package/lib/data-access-overview.css +1 -1
- package/lib/index.css +1 -17
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/QueryBuilderStateBuilder.d.ts +1 -1
- package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
- package/lib/stores/QueryBuilderStateBuilder.js +10 -2
- package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
- package/lib/stores/QueryBuilderStateHashUtils.d.ts +2 -0
- package/lib/stores/QueryBuilderStateHashUtils.d.ts.map +1 -1
- package/lib/stores/QueryBuilderStateHashUtils.js +2 -0
- package/lib/stores/QueryBuilderStateHashUtils.js.map +1 -1
- package/lib/stores/__test-utils__/TEST_DATA__QueryBuilder_Accessors.d.ts +98 -0
- package/lib/stores/__test-utils__/TEST_DATA__QueryBuilder_Accessors.d.ts.map +1 -1
- package/lib/stores/__test-utils__/TEST_DATA__QueryBuilder_Accessors.js +156 -0
- package/lib/stores/__test-utils__/TEST_DATA__QueryBuilder_Accessors.js.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterState.d.ts +50 -4
- package/lib/stores/filter/QueryBuilderFilterState.d.ts.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterState.js +112 -11
- package/lib/stores/filter/QueryBuilderFilterState.js.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterStateBuilder.d.ts.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterStateBuilder.js +17 -3
- package/lib/stores/filter/QueryBuilderFilterStateBuilder.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperatorValueSpecificationBuilder.d.ts +6 -0
- package/lib/stores/filter/operators/QueryBuilderFilterOperatorValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperatorValueSpecificationBuilder.js +35 -9
- package/lib/stores/filter/operators/QueryBuilderFilterOperatorValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_Contain.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_Contain.js +2 -4
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_Contain.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_EndWith.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_EndWith.js +2 -4
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_EndWith.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_Equal.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_Equal.js +7 -11
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_Equal.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.js +7 -11
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.js +7 -11
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_In.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_In.js +3 -6
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_In.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_IsEmpty.d.ts +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_IsEmpty.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_IsEmpty.js +5 -3
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_IsEmpty.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThan.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThan.js +7 -11
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThan.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.js +7 -11
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_StartWith.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_StartWith.js +2 -4
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_StartWith.js.map +1 -1
- package/lib/stores/milestoning/QueryBuilderMilestoningState.d.ts.map +1 -1
- package/lib/stores/milestoning/QueryBuilderMilestoningState.js +9 -6
- package/lib/stores/milestoning/QueryBuilderMilestoningState.js.map +1 -1
- package/lib/stores/workflows/accessor/AccessorQueryBuilderState.d.ts +1 -2
- package/lib/stores/workflows/accessor/AccessorQueryBuilderState.d.ts.map +1 -1
- package/lib/stores/workflows/accessor/AccessorQueryBuilderState.js +1 -3
- package/lib/stores/workflows/accessor/AccessorQueryBuilderState.js.map +1 -1
- package/lib/stores/workflows/dataProduct/DataProductQueryBuilderState.d.ts +11 -6
- package/lib/stores/workflows/dataProduct/DataProductQueryBuilderState.d.ts.map +1 -1
- package/lib/stores/workflows/dataProduct/DataProductQueryBuilderState.js +150 -49
- package/lib/stores/workflows/dataProduct/DataProductQueryBuilderState.js.map +1 -1
- package/package.json +10 -10
- package/src/components/QueryBuilder.tsx +0 -1
- package/src/components/QueryBuilderSideBar.tsx +10 -7
- package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +7 -2
- package/src/components/filter/QueryBuilderFilterPanel.tsx +138 -69
- package/src/components/result/tds/QueryBuilderTDSCellSelectionStatsBar.tsx +33 -3
- package/src/components/result/tds/QueryBuilderTDSResultShared.tsx +4 -1
- package/src/components/sql-playground/SQLPlaygroundPanel.tsx +10 -5
- package/src/index.ts +1 -1
- package/src/stores/QueryBuilderStateBuilder.ts +15 -2
- package/src/stores/QueryBuilderStateHashUtils.ts +2 -0
- package/src/stores/__test-utils__/TEST_DATA__QueryBuilder_Accessors.ts +157 -0
- package/src/stores/filter/QueryBuilderFilterState.ts +175 -14
- package/src/stores/filter/QueryBuilderFilterStateBuilder.ts +24 -3
- package/src/stores/filter/operators/QueryBuilderFilterOperatorValueSpecificationBuilder.ts +55 -24
- package/src/stores/filter/operators/QueryBuilderFilterOperator_Contain.ts +2 -5
- package/src/stores/filter/operators/QueryBuilderFilterOperator_EndWith.ts +2 -5
- package/src/stores/filter/operators/QueryBuilderFilterOperator_Equal.ts +7 -13
- package/src/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.ts +7 -13
- package/src/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.ts +7 -13
- package/src/stores/filter/operators/QueryBuilderFilterOperator_In.ts +3 -9
- package/src/stores/filter/operators/QueryBuilderFilterOperator_IsEmpty.ts +9 -6
- package/src/stores/filter/operators/QueryBuilderFilterOperator_LessThan.ts +7 -13
- package/src/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.ts +7 -13
- package/src/stores/filter/operators/QueryBuilderFilterOperator_StartWith.ts +2 -5
- package/src/stores/milestoning/QueryBuilderMilestoningState.ts +13 -7
- package/src/stores/workflows/accessor/AccessorQueryBuilderState.ts +1 -3
- package/src/stores/workflows/dataProduct/DataProductQueryBuilderState.ts +245 -76
|
@@ -22,7 +22,6 @@ import { QueryBuilderFilterOperator } from '../QueryBuilderFilterOperator.js';
|
|
|
22
22
|
import {
|
|
23
23
|
type ValueSpecification,
|
|
24
24
|
type SimpleFunctionExpression,
|
|
25
|
-
type AbstractPropertyExpression,
|
|
26
25
|
Enumeration,
|
|
27
26
|
PRIMITIVE_TYPE,
|
|
28
27
|
} from '@finos/legend-graph';
|
|
@@ -30,6 +29,7 @@ import { type Hashable, hashArray } from '@finos/legend-shared';
|
|
|
30
29
|
import {
|
|
31
30
|
buildFilterConditionState,
|
|
32
31
|
buildFilterConditionExpression,
|
|
32
|
+
getFilterExpressionLeftSideTypePath,
|
|
33
33
|
} from './QueryBuilderFilterOperatorValueSpecificationBuilder.js';
|
|
34
34
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../graph/QueryBuilderMetaModelConst.js';
|
|
35
35
|
import {
|
|
@@ -52,9 +52,7 @@ export class QueryBuilderFilterOperator_Equal
|
|
|
52
52
|
isCompatibleWithFilterConditionProperty(
|
|
53
53
|
filterConditionState: FilterConditionState,
|
|
54
54
|
): boolean {
|
|
55
|
-
const propertyType =
|
|
56
|
-
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
|
57
|
-
.genericType.value.rawType;
|
|
55
|
+
const propertyType = filterConditionState.leftConditionType;
|
|
58
56
|
const normalizedType = getStandardPrimitiveTypeEquivalent(propertyType);
|
|
59
57
|
return (
|
|
60
58
|
(normalizedType !== undefined &&
|
|
@@ -84,17 +82,14 @@ export class QueryBuilderFilterOperator_Equal
|
|
|
84
82
|
!filterConditionState.rightConditionValue.isCollection
|
|
85
83
|
? filterConditionState.rightConditionValue.type
|
|
86
84
|
: undefined,
|
|
87
|
-
filterConditionState.
|
|
88
|
-
.genericType.value.rawType,
|
|
85
|
+
filterConditionState.leftConditionType,
|
|
89
86
|
);
|
|
90
87
|
}
|
|
91
88
|
|
|
92
89
|
getDefaultFilterConditionValue(
|
|
93
90
|
filterConditionState: FilterConditionState,
|
|
94
91
|
): ValueSpecification | undefined {
|
|
95
|
-
const propertyType =
|
|
96
|
-
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
|
97
|
-
.genericType.value.rawType;
|
|
92
|
+
const propertyType = filterConditionState.leftConditionType;
|
|
98
93
|
return buildDefaultInstanceValue(
|
|
99
94
|
filterConditionState.filterState.queryBuilderState.graphManagerState
|
|
100
95
|
.graph,
|
|
@@ -111,8 +106,7 @@ export class QueryBuilderFilterOperator_Equal
|
|
|
111
106
|
): ValueSpecification {
|
|
112
107
|
return buildFilterConditionExpression(
|
|
113
108
|
filterConditionState,
|
|
114
|
-
filterConditionState.
|
|
115
|
-
.genericType.value.rawType.path === PRIMITIVE_TYPE.DATETIME &&
|
|
109
|
+
filterConditionState.leftConditionType.path === PRIMITIVE_TYPE.DATETIME &&
|
|
116
110
|
filterConditionState.rightConditionValue?.type?.path !==
|
|
117
111
|
PRIMITIVE_TYPE.DATETIME
|
|
118
112
|
? QUERY_BUILDER_SUPPORTED_FUNCTIONS.IS_ON_DAY
|
|
@@ -128,8 +122,8 @@ export class QueryBuilderFilterOperator_Equal
|
|
|
128
122
|
return buildFilterConditionState(
|
|
129
123
|
filterState,
|
|
130
124
|
expression,
|
|
131
|
-
(expression
|
|
132
|
-
|
|
125
|
+
getFilterExpressionLeftSideTypePath(expression) ===
|
|
126
|
+
PRIMITIVE_TYPE.DATETIME &&
|
|
133
127
|
expression.parametersValues[1]?.genericType?.value.rawType.path !==
|
|
134
128
|
PRIMITIVE_TYPE.DATETIME
|
|
135
129
|
? QUERY_BUILDER_SUPPORTED_FUNCTIONS.IS_ON_DAY
|
|
@@ -22,7 +22,6 @@ import { QueryBuilderFilterOperator } from '../QueryBuilderFilterOperator.js';
|
|
|
22
22
|
import {
|
|
23
23
|
type ValueSpecification,
|
|
24
24
|
type SimpleFunctionExpression,
|
|
25
|
-
type AbstractPropertyExpression,
|
|
26
25
|
PRIMITIVE_TYPE,
|
|
27
26
|
} from '@finos/legend-graph';
|
|
28
27
|
import {
|
|
@@ -33,6 +32,7 @@ import {
|
|
|
33
32
|
import {
|
|
34
33
|
buildFilterConditionState,
|
|
35
34
|
buildFilterConditionExpression,
|
|
35
|
+
getFilterExpressionLeftSideTypePath,
|
|
36
36
|
} from './QueryBuilderFilterOperatorValueSpecificationBuilder.js';
|
|
37
37
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../graph/QueryBuilderMetaModelConst.js';
|
|
38
38
|
import {
|
|
@@ -53,9 +53,7 @@ export class QueryBuilderFilterOperator_GreaterThan
|
|
|
53
53
|
isCompatibleWithFilterConditionProperty(
|
|
54
54
|
filterConditionState: FilterConditionState,
|
|
55
55
|
): boolean {
|
|
56
|
-
const propertyType =
|
|
57
|
-
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
|
58
|
-
.genericType.value.rawType;
|
|
56
|
+
const propertyType = filterConditionState.leftConditionType;
|
|
59
57
|
const normalizedType = getStandardPrimitiveTypeEquivalent(propertyType);
|
|
60
58
|
return (
|
|
61
59
|
normalizedType !== undefined &&
|
|
@@ -81,17 +79,14 @@ export class QueryBuilderFilterOperator_GreaterThan
|
|
|
81
79
|
!filterConditionState.rightConditionValue.isCollection
|
|
82
80
|
? filterConditionState.rightConditionValue.type
|
|
83
81
|
: undefined,
|
|
84
|
-
filterConditionState.
|
|
85
|
-
.genericType.value.rawType,
|
|
82
|
+
filterConditionState.leftConditionType,
|
|
86
83
|
);
|
|
87
84
|
}
|
|
88
85
|
|
|
89
86
|
getDefaultFilterConditionValue(
|
|
90
87
|
filterConditionState: FilterConditionState,
|
|
91
88
|
): ValueSpecification | undefined {
|
|
92
|
-
const propertyType =
|
|
93
|
-
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
|
94
|
-
.genericType.value.rawType;
|
|
89
|
+
const propertyType = filterConditionState.leftConditionType;
|
|
95
90
|
switch (propertyType.path) {
|
|
96
91
|
case PRIMITIVE_TYPE.NUMBER:
|
|
97
92
|
case PRIMITIVE_TYPE.DECIMAL:
|
|
@@ -122,8 +117,7 @@ export class QueryBuilderFilterOperator_GreaterThan
|
|
|
122
117
|
): ValueSpecification {
|
|
123
118
|
return buildFilterConditionExpression(
|
|
124
119
|
filterConditionState,
|
|
125
|
-
filterConditionState.
|
|
126
|
-
.genericType.value.rawType.path === PRIMITIVE_TYPE.DATETIME &&
|
|
120
|
+
filterConditionState.leftConditionType.path === PRIMITIVE_TYPE.DATETIME &&
|
|
127
121
|
filterConditionState.rightConditionValue?.type?.path !==
|
|
128
122
|
PRIMITIVE_TYPE.DATETIME
|
|
129
123
|
? QUERY_BUILDER_SUPPORTED_FUNCTIONS.IS_AFTER_DAY
|
|
@@ -139,8 +133,8 @@ export class QueryBuilderFilterOperator_GreaterThan
|
|
|
139
133
|
return buildFilterConditionState(
|
|
140
134
|
filterState,
|
|
141
135
|
expression,
|
|
142
|
-
(expression
|
|
143
|
-
|
|
136
|
+
getFilterExpressionLeftSideTypePath(expression) ===
|
|
137
|
+
PRIMITIVE_TYPE.DATETIME &&
|
|
144
138
|
expression.parametersValues[1]?.genericType?.value.rawType.path !==
|
|
145
139
|
PRIMITIVE_TYPE.DATETIME
|
|
146
140
|
? QUERY_BUILDER_SUPPORTED_FUNCTIONS.IS_AFTER_DAY
|
|
@@ -23,7 +23,6 @@ import {
|
|
|
23
23
|
PRIMITIVE_TYPE,
|
|
24
24
|
type ValueSpecification,
|
|
25
25
|
type SimpleFunctionExpression,
|
|
26
|
-
type AbstractPropertyExpression,
|
|
27
26
|
} from '@finos/legend-graph';
|
|
28
27
|
import {
|
|
29
28
|
type Hashable,
|
|
@@ -33,6 +32,7 @@ import {
|
|
|
33
32
|
import {
|
|
34
33
|
buildFilterConditionState,
|
|
35
34
|
buildFilterConditionExpression,
|
|
35
|
+
getFilterExpressionLeftSideTypePath,
|
|
36
36
|
} from './QueryBuilderFilterOperatorValueSpecificationBuilder.js';
|
|
37
37
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../graph/QueryBuilderMetaModelConst.js';
|
|
38
38
|
import {
|
|
@@ -53,9 +53,7 @@ export class QueryBuilderFilterOperator_GreaterThanEqual
|
|
|
53
53
|
isCompatibleWithFilterConditionProperty(
|
|
54
54
|
filterConditionState: FilterConditionState,
|
|
55
55
|
): boolean {
|
|
56
|
-
const propertyType =
|
|
57
|
-
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
|
58
|
-
.genericType.value.rawType;
|
|
56
|
+
const propertyType = filterConditionState.leftConditionType;
|
|
59
57
|
const normalizedType = getStandardPrimitiveTypeEquivalent(propertyType);
|
|
60
58
|
return (
|
|
61
59
|
normalizedType !== undefined &&
|
|
@@ -81,17 +79,14 @@ export class QueryBuilderFilterOperator_GreaterThanEqual
|
|
|
81
79
|
!filterConditionState.rightConditionValue.isCollection
|
|
82
80
|
? filterConditionState.rightConditionValue.type
|
|
83
81
|
: undefined,
|
|
84
|
-
filterConditionState.
|
|
85
|
-
.genericType.value.rawType,
|
|
82
|
+
filterConditionState.leftConditionType,
|
|
86
83
|
);
|
|
87
84
|
}
|
|
88
85
|
|
|
89
86
|
getDefaultFilterConditionValue(
|
|
90
87
|
filterConditionState: FilterConditionState,
|
|
91
88
|
): ValueSpecification | undefined {
|
|
92
|
-
const propertyType =
|
|
93
|
-
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
|
94
|
-
.genericType.value.rawType;
|
|
89
|
+
const propertyType = filterConditionState.leftConditionType;
|
|
95
90
|
switch (propertyType.path) {
|
|
96
91
|
case PRIMITIVE_TYPE.NUMBER:
|
|
97
92
|
case PRIMITIVE_TYPE.DECIMAL:
|
|
@@ -122,8 +117,7 @@ export class QueryBuilderFilterOperator_GreaterThanEqual
|
|
|
122
117
|
): ValueSpecification {
|
|
123
118
|
return buildFilterConditionExpression(
|
|
124
119
|
filterConditionState,
|
|
125
|
-
filterConditionState.
|
|
126
|
-
.genericType.value.rawType.path === PRIMITIVE_TYPE.DATETIME &&
|
|
120
|
+
filterConditionState.leftConditionType.path === PRIMITIVE_TYPE.DATETIME &&
|
|
127
121
|
filterConditionState.rightConditionValue?.type?.path !==
|
|
128
122
|
PRIMITIVE_TYPE.DATETIME
|
|
129
123
|
? QUERY_BUILDER_SUPPORTED_FUNCTIONS.IS_ON_OR_AFTER_DAY
|
|
@@ -139,8 +133,8 @@ export class QueryBuilderFilterOperator_GreaterThanEqual
|
|
|
139
133
|
return buildFilterConditionState(
|
|
140
134
|
filterState,
|
|
141
135
|
expression,
|
|
142
|
-
(expression
|
|
143
|
-
|
|
136
|
+
getFilterExpressionLeftSideTypePath(expression) ===
|
|
137
|
+
PRIMITIVE_TYPE.DATETIME &&
|
|
144
138
|
expression.parametersValues[1]?.genericType?.value.rawType.path !==
|
|
145
139
|
PRIMITIVE_TYPE.DATETIME
|
|
146
140
|
? QUERY_BUILDER_SUPPORTED_FUNCTIONS.IS_ON_OR_AFTER_DAY
|
|
@@ -56,9 +56,7 @@ export class QueryBuilderFilterOperator_In
|
|
|
56
56
|
isCompatibleWithFilterConditionProperty(
|
|
57
57
|
filterConditionState: FilterConditionState,
|
|
58
58
|
): boolean {
|
|
59
|
-
const propertyType =
|
|
60
|
-
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
|
61
|
-
.genericType.value.rawType;
|
|
59
|
+
const propertyType = filterConditionState.leftConditionType;
|
|
62
60
|
const normalizedType = getStandardPrimitiveTypeEquivalent(propertyType);
|
|
63
61
|
return (
|
|
64
62
|
(normalizedType !== undefined &&
|
|
@@ -82,9 +80,7 @@ export class QueryBuilderFilterOperator_In
|
|
|
82
80
|
isCompatibleWithFilterConditionValue(
|
|
83
81
|
filterConditionState: FilterConditionState,
|
|
84
82
|
): boolean {
|
|
85
|
-
const propertyType =
|
|
86
|
-
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
|
87
|
-
.genericType.value.rawType;
|
|
83
|
+
const propertyType = filterConditionState.leftConditionType;
|
|
88
84
|
const rightSide = filterConditionState.rightConditionValue;
|
|
89
85
|
// `in`/`not in` does not support right hand value being column state as the multipliticy for columns are [0..1]
|
|
90
86
|
if (rightSide instanceof FilterValueSpecConditionValueState) {
|
|
@@ -147,9 +143,7 @@ export class QueryBuilderFilterOperator_In
|
|
|
147
143
|
getDefaultFilterConditionValue(
|
|
148
144
|
filterConditionState: FilterConditionState,
|
|
149
145
|
): ValueSpecification | undefined {
|
|
150
|
-
const propertyType =
|
|
151
|
-
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
|
152
|
-
.genericType.value.rawType;
|
|
146
|
+
const propertyType = filterConditionState.leftConditionType;
|
|
153
147
|
return new CollectionInstanceValue(
|
|
154
148
|
Multiplicity.ONE,
|
|
155
149
|
GenericTypeExplicitReference.create(new GenericType(propertyType)),
|
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import
|
|
18
|
-
QueryBuilderFilterState,
|
|
19
|
-
FilterConditionState,
|
|
17
|
+
import {
|
|
18
|
+
type QueryBuilderFilterState,
|
|
19
|
+
type FilterConditionState,
|
|
20
|
+
FilterPropertyExpressionSourceState,
|
|
20
21
|
} from '../QueryBuilderFilterState.js';
|
|
21
22
|
import { QueryBuilderFilterOperator } from '../QueryBuilderFilterOperator.js';
|
|
22
23
|
import {
|
|
@@ -50,11 +51,13 @@ export class QueryBuilderFilterOperator_IsEmpty
|
|
|
50
51
|
isCompatibleWithFilterConditionProperty(
|
|
51
52
|
filterConditionState: FilterConditionState,
|
|
52
53
|
): boolean {
|
|
53
|
-
const propertyType =
|
|
54
|
-
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
|
55
|
-
.genericType.value.rawType;
|
|
54
|
+
const propertyType = filterConditionState.leftConditionType;
|
|
56
55
|
// First check if property is optional
|
|
57
56
|
if (
|
|
57
|
+
!(
|
|
58
|
+
filterConditionState.sourceState instanceof
|
|
59
|
+
FilterPropertyExpressionSourceState
|
|
60
|
+
) ||
|
|
58
61
|
!isPropertyExpressionChainOptional(
|
|
59
62
|
filterConditionState.propertyExpressionState.propertyExpression,
|
|
60
63
|
)
|
|
@@ -23,7 +23,6 @@ import {
|
|
|
23
23
|
PRIMITIVE_TYPE,
|
|
24
24
|
type ValueSpecification,
|
|
25
25
|
type SimpleFunctionExpression,
|
|
26
|
-
type AbstractPropertyExpression,
|
|
27
26
|
} from '@finos/legend-graph';
|
|
28
27
|
import {
|
|
29
28
|
type Hashable,
|
|
@@ -33,6 +32,7 @@ import {
|
|
|
33
32
|
import {
|
|
34
33
|
buildFilterConditionState,
|
|
35
34
|
buildFilterConditionExpression,
|
|
35
|
+
getFilterExpressionLeftSideTypePath,
|
|
36
36
|
} from './QueryBuilderFilterOperatorValueSpecificationBuilder.js';
|
|
37
37
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../graph/QueryBuilderMetaModelConst.js';
|
|
38
38
|
import {
|
|
@@ -53,9 +53,7 @@ export class QueryBuilderFilterOperator_LessThan
|
|
|
53
53
|
isCompatibleWithFilterConditionProperty(
|
|
54
54
|
filterConditionState: FilterConditionState,
|
|
55
55
|
): boolean {
|
|
56
|
-
const propertyType =
|
|
57
|
-
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
|
58
|
-
.genericType.value.rawType;
|
|
56
|
+
const propertyType = filterConditionState.leftConditionType;
|
|
59
57
|
const normalizedType = getStandardPrimitiveTypeEquivalent(propertyType);
|
|
60
58
|
return (
|
|
61
59
|
normalizedType !== undefined &&
|
|
@@ -81,17 +79,14 @@ export class QueryBuilderFilterOperator_LessThan
|
|
|
81
79
|
!filterConditionState.rightConditionValue.isCollection
|
|
82
80
|
? filterConditionState.rightConditionValue.type
|
|
83
81
|
: undefined,
|
|
84
|
-
filterConditionState.
|
|
85
|
-
.genericType.value.rawType,
|
|
82
|
+
filterConditionState.leftConditionType,
|
|
86
83
|
);
|
|
87
84
|
}
|
|
88
85
|
|
|
89
86
|
getDefaultFilterConditionValue(
|
|
90
87
|
filterConditionState: FilterConditionState,
|
|
91
88
|
): ValueSpecification | undefined {
|
|
92
|
-
const propertyType =
|
|
93
|
-
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
|
94
|
-
.genericType.value.rawType;
|
|
89
|
+
const propertyType = filterConditionState.leftConditionType;
|
|
95
90
|
switch (propertyType.path) {
|
|
96
91
|
case PRIMITIVE_TYPE.NUMBER:
|
|
97
92
|
case PRIMITIVE_TYPE.DECIMAL:
|
|
@@ -122,8 +117,7 @@ export class QueryBuilderFilterOperator_LessThan
|
|
|
122
117
|
): ValueSpecification {
|
|
123
118
|
return buildFilterConditionExpression(
|
|
124
119
|
filterConditionState,
|
|
125
|
-
filterConditionState.
|
|
126
|
-
.genericType.value.rawType.path === PRIMITIVE_TYPE.DATETIME &&
|
|
120
|
+
filterConditionState.leftConditionType.path === PRIMITIVE_TYPE.DATETIME &&
|
|
127
121
|
filterConditionState.rightConditionValue?.type?.path !==
|
|
128
122
|
PRIMITIVE_TYPE.DATETIME
|
|
129
123
|
? QUERY_BUILDER_SUPPORTED_FUNCTIONS.IS_BEFORE_DAY
|
|
@@ -139,8 +133,8 @@ export class QueryBuilderFilterOperator_LessThan
|
|
|
139
133
|
return buildFilterConditionState(
|
|
140
134
|
filterState,
|
|
141
135
|
expression,
|
|
142
|
-
(expression
|
|
143
|
-
|
|
136
|
+
getFilterExpressionLeftSideTypePath(expression) ===
|
|
137
|
+
PRIMITIVE_TYPE.DATETIME &&
|
|
144
138
|
expression.parametersValues[1]?.genericType?.value.rawType.path !==
|
|
145
139
|
PRIMITIVE_TYPE.DATETIME
|
|
146
140
|
? QUERY_BUILDER_SUPPORTED_FUNCTIONS.IS_BEFORE_DAY
|
|
@@ -23,7 +23,6 @@ import {
|
|
|
23
23
|
PRIMITIVE_TYPE,
|
|
24
24
|
type ValueSpecification,
|
|
25
25
|
type SimpleFunctionExpression,
|
|
26
|
-
type AbstractPropertyExpression,
|
|
27
26
|
} from '@finos/legend-graph';
|
|
28
27
|
import {
|
|
29
28
|
type Hashable,
|
|
@@ -33,6 +32,7 @@ import {
|
|
|
33
32
|
import {
|
|
34
33
|
buildFilterConditionState,
|
|
35
34
|
buildFilterConditionExpression,
|
|
35
|
+
getFilterExpressionLeftSideTypePath,
|
|
36
36
|
} from './QueryBuilderFilterOperatorValueSpecificationBuilder.js';
|
|
37
37
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../graph/QueryBuilderMetaModelConst.js';
|
|
38
38
|
import {
|
|
@@ -53,9 +53,7 @@ export class QueryBuilderFilterOperator_LessThanEqual
|
|
|
53
53
|
isCompatibleWithFilterConditionProperty(
|
|
54
54
|
filterConditionState: FilterConditionState,
|
|
55
55
|
): boolean {
|
|
56
|
-
const propertyType =
|
|
57
|
-
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
|
58
|
-
.genericType.value.rawType;
|
|
56
|
+
const propertyType = filterConditionState.leftConditionType;
|
|
59
57
|
const normalizedType = getStandardPrimitiveTypeEquivalent(propertyType);
|
|
60
58
|
return (
|
|
61
59
|
normalizedType !== undefined &&
|
|
@@ -81,17 +79,14 @@ export class QueryBuilderFilterOperator_LessThanEqual
|
|
|
81
79
|
!filterConditionState.rightConditionValue.isCollection
|
|
82
80
|
? filterConditionState.rightConditionValue.type
|
|
83
81
|
: undefined,
|
|
84
|
-
filterConditionState.
|
|
85
|
-
.genericType.value.rawType,
|
|
82
|
+
filterConditionState.leftConditionType,
|
|
86
83
|
);
|
|
87
84
|
}
|
|
88
85
|
|
|
89
86
|
getDefaultFilterConditionValue(
|
|
90
87
|
filterConditionState: FilterConditionState,
|
|
91
88
|
): ValueSpecification | undefined {
|
|
92
|
-
const propertyType =
|
|
93
|
-
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
|
94
|
-
.genericType.value.rawType;
|
|
89
|
+
const propertyType = filterConditionState.leftConditionType;
|
|
95
90
|
switch (propertyType.path) {
|
|
96
91
|
case PRIMITIVE_TYPE.NUMBER:
|
|
97
92
|
case PRIMITIVE_TYPE.DECIMAL:
|
|
@@ -122,8 +117,7 @@ export class QueryBuilderFilterOperator_LessThanEqual
|
|
|
122
117
|
): ValueSpecification {
|
|
123
118
|
return buildFilterConditionExpression(
|
|
124
119
|
filterConditionState,
|
|
125
|
-
filterConditionState.
|
|
126
|
-
.genericType.value.rawType.path === PRIMITIVE_TYPE.DATETIME &&
|
|
120
|
+
filterConditionState.leftConditionType.path === PRIMITIVE_TYPE.DATETIME &&
|
|
127
121
|
filterConditionState.rightConditionValue?.type?.path !==
|
|
128
122
|
PRIMITIVE_TYPE.DATETIME
|
|
129
123
|
? QUERY_BUILDER_SUPPORTED_FUNCTIONS.IS_ON_OR_BEFORE_DAY
|
|
@@ -139,8 +133,8 @@ export class QueryBuilderFilterOperator_LessThanEqual
|
|
|
139
133
|
return buildFilterConditionState(
|
|
140
134
|
filterState,
|
|
141
135
|
expression,
|
|
142
|
-
(expression
|
|
143
|
-
|
|
136
|
+
getFilterExpressionLeftSideTypePath(expression) ===
|
|
137
|
+
PRIMITIVE_TYPE.DATETIME &&
|
|
144
138
|
expression.parametersValues[1]?.genericType?.value.rawType.path !==
|
|
145
139
|
PRIMITIVE_TYPE.DATETIME
|
|
146
140
|
? QUERY_BUILDER_SUPPORTED_FUNCTIONS.IS_ON_OR_BEFORE_DAY
|
|
@@ -55,8 +55,7 @@ export class QueryBuilderFilterOperator_StartWith
|
|
|
55
55
|
): boolean {
|
|
56
56
|
return (
|
|
57
57
|
getStandardPrimitiveTypeEquivalent(
|
|
58
|
-
filterConditionState.
|
|
59
|
-
.value.genericType.value.rawType,
|
|
58
|
+
filterConditionState.leftConditionType,
|
|
60
59
|
) === PRIMITIVE_TYPE.STRING
|
|
61
60
|
);
|
|
62
61
|
}
|
|
@@ -78,9 +77,7 @@ export class QueryBuilderFilterOperator_StartWith
|
|
|
78
77
|
getDefaultFilterConditionValue(
|
|
79
78
|
filterConditionState: FilterConditionState,
|
|
80
79
|
): ValueSpecification | undefined {
|
|
81
|
-
const propertyType =
|
|
82
|
-
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
|
83
|
-
.genericType.value.rawType;
|
|
80
|
+
const propertyType = filterConditionState.leftConditionType;
|
|
84
81
|
switch (propertyType.path) {
|
|
85
82
|
case PRIMITIVE_TYPE.STRING: {
|
|
86
83
|
return buildDefaultInstanceValue(
|
|
@@ -51,6 +51,7 @@ import { QueryBuilderAggregateColumnState } from '../fetch-structure/tds/aggrega
|
|
|
51
51
|
import {
|
|
52
52
|
QueryBuilderFilterTreeConditionNodeData,
|
|
53
53
|
QueryBuilderFilterTreeExistsNodeData,
|
|
54
|
+
FilterPropertyExpressionSourceState,
|
|
54
55
|
} from '../filter/QueryBuilderFilterState.js';
|
|
55
56
|
|
|
56
57
|
export class QueryBuilderMilestoningState implements Hashable {
|
|
@@ -153,13 +154,18 @@ export class QueryBuilderMilestoningState implements Hashable {
|
|
|
153
154
|
}
|
|
154
155
|
this.queryBuilderState.filterState.nodes.forEach((node) => {
|
|
155
156
|
if (node instanceof QueryBuilderFilterTreeConditionNodeData) {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
157
|
+
if (
|
|
158
|
+
node.condition.sourceState instanceof
|
|
159
|
+
FilterPropertyExpressionSourceState
|
|
160
|
+
) {
|
|
161
|
+
node.condition.sourceState.propertyExpressionState.derivedPropertyExpressionStates[0]?.parameterValues.forEach(
|
|
162
|
+
(p) => {
|
|
163
|
+
if (p instanceof INTERNAL__PropagatedValue) {
|
|
164
|
+
p.isPropagatedValue = false;
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
);
|
|
168
|
+
}
|
|
163
169
|
} else if (node instanceof QueryBuilderFilterTreeExistsNodeData) {
|
|
164
170
|
if (
|
|
165
171
|
node.propertyExpressionState.derivedPropertyExpressionStates[0] &&
|
|
@@ -147,11 +147,9 @@ export class AccessorQueryBuilderState extends QueryBuilderState {
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
/**
|
|
150
|
-
* In accessor mode,
|
|
151
|
-
* so we hide it and show the post-filter panel instead.
|
|
150
|
+
* In accessor mode, configure both filter and post-filter panels to be visible.
|
|
152
151
|
*/
|
|
153
152
|
private configureFilterPanelsForAccessor(): void {
|
|
154
|
-
this.filterState.setShowPanel(false);
|
|
155
153
|
const tdsState = this.fetchStructureState.implementation;
|
|
156
154
|
if (tdsState instanceof QueryBuilderTDSState) {
|
|
157
155
|
tdsState.setShowPostFilterPanel(true);
|