@finos/legend-query-builder 4.14.62 → 4.14.64

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