@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.
Files changed (207) hide show
  1. package/lib/__lib__/QueryBuilderTesting.d.ts +1 -0
  2. package/lib/__lib__/QueryBuilderTesting.d.ts.map +1 -1
  3. package/lib/__lib__/QueryBuilderTesting.js +1 -0
  4. package/lib/__lib__/QueryBuilderTesting.js.map +1 -1
  5. package/lib/components/QueryBuilder.d.ts.map +1 -1
  6. package/lib/components/QueryBuilder.js +37 -17
  7. package/lib/components/QueryBuilder.js.map +1 -1
  8. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -1
  9. package/lib/components/QueryBuilderConstantExpressionPanel.js +30 -13
  10. package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -1
  11. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
  12. package/lib/components/QueryBuilderPropertyExpressionEditor.js +2 -1
  13. package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
  14. package/lib/components/QueryBuilderSideBar.d.ts +0 -16
  15. package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
  16. package/lib/components/QueryBuilderSideBar.js +32 -104
  17. package/lib/components/QueryBuilderSideBar.js.map +1 -1
  18. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  19. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +2 -1
  20. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  21. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
  22. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +50 -5
  23. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js.map +1 -1
  24. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  25. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +2 -1
  26. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  27. package/lib/components/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
  28. package/lib/components/filter/QueryBuilderFilterPanel.js +2 -1
  29. package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
  30. package/lib/components/shared/BasicValueSpecificationEditor.d.ts.map +1 -1
  31. package/lib/components/shared/BasicValueSpecificationEditor.js +62 -28
  32. package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -1
  33. package/lib/components/shared/CustomDatePicker.d.ts +1 -0
  34. package/lib/components/shared/CustomDatePicker.d.ts.map +1 -1
  35. package/lib/components/shared/CustomDatePicker.js +13 -9
  36. package/lib/components/shared/CustomDatePicker.js.map +1 -1
  37. package/lib/components/shared/QueryBuilderVariableSelector.d.ts +1 -0
  38. package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -1
  39. package/lib/components/shared/QueryBuilderVariableSelector.js +2 -2
  40. package/lib/components/shared/QueryBuilderVariableSelector.js.map +1 -1
  41. package/lib/components/workflows/ClassQueryBuilder.d.ts.map +1 -1
  42. package/lib/components/workflows/ClassQueryBuilder.js +19 -16
  43. package/lib/components/workflows/ClassQueryBuilder.js.map +1 -1
  44. package/lib/components/workflows/MappingQueryBuilder.d.ts.map +1 -1
  45. package/lib/components/workflows/MappingQueryBuilder.js +18 -15
  46. package/lib/components/workflows/MappingQueryBuilder.js.map +1 -1
  47. package/lib/components/workflows/ServiceQueryBuilder.d.ts.map +1 -1
  48. package/lib/components/workflows/ServiceQueryBuilder.js +13 -10
  49. package/lib/components/workflows/ServiceQueryBuilder.js.map +1 -1
  50. package/lib/index.css +2 -2
  51. package/lib/index.css.map +1 -1
  52. package/lib/index.d.ts +2 -1
  53. package/lib/index.d.ts.map +1 -1
  54. package/lib/index.js +1 -0
  55. package/lib/index.js.map +1 -1
  56. package/lib/package.json +1 -1
  57. package/lib/stores/QueryBuilderConstantsState.d.ts.map +1 -1
  58. package/lib/stores/QueryBuilderConstantsState.js +2 -1
  59. package/lib/stores/QueryBuilderConstantsState.js.map +1 -1
  60. package/lib/stores/QueryBuilderPropertyEditorState.d.ts +1 -1
  61. package/lib/stores/QueryBuilderPropertyEditorState.d.ts.map +1 -1
  62. package/lib/stores/QueryBuilderPropertyEditorState.js +12 -34
  63. package/lib/stores/QueryBuilderPropertyEditorState.js.map +1 -1
  64. package/lib/stores/QueryBuilderState.d.ts +3 -0
  65. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  66. package/lib/stores/QueryBuilderState.js +15 -1
  67. package/lib/stores/QueryBuilderState.js.map +1 -1
  68. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts +2 -1
  69. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts.map +1 -1
  70. package/lib/stores/QueryBuilderValueSpecificationHelper.js +23 -1
  71. package/lib/stores/QueryBuilderValueSpecificationHelper.js.map +1 -1
  72. package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts +13 -0
  73. package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts.map +1 -1
  74. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts +2 -0
  75. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts.map +1 -1
  76. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js +2 -0
  77. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js.map +1 -1
  78. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts +2 -0
  79. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts.map +1 -1
  80. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js +6 -0
  81. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js.map +1 -1
  82. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +2 -0
  83. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
  84. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +15 -0
  85. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  86. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts +3 -0
  87. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts.map +1 -1
  88. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js +42 -3
  89. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js.map +1 -1
  90. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.d.ts.map +1 -1
  91. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js +6 -5
  92. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js.map +1 -1
  93. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.d.ts.map +1 -1
  94. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js +6 -5
  95. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js.map +1 -1
  96. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.d.ts.map +1 -1
  97. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js +8 -37
  98. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js.map +1 -1
  99. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.d.ts.map +1 -1
  100. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js +7 -10
  101. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js.map +1 -1
  102. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.d.ts.map +1 -1
  103. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js +7 -10
  104. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js.map +1 -1
  105. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.d.ts.map +1 -1
  106. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js +6 -5
  107. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js.map +1 -1
  108. package/lib/stores/filter/QueryBuilderFilterState.d.ts +3 -0
  109. package/lib/stores/filter/QueryBuilderFilterState.d.ts.map +1 -1
  110. package/lib/stores/filter/QueryBuilderFilterState.js +30 -2
  111. package/lib/stores/filter/QueryBuilderFilterState.js.map +1 -1
  112. package/lib/stores/filter/operators/QueryBuilderFilterOperator_Contain.d.ts.map +1 -1
  113. package/lib/stores/filter/operators/QueryBuilderFilterOperator_Contain.js +5 -4
  114. package/lib/stores/filter/operators/QueryBuilderFilterOperator_Contain.js.map +1 -1
  115. package/lib/stores/filter/operators/QueryBuilderFilterOperator_EndWith.d.ts.map +1 -1
  116. package/lib/stores/filter/operators/QueryBuilderFilterOperator_EndWith.js +5 -4
  117. package/lib/stores/filter/operators/QueryBuilderFilterOperator_EndWith.js.map +1 -1
  118. package/lib/stores/filter/operators/QueryBuilderFilterOperator_Equal.d.ts.map +1 -1
  119. package/lib/stores/filter/operators/QueryBuilderFilterOperator_Equal.js +7 -35
  120. package/lib/stores/filter/operators/QueryBuilderFilterOperator_Equal.js.map +1 -1
  121. package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.d.ts.map +1 -1
  122. package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.js +6 -8
  123. package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.js.map +1 -1
  124. package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.d.ts.map +1 -1
  125. package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.js +6 -8
  126. package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.js.map +1 -1
  127. package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThan.d.ts.map +1 -1
  128. package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThan.js +6 -8
  129. package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThan.js.map +1 -1
  130. package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.d.ts.map +1 -1
  131. package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.js +6 -8
  132. package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.js.map +1 -1
  133. package/lib/stores/filter/operators/QueryBuilderFilterOperator_StartWith.d.ts.map +1 -1
  134. package/lib/stores/filter/operators/QueryBuilderFilterOperator_StartWith.js +5 -4
  135. package/lib/stores/filter/operators/QueryBuilderFilterOperator_StartWith.js.map +1 -1
  136. package/lib/stores/query-workflow/QueryBuilderWorkFlowState.d.ts +5 -0
  137. package/lib/stores/query-workflow/QueryBuilderWorkFlowState.d.ts.map +1 -1
  138. package/lib/stores/query-workflow/QueryBuilderWorkFlowState.js +7 -0
  139. package/lib/stores/query-workflow/QueryBuilderWorkFlowState.js.map +1 -1
  140. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts +1 -1
  141. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts.map +1 -1
  142. package/lib/stores/shared/ValueSpecificationEditorHelper.js +20 -10
  143. package/lib/stores/shared/ValueSpecificationEditorHelper.js.map +1 -1
  144. package/lib/stores/watermark/QueryBuilderWatermarkState.d.ts +0 -2
  145. package/lib/stores/watermark/QueryBuilderWatermarkState.d.ts.map +1 -1
  146. package/lib/stores/watermark/QueryBuilderWatermarkState.js +0 -6
  147. package/lib/stores/watermark/QueryBuilderWatermarkState.js.map +1 -1
  148. package/lib/stores/workflows/MappingQueryBuilderState.d.ts +2 -2
  149. package/lib/stores/workflows/MappingQueryBuilderState.d.ts.map +1 -1
  150. package/lib/stores/workflows/MappingQueryBuilderState.js +2 -1
  151. package/lib/stores/workflows/MappingQueryBuilderState.js.map +1 -1
  152. package/lib/stores/workflows/ServiceQueryBuilderState.d.ts +2 -2
  153. package/lib/stores/workflows/ServiceQueryBuilderState.d.ts.map +1 -1
  154. package/lib/stores/workflows/ServiceQueryBuilderState.js +2 -1
  155. package/lib/stores/workflows/ServiceQueryBuilderState.js.map +1 -1
  156. package/package.json +4 -4
  157. package/src/__lib__/QueryBuilderTesting.ts +1 -0
  158. package/src/components/QueryBuilder.tsx +89 -46
  159. package/src/components/QueryBuilderConstantExpressionPanel.tsx +36 -14
  160. package/src/components/QueryBuilderPropertyExpressionEditor.tsx +2 -0
  161. package/src/components/QueryBuilderSideBar.tsx +138 -339
  162. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +6 -1
  163. package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +139 -1
  164. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +17 -0
  165. package/src/components/filter/QueryBuilderFilterPanel.tsx +6 -0
  166. package/src/components/shared/BasicValueSpecificationEditor.tsx +96 -34
  167. package/src/components/shared/CustomDatePicker.tsx +18 -11
  168. package/src/components/shared/QueryBuilderVariableSelector.tsx +2 -2
  169. package/src/components/workflows/ClassQueryBuilder.tsx +79 -77
  170. package/src/components/workflows/MappingQueryBuilder.tsx +75 -76
  171. package/src/components/workflows/ServiceQueryBuilder.tsx +71 -70
  172. package/src/index.ts +2 -1
  173. package/src/stores/QueryBuilderConstantsState.ts +2 -0
  174. package/src/stores/QueryBuilderPropertyEditorState.ts +15 -53
  175. package/src/stores/QueryBuilderState.ts +23 -1
  176. package/src/stores/QueryBuilderValueSpecificationHelper.ts +32 -0
  177. package/src/stores/QueryBuilder_LegendApplicationPlugin_Extension.ts +18 -0
  178. package/src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts +4 -0
  179. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts +8 -0
  180. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +32 -0
  181. package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.ts +59 -0
  182. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.ts +5 -5
  183. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.ts +5 -5
  184. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.ts +10 -69
  185. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.ts +7 -18
  186. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.ts +7 -18
  187. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.ts +5 -5
  188. package/src/stores/filter/QueryBuilderFilterState.ts +48 -2
  189. package/src/stores/filter/operators/QueryBuilderFilterOperator_Contain.ts +5 -5
  190. package/src/stores/filter/operators/QueryBuilderFilterOperator_EndWith.ts +5 -5
  191. package/src/stores/filter/operators/QueryBuilderFilterOperator_Equal.ts +10 -71
  192. package/src/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.ts +6 -14
  193. package/src/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.ts +6 -14
  194. package/src/stores/filter/operators/QueryBuilderFilterOperator_LessThan.ts +6 -14
  195. package/src/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.ts +6 -14
  196. package/src/stores/filter/operators/QueryBuilderFilterOperator_StartWith.ts +5 -5
  197. package/src/stores/query-workflow/QueryBuilderWorkFlowState.ts +10 -0
  198. package/src/stores/shared/ValueSpecificationEditorHelper.ts +32 -16
  199. package/src/stores/watermark/QueryBuilderWatermarkState.ts +0 -7
  200. package/src/stores/workflows/MappingQueryBuilderState.ts +7 -1
  201. package/src/stores/workflows/ServiceQueryBuilderState.ts +6 -1
  202. package/tsconfig.json +0 -1
  203. package/lib/components/watermark/QueryBuilderWatermark.d.ts +0 -22
  204. package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +0 -1
  205. package/lib/components/watermark/QueryBuilderWatermark.js +0 -83
  206. package/lib/components/watermark/QueryBuilderWatermark.js.map +0 -1
  207. 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
