@finos/legend-query-builder 4.14.35 → 4.14.37

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. package/lib/__lib__/QueryBuilderDocumentation.d.ts +2 -1
  2. package/lib/__lib__/QueryBuilderDocumentation.d.ts.map +1 -1
  3. package/lib/__lib__/QueryBuilderDocumentation.js +1 -0
  4. package/lib/__lib__/QueryBuilderDocumentation.js.map +1 -1
  5. package/lib/__lib__/QueryBuilderTesting.d.ts +1 -0
  6. package/lib/__lib__/QueryBuilderTesting.d.ts.map +1 -1
  7. package/lib/__lib__/QueryBuilderTesting.js +1 -0
  8. package/lib/__lib__/QueryBuilderTesting.js.map +1 -1
  9. package/lib/components/QueryBuilder.d.ts.map +1 -1
  10. package/lib/components/QueryBuilder.js +55 -19
  11. package/lib/components/QueryBuilder.js.map +1 -1
  12. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -1
  13. package/lib/components/QueryBuilderConstantExpressionPanel.js +30 -13
  14. package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -1
  15. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
  16. package/lib/components/QueryBuilderPropertyExpressionEditor.js +2 -1
  17. package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
  18. package/lib/components/QueryBuilderSideBar.d.ts +0 -16
  19. package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
  20. package/lib/components/QueryBuilderSideBar.js +32 -104
  21. package/lib/components/QueryBuilderSideBar.js.map +1 -1
  22. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  23. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +2 -1
  24. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  25. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
  26. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +50 -5
  27. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js.map +1 -1
  28. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  29. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +2 -1
  30. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  31. package/lib/components/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
  32. package/lib/components/filter/QueryBuilderFilterPanel.js +2 -1
  33. package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
  34. package/lib/components/result/QueryBuilderResultPanel.d.ts.map +1 -1
  35. package/lib/components/result/QueryBuilderResultPanel.js +18 -6
  36. package/lib/components/result/QueryBuilderResultPanel.js.map +1 -1
  37. package/lib/components/shared/BasicValueSpecificationEditor.d.ts.map +1 -1
  38. package/lib/components/shared/BasicValueSpecificationEditor.js +62 -28
  39. package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -1
  40. package/lib/components/shared/CustomDatePicker.d.ts +1 -0
  41. package/lib/components/shared/CustomDatePicker.d.ts.map +1 -1
  42. package/lib/components/shared/CustomDatePicker.js +13 -9
  43. package/lib/components/shared/CustomDatePicker.js.map +1 -1
  44. package/lib/components/shared/QueryBuilderVariableSelector.d.ts +1 -0
  45. package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -1
  46. package/lib/components/shared/QueryBuilderVariableSelector.js +2 -2
  47. package/lib/components/shared/QueryBuilderVariableSelector.js.map +1 -1
  48. package/lib/components/workflows/ClassQueryBuilder.d.ts.map +1 -1
  49. package/lib/components/workflows/ClassQueryBuilder.js +19 -16
  50. package/lib/components/workflows/ClassQueryBuilder.js.map +1 -1
  51. package/lib/components/workflows/MappingQueryBuilder.d.ts.map +1 -1
  52. package/lib/components/workflows/MappingQueryBuilder.js +18 -15
  53. package/lib/components/workflows/MappingQueryBuilder.js.map +1 -1
  54. package/lib/components/workflows/ServiceQueryBuilder.d.ts.map +1 -1
  55. package/lib/components/workflows/ServiceQueryBuilder.js +13 -10
  56. package/lib/components/workflows/ServiceQueryBuilder.js.map +1 -1
  57. package/lib/index.css +2 -2
  58. package/lib/index.css.map +1 -1
  59. package/lib/index.d.ts +2 -1
  60. package/lib/index.d.ts.map +1 -1
  61. package/lib/index.js +1 -0
  62. package/lib/index.js.map +1 -1
  63. package/lib/package.json +1 -1
  64. package/lib/stores/QueryBuilderConstantsState.d.ts.map +1 -1
  65. package/lib/stores/QueryBuilderConstantsState.js +2 -1
  66. package/lib/stores/QueryBuilderConstantsState.js.map +1 -1
  67. package/lib/stores/QueryBuilderPropertyEditorState.d.ts +1 -1
  68. package/lib/stores/QueryBuilderPropertyEditorState.d.ts.map +1 -1
  69. package/lib/stores/QueryBuilderPropertyEditorState.js +12 -34
  70. package/lib/stores/QueryBuilderPropertyEditorState.js.map +1 -1
  71. package/lib/stores/QueryBuilderState.d.ts +3 -0
  72. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  73. package/lib/stores/QueryBuilderState.js +15 -1
  74. package/lib/stores/QueryBuilderState.js.map +1 -1
  75. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts +2 -1
  76. package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts.map +1 -1
  77. package/lib/stores/QueryBuilderValueSpecificationHelper.js +23 -1
  78. package/lib/stores/QueryBuilderValueSpecificationHelper.js.map +1 -1
  79. package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts +29 -0
  80. package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts.map +1 -1
  81. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts +2 -0
  82. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts.map +1 -1
  83. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js +2 -0
  84. package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js.map +1 -1
  85. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts +2 -0
  86. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts.map +1 -1
  87. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js +6 -0
  88. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js.map +1 -1
  89. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +2 -0
  90. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
  91. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +15 -0
  92. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  93. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts +3 -0
  94. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts.map +1 -1
  95. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js +42 -3
  96. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js.map +1 -1
  97. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.d.ts.map +1 -1
  98. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js +6 -5
  99. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js.map +1 -1
  100. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.d.ts.map +1 -1
  101. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js +6 -5
  102. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js.map +1 -1
  103. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.d.ts.map +1 -1
  104. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js +8 -37
  105. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js.map +1 -1
  106. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.d.ts.map +1 -1
  107. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js +7 -10
  108. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js.map +1 -1
  109. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.d.ts.map +1 -1
  110. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js +7 -10
  111. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js.map +1 -1
  112. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.d.ts.map +1 -1
  113. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js +6 -5
  114. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js.map +1 -1
  115. package/lib/stores/filter/QueryBuilderFilterState.d.ts +3 -0
  116. package/lib/stores/filter/QueryBuilderFilterState.d.ts.map +1 -1
  117. package/lib/stores/filter/QueryBuilderFilterState.js +30 -2
  118. package/lib/stores/filter/QueryBuilderFilterState.js.map +1 -1
  119. package/lib/stores/filter/operators/QueryBuilderFilterOperator_Contain.d.ts.map +1 -1
  120. package/lib/stores/filter/operators/QueryBuilderFilterOperator_Contain.js +5 -4
  121. package/lib/stores/filter/operators/QueryBuilderFilterOperator_Contain.js.map +1 -1
  122. package/lib/stores/filter/operators/QueryBuilderFilterOperator_EndWith.d.ts.map +1 -1
  123. package/lib/stores/filter/operators/QueryBuilderFilterOperator_EndWith.js +5 -4
  124. package/lib/stores/filter/operators/QueryBuilderFilterOperator_EndWith.js.map +1 -1
  125. package/lib/stores/filter/operators/QueryBuilderFilterOperator_Equal.d.ts.map +1 -1
  126. package/lib/stores/filter/operators/QueryBuilderFilterOperator_Equal.js +7 -35
  127. package/lib/stores/filter/operators/QueryBuilderFilterOperator_Equal.js.map +1 -1
  128. package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.d.ts.map +1 -1
  129. package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.js +6 -8
  130. package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.js.map +1 -1
  131. package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.d.ts.map +1 -1
  132. package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.js +6 -8
  133. package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.js.map +1 -1
  134. package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThan.d.ts.map +1 -1
  135. package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThan.js +6 -8
  136. package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThan.js.map +1 -1
  137. package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.d.ts.map +1 -1
  138. package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.js +6 -8
  139. package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.js.map +1 -1
  140. package/lib/stores/filter/operators/QueryBuilderFilterOperator_StartWith.d.ts.map +1 -1
  141. package/lib/stores/filter/operators/QueryBuilderFilterOperator_StartWith.js +5 -4
  142. package/lib/stores/filter/operators/QueryBuilderFilterOperator_StartWith.js.map +1 -1
  143. package/lib/stores/query-workflow/QueryBuilderWorkFlowState.d.ts +5 -0
  144. package/lib/stores/query-workflow/QueryBuilderWorkFlowState.d.ts.map +1 -1
  145. package/lib/stores/query-workflow/QueryBuilderWorkFlowState.js +7 -0
  146. package/lib/stores/query-workflow/QueryBuilderWorkFlowState.js.map +1 -1
  147. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts +1 -1
  148. package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts.map +1 -1
  149. package/lib/stores/shared/ValueSpecificationEditorHelper.js +20 -10
  150. package/lib/stores/shared/ValueSpecificationEditorHelper.js.map +1 -1
  151. package/lib/stores/watermark/QueryBuilderWatermarkState.d.ts +0 -2
  152. package/lib/stores/watermark/QueryBuilderWatermarkState.d.ts.map +1 -1
  153. package/lib/stores/watermark/QueryBuilderWatermarkState.js +0 -6
  154. package/lib/stores/watermark/QueryBuilderWatermarkState.js.map +1 -1
  155. package/lib/stores/workflows/MappingQueryBuilderState.d.ts +2 -2
  156. package/lib/stores/workflows/MappingQueryBuilderState.d.ts.map +1 -1
  157. package/lib/stores/workflows/MappingQueryBuilderState.js +2 -1
  158. package/lib/stores/workflows/MappingQueryBuilderState.js.map +1 -1
  159. package/lib/stores/workflows/ServiceQueryBuilderState.d.ts +2 -2
  160. package/lib/stores/workflows/ServiceQueryBuilderState.d.ts.map +1 -1
  161. package/lib/stores/workflows/ServiceQueryBuilderState.js +2 -1
  162. package/lib/stores/workflows/ServiceQueryBuilderState.js.map +1 -1
  163. package/package.json +4 -4
  164. package/src/__lib__/QueryBuilderDocumentation.ts +1 -0
  165. package/src/__lib__/QueryBuilderTesting.ts +1 -0
  166. package/src/components/QueryBuilder.tsx +179 -54
  167. package/src/components/QueryBuilderConstantExpressionPanel.tsx +36 -14
  168. package/src/components/QueryBuilderPropertyExpressionEditor.tsx +2 -0
  169. package/src/components/QueryBuilderSideBar.tsx +138 -339
  170. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +6 -1
  171. package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +139 -1
  172. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +17 -0
  173. package/src/components/filter/QueryBuilderFilterPanel.tsx +6 -0
  174. package/src/components/result/QueryBuilderResultPanel.tsx +63 -6
  175. package/src/components/shared/BasicValueSpecificationEditor.tsx +96 -34
  176. package/src/components/shared/CustomDatePicker.tsx +18 -11
  177. package/src/components/shared/QueryBuilderVariableSelector.tsx +2 -2
  178. package/src/components/workflows/ClassQueryBuilder.tsx +79 -77
  179. package/src/components/workflows/MappingQueryBuilder.tsx +75 -76
  180. package/src/components/workflows/ServiceQueryBuilder.tsx +71 -70
  181. package/src/index.ts +2 -1
  182. package/src/stores/QueryBuilderConstantsState.ts +2 -0
  183. package/src/stores/QueryBuilderPropertyEditorState.ts +15 -53
  184. package/src/stores/QueryBuilderState.ts +23 -1
  185. package/src/stores/QueryBuilderValueSpecificationHelper.ts +32 -0
  186. package/src/stores/QueryBuilder_LegendApplicationPlugin_Extension.ts +39 -0
  187. package/src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts +4 -0
  188. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts +8 -0
  189. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +32 -0
  190. package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.ts +59 -0
  191. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.ts +5 -5
  192. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.ts +5 -5
  193. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.ts +10 -69
  194. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.ts +7 -18
  195. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.ts +7 -18
  196. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.ts +5 -5
  197. package/src/stores/filter/QueryBuilderFilterState.ts +48 -2
  198. package/src/stores/filter/operators/QueryBuilderFilterOperator_Contain.ts +5 -5
  199. package/src/stores/filter/operators/QueryBuilderFilterOperator_EndWith.ts +5 -5
  200. package/src/stores/filter/operators/QueryBuilderFilterOperator_Equal.ts +10 -71
  201. package/src/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.ts +6 -14
  202. package/src/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.ts +6 -14
  203. package/src/stores/filter/operators/QueryBuilderFilterOperator_LessThan.ts +6 -14
  204. package/src/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.ts +6 -14
  205. package/src/stores/filter/operators/QueryBuilderFilterOperator_StartWith.ts +5 -5
  206. package/src/stores/query-workflow/QueryBuilderWorkFlowState.ts +10 -0
  207. package/src/stores/shared/ValueSpecificationEditorHelper.ts +32 -16
  208. package/src/stores/watermark/QueryBuilderWatermarkState.ts +0 -7
  209. package/src/stores/workflows/MappingQueryBuilderState.ts +7 -1
  210. package/src/stores/workflows/ServiceQueryBuilderState.ts +6 -1
  211. package/tsconfig.json +0 -1
  212. package/lib/components/watermark/QueryBuilderWatermark.d.ts +0 -22
  213. package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +0 -1
  214. package/lib/components/watermark/QueryBuilderWatermark.js +0 -83
  215. package/lib/components/watermark/QueryBuilderWatermark.js.map +0 -1
  216. package/src/components/watermark/QueryBuilderWatermark.tsx +0 -218
