@finos/legend-query-builder 1.0.1 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. package/lib/components/QueryBuilderConstantExpressionPanel.js +1 -1
  2. package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
  3. package/lib/components/QueryBuilderResultPanel.js +2 -2
  4. package/lib/components/QueryBuilderResultPanel.js.map +1 -1
  5. package/lib/components/shared/BasicValueSpecificationEditor.d.ts.map +1 -1
  6. package/lib/components/shared/BasicValueSpecificationEditor.js +41 -2
  7. package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -1
  8. package/lib/index.css +1 -1
  9. package/lib/package.json +1 -1
  10. package/lib/stores/QueryBuilderState.d.ts +5 -2
  11. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  12. package/lib/stores/QueryBuilderState.js +19 -6
  13. package/lib/stores/QueryBuilderState.js.map +1 -1
  14. package/lib/stores/QueryBuilderStateBuilder.d.ts +2 -2
  15. package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
  16. package/lib/stores/QueryBuilderStateBuilder.js +21 -4
  17. package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
  18. package/lib/stores/QueryBuilderTextEditorState.d.ts.map +1 -1
  19. package/lib/stores/QueryBuilderTextEditorState.js +4 -1
  20. package/lib/stores/QueryBuilderTextEditorState.js.map +1 -1
  21. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.d.ts +1 -1
  22. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.d.ts.map +1 -1
  23. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.js +14 -1
  24. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.js.map +1 -1
  25. package/lib/stores/filter/QueryBuilderFilterStateBuilder.d.ts.map +1 -1
  26. package/lib/stores/filter/QueryBuilderFilterStateBuilder.js +14 -1
  27. package/lib/stores/filter/QueryBuilderFilterStateBuilder.js.map +1 -1
  28. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts +1 -0
  29. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts.map +1 -1
  30. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js +21 -17
  31. package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js.map +1 -1
  32. package/package.json +7 -7
  33. package/src/components/QueryBuilderConstantExpressionPanel.tsx +1 -1
  34. package/src/components/QueryBuilderResultPanel.tsx +2 -1
  35. package/src/components/shared/BasicValueSpecificationEditor.tsx +72 -2
  36. package/src/stores/QueryBuilderState.ts +29 -5
  37. package/src/stores/QueryBuilderStateBuilder.ts +20 -1
  38. package/src/stores/QueryBuilderTextEditorState.ts +4 -1
  39. package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.ts +20 -1
  40. package/src/stores/filter/QueryBuilderFilterStateBuilder.ts +20 -0
  41. package/src/stores/milestoning/QueryBuilderMilestoningHelper.ts +34 -27
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilderTextEditorState.js","sourceRoot":"","sources":["../../src/stores/QueryBuilderTextEditorState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,mBAAmB,EACnB,8BAA8B,EAC9B,WAAW,EACX,SAAS,EACT,cAAc,EACd,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,iBAAiB,EACjB,QAAQ,EACR,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,MAAM,OAAO,0BAA0B;IACrC,MAAM,CAAY;IAElB,YAAY,MAAiB;QAC3B,IAAI,CAAC,MA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C5C,IAAI,CAAC,aAAa,CAChB,IAAI,CAAC,SAAS,CACZ,sBAAsB,CACpB,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,YAAY,CAAC,8BAA8B,CAClF,SAAS,CACV,CACF,EACD,IAAI,EACJ,QAAQ,CACT,CACF,CAAC;SACH;QACD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IAED,CAAC,UAAU;QACT,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,CAAC;QACpC,IAAI,IAAI,CAAC,IAAI,KAAK,0BAA0B,CAAC,IAAI,EAAE;YACjD,MAAM,UAAU,CAAC,IAAI,CAAC,kCAAkC,EAAE,CAAC,CAAC;YAC5D,IAAI,IAAI,CAAC,WAAW,EAAE;gBACpB,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,WAAW,CACrE,uDAAuD,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAClF,CAAC;aACH;iBAAM;gBACL,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;gBACpE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;aACzB;YACD,OAAO;SACR;QACD,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;QAElC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC1B,CAAC;CACF"}
1
+ {"version":3,"file":"QueryBuilderTextEditorState.js","sourceRoot":"","sources":["../../src/stores/QueryBuilderTextEditorState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,mBAAmB,EACnB,8BAA8B,EAC9B,WAAW,EACX,SAAS,EACT,cAAc,EACd,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,iBAAiB,EACjB,QAAQ,EACR,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO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B,CAAC;CACF"}
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { FunctionExpression, type SimpleFunctionExpression } from '@finos/legend-graph';
16
+ import { FunctionExpression, SimpleFunctionExpression } from '@finos/legend-graph';
17
17
  import type { QueryBuilderPostFilterOperator } from './QueryBuilderPostFilterOperator.js';
18
18
  import { type QueryBuilderPostFilterState, PostFilterConditionState } from './QueryBuilderPostFilterState.js';
19
19
  import type { QueryBuilderState } from '../../../QueryBuilderState.js';
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilderPostFilterStateBuilder.d.ts","sourceRoot":"","sources":["../../../../../src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAOL,kBAAkB,EAClB,KAAK,wBAAwB,EAC9B,MAAM,qBAAqB,CAAC;AAY7B,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAC1F,OAAO,EACL,KAAK,2BAA2B,EAEhC,wBAAwB,EAKzB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAuDvE,eAAO,MAAM,6BAA6B,oBACvB,2BAA2B,cAChC,kBAAkB,4BACJ,MAAM,GAAG,SAAS,YAClC,8BAA8B,KACvC,wBAAwB,GAAG,SAiE7B,CAAC;AAyDF,eAAO,MAAM,8BAA8B,eAC7B,wBAAwB,qBACjB,iBAAiB,KACnC,IAqDF,CAAC"}
1
+ {"version":3,"file":"QueryBuilderPostFilterStateBuilder.d.ts","sourceRoot":"","sources":["../../../../../src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAOL,kBAAkB,EAClB,wBAAwB,EAEzB,MAAM,qBAAqB,CAAC;AAY7B,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAC1F,OAAO,EACL,KAAK,2BAA2B,EAEhC,wBAAwB,EAKzB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAuDvE,eAAO,MAAM,6BAA6B,oBACvB,2BAA2B,cAChC,kBAAkB,4BACJ,MAAM,GAAG,SAAS,YAClC,8BAA8B,KACvC,wBAAwB,GAAG,SAiE7B,CAAC;AA2EF,eAAO,MAAM,8BAA8B,eAC7B,wBAAwB,qBACjB,iBAAiB,KACnC,IAqDF,CAAC"}
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { LambdaFunctionInstanceValue, AbstractPropertyExpression, extractElementNameFromPath, PrimitiveInstanceValue, matchFunctionName, VariableExpression, FunctionExpression, } from '@finos/legend-graph';
16
+ import { LambdaFunctionInstanceValue, AbstractPropertyExpression, extractElementNameFromPath, PrimitiveInstanceValue, matchFunctionName, VariableExpression, FunctionExpression, SimpleFunctionExpression, MINUS_STRING, } from '@finos/legend-graph';
17
17
  import { assertTrue, assertType, guaranteeIsString, guaranteeNonNullable, guaranteeType, UnsupportedOperationError, } from '@finos/legend-shared';
18
18
  import { QueryBuilderDerivationProjectionColumnState } from '../projection/QueryBuilderProjectionColumnState.js';
19
19
  import { getTDSColumnState } from '../QueryBuilderTDSHelper.js';
@@ -71,6 +71,19 @@ export const buildPostFilterConditionState = (postFilterState, expression, opera
71
71
  return postConditionState;
72
72
  };
73
73
  const processPostFilterTree = (expression, postFilterState, parentPostFilterNodeId) => {
74
+ // NOTE: This checks if the expression is a simple function expression of Minus
75
+ // since negative numbers are returned as a SimpleFunctionExpression of minus(number)
76
+ // rather than a PrimitiveInstanceValue of -number, so here
77
+ // we replace the parameter value of the expression directly with a PrimitiveInstanceValue
78
+ if (expression.parametersValues[1] instanceof SimpleFunctionExpression &&
79
+ expression.parametersValues[1].functionName === MINUS_STRING &&
80
+ expression.parametersValues[1].parametersValues[0] instanceof
81
+ PrimitiveInstanceValue) {
82
+ expression.parametersValues[1].parametersValues[0].values[0] =
83
+ parseFloat(expression.parametersValues[1].parametersValues[0].values[0]) * -1;
84
+ expression.parametersValues[1] =
85
+ expression.parametersValues[1].parametersValues[0];
86
+ }
74
87
  const parentNode = parentPostFilterNodeId
75
88
  ? postFilterState.getNode(parentPostFilterNodeId)
76
89
  : undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilderPostFilterStateBuilder.js","sourceRoot":"","sources":["../../../../../src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,0BAA0B,EAC1B,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,GAEnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,oBAAoB,EACpB,aAAa,EACb,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,2CAA2C,EAAE,MAAM,oDAAoD,CAAC;AAEjH,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAEL,kCAAkC,EAClC,wBAAwB,EACxB,2CAA2C,EAC3C,uCAAuC,EACvC,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,iCAAiC,EAAE,MAAM,4DAA4D,CAAC;AAE/G,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAEhF,MAAM,yBAAyB,GAAG,CAChC,kBAA8C,EAC9C,eAA4C,EAChB,EAAE;IAC9B,MAAM,eAAe,GAAG,eAAe,CAA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F,eAAe,CAAC,sBAAsB,CACpC,aAAa,CACX,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,EACrC,kBAAkB,EAClB,8GAA8G,CAC/G,CAAC,IAAI,CACP,CAAC;QACF,qBAAqB,CAAC,cAAc,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;QAElE,QAAQ,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;QACtC,eAAe,CAAC,YAAY,EAAE,CAAC;KAChC;AACH,CAAC,CAAC"}
1
+ {"version":3,"file":"QueryBuilderPostFilterStateBuilder.js","sourceRoot":"","sources":["../../../../../src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,0BAA0B,EAC1B,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,YAAY,GACb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,oBAAoB,EACpB,aAAa,EACb,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,2CAA2C,EAAE,MAAM,oDAAoD,CAAC;AAEjH,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAEL,kCAAkC,EAClC,wBAAwB,EACxB,2CAA2C,EAC3C,uCAAuC,EACvC,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,iCAAiC,EAAE,MAAM,4DAA4D,CAAC;AAE/G,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAEhF,MAAM,yBAAyB,GAAG,CAChC,kBAA8C,EAC9C,eAA4C,EAChB,EAAE;IAC9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,gBAAgB,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;QACxD,UAAU,CACR,gBAAgB,EAChB,2BAA2B,EAC3B,mFAAmF,CACpF,CAAC;QAEF,UAAU,CACR,mBAAmB,CAAC,cAAc,EAClC,oBAAoB,EACpB,0FAA0F,CAC3F,CAAC;QACF,UAAU,CACR,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAC1C,gGAAgG,CACjG,CAAC;QACF,MAAM,UAAU,GAAG,oBAAoB,CACrC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,EAC1B,0EAA0E,CAC3E,CAAC;QACF,UAAU,CACR,UAAU,CAAC,kBAAkB,CAAC,MAAM,KAAK,CAAC,EAC1C,0FAA0F,CAC3F,CAAC;QACF,MAAM,cAAc,GAAG,aAAa,CAClC,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAChC,kBAAkB,EAClB,qGAAqG,CACtG,CAAC;QACF,UAAU,CACR,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAC/C,oFAAoF,CACrF,CAAC;QACF,eAAe,CAAC,sBAAsB,CACpC,aAAa,CACX,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,EACrC,kBAAkB,EAClB,8GAA8G,CAC/G,CAAC,IAAI,CACP,CAAC;QACF,qBAAqB,CAAC,cAAc,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;QAElE,QAAQ,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;QACtC,eAAe,CAAC,YAAY,EAAE,CAAC;KAChC;AACH,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilderFilterStateBuilder.d.ts","sourceRoot":"","sources":["../../../src/stores/filter/QueryBuilderFilterStateBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAIL,wBAAwB,EAEzB,MAAM,qBAAqB,CAAC;AAW7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AA0EjE,eAAO,MAAM,uBAAuB,eACtB,wBAAwB,qBACjB,iBAAiB,KACnC,IA4CF,CAAC"}
1
+ {"version":3,"file":"QueryBuilderFilterStateBuilder.d.ts","sourceRoot":"","sources":["../../../src/stores/filter/QueryBuilderFilterStateBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAML,wBAAwB,EAEzB,MAAM,qBAAqB,CAAC;AAW7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AA4FjE,eAAO,MAAM,uBAAuB,eACtB,wBAAwB,qBACjB,iBAAiB,KACnC,IA4CF,CAAC"}
@@ -13,13 +13,26 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { AbstractPropertyExpression, LambdaFunctionInstanceValue, matchFunctionName, SimpleFunctionExpression, VariableExpression, } from '@finos/legend-graph';
16
+ import { AbstractPropertyExpression, LambdaFunctionInstanceValue, matchFunctionName, MINUS_STRING, PrimitiveInstanceValue, SimpleFunctionExpression, VariableExpression, } from '@finos/legend-graph';
17
17
  import { assertTrue, assertType, guaranteeNonNullable, guaranteeType, returnUndefOnError, UnsupportedOperationError, } from '@finos/legend-shared';
18
18
  import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../graphManager/QueryBuilderSupportedFunctions.js';
19
19
  import { toGroupOperation } from '../QueryBuilderGroupOperationHelper.js';
20
20
  import { validatePropertyExpressionChain } from '../QueryBuilderValueSpecificationHelper.js';
21
21
  import { QueryBuilderFilterTreeConditionNodeData, QueryBuilderFilterTreeGroupNodeData, } from './QueryBuilderFilterState.js';
22
22
  const processFilterTree = (expression, filterState, parentFilterNodeId) => {
23
+ // NOTE: This checks if the expression is a simple function expression of Minus
24
+ // since negative numbers are returned as a SimpleFunctionExpression of minus(number)
25
+ // rather than a PrimitiveInstanceValue of -number, so here
26
+ // we replace the parameter value of the expression directly with a PrimitiveInstanceValue
27
+ if (expression.parametersValues[1] instanceof SimpleFunctionExpression &&
28
+ expression.parametersValues[1].functionName === MINUS_STRING &&
29
+ expression.parametersValues[1].parametersValues[0] instanceof
30
+ PrimitiveInstanceValue) {
31
+ expression.parametersValues[1].parametersValues[0].values[0] =
32
+ parseFloat(expression.parametersValues[1].parametersValues[0].values[0]) * -1;
33
+ expression.parametersValues[1] =
34
+ expression.parametersValues[1].parametersValues[0];
35
+ }
23
36
  const parentNode = parentFilterNodeId
24
37
  ? filterState.getNode(parentFilterNodeId)
25
38
  : undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilderFilterStateBuilder.js","sourceRoot":"","sources":["../../../src/stores/filter/QueryBuilderFilterStateBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,UAAU,EACV,UAAU,EACV,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,iCAAiC,EAAE,MAAM,sDAAsD,CAAC;AACzG,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAE1E,OAAO,EAAE,+BAA+B,EAAE,MAAM,4CAA4C,CAAC;AAC7F,OAAO,EAEL,uCAAuC,EACvC,mCAAmC,GACpC,MAAM,8BAA8B,CAAC;AAEtC,MAAM,iBAAiB,GAAG,CACxB,UAAoC,EACpC,WAAoC,EACpC,kBAAsC,EAChC,EAAE;IACR,MAAM,UAAU,GAAG,kBAAkB;QACnC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,kBAAkB,CAAC;QACzC,CAAC,CAAC,SAAS,CAAC;IACd,IACE,iBAAiB,CAAC,UAAU,CAAC,Y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AO;aACR;SACF;QACD,MAAM,IAAI,yBAAyB,CACjC,mGAAmG,CACpG,CAAC;KACH;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,UAAoC,EACpC,iBAAoC,EAC9B,EAAE;IACR,MAAM,WAAW,GAAG,iBAAiB,CAAC,WAAW,CAAC;IAClD,MAAM,YAAY,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;IACpD,UAAU,CACR,YAAY,EACZ,2BAA2B,EAC3B,yFAAyF,CAC1F,CAAC;IAEF,MAAM,UAAU,GAAG,oBAAoB,CACrC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EACtB,oEAAoE,CACrE,CAAC;IACF,UAAU,CACR,UAAU,CAAC,kBAAkB,CAAC,MAAM,KAAK,CAAC,EAC1C,oFAAoF,CACrF,CAAC;IACF,MAAM,cAAc,GAAG,aAAa,CAClC,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAChC,wBAAwB,EACxB,oFAAoF,CACrF,CAAC;IAEF,UAAU,CACR,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAC/C,8EAA8E,CAC/E,CAAC;IACF,WAAW,CAAC,sBAAsB,CAChC,aAAa,CACX,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,EACrC,kBAAkB,EAClB,8EAA8E,CAC/E,CAAC,IAAI,CACP,CAAC;IAEF,iBAAiB,CAAC,cAAc,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;IAE1D;;;;;OAKG;IACH,WAAW,CAAC,YAAY,EAAE,CAAC;AAC7B,CAAC,CAAC"}
1
+ {"version":3,"file":"QueryBuilderFilterStateBuilder.js","sourceRoot":"","sources":["../../../src/stores/filter/QueryBuilderFilterStateBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,iBAAiB,E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E;gBACxB,WAAW,CAAC,eAAe,CACzB,IAAI,uCAAuC,CACzC,SAAS,EACT,oBAAoB,CACrB,EACD,UAAU,CACX,CAAC;gBACF,OAAO;aACR;SACF;QACD,MAAM,IAAI,yBAAyB,CACjC,mGAAmG,CACpG,CAAC;KACH;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,UAAoC,EACpC,iBAAoC,EAC9B,EAAE;IACR,MAAM,WAAW,GAAG,iBAAiB,CAAC,WAAW,CAAC;IAClD,MAAM,YAAY,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;IACpD,UAAU,CACR,YAAY,EACZ,2BAA2B,EAC3B,yFAAyF,CAC1F,CAAC;IAEF,MAAM,UAAU,GAAG,oBAAoB,CACrC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EACtB,oEAAoE,CACrE,CAAC;IACF,UAAU,CACR,UAAU,CAAC,kBAAkB,CAAC,MAAM,KAAK,CAAC,EAC1C,oFAAoF,CACrF,CAAC;IACF,MAAM,cAAc,GAAG,aAAa,CAClC,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAChC,wBAAwB,EACxB,oFAAoF,CACrF,CAAC;IAEF,UAAU,CACR,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAC/C,8EAA8E,CAC/E,CAAC;IACF,WAAW,CAAC,sBAAsB,CAChC,aAAa,CACX,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,EACrC,kBAAkB,EAClB,8EAA8E,CAC/E,CAAC,IAAI,CACP,CAAC;IAEF,iBAAiB,CAAC,cAAc,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;IAE1D;;;;;OAKG;IACH,WAAW,CAAC,YAAY,EAAE,CAAC;AAC7B,CAAC,CAAC"}
@@ -53,6 +53,7 @@ export declare const getDerivedPropertyMilestoningSteoreotype: (property: Derive
53
53
  * BUD : default business date is propgated
54
54
  */
55
55
  export declare const isDefaultDatePropagationSupported: (currentPropertyExpression: AbstractPropertyExpression, queryBuilderState: QueryBuilderState, prevPropertyExpression?: AbstractPropertyExpression | undefined) => boolean;
56
+ export declare const checkIfEquivalent: (param1: ValueSpecification | undefined, param2: ValueSpecification | undefined) => boolean;
56
57
  /**
57
58
  * Check if the parameter value of the milestoned property is
58
59
  * the same as those specified in global scope, so that we can
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilderMilestoningHelper.d.ts","sourceRoot":"","sources":["../../../src/stores/milestoning/QueryBuilderMilestoningHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,0BAA0B,EAC1B,eAAe,EAEf,sBAAsB,EAEtB,KAAK,kBAAkB,EAKvB,KAAK,SAAS,EAEf,MAAM,qBAAqB,CAAC;AAM7B,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,KAAK,EAAE,0CAA0C,EAAE,MAAM,uCAAuC,CAAC;AACxG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,eAAO,MAAM,wCAAwC,aACzC,eAAe,SAClB,SAAS,KACf,sBAAsB,GAAG,SAiB3B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,iCAAiC,8BACjB,0BAA0B,qBAClC,iBAAiB,2BACX,0BAA0B,GAAG,SAAS,KAC9D,OAkCF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,eAC7B,sBAAsB,OAC7B,MAAM,kBACK,kBAAkB,mBACjB,4BAA4B,KAC5C,OA2CF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wCAAwC,mCACnB,0CAA0C,OACrE,MAAM,KACV,kBAAkB,GAAG,SA6EvB,CAAC;AAEF,eAAO,MAAM,0CAA0C,qBACnC,sBAAsB,GAAG,SAAS,oBAClC,sBAAsB,sBACpB,0BAA0B,KAC7C,IA4BF,CAAC"}
1
+ {"version":3,"file":"QueryBuilderMilestoningHelper.d.ts","sourceRoot":"","sources":["../../../src/stores/milestoning/QueryBuilderMilestoningHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,0BAA0B,EAC1B,eAAe,EAEf,sBAAsB,EAEtB,KAAK,kBAAkB,EAKvB,KAAK,SAAS,EAEf,MAAM,qBAAqB,CAAC;AAM7B,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,KAAK,EAAE,0CAA0C,EAAE,MAAM,uCAAuC,CAAC;AACxG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,eAAO,MAAM,wCAAwC,aACzC,eAAe,SAClB,SAAS,KACf,sBAAsB,GAAG,SAiB3B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,iCAAiC,8BACjB,0BAA0B,qBAClC,iBAAiB,2BACX,0BAA0B,GAAG,SAAS,KAC9D,OAkCF,CAAC;AAEF,eAAO,MAAM,iBAAiB,WACpB,kBAAkB,GAAG,SAAS,UAC9B,kBAAkB,GAAG,SAAS,KACrC,OA6BF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,eAC7B,sBAAsB,OAC7B,MAAM,kBACK,kBAAkB,mBACjB,4BAA4B,KAC5C,OAgBF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wCAAwC,mCACnB,0CAA0C,OACrE,MAAM,KACV,kBAAkB,GAAG,SA6EvB,CAAC;AAEF,eAAO,MAAM,0CAA0C,qBACnC,sBAAsB,GAAG,SAAS,oBAClC,sBAAsB,sBACpB,0BAA0B,KAC7C,IA4BF,CAAC"}
@@ -90,29 +90,33 @@ export const isDefaultDatePropagationSupported = (currentPropertyExpression, que
90
90
  }
91
91
  return false;
92
92
  };
93
+ export const checkIfEquivalent = (param1, param2) => {
94
+ if (param1?.multiplicity.lowerBound !== param2?.multiplicity.lowerBound ||
95
+ param1?.multiplicity.upperBound !== param2?.multiplicity.upperBound) {
96
+ return false;
97
+ }
98
+ if (param1 instanceof VariableExpression &&
99
+ param2 instanceof VariableExpression) {
100
+ return param1.name === param2.name;
101
+ }
102
+ else if (param1 instanceof PrimitiveInstanceValue &&
103
+ param2 instanceof PrimitiveInstanceValue) {
104
+ if (param1.genericType.value.rawType.name === PRIMITIVE_TYPE.LATESTDATE &&
105
+ param2.genericType.value.rawType.name === PRIMITIVE_TYPE.LATESTDATE) {
106
+ return true;
107
+ }
108
+ return (param1.genericType.value.rawType.name ===
109
+ param2.genericType.value.rawType.name &&
110
+ param1.values[0] === param2.values[0]);
111
+ }
112
+ return false;
113
+ };
93
114
  /**
94
115
  * Check if the parameter value of the milestoned property is
95
116
  * the same as those specified in global scope, so that we can
96
117
  * potentially replace them with propgated value.
97
118
  */
98
119
  export const matchMilestoningParameterValue = (stereotype, idx, parameterValue, milestoningDate) => {
99
- const checkIfEquivalent = (param1, param2) => {
100
- if (param1 instanceof VariableExpression &&
101
- param2 instanceof VariableExpression) {
102
- return param1.name === param2.name;
103
- }
104
- else if (param1 instanceof PrimitiveInstanceValue &&
105
- param2 instanceof PrimitiveInstanceValue) {
106
- if (param1.genericType.value.rawType.name === PRIMITIVE_TYPE.LATESTDATE &&
107
- param2.genericType.value.rawType.name === PRIMITIVE_TYPE.LATESTDATE) {
108
- return true;
109
- }
110
- return (param1.genericType.value.rawType.name ===
111
- param2.genericType.value.rawType.name &&
112
- param1.values[0] === param2.values[0]);
113
- }
114
- return false;
115
- };
116
120
  switch (stereotype) {
117
121
  case MILESTONING_STEREOTYPE.BITEMPORAL:
118
122
  return ((idx === 0 &&
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilderMilestoningHelper.js","sourceRoot":"","sources":["../../../src/stores/milestoning/QueryBuilderMilestoningHelper.ts"],"names":[],"m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CAAC,UAAU,4CAA4C,CACpH,CAAC;aACH;SACF;aAAM,IAAI,kBAAkB,CAAC,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE;YAC3D,MAAM,IAAI,yBAAyB,CACjC,sCAAsC,gBAAgB,qCAAqC,CAC5F,CAAC;SACH;KACF;AACH,CAAC,CAAC"}
1
+ {"version":3,"file":"QueryBuilderMilestoningHelper.js","sourceRoot":"","sources":["../../../src/stores/milestoning/QueryBuilderMilestoningHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,0BAA0B,EAC1B,eAAe,EACf,KAAK,EACL,sBAAsB,EACtB,8BAA8B,EAE9B,WAAW,EACX,8CAA8C,EAC9C,sBAAsB,EACtB,cAAc,EAEd,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAK9B,MAAM,CAAC,MAAM,wCAAwC,GAAG,CACtD,QAAyB,EACzB,KAAgB,EACoB,EAAE;IACtC,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC;IAC9B,IAAI,KAAK,YAAY,KAAK,EAAE;QAC1B,OAAO,8BAA8B,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;KACrD;SAAM,IAAI,KAAK,YAAY,WAAW,EAAE;QACvC,MAAM,6BAA6B,GACjC,8CAA8C,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAClE,IAAI,6BAA6B,CAAC,MAAM,EAAE;YACxC,MAAM,UAAU,GACd,6BAA6B,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC;YAC9D,OAAO,8BAA8B,CACnC,aAAa,CAAC,UAAU,EAAE,KAAK,CAAC,EAChC,KAAK,CACN,CAAC;SACH;KACF;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;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rC;QACA,IAAI,gBAAgB,KAAK,sBAAsB,CAAC,UAAU,EAAE;YAC1D,IACE,kBAAkB,CAAC,gBAAgB,CAAC,MAAM,KAAK,CAAC;gBAChD,CAAC,gBAAgB,EACjB;gBACA,MAAM,IAAI,yBAAyB,CACjC,sCAAsC,sBAAsB,CAAC,UAAU,sCAAsC,CAC9G,CAAC;aACH;iBAAM,IAAI,kBAAkB,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;gBACzD,MAAM,IAAI,yBAAyB,CACjC,sCAAsC,sBAAsB,CAAC,UAAU,sCAAsC,CAC9G,CAAC;aACH;iBAAM,IAAI,kBAAkB,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;gBACzD,MAAM,IAAI,yBAAyB,CACjC,sCAAsC,sBAAsB,CAAC,UAAU,4CAA4C,CACpH,CAAC;aACH;SACF;aAAM,IAAI,kBAAkB,CAAC,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE;YAC3D,MAAM,IAAI,yBAAyB,CACjC,sCAAsC,gBAAgB,qCAAqC,CAC5F,CAAC;SACH;KACF;AACH,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-query-builder",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Legend query builder core",
5
5
  "keywords": [
6
6
  "legend",
@@ -45,12 +45,12 @@
45
45
  "@ag-grid-community/core": "29.1.0",
46
46
  "@ag-grid-community/react": "29.1.0",
47
47
  "@ag-grid-community/styles": "29.1.0",
48
- "@finos/legend-application": "13.0.1",
49
- "@finos/legend-art": "5.0.35",
50
- "@finos/legend-graph": "24.0.0",
51
- "@finos/legend-server-depot": "4.4.6",
52
- "@finos/legend-shared": "8.0.1",
53
- "@finos/legend-storage": "3.0.41",
48
+ "@finos/legend-application": "13.0.3",
49
+ "@finos/legend-art": "5.0.37",
50
+ "@finos/legend-graph": "24.1.0",
51
+ "@finos/legend-server-depot": "4.4.7",
52
+ "@finos/legend-shared": "8.0.2",
53
+ "@finos/legend-storage": "3.0.42",
54
54
  "@testing-library/react": "14.0.0",
55
55
  "@types/papaparse": "5.3.7",
56
56
  "@types/react": "18.0.28",
@@ -52,7 +52,7 @@ import { BasicValueSpecificationEditor } from './shared/BasicValueSpecificationE
52
52
  import { VariableViewer } from './shared/QueryBuilderVariableSelector.js';
53
53
  import { QUERY_BUILDER_TEST_ID } from '../application/QueryBuilderTesting.js';
54
54
 
55
- // Note: We currently only allow constant variables for primitive types of multiplicity ONE.
55
+ // NOTE: We currently only allow constant variables for primitive types of multiplicity ONE.
56
56
  // This is why we don't show multiplicity in the editor.
57
57
  const QueryBuilderConstantExpressionEditor = observer(
58
58
  (props: { constantState: QueryBuilderConstantExpressionState }) => {
@@ -370,7 +370,7 @@ const QueryBuilderGridResult = observer(
370
370
  },
371
371
  }}
372
372
  modules={[ClientSideRowModelModule]}
373
- // Note: we use onCellMouseOver as a bit of a workaround
373
+ // NOTE: we use onCellMouseOver as a bit of a workaround
374
374
  // since we use the context menu so we want the user to be
375
375
  // able to right click any cell and have the context menu
376
376
  // options use the data belonging to the row that they are
@@ -379,6 +379,7 @@ const QueryBuilderGridResult = observer(
379
379
  onCellMouseOver={(event): void => {
380
380
  setCellDoubleClickedEvent(event);
381
381
  }}
382
+ suppressFieldDotNotation={true}
382
383
  columnDefs={columns.map((colName) => ({
383
384
  minWidth: 50,
384
385
  sortable: true,
@@ -362,13 +362,82 @@ const NumberPrimitiveInstanceValueEditor = observer(
362
362
  resetValue,
363
363
  setValueSpecification,
364
364
  } = props;
365
+
366
+ const DECIMAL_POINT = '.';
367
+ const NEGATIVE_SIGN = '-';
368
+
369
+ // NOTE: Although we want to allow the user to type
370
+ // '-' and '.' for negative and decimal numbers respectively,
371
+ // we want to check for when user leaves the input to not
372
+ // leave the number value at an invalid state (i.e. if
373
+ // user just left '-' without an actual number)
374
+ const onBlur = (): void => {
375
+ if (valueSpecification.values[0] === NEGATIVE_SIGN) {
376
+ instanceValue_setValue(valueSpecification, 0, 0);
377
+ }
378
+ const numberInputValue = valueSpecification.values[0] as string;
379
+ if (
380
+ numberInputValue.length > 0 &&
381
+ numberInputValue.at(-1) === DECIMAL_POINT
382
+ ) {
383
+ instanceValue_setValue(
384
+ valueSpecification,
385
+ parseInt(
386
+ numberInputValue.substring(0, numberInputValue.length - 1),
387
+ 10,
388
+ ),
389
+ 0,
390
+ );
391
+ }
392
+ const val = isInteger
393
+ ? parseInt(numberInputValue, 10)
394
+ : parseFloat(numberInputValue);
395
+ instanceValue_setValue(valueSpecification, val, 0);
396
+ setValueSpecification(valueSpecification);
397
+ };
398
+
365
399
  const value = valueSpecification.values[0] as number;
366
400
  const changeValue: React.ChangeEventHandler<HTMLInputElement> = (event) => {
401
+ const valueIsDecimalPoint =
402
+ (event.nativeEvent as InputEvent).data === DECIMAL_POINT;
403
+
404
+ const valueIsNegativeSymbol =
405
+ (event.nativeEvent as InputEvent).data === NEGATIVE_SIGN;
406
+
407
+ if (
408
+ !isInteger &&
409
+ valueIsDecimalPoint &&
410
+ value.toString().length > 0 &&
411
+ !value.toString().includes(DECIMAL_POINT)
412
+ ) {
413
+ instanceValue_setValue(
414
+ valueSpecification,
415
+ valueSpecification.values[0] + DECIMAL_POINT,
416
+ 0,
417
+ );
418
+ return;
419
+ }
420
+ if (
421
+ value.toString().includes(DECIMAL_POINT) &&
422
+ (event.nativeEvent as InputEvent).data === '0'
423
+ ) {
424
+ instanceValue_setValue(
425
+ valueSpecification,
426
+ `${valueSpecification.values[0]}0`,
427
+ 0,
428
+ );
429
+ setValueSpecification(valueSpecification);
430
+ return;
431
+ }
432
+
367
433
  let inputVal = isInteger
368
434
  ? parseInt(event.target.value, 10)
369
435
  : parseFloat(event.target.value);
370
436
  inputVal = isNaN(inputVal) ? 0 : inputVal;
371
- instanceValue_setValue(valueSpecification, inputVal, 0);
437
+
438
+ valueIsNegativeSymbol
439
+ ? instanceValue_setValue(valueSpecification, NEGATIVE_SIGN, 0)
440
+ : instanceValue_setValue(valueSpecification, inputVal, 0);
372
441
  setValueSpecification(valueSpecification);
373
442
  };
374
443
 
@@ -377,8 +446,9 @@ const NumberPrimitiveInstanceValueEditor = observer(
377
446
  <input
378
447
  className="panel__content__form__section__input value-spec-editor__input"
379
448
  spellCheck={false}
380
- type="number"
449
+ type="text"
381
450
  value={value}
451
+ onBlur={onBlur}
382
452
  onChange={changeValue}
383
453
  />
384
454
  <button
@@ -61,6 +61,7 @@ import {
61
61
  isStubbed_RawLambda,
62
62
  buildLambdaVariableExpressions,
63
63
  buildRawLambdaFromLambdaFunction,
64
+ type ValueSpecification,
64
65
  } from '@finos/legend-graph';
65
66
  import { buildLambdaFunction } from './QueryBuilderValueSpecificationBuilder.js';
66
67
  import type {
@@ -294,9 +295,14 @@ export abstract class QueryBuilderState implements CommandRegistrar {
294
295
  );
295
296
  }
296
297
 
297
- resetQueryResult(): void {
298
+ resetQueryResult(preserveResult?: boolean): void {
298
299
  const resultState = new QueryBuilderResultState(this);
299
300
  resultState.setPreviewLimit(this.resultState.previewLimit);
301
+ if (preserveResult) {
302
+ resultState.setExecutionResult(this.resultState.executionResult);
303
+ resultState.setExecutionDuration(this.resultState.executionDuration);
304
+ resultState.latestRunHashCode = this.resultState.latestRunHashCode;
305
+ }
300
306
  this.resultState = resultState;
301
307
  }
302
308
 
@@ -312,9 +318,9 @@ export abstract class QueryBuilderState implements CommandRegistrar {
312
318
  mappingModelCoverageAnalysisResult;
313
319
  }
314
320
  this.explorerState.refreshTreeData();
315
- this.parametersState = new QueryBuilderParametersState(this);
316
321
  this.constantState = new QueryBuilderConstantsState(this);
317
322
  this.functionsExplorerState = new QueryFunctionsExplorerState(this);
323
+ this.parametersState = new QueryBuilderParametersState(this);
318
324
  this.filterState = new QueryBuilderFilterState(this, this.filterOperators);
319
325
  this.watermarkState = new QueryBuilderWatermarkState(this);
320
326
  this.checkEntitlementsState = new QueryBuilderCheckEntitlementsState(this);
@@ -377,15 +383,32 @@ export abstract class QueryBuilderState implements CommandRegistrar {
377
383
 
378
384
  initializeWithQuery(query: RawLambda): void {
379
385
  this.rebuildWithQuery(query);
386
+ this.resetQueryResult();
380
387
  this.changeDetectionState.initialize(query);
381
388
  }
382
389
 
383
390
  /**
384
391
  * Process the provided query, and rebuild the query builder state.
385
392
  */
386
- rebuildWithQuery(query: RawLambda): void {
393
+ rebuildWithQuery(
394
+ query: RawLambda,
395
+ options?: {
396
+ preserveParameterValues?: boolean | undefined;
397
+ preserveResult?: boolean | undefined;
398
+ },
399
+ ): void {
400
+ const previousStateParameterValues = new Map<
401
+ VariableExpression,
402
+ ValueSpecification | undefined
403
+ >();
387
404
  try {
388
- this.resetQueryResult();
405
+ if (options?.preserveParameterValues) {
406
+ // Preserving parameter values
407
+ this.parametersState.parameterStates.forEach((ps) => {
408
+ previousStateParameterValues.set(ps.parameter, ps.value);
409
+ });
410
+ }
411
+ this.resetQueryResult(options?.preserveResult);
389
412
  this.resetQueryContent();
390
413
 
391
414
  if (!isStubbed_RawLambda(query)) {
@@ -406,6 +429,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
406
429
  processQueryLambdaFunction(
407
430
  guaranteeNonNullable(compiledValueSpecification.values[0]),
408
431
  this,
432
+ previousStateParameterValues,
409
433
  );
410
434
  }
411
435
  if (this.parametersState.parameterStates.length > 0) {
@@ -413,8 +437,8 @@ export abstract class QueryBuilderState implements CommandRegistrar {
413
437
  }
414
438
  } catch (error) {
415
439
  assertErrorThrown(error);
416
- this.resetQueryContent();
417
440
  this.resetQueryResult();
441
+ this.resetQueryContent();
418
442
  this.unsupportedQueryState.setLambdaError(error);
419
443
  this.unsupportedQueryState.setRawLambda(query);
420
444
  this.setClass(undefined);
@@ -69,6 +69,7 @@ import { LambdaParameterState } from './shared/LambdaParameterState.js';
69
69
  import { processTDS_OLAPGroupByExpression } from './fetch-structure/tds/window/QueryBuilderWindowStateBuilder.js';
70
70
  import { processWatermarkExpression } from './watermark/QueryBuilderWatermarkStateBuilder.js';
71
71
  import { QueryBuilderConstantExpressionState } from './QueryBuilderConstantsState.js';
72
+ import { checkIfEquivalent } from './milestoning/QueryBuilderMilestoningHelper.js';
72
73
 
73
74
  const processGetAllExpression = (
74
75
  expression: SimpleFunctionExpression,
@@ -606,27 +607,45 @@ export class QueryBuilderValueSpecificationProcessor
606
607
  export const processParameters = (
607
608
  parameters: VariableExpression[],
608
609
  queryBuilderState: QueryBuilderState,
610
+ preservedParameters?: Map<VariableExpression, ValueSpecification | undefined>,
609
611
  ): void => {
610
612
  const queryParameterState = queryBuilderState.parametersState;
613
+ // Here we won't mock the values for parameters which are present in the previous state
614
+ // because we don't want to lose the parameter value
611
615
  parameters.forEach((parameter) => {
616
+ let oldParamterValue: ValueSpecification | undefined;
617
+ if (preservedParameters) {
618
+ Array.from(preservedParameters.entries()).forEach(([key, value]) => {
619
+ if (checkIfEquivalent(key, parameter)) {
620
+ oldParamterValue = value;
621
+ }
622
+ });
623
+ }
612
624
  const parameterState = new LambdaParameterState(
613
625
  parameter,
614
626
  queryBuilderState.observableContext,
615
627
  queryBuilderState.graphManagerState.graph,
616
628
  );
617
- parameterState.mockParameterValue();
629
+ if (oldParamterValue) {
630
+ parameterState.setValue(oldParamterValue);
631
+ } else {
632
+ parameterState.mockParameterValue();
633
+ }
618
634
  queryParameterState.addParameter(parameterState);
619
635
  });
636
+ queryBuilderState.parametersState = queryParameterState;
620
637
  };
621
638
 
622
639
  export const processQueryLambdaFunction = (
623
640
  lambdaFunction: LambdaFunction,
624
641
  queryBuilderState: QueryBuilderState,
642
+ preservedParameters?: Map<VariableExpression, ValueSpecification | undefined>,
625
643
  ): void => {
626
644
  if (lambdaFunction.functionType.parameters.length) {
627
645
  processParameters(
628
646
  lambdaFunction.functionType.parameters,
629
647
  queryBuilderState,
648
+ preservedParameters,
630
649
  );
631
650
  }
632
651
  lambdaFunction.expressionSequence.map((expression) =>
@@ -198,7 +198,10 @@ export class QueryBuilderTextEditorState extends LambdaEditorState {
198
198
  `Can't parse query. Please fix error before closing: ${this.parserError.message}`,
199
199
  );
200
200
  } else {
201
- this.queryBuilderState.rebuildWithQuery(this.rawLambdaState.lambda);
201
+ this.queryBuilderState.rebuildWithQuery(this.rawLambdaState.lambda, {
202
+ preserveParameterValues: true,
203
+ preserveResult: true,
204
+ });
202
205
  this.setMode(undefined);
203
206
  }
204
207
  return;
@@ -22,7 +22,8 @@ import {
22
22
  matchFunctionName,
23
23
  VariableExpression,
24
24
  FunctionExpression,
25
- type SimpleFunctionExpression,
25
+ SimpleFunctionExpression,
26
+ MINUS_STRING,
26
27
  } from '@finos/legend-graph';
27
28
  import {
28
29
  assertTrue,
@@ -178,6 +179,24 @@ const processPostFilterTree = (
178
179
  postFilterState: QueryBuilderPostFilterState,
179
180
  parentPostFilterNodeId: string | undefined,
180
181
  ): void => {
182
+ // NOTE: This checks if the expression is a simple function expression of Minus
183
+ // since negative numbers are returned as a SimpleFunctionExpression of minus(number)
184
+ // rather than a PrimitiveInstanceValue of -number, so here
185
+ // we replace the parameter value of the expression directly with a PrimitiveInstanceValue
186
+ if (
187
+ expression.parametersValues[1] instanceof SimpleFunctionExpression &&
188
+ expression.parametersValues[1].functionName === MINUS_STRING &&
189
+ expression.parametersValues[1].parametersValues[0] instanceof
190
+ PrimitiveInstanceValue
191
+ ) {
192
+ expression.parametersValues[1].parametersValues[0].values[0] =
193
+ parseFloat(
194
+ expression.parametersValues[1].parametersValues[0].values[0] as string,
195
+ ) * -1;
196
+ expression.parametersValues[1] =
197
+ expression.parametersValues[1].parametersValues[0];
198
+ }
199
+
181
200
  const parentNode = parentPostFilterNodeId
182
201
  ? postFilterState.getNode(parentPostFilterNodeId)
183
202
  : undefined;
@@ -18,6 +18,8 @@ import {
18
18
  AbstractPropertyExpression,
19
19
  LambdaFunctionInstanceValue,
20
20
  matchFunctionName,
21
+ MINUS_STRING,
22
+ PrimitiveInstanceValue,
21
23
  SimpleFunctionExpression,
22
24
  VariableExpression,
23
25
  } from '@finos/legend-graph';
@@ -44,6 +46,24 @@ const processFilterTree = (
44
46
  filterState: QueryBuilderFilterState,
45
47
  parentFilterNodeId: string | undefined,
46
48
  ): void => {
49
+ // NOTE: This checks if the expression is a simple function expression of Minus
50
+ // since negative numbers are returned as a SimpleFunctionExpression of minus(number)
51
+ // rather than a PrimitiveInstanceValue of -number, so here
52
+ // we replace the parameter value of the expression directly with a PrimitiveInstanceValue
53
+ if (
54
+ expression.parametersValues[1] instanceof SimpleFunctionExpression &&
55
+ expression.parametersValues[1].functionName === MINUS_STRING &&
56
+ expression.parametersValues[1].parametersValues[0] instanceof
57
+ PrimitiveInstanceValue
58
+ ) {
59
+ expression.parametersValues[1].parametersValues[0].values[0] =
60
+ parseFloat(
61
+ expression.parametersValues[1].parametersValues[0].values[0] as string,
62
+ ) * -1;
63
+ expression.parametersValues[1] =
64
+ expression.parametersValues[1].parametersValues[0];
65
+ }
66
+
47
67
  const parentNode = parentFilterNodeId
48
68
  ? filterState.getNode(parentFilterNodeId)
49
69
  : undefined;