- generateDefaultValueForPrimitiveType,
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
- const primitiveInstanceValue = new PrimitiveInstanceValue(
150
- GenericTypeExplicitReference.create(
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 primitiveInstanceValue;
167
- } else if (type instanceof Enumeration) {
168
- const enumValueInstanceValue = new EnumValueInstanceValue(
169
- GenericTypeExplicitReference.create(new GenericType(type)),
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
- const isRequired = paramValue.multiplicity.lowerBound >= 1;
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 { buildPrimitiveInstanceValue } from '../../../../shared/ValueSpecificationEditorHelper.js';
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 buildPrimitiveInstanceValue(
75
+ return buildDefaultInstanceValue(
77
76
  postFilterConditionState.postFilterState.tdsState.queryBuilderState
78
77
  .graphManagerState.graph,
79
- propertyType.path,
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 { buildPrimitiveInstanceValue } from '../../../../shared/ValueSpecificationEditorHelper.js';
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 buildPrimitiveInstanceValue(
72
+ return buildDefaultInstanceValue(
74
73
  postFilterConditionState.postFilterState.tdsState.queryBuilderState
75
74
  .graphManagerState.graph,
76
- propertyType.path,
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:
@@ -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 { buildPrimitiveInstanceValue } from '../../../../shared/ValueSpecificationEditorHelper.js';
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
- switch (propertyType.path) {
105
- case PRIMITIVE_TYPE.STRING:
106
- case PRIMITIVE_TYPE.BOOLEAN:
107
- case PRIMITIVE_TYPE.STRICTDATE:
108
- case PRIMITIVE_TYPE.DATETIME:
109
- case PRIMITIVE_TYPE.NUMBER:
110
- case PRIMITIVE_TYPE.DECIMAL:
111
- case PRIMITIVE_TYPE.FLOAT:
112
- case PRIMITIVE_TYPE.INTEGER: {
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 { buildPrimitiveInstanceValue } from '../../../../shared/ValueSpecificationEditorHelper.js';
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 buildPrimitiveInstanceValue(
91
+ return buildDefaultInstanceValue(
104
92
  postFilterConditionState.postFilterState.tdsState.queryBuilderState
105
93
  .graphManagerState.graph,
106
- PRIMITIVE_TYPE.STRICTDATE,
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: