@finos/legend-application-query 5.2.6 → 5.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/QueryBuilder.d.ts.map +1 -1
- package/lib/components/QueryBuilder.js +22 -11
- package/lib/components/QueryBuilder.js.map +1 -1
- package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderResultPanel.js +12 -7
- package/lib/components/QueryBuilderResultPanel.js.map +1 -1
- package/lib/components/QueryBuilderSetupPanel.js +1 -1
- package/lib/components/QueryBuilderSetupPanel.js.map +1 -1
- package/lib/components/explorer/QueryBuilderExplorerPanel.d.ts +1 -2
- package/lib/components/explorer/QueryBuilderExplorerPanel.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderExplorerPanel.js +14 -16
- package/lib/components/explorer/QueryBuilderExplorerPanel.js.map +1 -1
- package/lib/components/explorer/QueryBuilderPropertySearchPanel.js +2 -2
- package/lib/components/explorer/QueryBuilderPropertySearchPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.js +22 -105
- package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts +1 -2
- package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.js +8 -10
- package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +23 -17
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderProjectionPanel.d.ts +2 -2
- package/lib/components/fetch-structure/QueryBuilderProjectionPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderProjectionPanel.js +15 -12
- package/lib/components/fetch-structure/QueryBuilderProjectionPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts +2 -2
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +23 -28
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js.map +1 -1
- package/lib/components/filter/QueryBuilderFilterPanel.js +7 -7
- package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
- package/lib/components/shared/QueryBuilderPanelIssueCountBadge.d.ts.map +1 -1
- package/lib/components/shared/QueryBuilderPanelIssueCountBadge.js +1 -1
- package/lib/components/shared/QueryBuilderPanelIssueCountBadge.js.map +1 -1
- package/lib/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js +5 -3
- package/lib/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +7 -7
- package/lib/stores/QueryBuilderPreviewDataHelper.d.ts.map +1 -1
- package/lib/stores/QueryBuilderPreviewDataHelper.js +17 -14
- package/lib/stores/QueryBuilderPreviewDataHelper.js.map +1 -1
- package/lib/stores/QueryBuilderPropertyEditorState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderPropertyEditorState.js +34 -24
- package/lib/stores/QueryBuilderPropertyEditorState.js.map +1 -1
- package/lib/stores/QueryBuilderState.d.ts +1 -2
- package/lib/stores/QueryBuilderState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderState.js +17 -26
- package/lib/stores/QueryBuilderState.js.map +1 -1
- package/lib/stores/QueryBuilderStateBuilder.d.ts +124 -0
- package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -0
- package/lib/stores/QueryBuilderStateBuilder.js +310 -0
- package/lib/stores/QueryBuilderStateBuilder.js.map +1 -0
- package/lib/stores/{QueryBuilderTestUtils.d.ts → QueryBuilderStateTestUtils.d.ts} +2 -2
- package/lib/stores/QueryBuilderStateTestUtils.d.ts.map +1 -0
- package/lib/stores/{QueryBuilderTestUtils.js → QueryBuilderStateTestUtils.js} +2 -2
- package/lib/stores/QueryBuilderStateTestUtils.js.map +1 -0
- package/lib/stores/QueryBuilderTypeaheadHelper.d.ts.map +1 -1
- package/lib/stores/QueryBuilderTypeaheadHelper.js +14 -12
- package/lib/stores/QueryBuilderTypeaheadHelper.js.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts +3 -11
- package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.js +10 -319
- package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts +27 -0
- package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts.map +1 -0
- package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js +153 -0
- package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js.map +1 -0
- package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts +37 -1
- package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationHelper.js +79 -2
- package/lib/stores/QueryBuilderValueSpecificationHelper.js.map +1 -1
- package/lib/stores/explorer/QueryBuilderExplorerState.d.ts +12 -11
- package/lib/stores/explorer/QueryBuilderExplorerState.d.ts.map +1 -1
- package/lib/stores/explorer/QueryBuilderExplorerState.js +53 -20
- package/lib/stores/explorer/QueryBuilderExplorerState.js.map +1 -1
- package/lib/stores/explorer/QueryBuilderPropertySearchPanelState.d.ts +1 -1
- package/lib/stores/explorer/QueryBuilderPropertySearchPanelState.d.ts.map +1 -1
- package/lib/stores/explorer/QueryBuilderPropertySearchPanelState.js +3 -1
- package/lib/stores/explorer/QueryBuilderPropertySearchPanelState.js.map +1 -1
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts +17 -0
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js +10 -0
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js.map +1 -1
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.d.ts +3 -20
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.js +31 -73
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureState.js.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts +17 -4
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js +110 -21
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts +20 -0
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts.map +1 -0
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js +62 -0
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js.map +1 -0
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.d.ts +2 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.d.ts.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.js +3 -8
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.js.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchValueSpecificationBuilder.d.ts +9 -2
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchValueSpecificationBuilder.js +28 -5
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionColumnState.js +2 -2
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionColumnState.js.map +1 -1
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionState.d.ts +10 -2
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionState.js +102 -39
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionState.js.map +1 -1
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionStateBuilder.d.ts +25 -0
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionStateBuilder.d.ts.map +1 -0
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionStateBuilder.js +186 -0
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionStateBuilder.js.map +1 -0
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionValueSpecificationBuilder.d.ts +9 -4
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionValueSpecificationBuilder.js +129 -13
- package/lib/stores/fetch-structure/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/projection/aggregation/QueryBuilderAggregationStateBuilder.d.ts +20 -0
- package/lib/stores/fetch-structure/projection/aggregation/QueryBuilderAggregationStateBuilder.d.ts.map +1 -0
- package/lib/stores/fetch-structure/projection/aggregation/QueryBuilderAggregationStateBuilder.js +96 -0
- package/lib/stores/fetch-structure/projection/aggregation/QueryBuilderAggregationStateBuilder.js.map +1 -0
- package/lib/stores/fetch-structure/projection/aggregation/operators/QueryBuilderAggregateOperator_DistinctCount.js +1 -1
- package/lib/stores/fetch-structure/projection/aggregation/operators/QueryBuilderAggregateOperator_DistinctCount.js.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/{QueryBuilderPostFilterValueSpecificationProcessor.d.ts → QueryBuilderPostFilterStateBuilder.d.ts} +4 -3
- package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterStateBuilder.d.ts.map +1 -0
- package/lib/stores/fetch-structure/projection/post-filter/{QueryBuilderPostFilterValueSpecificationProcessor.js → QueryBuilderPostFilterStateBuilder.js} +30 -21
- package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterStateBuilder.js.map +1 -0
- package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.js +1 -4
- package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.js +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.js.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_In.js +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_In.js.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.js +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.js.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.js +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.js.map +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js +1 -1
- package/lib/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterStateBuilder.d.ts +19 -0
- package/lib/stores/filter/QueryBuilderFilterStateBuilder.d.ts.map +1 -0
- package/lib/stores/filter/QueryBuilderFilterStateBuilder.js +74 -0
- package/lib/stores/filter/QueryBuilderFilterStateBuilder.js.map +1 -0
- package/lib/stores/filter/{QueryBuilderValueSpecificationBuilder.d.ts → QueryBuilderFilterValueSpecificationBuilder.d.ts} +1 -1
- package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.d.ts.map +1 -0
- package/lib/stores/filter/{QueryBuilderValueSpecificationBuilder.js → QueryBuilderFilterValueSpecificationBuilder.js} +1 -1
- package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js.map +1 -0
- package/lib/stores/filter/operators/QueryBuilderFilterOperatorHelper.d.ts.map +1 -1
- package/lib/stores/filter/operators/QueryBuilderFilterOperatorHelper.js +5 -5
- package/lib/stores/filter/operators/QueryBuilderFilterOperatorHelper.js.map +1 -1
- package/package.json +14 -14
- package/src/components/QueryBuilder.tsx +47 -28
- package/src/components/QueryBuilderResultPanel.tsx +21 -14
- package/src/components/QueryBuilderSetupPanel.tsx +1 -1
- package/src/components/explorer/QueryBuilderExplorerPanel.tsx +23 -38
- package/src/components/explorer/QueryBuilderPropertySearchPanel.tsx +2 -2
- package/src/components/fetch-structure/QueryBuilderFetchStructurePanel.tsx +41 -175
- package/src/components/fetch-structure/QueryBuilderGraphFetchTreePanel.tsx +9 -12
- package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +62 -28
- package/src/components/fetch-structure/QueryBuilderProjectionPanel.tsx +74 -48
- package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +33 -41
- package/src/components/filter/QueryBuilderFilterPanel.tsx +7 -7
- package/src/components/shared/QueryBuilderPanelIssueCountBadge.tsx +3 -1
- package/src/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.ts +5 -8
- package/src/stores/QueryBuilderPreviewDataHelper.ts +27 -18
- package/src/stores/QueryBuilderPropertyEditorState.ts +40 -31
- package/src/stores/QueryBuilderState.ts +26 -32
- package/src/stores/QueryBuilderStateBuilder.ts +584 -0
- package/src/stores/{QueryBuilderTestUtils.ts → QueryBuilderStateTestUtils.ts} +1 -1
- package/src/stores/QueryBuilderTypeaheadHelper.ts +23 -16
- package/src/stores/QueryBuilderValueSpecificationBuilder.ts +24 -584
- package/src/stores/QueryBuilderValueSpecificationBuilderHelper.ts +248 -0
- package/src/stores/QueryBuilderValueSpecificationHelper.ts +114 -0
- package/src/stores/explorer/QueryBuilderExplorerState.ts +73 -33
- package/src/stores/explorer/QueryBuilderPropertySearchPanelState.ts +3 -1
- package/src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts +33 -2
- package/src/stores/fetch-structure/QueryBuilderFetchStructureState.ts +53 -118
- package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts +166 -26
- package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts +131 -0
- package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.ts +10 -19
- package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchValueSpecificationBuilder.ts +68 -4
- package/src/stores/fetch-structure/projection/QueryBuilderProjectionColumnState.ts +2 -2
- package/src/stores/fetch-structure/projection/QueryBuilderProjectionState.ts +172 -67
- package/src/stores/fetch-structure/projection/QueryBuilderProjectionStateBuilder.ts +426 -0
- package/src/stores/fetch-structure/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +266 -21
- package/src/stores/fetch-structure/projection/aggregation/QueryBuilderAggregationStateBuilder.ts +228 -0
- package/src/stores/fetch-structure/projection/aggregation/operators/QueryBuilderAggregateOperator_DistinctCount.ts +1 -1
- package/src/stores/fetch-structure/projection/post-filter/{QueryBuilderPostFilterValueSpecificationProcessor.ts → QueryBuilderPostFilterStateBuilder.ts} +68 -48
- package/src/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationBuilder.ts +1 -11
- package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Contain.ts +1 -1
- package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.ts +1 -1
- package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_Equal.ts +1 -1
- package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.ts +1 -1
- package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.ts +1 -1
- package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_In.ts +1 -1
- package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.ts +1 -1
- package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.ts +1 -1
- package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.ts +1 -1
- package/src/stores/fetch-structure/projection/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.ts +1 -1
- package/src/stores/filter/QueryBuilderFilterStateBuilder.ts +155 -0
- package/src/stores/filter/{QueryBuilderValueSpecificationBuilder.ts → QueryBuilderFilterValueSpecificationBuilder.ts} +0 -0
- package/src/stores/filter/operators/QueryBuilderFilterOperatorHelper.ts +5 -5
- package/tsconfig.json +10 -5
- package/tsconfig.package.json +1 -1
- package/lib/stores/QueryBuilderTestUtils.d.ts.map +0 -1
- package/lib/stores/QueryBuilderTestUtils.js.map +0 -1
- package/lib/stores/QueryBuilderValueSpecificationProcessor.d.ts +0 -56
- package/lib/stores/QueryBuilderValueSpecificationProcessor.d.ts.map +0 -1
- package/lib/stores/QueryBuilderValueSpecificationProcessor.js +0 -548
- package/lib/stores/QueryBuilderValueSpecificationProcessor.js.map +0 -1
- package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationProcessor.d.ts.map +0 -1
- package/lib/stores/fetch-structure/projection/post-filter/QueryBuilderPostFilterValueSpecificationProcessor.js.map +0 -1
- package/lib/stores/filter/QueryBuilderValueSpecificationBuilder.d.ts.map +0 -1
- package/lib/stores/filter/QueryBuilderValueSpecificationBuilder.js.map +0 -1
- package/src/stores/QueryBuilderValueSpecificationProcessor.ts +0 -1254
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"QueryBuilderFetchStructureImplementationState.d.ts","sourceRoot":"","sources":["../../../src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAE5F,8BAAsB,6CAA6C;IACjE,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,mBAAmB,EAAE,+BAA+B,CAAC;gBAGnD,iBAAiB,EAAE,iBAAiB,EACpC,mBAAmB,EAAE,+BAA+B;
|
1
|
+
{"version":3,"file":"QueryBuilderFetchStructureImplementationState.d.ts","sourceRoot":"","sources":["../../../src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,KAAK,EACL,gBAAgB,EAChB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,wCAAwC,EAAE,MAAM,0CAA0C,CAAC;AACzG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AACrG,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAE5F,oBAAY,8BAA8B;IACxC,UAAU,eAAe;IACzB,WAAW,gBAAgB;CAC5B;AAED,8BAAsB,6CAA6C;IACjE,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,mBAAmB,EAAE,+BAA+B,CAAC;gBAGnD,iBAAiB,EAAE,iBAAiB,EACpC,mBAAmB,EAAE,+BAA+B;IAWtD,QAAQ,KAAK,IAAI,IAAI,MAAM,CAAC;IAC5B,QAAQ,KAAK,+BAA+B,IAAI,MAAM,EAAE,CAAC;IACzD,QAAQ,KAAK,gBAAgB,IAAI,MAAM,EAAE,GAAG,SAAS,CAAC;IACtD,QAAQ,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,GAAG,SAAS,GAAG,IAAI;IACvD,QAAQ,CAAC,sBAAsB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO;IAC5E,QAAQ,CAAC,qBAAqB,IAAI,IAAI;IACtC,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,wCAAwC,GAAG,IAAI;IAC5E,QAAQ,CAAC,eAAe,CACtB,KAAK,EAAE,wCAAwC,EAAE,GAChD,IAAI;IACP,QAAQ,CAAC,iCAAiC,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IACtE,QAAQ,CAAC,oBAAoB,CAC3B,cAAc,EAAE,cAAc,EAC9B,OAAO,CAAC,EAAE,2BAA2B,GACpC,IAAI;CACR"}
|
@@ -13,10 +13,20 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
+
import { computed, makeObservable } from 'mobx';
|
17
|
+
export var FETCH_STRUCTURE_IMPLEMENTATION;
|
18
|
+
(function (FETCH_STRUCTURE_IMPLEMENTATION) {
|
19
|
+
FETCH_STRUCTURE_IMPLEMENTATION["PROJECTION"] = "PROJECTION";
|
20
|
+
FETCH_STRUCTURE_IMPLEMENTATION["GRAPH_FETCH"] = "GRAPH_FETCH";
|
21
|
+
})(FETCH_STRUCTURE_IMPLEMENTATION = FETCH_STRUCTURE_IMPLEMENTATION || (FETCH_STRUCTURE_IMPLEMENTATION = {}));
|
16
22
|
export class QueryBuilderFetchStructureImplementationState {
|
17
23
|
queryBuilderState;
|
18
24
|
fetchStructureState;
|
19
25
|
constructor(queryBuilderState, fetchStructureState) {
|
26
|
+
makeObservable(this, {
|
27
|
+
usedExplorerTreePropertyNodeIDs: computed,
|
28
|
+
validationIssues: computed,
|
29
|
+
});
|
20
30
|
this.queryBuilderState = queryBuilderState;
|
21
31
|
this.fetchStructureState = fetchStructureState;
|
22
32
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"QueryBuilderFetchStructureImplementationState.js","sourceRoot":"","sources":["../../../src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
1
|
+
{"version":3,"file":"QueryBuilderFetchStructureImplementationState.js","sourceRoot":"","sources":["../../../src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAOH,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAMhD,MAAM,CAAN,IAAY,8BAGX;AAHD,WAAY,8BAA8B;IACxC,2DAAyB,CAAA;IACzB,6DAA2B,CAAA;AAC7B,CAAC,EAHW,8BAA8B,GAA9B,8BAA8B,KAA9B,8BAA8B,QAGzC;AAED,MAAM,OAAgB,6CAA6C;IACjE,iBAAiB,CAAoB;IACrC,mBAAmB,CAAkC;IAErD,YACE,iBAAoC,EACpC,mBAAoD;QAEpD,cAAc,CAAC,IAAI,EAAE;YACnB,+BAA+B,EAAE,QAAQ;YACzC,gBAAgB,EAAE,QAAQ;SAC3B,CAAC,CAAC;QAEH,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;IACjD,CAAC;CAiBF"}
|
@@ -14,31 +14,14 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
import type { QueryBuilderState } from '../QueryBuilderState.js';
|
17
|
-
import { QueryBuilderGraphFetchTreeState } from './graph-fetch/QueryBuilderGraphFetchTreeState.js';
|
18
|
-
import { QueryBuilderProjectionState } from './projection/QueryBuilderProjectionState.js';
|
19
17
|
import { type QueryBuilderExplorerTreeNodeData } from '../explorer/QueryBuilderExplorerState.js';
|
20
|
-
|
21
|
-
PROJECTION = "PROJECTION",
|
22
|
-
GRAPH_FETCH = "GRAPH_FETCH"
|
23
|
-
}
|
18
|
+
import { type QueryBuilderFetchStructureImplementationState } from './QueryBuilderFetchStructureImplementationState.js';
|
24
19
|
export declare class QueryBuilderFetchStructureState {
|
25
20
|
queryBuilderState: QueryBuilderState;
|
26
|
-
|
27
|
-
* TODO: refactor this so we could reduce this to
|
28
|
-
* `implementationState: QueryBuilderFetchStructureImplementationState`
|
29
|
-
* so we don't have graph fetch and projection at the same time
|
30
|
-
*
|
31
|
-
* TODO?: perhaps it would eventually make sense to default to
|
32
|
-
* graph-fetch since `getAll()` naturally works for graph-fetch case
|
33
|
-
* and graph-fetch allows somewhat an empty tree
|
34
|
-
*/
|
35
|
-
fetchStructureMode: FETCH_STRUCTURE_MODE;
|
36
|
-
projectionState: QueryBuilderProjectionState;
|
37
|
-
graphFetchTreeState: QueryBuilderGraphFetchTreeState;
|
21
|
+
implementation: QueryBuilderFetchStructureImplementationState;
|
38
22
|
constructor(queryBuilderState: QueryBuilderState);
|
39
|
-
|
23
|
+
changeImplementation(type: string): void;
|
40
24
|
fetchProperty(node: QueryBuilderExplorerTreeNodeData): void;
|
41
25
|
fetchNodeChildrenProperties(node: QueryBuilderExplorerTreeNodeData): void;
|
42
|
-
get validationIssues(): string[] | undefined;
|
43
26
|
}
|
44
27
|
//# sourceMappingURL=QueryBuilderFetchStructureState.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"QueryBuilderFetchStructureState.d.ts","sourceRoot":"","sources":["../../../src/stores/fetch-structure/QueryBuilderFetchStructureState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;
|
1
|
+
{"version":3,"file":"QueryBuilderFetchStructureState.d.ts","sourceRoot":"","sources":["../../../src/stores/fetch-structure/QueryBuilderFetchStructureState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAGjE,OAAO,EACL,KAAK,gCAAgC,EAEtC,MAAM,0CAA0C,CAAC;AAGlD,OAAO,EAEL,KAAK,6CAA6C,EACnD,MAAM,oDAAoD,CAAC;AAE5D,qBAAa,+BAA+B;IAC1C,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,cAAc,EAAE,6CAA6C,CAAC;gBAElD,iBAAiB,EAAE,iBAAiB;IAoBhD,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAuBxC,aAAa,CAAC,IAAI,EAAE,gCAAgC,GAAG,IAAI;IAS3D,2BAA2B,CAAC,IAAI,EAAE,gCAAgC,GAAG,IAAI;CAoB1E"}
|
@@ -16,100 +16,58 @@
|
|
16
16
|
import { action, makeAutoObservable } from 'mobx';
|
17
17
|
import { QueryBuilderGraphFetchTreeState } from './graph-fetch/QueryBuilderGraphFetchTreeState.js';
|
18
18
|
import { QueryBuilderProjectionState } from './projection/QueryBuilderProjectionState.js';
|
19
|
-
import {
|
19
|
+
import { QueryBuilderExplorerTreePropertyNodeData, } from '../explorer/QueryBuilderExplorerState.js';
|
20
20
|
import { Class } from '@finos/legend-graph';
|
21
|
-
import { filterByType } from '@finos/legend-shared';
|
22
|
-
import {
|
23
|
-
import { QueryBuilderSimpleProjectionColumnState } from './projection/QueryBuilderProjectionColumnState.js';
|
24
|
-
export var FETCH_STRUCTURE_MODE;
|
25
|
-
(function (FETCH_STRUCTURE_MODE) {
|
26
|
-
FETCH_STRUCTURE_MODE["PROJECTION"] = "PROJECTION";
|
27
|
-
FETCH_STRUCTURE_MODE["GRAPH_FETCH"] = "GRAPH_FETCH";
|
28
|
-
})(FETCH_STRUCTURE_MODE = FETCH_STRUCTURE_MODE || (FETCH_STRUCTURE_MODE = {}));
|
21
|
+
import { filterByType, UnsupportedOperationError } from '@finos/legend-shared';
|
22
|
+
import { FETCH_STRUCTURE_IMPLEMENTATION, } from './QueryBuilderFetchStructureImplementationState.js';
|
29
23
|
export class QueryBuilderFetchStructureState {
|
30
24
|
queryBuilderState;
|
31
|
-
|
32
|
-
* TODO: refactor this so we could reduce this to
|
33
|
-
* `implementationState: QueryBuilderFetchStructureImplementationState`
|
34
|
-
* so we don't have graph fetch and projection at the same time
|
35
|
-
*
|
36
|
-
* TODO?: perhaps it would eventually make sense to default to
|
37
|
-
* graph-fetch since `getAll()` naturally works for graph-fetch case
|
38
|
-
* and graph-fetch allows somewhat an empty tree
|
39
|
-
*/
|
40
|
-
fetchStructureMode = FETCH_STRUCTURE_MODE.PROJECTION;
|
41
|
-
projectionState;
|
42
|
-
graphFetchTreeState;
|
25
|
+
implementation;
|
43
26
|
constructor(queryBuilderState) {
|
44
27
|
makeAutoObservable(this, {
|
45
28
|
queryBuilderState: false,
|
46
|
-
|
29
|
+
changeImplementation: action,
|
47
30
|
});
|
48
31
|
this.queryBuilderState = queryBuilderState;
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
32
|
+
/**
|
33
|
+
* TODO?: perhaps it would eventually make sense to default to
|
34
|
+
* graph-fetch since `getAll()` naturally works for graph-fetch case
|
35
|
+
* and graph-fetch allows somewhat an empty tree
|
36
|
+
*
|
37
|
+
* TODO?: we could consider making this configurable
|
38
|
+
*/
|
39
|
+
this.implementation = new QueryBuilderProjectionState(this.queryBuilderState, this);
|
53
40
|
}
|
54
|
-
|
55
|
-
|
41
|
+
changeImplementation(type) {
|
42
|
+
switch (type) {
|
43
|
+
case FETCH_STRUCTURE_IMPLEMENTATION.PROJECTION: {
|
44
|
+
this.implementation = new QueryBuilderProjectionState(this.queryBuilderState, this);
|
45
|
+
return;
|
46
|
+
}
|
47
|
+
case FETCH_STRUCTURE_IMPLEMENTATION.GRAPH_FETCH: {
|
48
|
+
this.implementation = new QueryBuilderGraphFetchTreeState(this.queryBuilderState, this);
|
49
|
+
return;
|
50
|
+
}
|
51
|
+
default:
|
52
|
+
throw new UnsupportedOperationError(`Can't change fetch-structure implementation to unsupported type: '${type}'`);
|
53
|
+
}
|
56
54
|
}
|
57
55
|
fetchProperty(node) {
|
58
56
|
if (node instanceof QueryBuilderExplorerTreePropertyNodeData &&
|
59
57
|
!(node.type instanceof Class)) {
|
60
|
-
|
61
|
-
case FETCH_STRUCTURE_MODE.GRAPH_FETCH: {
|
62
|
-
this.graphFetchTreeState.addProperty(node);
|
63
|
-
return;
|
64
|
-
}
|
65
|
-
case FETCH_STRUCTURE_MODE.PROJECTION: {
|
66
|
-
this.projectionState.addColumn(new QueryBuilderSimpleProjectionColumnState(this.projectionState, buildPropertyExpressionFromExplorerTreeNodeData(this.queryBuilderState.explorerState.nonNullableTreeData, node, this.queryBuilderState.graphManagerState.graph, this.queryBuilderState.explorerState.propertySearchPanelState
|
67
|
-
.allMappedPropertyNodes), this.queryBuilderState.explorerState.humanizePropertyName));
|
68
|
-
return;
|
69
|
-
}
|
70
|
-
default:
|
71
|
-
return;
|
72
|
-
}
|
58
|
+
this.implementation.fetchProperty(node);
|
73
59
|
}
|
74
60
|
}
|
75
61
|
fetchNodeChildrenProperties(node) {
|
76
62
|
if (node.type instanceof Class) {
|
63
|
+
this.implementation.fetchProperties(
|
77
64
|
// NOTE: here we require the node to already been expanded so the child nodes are generated
|
78
65
|
// we don't allow adding unopened node. Maybe if it helps, we can show a warning.
|
79
|
-
|
66
|
+
node.childrenIds
|
80
67
|
.map((childId) => this.queryBuilderState.explorerState.nonNullableTreeData.nodes.get(childId))
|
81
68
|
.filter(filterByType(QueryBuilderExplorerTreePropertyNodeData))
|
82
|
-
.filter((childNode) => !(childNode.type instanceof Class) &&
|
83
|
-
|
84
|
-
case FETCH_STRUCTURE_MODE.GRAPH_FETCH: {
|
85
|
-
const graphFetchTreeData = this.graphFetchTreeState.treeData;
|
86
|
-
if (graphFetchTreeData) {
|
87
|
-
nodesToAdd.forEach((nodeToAdd) => addQueryBuilderPropertyNode(graphFetchTreeData, this.queryBuilderState.explorerState.nonNullableTreeData, nodeToAdd, this.queryBuilderState));
|
88
|
-
this.graphFetchTreeState.setGraphFetchTree({
|
89
|
-
...graphFetchTreeData,
|
90
|
-
});
|
91
|
-
}
|
92
|
-
return;
|
93
|
-
}
|
94
|
-
case FETCH_STRUCTURE_MODE.PROJECTION: {
|
95
|
-
nodesToAdd.forEach((nodeToAdd) => {
|
96
|
-
this.projectionState.addColumn(new QueryBuilderSimpleProjectionColumnState(this.projectionState, buildPropertyExpressionFromExplorerTreeNodeData(this.queryBuilderState.explorerState.nonNullableTreeData, nodeToAdd, this.queryBuilderState.graphManagerState.graph, this.queryBuilderState.explorerState.propertySearchPanelState
|
97
|
-
.allMappedPropertyNodes), this.queryBuilderState.explorerState.humanizePropertyName));
|
98
|
-
});
|
99
|
-
return;
|
100
|
-
}
|
101
|
-
default:
|
102
|
-
return;
|
103
|
-
}
|
104
|
-
}
|
105
|
-
}
|
106
|
-
get validationIssues() {
|
107
|
-
switch (this.fetchStructureMode) {
|
108
|
-
case FETCH_STRUCTURE_MODE.PROJECTION:
|
109
|
-
return this.projectionState.validationIssues;
|
110
|
-
case FETCH_STRUCTURE_MODE.GRAPH_FETCH:
|
111
|
-
default:
|
112
|
-
return undefined;
|
69
|
+
.filter((childNode) => !(childNode.type instanceof Class) &&
|
70
|
+
childNode.mappingData.mapped));
|
113
71
|
}
|
114
72
|
}
|
115
73
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"QueryBuilderFetchStructureState.js","sourceRoot":"","sources":["../../../src/stores/fetch-structure/QueryBuilderFetchStructureState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAElD,OAAO,EAAE,+BAA+B,EAAE,MAAM,kDAAkD,CAAC;AACnG,OAAO,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,
|
1
|
+
{"version":3,"file":"QueryBuilderFetchStructureState.js","sourceRoot":"","sources":["../../../src/stores/fetch-structure/QueryBuilderFetchStructureState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,EAAE,kBA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wC;YACxD,CAAC,CAAC,IAAI,CAAC,IAAI,YAAY,KAAK,CAAC,EAC7B;YACA,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;SACzC;IACH,CAAC;IAED,2BAA2B,CAAC,IAAsC;QAChE,IAAI,IAAI,CAAC,IAAI,YAAY,KAAK,EAAE;YAC9B,IAAI,CAAC,cAAc,CAAC,eAAe;YACjC,2FAA2F;YAC3F,iFAAiF;YACjF,IAAI,CAAC,WAAW;iBACb,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CACf,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAChE,OAAO,CACR,CACF;iBACA,MAAM,CAAC,YAAY,CAAC,wCAAwC,CAAC,CAAC;iBAC9D,MAAM,CACL,CAAC,SAAS,EAAE,EAAE,CACZ,CAAC,CAAC,SAAS,CAAC,IAAI,YAAY,KAAK,CAAC;gBAClC,SAAS,CAAC,WAAW,CAAC,MAAM,CAC/B,CACJ,CAAC;SACH;IACH,CAAC;CACF"}
|
@@ -14,11 +14,12 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
import type { QueryBuilderState } from '../../QueryBuilderState.js';
|
17
|
-
import {
|
17
|
+
import { type CompilationError, type Class, type LambdaFunction } from '@finos/legend-graph';
|
18
18
|
import { type QueryBuilderGraphFetchTreeData } from './QueryBuilderGraphFetchTreeUtil.js';
|
19
|
-
import type
|
19
|
+
import { type QueryBuilderExplorerTreePropertyNodeData } from '../../explorer/QueryBuilderExplorerState.js';
|
20
20
|
import { QueryBuilderFetchStructureImplementationState } from '../QueryBuilderFetchStructureImplementationState.js';
|
21
21
|
import type { QueryBuilderFetchStructureState } from '../QueryBuilderFetchStructureState.js';
|
22
|
+
import type { LambdaFunctionBuilderOption } from '../../QueryBuilderValueSpecificationBuilderHelper.js';
|
22
23
|
export declare class QueryBuilderGraphFetchTreeState extends QueryBuilderFetchStructureImplementationState {
|
23
24
|
treeData?: QueryBuilderGraphFetchTreeData | undefined;
|
24
25
|
/**
|
@@ -28,9 +29,21 @@ export declare class QueryBuilderGraphFetchTreeState extends QueryBuilderFetchSt
|
|
28
29
|
*/
|
29
30
|
isChecked: boolean;
|
30
31
|
constructor(queryBuilderState: QueryBuilderState, fetchStructureState: QueryBuilderFetchStructureState);
|
32
|
+
get type(): string;
|
33
|
+
get usedExplorerTreePropertyNodeIDs(): string[];
|
34
|
+
get validationIssues(): string[] | undefined;
|
31
35
|
setGraphFetchTree(val: QueryBuilderGraphFetchTreeData | undefined): void;
|
32
36
|
setChecked(val: boolean): void;
|
33
|
-
|
34
|
-
|
37
|
+
private updateTreeData;
|
38
|
+
onClassChange(_class: Class | undefined): void;
|
39
|
+
appendFetchStructure(lambdaFunction: LambdaFunction, options?: LambdaFunctionBuilderOption): void;
|
40
|
+
addProperty(node: QueryBuilderExplorerTreePropertyNodeData, options?: {
|
41
|
+
refreshTreeData?: boolean;
|
42
|
+
}): void;
|
43
|
+
revealCompilationError(compilationError: CompilationError): boolean;
|
44
|
+
clearCompilationError(): void;
|
45
|
+
fetchProperty(node: QueryBuilderExplorerTreePropertyNodeData): void;
|
46
|
+
fetchProperties(nodes: QueryBuilderExplorerTreePropertyNodeData[]): void;
|
47
|
+
checkBeforeChangingImplementation(onChange: () => void): void;
|
35
48
|
}
|
36
49
|
//# sourceMappingURL=QueryBuilderGraphFetchTreeState.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"QueryBuilderGraphFetchTreeState.d.ts","sourceRoot":"","sources":["../../../../src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,OAAO,
|
1
|
+
{"version":3,"file":"QueryBuilderGraphFetchTreeState.d.ts","sourceRoot":"","sources":["../../../../src/stores/fetch-struct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C;KAC3B,GACA,IAAI;IAkBP,sBAAsB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO;IAInE,qBAAqB,IAAI,IAAI;IAI7B,aAAa,CAAC,IAAI,EAAE,wCAAwC,GAAG,IAAI;IAInE,eAAe,CAAC,KAAK,EAAE,wCAAwC,EAAE,GAAG,IAAI;IAaxE,iCAAiC,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;CA0B9D"}
|
@@ -14,10 +14,13 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
import { action, makeObservable, observable } from 'mobx';
|
17
|
-
import { PackageableElementExplicitReference, RootGraphFetchTree, } from '@finos/legend-graph';
|
17
|
+
import { PackageableElementExplicitReference, RootGraphFetchTree, getAllSuperclasses, } from '@finos/legend-graph';
|
18
18
|
import { addQueryBuilderPropertyNode, buildGraphFetchTreeData, } from './QueryBuilderGraphFetchTreeUtil.js';
|
19
|
-
import {
|
20
|
-
import { QueryBuilderFetchStructureImplementationState } from '../QueryBuilderFetchStructureImplementationState.js';
|
19
|
+
import { generateExplorerTreePropertyNodeID, generateExplorerTreeSubtypeNodeID, } from '../../explorer/QueryBuilderExplorerState.js';
|
20
|
+
import { FETCH_STRUCTURE_IMPLEMENTATION, QueryBuilderFetchStructureImplementationState, } from '../QueryBuilderFetchStructureImplementationState.js';
|
21
|
+
import { ActionAlertActionType, ActionAlertType, } from '@finos/legend-application';
|
22
|
+
import { appendGraphFetch } from './QueryBuilderGraphFetchValueSpecificationBuilder.js';
|
23
|
+
import { guaranteeNonNullable } from '@finos/legend-shared';
|
21
24
|
export class QueryBuilderGraphFetchTreeState extends QueryBuilderFetchStructureImplementationState {
|
22
25
|
treeData;
|
23
26
|
/**
|
@@ -29,11 +32,57 @@ export class QueryBuilderGraphFetchTreeState extends QueryBuilderFetchStructureI
|
|
29
32
|
constructor(queryBuilderState, fetchStructureState) {
|
30
33
|
super(queryBuilderState, fetchStructureState);
|
31
34
|
makeObservable(this, {
|
32
|
-
treeData: observable,
|
35
|
+
treeData: observable.ref,
|
33
36
|
isChecked: observable,
|
34
37
|
setGraphFetchTree: action,
|
35
38
|
setChecked: action,
|
36
39
|
});
|
40
|
+
// try to initialize the graph-fetch tree data using the setup class
|
41
|
+
this.updateTreeData(this.queryBuilderState.querySetupState._class);
|
42
|
+
}
|
43
|
+
get type() {
|
44
|
+
return FETCH_STRUCTURE_IMPLEMENTATION.GRAPH_FETCH;
|
45
|
+
}
|
46
|
+
get usedExplorerTreePropertyNodeIDs() {
|
47
|
+
if (!this.treeData) {
|
48
|
+
return [];
|
49
|
+
}
|
50
|
+
const explorerTreeNodeIDIndex = new Map();
|
51
|
+
const ids = [];
|
52
|
+
// traverse in breadth-first fashion
|
53
|
+
const nodesToProcess = this.treeData.rootIds.slice();
|
54
|
+
while (nodesToProcess.length) {
|
55
|
+
const currentNodeID = guaranteeNonNullable(nodesToProcess[0]);
|
56
|
+
const node = this.treeData.nodes.get(currentNodeID);
|
57
|
+
if (!node) {
|
58
|
+
continue;
|
59
|
+
}
|
60
|
+
let nodeID;
|
61
|
+
const parentNodeID = node.parentId
|
62
|
+
? // since we traverse the nodes in order, parent node ID should already been computed
|
63
|
+
guaranteeNonNullable(explorerTreeNodeIDIndex.get(node.parentId))
|
64
|
+
: '';
|
65
|
+
const propertyNodeID = generateExplorerTreePropertyNodeID(parentNodeID, node.tree.property.value.name);
|
66
|
+
ids.push(propertyNodeID);
|
67
|
+
if (node.tree.subType) {
|
68
|
+
nodeID = generateExplorerTreeSubtypeNodeID(propertyNodeID, node.tree.subType.value.path);
|
69
|
+
getAllSuperclasses(node.tree.subType.value)
|
70
|
+
.concat(node.tree.subType.value)
|
71
|
+
.forEach((_class) => ids.push(generateExplorerTreeSubtypeNodeID(propertyNodeID, _class.path)));
|
72
|
+
}
|
73
|
+
else {
|
74
|
+
nodeID = propertyNodeID;
|
75
|
+
}
|
76
|
+
explorerTreeNodeIDIndex.set(node.id, nodeID);
|
77
|
+
// update list of nodes to process
|
78
|
+
nodesToProcess.shift();
|
79
|
+
node.childrenIds.forEach((childId) => nodesToProcess.push(childId));
|
80
|
+
}
|
81
|
+
// de-duplicate
|
82
|
+
return Array.from(new Set(ids).values());
|
83
|
+
}
|
84
|
+
get validationIssues() {
|
85
|
+
return undefined;
|
37
86
|
}
|
38
87
|
setGraphFetchTree(val) {
|
39
88
|
this.treeData = val;
|
@@ -41,28 +90,68 @@ export class QueryBuilderGraphFetchTreeState extends QueryBuilderFetchStructureI
|
|
41
90
|
setChecked(val) {
|
42
91
|
this.isChecked = val;
|
43
92
|
}
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
93
|
+
updateTreeData(_class) {
|
94
|
+
this.setGraphFetchTree(_class
|
95
|
+
? buildGraphFetchTreeData(new RootGraphFetchTree(PackageableElementExplicitReference.create(_class)))
|
96
|
+
: undefined);
|
97
|
+
}
|
98
|
+
onClassChange(_class) {
|
99
|
+
this.updateTreeData(_class);
|
100
|
+
}
|
101
|
+
appendFetchStructure(lambdaFunction, options) {
|
102
|
+
appendGraphFetch(this, lambdaFunction, options);
|
103
|
+
}
|
104
|
+
addProperty(node, options) {
|
105
|
+
if (!this.treeData) {
|
106
|
+
this.queryBuilderState.applicationStore.notifyWarning(`Can't add property: graph-fetch tree has not been properly initialized`);
|
107
|
+
return;
|
48
108
|
}
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
this.setGraphFetchTree(buildGraphFetchTreeData(new RootGraphFetchTree(PackageableElementExplicitReference.create(_class))));
|
53
|
-
}
|
54
|
-
else {
|
55
|
-
this.setGraphFetchTree(undefined);
|
56
|
-
}
|
109
|
+
addQueryBuilderPropertyNode(this.treeData, this.queryBuilderState.explorerState.nonNullableTreeData, node, this.queryBuilderState);
|
110
|
+
if (options?.refreshTreeData) {
|
111
|
+
this.setGraphFetchTree({ ...this.treeData });
|
57
112
|
}
|
58
113
|
}
|
59
|
-
|
114
|
+
revealCompilationError(compilationError) {
|
115
|
+
return false;
|
116
|
+
}
|
117
|
+
clearCompilationError() {
|
118
|
+
return;
|
119
|
+
}
|
120
|
+
fetchProperty(node) {
|
121
|
+
this.addProperty(node, { refreshTreeData: true });
|
122
|
+
}
|
123
|
+
fetchProperties(nodes) {
|
60
124
|
if (!this.treeData) {
|
61
|
-
this.
|
125
|
+
this.queryBuilderState.applicationStore.notifyWarning(`Can't add property: graph-fetch tree has not been properly initialized`);
|
126
|
+
return;
|
127
|
+
}
|
128
|
+
nodes.forEach((nodeToAdd) => this.addProperty(nodeToAdd));
|
129
|
+
this.setGraphFetchTree({
|
130
|
+
...this.treeData,
|
131
|
+
});
|
132
|
+
}
|
133
|
+
checkBeforeChangingImplementation(onChange) {
|
134
|
+
if (this.treeData?.rootIds.length) {
|
135
|
+
this.queryBuilderState.applicationStore.setActionAlertInfo({
|
136
|
+
message: 'Current graph-fetch will be lost when switching to projection mode. Do you still want to proceed?',
|
137
|
+
type: ActionAlertType.CAUTION,
|
138
|
+
actions: [
|
139
|
+
{
|
140
|
+
label: 'Proceed',
|
141
|
+
type: ActionAlertActionType.PROCEED_WITH_CAUTION,
|
142
|
+
handler: this.queryBuilderState.applicationStore.guardUnhandledError(async () => onChange()),
|
143
|
+
},
|
144
|
+
{
|
145
|
+
label: 'Cancel',
|
146
|
+
type: ActionAlertActionType.PROCEED,
|
147
|
+
default: true,
|
148
|
+
},
|
149
|
+
],
|
150
|
+
});
|
151
|
+
}
|
152
|
+
else {
|
153
|
+
onChange();
|
62
154
|
}
|
63
|
-
assertNonNullable(this.treeData, `Graph-fetch tree has not been properly initialized`);
|
64
|
-
addQueryBuilderPropertyNode(this.treeData, this.queryBuilderState.explorerState.nonNullableTreeData, node, this.queryBuilderState);
|
65
|
-
this.setGraphFetchTree({ ...this.treeData });
|
66
155
|
}
|
67
156
|
}
|
68
157
|
//# sourceMappingURL=QueryBuilderGraphFetchTreeState.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"QueryBuilderGraphFetchTreeState.js","sourceRoot":"","sources":["../../../../src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,
|
1
|
+
{"version":3,"file":"QueryBuilderGraphFetchTreeState.js","sourceRoot":"","sources":["../../../../src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,EAEL,mCAAmC,EACnC,kBAAkB,EAGlB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,kCAAkC,EAClC,iCAAiC,GAElC,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,8BAA8B,EAC9B,6CAA6C,GAC9C,MAAM,qDAAqD,CAAC;AAE7D,OAAO,EACL,qBAAqB,EACrB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sDAAsD,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,OAAO,+BAAgC,SAAQ,6CAA6C;IAChG,QAAQ,CAA8C;IACtD;;;;OAIG;IACH,SAAS,GAAG,KAAK,CAAC;IAElB,YACE,iBAAoC,EACpC,mBAAoD;QAEpD,KAAK,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAAC;QAE9C,cAAc,CAAC,IAAI,EAAE;YACnB,QAAQ,EAAE,UAAU,CAAC,GAAG;YACxB,SAAS,EAAE,UAAU;YACrB,iBAAiB,EAAE,MAAM;YACzB,UAAU,EAAE,MAAM;SACnB,CAAC,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IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,kBAAkB,CAAC;gBACzD,OAAO,EACL,mGAAmG;gBACrG,IAAI,EAAE,eAAe,CAAC,OAAO;gBAC7B,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,SAAS;wBAChB,IAAI,EAAE,qBAAqB,CAAC,oBAAoB;wBAChD,OAAO,EACL,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,mBAAmB,CACzD,KAAK,IAAI,EAAE,CAAC,QAAQ,EAAE,CACvB;qBACJ;oBACD;wBACE,KAAK,EAAE,QAAQ;wBACf,IAAI,EAAE,qBAAqB,CAAC,OAAO;wBACnC,OAAO,EAAE,IAAI;qBACd;iBACF;aACF,CAAC,CAAC;SACJ;aAAM;YACL,QAAQ,EAAE,CAAC;SACZ;IACH,CAAC;CACF"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import { SimpleFunctionExpression } from '@finos/legend-graph';
|
17
|
+
import type { QueryBuilderState } from '../../QueryBuilderState.js';
|
18
|
+
export declare const processGraphFetchExpression: (expression: SimpleFunctionExpression, queryBuilderState: QueryBuilderState) => void;
|
19
|
+
export declare const processGraphFetchSerializeExpression: (expression: SimpleFunctionExpression, queryBuilderState: QueryBuilderState) => void;
|
20
|
+
//# sourceMappingURL=QueryBuilderGraphFetchTreeStateBuilder.d.ts.map
|
package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"QueryBuilderGraphFetchTreeStateBuilder.d.ts","sourceRoot":"","sources":["../../../../src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAIL,wBAAwB,EACzB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAMpE,eAAO,MAAM,2BAA2B,eAC1B,wBAAwB,qBACjB,iBAAiB,KACnC,IAyCF,CAAC;AAEF,eAAO,MAAM,oCAAoC,eACnC,wBAAwB,qBACjB,iBAAiB,KACnC,IAmDF,CAAC"}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import { GraphFetchTreeInstanceValue, matchFunctionName, RootGraphFetchTree, SimpleFunctionExpression, } from '@finos/legend-graph';
|
17
|
+
import { assertTrue, guaranteeType } from '@finos/legend-shared';
|
18
|
+
import { QUERY_BUILDER_SUPPORTED_FUNCTIONS } from '../../../QueryBuilder_Const.js';
|
19
|
+
import { QueryBuilderValueSpecificationProcessor } from '../../QueryBuilderStateBuilder.js';
|
20
|
+
import { FETCH_STRUCTURE_IMPLEMENTATION } from '../QueryBuilderFetchStructureImplementationState.js';
|
21
|
+
import { QueryBuilderGraphFetchTreeState } from './QueryBuilderGraphFetchTreeState.js';
|
22
|
+
import { buildGraphFetchTreeData } from './QueryBuilderGraphFetchTreeUtil.js';
|
23
|
+
export const processGraphFetchExpression = (expression, queryBuilderState) => {
|
24
|
+
const functionName = expression.functionName;
|
25
|
+
// check parameters
|
26
|
+
assertTrue(expression.parametersValues.length === 2, `Can't process ${functionName}() expression: ${functionName}() expects 1 argument`);
|
27
|
+
// check preceding expression
|
28
|
+
const precedingExpression = guaranteeType(expression.parametersValues[0], SimpleFunctionExpression, `Can't process ${functionName}() expression: only support ${functionName}() immediately following an expression`);
|
29
|
+
assertTrue(matchFunctionName(precedingExpression.functionName, [
|
30
|
+
QUERY_BUILDER_SUPPORTED_FUNCTIONS.FILTER,
|
31
|
+
QUERY_BUILDER_SUPPORTED_FUNCTIONS.GET_ALL,
|
32
|
+
]), `Can't process ${functionName}(): only support ${functionName}() immediately following either getAll() or filter()`);
|
33
|
+
QueryBuilderValueSpecificationProcessor.process(precedingExpression, queryBuilderState);
|
34
|
+
// build state
|
35
|
+
if (queryBuilderState.fetchStructureState.implementation instanceof
|
36
|
+
QueryBuilderGraphFetchTreeState) {
|
37
|
+
const graphFetchTreeState = queryBuilderState.fetchStructureState.implementation;
|
38
|
+
graphFetchTreeState.setChecked(matchFunctionName(expression.functionName, QUERY_BUILDER_SUPPORTED_FUNCTIONS.GRAPH_FETCH_CHECKED));
|
39
|
+
}
|
40
|
+
};
|
41
|
+
export const processGraphFetchSerializeExpression = (expression, queryBuilderState) => {
|
42
|
+
// update fetch-structure
|
43
|
+
queryBuilderState.fetchStructureState.changeImplementation(FETCH_STRUCTURE_IMPLEMENTATION.GRAPH_FETCH);
|
44
|
+
// check parameters
|
45
|
+
assertTrue(expression.parametersValues.length === 2, `Can't process serialize() expression: serialize() expects 1 argument`);
|
46
|
+
// check preceding expression
|
47
|
+
const precedingExpression = guaranteeType(expression.parametersValues[0], SimpleFunctionExpression, `Can't process serialize() expression: only support serialize() immediately following an expression`);
|
48
|
+
assertTrue(matchFunctionName(precedingExpression.functionName, [
|
49
|
+
QUERY_BUILDER_SUPPORTED_FUNCTIONS.GRAPH_FETCH,
|
50
|
+
QUERY_BUILDER_SUPPORTED_FUNCTIONS.GRAPH_FETCH_CHECKED,
|
51
|
+
]), `Can't process serialize() expression: only support serialize() in graph-fetch expression`);
|
52
|
+
QueryBuilderValueSpecificationProcessor.process(precedingExpression, queryBuilderState);
|
53
|
+
// build state
|
54
|
+
if (queryBuilderState.fetchStructureState.implementation instanceof
|
55
|
+
QueryBuilderGraphFetchTreeState) {
|
56
|
+
const graphFetchTreeState = queryBuilderState.fetchStructureState.implementation;
|
57
|
+
const graphFetchTree = guaranteeType(expression.parametersValues[1], GraphFetchTreeInstanceValue, `Can't process serialize() expression: serialize() graph-fetch is missing`);
|
58
|
+
const graphFetchTreeRoot = guaranteeType(graphFetchTree.values[0], RootGraphFetchTree, `Can't process serialize() expression: serialize() graph-fetch tree root is missing`);
|
59
|
+
graphFetchTreeState.setGraphFetchTree(buildGraphFetchTreeData(graphFetchTreeRoot));
|
60
|
+
}
|
61
|
+
};
|
62
|
+
//# sourceMappingURL=QueryBuilderGraphFetchTreeStateBuilder.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"QueryBuilderGraphFetchTreeStateBuilder.js","sourceRoot":"","sources":["../../../../src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,iCAAiC,EAAE,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ACpC,iBAAoC,EAC9B,EAAE;IACR,yBAAyB;IACzB,iBAAiB,CAAC,mBAAmB,CAAC,oBAAoB,CACxD,8BAA8B,CAAC,WAAW,CAC3C,CAAC;IAEF,mBAAmB;IACnB,UAAU,CACR,UAAU,CAAC,gBAAgB,CAAC,MAAM,KAAK,CAAC,EACxC,sEAAsE,CACvE,CAAC;IAEF,6BAA6B;IAC7B,MAAM,mBAAmB,GAAG,aAAa,CACvC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAC9B,wBAAwB,EACxB,oGAAoG,CACrG,CAAC;IACF,UAAU,CACR,iBAAiB,CAAC,mBAAmB,CAAC,YAAY,EAAE;QAClD,iCAAiC,CAAC,WAAW;QAC7C,iCAAiC,CAAC,mBAAmB;KACtD,CAAC,EACF,0FAA0F,CAC3F,CAAC;IACF,uCAAuC,CAAC,OAAO,CAC7C,mBAAmB,EACnB,iBAAiB,CAClB,CAAC;IAEF,cAAc;IACd,IACE,iBAAiB,CAAC,mBAAmB,CAAC,cAAc;QACpD,+BAA+B,EAC/B;QACA,MAAM,mBAAmB,GACvB,iBAAiB,CAAC,mBAAmB,CAAC,cAAc,CAAC;QACvD,MAAM,cAAc,GAAG,aAAa,CAClC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAC9B,2BAA2B,EAC3B,0EAA0E,CAC3E,CAAC;QACF,MAAM,kBAAkB,GAAG,aAAa,CACtC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EACxB,kBAAkB,EAClB,oFAAoF,CACrF,CAAC;QACF,mBAAmB,CAAC,iBAAiB,CACnC,uBAAuB,CAAC,kBAAkB,CAAC,CAC5C,CAAC;KACH;AACH,CAAC,CAAC"}
|
@@ -14,7 +14,7 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
import type { TreeNodeData, TreeData } from '@finos/legend-art';
|
17
|
-
import { type Type, type RootGraphFetchTree, PropertyGraphFetchTree } from '@finos/legend-graph';
|
17
|
+
import { type AbstractProperty, type Type, type RootGraphFetchTree, PropertyGraphFetchTree } from '@finos/legend-graph';
|
18
18
|
import { type QueryBuilderExplorerTreeNodeData, QueryBuilderExplorerTreePropertyNodeData } from '../../explorer/QueryBuilderExplorerState.js';
|
19
19
|
import type { QueryBuilderState } from '../../QueryBuilderState.js';
|
20
20
|
export declare class QueryBuilderGraphFetchTreeNodeData implements TreeNodeData {
|
@@ -31,6 +31,7 @@ export declare class QueryBuilderGraphFetchTreeNodeData implements TreeNodeData
|
|
31
31
|
export interface QueryBuilderGraphFetchTreeData extends TreeData<QueryBuilderGraphFetchTreeNodeData> {
|
32
32
|
tree: RootGraphFetchTree;
|
33
33
|
}
|
34
|
+
export declare const generateGraphFetchTreeNodeID: (property: AbstractProperty, parentNodeId: string | undefined, subType: Type | undefined) => string;
|
34
35
|
/**
|
35
36
|
* Build graph fetch tree data from an existing graph fetch tree root
|
36
37
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"QueryBuilderGraphFetchTreeUtil.d.ts","sourceRoot":"","sources":["../../../../src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,
|
1
|
+
{"version":3,"file":"QueryBuilderGraphFetchTreeUtil.d.ts","sourceRoot":"","sources":["../../../../src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EACL,KAAK,gBAAgB,EAErB,KAAK,IAAI,EACT,KAAK,kBAAkB,EAGvB,sBAAsB,EAGvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,gCAAgC,EACrC,wCAAwC,EAEzC,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAMpE,qBAAa,kCAAmC,YAAW,YAAY;IACrE,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,EAAE,CAAM;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,IAAI,EAAE,sBAAsB,CAAC;gBAG3B,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,kBAAkB,EAAE,sBAAsB;IAU5C,IAAI,IAAI,IAAI,IAAI,CAEf;CACF;AAED,MAAM,WAAW,8BACf,SAAQ,QAAQ,CAAC,kCAAkC,CAAC;IACpD,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED,eAAO,MAAM,4BAA4B,aAC7B,gBAAgB,gBACZ,MAAM,GAAG,SAAS,WACvB,IAAI,GAAG,SAAS,KACxB,MAGC,CAAC;AA6BL;;GAEG;AACH,eAAO,MAAM,uBAAuB,SAC5B,kBAAkB,KACvB,8BASF,CAAC;AAEF,eAAO,MAAM,yBAAyB,aAC1B,8BAA8B,KACvC,OAA8C,CAAC;AA6ClD,eAAO,MAAM,qBAAqB,aACtB,8BAA8B,QAClC,kCAAkC,KACvC,IAGF,CAAC;AAEF,eAAO,MAAM,2BAA2B,aAC5B,8BAA8B,oBACtB,SAAS,gCAAgC,CAAC,QACtD,wCAAwC,qBAC3B,iBAAiB,KACnC,IAgGF,CAAC"}
|
@@ -37,16 +37,13 @@ export class QueryBuilderGraphFetchTreeNodeData {
|
|
37
37
|
return this.tree.property.value.genericType.value.rawType;
|
38
38
|
}
|
39
39
|
}
|
40
|
-
const
|
41
|
-
const generateNodeIdForSubType = (property, subType, parentNodeId) => `${parentNodeId ? `${parentNodeId}.` : ''}${property.name}${TYPE_CAST_TOKEN}${subType.path}`;
|
40
|
+
export const generateGraphFetchTreeNodeID = (property, parentNodeId, subType) => `${parentNodeId ? `${parentNodeId}.` : ''}${property.name}${subType ? `${TYPE_CAST_TOKEN}${subType.path}` : ''}`;
|
42
41
|
const buildGraphFetchSubTree = (tree, parentNode, nodes) => {
|
43
42
|
assertType(tree, PropertyGraphFetchTree, 'Graph fetch sub-tree must be a property graph fetch tree');
|
44
43
|
const property = tree.property.value;
|
45
44
|
const subType = tree.subType?.value;
|
46
45
|
const parentNodeId = parentNode?.id;
|
47
|
-
const node = new QueryBuilderGraphFetchTreeNodeData(subType
|
48
|
-
? generateNodeIdForSubType(property, subType, parentNodeId)
|
49
|
-
: generateNodeId(property, parentNodeId), property.name, parentNodeId, tree);
|
46
|
+
const node = new QueryBuilderGraphFetchTreeNodeData(generateGraphFetchTreeNodeID(property, parentNodeId, subType), property.name, parentNodeId, tree);
|
50
47
|
tree.subTrees.forEach((subTree) => {
|
51
48
|
const subTreeNode = buildGraphFetchSubTree(subTree, node, nodes);
|
52
49
|
addUniqueEntry(node.childrenIds, subTreeNode.id);
|
@@ -149,9 +146,7 @@ export const addQueryBuilderPropertyNode = (treeData, explorerTreeData, node, qu
|
|
149
146
|
let parentNode = undefined;
|
150
147
|
let newSubTree;
|
151
148
|
for (const propertyGraphFetchTree of propertyGraphFetchTrees) {
|
152
|
-
currentNodeId = propertyGraphFetchTree.subType?.value
|
153
|
-
? generateNodeIdForSubType(propertyGraphFetchTree.property.value, propertyGraphFetchTree.subType.value, currentNodeId)
|
154
|
-
: generateNodeId(propertyGraphFetchTree.property.value, currentNodeId);
|
149
|
+
currentNodeId = generateGraphFetchTreeNodeID(propertyGraphFetchTree.property.value, currentNodeId, propertyGraphFetchTree.subType?.value);
|
155
150
|
const existingGraphFetchNode = treeData.nodes.get(currentNodeId);
|
156
151
|
if (existingGraphFetchNode) {
|
157
152
|
parentNode = existingGraphFetchNode;
|