@finos/legend-query-builder 4.14.62 → 4.14.64
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/QueryBuilderSideBar.js +1 -1
- package/lib/components/QueryBuilderSideBar.js.map +1 -1
- package/lib/components/QueryLoader.js +1 -1
- package/lib/components/QueryLoader.js.map +1 -1
- package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.d.ts +3 -0
- package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.d.ts.map +1 -1
- package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js +12 -1
- package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +20 -19
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
- package/lib/components/filter/QueryBuilderFilterPanel.d.ts +7 -1
- package/lib/components/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
- package/lib/components/filter/QueryBuilderFilterPanel.js +137 -54
- package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
- package/lib/components/shared/CustomDatePicker.js +1 -1
- package/lib/components/shared/CustomDatePicker.js.map +1 -1
- package/lib/components/shared/QueryBuilderFilterHelper.d.ts +19 -0
- package/lib/components/shared/QueryBuilderFilterHelper.d.ts.map +1 -0
- package/lib/components/shared/QueryBuilderFilterHelper.js +34 -0
- package/lib/components/shared/QueryBuilderFilterHelper.js.map +1 -0
- package/lib/components/shared/QueryBuilderPropertyInfoTooltip.js +1 -1
- package/lib/components/shared/QueryBuilderPropertyInfoTooltip.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +6 -6
- 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/explorer/QueryBuilderExplorerState.js +1 -1
- package/lib/stores/explorer/QueryBuilderExplorerState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_In.js +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_In.js.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterState.d.ts +35 -5
- package/lib/stores/filter/QueryBuilderFilterState.d.ts.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterState.js +181 -52
- package/lib/stores/filter/QueryBuilderFilterState.js.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterStateBuilder.js +2 -2
- package/lib/stores/filter/QueryBuilderFilterStateBuilder.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperatorValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperatorValueSpecificationBuilder.js +21 -6
- 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 +4 -3
- 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 +4 -3
- 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 +5 -4
- 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 +5 -4
- 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 +5 -4
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_In.d.ts +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_In.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_In.js +33 -28
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_In.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_IsEmpty.js +1 -1
- 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 +5 -4
- 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 +5 -4
- 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 +4 -3
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_StartWith.js.map +1 -1
- package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts +2 -1
- package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts.map +1 -1
- package/lib/stores/shared/ValueSpecificationEditorHelper.js +9 -3
- package/lib/stores/shared/ValueSpecificationEditorHelper.js.map +1 -1
- package/package.json +14 -14
- package/src/components/QueryBuilderSideBar.tsx +1 -1
- package/src/components/QueryLoader.tsx +2 -2
- package/src/components/__test-utils__/QueryBuilderComponentTestUtils.tsx +25 -0
- package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +29 -26
- package/src/components/filter/QueryBuilderFilterPanel.tsx +335 -106
- package/src/components/shared/CustomDatePicker.tsx +1 -1
- package/src/components/shared/QueryBuilderFilterHelper.ts +51 -0
- package/src/components/shared/QueryBuilderPropertyInfoTooltip.tsx +1 -1
- package/src/stores/QueryBuilderStateHashUtils.ts +2 -0
- package/src/stores/explorer/QueryBuilderExplorerState.ts +1 -1
- package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_In.ts +1 -1
- package/src/stores/filter/QueryBuilderFilterState.ts +284 -74
- package/src/stores/filter/QueryBuilderFilterStateBuilder.ts +2 -2
- package/src/stores/filter/operators/QueryBuilderFilterOperatorValueSpecificationBuilder.ts +48 -9
- package/src/stores/filter/operators/QueryBuilderFilterOperator_Contain.ts +5 -4
- package/src/stores/filter/operators/QueryBuilderFilterOperator_EndWith.ts +5 -4
- package/src/stores/filter/operators/QueryBuilderFilterOperator_Equal.ts +4 -4
- package/src/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.ts +5 -7
- package/src/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.ts +5 -7
- package/src/stores/filter/operators/QueryBuilderFilterOperator_In.ts +52 -47
- package/src/stores/filter/operators/QueryBuilderFilterOperator_IsEmpty.ts +1 -1
- package/src/stores/filter/operators/QueryBuilderFilterOperator_LessThan.ts +5 -7
- package/src/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.ts +5 -7
- package/src/stores/filter/operators/QueryBuilderFilterOperator_StartWith.ts +5 -4
- package/src/stores/shared/ValueSpecificationEditorHelper.ts +28 -0
- package/tsconfig.json +1 -0
@@ -34,7 +34,6 @@ import {
|
|
34
34
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../graph/QueryBuilderMetaModelConst.js';
|
35
35
|
import {
|
36
36
|
buildNotExpression,
|
37
|
-
getNonCollectionValueSpecificationType,
|
38
37
|
isTypeCompatibleForAssignment,
|
39
38
|
unwrapNotExpression,
|
40
39
|
} from '../../QueryBuilderValueSpecificationHelper.js';
|
@@ -78,8 +77,9 @@ export class QueryBuilderFilterOperator_Equal
|
|
78
77
|
filterConditionState: FilterConditionState,
|
79
78
|
): boolean {
|
80
79
|
return isTypeCompatibleForAssignment(
|
81
|
-
filterConditionState.
|
82
|
-
|
80
|
+
filterConditionState.rightConditionValue &&
|
81
|
+
!filterConditionState.rightConditionValue.isCollection
|
82
|
+
? filterConditionState.rightConditionValue.type
|
83
83
|
: undefined,
|
84
84
|
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
85
85
|
.genericType.value.rawType,
|
@@ -110,7 +110,7 @@ export class QueryBuilderFilterOperator_Equal
|
|
110
110
|
filterConditionState,
|
111
111
|
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
112
112
|
.genericType.value.rawType.path === PRIMITIVE_TYPE.DATETIME &&
|
113
|
-
filterConditionState.
|
113
|
+
filterConditionState.rightConditionValue?.type?.path !==
|
114
114
|
PRIMITIVE_TYPE.DATETIME
|
115
115
|
? QUERY_BUILDER_SUPPORTED_FUNCTIONS.IS_ON_DAY
|
116
116
|
: QUERY_BUILDER_SUPPORTED_FUNCTIONS.EQUAL,
|
@@ -35,10 +35,7 @@ import {
|
|
35
35
|
buildFilterConditionExpression,
|
36
36
|
} from './QueryBuilderFilterOperatorValueSpecificationBuilder.js';
|
37
37
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../graph/QueryBuilderMetaModelConst.js';
|
38
|
-
import {
|
39
|
-
getNonCollectionValueSpecificationType,
|
40
|
-
isTypeCompatibleForAssignment,
|
41
|
-
} from '../../QueryBuilderValueSpecificationHelper.js';
|
38
|
+
import { isTypeCompatibleForAssignment } from '../../QueryBuilderValueSpecificationHelper.js';
|
42
39
|
import { QUERY_BUILDER_STATE_HASH_STRUCTURE } from '../../QueryBuilderStateHashUtils.js';
|
43
40
|
import { buildDefaultInstanceValue } from '../../shared/ValueSpecificationEditorHelper.js';
|
44
41
|
|
@@ -73,8 +70,9 @@ export class QueryBuilderFilterOperator_GreaterThan
|
|
73
70
|
filterConditionState: FilterConditionState,
|
74
71
|
): boolean {
|
75
72
|
return isTypeCompatibleForAssignment(
|
76
|
-
filterConditionState.
|
77
|
-
|
73
|
+
filterConditionState.rightConditionValue &&
|
74
|
+
!filterConditionState.rightConditionValue.isCollection
|
75
|
+
? filterConditionState.rightConditionValue.type
|
78
76
|
: undefined,
|
79
77
|
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
80
78
|
.genericType.value.rawType,
|
@@ -121,7 +119,7 @@ export class QueryBuilderFilterOperator_GreaterThan
|
|
121
119
|
filterConditionState,
|
122
120
|
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
123
121
|
.genericType.value.rawType.path === PRIMITIVE_TYPE.DATETIME &&
|
124
|
-
filterConditionState.
|
122
|
+
filterConditionState.rightConditionValue?.type?.path !==
|
125
123
|
PRIMITIVE_TYPE.DATETIME
|
126
124
|
? QUERY_BUILDER_SUPPORTED_FUNCTIONS.IS_AFTER_DAY
|
127
125
|
: QUERY_BUILDER_SUPPORTED_FUNCTIONS.GREATER_THAN,
|
@@ -35,10 +35,7 @@ import {
|
|
35
35
|
buildFilterConditionExpression,
|
36
36
|
} from './QueryBuilderFilterOperatorValueSpecificationBuilder.js';
|
37
37
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../graph/QueryBuilderMetaModelConst.js';
|
38
|
-
import {
|
39
|
-
getNonCollectionValueSpecificationType,
|
40
|
-
isTypeCompatibleForAssignment,
|
41
|
-
} from '../../QueryBuilderValueSpecificationHelper.js';
|
38
|
+
import { isTypeCompatibleForAssignment } from '../../QueryBuilderValueSpecificationHelper.js';
|
42
39
|
import { QUERY_BUILDER_STATE_HASH_STRUCTURE } from '../../QueryBuilderStateHashUtils.js';
|
43
40
|
import { buildDefaultInstanceValue } from '../../shared/ValueSpecificationEditorHelper.js';
|
44
41
|
|
@@ -73,8 +70,9 @@ export class QueryBuilderFilterOperator_GreaterThanEqual
|
|
73
70
|
filterConditionState: FilterConditionState,
|
74
71
|
): boolean {
|
75
72
|
return isTypeCompatibleForAssignment(
|
76
|
-
filterConditionState.
|
77
|
-
|
73
|
+
filterConditionState.rightConditionValue &&
|
74
|
+
!filterConditionState.rightConditionValue.isCollection
|
75
|
+
? filterConditionState.rightConditionValue.type
|
78
76
|
: undefined,
|
79
77
|
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
80
78
|
.genericType.value.rawType,
|
@@ -121,7 +119,7 @@ export class QueryBuilderFilterOperator_GreaterThanEqual
|
|
121
119
|
filterConditionState,
|
122
120
|
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
123
121
|
.genericType.value.rawType.path === PRIMITIVE_TYPE.DATETIME &&
|
124
|
-
filterConditionState.
|
122
|
+
filterConditionState.rightConditionValue?.type?.path !==
|
125
123
|
PRIMITIVE_TYPE.DATETIME
|
126
124
|
? QUERY_BUILDER_SUPPORTED_FUNCTIONS.IS_ON_OR_AFTER_DAY
|
127
125
|
: QUERY_BUILDER_SUPPORTED_FUNCTIONS.GREATER_THAN_EQUAL,
|
@@ -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
|
+
FilterValueSpecConditionValueState,
|
20
21
|
} from '../QueryBuilderFilterState.js';
|
21
22
|
import { QueryBuilderFilterOperator } from '../QueryBuilderFilterOperator.js';
|
22
23
|
import {
|
@@ -81,51 +82,55 @@ export class QueryBuilderFilterOperator_In
|
|
81
82
|
const propertyType =
|
82
83
|
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
83
84
|
.genericType.value.rawType;
|
84
|
-
const
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
85
|
+
const rightSide = filterConditionState.rightConditionValue;
|
86
|
+
// `in`/`not in` does not support right hand value being column state as the multipliticy for columns are [0..1]
|
87
|
+
if (rightSide instanceof FilterValueSpecConditionValueState) {
|
88
|
+
const valueSpec = rightSide.value;
|
89
|
+
if (valueSpec instanceof CollectionInstanceValue) {
|
90
|
+
if (valueSpec.values.length === 0) {
|
91
|
+
return true;
|
92
|
+
}
|
93
|
+
const collectionType = getCollectionValueSpecificationType(
|
94
|
+
filterConditionState.filterState.queryBuilderState.graphManagerState
|
95
|
+
.graph,
|
96
|
+
valueSpec.values,
|
97
|
+
);
|
98
|
+
if (!collectionType) {
|
99
|
+
return false;
|
100
|
+
}
|
101
|
+
if (
|
102
|
+
(
|
103
|
+
[
|
104
|
+
PRIMITIVE_TYPE.NUMBER,
|
105
|
+
PRIMITIVE_TYPE.INTEGER,
|
106
|
+
PRIMITIVE_TYPE.DECIMAL,
|
107
|
+
PRIMITIVE_TYPE.FLOAT,
|
108
|
+
PRIMITIVE_TYPE.DATE,
|
109
|
+
PRIMITIVE_TYPE.STRICTDATE,
|
110
|
+
PRIMITIVE_TYPE.DATETIME,
|
111
|
+
] as string[]
|
112
|
+
).includes(propertyType.path)
|
113
|
+
) {
|
114
|
+
return (
|
115
|
+
[
|
116
|
+
PRIMITIVE_TYPE.NUMBER,
|
117
|
+
PRIMITIVE_TYPE.INTEGER,
|
118
|
+
PRIMITIVE_TYPE.DECIMAL,
|
119
|
+
PRIMITIVE_TYPE.FLOAT,
|
120
|
+
PRIMITIVE_TYPE.DATE,
|
121
|
+
PRIMITIVE_TYPE.STRICTDATE,
|
122
|
+
PRIMITIVE_TYPE.DATETIME,
|
123
|
+
] as string[]
|
124
|
+
).includes(collectionType.path);
|
125
|
+
}
|
126
|
+
return collectionType === propertyType;
|
127
|
+
} else if (valueSpec instanceof VariableExpression) {
|
128
|
+
// check if not a single value
|
129
|
+
if (valueSpec.multiplicity.upperBound === 1) {
|
130
|
+
return false;
|
131
|
+
}
|
132
|
+
return propertyType === valueSpec.genericType?.value.rawType;
|
127
133
|
}
|
128
|
-
return propertyType === valueSpec.genericType?.value.rawType;
|
129
134
|
}
|
130
135
|
return false;
|
131
136
|
}
|
@@ -69,7 +69,7 @@ export class QueryBuilderFilterOperator_IsEmpty
|
|
69
69
|
isCompatibleWithFilterConditionValue(
|
70
70
|
filterConditionState: FilterConditionState,
|
71
71
|
): boolean {
|
72
|
-
return filterConditionState.
|
72
|
+
return filterConditionState.rightConditionValue === undefined;
|
73
73
|
}
|
74
74
|
|
75
75
|
getDefaultFilterConditionValue(
|
@@ -35,10 +35,7 @@ import {
|
|
35
35
|
buildFilterConditionExpression,
|
36
36
|
} from './QueryBuilderFilterOperatorValueSpecificationBuilder.js';
|
37
37
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../graph/QueryBuilderMetaModelConst.js';
|
38
|
-
import {
|
39
|
-
getNonCollectionValueSpecificationType,
|
40
|
-
isTypeCompatibleForAssignment,
|
41
|
-
} from '../../QueryBuilderValueSpecificationHelper.js';
|
38
|
+
import { isTypeCompatibleForAssignment } from '../../QueryBuilderValueSpecificationHelper.js';
|
42
39
|
import { QUERY_BUILDER_STATE_HASH_STRUCTURE } from '../../QueryBuilderStateHashUtils.js';
|
43
40
|
import { buildDefaultInstanceValue } from '../../shared/ValueSpecificationEditorHelper.js';
|
44
41
|
|
@@ -73,8 +70,9 @@ export class QueryBuilderFilterOperator_LessThan
|
|
73
70
|
filterConditionState: FilterConditionState,
|
74
71
|
): boolean {
|
75
72
|
return isTypeCompatibleForAssignment(
|
76
|
-
filterConditionState.
|
77
|
-
|
73
|
+
filterConditionState.rightConditionValue &&
|
74
|
+
!filterConditionState.rightConditionValue.isCollection
|
75
|
+
? filterConditionState.rightConditionValue.type
|
78
76
|
: undefined,
|
79
77
|
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
80
78
|
.genericType.value.rawType,
|
@@ -121,7 +119,7 @@ export class QueryBuilderFilterOperator_LessThan
|
|
121
119
|
filterConditionState,
|
122
120
|
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
123
121
|
.genericType.value.rawType.path === PRIMITIVE_TYPE.DATETIME &&
|
124
|
-
filterConditionState.
|
122
|
+
filterConditionState.rightConditionValue?.type?.path !==
|
125
123
|
PRIMITIVE_TYPE.DATETIME
|
126
124
|
? QUERY_BUILDER_SUPPORTED_FUNCTIONS.IS_BEFORE_DAY
|
127
125
|
: QUERY_BUILDER_SUPPORTED_FUNCTIONS.LESS_THAN,
|
@@ -35,10 +35,7 @@ import {
|
|
35
35
|
buildFilterConditionExpression,
|
36
36
|
} from './QueryBuilderFilterOperatorValueSpecificationBuilder.js';
|
37
37
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../graph/QueryBuilderMetaModelConst.js';
|
38
|
-
import {
|
39
|
-
getNonCollectionValueSpecificationType,
|
40
|
-
isTypeCompatibleForAssignment,
|
41
|
-
} from '../../QueryBuilderValueSpecificationHelper.js';
|
38
|
+
import { isTypeCompatibleForAssignment } from '../../QueryBuilderValueSpecificationHelper.js';
|
42
39
|
import { QUERY_BUILDER_STATE_HASH_STRUCTURE } from '../../QueryBuilderStateHashUtils.js';
|
43
40
|
import { buildDefaultInstanceValue } from '../../shared/ValueSpecificationEditorHelper.js';
|
44
41
|
|
@@ -73,8 +70,9 @@ export class QueryBuilderFilterOperator_LessThanEqual
|
|
73
70
|
filterConditionState: FilterConditionState,
|
74
71
|
): boolean {
|
75
72
|
return isTypeCompatibleForAssignment(
|
76
|
-
filterConditionState.
|
77
|
-
|
73
|
+
filterConditionState.rightConditionValue &&
|
74
|
+
!filterConditionState.rightConditionValue.isCollection
|
75
|
+
? filterConditionState.rightConditionValue.type
|
78
76
|
: undefined,
|
79
77
|
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
80
78
|
.genericType.value.rawType,
|
@@ -121,7 +119,7 @@ export class QueryBuilderFilterOperator_LessThanEqual
|
|
121
119
|
filterConditionState,
|
122
120
|
filterConditionState.propertyExpressionState.propertyExpression.func.value
|
123
121
|
.genericType.value.rawType.path === PRIMITIVE_TYPE.DATETIME &&
|
124
|
-
filterConditionState.
|
122
|
+
filterConditionState.rightConditionValue?.type?.path !==
|
125
123
|
PRIMITIVE_TYPE.DATETIME
|
126
124
|
? QUERY_BUILDER_SUPPORTED_FUNCTIONS.IS_ON_OR_BEFORE_DAY
|
127
125
|
: QUERY_BUILDER_SUPPORTED_FUNCTIONS.LESS_THAN_EQUAL,
|
@@ -37,7 +37,6 @@ import {
|
|
37
37
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../graph/QueryBuilderMetaModelConst.js';
|
38
38
|
import {
|
39
39
|
buildNotExpression,
|
40
|
-
getNonCollectionValueSpecificationType,
|
41
40
|
unwrapNotExpression,
|
42
41
|
} from '../../QueryBuilderValueSpecificationHelper.js';
|
43
42
|
import { QUERY_BUILDER_STATE_HASH_STRUCTURE } from '../../QueryBuilderStateHashUtils.js';
|
@@ -64,9 +63,11 @@ export class QueryBuilderFilterOperator_StartWith
|
|
64
63
|
isCompatibleWithFilterConditionValue(
|
65
64
|
filterConditionState: FilterConditionState,
|
66
65
|
): boolean {
|
67
|
-
const type =
|
68
|
-
|
69
|
-
|
66
|
+
const type =
|
67
|
+
filterConditionState.rightConditionValue &&
|
68
|
+
!filterConditionState.rightConditionValue.isCollection
|
69
|
+
? filterConditionState.rightConditionValue.type
|
70
|
+
: undefined;
|
70
71
|
return PrimitiveType.STRING === type;
|
71
72
|
}
|
72
73
|
|
@@ -43,16 +43,21 @@ import {
|
|
43
43
|
buildRawLambdaFromLambdaFunction,
|
44
44
|
getValueSpecificationReturnType,
|
45
45
|
isSubType,
|
46
|
+
AbstractPropertyExpression,
|
47
|
+
PropertyExplicitReference,
|
46
48
|
} from '@finos/legend-graph';
|
47
49
|
import {
|
48
50
|
Randomizer,
|
49
51
|
UnsupportedOperationError,
|
50
52
|
deepClone,
|
53
|
+
guaranteeNonNullable,
|
51
54
|
returnUndefOnError,
|
52
55
|
} from '@finos/legend-shared';
|
53
56
|
import { generateDefaultValueForPrimitiveType } from '../QueryBuilderValueSpecificationHelper.js';
|
54
57
|
import {
|
58
|
+
functionExpression_setParametersValues,
|
55
59
|
instanceValue_setValues,
|
60
|
+
propertyExpression_setFunc,
|
56
61
|
valueSpecification_setGenericType,
|
57
62
|
} from './ValueSpecificationModifierHelper.js';
|
58
63
|
import {
|
@@ -103,6 +108,29 @@ export const cloneValueSpecification = (
|
|
103
108
|
return copy;
|
104
109
|
};
|
105
110
|
|
111
|
+
export const cloneAbstractPropertyExpression = (
|
112
|
+
propertyExpression: AbstractPropertyExpression,
|
113
|
+
observerContext: ObserverContext,
|
114
|
+
): AbstractPropertyExpression => {
|
115
|
+
const clonedPropertyExpression = new AbstractPropertyExpression(
|
116
|
+
propertyExpression.functionName,
|
117
|
+
);
|
118
|
+
propertyExpression_setFunc(
|
119
|
+
clonedPropertyExpression,
|
120
|
+
PropertyExplicitReference.create(
|
121
|
+
guaranteeNonNullable(propertyExpression.func.value),
|
122
|
+
),
|
123
|
+
);
|
124
|
+
functionExpression_setParametersValues(
|
125
|
+
clonedPropertyExpression,
|
126
|
+
propertyExpression.parametersValues.map((param) =>
|
127
|
+
cloneValueSpecification(param, observerContext),
|
128
|
+
),
|
129
|
+
observerContext,
|
130
|
+
);
|
131
|
+
return clonedPropertyExpression;
|
132
|
+
};
|
133
|
+
|
106
134
|
export const createMockPrimitiveValueSpecification = (
|
107
135
|
primitiveType: PrimitiveType,
|
108
136
|
graph: PureModel,
|
package/tsconfig.json
CHANGED
@@ -59,6 +59,7 @@
|
|
59
59
|
"./src/components/QueryBuilderComponentElement.ts",
|
60
60
|
"./src/components/QueryBuilder_LegendApplicationPlugin.ts",
|
61
61
|
"./src/components/QuerySetupUtils.ts",
|
62
|
+
"./src/components/shared/QueryBuilderFilterHelper.ts",
|
62
63
|
"./src/graph/QueryBuilderMetaModelConst.ts",
|
63
64
|
"./src/graph-manager/QueryBuilderConfig.ts",
|
64
65
|
"./src/graph-manager/QueryBuilderConst.ts",
|