@finos/legend-query-builder 4.14.63 → 4.14.65
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.d.ts +3 -0
- package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.d.ts.map +1 -1
- package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js +12 -1
- package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +20 -19
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
- package/lib/components/filter/QueryBuilderFilterPanel.d.ts +7 -1
- package/lib/components/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
- package/lib/components/filter/QueryBuilderFilterPanel.js +137 -54
- package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
- package/lib/components/shared/QueryBuilderFilterHelper.d.ts +19 -0
- package/lib/components/shared/QueryBuilderFilterHelper.d.ts.map +1 -0
- package/lib/components/shared/QueryBuilderFilterHelper.js +34 -0
- package/lib/components/shared/QueryBuilderFilterHelper.js.map +1 -0
- package/lib/components/shared/QueryBuilderPropertyInfoTooltip.js +1 -1
- package/lib/components/shared/QueryBuilderPropertyInfoTooltip.js.map +1 -1
- package/lib/index.css +17 -1
- package/lib/index.css.map +1 -1
- package/lib/package.json +3 -3
- package/lib/stores/QueryBuilderStateHashUtils.d.ts +2 -0
- package/lib/stores/QueryBuilderStateHashUtils.d.ts.map +1 -1
- package/lib/stores/QueryBuilderStateHashUtils.js +2 -0
- package/lib/stores/QueryBuilderStateHashUtils.js.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_In.js +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_In.js.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterState.d.ts +35 -5
- package/lib/stores/filter/QueryBuilderFilterState.d.ts.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterState.js +181 -52
- package/lib/stores/filter/QueryBuilderFilterState.js.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterStateBuilder.js +2 -2
- package/lib/stores/filter/QueryBuilderFilterStateBuilder.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperatorValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperatorValueSpecificationBuilder.js +21 -6
- package/lib/stores/filter/operators/QueryBuilderFilterOperatorValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_Contain.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_Contain.js +4 -3
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_Contain.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_EndWith.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_EndWith.js +4 -3
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_EndWith.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_Equal.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_Equal.js +5 -4
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_Equal.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.js +5 -4
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.js +5 -4
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_In.d.ts +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_In.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_In.js +33 -28
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_In.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_IsEmpty.js +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_IsEmpty.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThan.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThan.js +5 -4
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThan.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.js +5 -4
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.js.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_StartWith.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_StartWith.js +4 -3
- package/lib/stores/filter/operators/QueryBuilderFilterOperator_StartWith.js.map +1 -1
- package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts +2 -1
- package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts.map +1 -1
- package/lib/stores/shared/ValueSpecificationEditorHelper.js +9 -3
- package/lib/stores/shared/ValueSpecificationEditorHelper.js.map +1 -1
- package/package.json +11 -11
- package/src/components/__test-utils__/QueryBuilderComponentTestUtils.tsx +25 -0
- package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +29 -26
- package/src/components/filter/QueryBuilderFilterPanel.tsx +335 -106
- package/src/components/shared/QueryBuilderFilterHelper.ts +51 -0
- package/src/components/shared/QueryBuilderPropertyInfoTooltip.tsx +1 -1
- package/src/stores/QueryBuilderStateHashUtils.ts +2 -0
- package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_In.ts +1 -1
- package/src/stores/filter/QueryBuilderFilterState.ts +284 -74
- package/src/stores/filter/QueryBuilderFilterStateBuilder.ts +2 -2
- package/src/stores/filter/operators/QueryBuilderFilterOperatorValueSpecificationBuilder.ts +48 -9
- package/src/stores/filter/operators/QueryBuilderFilterOperator_Contain.ts +5 -4
- package/src/stores/filter/operators/QueryBuilderFilterOperator_EndWith.ts +5 -4
- package/src/stores/filter/operators/QueryBuilderFilterOperator_Equal.ts +4 -4
- package/src/stores/filter/operators/QueryBuilderFilterOperator_GreaterThan.ts +5 -7
- package/src/stores/filter/operators/QueryBuilderFilterOperator_GreaterThanEqual.ts +5 -7
- package/src/stores/filter/operators/QueryBuilderFilterOperator_In.ts +52 -47
- package/src/stores/filter/operators/QueryBuilderFilterOperator_IsEmpty.ts +1 -1
- package/src/stores/filter/operators/QueryBuilderFilterOperator_LessThan.ts +5 -7
- package/src/stores/filter/operators/QueryBuilderFilterOperator_LessThanEqual.ts +5 -7
- package/src/stores/filter/operators/QueryBuilderFilterOperator_StartWith.ts +5 -4
- package/src/stores/shared/ValueSpecificationEditorHelper.ts +28 -0
- package/tsconfig.json +1 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ValueSpecificationEditorHelper.d.ts","sourceRoot":"","sources":["../../../src/stores/shared/ValueSpecificationEditorHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,IAAI,EACT,KAAK,IAAI,EACT,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,kBAAkB,EAElB,WAAW,EAMX,sBAAsB,EACtB,aAAa,EACb,cAAc,EAEd,wBAAwB,EACxB,cAAc,
|
1
|
+
{"version":3,"file":"ValueSpecificationEditorHelper.d.ts","sourceRoot":"","sources":["../../../src/stores/shared/ValueSpecificationEditorHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,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BAAkB,GAAG,SAyCvB,CAAC;AAEF,eAAO,MAAM,gCAAgC,uBACvB,kBAAkB,oBACpB,gBAAgB,CAChC,uBAAuB,EACvB,8BAA8B,CAAC,uBAAuB,CAAC,CACxD,YACS;IACR,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,KACA,MAAM,GAAG,SA2CX,CAAC;AAEF,eAAO,MAAM,kBAAkB,QACxB,kBAAkB,SAChB,SAAS,KACf,OAeF,CAAC;AAEF,eAAO,MAAM,mCAAmC,iBAChC,IAAI,SACX,MAAM,mBACI,eAAe,KAC/B,sBAAsB,GAAG,IAyD3B,CAAC;AAEF,eAAO,MAAM,iBAAiB,UACrB,MAAM,YACH,WAAW,KACpB,IAAI,GAAG,SACqD,CAAC"}
|
@@ -13,10 +13,10 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
-
import { VariableExpression, CollectionInstanceValue, Enumeration, EnumValueExplicitReference, EnumValueInstanceValue, GenericType, GenericTypeExplicitReference, getEnumValue, PrimitiveInstanceValue, PrimitiveType, PRIMITIVE_TYPE, INTERNAL__PropagatedValue, SimpleFunctionExpression, LambdaFunction, FunctionType, PackageableElementExplicitReference, Multiplicity, CORE_PURE_PATH, buildRawLambdaFromLambdaFunction, getValueSpecificationReturnType, isSubType, } from '@finos/legend-graph';
|
17
|
-
import { Randomizer, UnsupportedOperationError, deepClone, returnUndefOnError, } from '@finos/legend-shared';
|
16
|
+
import { VariableExpression, CollectionInstanceValue, Enumeration, EnumValueExplicitReference, EnumValueInstanceValue, GenericType, GenericTypeExplicitReference, getEnumValue, PrimitiveInstanceValue, PrimitiveType, PRIMITIVE_TYPE, INTERNAL__PropagatedValue, SimpleFunctionExpression, LambdaFunction, FunctionType, PackageableElementExplicitReference, Multiplicity, CORE_PURE_PATH, buildRawLambdaFromLambdaFunction, getValueSpecificationReturnType, isSubType, AbstractPropertyExpression, PropertyExplicitReference, } from '@finos/legend-graph';
|
17
|
+
import { Randomizer, UnsupportedOperationError, deepClone, guaranteeNonNullable, returnUndefOnError, } from '@finos/legend-shared';
|
18
18
|
import { generateDefaultValueForPrimitiveType } from '../QueryBuilderValueSpecificationHelper.js';
|
19
|
-
import { instanceValue_setValues, valueSpecification_setGenericType, } from './ValueSpecificationModifierHelper.js';
|
19
|
+
import { functionExpression_setParametersValues, instanceValue_setValues, propertyExpression_setFunc, valueSpecification_setGenericType, } from './ValueSpecificationModifierHelper.js';
|
20
20
|
import { QUERY_BUILDER_PURE_PATH, QUERY_BUILDER_SUPPORTED_FUNCTIONS, } from '../../graph/QueryBuilderMetaModelConst.js';
|
21
21
|
import { buildDatePickerOption } from '../../components/shared/CustomDatePicker.js';
|
22
22
|
export const createSupportedFunctionExpression = (supportedFuncName, expectedReturnType) => {
|
@@ -35,6 +35,12 @@ export const cloneValueSpecification = (valueSpecification, observerContext) =>
|
|
35
35
|
copy.multiplicity = valueSpecification.multiplicity;
|
36
36
|
return copy;
|
37
37
|
};
|
38
|
+
export const cloneAbstractPropertyExpression = (propertyExpression, observerContext) => {
|
39
|
+
const clonedPropertyExpression = new AbstractPropertyExpression(propertyExpression.functionName);
|
40
|
+
propertyExpression_setFunc(clonedPropertyExpression, PropertyExplicitReference.create(guaranteeNonNullable(propertyExpression.func.value)));
|
41
|
+
functionExpression_setParametersValues(clonedPropertyExpression, propertyExpression.parametersValues.map((param) => cloneValueSpecification(param, observerContext)), observerContext);
|
42
|
+
return clonedPropertyExpression;
|
43
|
+
};
|
38
44
|
export const createMockPrimitiveValueSpecification = (primitiveType, graph, observerContext, options) => {
|
39
45
|
const primitiveTypeName = primitiveType.name;
|
40
46
|
if (options?.useCurrentDateDependentFunctions) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ValueSpecificationEditorHelper.js","sourceRoot":"","sources":["../../../src/stores/shared/ValueSpecificationEditorHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAQL,kBAAkB,EAClB,uBAAuB,EACvB,WAAW,EACX,0BAA0B,EAC1B,sBAAsB,EACtB,WAAW,EACX,4BAA4B,EAC5B,YAAY,EACZ,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,yBAAyB,EACzB,wBAAwB,EACxB,cAAc,EACd,YAAY,EACZ,mCAAmC,EACnC,YAAY,EACZ,cAAc,EACd,gCAAgC,EAChC,+BAA+B,EAC/B,SAAS,
|
1
|
+
{"version":3,"file":"ValueSpecificationEditorHelper.js","sourceRoot":"","sources":["../../../src/stores/shared/ValueSpecificationEditorHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAQL,kBAAkB,EAClB,uBAAuB,EACvB,WAAW,EACX,0BAA0B,EAC1B,sBAAsB,EACtB,WAAW,EACX,4BAA4B,EAC5B,YAAY,EACZ,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,yBAAyB,EACzB,wBAAwB,EACxB,cAAc,EACd,YAAY,EACZ,mCAAmC,EACnC,YAAY,EACZ,cAAc,EACd,gCAAgC,EAChC,+BAA+B,EAC/B,SAAS,EACT,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,UAAU,EACV,yBAAyB,EACzB,SAAS,EACT,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,EACL,sCAAsC,EACtC,uBAAuB,EACvB,0BAA0B,EAC1B,iCAAiC,GAClC,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,uBAAuB,EACvB,iCAAiC,GAClC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAQpF,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAC/C,iBAAyB,EACzB,kBAAwB,EACE,EAAE;IAC5B,MAAM,cAAc,GAAG,IAA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AC,CAAC,OAAO,EAAE,CAAC,CAAC,EACzC,CAAC;oBACD,OAAO,IAAI,CAAC;gBACd,CAAC;gBACD,MAAM,GAAG,IAAI,sBAAsB,CACjC,4BAA4B,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,YAAY,CAAC,CAAC,CACnE,CAAC;gBACF,uBAAuB,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,eAAe,CAAC,CAAC;gBAC1D,MAAM;YACR,CAAC;YACD;gBACE,yCAAyC;gBACzC,OAAO,IAAI,CAAC;QAChB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,KAAa,EACb,QAAqB,EACH,EAAE,CACpB,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@finos/legend-query-builder",
|
3
|
-
"version": "4.14.
|
3
|
+
"version": "4.14.65",
|
4
4
|
"description": "Legend query builder core",
|
5
5
|
"keywords": [
|
6
6
|
"legend",
|
@@ -42,14 +42,14 @@
|
|
42
42
|
"test:watch": "jest --watch"
|
43
43
|
},
|
44
44
|
"dependencies": {
|
45
|
-
"@finos/legend-application": "15.1.
|
46
|
-
"@finos/legend-art": "7.1.
|
47
|
-
"@finos/legend-graph": "31.10.
|
48
|
-
"@finos/legend-lego": "1.2.
|
49
|
-
"@finos/legend-server-depot": "6.0.
|
50
|
-
"@finos/legend-shared": "10.0.
|
51
|
-
"@finos/legend-storage": "3.0.
|
52
|
-
"@testing-library/dom": "10.
|
45
|
+
"@finos/legend-application": "15.1.19",
|
46
|
+
"@finos/legend-art": "7.1.47",
|
47
|
+
"@finos/legend-graph": "31.10.16",
|
48
|
+
"@finos/legend-lego": "1.2.52",
|
49
|
+
"@finos/legend-server-depot": "6.0.54",
|
50
|
+
"@finos/legend-shared": "10.0.49",
|
51
|
+
"@finos/legend-storage": "3.0.99",
|
52
|
+
"@testing-library/dom": "10.4.0",
|
53
53
|
"@testing-library/react": "16.0.0",
|
54
54
|
"@types/react": "18.3.3",
|
55
55
|
"@types/react-dom": "18.3.0",
|
@@ -66,7 +66,7 @@
|
|
66
66
|
"sql-formatter": "15.3.2"
|
67
67
|
},
|
68
68
|
"devDependencies": {
|
69
|
-
"@finos/legend-dev-utils": "2.1.
|
69
|
+
"@finos/legend-dev-utils": "2.1.16",
|
70
70
|
"@jest/globals": "29.7.0",
|
71
71
|
"cross-env": "7.0.3",
|
72
72
|
"eslint": "8.57.0",
|
@@ -74,7 +74,7 @@
|
|
74
74
|
"npm-run-all": "4.1.5",
|
75
75
|
"rimraf": "6.0.1",
|
76
76
|
"sass": "1.77.8",
|
77
|
-
"typescript": "5.5.
|
77
|
+
"typescript": "5.5.4"
|
78
78
|
},
|
79
79
|
"peerDependencies": {
|
80
80
|
"react": "^18.0.0"
|
@@ -21,6 +21,9 @@ import {
|
|
21
21
|
fireEvent,
|
22
22
|
findByText,
|
23
23
|
getByText,
|
24
|
+
getByDisplayValue,
|
25
|
+
findByDisplayValue,
|
26
|
+
getByRole,
|
24
27
|
} from '@testing-library/react';
|
25
28
|
import { LogService, guaranteeNonNullable } from '@finos/legend-shared';
|
26
29
|
import { createSpy } from '@finos/legend-shared/test';
|
@@ -163,6 +166,28 @@ export const dragAndDrop = async (
|
|
163
166
|
}
|
164
167
|
};
|
165
168
|
|
169
|
+
export const setDerivedPropertyValue = async (
|
170
|
+
derivedPropertyButton: HTMLElement,
|
171
|
+
value: string,
|
172
|
+
renderResult: RenderResult,
|
173
|
+
options?: {
|
174
|
+
currentDisplayValue?: string;
|
175
|
+
},
|
176
|
+
): Promise<void> => {
|
177
|
+
fireEvent.click(derivedPropertyButton);
|
178
|
+
const dpModal = await renderResult.findByRole('dialog');
|
179
|
+
await findByText(dpModal, 'Derived Property');
|
180
|
+
fireEvent.change(
|
181
|
+
getByDisplayValue(dpModal, options?.currentDisplayValue ?? ''),
|
182
|
+
{
|
183
|
+
target: { value },
|
184
|
+
},
|
185
|
+
);
|
186
|
+
await findByDisplayValue(dpModal, value);
|
187
|
+
fireEvent.click(getByRole(dpModal, 'button', { name: 'Done' }));
|
188
|
+
await waitFor(() => expect(renderResult.queryByRole('dialog')).toBeNull());
|
189
|
+
};
|
190
|
+
|
166
191
|
export const TEST__setUpQueryBuilder = async (
|
167
192
|
entities: Entity[],
|
168
193
|
lambda: RawLambda,
|
@@ -48,6 +48,7 @@ import {
|
|
48
48
|
} from '@finos/legend-art';
|
49
49
|
import {
|
50
50
|
type ValueSpecification,
|
51
|
+
type Type,
|
51
52
|
Class,
|
52
53
|
Enumeration,
|
53
54
|
PrimitiveType,
|
@@ -113,6 +114,7 @@ import {
|
|
113
114
|
} from '../../stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_In.js';
|
114
115
|
import { QueryBuilderPropertyNameDisplay } from '../QueryBuilderPropertyExpressionEditor.js';
|
115
116
|
import { convertTextToPrimitiveInstanceValue } from '../../stores/shared/ValueSpecificationEditorHelper.js';
|
117
|
+
import { getDNDItemType } from '../shared/QueryBuilderFilterHelper.js';
|
116
118
|
|
117
119
|
export const CAN_DROP_MAIN_GROUP_DND_TYPES = [
|
118
120
|
QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE,
|
@@ -276,27 +278,17 @@ export const QueryBuilderColumnBadge = observer(
|
|
276
278
|
},
|
277
279
|
);
|
278
280
|
|
279
|
-
const
|
280
|
-
|
281
|
-
| QueryBuilderVariableDragSource
|
282
|
-
| QueryBuilderProjectionColumnDragSource,
|
283
|
-
): itemToTest is QueryBuilderProjectionColumnDragSource =>
|
284
|
-
Object.hasOwn(itemToTest, 'columnState');
|
285
|
-
|
286
|
-
const canDropItemOntoNodeValue = (
|
287
|
-
item: QueryBuilderVariableDragSource | QueryBuilderProjectionColumnDragSource,
|
281
|
+
const canDropTypeOntoNodeValue = (
|
282
|
+
type: Type | undefined,
|
288
283
|
condition: PostFilterConditionState,
|
289
284
|
): boolean => {
|
290
|
-
const itemParameterType = isProjectionColumnDragSource(item)
|
291
|
-
? item.columnState.getColumnType()
|
292
|
-
: item.variable.genericType?.value.rawType;
|
293
285
|
const conditionOperator = condition.operator;
|
294
286
|
const conditionValueType = condition.leftConditionValue.getColumnType();
|
295
287
|
return (
|
296
288
|
conditionValueType !== undefined &&
|
297
289
|
!(conditionOperator instanceof QueryBuilderPostFilterOperator_In) &&
|
298
290
|
!(conditionOperator instanceof QueryBuilderPostFilterOperator_NotIn) &&
|
299
|
-
isTypeCompatibleForAssignment(
|
291
|
+
isTypeCompatibleForAssignment(type, conditionValueType)
|
300
292
|
);
|
301
293
|
};
|
302
294
|
|
@@ -319,26 +311,32 @@ const QueryBuilderPostFilterConditionEditor = observer(
|
|
319
311
|
item:
|
320
312
|
| QueryBuilderVariableDragSource
|
321
313
|
| QueryBuilderProjectionColumnDragSource,
|
314
|
+
type: string,
|
322
315
|
): void => {
|
323
|
-
const
|
324
|
-
? item.columnState.getColumnType()
|
325
|
-
: item.variable.genericType?.value.rawType;
|
316
|
+
const itemType = getDNDItemType(item, type);
|
326
317
|
const conditionValueType =
|
327
318
|
node.condition.leftConditionValue.getColumnType();
|
328
|
-
if (
|
329
|
-
if (
|
319
|
+
if (canDropTypeOntoNodeValue(itemType, node.condition)) {
|
320
|
+
if (type === QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE) {
|
321
|
+
const columnState = (item as QueryBuilderProjectionColumnDragSource)
|
322
|
+
.columnState;
|
330
323
|
node.condition.setRightConditionVal(
|
331
324
|
new PostFilterTDSColumnValueConditionValueState(
|
332
325
|
node.condition,
|
333
|
-
|
326
|
+
columnState,
|
334
327
|
),
|
335
328
|
);
|
329
|
+
} else if (type === QUERY_BUILDER_VARIABLE_DND_TYPE) {
|
330
|
+
const variable = (item as QueryBuilderVariableDragSource).variable;
|
331
|
+
node.condition.buildFromValueSpec(variable);
|
336
332
|
} else {
|
337
|
-
|
333
|
+
applicationStore.notificationService.notifyWarning(
|
334
|
+
`Dragging and Dropping ${type} to post-filter panel is not supported.`,
|
335
|
+
);
|
338
336
|
}
|
339
337
|
} else {
|
340
338
|
applicationStore.notificationService.notifyWarning(
|
341
|
-
`Incompatible parameter type ${
|
339
|
+
`Incompatible parameter type ${itemType?.name}. ${itemType?.name} is not compatible with type ${conditionValueType?.name}.`,
|
342
340
|
);
|
343
341
|
}
|
344
342
|
},
|
@@ -351,11 +349,14 @@ const QueryBuilderPostFilterConditionEditor = observer(
|
|
351
349
|
>(
|
352
350
|
() => ({
|
353
351
|
accept: CAN_DROP_POST_FILTER_VALUE_DND_TYPES,
|
354
|
-
canDrop: (item): boolean =>
|
355
|
-
|
352
|
+
canDrop: (item, monitor): boolean =>
|
353
|
+
canDropTypeOntoNodeValue(
|
354
|
+
getDNDItemType(item, monitor.getItemType() as string),
|
355
|
+
node.condition,
|
356
|
+
),
|
356
357
|
drop: (item, monitor): void => {
|
357
358
|
if (!monitor.didDrop()) {
|
358
|
-
handleDrop(item);
|
359
|
+
handleDrop(item, monitor.getItemType() as string);
|
359
360
|
} // prevent drop event propagation to accomondate for nested DnD
|
360
361
|
},
|
361
362
|
collect: (monitor) => ({
|
@@ -371,7 +372,10 @@ const QueryBuilderPostFilterConditionEditor = observer(
|
|
371
372
|
CAN_DROP_POST_FILTER_VALUE_DND_TYPES.includes(
|
372
373
|
monitor.getItemType()?.toString() ?? '',
|
373
374
|
) &&
|
374
|
-
|
375
|
+
canDropTypeOntoNodeValue(
|
376
|
+
getDNDItemType(monitor.getItem(), monitor.getItemType() as string),
|
377
|
+
node.condition,
|
378
|
+
),
|
375
379
|
}));
|
376
380
|
const resetNode = (): void => {
|
377
381
|
node.condition.buildFromValueSpec(
|
@@ -479,7 +483,6 @@ const QueryBuilderPostFilterConditionEditor = observer(
|
|
479
483
|
<PanelEntryDropZonePlaceholder
|
480
484
|
isDragOver={isDragOver && !isFilterValueDragOver}
|
481
485
|
alwaysShowChildren={true}
|
482
|
-
className="query-builder-post-filter-tree__node__drop-zone-placeholder"
|
483
486
|
>
|
484
487
|
<div className="query-builder-post-filter-tree__condition-node">
|
485
488
|
<div className="query-builder-post-filter-tree__condition-node__property">
|