@finos/legend-query-builder 4.14.35 → 4.14.36
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/__lib__/QueryBuilderTesting.d.ts +1 -0
- package/lib/__lib__/QueryBuilderTesting.d.ts.map +1 -1
- package/lib/__lib__/QueryBuilderTesting.js +1 -0
- package/lib/__lib__/QueryBuilderTesting.js.map +1 -1
- package/lib/components/QueryBuilder.d.ts.map +1 -1
- package/lib/components/QueryBuilder.js +37 -17
- package/lib/components/QueryBuilder.js.map +1 -1
- package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderConstantExpressionPanel.js +30 -13
- package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.js +2 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
- package/lib/components/QueryBuilderSideBar.d.ts +0 -16
- package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
- package/lib/components/QueryBuilderSideBar.js +32 -104
- package/lib/components/QueryBuilderSideBar.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +2 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +50 -5
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +2 -1
- 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 +2 -1
- package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
- package/lib/components/shared/BasicValueSpecificationEditor.d.ts.map +1 -1
- package/lib/components/shared/BasicValueSpecificationEditor.js +62 -28
- package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -1
- package/lib/components/shared/CustomDatePicker.d.ts +1 -0
- package/lib/components/shared/CustomDatePicker.d.ts.map +1 -1
- package/lib/components/shared/CustomDatePicker.js +13 -9
- package/lib/components/shared/CustomDatePicker.js.map +1 -1
- package/lib/components/shared/QueryBuilderVariableSelector.d.ts +1 -0
- package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -1
- package/lib/components/shared/QueryBuilderVariableSelector.js +2 -2
- package/lib/components/shared/QueryBuilderVariableSelector.js.map +1 -1
- package/lib/components/workflows/ClassQueryBuilder.d.ts.map +1 -1
- package/lib/components/workflows/ClassQueryBuilder.js +19 -16
- package/lib/components/workflows/ClassQueryBuilder.js.map +1 -1
- package/lib/components/workflows/MappingQueryBuilder.d.ts.map +1 -1
- package/lib/components/workflows/MappingQueryBuilder.js +18 -15
- package/lib/components/workflows/MappingQueryBuilder.js.map +1 -1
- package/lib/components/workflows/ServiceQueryBuilder.d.ts.map +1 -1
- package/lib/components/workflows/ServiceQueryBuilder.js +13 -10
- package/lib/components/workflows/ServiceQueryBuilder.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/QueryBuilderConstantsState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderConstantsState.js +2 -1
- package/lib/stores/QueryBuilderConstantsState.js.map +1 -1
- package/lib/stores/QueryBuilderPropertyEditorState.d.ts +1 -1
- package/lib/stores/QueryBuilderPropertyEditorState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderPropertyEditorState.js +12 -34
- package/lib/stores/QueryBuilderPropertyEditorState.js.map +1 -1
- package/lib/stores/QueryBuilderState.d.ts +3 -0
- package/lib/stores/QueryBuilderState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderState.js +15 -1
- package/lib/stores/QueryBuilderState.js.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts +2 -1
- package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationHelper.js +23 -1
- package/lib/stores/QueryBuilderValueSpecificationHelper.js.map +1 -1
- package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts +13 -0
- package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts.map +1 -1
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts +2 -0
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js +2 -0
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts +2 -0
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js +6 -0
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +2 -0
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +15 -0
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts +3 -0
- package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js +42 -3
- package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js +6 -5
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js +6 -5
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js +8 -37
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js +7 -10
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js +7 -10
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js +6 -5
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterState.d.ts +3 -0
- package/lib/stores/filter/QueryBuilderFilterState.d.ts.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterState.js +30 -2
- package/lib/stores/filter/QueryBuilderFilterState.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_Contain.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_Contain.js +5 -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 +5 -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 -35
- 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 +6 -8
- 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 +6 -8
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThan.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThan.js +6 -8
- 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 +6 -8
- 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 +5 -4
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_StartWith.js.map +1 -1
- package/lib/stores/query-workflow/QueryBuilderWorkFlowState.d.ts +5 -0
- package/lib/stores/query-workflow/QueryBuilderWorkFlowState.d.ts.map +1 -1
- package/lib/stores/query-workflow/QueryBuilderWorkFlowState.js +7 -0
- package/lib/stores/query-workflow/QueryBuilderWorkFlowState.js.map +1 -1
- package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts +1 -1
- package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts.map +1 -1
- package/lib/stores/shared/ValueSpecificationEditorHelper.js +20 -10
- package/lib/stores/shared/ValueSpecificationEditorHelper.js.map +1 -1
- package/lib/stores/watermark/QueryBuilderWatermarkState.d.ts +0 -2
- package/lib/stores/watermark/QueryBuilderWatermarkState.d.ts.map +1 -1
- package/lib/stores/watermark/QueryBuilderWatermarkState.js +0 -6
- package/lib/stores/watermark/QueryBuilderWatermarkState.js.map +1 -1
- package/lib/stores/workflows/MappingQueryBuilderState.d.ts +2 -2
- package/lib/stores/workflows/MappingQueryBuilderState.d.ts.map +1 -1
- package/lib/stores/workflows/MappingQueryBuilderState.js +2 -1
- package/lib/stores/workflows/MappingQueryBuilderState.js.map +1 -1
- package/lib/stores/workflows/ServiceQueryBuilderState.d.ts +2 -2
- package/lib/stores/workflows/ServiceQueryBuilderState.d.ts.map +1 -1
- package/lib/stores/workflows/ServiceQueryBuilderState.js +2 -1
- package/lib/stores/workflows/ServiceQueryBuilderState.js.map +1 -1
- package/package.json +4 -4
- package/src/__lib__/QueryBuilderTesting.ts +1 -0
- package/src/components/QueryBuilder.tsx +89 -46
- package/src/components/QueryBuilderConstantExpressionPanel.tsx +36 -14
- package/src/components/QueryBuilderPropertyExpressionEditor.tsx +2 -0
- package/src/components/QueryBuilderSideBar.tsx +138 -339
- package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +6 -1
- package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +139 -1
- package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +17 -0
- package/src/components/filter/QueryBuilderFilterPanel.tsx +6 -0
- package/src/components/shared/BasicValueSpecificationEditor.tsx +96 -34
- package/src/components/shared/CustomDatePicker.tsx +18 -11
- package/src/components/shared/QueryBuilderVariableSelector.tsx +2 -2
- package/src/components/workflows/ClassQueryBuilder.tsx +79 -77
- package/src/components/workflows/MappingQueryBuilder.tsx +75 -76
- package/src/components/workflows/ServiceQueryBuilder.tsx +71 -70
- package/src/index.ts +2 -1
- package/src/stores/QueryBuilderConstantsState.ts +2 -0
- package/src/stores/QueryBuilderPropertyEditorState.ts +15 -53
- package/src/stores/QueryBuilderState.ts +23 -1
- package/src/stores/QueryBuilderValueSpecificationHelper.ts +32 -0
- package/src/stores/QueryBuilder_LegendApplicationPlugin_Extension.ts +18 -0
- package/src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts +4 -0
- package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts +8 -0
- package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +32 -0
- package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.ts +59 -0
- package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.ts +5 -5
- package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.ts +5 -5
- package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.ts +10 -69
- package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.ts +7 -18
- package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.ts +7 -18
- package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.ts +5 -5
- package/src/stores/filter/QueryBuilderFilterState.ts +48 -2
- package/src/stores/filter/operators/QueryBuilderFilterOperator_Contain.ts +5 -5
- package/src/stores/filter/operators/QueryBuilderFilterOperator_EndWith.ts +5 -5
- package/src/stores/filter/operators/QueryBuilderFilterOperator_Equal.ts +10 -71
- package/src/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.ts +6 -14
- package/src/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.ts +6 -14
- package/src/stores/filter/operators/QueryBuilderFilterOperator_LessThan.ts +6 -14
- package/src/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.ts +6 -14
- package/src/stores/filter/operators/QueryBuilderFilterOperator_StartWith.ts +5 -5
- package/src/stores/query-workflow/QueryBuilderWorkFlowState.ts +10 -0
- package/src/stores/shared/ValueSpecificationEditorHelper.ts +32 -16
- package/src/stores/watermark/QueryBuilderWatermarkState.ts +0 -7
- package/src/stores/workflows/MappingQueryBuilderState.ts +7 -1
- package/src/stores/workflows/ServiceQueryBuilderState.ts +6 -1
- package/tsconfig.json +0 -1
- package/lib/components/watermark/QueryBuilderWatermark.d.ts +0 -22
- package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +0 -1
- package/lib/components/watermark/QueryBuilderWatermark.js +0 -83
- package/lib/components/watermark/QueryBuilderWatermark.js.map +0 -1
- package/src/components/watermark/QueryBuilderWatermark.tsx +0 -218
@@ -26,17 +26,13 @@ import {
|
|
26
26
|
import {
|
27
27
|
Class,
|
28
28
|
type AbstractProperty,
|
29
|
-
type Enum,
|
30
29
|
type ValueSpecification,
|
31
30
|
type PureModel,
|
32
31
|
AbstractPropertyExpression,
|
33
32
|
DerivedProperty,
|
34
33
|
Enumeration,
|
35
|
-
EnumValueExplicitReference,
|
36
|
-
EnumValueInstanceValue,
|
37
34
|
InstanceValue,
|
38
35
|
PrimitiveInstanceValue,
|
39
|
-
type PRIMITIVE_TYPE,
|
40
36
|
VariableExpression,
|
41
37
|
SimpleFunctionExpression,
|
42
38
|
matchFunctionName,
|
@@ -50,7 +46,7 @@ import {
|
|
50
46
|
} from '@finos/legend-graph';
|
51
47
|
import {
|
52
48
|
createNullishValue,
|
53
|
-
|
49
|
+
isValidInstanceValue,
|
54
50
|
} from './QueryBuilderValueSpecificationHelper.js';
|
55
51
|
import type { QueryBuilderState } from './QueryBuilderState.js';
|
56
52
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../graph/QueryBuilderMetaModelConst.js';
|
@@ -58,9 +54,9 @@ import { QUERY_BUILDER_STATE_HASH_STRUCTURE } from './QueryBuilderStateHashUtils
|
|
58
54
|
import {
|
59
55
|
propertyExpression_setFunc,
|
60
56
|
functionExpression_setParametersValues,
|
61
|
-
instanceValue_setValues,
|
62
57
|
} from './shared/ValueSpecificationModifierHelper.js';
|
63
58
|
import { generateMilestonedPropertyParameterValue } from './milestoning/QueryBuilderMilestoningHelper.js';
|
59
|
+
import { buildDefaultInstanceValue } from './shared/ValueSpecificationEditorHelper.js';
|
64
60
|
|
65
61
|
export const getPropertyChainName = (
|
66
62
|
propertyExpression: AbstractPropertyExpression,
|
@@ -141,44 +137,23 @@ export const getPropertyPath = (
|
|
141
137
|
export const generateValueSpecificationForParameter = (
|
142
138
|
parameter: VariableExpression,
|
143
139
|
graph: PureModel,
|
140
|
+
initializeDefaultValue: boolean,
|
144
141
|
observerContext: ObserverContext,
|
145
142
|
): ValueSpecification => {
|
146
143
|
if (parameter.genericType) {
|
147
144
|
const type = parameter.genericType.value.rawType;
|
148
|
-
if (type instanceof PrimitiveType) {
|
149
|
-
|
150
|
-
|
151
|
-
new GenericType(
|
152
|
-
// NOTE: since the default generated value for type Date is a StrictDate
|
153
|
-
// we need to adjust the generic type accordingly
|
154
|
-
// See https://github.com/finos/legend-studio/issues/1391
|
155
|
-
type === PrimitiveType.DATE ? PrimitiveType.STRICTDATE : type,
|
156
|
-
),
|
157
|
-
),
|
158
|
-
);
|
159
|
-
if (type !== PrimitiveType.LATESTDATE) {
|
160
|
-
instanceValue_setValues(
|
161
|
-
primitiveInstanceValue,
|
162
|
-
[generateDefaultValueForPrimitiveType(type.name as PRIMITIVE_TYPE)],
|
163
|
-
observerContext,
|
145
|
+
if (type instanceof PrimitiveType || type instanceof Enumeration) {
|
146
|
+
if (type === PrimitiveType.LATESTDATE) {
|
147
|
+
return new PrimitiveInstanceValue(
|
148
|
+
GenericTypeExplicitReference.create(new GenericType(type)),
|
164
149
|
);
|
165
150
|
}
|
166
|
-
return
|
167
|
-
|
168
|
-
|
169
|
-
|
151
|
+
return buildDefaultInstanceValue(
|
152
|
+
graph,
|
153
|
+
type,
|
154
|
+
observerContext,
|
155
|
+
initializeDefaultValue || parameter.multiplicity.lowerBound === 0,
|
170
156
|
);
|
171
|
-
if (type.values.length) {
|
172
|
-
const enumValueRef = EnumValueExplicitReference.create(
|
173
|
-
type.values[0] as Enum,
|
174
|
-
);
|
175
|
-
instanceValue_setValues(
|
176
|
-
enumValueInstanceValue,
|
177
|
-
[enumValueRef],
|
178
|
-
observerContext,
|
179
|
-
);
|
180
|
-
}
|
181
|
-
return enumValueInstanceValue;
|
182
157
|
}
|
183
158
|
}
|
184
159
|
// for arguments of types we don't support, we will fill them with `[]`
|
@@ -215,6 +190,8 @@ const fillDerivedPropertyParameterValues = (
|
|
215
190
|
parameter,
|
216
191
|
derivedPropertyExpressionState.queryBuilderState.graphManagerState
|
217
192
|
.graph,
|
193
|
+
derivedPropertyExpressionState.queryBuilderState
|
194
|
+
.INTERNAL__enableInitializingDefaultSimpleExpressionValue,
|
218
195
|
derivedPropertyExpressionState.queryBuilderState.observerContext,
|
219
196
|
),
|
220
197
|
);
|
@@ -284,22 +261,7 @@ export class QueryBuilderDerivedPropertyExpressionState {
|
|
284
261
|
// TODO: more type matching logic here (take into account multiplicity, type, etc.)
|
285
262
|
return this.parameterValues.every((paramValue) => {
|
286
263
|
if (paramValue instanceof InstanceValue) {
|
287
|
-
|
288
|
-
// required and no values provided. LatestDate doesn't have any values so we skip that check for it.
|
289
|
-
if (
|
290
|
-
isRequired &&
|
291
|
-
paramValue.genericType?.value.rawType !== PrimitiveType.LATESTDATE &&
|
292
|
-
!paramValue.values.length
|
293
|
-
) {
|
294
|
-
return false;
|
295
|
-
}
|
296
|
-
// more values than allowed
|
297
|
-
if (
|
298
|
-
paramValue.multiplicity.upperBound &&
|
299
|
-
paramValue.values.length > paramValue.multiplicity.upperBound
|
300
|
-
) {
|
301
|
-
return false;
|
302
|
-
}
|
264
|
+
return isValidInstanceValue(paramValue);
|
303
265
|
}
|
304
266
|
return true;
|
305
267
|
});
|
@@ -156,6 +156,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
156
156
|
isCalendarEnabled = false;
|
157
157
|
isQueryChatOpened = false;
|
158
158
|
isLocalModeEnabled = false;
|
159
|
+
INTERNAL__enableInitializingDefaultSimpleExpressionValue = false;
|
159
160
|
|
160
161
|
lambdaWriteMode = QUERY_BUILDER_LAMBDA_WRITER_MODE.STANDARD;
|
161
162
|
|
@@ -207,10 +208,12 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
207
208
|
isLocalModeEnabled: observable,
|
208
209
|
getAllFunction: observable,
|
209
210
|
lambdaWriteMode: observable,
|
211
|
+
INTERNAL__enableInitializingDefaultSimpleExpressionValue: observable,
|
210
212
|
|
211
213
|
sideBarClassName: computed,
|
212
214
|
isQuerySupported: computed,
|
213
215
|
allValidationIssues: computed,
|
216
|
+
canBuildQuery: computed,
|
214
217
|
|
215
218
|
setShowFunctionsExplorerPanel: action,
|
216
219
|
setShowParametersPanel: action,
|
@@ -222,6 +225,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
222
225
|
setIsLocalModeEnabled: action,
|
223
226
|
setGetAllFunction: action,
|
224
227
|
setLambdaWriteMode: action,
|
228
|
+
setINTERNAL__enableInitializingDefaultSimpleExpressionValue: action,
|
225
229
|
|
226
230
|
resetQueryResult: action,
|
227
231
|
resetQueryContent: action,
|
@@ -402,6 +406,12 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
402
406
|
this.getAllFunction = val;
|
403
407
|
}
|
404
408
|
|
409
|
+
setINTERNAL__enableInitializingDefaultSimpleExpressionValue(
|
410
|
+
val: boolean,
|
411
|
+
): void {
|
412
|
+
this.INTERNAL__enableInitializingDefaultSimpleExpressionValue = val;
|
413
|
+
}
|
414
|
+
|
405
415
|
get isQuerySupported(): boolean {
|
406
416
|
return !this.unsupportedQueryState.rawLambda;
|
407
417
|
}
|
@@ -802,7 +812,19 @@ export abstract class QueryBuilderState implements CommandRegistrar {
|
|
802
812
|
}
|
803
813
|
|
804
814
|
get allValidationIssues(): string[] {
|
805
|
-
return this.fetchStructureState.implementation.allValidationIssues
|
815
|
+
return this.fetchStructureState.implementation.allValidationIssues.concat(
|
816
|
+
this.filterState.allValidationIssues,
|
817
|
+
);
|
818
|
+
}
|
819
|
+
|
820
|
+
get canBuildQuery(): boolean {
|
821
|
+
return (
|
822
|
+
!this.filterState.hasInvalidFilterValues &&
|
823
|
+
!this.filterState.hasInvalidDerivedPropertyParameters &&
|
824
|
+
!this.fetchStructureState.implementation.hasInvalidFilterValues &&
|
825
|
+
!this.fetchStructureState.implementation
|
826
|
+
.hasInvalidDerivedPropertyParameters
|
827
|
+
);
|
806
828
|
}
|
807
829
|
|
808
830
|
/**
|
@@ -46,6 +46,7 @@ import {
|
|
46
46
|
INTERNAL__PropagatedValue,
|
47
47
|
isSubType,
|
48
48
|
type ObserverContext,
|
49
|
+
InstanceValue,
|
49
50
|
} from '@finos/legend-graph';
|
50
51
|
import {
|
51
52
|
addUniqueEntry,
|
@@ -130,6 +131,37 @@ export const getCollectionValueSpecificationType = (
|
|
130
131
|
return undefined;
|
131
132
|
};
|
132
133
|
|
134
|
+
export const isValidInstanceValue = (value: InstanceValue): boolean => {
|
135
|
+
const isRequired = value.multiplicity.lowerBound >= 1;
|
136
|
+
// required and no values provided. LatestDate doesn't have any values so we skip that check for it.
|
137
|
+
if (
|
138
|
+
isRequired &&
|
139
|
+
value.genericType?.value.rawType !== PrimitiveType.LATESTDATE &&
|
140
|
+
(!value.values.length ||
|
141
|
+
value.values.some((val) => val === null || val === undefined))
|
142
|
+
) {
|
143
|
+
return false;
|
144
|
+
}
|
145
|
+
// more values than allowed
|
146
|
+
if (
|
147
|
+
!(value instanceof CollectionInstanceValue) &&
|
148
|
+
value.multiplicity.upperBound &&
|
149
|
+
value.values.length > value.multiplicity.upperBound
|
150
|
+
) {
|
151
|
+
return false;
|
152
|
+
}
|
153
|
+
// collection instance with invalid values
|
154
|
+
if (
|
155
|
+
value instanceof CollectionInstanceValue &&
|
156
|
+
value.values.some(
|
157
|
+
(val) => val instanceof InstanceValue && !isValidInstanceValue(val),
|
158
|
+
)
|
159
|
+
) {
|
160
|
+
return false;
|
161
|
+
}
|
162
|
+
return true;
|
163
|
+
};
|
164
|
+
|
133
165
|
export const unwrapNotExpression = (
|
134
166
|
expression: SimpleFunctionExpression,
|
135
167
|
): SimpleFunctionExpression | undefined => {
|
@@ -75,6 +75,14 @@ export type TemplateQueryPanelContentRenderer = (
|
|
75
75
|
queryBuilderState: QueryBuilderState,
|
76
76
|
) => React.ReactNode;
|
77
77
|
|
78
|
+
export type QueryBuilderHeaderActionConfiguration = {
|
79
|
+
key: string;
|
80
|
+
category: number;
|
81
|
+
renderer: (
|
82
|
+
queryBuilderState: QueryBuilderState,
|
83
|
+
) => React.ReactNode | undefined;
|
84
|
+
};
|
85
|
+
|
78
86
|
export interface QueryBuilder_LegendApplicationPlugin_Extension
|
79
87
|
extends LegendApplicationPlugin {
|
80
88
|
/**
|
@@ -118,4 +126,14 @@ export interface QueryBuilder_LegendApplicationPlugin_Extension
|
|
118
126
|
* Get the list of template query panel content render
|
119
127
|
*/
|
120
128
|
getExtraTemplateQueryPanelContentRenderer?(): TemplateQueryPanelContentRenderer[];
|
129
|
+
|
130
|
+
/**
|
131
|
+
* Get the list of action configurations
|
132
|
+
*/
|
133
|
+
getExtraQueryBuilderHeaderActionConfigurations?(): QueryBuilderHeaderActionConfiguration[];
|
134
|
+
|
135
|
+
/**
|
136
|
+
* Get the list of action configurations
|
137
|
+
*/
|
138
|
+
getExtraQueryBuilderHeaderTitleConfigurations?(): QueryBuilderHeaderActionConfiguration[];
|
121
139
|
}
|
@@ -47,6 +47,8 @@ export abstract class QueryBuilderFetchStructureImplementationState
|
|
47
47
|
usedExplorerTreePropertyNodeIDs: computed,
|
48
48
|
fetchStructureValidationIssues: computed,
|
49
49
|
allValidationIssues: computed,
|
50
|
+
hasInvalidFilterValues: computed,
|
51
|
+
hasInvalidDerivedPropertyParameters: computed,
|
50
52
|
hashCode: computed,
|
51
53
|
});
|
52
54
|
|
@@ -75,6 +77,8 @@ export abstract class QueryBuilderFetchStructureImplementationState
|
|
75
77
|
): void;
|
76
78
|
abstract initialize(): void;
|
77
79
|
abstract initializeWithQuery(): void;
|
80
|
+
abstract get hasInvalidFilterValues(): boolean;
|
81
|
+
abstract get hasInvalidDerivedPropertyParameters(): boolean;
|
78
82
|
abstract get hashCode(): string;
|
79
83
|
|
80
84
|
get TEMPORARY__showPostFetchStructurePanel(): boolean {
|
@@ -529,6 +529,14 @@ export class QueryBuilderGraphFetchTreeState
|
|
529
529
|
);
|
530
530
|
}
|
531
531
|
|
532
|
+
get hasInvalidFilterValues(): boolean {
|
533
|
+
return false;
|
534
|
+
}
|
535
|
+
|
536
|
+
get hasInvalidDerivedPropertyParameters(): boolean {
|
537
|
+
return false;
|
538
|
+
}
|
539
|
+
|
532
540
|
get hashCode(): string {
|
533
541
|
return hashArray([
|
534
542
|
QUERY_BUILDER_STATE_HASH_STRUCTURE.GRAPH_FETCH_STATE,
|
@@ -329,6 +329,20 @@ export class QueryBuilderTDSState
|
|
329
329
|
if (hasNoProjectionColumns) {
|
330
330
|
validationIssues.push('Query has no projection columns');
|
331
331
|
}
|
332
|
+
|
333
|
+
this.projectionColumns.forEach((column) => {
|
334
|
+
if (
|
335
|
+
column instanceof QueryBuilderSimpleProjectionColumnState &&
|
336
|
+
column.propertyExpressionState.derivedPropertyExpressionStates.some(
|
337
|
+
(p) => !p.isValid,
|
338
|
+
)
|
339
|
+
) {
|
340
|
+
validationIssues.push(
|
341
|
+
`Derived property parameter value for ${column.propertyExpressionState.title} is missing`,
|
342
|
+
);
|
343
|
+
}
|
344
|
+
});
|
345
|
+
|
332
346
|
return validationIssues;
|
333
347
|
}
|
334
348
|
|
@@ -336,6 +350,7 @@ export class QueryBuilderTDSState
|
|
336
350
|
const fetchStructureValidationIssues = [
|
337
351
|
...this.fetchStructureValidationIssues,
|
338
352
|
...this.windowState.windowValidationIssues,
|
353
|
+
...this.postFilterState.allValidationIssues,
|
339
354
|
];
|
340
355
|
|
341
356
|
return fetchStructureValidationIssues;
|
@@ -786,6 +801,23 @@ export class QueryBuilderTDSState
|
|
786
801
|
return Boolean(usedInProjection ?? usedInPostFilter);
|
787
802
|
}
|
788
803
|
|
804
|
+
get hasInvalidFilterValues(): boolean {
|
805
|
+
return (
|
806
|
+
this.postFilterState.hasInvalidFilterValues ||
|
807
|
+
this.postFilterState.hasInvalidDerivedPropertyParameters
|
808
|
+
);
|
809
|
+
}
|
810
|
+
|
811
|
+
get hasInvalidDerivedPropertyParameters(): boolean {
|
812
|
+
return this.projectionColumns.some(
|
813
|
+
(column) =>
|
814
|
+
column instanceof QueryBuilderSimpleProjectionColumnState &&
|
815
|
+
column.propertyExpressionState.derivedPropertyExpressionStates.some(
|
816
|
+
(p) => !p.isValid,
|
817
|
+
),
|
818
|
+
);
|
819
|
+
}
|
820
|
+
|
789
821
|
get hashCode(): string {
|
790
822
|
return hashArray([
|
791
823
|
QUERY_BUILDER_STATE_HASH_STRUCTURE.PROJECTION_STATE,
|
@@ -25,6 +25,7 @@ import {
|
|
25
25
|
observe_ValueSpecification,
|
26
26
|
PrimitiveType,
|
27
27
|
CollectionInstanceValue,
|
28
|
+
InstanceValue,
|
28
29
|
} from '@finos/legend-graph';
|
29
30
|
import {
|
30
31
|
type GeneratorFn,
|
@@ -59,6 +60,7 @@ import {
|
|
59
60
|
QueryBuilderProjectionColumnState,
|
60
61
|
type QueryBuilderProjectionColumnDragSource,
|
61
62
|
QueryBuilderDerivationProjectionColumnState,
|
63
|
+
QueryBuilderSimpleProjectionColumnState,
|
62
64
|
} from '../projection/QueryBuilderProjectionColumnState.js';
|
63
65
|
import {
|
64
66
|
buildProjectionColumnTypeaheadQuery,
|
@@ -72,6 +74,7 @@ import type { QueryBuilderTDSColumnState } from '../QueryBuilderTDSColumnState.j
|
|
72
74
|
import {
|
73
75
|
getCollectionValueSpecificationType,
|
74
76
|
getNonCollectionValueSpecificationType,
|
77
|
+
isValidInstanceValue,
|
75
78
|
isValueExpressionReferencedInValue,
|
76
79
|
} from '../../../QueryBuilderValueSpecificationHelper.js';
|
77
80
|
import { buildtdsPropertyExpressionFromColState } from './operators/QueryBuilderPostFilterOperatorValueSpecificationBuilder.js';
|
@@ -604,6 +607,9 @@ export class QueryBuilderPostFilterState
|
|
604
607
|
replaceBlankNodeWithNode: action,
|
605
608
|
setRearrangingConditions: action,
|
606
609
|
setDerivedColumnBeingDropped: action,
|
610
|
+
allValidationIssues: computed,
|
611
|
+
hasInvalidFilterValues: computed,
|
612
|
+
hasInvalidDerivedPropertyParameters: computed,
|
607
613
|
hashCode: computed,
|
608
614
|
});
|
609
615
|
|
@@ -986,6 +992,59 @@ export class QueryBuilderPostFilterState
|
|
986
992
|
);
|
987
993
|
}
|
988
994
|
|
995
|
+
get allValidationIssues(): string[] {
|
996
|
+
const validationIssues: string[] = [];
|
997
|
+
Array.from(this.nodes.values()).forEach((node) => {
|
998
|
+
if (node instanceof QueryBuilderPostFilterTreeConditionNodeData) {
|
999
|
+
if (
|
1000
|
+
node.condition.rightConditionValue instanceof
|
1001
|
+
PostFilterValueSpecConditionValueState &&
|
1002
|
+
node.condition.rightConditionValue.value instanceof InstanceValue &&
|
1003
|
+
!isValidInstanceValue(node.condition.rightConditionValue.value) &&
|
1004
|
+
node.condition.leftConditionValue instanceof
|
1005
|
+
QueryBuilderSimpleProjectionColumnState
|
1006
|
+
) {
|
1007
|
+
validationIssues.push(
|
1008
|
+
`Filter value for ${node.condition.leftConditionValue.propertyExpressionState.title} is missing or invalid`,
|
1009
|
+
);
|
1010
|
+
}
|
1011
|
+
if (
|
1012
|
+
node.condition.leftConditionValue instanceof
|
1013
|
+
QueryBuilderSimpleProjectionColumnState &&
|
1014
|
+
!node.condition.leftConditionValue.propertyExpressionState.isValid
|
1015
|
+
) {
|
1016
|
+
validationIssues.push(
|
1017
|
+
`Derived property parameter value for ${node.condition.leftConditionValue.propertyExpressionState.title} is missing or invalid`,
|
1018
|
+
);
|
1019
|
+
}
|
1020
|
+
}
|
1021
|
+
});
|
1022
|
+
return validationIssues;
|
1023
|
+
}
|
1024
|
+
|
1025
|
+
get hasInvalidFilterValues(): boolean {
|
1026
|
+
return Array.from(this.nodes.values()).some(
|
1027
|
+
(node) =>
|
1028
|
+
node instanceof QueryBuilderPostFilterTreeConditionNodeData &&
|
1029
|
+
node.condition.rightConditionValue instanceof
|
1030
|
+
PostFilterValueSpecConditionValueState &&
|
1031
|
+
node.condition.rightConditionValue.value instanceof InstanceValue &&
|
1032
|
+
!isValidInstanceValue(node.condition.rightConditionValue.value) &&
|
1033
|
+
node.condition.leftConditionValue instanceof
|
1034
|
+
QueryBuilderSimpleProjectionColumnState,
|
1035
|
+
);
|
1036
|
+
}
|
1037
|
+
|
1038
|
+
get hasInvalidDerivedPropertyParameters(): boolean {
|
1039
|
+
return Array.from(this.nodes.values()).some(
|
1040
|
+
(node) =>
|
1041
|
+
node instanceof QueryBuilderPostFilterTreeConditionNodeData &&
|
1042
|
+
node.condition.leftConditionValue instanceof
|
1043
|
+
QueryBuilderSimpleProjectionColumnState &&
|
1044
|
+
!node.condition.leftConditionValue.propertyExpressionState.isValid,
|
1045
|
+
);
|
1046
|
+
}
|
1047
|
+
|
989
1048
|
get hashCode(): string {
|
990
1049
|
return hashArray([
|
991
1050
|
QUERY_BUILDER_STATE_HASH_STRUCTURE.POST_FILTER_STATE,
|
@@ -36,13 +36,12 @@ import type {
|
|
36
36
|
} from '../QueryBuilderPostFilterState.js';
|
37
37
|
import {
|
38
38
|
buildNotExpression,
|
39
|
-
generateDefaultValueForPrimitiveType,
|
40
39
|
unwrapNotExpression,
|
41
40
|
} from '../../../../QueryBuilderValueSpecificationHelper.js';
|
42
41
|
import { buildPostFilterConditionExpression } from './QueryBuilderPostFilterOperatorValueSpecificationBuilder.js';
|
43
42
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../../graph/QueryBuilderMetaModelConst.js';
|
44
43
|
import { QUERY_BUILDER_STATE_HASH_STRUCTURE } from '../../../../QueryBuilderStateHashUtils.js';
|
45
|
-
import {
|
44
|
+
import { buildDefaultInstanceValue } from '../../../../shared/ValueSpecificationEditorHelper.js';
|
46
45
|
|
47
46
|
export class QueryBuilderPostFilterOperator_Contain
|
48
47
|
extends QueryBuilderPostFilterOperator
|
@@ -73,13 +72,14 @@ export class QueryBuilderPostFilterOperator_Contain
|
|
73
72
|
);
|
74
73
|
switch (propertyType.path) {
|
75
74
|
case PRIMITIVE_TYPE.STRING: {
|
76
|
-
return
|
75
|
+
return buildDefaultInstanceValue(
|
77
76
|
postFilterConditionState.postFilterState.tdsState.queryBuilderState
|
78
77
|
.graphManagerState.graph,
|
79
|
-
propertyType
|
80
|
-
generateDefaultValueForPrimitiveType(propertyType.path),
|
78
|
+
propertyType,
|
81
79
|
postFilterConditionState.postFilterState.tdsState.queryBuilderState
|
82
80
|
.observerContext,
|
81
|
+
postFilterConditionState.postFilterState.tdsState.queryBuilderState
|
82
|
+
.INTERNAL__enableInitializingDefaultSimpleExpressionValue,
|
83
83
|
);
|
84
84
|
}
|
85
85
|
default:
|
@@ -34,13 +34,12 @@ import type {
|
|
34
34
|
} from '../QueryBuilderPostFilterState.js';
|
35
35
|
import {
|
36
36
|
buildNotExpression,
|
37
|
-
generateDefaultValueForPrimitiveType,
|
38
37
|
unwrapNotExpression,
|
39
38
|
} from '../../../../QueryBuilderValueSpecificationHelper.js';
|
40
39
|
import { buildPostFilterConditionExpression } from './QueryBuilderPostFilterOperatorValueSpecificationBuilder.js';
|
41
40
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../../graph/QueryBuilderMetaModelConst.js';
|
42
41
|
import { QUERY_BUILDER_STATE_HASH_STRUCTURE } from '../../../../QueryBuilderStateHashUtils.js';
|
43
|
-
import {
|
42
|
+
import { buildDefaultInstanceValue } from '../../../../shared/ValueSpecificationEditorHelper.js';
|
44
43
|
|
45
44
|
export class QueryBuilderPostFilterOperator_EndWith
|
46
45
|
extends QueryBuilderPostFilterOperator
|
@@ -70,13 +69,14 @@ export class QueryBuilderPostFilterOperator_EndWith
|
|
70
69
|
postFilterConditionState.leftConditionValue.getColumnType();
|
71
70
|
switch (propertyType?.path) {
|
72
71
|
case PRIMITIVE_TYPE.STRING: {
|
73
|
-
return
|
72
|
+
return buildDefaultInstanceValue(
|
74
73
|
postFilterConditionState.postFilterState.tdsState.queryBuilderState
|
75
74
|
.graphManagerState.graph,
|
76
|
-
propertyType
|
77
|
-
generateDefaultValueForPrimitiveType(propertyType.path),
|
75
|
+
propertyType,
|
78
76
|
postFilterConditionState.postFilterState.tdsState.queryBuilderState
|
79
77
|
.observerContext,
|
78
|
+
postFilterConditionState.postFilterState.tdsState.queryBuilderState
|
79
|
+
.INTERNAL__enableInitializingDefaultSimpleExpressionValue,
|
80
80
|
);
|
81
81
|
}
|
82
82
|
default:
|
package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.ts
CHANGED
@@ -17,15 +17,10 @@
|
|
17
17
|
import {
|
18
18
|
type Type,
|
19
19
|
type ValueSpecification,
|
20
|
-
type Enum,
|
21
20
|
type SimpleFunctionExpression,
|
22
21
|
type FunctionExpression,
|
23
22
|
AbstractPropertyExpression,
|
24
23
|
Enumeration,
|
25
|
-
EnumValueExplicitReference,
|
26
|
-
EnumValueInstanceValue,
|
27
|
-
GenericType,
|
28
|
-
GenericTypeExplicitReference,
|
29
24
|
PRIMITIVE_TYPE,
|
30
25
|
PrimitiveType,
|
31
26
|
} from '@finos/legend-graph';
|
@@ -33,7 +28,6 @@ import {
|
|
33
28
|
guaranteeNonNullable,
|
34
29
|
type Hashable,
|
35
30
|
hashArray,
|
36
|
-
UnsupportedOperationError,
|
37
31
|
} from '@finos/legend-shared';
|
38
32
|
import { QueryBuilderPostFilterOperator } from '../QueryBuilderPostFilterOperator.js';
|
39
33
|
import { buildPostFilterConditionState } from '../QueryBuilderPostFilterStateBuilder.js';
|
@@ -43,15 +37,13 @@ import {
|
|
43
37
|
} from '../QueryBuilderPostFilterState.js';
|
44
38
|
import {
|
45
39
|
buildNotExpression,
|
46
|
-
generateDefaultValueForPrimitiveType,
|
47
40
|
isTypeCompatibleForAssignment,
|
48
41
|
unwrapNotExpression,
|
49
42
|
} from '../../../../QueryBuilderValueSpecificationHelper.js';
|
50
43
|
import { buildPostFilterConditionExpression } from './QueryBuilderPostFilterOperatorValueSpecificationBuilder.js';
|
51
44
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../../graph/QueryBuilderMetaModelConst.js';
|
52
45
|
import { QUERY_BUILDER_STATE_HASH_STRUCTURE } from '../../../../QueryBuilderStateHashUtils.js';
|
53
|
-
import {
|
54
|
-
import { instanceValue_setValues } from '../../../../shared/ValueSpecificationModifierHelper.js';
|
46
|
+
import { buildDefaultInstanceValue } from '../../../../shared/ValueSpecificationEditorHelper.js';
|
55
47
|
|
56
48
|
export class QueryBuilderPostFilterOperator_Equal
|
57
49
|
extends QueryBuilderPostFilterOperator
|
@@ -101,66 +93,15 @@ export class QueryBuilderPostFilterOperator_Equal
|
|
101
93
|
const propertyType = guaranteeNonNullable(
|
102
94
|
postFilterConditionState.leftConditionValue.getColumnType(),
|
103
95
|
);
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
return buildPrimitiveInstanceValue(
|
114
|
-
postFilterConditionState.postFilterState.tdsState.queryBuilderState
|
115
|
-
.graphManagerState.graph,
|
116
|
-
propertyType.path,
|
117
|
-
generateDefaultValueForPrimitiveType(propertyType.path),
|
118
|
-
postFilterConditionState.postFilterState.tdsState.queryBuilderState
|
119
|
-
.observerContext,
|
120
|
-
);
|
121
|
-
}
|
122
|
-
case PRIMITIVE_TYPE.DATE: {
|
123
|
-
return buildPrimitiveInstanceValue(
|
124
|
-
postFilterConditionState.postFilterState.tdsState.queryBuilderState
|
125
|
-
.graphManagerState.graph,
|
126
|
-
PRIMITIVE_TYPE.STRICTDATE,
|
127
|
-
generateDefaultValueForPrimitiveType(propertyType.path),
|
128
|
-
postFilterConditionState.postFilterState.tdsState.queryBuilderState
|
129
|
-
.observerContext,
|
130
|
-
);
|
131
|
-
}
|
132
|
-
default:
|
133
|
-
if (propertyType instanceof Enumeration) {
|
134
|
-
if (propertyType.values.length > 0) {
|
135
|
-
const enumValueInstanceValue = new EnumValueInstanceValue(
|
136
|
-
GenericTypeExplicitReference.create(
|
137
|
-
new GenericType(propertyType),
|
138
|
-
),
|
139
|
-
);
|
140
|
-
instanceValue_setValues(
|
141
|
-
enumValueInstanceValue,
|
142
|
-
[
|
143
|
-
EnumValueExplicitReference.create(
|
144
|
-
propertyType.values[0] as Enum,
|
145
|
-
),
|
146
|
-
],
|
147
|
-
postFilterConditionState.postFilterState.tdsState
|
148
|
-
.queryBuilderState.observerContext,
|
149
|
-
);
|
150
|
-
return enumValueInstanceValue;
|
151
|
-
}
|
152
|
-
throw new UnsupportedOperationError(
|
153
|
-
`Can't get default value for post-filter operator '${this.getLabel()}' since enumeration '${
|
154
|
-
propertyType.path
|
155
|
-
}' has no value`,
|
156
|
-
);
|
157
|
-
}
|
158
|
-
throw new UnsupportedOperationError(
|
159
|
-
`Can't get default value for post-filter operator '${this.getLabel()}' when the LHS property is of type '${
|
160
|
-
propertyType.path
|
161
|
-
}'`,
|
162
|
-
);
|
163
|
-
}
|
96
|
+
return buildDefaultInstanceValue(
|
97
|
+
postFilterConditionState.postFilterState.tdsState.queryBuilderState
|
98
|
+
.graphManagerState.graph,
|
99
|
+
propertyType,
|
100
|
+
postFilterConditionState.postFilterState.tdsState.queryBuilderState
|
101
|
+
.observerContext,
|
102
|
+
postFilterConditionState.postFilterState.tdsState.queryBuilderState
|
103
|
+
.INTERNAL__enableInitializingDefaultSimpleExpressionValue,
|
104
|
+
);
|
164
105
|
}
|
165
106
|
|
166
107
|
buildPostFilterConditionExpression(
|
@@ -34,14 +34,11 @@ import type {
|
|
34
34
|
PostFilterConditionState,
|
35
35
|
QueryBuilderPostFilterState,
|
36
36
|
} from '../QueryBuilderPostFilterState.js';
|
37
|
-
import {
|
38
|
-
generateDefaultValueForPrimitiveType,
|
39
|
-
isTypeCompatibleForAssignment,
|
40
|
-
} from '../../../../QueryBuilderValueSpecificationHelper.js';
|
37
|
+
import { isTypeCompatibleForAssignment } from '../../../../QueryBuilderValueSpecificationHelper.js';
|
41
38
|
import { buildPostFilterConditionExpression } from './QueryBuilderPostFilterOperatorValueSpecificationBuilder.js';
|
42
39
|
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../../../graph/QueryBuilderMetaModelConst.js';
|
43
40
|
import { QUERY_BUILDER_STATE_HASH_STRUCTURE } from '../../../../QueryBuilderStateHashUtils.js';
|
44
|
-
import {
|
41
|
+
import { buildDefaultInstanceValue } from '../../../../shared/ValueSpecificationEditorHelper.js';
|
45
42
|
|
46
43
|
export class QueryBuilderPostFilterOperator_GreaterThan
|
47
44
|
extends QueryBuilderPostFilterOperator
|
@@ -89,24 +86,16 @@ export class QueryBuilderPostFilterOperator_GreaterThan
|
|
89
86
|
case PRIMITIVE_TYPE.FLOAT:
|
90
87
|
case PRIMITIVE_TYPE.INTEGER:
|
91
88
|
case PRIMITIVE_TYPE.STRICTDATE:
|
92
|
-
case PRIMITIVE_TYPE.DATETIME:
|
93
|
-
return buildPrimitiveInstanceValue(
|
94
|
-
postFilterConditionState.postFilterState.tdsState.queryBuilderState
|
95
|
-
.graphManagerState.graph,
|
96
|
-
propertyType.path,
|
97
|
-
generateDefaultValueForPrimitiveType(propertyType.path),
|
98
|
-
postFilterConditionState.postFilterState.tdsState.queryBuilderState
|
99
|
-
.observerContext,
|
100
|
-
);
|
101
|
-
}
|
89
|
+
case PRIMITIVE_TYPE.DATETIME:
|
102
90
|
case PRIMITIVE_TYPE.DATE: {
|
103
|
-
return
|
91
|
+
return buildDefaultInstanceValue(
|
104
92
|
postFilterConditionState.postFilterState.tdsState.queryBuilderState
|
105
93
|
.graphManagerState.graph,
|
106
|
-
|
107
|
-
generateDefaultValueForPrimitiveType(propertyType.path),
|
94
|
+
propertyType,
|
108
95
|
postFilterConditionState.postFilterState.tdsState.queryBuilderState
|
109
96
|
.observerContext,
|
97
|
+
postFilterConditionState.postFilterState.tdsState.queryBuilderState
|
98
|
+
.INTERNAL__enableInitializingDefaultSimpleExpressionValue,
|
110
99
|
);
|
111
100
|
}
|
112
101
|
default:
|