@sapui5/sap.fe.core 1.111.1 → 1.112.0
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/package.json +1 -1
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/ActionRuntime-dbg.js +4 -4
- package/src/sap/fe/core/ActionRuntime.js +1 -1
- package/src/sap/fe/core/ActionRuntime.js.map +1 -1
- package/src/sap/fe/core/ActionRuntime.ts +11 -11
- package/src/sap/fe/core/AppComponent-dbg.js +27 -5
- package/src/sap/fe/core/AppComponent.js +1 -1
- package/src/sap/fe/core/AppComponent.js.map +1 -1
- package/src/sap/fe/core/AppComponent.ts +58 -3
- package/src/sap/fe/core/AppStateHandler-dbg.js +5 -2
- package/src/sap/fe/core/AppStateHandler.js +1 -1
- package/src/sap/fe/core/AppStateHandler.js.map +1 -1
- package/src/sap/fe/core/AppStateHandler.ts +10 -1
- package/src/sap/fe/core/BaseController-dbg.js +1 -1
- package/src/sap/fe/core/BaseController.ts +2 -1
- package/src/sap/fe/core/CommonUtils-dbg.js +152 -365
- package/src/sap/fe/core/CommonUtils.js +1 -1
- package/src/sap/fe/core/CommonUtils.js.map +1 -1
- package/src/sap/fe/core/CommonUtils.ts +201 -478
- package/src/sap/fe/core/ExtensionAPI-dbg.js +2 -1
- package/src/sap/fe/core/ExtensionAPI.js +1 -1
- package/src/sap/fe/core/ExtensionAPI.js.map +1 -1
- package/src/sap/fe/core/ExtensionAPI.ts +9 -1
- package/src/sap/fe/core/PageController-dbg.js +26 -31
- package/src/sap/fe/core/PageController.js +1 -1
- package/src/sap/fe/core/PageController.js.map +1 -1
- package/src/sap/fe/core/PageController.ts +17 -3
- package/src/sap/fe/core/ResourceModel-dbg.js +71 -0
- package/src/sap/fe/core/ResourceModel.js +6 -0
- package/src/sap/fe/core/ResourceModel.js.map +1 -0
- package/src/sap/fe/core/ResourceModel.ts +67 -0
- package/src/sap/fe/core/TemplateComponent-dbg.js +1 -1
- package/src/sap/fe/core/TemplateComponent.ts +1 -0
- package/src/sap/fe/core/TemplateModel-dbg.js +1 -1
- package/src/sap/fe/core/TemplateModel.ts +6 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel-dbg.js +5 -7
- package/src/sap/fe/core/buildingBlocks/AttributeModel.js +1 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel.js.map +1 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +6 -5
- package/src/sap/fe/core/buildingBlocks/BuildingBlockBase-dbg.js +163 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockBase.js +6 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockBase.js.map +1 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockBase.ts +169 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockSupport-dbg.js +88 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockSupport.js +6 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockSupport.js.map +1 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockSupport.ts +147 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockTemplateProcessor-dbg.js +905 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockTemplateProcessor.js +21 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockTemplateProcessor.js.map +1 -0
- package/src/sap/fe/core/buildingBlocks/{BuildingBlockRuntime.ts → BuildingBlockTemplateProcessor.ts} +290 -362
- package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlock-dbg.js +79 -0
- package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlock.js +15 -0
- package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlock.js.map +1 -0
- package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlock.ts +68 -0
- package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlockFragment-dbg.js +162 -0
- package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlockFragment.js +6 -0
- package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlockFragment.js.map +1 -0
- package/src/sap/fe/core/buildingBlocks/RuntimeBuildingBlockFragment.ts +181 -0
- package/src/sap/fe/core/buildingBlocks/TraceInfo-dbg.js +4 -2
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +1 -1
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js.map +1 -1
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +5 -3
- package/src/sap/fe/core/controllerextensions/EditFlow-dbg.js +890 -220
- package/src/sap/fe/core/controllerextensions/EditFlow.js +1 -1
- package/src/sap/fe/core/controllerextensions/EditFlow.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +974 -239
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation-dbg.js +24 -34
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +1 -1
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +71 -61
- package/src/sap/fe/core/controllerextensions/InternalRouting-dbg.js +14 -17
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +1 -1
- package/src/sap/fe/core/controllerextensions/InternalRouting.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +23 -17
- package/src/sap/fe/core/controllerextensions/KPIManagement-dbg.js +1 -1
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +2 -0
- package/src/sap/fe/core/controllerextensions/MassEdit-dbg.js +3 -3
- package/src/sap/fe/core/controllerextensions/MassEdit.js +1 -1
- package/src/sap/fe/core/controllerextensions/MassEdit.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +2 -2
- package/src/sap/fe/core/controllerextensions/MessageHandler-dbg.js +2 -1
- package/src/sap/fe/core/controllerextensions/MessageHandler.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +2 -0
- package/src/sap/fe/core/controllerextensions/PageReady-dbg.js +1 -1
- package/src/sap/fe/core/controllerextensions/PageReady.ts +24 -0
- package/src/sap/fe/core/controllerextensions/Paginator-dbg.js +2 -1
- package/src/sap/fe/core/controllerextensions/Paginator.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/Paginator.ts +7 -0
- package/src/sap/fe/core/controllerextensions/Placeholder-dbg.js +1 -1
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +8 -0
- package/src/sap/fe/core/controllerextensions/Share-dbg.js +8 -1
- package/src/sap/fe/core/controllerextensions/Share.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/Share.ts +11 -0
- package/src/sap/fe/core/controllerextensions/SideEffects-dbg.js +14 -13
- package/src/sap/fe/core/controllerextensions/SideEffects.js +1 -1
- package/src/sap/fe/core/controllerextensions/SideEffects.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +27 -27
- package/src/sap/fe/core/controllerextensions/ViewState-dbg.js +17 -8
- package/src/sap/fe/core/controllerextensions/ViewState.js +1 -1
- package/src/sap/fe/core/controllerextensions/ViewState.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/ViewState.ts +35 -14
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase-dbg.js +6 -5
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +1 -1
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +7 -4
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync-dbg.js +285 -82
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +1 -1
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.ts +326 -89
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon-dbg.js +23 -2
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +1 -1
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +32 -3
- package/src/sap/fe/core/controllerextensions/collaboration/Manage-dbg.js +1 -1
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.ts +2 -3
- package/src/sap/fe/core/controllerextensions/collaboration/ManageDialog.fragment.xml +17 -3
- package/src/sap/fe/core/controllerextensions/dialog/OperationsDialog.block-dbg.js +65 -34
- package/src/sap/fe/core/controllerextensions/dialog/OperationsDialog.block.js +1 -1
- package/src/sap/fe/core/controllerextensions/dialog/OperationsDialog.block.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/dialog/OperationsDialog.block.tsx +33 -18
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper-dbg.js +45 -31
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +52 -42
- package/src/sap/fe/core/controllerextensions/editFlow/draft-dbg.js +44 -49
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +43 -63
- package/src/sap/fe/core/controllerextensions/editFlow/draftDataLossPopup.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/operations/_internal-dbg.js +77 -0
- package/src/sap/fe/core/controllerextensions/editFlow/operations/_internal.js +6 -0
- package/src/sap/fe/core/controllerextensions/editFlow/operations/_internal.js.map +1 -0
- package/src/sap/fe/core/controllerextensions/editFlow/operations/_internal.ts +114 -0
- package/src/sap/fe/core/controllerextensions/editFlow/operations/facade-dbg.js +1505 -0
- package/src/sap/fe/core/controllerextensions/editFlow/operations/facade.js +6 -0
- package/src/sap/fe/core/controllerextensions/editFlow/operations/facade.js.map +1 -0
- package/src/sap/fe/core/controllerextensions/editFlow/operations/facade.ts +1985 -0
- package/src/sap/fe/core/controllerextensions/editFlow/operations-dbg.js +3 -1415
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/operations.ts +2 -1921
- package/src/sap/fe/core/controllerextensions/editFlow/sticky-dbg.js +10 -11
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +9 -13
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling-dbg.js +43 -41
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +1 -1
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +44 -47
- package/src/sap/fe/core/controllerextensions/pageReady/DataQueryWatcher-dbg.js +12 -1
- package/src/sap/fe/core/controllerextensions/pageReady/DataQueryWatcher.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/pageReady/DataQueryWatcher.ts +19 -0
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy-dbg.js +12 -13
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +1 -1
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js.map +1 -1
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +32 -13
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +4 -1
- package/src/sap/fe/core/controls/CommandExecution-dbg.js +16 -5
- package/src/sap/fe/core/controls/CommandExecution.js +1 -1
- package/src/sap/fe/core/controls/CommandExecution.js.map +1 -1
- package/src/sap/fe/core/controls/CommandExecution.ts +15 -3
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler-dbg.js +3 -2
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +1 -1
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js.map +1 -1
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +4 -1
- package/src/sap/fe/core/controls/FilterBar-dbg.js +1 -1
- package/src/sap/fe/core/controls/FilterBar.ts +5 -0
- package/src/sap/fe/core/controls/FormElementWrapper-dbg.js +1 -1
- package/src/sap/fe/core/controls/FormElementWrapper.ts +3 -0
- package/src/sap/fe/core/controls/filterbar/FilterContainer-dbg.js +1 -1
- package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +7 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilter-dbg.js +1 -1
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +4 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer-dbg.js +1 -1
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +10 -0
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils-dbg.js +4 -3
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +1 -1
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js.map +1 -1
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +3 -2
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +0 -1
- package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +2 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers-dbg.js +6 -1
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +1 -1
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js.map +1 -1
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +5 -0
- package/src/sap/fe/core/converters/ConverterContext-dbg.js +1 -1
- package/src/sap/fe/core/converters/ConverterContext.ts +2 -1
- package/src/sap/fe/core/converters/ManifestSettings-dbg.js +1 -8
- package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.js.map +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +15 -6
- package/src/sap/fe/core/converters/ManifestWrapper-dbg.js +17 -1
- package/src/sap/fe/core/converters/ManifestWrapper.js +1 -1
- package/src/sap/fe/core/converters/ManifestWrapper.js.map +1 -1
- package/src/sap/fe/core/converters/ManifestWrapper.ts +16 -0
- package/src/sap/fe/core/converters/MetaModelConverter-dbg.js +61 -49
- package/src/sap/fe/core/converters/MetaModelConverter.js +1 -1
- package/src/sap/fe/core/converters/MetaModelConverter.js.map +1 -1
- package/src/sap/fe/core/converters/MetaModelConverter.ts +65 -51
- package/src/sap/fe/core/converters/TemplateConverter-dbg.js +2 -1
- package/src/sap/fe/core/converters/TemplateConverter.js.map +1 -1
- package/src/sap/fe/core/converters/TemplateConverter.ts +2 -1
- package/src/sap/fe/core/converters/annotations/DataField-dbg.js +65 -16
- package/src/sap/fe/core/converters/annotations/DataField.js +1 -1
- package/src/sap/fe/core/converters/annotations/DataField.js.map +1 -1
- package/src/sap/fe/core/converters/annotations/DataField.ts +62 -18
- package/src/sap/fe/core/converters/common/AnnotationConverter-dbg.js +1010 -957
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +1 -1
- package/src/sap/fe/core/converters/common/AnnotationConverter.js.map +1 -1
- package/src/sap/fe/core/converters/controls/Common/Action-dbg.js +8 -8
- package/src/sap/fe/core/converters/controls/Common/Action.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/Action.js.map +1 -1
- package/src/sap/fe/core/converters/controls/Common/Action.ts +28 -26
- package/src/sap/fe/core/converters/controls/Common/Chart-dbg.js +95 -33
- package/src/sap/fe/core/converters/controls/Common/Chart.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/Chart.js.map +1 -1
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +133 -49
- package/src/sap/fe/core/converters/controls/Common/DataVisualization-dbg.js +99 -62
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js.map +1 -1
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +140 -75
- package/src/sap/fe/core/converters/controls/Common/Form-dbg.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/Form.ts +3 -3
- package/src/sap/fe/core/converters/controls/Common/KPI-dbg.js +6 -6
- package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/KPI.js.map +1 -1
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +15 -15
- package/src/sap/fe/core/converters/controls/Common/Table-dbg.js +97 -69
- package/src/sap/fe/core/converters/controls/Common/Table.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/Table.js.map +1 -1
- package/src/sap/fe/core/converters/controls/Common/Table.ts +161 -137
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions-dbg.js +3 -3
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js.map +1 -1
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +10 -9
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar-dbg.js +48 -44
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +1 -1
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js.map +1 -1
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +130 -86
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters-dbg.js +34 -26
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +1 -1
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js.map +1 -1
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +62 -45
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar-dbg.js +1 -1
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.ts +1 -1
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet-dbg.js +6 -6
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +1 -1
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js.map +1 -1
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +5 -8
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection-dbg.js +34 -13
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +1 -1
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js.map +1 -1
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +54 -20
- package/src/sap/fe/core/converters/helpers/Aggregation-dbg.js +3 -1
- package/src/sap/fe/core/converters/helpers/Aggregation.js.map +1 -1
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +8 -0
- package/src/sap/fe/core/converters/helpers/ConfigurableObject-dbg.js +7 -6
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +1 -1
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.js.map +1 -1
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +19 -10
- package/src/sap/fe/core/converters/helpers/DataFieldHelper-dbg.js +1 -1
- package/src/sap/fe/core/converters/helpers/DataFieldHelper.ts +7 -2
- package/src/sap/fe/core/converters/helpers/ID-dbg.js +1 -1
- package/src/sap/fe/core/converters/helpers/ID.ts +2 -1
- package/src/sap/fe/core/converters/helpers/IssueManager-dbg.js +9 -8
- package/src/sap/fe/core/converters/helpers/IssueManager.js +1 -1
- package/src/sap/fe/core/converters/helpers/IssueManager.js.map +1 -1
- package/src/sap/fe/core/converters/helpers/IssueManager.ts +8 -7
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction-dbg.js +8 -7
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +1 -1
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js.map +1 -1
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +9 -6
- package/src/sap/fe/core/converters/templates/ListReportConverter-dbg.js +25 -33
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +1 -1
- package/src/sap/fe/core/converters/templates/ListReportConverter.js.map +1 -1
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +35 -35
- package/src/sap/fe/core/converters/templates/ObjectPageConverter-dbg.js +11 -4
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +1 -1
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js.map +1 -1
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +7 -1
- package/src/sap/fe/core/formatters/FPMFormatter-dbg.js +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.ts +1 -1
- package/src/sap/fe/core/formatters/FiscalFormat-dbg.js +2 -2
- package/src/sap/fe/core/formatters/FiscalFormat.ts +6 -1
- package/src/sap/fe/core/formatters/TableFormatter-dbg.js +2 -2
- package/src/sap/fe/core/formatters/TableFormatter.js +1 -1
- package/src/sap/fe/core/formatters/TableFormatter.js.map +1 -1
- package/src/sap/fe/core/formatters/TableFormatter.ts +1 -1
- package/src/sap/fe/core/formatters/ValueFormatter-dbg.js +5 -5
- package/src/sap/fe/core/formatters/ValueFormatter.js +1 -1
- package/src/sap/fe/core/formatters/ValueFormatter.js.map +1 -1
- package/src/sap/fe/core/formatters/ValueFormatter.ts +6 -4
- package/src/sap/fe/core/fpm/Component-dbg.js +1 -1
- package/src/sap/fe/core/fpm/Component.ts +1 -0
- package/src/sap/fe/core/fpm/manifest.json +1 -1
- package/src/sap/fe/core/helpers/AppStartupHelper-dbg.js +2 -2
- package/src/sap/fe/core/helpers/AppStartupHelper.js +1 -1
- package/src/sap/fe/core/helpers/AppStartupHelper.js.map +1 -1
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +1 -1
- package/src/sap/fe/core/helpers/BindingToolkit-dbg.js +6 -6
- package/src/sap/fe/core/helpers/BindingToolkit.js.map +1 -1
- package/src/sap/fe/core/helpers/BindingToolkit.ts +8 -8
- package/src/sap/fe/core/helpers/ClassSupport-dbg.js +1 -1
- package/src/sap/fe/core/helpers/ClassSupport.js.map +1 -1
- package/src/sap/fe/core/helpers/ClassSupport.ts +1 -0
- package/src/sap/fe/core/helpers/DeleteHelper-dbg.js +93 -62
- package/src/sap/fe/core/helpers/DeleteHelper.js +1 -1
- package/src/sap/fe/core/helpers/DeleteHelper.js.map +1 -1
- package/src/sap/fe/core/helpers/DeleteHelper.ts +140 -185
- package/src/sap/fe/core/helpers/MassEditHelper-dbg.js +20 -18
- package/src/sap/fe/core/helpers/MassEditHelper.js +1 -1
- package/src/sap/fe/core/helpers/MassEditHelper.js.map +1 -1
- package/src/sap/fe/core/helpers/MassEditHelper.ts +22 -23
- package/src/sap/fe/core/helpers/MessageStrip-dbg.js +4 -5
- package/src/sap/fe/core/helpers/MessageStrip.js +1 -1
- package/src/sap/fe/core/helpers/MessageStrip.js.map +1 -1
- package/src/sap/fe/core/helpers/MessageStrip.ts +4 -4
- package/src/sap/fe/core/helpers/MetaModelFunction-dbg.js +354 -0
- package/src/sap/fe/core/helpers/MetaModelFunction.js +6 -0
- package/src/sap/fe/core/helpers/MetaModelFunction.js.map +1 -0
- package/src/sap/fe/core/helpers/MetaModelFunction.ts +408 -0
- package/src/sap/fe/core/helpers/ModelHelper-dbg.js +13 -13
- package/src/sap/fe/core/helpers/ModelHelper.js.map +1 -1
- package/src/sap/fe/core/helpers/ModelHelper.ts +13 -13
- package/src/sap/fe/core/helpers/PasteHelper-dbg.js +5 -5
- package/src/sap/fe/core/helpers/PasteHelper.js +1 -1
- package/src/sap/fe/core/helpers/PasteHelper.js.map +1 -1
- package/src/sap/fe/core/helpers/PasteHelper.ts +6 -10
- package/src/sap/fe/core/helpers/ResourceModelHelper-dbg.js +26 -0
- package/src/sap/fe/core/helpers/ResourceModelHelper.js +6 -0
- package/src/sap/fe/core/helpers/ResourceModelHelper.js.map +1 -0
- package/src/sap/fe/core/helpers/ResourceModelHelper.ts +19 -0
- package/src/sap/fe/core/helpers/SemanticDateOperators-dbg.js +93 -18
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +1 -1
- package/src/sap/fe/core/helpers/SemanticDateOperators.js.map +1 -1
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +70 -17
- package/src/sap/fe/core/helpers/SemanticKeyHelper-dbg.js +2 -2
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +1 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js.map +1 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +1 -1
- package/src/sap/fe/core/helpers/Synchronization-dbg.js +1 -1
- package/src/sap/fe/core/helpers/Synchronization.ts +2 -0
- package/src/sap/fe/core/helpers/TypeGuards-dbg.js +5 -1
- package/src/sap/fe/core/helpers/TypeGuards.js +1 -1
- package/src/sap/fe/core/helpers/TypeGuards.js.map +1 -1
- package/src/sap/fe/core/helpers/TypeGuards.ts +12 -1
- package/src/sap/fe/core/jsx-runtime/ViewLoader-dbg.js +2 -1
- package/src/sap/fe/core/jsx-runtime/ViewLoader.js.map +1 -1
- package/src/sap/fe/core/jsx-runtime/ViewLoader.tsx +6 -2
- package/src/sap/fe/core/jsx-runtime/jsx-control-dbg.js +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx-control.ts +3 -1
- package/src/sap/fe/core/jsx-runtime/useMDXComponents-dbg.js +3 -3
- package/src/sap/fe/core/jsx-runtime/useMDXComponents.js +1 -1
- package/src/sap/fe/core/jsx-runtime/useMDXComponents.js.map +1 -1
- package/src/sap/fe/core/jsx-runtime/useMDXComponents.tsx +1 -1
- package/src/sap/fe/core/library-dbg.js +2 -2
- package/src/sap/fe/core/library-preload.js +127 -125
- package/src/sap/fe/core/library-preload.js.map +1 -1
- package/src/sap/fe/core/library.js +1 -1
- package/src/sap/fe/core/library.ts +7 -0
- package/src/sap/fe/core/manifest.json +1 -1
- package/src/sap/fe/core/messagebundle.properties +33 -0
- package/src/sap/fe/core/messagebundle_ar.properties +12 -10
- package/src/sap/fe/core/messagebundle_bg.properties +11 -9
- package/src/sap/fe/core/messagebundle_ca.properties +11 -9
- package/src/sap/fe/core/messagebundle_cs.properties +11 -9
- package/src/sap/fe/core/messagebundle_cy.properties +11 -9
- package/src/sap/fe/core/messagebundle_da.properties +11 -9
- package/src/sap/fe/core/messagebundle_de.properties +3 -1
- package/src/sap/fe/core/messagebundle_el.properties +11 -9
- package/src/sap/fe/core/messagebundle_en.properties +3 -1
- package/src/sap/fe/core/messagebundle_en_GB.properties +2 -0
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +2 -0
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +20 -0
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +21 -3
- package/src/sap/fe/core/messagebundle_es.properties +11 -9
- package/src/sap/fe/core/messagebundle_es_MX.properties +11 -9
- package/src/sap/fe/core/messagebundle_et.properties +11 -9
- package/src/sap/fe/core/messagebundle_fi.properties +11 -9
- package/src/sap/fe/core/messagebundle_fr.properties +11 -9
- package/src/sap/fe/core/messagebundle_fr_CA.properties +3 -1
- package/src/sap/fe/core/messagebundle_hi.properties +2 -0
- package/src/sap/fe/core/messagebundle_hr.properties +11 -9
- package/src/sap/fe/core/messagebundle_hu.properties +11 -9
- package/src/sap/fe/core/messagebundle_id.properties +3 -1
- package/src/sap/fe/core/messagebundle_it.properties +11 -9
- package/src/sap/fe/core/messagebundle_iw.properties +11 -9
- package/src/sap/fe/core/messagebundle_ja.properties +11 -9
- package/src/sap/fe/core/messagebundle_kk.properties +11 -9
- package/src/sap/fe/core/messagebundle_ko.properties +2 -0
- package/src/sap/fe/core/messagebundle_lt.properties +11 -9
- package/src/sap/fe/core/messagebundle_lv.properties +2 -0
- package/src/sap/fe/core/messagebundle_ms.properties +12 -10
- package/src/sap/fe/core/messagebundle_nl.properties +12 -10
- package/src/sap/fe/core/messagebundle_no.properties +11 -9
- package/src/sap/fe/core/messagebundle_pl.properties +2 -0
- package/src/sap/fe/core/messagebundle_pt.properties +11 -9
- package/src/sap/fe/core/messagebundle_pt_PT.properties +11 -9
- package/src/sap/fe/core/messagebundle_ro.properties +3 -1
- package/src/sap/fe/core/messagebundle_ru.properties +3 -1
- package/src/sap/fe/core/messagebundle_sh.properties +11 -9
- package/src/sap/fe/core/messagebundle_sk.properties +11 -9
- package/src/sap/fe/core/messagebundle_sl.properties +11 -9
- package/src/sap/fe/core/messagebundle_sv.properties +2 -0
- package/src/sap/fe/core/messagebundle_th.properties +11 -9
- package/src/sap/fe/core/messagebundle_tr.properties +11 -9
- package/src/sap/fe/core/messagebundle_uk.properties +11 -9
- package/src/sap/fe/core/messagebundle_vi.properties +12 -10
- package/src/sap/fe/core/messagebundle_zh_CN.properties +2 -0
- package/src/sap/fe/core/messagebundle_zh_TW.properties +2 -0
- package/src/sap/fe/core/operationsHelper-dbg.js +70 -44
- package/src/sap/fe/core/operationsHelper.js +1 -1
- package/src/sap/fe/core/operationsHelper.js.map +1 -1
- package/src/sap/fe/core/operationsHelper.ts +88 -63
- package/src/sap/fe/core/rootView/Fcl-dbg.controller.js +1 -1
- package/src/sap/fe/core/rootView/Fcl.controller.ts +10 -0
- package/src/sap/fe/core/rootView/NavContainer-dbg.controller.js +2 -2
- package/src/sap/fe/core/rootView/NavContainer.controller.js +1 -1
- package/src/sap/fe/core/rootView/NavContainer.controller.js.map +1 -1
- package/src/sap/fe/core/rootView/NavContainer.controller.ts +5 -3
- package/src/sap/fe/core/rootView/RootViewBaseController-dbg.js +4 -3
- package/src/sap/fe/core/rootView/RootViewBaseController.js +1 -1
- package/src/sap/fe/core/rootView/RootViewBaseController.js.map +1 -1
- package/src/sap/fe/core/rootView/RootViewBaseController.ts +15 -5
- package/src/sap/fe/core/services/AsyncComponentServiceFactory-dbg.js +1 -1
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory-dbg.js +1 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js.map +1 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +15 -1
- package/src/sap/fe/core/services/EnvironmentServiceFactory-dbg.js +1 -1
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js.map +1 -1
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +4 -1
- package/src/sap/fe/core/services/NavigationServiceFactory-dbg.js +9 -1
- package/src/sap/fe/core/services/NavigationServiceFactory.js.map +1 -1
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +19 -1
- package/src/sap/fe/core/services/ResourceModelServiceFactory-dbg.js +2 -2
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +1 -1
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js.map +1 -1
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +10 -3
- package/src/sap/fe/core/services/RoutingServiceFactory-dbg.js +3 -3
- package/src/sap/fe/core/services/RoutingServiceFactory.js +1 -1
- package/src/sap/fe/core/services/RoutingServiceFactory.js.map +1 -1
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +29 -3
- package/src/sap/fe/core/services/ShellServicesFactory-dbg.js +1 -1
- package/src/sap/fe/core/services/ShellServicesFactory.ts +14 -2
- package/src/sap/fe/core/services/SideEffectsServiceFactory-dbg.js +448 -279
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +1 -1
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js.map +1 -1
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +502 -333
- package/src/sap/fe/core/services/TemplatedViewServiceFactory-dbg.js +18 -5
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +1 -1
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js.map +1 -1
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +41 -12
- package/src/sap/fe/core/support/Diagnostics-dbg.js +1 -1
- package/src/sap/fe/core/support/Diagnostics.ts +5 -0
- package/src/sap/fe/core/templating/DataModelPathHelper-dbg.js +185 -86
- package/src/sap/fe/core/templating/DataModelPathHelper.js +1 -1
- package/src/sap/fe/core/templating/DataModelPathHelper.js.map +1 -1
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +190 -82
- package/src/sap/fe/core/templating/DisplayModeFormatter-dbg.js +1 -1
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +1 -1
- package/src/sap/fe/core/templating/EntitySetHelper-dbg.js +2 -3
- package/src/sap/fe/core/templating/EntitySetHelper.js +1 -1
- package/src/sap/fe/core/templating/EntitySetHelper.js.map +1 -1
- package/src/sap/fe/core/templating/EntitySetHelper.ts +1 -3
- package/src/sap/fe/core/templating/FilterHelper-dbg.js +3 -3
- package/src/sap/fe/core/templating/FilterHelper.js +1 -1
- package/src/sap/fe/core/templating/FilterHelper.js.map +1 -1
- package/src/sap/fe/core/templating/FilterHelper.ts +5 -3
- package/src/sap/fe/core/templating/PropertyHelper-dbg.js +1 -1
- package/src/sap/fe/core/templating/PropertyHelper.ts +2 -2
- package/src/sap/fe/core/templating/UIFormatters-dbg.js +1 -1
- package/src/sap/fe/core/templating/UIFormatters.ts +4 -0
- package/src/sap/fe/core/type/DateTimeWithTimezone-dbg.js +1 -1
- package/src/sap/fe/core/type/DateTimeWithTimezone.ts +2 -0
- package/src/sap/fe/core/type/FiscalDate-dbg.js +2 -2
- package/src/sap/fe/core/type/FiscalDate.js.map +1 -1
- package/src/sap/fe/core/type/FiscalDate.ts +2 -1
- package/src/sap/fe/core/type/TypeUtil-dbg.js +5 -10
- package/src/sap/fe/core/type/TypeUtil.js +1 -1
- package/src/sap/fe/core/type/TypeUtil.js.map +1 -1
- package/src/sap/fe/core/type/TypeUtil.ts +3 -6
- package/src/sap/fe/core/buildingBlocks/BuildingBlock-dbg.js +0 -410
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +0 -15
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.js.map +0 -1
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +0 -536
- package/src/sap/fe/core/buildingBlocks/BuildingBlockFragment-dbg.js +0 -44
- package/src/sap/fe/core/buildingBlocks/BuildingBlockFragment.js +0 -6
- package/src/sap/fe/core/buildingBlocks/BuildingBlockFragment.js.map +0 -1
- package/src/sap/fe/core/buildingBlocks/BuildingBlockFragment.ts +0 -14
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime-dbg.js +0 -948
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +0 -19
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js.map +0 -1
- package/src/sap/fe/core/controllerextensions/InternalEditFlow-dbg.js +0 -711
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +0 -6
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js.map +0 -1
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +0 -863
- package/src/sap/fe/core/controls/ConditionalWrapper-dbg.js +0 -151
- package/src/sap/fe/core/controls/ConditionalWrapper.js +0 -6
- package/src/sap/fe/core/controls/ConditionalWrapper.js.map +0 -1
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +0 -88
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper-dbg.js +0 -330
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +0 -6
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js.map +0 -1
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +0 -292
- package/src/sap/fe/core/controls/CustomQuickViewPage-dbg.js +0 -126
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +0 -6
- package/src/sap/fe/core/controls/CustomQuickViewPage.js.map +0 -1
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +0 -105
- package/src/sap/fe/core/controls/FieldWrapper-dbg.js +0 -194
- package/src/sap/fe/core/controls/FieldWrapper.js +0 -6
- package/src/sap/fe/core/controls/FieldWrapper.js.map +0 -1
- package/src/sap/fe/core/controls/FieldWrapper.ts +0 -121
- package/src/sap/fe/core/controls/FileWrapper-dbg.js +0 -280
- package/src/sap/fe/core/controls/FileWrapper.js +0 -6
- package/src/sap/fe/core/controls/FileWrapper.js.map +0 -1
- package/src/sap/fe/core/controls/FileWrapper.ts +0 -202
- package/src/sap/fe/core/helpers/SideEffectsHelper-dbg.js +0 -141
- package/src/sap/fe/core/helpers/SideEffectsHelper.js +0 -6
- package/src/sap/fe/core/helpers/SideEffectsHelper.js.map +0 -1
- package/src/sap/fe/core/helpers/SideEffectsHelper.ts +0 -129
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
Action,
|
|
3
|
-
AnnotationTerm,
|
|
4
|
-
ComplexType,
|
|
5
|
-
ConvertedMetadata,
|
|
6
|
-
EntityType,
|
|
7
|
-
NavigationProperty,
|
|
8
|
-
NavigationPropertyPath,
|
|
9
|
-
Property,
|
|
10
|
-
PropertyPath
|
|
11
|
-
} from "@sap-ux/vocabularies-types";
|
|
1
|
+
import type { Action, ConvertedMetadata, EntityType, NavigationPropertyPath, PropertyPath } from "@sap-ux/vocabularies-types";
|
|
12
2
|
import type { SideEffectsType as CommonSideEffectsType } from "@sap-ux/vocabularies-types/vocabularies/Common";
|
|
13
3
|
import { CommonAnnotationTypes } from "@sap-ux/vocabularies-types/vocabularies/Common";
|
|
14
4
|
import Log from "sap/base/Log";
|
|
15
|
-
import
|
|
16
|
-
|
|
5
|
+
import {
|
|
6
|
+
convertTypes,
|
|
7
|
+
EnvironmentCapabilities,
|
|
8
|
+
getInvolvedDataModelObjects,
|
|
9
|
+
isComplexType,
|
|
10
|
+
isEntityType
|
|
11
|
+
} from "sap/fe/core/converters/MetaModelConverter";
|
|
17
12
|
import Service from "sap/ui/core/service/Service";
|
|
18
13
|
import ServiceFactory from "sap/ui/core/service/ServiceFactory";
|
|
19
14
|
import type Context from "sap/ui/model/odata/v4/Context";
|
|
20
15
|
import type ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
|
|
21
|
-
import type { ServiceContext
|
|
22
|
-
import {
|
|
16
|
+
import type { ServiceContext } from "types/metamodel_types";
|
|
17
|
+
import { DataModelObjectPath, enhanceDataModelPath, getTargetNavigationPath, getTargetObjectPath } from "../templating/DataModelPathHelper";
|
|
18
|
+
import { getAssociatedTextPropertyPath, isProperty } from "../templating/PropertyHelper";
|
|
23
19
|
|
|
24
20
|
type SideEffectsSettings = {};
|
|
25
21
|
|
|
26
|
-
export type
|
|
22
|
+
export type SideEffectsEntityType = {
|
|
27
23
|
$NavigationPropertyPath: string;
|
|
28
|
-
$PropertyPath?: string;
|
|
29
24
|
};
|
|
30
|
-
export type SideEffectsTarget =
|
|
25
|
+
export type SideEffectsTarget = SideEffectsEntityType | string;
|
|
31
26
|
|
|
32
|
-
type SideEffectsTargetType = {
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
export type SideEffectsTargetType = {
|
|
28
|
+
targetProperties: string[];
|
|
29
|
+
targetEntities: SideEffectsEntityType[];
|
|
35
30
|
};
|
|
36
31
|
|
|
37
32
|
type BaseSideEffectsType = {
|
|
33
|
+
sourceProperties?: string[];
|
|
34
|
+
sourceEntities?: SideEffectsEntityType[];
|
|
38
35
|
fullyQualifiedName: string;
|
|
39
36
|
} & SideEffectsTargetType;
|
|
40
37
|
|
|
38
|
+
export type ODataSideEffectsType = BaseSideEffectsType & {
|
|
39
|
+
triggerAction?: string;
|
|
40
|
+
};
|
|
41
|
+
|
|
41
42
|
export type ActionSideEffectsType = {
|
|
42
43
|
pathExpressions: SideEffectsTarget[];
|
|
43
44
|
triggerActions?: string[];
|
|
@@ -45,22 +46,21 @@ export type ActionSideEffectsType = {
|
|
|
45
46
|
|
|
46
47
|
export type ControlSideEffectsType = Partial<BaseSideEffectsType> & {
|
|
47
48
|
fullyQualifiedName: string;
|
|
48
|
-
|
|
49
|
+
sourceProperties: string[];
|
|
49
50
|
sourceControlId: string;
|
|
50
51
|
};
|
|
51
52
|
|
|
52
|
-
export type ODataSideEffectsType = BaseSideEffectsType & {
|
|
53
|
-
SourceProperties?: PropertyPath[];
|
|
54
|
-
SourceEntities?: NavigationPropertyPath[];
|
|
55
|
-
TriggerAction?: string;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
53
|
export type SideEffectsType = ControlSideEffectsType | ODataSideEffectsType;
|
|
59
54
|
|
|
55
|
+
//TODO fix this type in the ux vocabularies
|
|
56
|
+
type CommonSideEffectTypeWithQualifier = CommonSideEffectsType & { qualifier?: string };
|
|
57
|
+
|
|
60
58
|
export type ODataSideEffectsEntityDictionary = Record<string, ODataSideEffectsType>;
|
|
61
59
|
export type ODataSideEffectsActionDictionary = Record<string, ActionSideEffectsType>;
|
|
62
60
|
export type ControlSideEffectsEntityDictionary = Record<string, ControlSideEffectsType>;
|
|
63
61
|
|
|
62
|
+
export type SideEffectInfoForSource = { entity: string; qualifier?: string; hasUniqueSourceProperty?: boolean };
|
|
63
|
+
|
|
64
64
|
type SideEffectsOriginRegistry = {
|
|
65
65
|
oData: {
|
|
66
66
|
entities: {
|
|
@@ -75,26 +75,30 @@ type SideEffectsOriginRegistry = {
|
|
|
75
75
|
};
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
-
type ExtractorPropertyInfo = {
|
|
79
|
-
property: Property;
|
|
80
|
-
navigationPath?: string;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
78
|
export class SideEffectsService extends Service<SideEffectsSettings> {
|
|
84
79
|
initPromise!: Promise<SideEffectsService>;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
80
|
+
|
|
81
|
+
private sideEffectsRegistry!: SideEffectsOriginRegistry;
|
|
82
|
+
|
|
83
|
+
private capabilities!: EnvironmentCapabilities | undefined;
|
|
84
|
+
|
|
85
|
+
private isInitialized!: boolean;
|
|
86
|
+
|
|
87
|
+
private sourcesToSideEffectMappings!: {
|
|
88
|
+
entities: Record<string, SideEffectInfoForSource[]>;
|
|
89
|
+
properties: Record<string, SideEffectInfoForSource[]>;
|
|
90
|
+
};
|
|
91
|
+
|
|
88
92
|
// !: means that we know it will be assigned before usage
|
|
89
93
|
init() {
|
|
90
|
-
this.
|
|
94
|
+
this.sideEffectsRegistry = {
|
|
91
95
|
oData: {
|
|
92
96
|
entities: {},
|
|
93
97
|
actions: {}
|
|
94
98
|
},
|
|
95
99
|
control: {}
|
|
96
100
|
};
|
|
97
|
-
this.
|
|
101
|
+
this.isInitialized = false;
|
|
98
102
|
this.initPromise = Promise.resolve(this);
|
|
99
103
|
}
|
|
100
104
|
|
|
@@ -107,113 +111,102 @@ export class SideEffectsService extends Service<SideEffectsSettings> {
|
|
|
107
111
|
*
|
|
108
112
|
* Ensure the sourceControlId matches the associated SAPUI5 control ID.
|
|
109
113
|
*
|
|
110
|
-
* @private
|
|
111
114
|
* @ui5-restricted
|
|
112
|
-
* @param
|
|
113
|
-
* @param
|
|
115
|
+
* @param entityType Name of the entity type
|
|
116
|
+
* @param sideEffect SideEffects definition
|
|
114
117
|
*/
|
|
115
|
-
public addControlSideEffects(
|
|
116
|
-
if (
|
|
117
|
-
const
|
|
118
|
-
...
|
|
119
|
-
fullyQualifiedName: `${
|
|
118
|
+
public addControlSideEffects(entityType: string, sideEffect: Omit<ControlSideEffectsType, "fullyQualifiedName">): void {
|
|
119
|
+
if (sideEffect.sourceControlId) {
|
|
120
|
+
const controlSideEffect: ControlSideEffectsType = {
|
|
121
|
+
...sideEffect,
|
|
122
|
+
fullyQualifiedName: `${entityType}/SideEffectsForControl/${sideEffect.sourceControlId}`
|
|
120
123
|
};
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
this.
|
|
124
|
+
const entityControlSideEffects = this.sideEffectsRegistry.control[entityType] || {};
|
|
125
|
+
entityControlSideEffects[controlSideEffect.sourceControlId] = controlSideEffect;
|
|
126
|
+
this.sideEffectsRegistry.control[entityType] = entityControlSideEffects;
|
|
124
127
|
}
|
|
125
128
|
}
|
|
126
129
|
|
|
127
130
|
/**
|
|
128
131
|
* Executes SideEffects action.
|
|
129
132
|
*
|
|
130
|
-
* @private
|
|
131
133
|
* @ui5-restricted
|
|
132
|
-
* @param
|
|
133
|
-
* @param
|
|
134
|
-
* @param
|
|
134
|
+
* @param triggerAction Name of the action
|
|
135
|
+
* @param context Context
|
|
136
|
+
* @param groupId The group ID to be used for the request
|
|
135
137
|
* @returns A promise that is resolved without data or with a return value context when the action call succeeded
|
|
136
138
|
*/
|
|
137
|
-
public executeAction(
|
|
138
|
-
const
|
|
139
|
-
return
|
|
139
|
+
public executeAction(triggerAction: string, context: Context, groupId?: string): Promise<void> {
|
|
140
|
+
const action = context.getModel().bindContext(`${triggerAction}(...)`, context);
|
|
141
|
+
return action.execute(groupId || context.getBinding().getUpdateGroupId());
|
|
140
142
|
}
|
|
141
143
|
|
|
142
144
|
/**
|
|
143
145
|
* Gets converted OData metaModel.
|
|
144
146
|
*
|
|
145
|
-
* @private
|
|
146
147
|
* @ui5-restricted
|
|
147
148
|
* @returns Converted OData metaModel
|
|
148
149
|
*/
|
|
149
150
|
public getConvertedMetaModel(): ConvertedMetadata {
|
|
150
|
-
|
|
151
|
-
const oComponent = oContext.scopeObject;
|
|
152
|
-
const oMetaModel: ODataMetaModel = oComponent.getModel().getMetaModel();
|
|
153
|
-
return convertTypes(oMetaModel, this._oCapabilities);
|
|
151
|
+
return convertTypes(this.getMetaModel(), this.capabilities);
|
|
154
152
|
}
|
|
155
153
|
|
|
156
154
|
/**
|
|
157
155
|
* Gets the entity type of a context.
|
|
158
156
|
*
|
|
159
|
-
* @
|
|
160
|
-
* @name getEntityTypeFromContext
|
|
161
|
-
* @param oContext Context
|
|
157
|
+
* @param context Context
|
|
162
158
|
* @returns Entity Type
|
|
163
159
|
*/
|
|
164
|
-
public getEntityTypeFromContext(
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
return
|
|
160
|
+
public getEntityTypeFromContext(context: Context): string | undefined {
|
|
161
|
+
const metaModel = context.getModel().getMetaModel(),
|
|
162
|
+
metaPath = metaModel.getMetaPath(context.getPath()),
|
|
163
|
+
entityType = metaModel.getObject(metaPath)["$Type"];
|
|
164
|
+
return entityType;
|
|
169
165
|
}
|
|
170
166
|
|
|
171
167
|
/**
|
|
172
168
|
* Gets the SideEffects that come from an OData service.
|
|
173
169
|
*
|
|
174
|
-
* @private
|
|
175
170
|
* @ui5-restricted
|
|
176
|
-
* @param
|
|
171
|
+
* @param entityTypeName Name of the entity type
|
|
177
172
|
* @returns SideEffects dictionary
|
|
178
173
|
*/
|
|
179
|
-
public getODataEntitySideEffects(
|
|
180
|
-
return this.
|
|
174
|
+
public getODataEntitySideEffects(entityTypeName: string): Record<string, ODataSideEffectsType> {
|
|
175
|
+
return this.sideEffectsRegistry.oData.entities[entityTypeName] || {};
|
|
181
176
|
}
|
|
182
177
|
|
|
183
178
|
/**
|
|
184
179
|
* Gets the global SideEffects that come from an OData service.
|
|
185
180
|
*
|
|
186
|
-
* @private
|
|
187
181
|
* @ui5-restricted
|
|
188
|
-
* @param
|
|
182
|
+
* @param entityTypeName Name of the entity type
|
|
189
183
|
* @returns Global SideEffects
|
|
190
184
|
*/
|
|
191
|
-
public getGlobalODataEntitySideEffects(
|
|
192
|
-
const
|
|
193
|
-
const
|
|
194
|
-
for (const key in
|
|
195
|
-
const
|
|
196
|
-
if (!
|
|
197
|
-
|
|
185
|
+
public getGlobalODataEntitySideEffects(entityTypeName: string): ODataSideEffectsType[] {
|
|
186
|
+
const entitySideEffects = this.getODataEntitySideEffects(entityTypeName);
|
|
187
|
+
const globalSideEffects: ODataSideEffectsType[] = [];
|
|
188
|
+
for (const key in entitySideEffects) {
|
|
189
|
+
const sideEffects = entitySideEffects[key];
|
|
190
|
+
if (!sideEffects.sourceEntities && !sideEffects.sourceProperties) {
|
|
191
|
+
globalSideEffects.push(sideEffects);
|
|
198
192
|
}
|
|
199
193
|
}
|
|
200
|
-
return
|
|
194
|
+
return globalSideEffects;
|
|
201
195
|
}
|
|
202
196
|
|
|
203
197
|
/**
|
|
204
198
|
* Gets the SideEffects that come from an OData service.
|
|
205
199
|
*
|
|
206
|
-
* @private
|
|
207
200
|
* @ui5-restricted
|
|
208
|
-
* @param
|
|
209
|
-
* @param
|
|
201
|
+
* @param actionName Name of the action
|
|
202
|
+
* @param context Context
|
|
210
203
|
* @returns SideEffects definition
|
|
211
204
|
*/
|
|
212
|
-
public getODataActionSideEffects(
|
|
213
|
-
if (
|
|
214
|
-
const
|
|
215
|
-
if (
|
|
216
|
-
return this.
|
|
205
|
+
public getODataActionSideEffects(actionName: string, context?: Context): ActionSideEffectsType | undefined {
|
|
206
|
+
if (context) {
|
|
207
|
+
const entityType = this.getEntityTypeFromContext(context);
|
|
208
|
+
if (entityType) {
|
|
209
|
+
return this.sideEffectsRegistry.oData.actions[entityType]?.[actionName];
|
|
217
210
|
}
|
|
218
211
|
}
|
|
219
212
|
return undefined;
|
|
@@ -222,120 +215,136 @@ export class SideEffectsService extends Service<SideEffectsSettings> {
|
|
|
222
215
|
/**
|
|
223
216
|
* Generates the dictionary for the SideEffects.
|
|
224
217
|
*
|
|
225
|
-
* @private
|
|
226
218
|
* @ui5-restricted
|
|
227
|
-
* @param
|
|
219
|
+
* @param capabilities The current capabilities
|
|
228
220
|
*/
|
|
229
|
-
public initializeSideEffects(
|
|
230
|
-
this.
|
|
231
|
-
if (!this.
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
221
|
+
public initializeSideEffects(capabilities?: EnvironmentCapabilities): void {
|
|
222
|
+
this.capabilities = capabilities;
|
|
223
|
+
if (!this.isInitialized) {
|
|
224
|
+
const sideEffectSources: {
|
|
225
|
+
entities: Record<string, SideEffectInfoForSource[]>;
|
|
226
|
+
properties: Record<string, SideEffectInfoForSource[]>;
|
|
227
|
+
} = {
|
|
228
|
+
entities: {},
|
|
229
|
+
properties: {}
|
|
230
|
+
};
|
|
231
|
+
const convertedMetaModel = this.getConvertedMetaModel();
|
|
232
|
+
convertedMetaModel.entityTypes.forEach((entityType: EntityType) => {
|
|
233
|
+
this.sideEffectsRegistry.oData.entities[entityType.fullyQualifiedName] = this.retrieveODataEntitySideEffects(entityType);
|
|
234
|
+
this.sideEffectsRegistry.oData.actions[entityType.fullyQualifiedName] = this.retrieveODataActionsSideEffects(entityType); // only bound actions are analyzed since unbound ones don't get SideEffects
|
|
235
|
+
this.mapSideEffectSources(entityType, sideEffectSources);
|
|
236
236
|
});
|
|
237
|
-
this.
|
|
237
|
+
this.sourcesToSideEffectMappings = sideEffectSources;
|
|
238
|
+
this.isInitialized = true;
|
|
238
239
|
}
|
|
239
240
|
}
|
|
240
241
|
|
|
241
242
|
/**
|
|
242
243
|
* Removes all SideEffects related to a control.
|
|
243
244
|
*
|
|
244
|
-
* @private
|
|
245
245
|
* @ui5-restricted
|
|
246
|
-
* @param
|
|
246
|
+
* @param controlId Control Id
|
|
247
247
|
*/
|
|
248
|
-
public removeControlSideEffects(
|
|
249
|
-
Object.keys(this.
|
|
250
|
-
if (this.
|
|
251
|
-
delete this.
|
|
248
|
+
public removeControlSideEffects(controlId: string): void {
|
|
249
|
+
Object.keys(this.sideEffectsRegistry.control).forEach((sEntityType) => {
|
|
250
|
+
if (this.sideEffectsRegistry.control[sEntityType][controlId]) {
|
|
251
|
+
delete this.sideEffectsRegistry.control[sEntityType][controlId];
|
|
252
252
|
}
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
/**
|
|
257
|
-
*
|
|
257
|
+
* Requests the SideEffects on a specific context.
|
|
258
258
|
*
|
|
259
|
-
* @
|
|
260
|
-
* @
|
|
261
|
-
* @param
|
|
262
|
-
* @param oContext Context where SideEffects need to be executed
|
|
263
|
-
* @param sGroupId The group ID to be used for the request
|
|
259
|
+
* @param pathExpressions Targets of SideEffects to be executed
|
|
260
|
+
* @param context Context where SideEffects need to be executed
|
|
261
|
+
* @param groupId The group ID to be used for the request
|
|
264
262
|
* @returns Promise on SideEffects request
|
|
265
263
|
*/
|
|
266
|
-
public
|
|
267
|
-
this.
|
|
268
|
-
return
|
|
264
|
+
public requestSideEffects(pathExpressions: SideEffectsTarget[], context: Context, groupId?: string): Promise<undefined> {
|
|
265
|
+
this.logRequest(pathExpressions, context);
|
|
266
|
+
return context.requestSideEffects(pathExpressions as object[], groupId);
|
|
269
267
|
}
|
|
270
268
|
|
|
271
|
-
|
|
272
|
-
|
|
269
|
+
/**
|
|
270
|
+
* Requests the SideEffects for an OData action.
|
|
271
|
+
*
|
|
272
|
+
* @param sideEffects SideEffects definition
|
|
273
|
+
* @param context Context where SideEffects need to be executed
|
|
274
|
+
* @returns Promise on SideEffects requests and action execution
|
|
275
|
+
*/
|
|
276
|
+
public requestSideEffectsForODataAction(sideEffects: ActionSideEffectsType, context: Context): Promise<(void | undefined)[]> {
|
|
277
|
+
let promises: Promise<void | undefined>[];
|
|
273
278
|
|
|
274
279
|
if (sideEffects.triggerActions?.length) {
|
|
275
|
-
|
|
276
|
-
return this.executeAction(
|
|
280
|
+
promises = sideEffects.triggerActions.map((actionName) => {
|
|
281
|
+
return this.executeAction(actionName, context);
|
|
277
282
|
});
|
|
278
283
|
} else {
|
|
279
|
-
|
|
284
|
+
promises = [];
|
|
280
285
|
}
|
|
281
286
|
|
|
282
287
|
if (sideEffects.pathExpressions?.length) {
|
|
283
|
-
|
|
288
|
+
promises.push(this.requestSideEffects(sideEffects.pathExpressions, context));
|
|
284
289
|
}
|
|
285
290
|
|
|
286
|
-
return
|
|
291
|
+
return promises.length ? Promise.all(promises) : Promise.resolve([]);
|
|
287
292
|
}
|
|
288
293
|
|
|
289
294
|
/**
|
|
290
|
-
*
|
|
295
|
+
* Requests the SideEffects for a navigation property on a specific context.
|
|
291
296
|
*
|
|
292
297
|
* @function
|
|
293
|
-
* @
|
|
294
|
-
* @param
|
|
295
|
-
* @param
|
|
298
|
+
* @param navigationProperty Navigation property
|
|
299
|
+
* @param context Context where SideEffects need to be executed
|
|
300
|
+
* @param groupId Batch group for the query
|
|
296
301
|
* @returns SideEffects request on SAPUI5 context
|
|
297
302
|
*/
|
|
298
|
-
public requestSideEffectsForNavigationProperty(
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
+
public requestSideEffectsForNavigationProperty(
|
|
304
|
+
navigationProperty: string,
|
|
305
|
+
context: Context,
|
|
306
|
+
groupId?: string
|
|
307
|
+
): Promise<void | undefined> {
|
|
308
|
+
const baseEntityType = this.getEntityTypeFromContext(context);
|
|
309
|
+
if (baseEntityType) {
|
|
310
|
+
const navigationPath = `${navigationProperty}/`;
|
|
311
|
+
const entitySideEffects = this.getODataEntitySideEffects(baseEntityType);
|
|
303
312
|
let targetProperties: string[] = [];
|
|
304
|
-
let targetEntities:
|
|
313
|
+
let targetEntities: SideEffectsEntityType[] = [];
|
|
305
314
|
let sideEffectsTargets: SideEffectsTarget[] = [];
|
|
306
|
-
Object.keys(
|
|
315
|
+
Object.keys(entitySideEffects)
|
|
307
316
|
.filter(
|
|
308
317
|
// Keep relevant SideEffects
|
|
309
|
-
(
|
|
310
|
-
const
|
|
318
|
+
(annotationName) => {
|
|
319
|
+
const sideEffects: ODataSideEffectsType = entitySideEffects[annotationName];
|
|
311
320
|
return (
|
|
312
|
-
(
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
)
|
|
318
|
-
}) ||
|
|
319
|
-
(oSideEffects.SourceEntities || []).some(
|
|
320
|
-
(oNavigationPropertyPath) => oNavigationPropertyPath.value === sNavigationProperty
|
|
321
|
+
(sideEffects.sourceProperties || []).some(
|
|
322
|
+
(propertyPath) =>
|
|
323
|
+
propertyPath.startsWith(navigationPath) && propertyPath.replace(navigationPath, "").indexOf("/") === -1
|
|
324
|
+
) ||
|
|
325
|
+
(sideEffects.sourceEntities || []).some(
|
|
326
|
+
(navigation) => navigation.$NavigationPropertyPath === navigationProperty
|
|
321
327
|
)
|
|
322
328
|
);
|
|
323
329
|
}
|
|
324
330
|
)
|
|
325
331
|
.forEach((sAnnotationName) => {
|
|
326
|
-
const
|
|
327
|
-
if (
|
|
328
|
-
this.executeAction(
|
|
332
|
+
const sideEffects = entitySideEffects[sAnnotationName];
|
|
333
|
+
if (sideEffects.triggerAction) {
|
|
334
|
+
this.executeAction(sideEffects.triggerAction, context, groupId);
|
|
329
335
|
}
|
|
330
|
-
targetProperties = targetProperties.concat(
|
|
331
|
-
targetEntities = targetEntities.concat(
|
|
336
|
+
targetProperties = targetProperties.concat(sideEffects.targetProperties);
|
|
337
|
+
targetEntities = targetEntities.concat(sideEffects.targetEntities);
|
|
332
338
|
});
|
|
333
339
|
// Remove duplicate targets
|
|
334
|
-
const sideEffectsTargetDefinition = this.
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
340
|
+
const sideEffectsTargetDefinition = this.removeDuplicateTargets({
|
|
341
|
+
targetProperties: targetProperties,
|
|
342
|
+
targetEntities: targetEntities
|
|
343
|
+
});
|
|
344
|
+
sideEffectsTargets = [...sideEffectsTargetDefinition.targetProperties, ...sideEffectsTargetDefinition.targetEntities];
|
|
345
|
+
if (sideEffectsTargets.length) {
|
|
346
|
+
return this.requestSideEffects(sideEffectsTargets, context, groupId).catch((error) =>
|
|
347
|
+
Log.error(`SideEffects - Error while processing SideEffects for Navigation Property ${navigationProperty}`, error)
|
|
339
348
|
);
|
|
340
349
|
}
|
|
341
350
|
}
|
|
@@ -345,249 +354,356 @@ export class SideEffectsService extends Service<SideEffectsSettings> {
|
|
|
345
354
|
/**
|
|
346
355
|
* Gets the SideEffects that come from controls.
|
|
347
356
|
*
|
|
348
|
-
* @private
|
|
349
357
|
* @ui5-restricted
|
|
350
|
-
* @param
|
|
358
|
+
* @param entityTypeName Entity type Name
|
|
351
359
|
* @returns SideEffects dictionary
|
|
352
360
|
*/
|
|
353
|
-
public getControlEntitySideEffects(
|
|
354
|
-
return this.
|
|
361
|
+
public getControlEntitySideEffects(entityTypeName: string): Record<string, ControlSideEffectsType> {
|
|
362
|
+
return this.sideEffectsRegistry.control[entityTypeName] || {};
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Gets SideEffects' qualifier and owner entity where this entity is used as source.
|
|
367
|
+
*
|
|
368
|
+
* @param entityTypeName Entity type fully qualified name
|
|
369
|
+
* @returns Array of sideEffects info
|
|
370
|
+
*/
|
|
371
|
+
public getSideEffectWhereEntityIsSource(entityTypeName: string): SideEffectInfoForSource[] {
|
|
372
|
+
return this.sourcesToSideEffectMappings.entities[entityTypeName] || [];
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Common method to get the field groupIds for a source entity and a source property.
|
|
377
|
+
*
|
|
378
|
+
* @param sourceEntityType
|
|
379
|
+
* @param sourceProperty
|
|
380
|
+
* @returns A collection of fieldGroupIds
|
|
381
|
+
*/
|
|
382
|
+
public computeFieldGroupIds(sourceEntityType: string, sourceProperty: string): string[] {
|
|
383
|
+
const entityFieldGroupIds = this.getSideEffectWhereEntityIsSource(sourceEntityType).map((sideEffectInfo) =>
|
|
384
|
+
this.getFieldGroupIdForSideEffect(sideEffectInfo, true)
|
|
385
|
+
);
|
|
386
|
+
return entityFieldGroupIds.concat(
|
|
387
|
+
this.getSideEffectWherePropertyIsSource(sourceProperty).map((sideEffectInfo) =>
|
|
388
|
+
this.getFieldGroupIdForSideEffect(sideEffectInfo)
|
|
389
|
+
)
|
|
390
|
+
);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Gets SideEffects' qualifier and owner entity where this property is used as source.
|
|
395
|
+
*
|
|
396
|
+
* @param propertyName Property fully qualified name
|
|
397
|
+
* @returns Array of sideEffects info
|
|
398
|
+
*/
|
|
399
|
+
public getSideEffectWherePropertyIsSource(propertyName: string): SideEffectInfoForSource[] {
|
|
400
|
+
return this.sourcesToSideEffectMappings.properties[propertyName] || [];
|
|
355
401
|
}
|
|
356
402
|
|
|
357
403
|
/**
|
|
358
404
|
* Adds the text properties required for SideEffects
|
|
359
|
-
* If a property has an associated text then this text needs to be added as targetProperties
|
|
405
|
+
* If a property has an associated text then this text needs to be added as targetProperties.
|
|
360
406
|
*
|
|
361
|
-
* @private
|
|
362
407
|
* @ui5-restricted
|
|
363
|
-
* @param
|
|
364
|
-
* @param
|
|
408
|
+
* @param sideEffectsTargets SideEffects Targets
|
|
409
|
+
* @param entityType Entity type
|
|
365
410
|
* @returns SideEffects definition with added text properties
|
|
366
411
|
*/
|
|
367
|
-
private
|
|
368
|
-
const
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
aEntitiesRequested.push(sNavigationPropertyPath);
|
|
387
|
-
aDerivedProperties = aDerivedProperties.concat(
|
|
388
|
-
aTargetEntityProperties.map((mProperty) => {
|
|
389
|
-
return {
|
|
390
|
-
navigationPath: sRelativePath,
|
|
391
|
-
property: mProperty
|
|
392
|
-
};
|
|
393
|
-
})
|
|
394
|
-
);
|
|
395
|
-
} else {
|
|
396
|
-
aDerivedProperties.push({
|
|
397
|
-
property: aTargetEntityProperties.find(
|
|
398
|
-
(mProperty) => mProperty.name === sPropertyPath.split("/").pop()
|
|
399
|
-
) as Property,
|
|
400
|
-
navigationPath: sRelativePath
|
|
401
|
-
});
|
|
402
|
-
}
|
|
403
|
-
} else {
|
|
404
|
-
Log.info(`SideEffects - The entity type associated to property path ${sPropertyPath} cannot be resolved`);
|
|
405
|
-
}
|
|
406
|
-
});
|
|
407
|
-
|
|
408
|
-
aDerivedProperties.forEach((mPropertyInfo) => {
|
|
409
|
-
const textAnnotation = mPropertyInfo.property?.annotations?.Common?.Text;
|
|
410
|
-
if (textAnnotation && isPathExpression(textAnnotation)) {
|
|
411
|
-
const sTargetTextPath = textAnnotation.path,
|
|
412
|
-
sTextPathFromInitialEntity = mPropertyInfo.navigationPath + sTargetTextPath,
|
|
413
|
-
sTargetCollectionPath = sTextPathFromInitialEntity.substring(0, sTextPathFromInitialEntity.lastIndexOf("/"));
|
|
414
|
-
/**
|
|
415
|
-
* The property Text must be added only if the property is
|
|
416
|
-
* - not part of a star property (.i.e '*' or 'navigation/*') or a targeted Entity
|
|
417
|
-
* - not include into the initial targeted properties of SideEffects
|
|
418
|
-
* Indeed in the two listed cases, the property containing text will be/is requested by initial SideEffects configuration.
|
|
419
|
-
*/
|
|
420
|
-
|
|
412
|
+
private addTextProperties(sideEffectsTargets: SideEffectsTargetType, entityType: EntityType): SideEffectsTargetType {
|
|
413
|
+
const setOfProperties = new Set(sideEffectsTargets.targetProperties);
|
|
414
|
+
const setOfEntities = new Set(sideEffectsTargets.targetEntities.map((target) => target.$NavigationPropertyPath));
|
|
415
|
+
|
|
416
|
+
// Generate all dataModelPath for the properties to analyze (cover "*" and /*)
|
|
417
|
+
const propertiesToAnalyze = sideEffectsTargets.targetProperties.reduce(
|
|
418
|
+
(dataModelPropertyPaths: DataModelObjectPath[], propertyPath) => {
|
|
419
|
+
return dataModelPropertyPaths.concat(this.getDataModelPropertiesFromAPath(propertyPath, entityType));
|
|
420
|
+
},
|
|
421
|
+
[]
|
|
422
|
+
);
|
|
423
|
+
|
|
424
|
+
// Generate all paths related to the text properties and not already covered by the SideEffects
|
|
425
|
+
for (const dataModelPropertyPath of propertiesToAnalyze) {
|
|
426
|
+
const associatedTextPath = getAssociatedTextPropertyPath(dataModelPropertyPath.targetObject);
|
|
427
|
+
if (associatedTextPath) {
|
|
428
|
+
const dataModelTextPath = enhanceDataModelPath(dataModelPropertyPath, associatedTextPath);
|
|
429
|
+
const relativeNavigation = getTargetNavigationPath(dataModelTextPath, true);
|
|
430
|
+
const targetPath = getTargetObjectPath(dataModelTextPath, true);
|
|
421
431
|
if (
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
432
|
+
isProperty(dataModelTextPath.targetObject) &&
|
|
433
|
+
!setOfProperties.has(targetPath) && // the property is already listed
|
|
434
|
+
!setOfProperties.has(`${relativeNavigation}${dataModelTextPath.navigationProperties.length ? "/" : ""}*`) && // the property is already listed thanks to the "*"
|
|
435
|
+
!setOfEntities.has(`${relativeNavigation}`) // the property is not part of a TargetEntities
|
|
425
436
|
) {
|
|
426
|
-
// The Text association is added as TargetEntities if
|
|
437
|
+
// The Text association is added as TargetEntities if
|
|
438
|
+
// - it's contained on a different entitySet than the SideEffects
|
|
439
|
+
// - and it's contained on a different entitySet than the sourced property
|
|
427
440
|
// Otherwise it's added as targetProperties
|
|
428
441
|
if (
|
|
429
|
-
|
|
430
|
-
|
|
442
|
+
dataModelPropertyPath.targetEntitySet !== dataModelTextPath.targetEntitySet &&
|
|
443
|
+
dataModelTextPath.navigationProperties &&
|
|
444
|
+
dataModelTextPath.targetEntityType
|
|
431
445
|
) {
|
|
432
|
-
|
|
433
|
-
aEntitiesRequested.push(sTargetCollectionPath);
|
|
446
|
+
setOfEntities.add(relativeNavigation);
|
|
434
447
|
} else {
|
|
435
|
-
|
|
448
|
+
setOfProperties.add(targetPath);
|
|
436
449
|
}
|
|
437
450
|
}
|
|
438
451
|
}
|
|
439
|
-
}
|
|
452
|
+
}
|
|
440
453
|
|
|
441
|
-
return
|
|
454
|
+
return {
|
|
455
|
+
targetProperties: Array.from(setOfProperties),
|
|
456
|
+
targetEntities: Array.from(setOfEntities).map((navigation) => {
|
|
457
|
+
return { $NavigationPropertyPath: navigation };
|
|
458
|
+
})
|
|
459
|
+
};
|
|
442
460
|
}
|
|
461
|
+
|
|
443
462
|
/**
|
|
444
|
-
* Converts SideEffects to expected format
|
|
463
|
+
* Converts the SideEffects to expected format
|
|
464
|
+
* - Set TriggerAction as string
|
|
445
465
|
* - Converts SideEffects targets to expected format
|
|
446
466
|
* - Removes binding parameter from SideEffects targets properties
|
|
447
467
|
* - Adds the text properties
|
|
448
468
|
* - Replaces TargetProperties having reference to Source Properties for a SideEffects.
|
|
449
469
|
*
|
|
450
|
-
* @private
|
|
451
470
|
* @ui5-restricted
|
|
452
|
-
* @param
|
|
453
|
-
* @param
|
|
454
|
-
* @param
|
|
471
|
+
* @param sideEffects SideEffects definition
|
|
472
|
+
* @param entityType Entity type
|
|
473
|
+
* @param bindingParameter Name of the binding parameter
|
|
455
474
|
* @returns SideEffects definition
|
|
456
475
|
*/
|
|
457
|
-
private
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
476
|
+
private convertSideEffects(
|
|
477
|
+
sideEffects: CommonSideEffectsType,
|
|
478
|
+
entityType: EntityType,
|
|
479
|
+
bindingParameter?: string
|
|
461
480
|
): ODataSideEffectsType {
|
|
462
|
-
const
|
|
463
|
-
|
|
481
|
+
const triggerAction = sideEffects.TriggerAction as string;
|
|
482
|
+
const newSideEffects = this.convertSideEffectsFormat(sideEffects);
|
|
483
|
+
let sideEffectsTargets = { targetProperties: newSideEffects.targetProperties, targetEntities: newSideEffects.targetEntities };
|
|
484
|
+
sideEffectsTargets = this.removeBindingParameter(sideEffectsTargets, bindingParameter);
|
|
485
|
+
sideEffectsTargets = this.addTextProperties(sideEffectsTargets, entityType);
|
|
486
|
+
sideEffectsTargets = this.removeDuplicateTargets(sideEffectsTargets);
|
|
487
|
+
return {
|
|
488
|
+
...newSideEffects,
|
|
489
|
+
...{ targetEntities: sideEffectsTargets.targetEntities, targetProperties: sideEffectsTargets.targetProperties, triggerAction }
|
|
490
|
+
};
|
|
464
491
|
}
|
|
465
492
|
|
|
466
493
|
/**
|
|
467
|
-
* Converts SideEffects targets (TargetEntities and TargetProperties) to expected format
|
|
494
|
+
* Converts the SideEffects targets (TargetEntities and TargetProperties) to expected format
|
|
468
495
|
* - TargetProperties as array of string
|
|
469
496
|
* - TargetEntities as array of object with property $NavigationPropertyPath.
|
|
470
497
|
*
|
|
471
|
-
* @private
|
|
472
498
|
* @ui5-restricted
|
|
473
|
-
* @param
|
|
499
|
+
* @param sideEffects SideEffects definition
|
|
474
500
|
* @returns Converted SideEffects
|
|
475
501
|
*/
|
|
476
|
-
private
|
|
477
|
-
const
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
502
|
+
private convertSideEffectsFormat(sideEffects: CommonSideEffectsType): ODataSideEffectsType {
|
|
503
|
+
const formatProperties = (properties?: (string | PropertyPath)[]) => {
|
|
504
|
+
return properties
|
|
505
|
+
? properties.reduce((targetProperties: string[], target) => {
|
|
506
|
+
const path = ((target as PropertyPath).type && (target as PropertyPath).value) || (target as string);
|
|
507
|
+
if (path) {
|
|
508
|
+
targetProperties.push(path);
|
|
509
|
+
} else {
|
|
510
|
+
Log.error(
|
|
511
|
+
`SideEffects - Error while processing TargetProperties for SideEffects ${sideEffects.fullyQualifiedName}`
|
|
512
|
+
);
|
|
513
|
+
}
|
|
514
|
+
return targetProperties;
|
|
515
|
+
}, [])
|
|
516
|
+
: properties;
|
|
517
|
+
};
|
|
518
|
+
const formatEntities = (entities?: NavigationPropertyPath[]) => {
|
|
519
|
+
return entities
|
|
520
|
+
? entities.map((targetEntity) => {
|
|
521
|
+
return { $NavigationPropertyPath: targetEntity.value };
|
|
522
|
+
})
|
|
523
|
+
: entities;
|
|
524
|
+
};
|
|
525
|
+
return {
|
|
526
|
+
fullyQualifiedName: sideEffects.fullyQualifiedName,
|
|
527
|
+
sourceProperties: formatProperties(sideEffects.SourceProperties),
|
|
528
|
+
sourceEntities: formatEntities(sideEffects.SourceEntities),
|
|
529
|
+
targetProperties: formatProperties(sideEffects.TargetProperties as (string | PropertyPath)[]) ?? [],
|
|
530
|
+
targetEntities: formatEntities(sideEffects.TargetEntities) ?? []
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Gets all dataModelObjectPath related to properties listed by a path
|
|
536
|
+
*
|
|
537
|
+
* The path can be:
|
|
538
|
+
* - a path targeting a property on a complexType or an EntityType
|
|
539
|
+
* - a path with a star targeting all properties on a complexType or an EntityType.
|
|
540
|
+
*
|
|
541
|
+
* @ui5-restricted
|
|
542
|
+
* @param path The path to analyze
|
|
543
|
+
* @param entityType Entity type
|
|
544
|
+
* @returns Array of dataModelObjectPath representing the properties
|
|
545
|
+
*/
|
|
546
|
+
private getDataModelPropertiesFromAPath(path: string, entityType: EntityType): DataModelObjectPath[] {
|
|
547
|
+
let dataModelObjectPaths: DataModelObjectPath[] = [];
|
|
548
|
+
const convertedMetaModel = this.getConvertedMetaModel();
|
|
549
|
+
const entitySet =
|
|
550
|
+
convertedMetaModel.entitySets.find((relatedEntitySet) => relatedEntitySet.entityType === entityType) ||
|
|
551
|
+
convertedMetaModel.singletons.find((singleton) => singleton.entityType === entityType);
|
|
552
|
+
|
|
553
|
+
if (entitySet) {
|
|
554
|
+
const metaModel = this.getMetaModel(),
|
|
555
|
+
entitySetContext = metaModel.createBindingContext(`/${entitySet.name}`);
|
|
556
|
+
if (entitySetContext) {
|
|
557
|
+
const dataModelEntitySet = getInvolvedDataModelObjects(entitySetContext);
|
|
558
|
+
const dataModelObjectPath = enhanceDataModelPath(dataModelEntitySet, path.replace("*", "") || "/"), // "*" is replaced by "/" to target the current EntityType
|
|
559
|
+
targetObject = dataModelObjectPath.targetObject;
|
|
560
|
+
if (isProperty(targetObject)) {
|
|
561
|
+
if (isComplexType(targetObject.targetType)) {
|
|
562
|
+
dataModelObjectPaths = dataModelObjectPaths.concat(
|
|
563
|
+
targetObject.targetType.properties.map((property) => enhanceDataModelPath(dataModelObjectPath, property.name))
|
|
485
564
|
);
|
|
565
|
+
} else {
|
|
566
|
+
dataModelObjectPaths.push(dataModelObjectPath);
|
|
486
567
|
}
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
568
|
+
} else if (isEntityType(targetObject)) {
|
|
569
|
+
dataModelObjectPaths = dataModelObjectPaths.concat(
|
|
570
|
+
dataModelObjectPath.targetEntityType.entityProperties.map((entityProperty) => {
|
|
571
|
+
return enhanceDataModelPath(dataModelObjectPath, entityProperty.name);
|
|
572
|
+
})
|
|
573
|
+
);
|
|
574
|
+
}
|
|
575
|
+
entitySetContext.destroy();
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
return dataModelObjectPaths.filter((dataModelObjectPath) => dataModelObjectPath.targetObject);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* Gets the Odata metamodel.
|
|
583
|
+
*
|
|
584
|
+
* @ui5-restricted
|
|
585
|
+
* @returns The OData metamodel
|
|
586
|
+
*/
|
|
587
|
+
private getMetaModel(): ODataMetaModel {
|
|
588
|
+
const oContext = this.getContext();
|
|
589
|
+
const oComponent = oContext.scopeObject;
|
|
590
|
+
return oComponent.getModel().getMetaModel();
|
|
495
591
|
}
|
|
496
592
|
|
|
497
593
|
/**
|
|
498
|
-
* Gets SideEffects related to an entity type or action that come from an OData Service
|
|
594
|
+
* Gets the SideEffects related to an entity type or action that come from an OData Service
|
|
499
595
|
* Internal routine to get, from converted oData metaModel, SideEffects related to a specific entity type or action
|
|
500
596
|
* and to convert these SideEffects with expected format.
|
|
501
597
|
*
|
|
502
|
-
* @private
|
|
503
598
|
* @ui5-restricted
|
|
504
|
-
* @param
|
|
599
|
+
* @param source Entity type or action
|
|
505
600
|
* @returns Array of SideEffects
|
|
506
601
|
*/
|
|
507
|
-
private
|
|
508
|
-
|
|
509
|
-
const
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
602
|
+
private getSideEffectsFromSource(source: EntityType | Action): ODataSideEffectsType[] {
|
|
603
|
+
let bindingAlias = "";
|
|
604
|
+
const isSourceEntityType = isEntityType(source);
|
|
605
|
+
const entityType: EntityType | undefined = isSourceEntityType ? source : source.sourceEntityType;
|
|
606
|
+
const commonAnnotation = source.annotations?.Common as undefined | unknown as Record<string, CommonAnnotationTypes>;
|
|
607
|
+
if (entityType && commonAnnotation) {
|
|
608
|
+
if (!isSourceEntityType) {
|
|
609
|
+
const bindingParameter = source.parameters?.find((parameter) => parameter.type === entityType.fullyQualifiedName);
|
|
610
|
+
bindingAlias = bindingParameter?.fullyQualifiedName.split("/")[1] ?? "";
|
|
611
|
+
}
|
|
612
|
+
return this.getSideEffectsAnnotationFromSource(source).map((sideEffectAnno) =>
|
|
613
|
+
this.convertSideEffects(sideEffectAnno, entityType, bindingAlias)
|
|
514
614
|
);
|
|
515
|
-
const sBindingParameter = mBindingParameter ? mBindingParameter.fullyQualifiedName.split("/")[1] : "";
|
|
516
|
-
Object.keys(mCommonAnnotation)
|
|
517
|
-
.filter((sAnnotationName) => mCommonAnnotation[sAnnotationName].$Type === CommonAnnotationTypes.SideEffectsType)
|
|
518
|
-
.forEach((sAnnotationName) => {
|
|
519
|
-
aSideEffects.push(
|
|
520
|
-
this._convertSideEffects(
|
|
521
|
-
mCommonAnnotation[sAnnotationName] as CommonSideEffectsType,
|
|
522
|
-
mEntityType,
|
|
523
|
-
sBindingParameter
|
|
524
|
-
)
|
|
525
|
-
);
|
|
526
|
-
});
|
|
527
615
|
}
|
|
528
|
-
return
|
|
616
|
+
return [];
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Gets the SideEffects related to an entity type or action that come from an OData Service
|
|
620
|
+
* Internal routine to get, from converted oData metaModel, SideEffects related to a specific entity type or action.
|
|
621
|
+
*
|
|
622
|
+
* @param source Entity type or action
|
|
623
|
+
* @returns Array of SideEffects
|
|
624
|
+
*/
|
|
625
|
+
private getSideEffectsAnnotationFromSource(source: EntityType | Action): CommonSideEffectTypeWithQualifier[] {
|
|
626
|
+
const sideEffects: CommonSideEffectsType[] = [];
|
|
627
|
+
const commonAnnotation = source.annotations?.Common as undefined | unknown as Record<string, CommonSideEffectTypeWithQualifier>;
|
|
628
|
+
for (const key in commonAnnotation) {
|
|
629
|
+
const annotation = commonAnnotation[key];
|
|
630
|
+
if (this.isSideEffectsAnnotation(annotation)) {
|
|
631
|
+
sideEffects.push(annotation);
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
return sideEffects;
|
|
529
635
|
}
|
|
530
636
|
|
|
531
637
|
/**
|
|
532
|
-
*
|
|
638
|
+
* Checks if the annotation is a SideEffects annotation.
|
|
533
639
|
*
|
|
534
|
-
* @private
|
|
535
640
|
* @ui5-restricted
|
|
536
|
-
* @param
|
|
537
|
-
* @
|
|
641
|
+
* @param annotation Annotation
|
|
642
|
+
* @returns Boolean
|
|
538
643
|
*/
|
|
539
|
-
private
|
|
540
|
-
|
|
541
|
-
|
|
644
|
+
private isSideEffectsAnnotation(annotation: unknown): annotation is CommonSideEffectsType {
|
|
645
|
+
return (annotation as CommonSideEffectsType)?.$Type === CommonAnnotationTypes.SideEffectsType;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* Logs the SideEffects request.
|
|
650
|
+
*
|
|
651
|
+
* @ui5-restricted
|
|
652
|
+
* @param pathExpressions SideEffects targets
|
|
653
|
+
* @param context Context
|
|
654
|
+
*/
|
|
655
|
+
private logRequest(pathExpressions: SideEffectsTarget[], context: Context) {
|
|
656
|
+
const targetPaths = pathExpressions.reduce(function (paths, target) {
|
|
657
|
+
return `${paths}\n\t\t${(target as SideEffectsEntityType).$NavigationPropertyPath || target || ""}`;
|
|
542
658
|
}, "");
|
|
543
|
-
Log.debug(`SideEffects - Request:\n\tContext path : ${
|
|
659
|
+
Log.debug(`SideEffects - Request:\n\tContext path : ${context.getPath()}\n\tProperty paths :${targetPaths}`);
|
|
544
660
|
}
|
|
545
661
|
|
|
546
662
|
/**
|
|
547
|
-
* Removes name of binding parameter on SideEffects targets.
|
|
663
|
+
* Removes the name of the binding parameter on the SideEffects targets.
|
|
548
664
|
*
|
|
549
|
-
* @private
|
|
550
665
|
* @ui5-restricted
|
|
551
|
-
* @param
|
|
552
|
-
* @param
|
|
666
|
+
* @param sideEffectsTargets SideEffects Targets
|
|
667
|
+
* @param bindingParameterName Name of binding parameter
|
|
553
668
|
* @returns SideEffects definition
|
|
554
669
|
*/
|
|
555
|
-
private
|
|
556
|
-
if (
|
|
670
|
+
private removeBindingParameter(sideEffectsTargets: SideEffectsTargetType, bindingParameterName?: string): SideEffectsTargetType {
|
|
671
|
+
if (bindingParameterName) {
|
|
557
672
|
const replaceBindingParameter = function (value: string) {
|
|
558
|
-
return value.replace(new RegExp(`^${
|
|
673
|
+
return value.replace(new RegExp(`^${bindingParameterName}/?`), "");
|
|
674
|
+
};
|
|
675
|
+
return {
|
|
676
|
+
targetProperties: sideEffectsTargets.targetProperties.map((targetProperty) => replaceBindingParameter(targetProperty)),
|
|
677
|
+
targetEntities: sideEffectsTargets.targetEntities.map((targetEntity) => {
|
|
678
|
+
return { $NavigationPropertyPath: replaceBindingParameter(targetEntity.$NavigationPropertyPath) };
|
|
679
|
+
})
|
|
559
680
|
};
|
|
560
|
-
|
|
561
|
-
oSideEffects.TargetProperties = oSideEffects.TargetProperties.map((targetProperty) => replaceBindingParameter(targetProperty));
|
|
562
|
-
oSideEffects.TargetEntities = oSideEffects.TargetEntities.map((targetEntity) => {
|
|
563
|
-
return { $NavigationPropertyPath: replaceBindingParameter(targetEntity.$NavigationPropertyPath) };
|
|
564
|
-
});
|
|
565
681
|
}
|
|
566
|
-
return
|
|
682
|
+
return {
|
|
683
|
+
targetProperties: sideEffectsTargets.targetProperties,
|
|
684
|
+
targetEntities: sideEffectsTargets.targetEntities
|
|
685
|
+
};
|
|
567
686
|
}
|
|
568
687
|
|
|
569
688
|
/**
|
|
570
689
|
* Remove duplicates in SideEffects targets.
|
|
571
690
|
*
|
|
572
|
-
* @private
|
|
573
691
|
* @ui5-restricted
|
|
574
|
-
* @param
|
|
575
|
-
* @param targetEntities SideEffects TargetEntities
|
|
692
|
+
* @param sideEffectsTargets SideEffects Targets
|
|
576
693
|
* @returns SideEffects targets without duplicates
|
|
577
694
|
*/
|
|
578
|
-
private
|
|
579
|
-
const
|
|
580
|
-
const
|
|
581
|
-
const
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
}
|
|
587
|
-
return false;
|
|
695
|
+
private removeDuplicateTargets(sideEffectsTargets: SideEffectsTargetType): SideEffectsTargetType {
|
|
696
|
+
const targetEntitiesPaths = sideEffectsTargets.targetEntities.map((targetEntity) => targetEntity.$NavigationPropertyPath);
|
|
697
|
+
const uniqueTargetedEntitiesPath = new Set<string>(targetEntitiesPaths);
|
|
698
|
+
const uniqueTargetProperties = new Set<string>(sideEffectsTargets.targetProperties);
|
|
699
|
+
|
|
700
|
+
const uniqueTargetedEntities = Array.from(uniqueTargetedEntitiesPath).map((entityPath) => {
|
|
701
|
+
return {
|
|
702
|
+
$NavigationPropertyPath: entityPath
|
|
703
|
+
};
|
|
588
704
|
});
|
|
589
705
|
|
|
590
|
-
return {
|
|
706
|
+
return { targetProperties: Array.from(uniqueTargetProperties), targetEntities: uniqueTargetedEntities };
|
|
591
707
|
}
|
|
592
708
|
|
|
593
709
|
/**
|
|
@@ -596,12 +712,11 @@ export class SideEffectsService extends Service<SideEffectsSettings> {
|
|
|
596
712
|
* related to a specific entity type and to convert these SideEffects with
|
|
597
713
|
* expected format.
|
|
598
714
|
*
|
|
599
|
-
* @private
|
|
600
715
|
* @ui5-restricted
|
|
601
716
|
* @param entityType Entity type
|
|
602
717
|
* @returns Entity type SideEffects dictionary
|
|
603
718
|
*/
|
|
604
|
-
private
|
|
719
|
+
private retrieveODataActionsSideEffects(entityType: EntityType): Record<string, ActionSideEffectsType> {
|
|
605
720
|
const sideEffects: Record<string, ActionSideEffectsType> = {};
|
|
606
721
|
const actions = entityType.actions;
|
|
607
722
|
if (actions) {
|
|
@@ -609,19 +724,19 @@ export class SideEffectsService extends Service<SideEffectsSettings> {
|
|
|
609
724
|
const action = entityType.actions[actionName];
|
|
610
725
|
const triggerActions = new Set<string>();
|
|
611
726
|
let targetProperties: string[] = [];
|
|
612
|
-
let targetEntities:
|
|
727
|
+
let targetEntities: SideEffectsEntityType[] = [];
|
|
613
728
|
|
|
614
|
-
this.
|
|
615
|
-
const triggerAction = oDataSideEffect.
|
|
616
|
-
targetProperties = targetProperties.concat(oDataSideEffect.
|
|
617
|
-
targetEntities = targetEntities.concat(oDataSideEffect.
|
|
729
|
+
this.getSideEffectsFromSource(action).forEach((oDataSideEffect) => {
|
|
730
|
+
const triggerAction = oDataSideEffect.triggerAction;
|
|
731
|
+
targetProperties = targetProperties.concat(oDataSideEffect.targetProperties);
|
|
732
|
+
targetEntities = targetEntities.concat(oDataSideEffect.targetEntities);
|
|
618
733
|
if (triggerAction) {
|
|
619
734
|
triggerActions.add(triggerAction);
|
|
620
735
|
}
|
|
621
736
|
});
|
|
622
|
-
const sideEffectsTargets = this.
|
|
737
|
+
const sideEffectsTargets = this.removeDuplicateTargets({ targetProperties, targetEntities });
|
|
623
738
|
sideEffects[actionName] = {
|
|
624
|
-
pathExpressions: [...sideEffectsTargets.
|
|
739
|
+
pathExpressions: [...sideEffectsTargets.targetProperties, ...sideEffectsTargets.targetEntities],
|
|
625
740
|
triggerActions: Array.from(triggerActions)
|
|
626
741
|
};
|
|
627
742
|
});
|
|
@@ -635,17 +750,71 @@ export class SideEffectsService extends Service<SideEffectsSettings> {
|
|
|
635
750
|
* related to a specific entity type and to convert these SideEffects with
|
|
636
751
|
* expected format.
|
|
637
752
|
*
|
|
638
|
-
* @private
|
|
639
753
|
* @ui5-restricted
|
|
640
|
-
* @param
|
|
754
|
+
* @param entityType Entity type
|
|
641
755
|
* @returns Entity type SideEffects dictionary
|
|
642
756
|
*/
|
|
643
|
-
private
|
|
644
|
-
const
|
|
645
|
-
this.
|
|
646
|
-
|
|
757
|
+
private retrieveODataEntitySideEffects(entityType: EntityType): Record<string, ODataSideEffectsType> {
|
|
758
|
+
const entitySideEffects: Record<string, ODataSideEffectsType> = {};
|
|
759
|
+
this.getSideEffectsFromSource(entityType).forEach((sideEffects) => {
|
|
760
|
+
entitySideEffects[sideEffects.fullyQualifiedName] = sideEffects;
|
|
647
761
|
});
|
|
648
|
-
return
|
|
762
|
+
return entitySideEffects;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
* Defines a map for the Sources of sideEffect on the entity to track where those sources are used in SideEffects annotation.
|
|
767
|
+
*
|
|
768
|
+
* @param entityType The entityType we look for side Effects annotation
|
|
769
|
+
* @param sideEffectsSources The mapping object in construction
|
|
770
|
+
* @param sideEffectsSources.entities
|
|
771
|
+
* @param sideEffectsSources.properties
|
|
772
|
+
*/
|
|
773
|
+
private mapSideEffectSources(
|
|
774
|
+
entityType: EntityType,
|
|
775
|
+
sideEffectsSources: { entities: Record<string, SideEffectInfoForSource[]>; properties: Record<string, SideEffectInfoForSource[]> }
|
|
776
|
+
): void {
|
|
777
|
+
for (const sideEffectDefinition of this.getSideEffectsAnnotationFromSource(entityType)) {
|
|
778
|
+
for (const sourceEntity of sideEffectDefinition.SourceEntities ?? []) {
|
|
779
|
+
const targetEntityType = sourceEntity.value ? sourceEntity.$target?.targetType : entityType;
|
|
780
|
+
if (targetEntityType) {
|
|
781
|
+
if (!sideEffectsSources.entities[targetEntityType.fullyQualifiedName]) {
|
|
782
|
+
sideEffectsSources.entities[targetEntityType.fullyQualifiedName] = [];
|
|
783
|
+
}
|
|
784
|
+
sideEffectsSources.entities[targetEntityType.fullyQualifiedName].push({
|
|
785
|
+
entity: entityType.fullyQualifiedName,
|
|
786
|
+
qualifier: sideEffectDefinition.qualifier
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
const hasUniqueSourceProperty = sideEffectDefinition.SourceProperties?.length === 1;
|
|
791
|
+
for (const sourceProperty of sideEffectDefinition.SourceProperties ?? []) {
|
|
792
|
+
if (!sideEffectsSources.properties[sourceProperty.$target?.fullyQualifiedName]) {
|
|
793
|
+
sideEffectsSources.properties[sourceProperty.$target?.fullyQualifiedName] = [];
|
|
794
|
+
}
|
|
795
|
+
sideEffectsSources.properties[sourceProperty.$target?.fullyQualifiedName].push({
|
|
796
|
+
entity: entityType.fullyQualifiedName,
|
|
797
|
+
qualifier: sideEffectDefinition.qualifier,
|
|
798
|
+
hasUniqueSourceProperty
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Get the fieldGroupId based on the stored information on th side effect.
|
|
806
|
+
*
|
|
807
|
+
* @param sideEffectInfo
|
|
808
|
+
* @param isImmediate
|
|
809
|
+
* @returns A string for the fieldGroupId.
|
|
810
|
+
*/
|
|
811
|
+
private getFieldGroupIdForSideEffect(sideEffectInfo: SideEffectInfoForSource, isImmediate: boolean = false): string {
|
|
812
|
+
const sideEffectWithQualifier = sideEffectInfo.qualifier
|
|
813
|
+
? `${sideEffectInfo.entity}#${sideEffectInfo.qualifier}`
|
|
814
|
+
: sideEffectInfo.entity;
|
|
815
|
+
return isImmediate || sideEffectInfo.hasUniqueSourceProperty === true
|
|
816
|
+
? `${sideEffectWithQualifier}$$ImmediateRequest`
|
|
817
|
+
: sideEffectWithQualifier;
|
|
649
818
|
}
|
|
650
819
|
|
|
651
820
|
getInterface(): SideEffectsService {
|