package/src/index.ts CHANGED
@@ -21,6 +21,7 @@ export * from './__lib__/QueryBuilderEvent.js';
21
21
  export { QueryBuilder_GraphManagerPreset } from './graph-manager/QueryBuilder_GraphManagerPreset.js';
22
22
  export { QueryBuilderConfig } from './graph-manager/QueryBuilderConfig.js';
23
23
  export { QUERY_BUILDER_TEST_ID } from './__lib__/QueryBuilderTesting.js';
24
+ export { dragAndDrop } from './components/__test-utils__/QueryBuilderComponentTestUtils.js';
24
25
  export {
25
26
  type CheckEntitlementEditorRender,
26
27
  QueryBuilder_LegendApplicationPlugin,
@@ -29,8 +30,8 @@ export { QueryBuilderNavigationBlocker } from './components/QueryBuilderNavigati
29
30
  export { QueryBuilder } from './components/QueryBuilder.js';
30
31
  export { QUERY_BUILDER_COMPONENT_ELEMENT_ID } from './components/QueryBuilderComponentElement.js';
31
32
  export {
32
- QueryBuilderState,
33
33
  type QuerySDLC,
34
+ QueryBuilderState,
34
35
  } from './stores/QueryBuilderState.js';
35
36
  export {
36
37
  getTDSColumnDerivedProperyFromType,
@@ -131,6 +131,8 @@ export class QueryBuilderSimpleConstantExpressionState
131
131
  this.queryBuilderState.graphManagerState.graph,
132
132
  type,
133
133
  this.queryBuilderState.observerContext,
134
+ this.queryBuilderState
135
+ .INTERNAL__enableInitializingDefaultSimpleExpressionValue,
134
136
  );
135
137
  this.setValueSpec(valSpec);
136
138
  } catch (error) {
@@ -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,25 @@ 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
+
86
+ export type QueryBuilderMenuActionConfiguration = {
87
+ key: string;
88
+ title?: string;
89
+ label: string;
90
+ onClick: (queryBuilderState: QueryBuilderState) => void;
91
+ icon?: React.ReactNode;
92
+ renderExtraComponent?: (
93
+ queryBuilderState: QueryBuilderState,
94
+ ) => React.ReactNode;
95
+ };
96
+
78
97
  export interface QueryBuilder_LegendApplicationPlugin_Extension
79
98
  extends LegendApplicationPlugin {
80
99
  /**
@@ -118,4 +137,24 @@ export interface QueryBuilder_LegendApplicationPlugin_Extension
118
137
  * Get the list of template query panel content render
119
138
  */
120
139
  getExtraTemplateQueryPanelContentRenderer?(): TemplateQueryPanelContentRenderer[];
140
+
141
+ /**
142
+ * Get the list of action configurations
143
+ */
144
+ getExtraQueryBuilderHeaderActionConfigurations?(): QueryBuilderHeaderActionConfiguration[];
145
+
146
+ /**
147
+ * Get the list of action configurations
148
+ */
149
+ getExtraQueryBuilderHeaderTitleConfigurations?(): QueryBuilderHeaderActionConfiguration[];
150
+
151
+ /**
152
+ * Get the list of help menu action configurations
153
+ */
154
+ getExtraQueryBuilderHelpMenuActionConfigurations?(): QueryBuilderMenuActionConfiguration[];
155
+
156
+ /**
157
+ * Get the list of export menu action configurations
158
+ */
159
+ getExtraQueryBuilderExportMenuActionConfigurations?(): QueryBuilderMenuActionConfiguration[];
121
160
  }
@@ -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(