@finos/legend-query-builder 0.4.4 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/QueryBuilder.d.ts +1 -0
- package/lib/components/QueryBuilder.d.ts.map +1 -1
- package/lib/components/QueryBuilder.js +11 -2
- package/lib/components/QueryBuilder.js.map +1 -1
- package/lib/components/QueryBuilderConstantExpressionPanel.d.ts +23 -0
- package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -0
- package/lib/components/QueryBuilderConstantExpressionPanel.js +105 -0
- package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -0
- package/lib/components/QueryBuilderDiffPanel.d.ts +1 -0
- package/lib/components/QueryBuilderDiffPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderDiffPanel.js +1 -2
- package/lib/components/QueryBuilderDiffPanel.js.map +1 -1
- package/lib/components/QueryBuilderParametersPanel.d.ts +1 -9
- package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderParametersPanel.js +10 -27
- package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts +1 -0
- package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.js +60 -12
- package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
- package/lib/components/QueryBuilderResultPanel.d.ts +1 -0
- package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderSideBar.d.ts +3 -1
- package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
- package/lib/components/QueryBuilderSideBar.js +6 -14
- package/lib/components/QueryBuilderSideBar.js.map +1 -1
- package/lib/components/QueryBuilderTextEditor.d.ts +1 -0
- package/lib/components/QueryBuilderTextEditor.d.ts.map +1 -1
- package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts +1 -0
- package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts +1 -0
- package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts +1 -0
- package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderMilestoningEditor.js +12 -18
- package/lib/components/explorer/QueryBuilderMilestoningEditor.js.map +1 -1
- package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts +1 -0
- package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts +1 -0
- package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts +1 -0
- package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/{QueryBuilderOLAPGroupByPanel_.d.ts → QueryBuilderOLAPGroupByPanel.d.ts} +3 -2
- package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel.d.ts.map +1 -0
- package/lib/components/fetch-structure/{QueryBuilderOLAPGroupByPanel_.js → QueryBuilderOLAPGroupByPanel.js} +2 -2
- package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel.js.map +1 -0
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts +1 -0
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +9 -11
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts +1 -0
- package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.js +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts +1 -0
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts +1 -0
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +4 -4
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
- package/lib/components/filter/QueryBuilderFilterPanel.d.ts +1 -0
- package/lib/components/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
- package/lib/components/filter/QueryBuilderFilterPanel.js +8 -9
- package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
- package/lib/components/shared/BasicValueSpecificationEditor.d.ts +12 -1
- package/lib/components/shared/BasicValueSpecificationEditor.d.ts.map +1 -1
- package/lib/components/shared/BasicValueSpecificationEditor.js +11 -7
- package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -1
- package/lib/components/shared/CustomDatePicker.d.ts.map +1 -1
- package/lib/components/shared/CustomDatePicker.js +3 -3
- package/lib/components/shared/CustomDatePicker.js.map +1 -1
- package/lib/components/shared/LambdaEditor.d.ts +1 -0
- package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
- package/lib/components/shared/LambdaEditor.js +1 -15
- package/lib/components/shared/LambdaEditor.js.map +1 -1
- package/lib/components/shared/LambdaParameterValuesEditor.d.ts +1 -0
- package/lib/components/shared/LambdaParameterValuesEditor.d.ts.map +1 -1
- package/lib/components/shared/QueryBuilderVariableSelector.d.ts +37 -0
- package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -0
- package/lib/components/shared/QueryBuilderVariableSelector.js +53 -0
- package/lib/components/shared/QueryBuilderVariableSelector.js.map +1 -0
- package/lib/components/watermark/QueryBuilderWatermark.d.ts +1 -0
- package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +1 -1
- package/lib/components/watermark/QueryBuilderWatermark.js +9 -11
- package/lib/components/watermark/QueryBuilderWatermark.js.map +1 -1
- package/lib/graphManager/QueryBuilderHashUtils.d.ts +2 -0
- package/lib/graphManager/QueryBuilderHashUtils.d.ts.map +1 -1
- package/lib/graphManager/QueryBuilderHashUtils.js +2 -0
- package/lib/graphManager/QueryBuilderHashUtils.js.map +1 -1
- package/lib/index.css +1 -17
- package/lib/index.css.map +1 -1
- package/lib/package.json +6 -6
- package/lib/stores/QueryBuilderConfig.d.ts +1 -0
- package/lib/stores/QueryBuilderConfig.d.ts.map +1 -1
- package/lib/stores/QueryBuilderConfig.js +1 -0
- package/lib/stores/QueryBuilderConfig.js.map +1 -1
- package/lib/stores/QueryBuilderConstantsState.d.ts +43 -0
- package/lib/stores/QueryBuilderConstantsState.d.ts.map +1 -0
- package/lib/stores/QueryBuilderConstantsState.js +116 -0
- package/lib/stores/QueryBuilderConstantsState.js.map +1 -0
- package/lib/stores/QueryBuilderParametersState.d.ts +0 -4
- package/lib/stores/QueryBuilderParametersState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderParametersState.js +0 -1
- package/lib/stores/QueryBuilderParametersState.js.map +1 -1
- package/lib/stores/QueryBuilderPropertyEditorState.d.ts +3 -10
- package/lib/stores/QueryBuilderPropertyEditorState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderPropertyEditorState.js +6 -140
- package/lib/stores/QueryBuilderPropertyEditorState.js.map +1 -1
- package/lib/stores/QueryBuilderState.d.ts +10 -3
- package/lib/stores/QueryBuilderState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderState.js +27 -4
- package/lib/stores/QueryBuilderState.js.map +1 -1
- package/lib/stores/QueryBuilderStateBuilder.d.ts +4 -3
- package/lib/stores/QueryBuilderStateBuilder.d.ts.map +1 -1
- package/lib/stores/QueryBuilderStateBuilder.js +50 -42
- package/lib/stores/QueryBuilderStateBuilder.js.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilder.js +23 -25
- package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.d.ts.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js +14 -78
- package/lib/stores/QueryBuilderValueSpecificationBuilderHelper.js.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts +2 -1
- package/lib/stores/QueryBuilderValueSpecificationHelper.d.ts.map +1 -1
- package/lib/stores/QueryBuilderValueSpecificationHelper.js +13 -20
- package/lib/stores/QueryBuilderValueSpecificationHelper.js.map +1 -1
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts +2 -1
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.js.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts +2 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js +4 -0
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts +3 -3
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js +4 -4
- package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts +3 -2
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +15 -2
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.d.ts +3 -3
- package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.js +6 -6
- package/lib/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.d.ts → QueryBuilderOLAPGroupByOperatorLoader.d.ts} +1 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.js → QueryBuilderOLAPGroupByOperatorLoader.js} +1 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader.js.map +1 -0
- package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.d.ts → QueryBuilderOLAPGroupByState.d.ts} +1 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.js → QueryBuilderOLAPGroupByState.js} +1 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState.js.map +1 -0
- package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.d.ts → QueryBuilderOLAPGroupByStateBuilder.d.ts} +3 -3
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.js → QueryBuilderOLAPGroupByStateBuilder.js} +4 -4
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder.js.map +1 -0
- package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.d.ts → QueryBuilderOLAPGroupByValueSpecificationBuilder.d.ts} +2 -2
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.d.ts.map +1 -0
- package/lib/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.js → QueryBuilderOLAPGroupByValueSpecificationBuilder.js} +2 -2
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder.js.map +1 -0
- package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts +2 -1
- package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js +9 -1
- package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js +1 -1
- package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.js.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.d.ts +2 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js +4 -0
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts +5 -5
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js +10 -10
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.js.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterState.d.ts +2 -1
- package/lib/stores/filter/QueryBuilderFilterState.d.ts.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterState.js +9 -1
- package/lib/stores/filter/QueryBuilderFilterState.js.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.d.ts +2 -2
- package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js +6 -4
- package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.d.ts +27 -0
- package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.d.ts.map +1 -0
- package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.js +93 -0
- package/lib/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.js.map +1 -0
- package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.d.ts +26 -0
- package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.d.ts.map +1 -0
- package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.js +60 -0
- package/lib/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.js.map +1 -0
- package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts +70 -0
- package/lib/stores/milestoning/QueryBuilderMilestoningHelper.d.ts.map +1 -0
- package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js +199 -0
- package/lib/stores/milestoning/QueryBuilderMilestoningHelper.js.map +1 -0
- package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.d.ts +49 -0
- package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.d.ts.map +1 -0
- package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.js +24 -0
- package/lib/stores/milestoning/QueryBuilderMilestoningImplementation.js.map +1 -0
- package/lib/stores/{QueryBuilderMilestoningState.d.ts → milestoning/QueryBuilderMilestoningState.d.ts} +7 -2
- package/lib/stores/milestoning/QueryBuilderMilestoningState.d.ts.map +1 -0
- package/lib/stores/{QueryBuilderMilestoningState.js → milestoning/QueryBuilderMilestoningState.js} +30 -20
- package/lib/stores/milestoning/QueryBuilderMilestoningState.js.map +1 -0
- package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.d.ts +26 -0
- package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.d.ts.map +1 -0
- package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.js +55 -0
- package/lib/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.js.map +1 -0
- package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts +3 -1
- package/lib/stores/shared/ValueSpecificationEditorHelper.d.ts.map +1 -1
- package/lib/stores/shared/ValueSpecificationEditorHelper.js +58 -2
- package/lib/stores/shared/ValueSpecificationEditorHelper.js.map +1 -1
- package/lib/stores/watermark/QueryBuilderWatermarkState.d.ts +2 -1
- package/lib/stores/watermark/QueryBuilderWatermarkState.d.ts.map +1 -1
- package/lib/stores/watermark/QueryBuilderWatermarkState.js +6 -0
- package/lib/stores/watermark/QueryBuilderWatermarkState.js.map +1 -1
- package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.d.ts +2 -2
- package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.d.ts.map +1 -1
- package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.js +2 -2
- package/lib/stores/watermark/QueryBuilderWatermarkStateBuilder.js.map +1 -1
- package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.d.ts +2 -2
- package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.d.ts.map +1 -1
- package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.js +7 -4
- package/lib/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.js.map +1 -1
- package/lib/stores/workflows/ServiceQueryBuilderState.js +1 -1
- package/lib/stores/workflows/ServiceQueryBuilderState.js.map +1 -1
- package/package.json +13 -13
- package/src/components/QueryBuilder.tsx +38 -0
- package/src/components/QueryBuilderConstantExpressionPanel.tsx +291 -0
- package/src/components/QueryBuilderDiffPanel.tsx +0 -2
- package/src/components/QueryBuilderParametersPanel.tsx +29 -103
- package/src/components/QueryBuilderPropertyExpressionEditor.tsx +119 -36
- package/src/components/QueryBuilderSideBar.tsx +5 -22
- package/src/components/explorer/QueryBuilderMilestoningEditor.tsx +29 -39
- package/src/components/fetch-structure/{QueryBuilderOLAPGroupByPanel_.tsx → QueryBuilderOLAPGroupByPanel.tsx} +1 -1
- package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +18 -19
- package/src/components/fetch-structure/QueryBuilderPostTDSPanel.tsx +1 -1
- package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +9 -9
- package/src/components/filter/QueryBuilderFilterPanel.tsx +16 -17
- package/src/components/shared/BasicValueSpecificationEditor.tsx +47 -22
- package/src/components/shared/CustomDatePicker.tsx +3 -2
- package/src/components/shared/LambdaEditor.tsx +0 -15
- package/src/components/shared/QueryBuilderVariableSelector.tsx +193 -0
- package/src/components/watermark/QueryBuilderWatermark.tsx +19 -31
- package/src/graphManager/QueryBuilderHashUtils.ts +2 -0
- package/src/stores/QueryBuilderConfig.ts +1 -0
- package/src/stores/QueryBuilderConstantsState.ts +173 -0
- package/src/stores/QueryBuilderParametersState.ts +0 -6
- package/src/stores/QueryBuilderPropertyEditorState.ts +6 -235
- package/src/stores/QueryBuilderState.ts +36 -4
- package/src/stores/QueryBuilderStateBuilder.ts +111 -52
- package/src/stores/QueryBuilderValueSpecificationBuilder.ts +34 -51
- package/src/stores/QueryBuilderValueSpecificationBuilderHelper.ts +16 -105
- package/src/stores/QueryBuilderValueSpecificationHelper.ts +23 -29
- package/src/stores/fetch-structure/QueryBuilderFetchStructureImplementationState.ts +2 -0
- package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts +14 -2
- package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeStateBuilder.ts +5 -0
- package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +21 -4
- package/src/stores/fetch-structure/tds/aggregation/QueryBuilderAggregationStateBuilder.ts +7 -0
- package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByOperatorLoader_.ts → QueryBuilderOLAPGroupByOperatorLoader.ts} +0 -0
- package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByState_.ts → QueryBuilderOLAPGroupByState.ts} +0 -0
- package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByStateBuilder_.ts → QueryBuilderOLAPGroupByStateBuilder.ts} +3 -1
- package/src/stores/fetch-structure/tds/olapGroupBy/{QueryBuilderOLAPGroupByValueSpecificationBuilder_.ts → QueryBuilderOLAPGroupByValueSpecificationBuilder.ts} +1 -1
- package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.ts +13 -0
- package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorHelper.ts +1 -1
- package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.ts +12 -0
- package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionStateBuilder.ts +11 -0
- package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionValueSpecificationBuilder.ts +1 -1
- package/src/stores/filter/QueryBuilderFilterState.ts +13 -0
- package/src/stores/filter/QueryBuilderFilterValueSpecificationBuilder.ts +10 -5
- package/src/stores/milestoning/QueryBuilderBitemporalMilestoningImplementation.ts +165 -0
- package/src/stores/milestoning/QueryBuilderBusinessTemporalMilestoningImplementation.ts +96 -0
- package/src/stores/milestoning/QueryBuilderMilestoningHelper.ts +311 -0
- package/src/stores/milestoning/QueryBuilderMilestoningImplementation.ts +77 -0
- package/src/stores/{QueryBuilderMilestoningState.ts → milestoning/QueryBuilderMilestoningState.ts} +66 -39
- package/src/stores/milestoning/QueryBuilderProcessingTemporalMilestoningImplementation.ts +88 -0
- package/src/stores/shared/ValueSpecificationEditorHelper.ts +84 -2
- package/src/stores/watermark/QueryBuilderWatermarkState.ts +8 -0
- package/src/stores/watermark/QueryBuilderWatermarkStateBuilder.ts +3 -0
- package/src/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.ts +11 -5
- package/src/stores/workflows/ServiceQueryBuilderState.ts +1 -1
- package/tsconfig.json +14 -6
- package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel_.d.ts.map +0 -1
- package/lib/components/fetch-structure/QueryBuilderOLAPGroupByPanel_.js.map +0 -1
- package/lib/stores/QueryBuilderMilestoningState.d.ts.map +0 -1
- package/lib/stores/QueryBuilderMilestoningState.js.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader_.d.ts.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByOperatorLoader_.js.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder_.d.ts.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByStateBuilder_.js.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState_.d.ts.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByState_.js.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder_.d.ts.map +0 -1
- package/lib/stores/fetch-structure/tds/olapGroupBy/QueryBuilderOLAPGroupByValueSpecificationBuilder_.js.map +0 -1
@@ -0,0 +1,165 @@
|
|
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
|
+
|
17
|
+
import {
|
18
|
+
type ValueSpecification,
|
19
|
+
PROCESSING_DATE_MILESTONING_PROPERTY_NAME,
|
20
|
+
BUSINESS_DATE_MILESTONING_PROPERTY_NAME,
|
21
|
+
type SimpleFunctionExpression,
|
22
|
+
AbstractPropertyExpression,
|
23
|
+
MILESTONING_STEREOTYPE,
|
24
|
+
INTERNAL__PropagatedValue,
|
25
|
+
} from '@finos/legend-graph';
|
26
|
+
import {
|
27
|
+
assertTrue,
|
28
|
+
guaranteeNonNullable,
|
29
|
+
guaranteeType,
|
30
|
+
} from '@finos/legend-shared';
|
31
|
+
import { getParameterValue } from '../../components/QueryBuilderSideBar.js';
|
32
|
+
import type { QueryBuilderDerivedPropertyExpressionState } from '../QueryBuilderPropertyEditorState.js';
|
33
|
+
import { QueryBuilderMilestoningImplementation } from './QueryBuilderMilestoningImplementation.js';
|
34
|
+
|
35
|
+
export class QueryBuilderBitemporalMilestoningImplementation extends QueryBuilderMilestoningImplementation {
|
36
|
+
getMilestoningDate(index?: number): ValueSpecification | undefined {
|
37
|
+
if (index === 0) {
|
38
|
+
return this.milestoningState.processingDate;
|
39
|
+
} else {
|
40
|
+
return this.milestoningState.businessDate;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
getMilestoningToolTipText(): string {
|
45
|
+
return `Processing Date: ${getParameterValue(
|
46
|
+
this.getMilestoningDate(0),
|
47
|
+
)}, Business Date: ${getParameterValue(this.getMilestoningDate(1))}`;
|
48
|
+
}
|
49
|
+
|
50
|
+
initializeMilestoningParameters(force?: boolean): void {
|
51
|
+
if (!this.milestoningState.processingDate || force) {
|
52
|
+
this.milestoningState.setProcessingDate(
|
53
|
+
this.milestoningState.buildMilestoningParameter(
|
54
|
+
PROCESSING_DATE_MILESTONING_PROPERTY_NAME,
|
55
|
+
),
|
56
|
+
);
|
57
|
+
}
|
58
|
+
if (!this.milestoningState.businessDate || force) {
|
59
|
+
this.milestoningState.setBusinessDate(
|
60
|
+
this.milestoningState.buildMilestoningParameter(
|
61
|
+
BUSINESS_DATE_MILESTONING_PROPERTY_NAME,
|
62
|
+
),
|
63
|
+
);
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
processGetAllParamaters(parameterValues: ValueSpecification[]): void {
|
68
|
+
assertTrue(
|
69
|
+
parameterValues.length === 3,
|
70
|
+
`Can't process getAll() expression: when used with a bitemporal milestoned class getAll() expects two parameters`,
|
71
|
+
);
|
72
|
+
this.milestoningState.setProcessingDate(parameterValues[1]);
|
73
|
+
this.milestoningState.setBusinessDate(parameterValues[2]);
|
74
|
+
}
|
75
|
+
|
76
|
+
buildGetAllParameters(getAllFunction: SimpleFunctionExpression): void {
|
77
|
+
getAllFunction.parametersValues.push(
|
78
|
+
guaranteeNonNullable(
|
79
|
+
this.getMilestoningDate(0),
|
80
|
+
`Milestoning class should have a parameter of type 'Date'`,
|
81
|
+
),
|
82
|
+
);
|
83
|
+
getAllFunction.parametersValues.push(
|
84
|
+
guaranteeNonNullable(
|
85
|
+
this.getMilestoningDate(1),
|
86
|
+
`Milestoning class should have a parameter of type 'Date'`,
|
87
|
+
),
|
88
|
+
);
|
89
|
+
}
|
90
|
+
|
91
|
+
generateMilestoningDate(
|
92
|
+
isDatePropagationSupported: boolean,
|
93
|
+
hasDefaultMilestoningDate: boolean,
|
94
|
+
prevPropertyExpression: AbstractPropertyExpression | undefined,
|
95
|
+
temporalSource: MILESTONING_STEREOTYPE | undefined,
|
96
|
+
idx?: number,
|
97
|
+
derivedPropertyExpressionState?: QueryBuilderDerivedPropertyExpressionState,
|
98
|
+
): ValueSpecification {
|
99
|
+
this.initializeMilestoningParameters();
|
100
|
+
if (idx === 0) {
|
101
|
+
if (
|
102
|
+
temporalSource === MILESTONING_STEREOTYPE.PROCESSING_TEMPORAL &&
|
103
|
+
derivedPropertyExpressionState?.parameterValues.length === 1
|
104
|
+
) {
|
105
|
+
return new INTERNAL__PropagatedValue(() =>
|
106
|
+
guaranteeNonNullable(
|
107
|
+
guaranteeType(prevPropertyExpression, AbstractPropertyExpression)
|
108
|
+
.parametersValues[1],
|
109
|
+
),
|
110
|
+
);
|
111
|
+
}
|
112
|
+
let parameter;
|
113
|
+
if (
|
114
|
+
isDatePropagationSupported &&
|
115
|
+
prevPropertyExpression &&
|
116
|
+
!hasDefaultMilestoningDate
|
117
|
+
) {
|
118
|
+
parameter = new INTERNAL__PropagatedValue(() =>
|
119
|
+
guaranteeNonNullable(prevPropertyExpression.parametersValues[1]),
|
120
|
+
);
|
121
|
+
} else {
|
122
|
+
parameter = new INTERNAL__PropagatedValue(() =>
|
123
|
+
guaranteeNonNullable(this.getMilestoningDate(idx)),
|
124
|
+
);
|
125
|
+
parameter.isPropagatedValue = hasDefaultMilestoningDate
|
126
|
+
? false
|
127
|
+
: isDatePropagationSupported;
|
128
|
+
}
|
129
|
+
return parameter;
|
130
|
+
} else {
|
131
|
+
if (
|
132
|
+
temporalSource === MILESTONING_STEREOTYPE.BUSINESS_TEMPORAL &&
|
133
|
+
derivedPropertyExpressionState?.parameterValues.length === 1
|
134
|
+
) {
|
135
|
+
return new INTERNAL__PropagatedValue(() =>
|
136
|
+
guaranteeNonNullable(
|
137
|
+
guaranteeType(
|
138
|
+
derivedPropertyExpressionState.propertyExpression
|
139
|
+
.parametersValues[0],
|
140
|
+
AbstractPropertyExpression,
|
141
|
+
).parametersValues[1],
|
142
|
+
),
|
143
|
+
);
|
144
|
+
}
|
145
|
+
let parameter;
|
146
|
+
if (
|
147
|
+
isDatePropagationSupported &&
|
148
|
+
prevPropertyExpression &&
|
149
|
+
!hasDefaultMilestoningDate
|
150
|
+
) {
|
151
|
+
parameter = new INTERNAL__PropagatedValue(() =>
|
152
|
+
guaranteeNonNullable(prevPropertyExpression.parametersValues[2]),
|
153
|
+
);
|
154
|
+
} else {
|
155
|
+
parameter = new INTERNAL__PropagatedValue(() =>
|
156
|
+
guaranteeNonNullable(this.getMilestoningDate(idx)),
|
157
|
+
);
|
158
|
+
parameter.isPropagatedValue = hasDefaultMilestoningDate
|
159
|
+
? false
|
160
|
+
: isDatePropagationSupported;
|
161
|
+
}
|
162
|
+
return parameter;
|
163
|
+
}
|
164
|
+
}
|
165
|
+
}
|
@@ -0,0 +1,96 @@
|
|
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
|
+
|
17
|
+
import {
|
18
|
+
type ValueSpecification,
|
19
|
+
BUSINESS_DATE_MILESTONING_PROPERTY_NAME,
|
20
|
+
type SimpleFunctionExpression,
|
21
|
+
type AbstractPropertyExpression,
|
22
|
+
MILESTONING_STEREOTYPE,
|
23
|
+
INTERNAL__PropagatedValue,
|
24
|
+
} from '@finos/legend-graph';
|
25
|
+
import { assertTrue, guaranteeNonNullable } from '@finos/legend-shared';
|
26
|
+
import { getParameterValue } from '../../components/QueryBuilderSideBar.js';
|
27
|
+
import { QueryBuilderMilestoningImplementation } from './QueryBuilderMilestoningImplementation.js';
|
28
|
+
|
29
|
+
export class QueryBuilderBusinessTemporalMilestoningImplementation extends QueryBuilderMilestoningImplementation {
|
30
|
+
getMilestoningDate(): ValueSpecification | undefined {
|
31
|
+
return this.milestoningState.businessDate;
|
32
|
+
}
|
33
|
+
|
34
|
+
getMilestoningToolTipText(): string {
|
35
|
+
return `Business Date: ${getParameterValue(this.getMilestoningDate())}`;
|
36
|
+
}
|
37
|
+
|
38
|
+
initializeMilestoningParameters(force?: boolean): void {
|
39
|
+
if (!this.milestoningState.businessDate || force) {
|
40
|
+
this.milestoningState.setBusinessDate(
|
41
|
+
this.milestoningState.buildMilestoningParameter(
|
42
|
+
BUSINESS_DATE_MILESTONING_PROPERTY_NAME,
|
43
|
+
),
|
44
|
+
);
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
processGetAllParamaters(parameterValues: ValueSpecification[]): void {
|
49
|
+
assertTrue(
|
50
|
+
parameterValues.length === 2,
|
51
|
+
`Can't process getAll() expression: when used with a milestoned class getAll() expects a parameter`,
|
52
|
+
);
|
53
|
+
this.milestoningState.setBusinessDate(parameterValues[1]);
|
54
|
+
}
|
55
|
+
|
56
|
+
buildGetAllParameters(getAllFunction: SimpleFunctionExpression): void {
|
57
|
+
getAllFunction.parametersValues.push(
|
58
|
+
guaranteeNonNullable(
|
59
|
+
this.getMilestoningDate(),
|
60
|
+
`Milestoning class should have a parameter of type 'Date'`,
|
61
|
+
),
|
62
|
+
);
|
63
|
+
}
|
64
|
+
|
65
|
+
generateMilestoningDate(
|
66
|
+
isDatePropagationSupported: boolean,
|
67
|
+
hasDefaultMilestoningDate: boolean,
|
68
|
+
prevPropertyExpression: AbstractPropertyExpression | undefined,
|
69
|
+
temporalSource: MILESTONING_STEREOTYPE | undefined,
|
70
|
+
): ValueSpecification {
|
71
|
+
this.initializeMilestoningParameters();
|
72
|
+
if (
|
73
|
+
isDatePropagationSupported &&
|
74
|
+
prevPropertyExpression &&
|
75
|
+
!hasDefaultMilestoningDate
|
76
|
+
) {
|
77
|
+
if (temporalSource === MILESTONING_STEREOTYPE.BUSINESS_TEMPORAL) {
|
78
|
+
return new INTERNAL__PropagatedValue(() =>
|
79
|
+
guaranteeNonNullable(prevPropertyExpression.parametersValues[1]),
|
80
|
+
);
|
81
|
+
} else {
|
82
|
+
return new INTERNAL__PropagatedValue(() =>
|
83
|
+
guaranteeNonNullable(prevPropertyExpression.parametersValues[2]),
|
84
|
+
);
|
85
|
+
}
|
86
|
+
} else {
|
87
|
+
const milestoningDate = new INTERNAL__PropagatedValue(() =>
|
88
|
+
guaranteeNonNullable(this.getMilestoningDate()),
|
89
|
+
);
|
90
|
+
milestoningDate.isPropagatedValue = hasDefaultMilestoningDate
|
91
|
+
? false
|
92
|
+
: isDatePropagationSupported;
|
93
|
+
return milestoningDate;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
}
|
@@ -0,0 +1,311 @@
|
|
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
|
+
|
17
|
+
import {
|
18
|
+
AbstractPropertyExpression,
|
19
|
+
DerivedProperty,
|
20
|
+
Class,
|
21
|
+
MILESTONING_STEREOTYPE,
|
22
|
+
getMilestoneTemporalStereotype,
|
23
|
+
type ValueSpecification,
|
24
|
+
Association,
|
25
|
+
getGeneratedMilestonedPropertiesForAssociation,
|
26
|
+
PrimitiveInstanceValue,
|
27
|
+
PRIMITIVE_TYPE,
|
28
|
+
type PureModel,
|
29
|
+
VariableExpression,
|
30
|
+
} from '@finos/legend-graph';
|
31
|
+
import {
|
32
|
+
guaranteeNonNullable,
|
33
|
+
guaranteeType,
|
34
|
+
UnsupportedOperationError,
|
35
|
+
} from '@finos/legend-shared';
|
36
|
+
import type { QueryBuilderMilestoningState } from './QueryBuilderMilestoningState.js';
|
37
|
+
import type { QueryBuilderDerivedPropertyExpressionState } from '../QueryBuilderPropertyEditorState.js';
|
38
|
+
import type { QueryBuilderState } from '../QueryBuilderState.js';
|
39
|
+
|
40
|
+
export const getDerivedPropertyMilestoningSteoreotype = (
|
41
|
+
property: DerivedProperty,
|
42
|
+
graph: PureModel,
|
43
|
+
): MILESTONING_STEREOTYPE | undefined => {
|
44
|
+
const owner = property._OWNER;
|
45
|
+
if (owner instanceof Class) {
|
46
|
+
return getMilestoneTemporalStereotype(owner, graph);
|
47
|
+
} else if (owner instanceof Association) {
|
48
|
+
const generatedMilestonedProperties =
|
49
|
+
getGeneratedMilestonedPropertiesForAssociation(owner, property);
|
50
|
+
if (generatedMilestonedProperties.length) {
|
51
|
+
const ownerClass =
|
52
|
+
generatedMilestonedProperties[0]?.genericType.value.rawType;
|
53
|
+
return getMilestoneTemporalStereotype(
|
54
|
+
guaranteeType(ownerClass, Class),
|
55
|
+
graph,
|
56
|
+
);
|
57
|
+
}
|
58
|
+
}
|
59
|
+
return undefined;
|
60
|
+
};
|
61
|
+
|
62
|
+
/**
|
63
|
+
* Checks if the provided property expression match the criteria for default
|
64
|
+
* date propagation so we know whether we need to fill in values for the parameter
|
65
|
+
* or just propgate values from the parent's expression
|
66
|
+
*
|
67
|
+
* NOTE: this takes date propgation into account. See the table below for all
|
68
|
+
* the combination:
|
69
|
+
*
|
70
|
+
* | [source] | | | | |
|
71
|
+
* ----------------------------------------------------------------------
|
72
|
+
* [target] | | NONE | PR_TMP | BI_TMP | BU_TMP |
|
73
|
+
* ----------------------------------------------------------------------
|
74
|
+
* | NONE | N.A. | PRD | PRD,BUD | BUD |
|
75
|
+
* ----------------------------------------------------------------------
|
76
|
+
* | PR_TMP | N.A. | X | PRD,BUD | BUD |
|
77
|
+
* ----------------------------------------------------------------------
|
78
|
+
* | BI_TMP | N.A. | X | X | X |
|
79
|
+
* ----------------------------------------------------------------------
|
80
|
+
* | BU_TMP | N.A. | PRD | PRD,BUD | X |
|
81
|
+
* ----------------------------------------------------------------------
|
82
|
+
*
|
83
|
+
* Annotations:
|
84
|
+
*
|
85
|
+
* [source]: source temporal type
|
86
|
+
* [target]: target temporal type
|
87
|
+
*
|
88
|
+
* PR_TMP : processing temporal
|
89
|
+
* BI_TMP : bitemporal
|
90
|
+
* BU_TMP : business temporal
|
91
|
+
*
|
92
|
+
* X : no default date propagated
|
93
|
+
* PRD : default processing date is propagated
|
94
|
+
* BUD : default business date is propgated
|
95
|
+
*/
|
96
|
+
export const isDefaultDatePropagationSupported = (
|
97
|
+
currentPropertyExpression: AbstractPropertyExpression,
|
98
|
+
queryBuilderState: QueryBuilderState,
|
99
|
+
prevPropertyExpression?: AbstractPropertyExpression | undefined,
|
100
|
+
): boolean => {
|
101
|
+
const property = currentPropertyExpression.func.value;
|
102
|
+
const graph = queryBuilderState.graphManagerState.graph;
|
103
|
+
// Default date propagation is not supported for current expression when the previous property expression is a derived property.
|
104
|
+
if (
|
105
|
+
prevPropertyExpression &&
|
106
|
+
prevPropertyExpression.func.value instanceof DerivedProperty &&
|
107
|
+
prevPropertyExpression.func.value._OWNER.derivedProperties.includes(
|
108
|
+
prevPropertyExpression.func.value,
|
109
|
+
)
|
110
|
+
) {
|
111
|
+
return false;
|
112
|
+
}
|
113
|
+
if (property.genericType.value.rawType instanceof Class) {
|
114
|
+
// the stereotype of source class of current property expression.
|
115
|
+
const sourceStereotype =
|
116
|
+
property instanceof DerivedProperty
|
117
|
+
? getDerivedPropertyMilestoningSteoreotype(property, graph)
|
118
|
+
: undefined;
|
119
|
+
// Default date propagation is always supported if the source is `bitemporal`
|
120
|
+
if (sourceStereotype === MILESTONING_STEREOTYPE.BITEMPORAL) {
|
121
|
+
return true;
|
122
|
+
}
|
123
|
+
// the stereotype (if exists) of the generic type of current property expression.
|
124
|
+
const targetStereotype = getMilestoneTemporalStereotype(
|
125
|
+
property.genericType.value.rawType,
|
126
|
+
graph,
|
127
|
+
);
|
128
|
+
// Default date propagation is supported when stereotype of both source and target matches
|
129
|
+
if (sourceStereotype && targetStereotype) {
|
130
|
+
return sourceStereotype === targetStereotype;
|
131
|
+
}
|
132
|
+
}
|
133
|
+
return false;
|
134
|
+
};
|
135
|
+
|
136
|
+
/**
|
137
|
+
* Check if the parameter value of the milestoned property is
|
138
|
+
* the same as those specified in global scope, so that we can
|
139
|
+
* potentially replace them with propgated value.
|
140
|
+
*/
|
141
|
+
export const matchMilestoningParameterValue = (
|
142
|
+
stereotype: MILESTONING_STEREOTYPE,
|
143
|
+
idx: number,
|
144
|
+
parameterValue: ValueSpecification,
|
145
|
+
milestoningDate: QueryBuilderMilestoningState,
|
146
|
+
): boolean => {
|
147
|
+
const checkIfEquivalent = (
|
148
|
+
param1: ValueSpecification | undefined,
|
149
|
+
param2: ValueSpecification | undefined,
|
150
|
+
): boolean => {
|
151
|
+
if (
|
152
|
+
param1 instanceof VariableExpression &&
|
153
|
+
param2 instanceof VariableExpression
|
154
|
+
) {
|
155
|
+
return param1.name === param2.name;
|
156
|
+
} else if (
|
157
|
+
param1 instanceof PrimitiveInstanceValue &&
|
158
|
+
param2 instanceof PrimitiveInstanceValue
|
159
|
+
) {
|
160
|
+
if (
|
161
|
+
param1.genericType.value.rawType.name === PRIMITIVE_TYPE.LATESTDATE &&
|
162
|
+
param2.genericType.value.rawType.name === PRIMITIVE_TYPE.LATESTDATE
|
163
|
+
) {
|
164
|
+
return true;
|
165
|
+
}
|
166
|
+
return (
|
167
|
+
param1.genericType.value.rawType.name ===
|
168
|
+
param2.genericType.value.rawType.name &&
|
169
|
+
param1.values[0] === param2.values[0]
|
170
|
+
);
|
171
|
+
}
|
172
|
+
return false;
|
173
|
+
};
|
174
|
+
switch (stereotype) {
|
175
|
+
case MILESTONING_STEREOTYPE.BITEMPORAL:
|
176
|
+
return (
|
177
|
+
(idx === 0 &&
|
178
|
+
checkIfEquivalent(parameterValue, milestoningDate.processingDate)) ||
|
179
|
+
(idx === 1 &&
|
180
|
+
checkIfEquivalent(parameterValue, milestoningDate.businessDate))
|
181
|
+
);
|
182
|
+
case MILESTONING_STEREOTYPE.PROCESSING_TEMPORAL:
|
183
|
+
return checkIfEquivalent(parameterValue, milestoningDate.processingDate);
|
184
|
+
case MILESTONING_STEREOTYPE.BUSINESS_TEMPORAL:
|
185
|
+
return checkIfEquivalent(parameterValue, milestoningDate.businessDate);
|
186
|
+
default:
|
187
|
+
}
|
188
|
+
return false;
|
189
|
+
};
|
190
|
+
|
191
|
+
/**
|
192
|
+
* Generate a parameter value for the derived property given the index if the property is milestoned.
|
193
|
+
*
|
194
|
+
* This method considers different scenarios for milestoning and take into account date propagation
|
195
|
+
* See https://github.com/finos/legend-studio/pull/891
|
196
|
+
*/
|
197
|
+
export const generateMilestonedPropertyParameterValue = (
|
198
|
+
derivedPropertyExpressionState: QueryBuilderDerivedPropertyExpressionState,
|
199
|
+
idx: number,
|
200
|
+
): ValueSpecification | undefined => {
|
201
|
+
// Milestoning transformations should not be done on actual derived properties.
|
202
|
+
if (
|
203
|
+
derivedPropertyExpressionState.derivedProperty._OWNER.derivedProperties.includes(
|
204
|
+
derivedPropertyExpressionState.derivedProperty,
|
205
|
+
)
|
206
|
+
) {
|
207
|
+
return undefined;
|
208
|
+
}
|
209
|
+
const prevPropertyExpression =
|
210
|
+
derivedPropertyExpressionState.propertyExpression
|
211
|
+
.parametersValues[0] instanceof AbstractPropertyExpression
|
212
|
+
? derivedPropertyExpressionState.propertyExpression.parametersValues[0]
|
213
|
+
: undefined;
|
214
|
+
const milestoningState =
|
215
|
+
derivedPropertyExpressionState.queryBuilderState.milestoningState;
|
216
|
+
const temporalSource = getDerivedPropertyMilestoningSteoreotype(
|
217
|
+
derivedPropertyExpressionState.derivedProperty,
|
218
|
+
derivedPropertyExpressionState.queryBuilderState.graphManagerState.graph,
|
219
|
+
);
|
220
|
+
const temporalTarget =
|
221
|
+
derivedPropertyExpressionState.propertyExpression.func.value.genericType
|
222
|
+
.value.rawType instanceof Class &&
|
223
|
+
derivedPropertyExpressionState.propertyExpression.func.value._OWNER
|
224
|
+
._generatedMilestonedProperties.length !== 0
|
225
|
+
? getMilestoneTemporalStereotype(
|
226
|
+
derivedPropertyExpressionState.propertyExpression.func.value
|
227
|
+
.genericType.value.rawType,
|
228
|
+
derivedPropertyExpressionState.queryBuilderState.graphManagerState
|
229
|
+
.graph,
|
230
|
+
)
|
231
|
+
: undefined;
|
232
|
+
const hasDefaultMilestoningDate =
|
233
|
+
temporalTarget &&
|
234
|
+
idx < derivedPropertyExpressionState.parameterValues.length &&
|
235
|
+
matchMilestoningParameterValue(
|
236
|
+
temporalTarget,
|
237
|
+
idx,
|
238
|
+
guaranteeNonNullable(derivedPropertyExpressionState.parameterValues[idx]),
|
239
|
+
milestoningState,
|
240
|
+
);
|
241
|
+
const shouldReturnMilestoningParameter =
|
242
|
+
temporalTarget &&
|
243
|
+
((idx < derivedPropertyExpressionState.parameterValues.length &&
|
244
|
+
(hasDefaultMilestoningDate ||
|
245
|
+
/**
|
246
|
+
* Checks if the given milestoning needs to be overwritten or not.
|
247
|
+
* Specially, we would need to rewrite the query if the user passes a single parameter
|
248
|
+
* to the `bitemporal` property expression with `processing temporal` source.
|
249
|
+
*/
|
250
|
+
(getDerivedPropertyMilestoningSteoreotype(
|
251
|
+
derivedPropertyExpressionState.derivedProperty,
|
252
|
+
derivedPropertyExpressionState.queryBuilderState.graphManagerState
|
253
|
+
.graph,
|
254
|
+
) === MILESTONING_STEREOTYPE.PROCESSING_TEMPORAL &&
|
255
|
+
temporalTarget === MILESTONING_STEREOTYPE.BITEMPORAL &&
|
256
|
+
derivedPropertyExpressionState.parameterValues.length === 1))) ||
|
257
|
+
idx >= derivedPropertyExpressionState.parameterValues.length);
|
258
|
+
|
259
|
+
if (!shouldReturnMilestoningParameter) {
|
260
|
+
return undefined;
|
261
|
+
}
|
262
|
+
const isDatePropagationSupported = isDefaultDatePropagationSupported(
|
263
|
+
derivedPropertyExpressionState.propertyExpression,
|
264
|
+
derivedPropertyExpressionState.queryBuilderState,
|
265
|
+
prevPropertyExpression,
|
266
|
+
);
|
267
|
+
return milestoningState
|
268
|
+
.getMilestoningImplementation(temporalTarget)
|
269
|
+
.generateMilestoningDate(
|
270
|
+
isDatePropagationSupported,
|
271
|
+
hasDefaultMilestoningDate ?? false,
|
272
|
+
prevPropertyExpression,
|
273
|
+
temporalSource,
|
274
|
+
idx,
|
275
|
+
derivedPropertyExpressionState,
|
276
|
+
);
|
277
|
+
};
|
278
|
+
|
279
|
+
export const validateMilestoningPropertyExpressionChain = (
|
280
|
+
sourceStereotype: MILESTONING_STEREOTYPE | undefined,
|
281
|
+
targetStereotype: MILESTONING_STEREOTYPE,
|
282
|
+
propertyExpression: AbstractPropertyExpression,
|
283
|
+
): void => {
|
284
|
+
if (
|
285
|
+
sourceStereotype !== MILESTONING_STEREOTYPE.BITEMPORAL &&
|
286
|
+
targetStereotype !== sourceStereotype
|
287
|
+
) {
|
288
|
+
if (targetStereotype === MILESTONING_STEREOTYPE.BITEMPORAL) {
|
289
|
+
if (
|
290
|
+
propertyExpression.parametersValues.length !== 3 &&
|
291
|
+
!sourceStereotype
|
292
|
+
) {
|
293
|
+
throw new UnsupportedOperationError(
|
294
|
+
`Property of milestoning sterotype '${MILESTONING_STEREOTYPE.BITEMPORAL}' should have exactly two parameters`,
|
295
|
+
);
|
296
|
+
} else if (propertyExpression.parametersValues.length < 2) {
|
297
|
+
throw new UnsupportedOperationError(
|
298
|
+
`Property of milestoning sterotype '${MILESTONING_STEREOTYPE.BITEMPORAL}' should have at least one parameter`,
|
299
|
+
);
|
300
|
+
} else if (propertyExpression.parametersValues.length > 3) {
|
301
|
+
throw new UnsupportedOperationError(
|
302
|
+
`Property of milestoning sterotype '${MILESTONING_STEREOTYPE.BITEMPORAL}' should not have more than two parameters`,
|
303
|
+
);
|
304
|
+
}
|
305
|
+
} else if (propertyExpression.parametersValues.length !== 2) {
|
306
|
+
throw new UnsupportedOperationError(
|
307
|
+
`Property of milestoning sterotype '${targetStereotype}' should have exactly one parameter`,
|
308
|
+
);
|
309
|
+
}
|
310
|
+
}
|
311
|
+
};
|
@@ -0,0 +1,77 @@
|
|
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
|
+
|
17
|
+
import type {
|
18
|
+
ValueSpecification,
|
19
|
+
SimpleFunctionExpression,
|
20
|
+
AbstractPropertyExpression,
|
21
|
+
MILESTONING_STEREOTYPE,
|
22
|
+
} from '@finos/legend-graph';
|
23
|
+
import type { QueryBuilderDerivedPropertyExpressionState } from '../QueryBuilderPropertyEditorState.js';
|
24
|
+
import type { QueryBuilderMilestoningState } from './QueryBuilderMilestoningState.js';
|
25
|
+
|
26
|
+
export abstract class QueryBuilderMilestoningImplementation {
|
27
|
+
milestoningState: QueryBuilderMilestoningState;
|
28
|
+
readonly stereotype: MILESTONING_STEREOTYPE;
|
29
|
+
|
30
|
+
constructor(
|
31
|
+
queryBuilderMilestoningState: QueryBuilderMilestoningState,
|
32
|
+
stereotype: MILESTONING_STEREOTYPE,
|
33
|
+
) {
|
34
|
+
this.milestoningState = queryBuilderMilestoningState;
|
35
|
+
this.stereotype = stereotype;
|
36
|
+
}
|
37
|
+
|
38
|
+
/**
|
39
|
+
* Gets the milestoning date associated with the given stereotype
|
40
|
+
*/
|
41
|
+
abstract getMilestoningDate(index?: number): ValueSpecification | undefined;
|
42
|
+
|
43
|
+
/**
|
44
|
+
* Gets the tooltip text for given stereotype
|
45
|
+
*/
|
46
|
+
abstract getMilestoningToolTipText(): string;
|
47
|
+
|
48
|
+
/**
|
49
|
+
* Initializes milestoning parameters when they are not defined.
|
50
|
+
* We need to force initialize when we change class as we don't reset the whole milestoning state here.
|
51
|
+
*/
|
52
|
+
abstract initializeMilestoningParameters(force?: boolean): void;
|
53
|
+
|
54
|
+
/**
|
55
|
+
* Checks whether the getAll function has the no of parameters as expected for a given stereotype and sets the corresponding milestoning dates.
|
56
|
+
*/
|
57
|
+
abstract processGetAllParamaters(parameterValues: ValueSpecification[]): void;
|
58
|
+
|
59
|
+
/**
|
60
|
+
* Builds parameters for getAll() function with milestoned class
|
61
|
+
*/
|
62
|
+
abstract buildGetAllParameters(
|
63
|
+
getAllFunction: SimpleFunctionExpression,
|
64
|
+
): void;
|
65
|
+
|
66
|
+
/**
|
67
|
+
* Generates milestoning date for a propertyexpression based on its source and target stereotype
|
68
|
+
*/
|
69
|
+
abstract generateMilestoningDate(
|
70
|
+
isDatePropagationSupported: boolean,
|
71
|
+
hasDefaultMilestoningDate: boolean,
|
72
|
+
prevPropertyExpression: AbstractPropertyExpression | undefined,
|
73
|
+
temporalSource: MILESTONING_STEREOTYPE | undefined,
|
74
|
+
idx?: number,
|
75
|
+
derivedPropertyExpressionState?: QueryBuilderDerivedPropertyExpressionState,
|
76
|
+
): ValueSpecification;
|
77
|
+
}
|