@sapui5/sap.fe.core 1.127.2 → 1.129.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.js +3 -9
- package/src/sap/fe/core/ActionRuntime.ts +3 -7
- package/src/sap/fe/core/AppComponent.js +9 -19
- package/src/sap/fe/core/AppComponent.ts +2 -12
- package/src/sap/fe/core/AppStateHandler.js +3 -11
- package/src/sap/fe/core/AppStateHandler.ts +0 -7
- package/src/sap/fe/core/BaseController.js +4 -8
- package/src/sap/fe/core/BaseController.ts +0 -5
- package/src/sap/fe/core/CommonUtils.js +1 -9
- package/src/sap/fe/core/CommonUtils.ts +4 -8
- package/src/sap/fe/core/ExtensionAPI.js +10 -25
- package/src/sap/fe/core/ExtensionAPI.ts +4 -19
- package/src/sap/fe/core/InsightsFormattersExtension.js +5 -3
- package/src/sap/fe/core/PageController.js +7 -10
- package/src/sap/fe/core/PageController.ts +0 -3
- package/src/sap/fe/core/ResourceModel.js +3 -5
- package/src/sap/fe/core/ResourceModel.ts +0 -2
- package/src/sap/fe/core/ReuseComponent.js +8 -14
- package/src/sap/fe/core/ReuseComponent.ts +0 -6
- package/src/sap/fe/core/TemplateComponent.js +37 -9
- package/src/sap/fe/core/TemplateComponent.ts +3 -2
- package/src/sap/fe/core/TemplateModel.js +5 -5
- package/src/sap/fe/core/TemplateModel.ts +0 -1
- package/src/sap/fe/core/UIProvider.js +1 -1
- package/src/sap/fe/core/UIProvider.ts +44 -1
- package/src/sap/fe/core/buildingBlocks/BuildingBlockBase.js +7 -12
- package/src/sap/fe/core/buildingBlocks/BuildingBlockBase.ts +0 -5
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +61 -65
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +60 -63
- package/src/sap/fe/core/buildingBlocks/templating/AttributeModel.js +3 -3
- package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockFormatter.js +1 -1
- package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockSupport.js +21 -5
- package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockSupport.ts +0 -4
- package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockTemplateProcessor.js +6 -18
- package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockTemplateProcessor.ts +3 -20
- package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockTemplatingBase.js +5 -11
- package/src/sap/fe/core/buildingBlocks/templating/BuildingBlockTemplatingBase.ts +0 -6
- package/src/sap/fe/core/buildingBlocks/templating/RuntimeBuildingBlock.js +3 -3
- package/src/sap/fe/core/buildingBlocks/templating/RuntimeBuildingBlockFragment.js +11 -10
- package/src/sap/fe/core/buildingBlocks/templating/RuntimeBuildingBlockFragment.ts +0 -1
- package/src/sap/fe/core/controllerextensions/BaseControllerExtension.js +5 -7
- package/src/sap/fe/core/controllerextensions/BaseControllerExtension.ts +0 -1
- package/src/sap/fe/core/controllerextensions/BusyLocker.js +1 -1
- package/src/sap/fe/core/controllerextensions/CollaborativeDraft.js +3 -10
- package/src/sap/fe/core/controllerextensions/CollaborativeDraft.ts +0 -7
- package/src/sap/fe/core/controllerextensions/ContextSharing.js +5 -8
- package/src/sap/fe/core/controllerextensions/ContextSharing.ts +0 -2
- package/src/sap/fe/core/controllerextensions/EditFlow.js +225 -155
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +248 -164
- package/src/sap/fe/core/controllerextensions/Feedback.js +1 -3
- package/src/sap/fe/core/controllerextensions/Feedback.ts +0 -2
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +4 -7
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +0 -3
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +8 -25
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +2 -21
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +22 -34
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +25 -31
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +8 -21
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +4 -15
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +68 -31
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +78 -32
- package/src/sap/fe/core/controllerextensions/PageReady.js +4 -4
- package/src/sap/fe/core/controllerextensions/Paginator.js +4 -8
- package/src/sap/fe/core/controllerextensions/Paginator.ts +0 -4
- package/src/sap/fe/core/controllerextensions/Placeholder.js +4 -4
- package/src/sap/fe/core/controllerextensions/Recommendations.js +15 -24
- package/src/sap/fe/core/controllerextensions/Recommendations.ts +13 -20
- package/src/sap/fe/core/controllerextensions/Routing.js +4 -10
- package/src/sap/fe/core/controllerextensions/Routing.ts +0 -6
- package/src/sap/fe/core/controllerextensions/RoutingListener.js +1 -1
- package/src/sap/fe/core/controllerextensions/Share.js +17 -11
- package/src/sap/fe/core/controllerextensions/Share.ts +10 -5
- package/src/sap/fe/core/controllerextensions/SideEffects.js +49 -45
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +54 -41
- package/src/sap/fe/core/controllerextensions/Telemetry.js +4 -4
- package/src/sap/fe/core/controllerextensions/ViewState.js +10 -34
- package/src/sap/fe/core/controllerextensions/ViewState.ts +3 -49
- package/src/sap/fe/core/controllerextensions/cards/CollaborationManager.js +6 -8
- package/src/sap/fe/core/controllerextensions/cards/CollaborationManager.ts +0 -1
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +1 -2
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +0 -1
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +4 -3
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +1 -1
- package/src/sap/fe/core/controllerextensions/dialog/OperationsDialog.block.js +16 -12
- package/src/sap/fe/core/controllerextensions/dialog/OperationsDialog.block.tsx +4 -1
- package/src/sap/fe/core/controllerextensions/editFlow/NotApplicableContextDialog.js +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +126 -74
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +158 -91
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +1 -22
- package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +0 -20
- package/src/sap/fe/core/controllerextensions/editFlow/draftDataLossPopup.js +10 -20
- package/src/sap/fe/core/controllerextensions/editFlow/draftDataLossPopup.ts +11 -17
- package/src/sap/fe/core/controllerextensions/editFlow/editFlowConstants.js +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/operations/facade.js +191 -767
- package/src/sap/fe/core/controllerextensions/editFlow/operations/facade.ts +277 -1024
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js +1 -1
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +1 -6
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +0 -5
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +381 -250
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +467 -301
- package/src/sap/fe/core/controllerextensions/pageReady/DataQueryWatcher.js +2 -6
- package/src/sap/fe/core/controllerextensions/pageReady/DataQueryWatcher.ts +0 -5
- package/src/sap/fe/core/controllerextensions/recommendations/Telemetry.js +2 -6
- package/src/sap/fe/core/controllerextensions/recommendations/Telemetry.ts +4 -6
- package/src/sap/fe/core/controllerextensions/routing/ContextPathHelper.js +1 -6
- package/src/sap/fe/core/controllerextensions/routing/ContextPathHelper.ts +0 -4
- package/src/sap/fe/core/controllerextensions/routing/NavigationReason.js +1 -1
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +4 -41
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +1 -37
- package/src/sap/fe/core/controllerextensions/viewState/IViewStateContributor.js +1 -1
- package/src/sap/fe/core/controllerextensions/viewState/IViewStateContributor.ts +0 -1
- package/src/sap/fe/core/controls/Any.js +1 -2
- package/src/sap/fe/core/controls/Any.ts +0 -1
- package/src/sap/fe/core/controls/AnyElement.js +1 -2
- package/src/sap/fe/core/controls/AnyElement.ts +0 -1
- package/src/sap/fe/core/controls/CommandExecution.js +3 -3
- package/src/sap/fe/core/controls/ComponentLoader.js +23 -10
- package/src/sap/fe/core/controls/ComponentLoader.ts +0 -1
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DraftDataLossDialog.block.js +10 -13
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DraftDataLossDialog.block.tsx +0 -6
- package/src/sap/fe/core/controls/EventDelegateHook.js +8 -9
- package/src/sap/fe/core/controls/FormElementWrapper.js +7 -7
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +3 -1
- package/src/sap/fe/core/controls/Recommendations/ConfirmRecommendationDialog.block.js +140 -24
- package/src/sap/fe/core/controls/Recommendations/ConfirmRecommendationDialog.block.tsx +141 -10
- package/src/sap/fe/core/converters/ConverterContext.js +8 -30
- package/src/sap/fe/core/converters/ConverterContext.ts +7 -29
- package/src/sap/fe/core/converters/ManifestSettings.js +37 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +12 -3
- package/src/sap/fe/core/converters/ManifestWrapper.js +12 -40
- package/src/sap/fe/core/converters/ManifestWrapper.ts +13 -46
- package/src/sap/fe/core/converters/MetaModelConverter.js +44 -48
- package/src/sap/fe/core/converters/MetaModelConverter.ts +50 -48
- package/src/sap/fe/core/converters/TemplateConverter.js +3 -2
- package/src/sap/fe/core/converters/TemplateConverter.ts +0 -1
- package/src/sap/fe/core/converters/annotations/DataField.js +1 -28
- package/src/sap/fe/core/converters/annotations/DataField.ts +0 -26
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +24 -19
- package/src/sap/fe/core/converters/controls/Common/Action.js +13 -26
- package/src/sap/fe/core/converters/controls/Common/Action.ts +13 -31
- package/src/sap/fe/core/converters/controls/Common/Chart.js +5 -6
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +0 -5
- package/src/sap/fe/core/converters/controls/Common/Criticality.js +2 -4
- package/src/sap/fe/core/converters/controls/Common/Criticality.ts +1 -2
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +1 -5
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +0 -4
- package/src/sap/fe/core/converters/controls/Common/Form.js +3 -2
- package/src/sap/fe/core/converters/controls/Common/Form.ts +2 -1
- package/src/sap/fe/core/converters/controls/Common/KPI.js +11 -7
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +11 -6
- package/src/sap/fe/core/converters/controls/Common/Table.js +159 -141
- package/src/sap/fe/core/converters/controls/Common/Table.ts +166 -122
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +5 -30
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +3 -29
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +43 -55
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +43 -47
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +1 -4
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +0 -3
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.js +1 -1
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +3 -8
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +2 -7
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +1 -11
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +0 -9
- package/src/sap/fe/core/converters/helpers/Aggregation.js +1 -10
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +0 -9
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +1 -7
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +0 -6
- package/src/sap/fe/core/converters/helpers/DataFieldHelper.js +1 -9
- package/src/sap/fe/core/converters/helpers/DataFieldHelper.ts +0 -8
- package/src/sap/fe/core/converters/helpers/ID.js +1 -2
- package/src/sap/fe/core/converters/helpers/ID.ts +0 -1
- package/src/sap/fe/core/converters/helpers/InsightsHelpers.js +1 -2
- package/src/sap/fe/core/converters/helpers/InsightsHelpers.ts +0 -1
- package/src/sap/fe/core/converters/helpers/IssueManager.js +1 -1
- package/src/sap/fe/core/converters/helpers/Key.js +1 -5
- package/src/sap/fe/core/converters/helpers/Key.ts +0 -4
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.js +1 -2
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.ts +0 -1
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +1 -1
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +1 -7
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +0 -6
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +6 -27
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +9 -26
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +1 -16
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +0 -15
- package/src/sap/fe/core/definition/FEDefinition.js +2550 -0
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +11 -12
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +9 -10
- package/src/sap/fe/core/formatters/CollaborationFormatter.js +8 -2
- package/src/sap/fe/core/formatters/CollaborationFormatter.ts +0 -2
- package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.js +1 -2
- package/src/sap/fe/core/formatters/FPMFormatter.ts +0 -1
- package/src/sap/fe/core/formatters/FiscalFormat.js +9 -14
- package/src/sap/fe/core/formatters/FiscalFormat.ts +0 -11
- package/src/sap/fe/core/formatters/KPIFormatter.js +1 -4
- package/src/sap/fe/core/formatters/KPIFormatter.ts +0 -3
- package/src/sap/fe/core/formatters/StandardFormatter.js +6 -3
- package/src/sap/fe/core/formatters/StandardFormatter.ts +6 -2
- package/src/sap/fe/core/formatters/ValueFormatter.js +1 -4
- package/src/sap/fe/core/formatters/ValueFormatter.ts +0 -3
- package/src/sap/fe/core/fpm/Component.js +14 -17
- package/src/sap/fe/core/fpm/Component.ts +7 -10
- package/src/sap/fe/core/fpm/manifest.json +1 -1
- package/src/sap/fe/core/helpers/AdaptiveCardExpressionCompiler.js +3 -10
- package/src/sap/fe/core/helpers/AdaptiveCardExpressionCompiler.ts +0 -9
- package/src/sap/fe/core/helpers/AppStartupHelper.js +1 -13
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +0 -11
- package/src/sap/fe/core/helpers/BindingHelper.js +1 -4
- package/src/sap/fe/core/helpers/BindingHelper.ts +0 -3
- package/src/sap/fe/core/helpers/BindingToolkitEvaluator.js +1 -2
- package/src/sap/fe/core/helpers/BindingToolkitEvaluator.ts +0 -1
- package/src/sap/fe/core/helpers/DeleteHelper.js +61 -32
- package/src/sap/fe/core/helpers/DeleteHelper.ts +79 -33
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +1 -2
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +0 -1
- package/src/sap/fe/core/helpers/EditState.js +1 -1
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +1 -2
- package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +0 -1
- package/src/sap/fe/core/helpers/FPMHelper.js +1 -2
- package/src/sap/fe/core/helpers/FPMHelper.ts +0 -1
- package/src/sap/fe/core/helpers/KeepAliveHelper.js +1 -8
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +0 -7
- package/src/sap/fe/core/helpers/KeepAliveRefreshTypes.js +7 -1
- package/src/sap/fe/core/helpers/LoaderUtils.js +1 -1
- package/src/sap/fe/core/helpers/ManifestHelper.js +1 -3
- package/src/sap/fe/core/helpers/ManifestHelper.ts +0 -2
- package/src/sap/fe/core/helpers/MessageStrip.js +1 -1
- package/src/sap/fe/core/helpers/MetaModelFunction.js +3 -8
- package/src/sap/fe/core/helpers/MetaModelFunction.ts +0 -5
- package/src/sap/fe/core/helpers/MetaPath.js +1 -7
- package/src/sap/fe/core/helpers/MetaPath.ts +0 -6
- package/src/sap/fe/core/helpers/ModelHelper.js +55 -35
- package/src/sap/fe/core/helpers/ModelHelper.ts +64 -38
- package/src/sap/fe/core/helpers/PasteHelper.js +77 -24
- package/src/sap/fe/core/helpers/PasteHelper.ts +105 -23
- package/src/sap/fe/core/helpers/PromiseKeeper.js +1 -3
- package/src/sap/fe/core/helpers/PromiseKeeper.ts +0 -2
- package/src/sap/fe/core/helpers/RecommendationHelper.js +1 -4
- package/src/sap/fe/core/helpers/RecommendationHelper.ts +0 -3
- package/src/sap/fe/core/helpers/ResourceModelHelper.js +1 -3
- package/src/sap/fe/core/helpers/ResourceModelHelper.ts +3 -4
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +1 -2
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +0 -1
- package/src/sap/fe/core/helpers/SizeHelper.js +1 -2
- package/src/sap/fe/core/helpers/SizeHelper.ts +0 -1
- package/src/sap/fe/core/helpers/StableIdHelper.js +7 -17
- package/src/sap/fe/core/helpers/StableIdHelper.ts +7 -17
- package/src/sap/fe/core/helpers/StandardRecommendationHelper.js +1 -12
- package/src/sap/fe/core/helpers/StandardRecommendationHelper.ts +0 -11
- package/src/sap/fe/core/helpers/Synchronization.js +1 -1
- package/src/sap/fe/core/helpers/TitleHelper.js +1 -10
- package/src/sap/fe/core/helpers/TitleHelper.ts +0 -9
- package/src/sap/fe/core/helpers/ToES6Promise.js +1 -2
- package/src/sap/fe/core/helpers/ToES6Promise.ts +0 -1
- package/src/sap/fe/core/helpers/TypeGuards.js +1 -15
- package/src/sap/fe/core/helpers/TypeGuards.ts +0 -14
- package/src/sap/fe/core/helpers/WebSocket.js +1 -1
- package/src/sap/fe/core/library.js +10 -44
- package/src/sap/fe/core/library.support.js +1 -1
- package/src/sap/fe/core/library.ts +8 -45
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +1 -6
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +0 -5
- package/src/sap/fe/core/messagebundle.properties +12 -1
- package/src/sap/fe/core/messagebundle_ar.properties +8 -0
- package/src/sap/fe/core/messagebundle_bg.properties +8 -0
- package/src/sap/fe/core/messagebundle_ca.properties +8 -0
- package/src/sap/fe/core/messagebundle_cnr.properties +8 -0
- package/src/sap/fe/core/messagebundle_cs.properties +9 -1
- package/src/sap/fe/core/messagebundle_cy.properties +8 -0
- package/src/sap/fe/core/messagebundle_da.properties +8 -0
- package/src/sap/fe/core/messagebundle_de.properties +8 -0
- package/src/sap/fe/core/messagebundle_el.properties +8 -0
- package/src/sap/fe/core/messagebundle_en.properties +8 -0
- package/src/sap/fe/core/messagebundle_en_GB.properties +8 -0
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +144 -65
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +8 -0
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +273 -194
- package/src/sap/fe/core/messagebundle_es.properties +9 -1
- package/src/sap/fe/core/messagebundle_es_MX.properties +8 -0
- package/src/sap/fe/core/messagebundle_et.properties +8 -0
- package/src/sap/fe/core/messagebundle_fi.properties +8 -0
- package/src/sap/fe/core/messagebundle_fr.properties +8 -0
- package/src/sap/fe/core/messagebundle_fr_CA.properties +8 -0
- package/src/sap/fe/core/messagebundle_hi.properties +9 -1
- package/src/sap/fe/core/messagebundle_hr.properties +8 -0
- package/src/sap/fe/core/messagebundle_hu.properties +8 -0
- package/src/sap/fe/core/messagebundle_id.properties +12 -4
- package/src/sap/fe/core/messagebundle_it.properties +8 -0
- package/src/sap/fe/core/messagebundle_iw.properties +8 -0
- package/src/sap/fe/core/messagebundle_ja.properties +8 -0
- package/src/sap/fe/core/messagebundle_kk.properties +8 -0
- package/src/sap/fe/core/messagebundle_ko.properties +8 -0
- package/src/sap/fe/core/messagebundle_lt.properties +8 -0
- package/src/sap/fe/core/messagebundle_lv.properties +8 -0
- package/src/sap/fe/core/messagebundle_mk.properties +8 -0
- package/src/sap/fe/core/messagebundle_ms.properties +8 -0
- package/src/sap/fe/core/messagebundle_nl.properties +16 -8
- package/src/sap/fe/core/messagebundle_no.properties +8 -0
- package/src/sap/fe/core/messagebundle_pl.properties +8 -0
- package/src/sap/fe/core/messagebundle_pt.properties +8 -0
- package/src/sap/fe/core/messagebundle_pt_PT.properties +8 -0
- package/src/sap/fe/core/messagebundle_ro.properties +8 -0
- package/src/sap/fe/core/messagebundle_ru.properties +8 -0
- package/src/sap/fe/core/messagebundle_sh.properties +8 -0
- package/src/sap/fe/core/messagebundle_sk.properties +8 -0
- package/src/sap/fe/core/messagebundle_sl.properties +8 -0
- package/src/sap/fe/core/messagebundle_sr.properties +8 -0
- package/src/sap/fe/core/messagebundle_sv.properties +8 -0
- package/src/sap/fe/core/messagebundle_th.properties +12 -4
- package/src/sap/fe/core/messagebundle_tr.properties +8 -0
- package/src/sap/fe/core/messagebundle_uk.properties +10 -2
- package/src/sap/fe/core/messagebundle_vi.properties +8 -0
- package/src/sap/fe/core/messagebundle_zh_CN.properties +8 -0
- package/src/sap/fe/core/messagebundle_zh_TW.properties +8 -0
- package/src/sap/fe/core/operationsHelper.js +22 -7
- package/src/sap/fe/core/operationsHelper.ts +24 -5
- package/src/sap/fe/core/rootView/Fcl.controller.js +7 -27
- package/src/sap/fe/core/rootView/Fcl.controller.ts +0 -18
- package/src/sap/fe/core/rootView/NavContainer.controller.js +7 -12
- package/src/sap/fe/core/rootView/NavContainer.controller.ts +0 -5
- package/src/sap/fe/core/rootView/RootViewBaseController.js +10 -24
- package/src/sap/fe/core/rootView/RootViewBaseController.ts +3 -16
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +3 -3
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +3 -3
- package/src/sap/fe/core/services/CollaborationManagerServiceFactory.js +4 -4
- package/src/sap/fe/core/services/CollaborativeToolsServiceFactory.js +3 -3
- package/src/sap/fe/core/services/ContextSharingServiceFactory.js +3 -4
- package/src/sap/fe/core/services/ContextSharingServiceFactory.ts +0 -1
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +13 -20
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +11 -17
- package/src/sap/fe/core/services/NavigationServiceFactory.js +11 -21
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +4 -17
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +3 -3
- package/src/sap/fe/core/services/RoutingServiceFactory.js +7 -19
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +0 -12
- package/src/sap/fe/core/services/ShellServicesFactory.js +8 -44
- package/src/sap/fe/core/services/ShellServicesFactory.ts +1 -41
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +19 -60
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +14 -57
- package/src/sap/fe/core/services/TelemetryServiceFactory.js +6 -14
- package/src/sap/fe/core/services/TelemetryServiceFactory.ts +2 -10
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +17 -7
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +17 -3
- package/src/sap/fe/core/services/ValueHelpHistoryServiceFactory.js +11 -24
- package/src/sap/fe/core/services/ValueHelpHistoryServiceFactory.ts +0 -19
- package/src/sap/fe/core/services/collaborativeDraftServiceFactory.js +3 -31
- package/src/sap/fe/core/services/collaborativeDraftServiceFactory.ts +0 -27
- package/src/sap/fe/core/services/valueHelpService/HistoryOptOutProvider.js +1 -4
- package/src/sap/fe/core/services/valueHelpService/HistoryOptOutProvider.ts +0 -3
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +7 -7
- package/src/sap/fe/core/support/AnnotationIssue.support.js +1 -1
- package/src/sap/fe/core/support/CollectionFacetMissingID.support.js +1 -1
- package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +1 -1
- package/src/sap/fe/core/support/CommonHelper.js +4 -1
- package/src/sap/fe/core/support/Diagnostics.js +1 -1
- package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.js +1 -1
- package/src/sap/fe/core/templating/ActionHelper.js +1 -2
- package/src/sap/fe/core/templating/ActionHelper.ts +0 -1
- package/src/sap/fe/core/templating/CommonFormatters.js +1 -2
- package/src/sap/fe/core/templating/CommonFormatters.ts +0 -1
- package/src/sap/fe/core/templating/CriticalityFormatters.js +1 -6
- package/src/sap/fe/core/templating/CriticalityFormatters.ts +0 -5
- package/src/sap/fe/core/templating/DataFieldFormatters.js +1 -2
- package/src/sap/fe/core/templating/DataFieldFormatters.ts +0 -1
- package/src/sap/fe/core/templating/DataModelPathHelper.js +1 -18
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +0 -17
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +6 -1
- package/src/sap/fe/core/templating/EntitySetHelper.js +1 -4
- package/src/sap/fe/core/templating/EntitySetHelper.ts +0 -3
- package/src/sap/fe/core/templating/EntityTypeHelper.js +4 -5
- package/src/sap/fe/core/templating/EntityTypeHelper.ts +3 -4
- package/src/sap/fe/core/templating/FieldControlHelper.js +4 -9
- package/src/sap/fe/core/templating/FieldControlHelper.ts +3 -9
- package/src/sap/fe/core/templating/FilterTemplating.js +1 -1
- package/src/sap/fe/core/templating/PropertyFormatters.js +1 -1
- package/src/sap/fe/core/templating/PropertyHelper.js +1 -31
- package/src/sap/fe/core/templating/PropertyHelper.ts +0 -30
- package/src/sap/fe/core/templating/SemanticObjectHelper.js +1 -7
- package/src/sap/fe/core/templating/SemanticObjectHelper.ts +0 -6
- package/src/sap/fe/core/templating/UIFormatters.js +18 -14
- package/src/sap/fe/core/templating/UIFormatters.ts +30 -18
- package/src/sap/fe/core/type/Date.js +3 -6
- package/src/sap/fe/core/type/Date.ts +0 -3
- package/src/sap/fe/core/type/DateTimeWithTimezone.js +3 -3
- package/src/sap/fe/core/type/EDM.js +1 -1
- package/src/sap/fe/core/type/Email.js +3 -3
- package/src/sap/fe/core/type/FiscalDate.js +3 -9
- package/src/sap/fe/core/type/FiscalDate.ts +0 -6
- package/src/sap/fe/core/type/InputMask.js +3 -7
- package/src/sap/fe/core/type/InputMask.ts +0 -4
|
@@ -1,61 +1,49 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
ActionImport,
|
|
3
|
+
ActionParameter,
|
|
4
|
+
Action as EdmAction,
|
|
5
|
+
ActionParameter as EdmActionParameter,
|
|
6
|
+
PrimitiveType
|
|
7
|
+
} from "@sap-ux/vocabularies-types";
|
|
2
8
|
import Log from "sap/base/Log";
|
|
3
|
-
import type { ActionParameterInfo } from "sap/fe/core/ActionRuntime";
|
|
4
9
|
import ActionRuntime from "sap/fe/core/ActionRuntime";
|
|
5
10
|
import type { FEView } from "sap/fe/core/BaseController";
|
|
6
|
-
import CommonUtils from "sap/fe/core/CommonUtils";
|
|
7
11
|
import type ResourceModel from "sap/fe/core/ResourceModel";
|
|
8
|
-
import
|
|
12
|
+
import { getCoreUIFactory } from "sap/fe/core/UIProvider";
|
|
9
13
|
import type { BindContextParameters } from "sap/fe/core/controllerextensions/editFlow/draft";
|
|
10
|
-
import UiModelConstants from "sap/fe/core/controllerextensions/editFlow/editFlowConstants";
|
|
11
14
|
import type { ShowMessageParameters } from "sap/fe/core/controllerextensions/messageHandler/messageHandling";
|
|
12
15
|
import messageHandling from "sap/fe/core/controllerextensions/messageHandler/messageHandling";
|
|
13
16
|
import { convertTypes, type MetaModelAction } from "sap/fe/core/converters/MetaModelConverter";
|
|
14
17
|
import DeleteHelper from "sap/fe/core/helpers/DeleteHelper";
|
|
15
|
-
import FPMHelper from "sap/fe/core/helpers/FPMHelper";
|
|
16
18
|
import type { InternalModelContext } from "sap/fe/core/helpers/ModelHelper";
|
|
17
19
|
import ModelHelper from "sap/fe/core/helpers/ModelHelper";
|
|
18
20
|
import { getResourceModel } from "sap/fe/core/helpers/ResourceModelHelper";
|
|
19
|
-
import { generate } from "sap/fe/core/helpers/StableIdHelper";
|
|
20
21
|
import FELibrary from "sap/fe/core/library";
|
|
21
22
|
import type { ActionSideEffectsType } from "sap/fe/core/services/SideEffectsServiceFactory";
|
|
22
|
-
import type
|
|
23
|
-
import type ObjectPageExtensionAPI from "sap/fe/templates/ObjectPage/ExtensionAPI";
|
|
24
|
-
import Button from "sap/m/Button";
|
|
25
|
-
import type { Dialog$BeforeOpenEvent } from "sap/m/Dialog";
|
|
26
|
-
import Dialog from "sap/m/Dialog";
|
|
23
|
+
import type Dialog from "sap/m/Dialog";
|
|
27
24
|
import MessageBox from "sap/m/MessageBox";
|
|
28
|
-
import type Event from "sap/ui/base/Event";
|
|
29
25
|
import type Control from "sap/ui/core/Control";
|
|
30
|
-
import Element from "sap/ui/core/Element";
|
|
31
|
-
import Fragment from "sap/ui/core/Fragment";
|
|
32
26
|
import Library from "sap/ui/core/Lib";
|
|
33
27
|
import Messaging from "sap/ui/core/Messaging";
|
|
34
|
-
import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
|
|
35
28
|
import Message from "sap/ui/core/message/Message";
|
|
36
29
|
import MessageType from "sap/ui/core/message/MessageType";
|
|
37
30
|
import type View from "sap/ui/core/mvc/View";
|
|
38
|
-
import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
|
|
39
|
-
import type Field from "sap/ui/mdc/Field";
|
|
40
|
-
import type MultiValueField from "sap/ui/mdc/MultiValueField";
|
|
41
31
|
import type Table from "sap/ui/mdc/Table";
|
|
42
32
|
import type MultiValueFieldItem from "sap/ui/mdc/field/MultiValueFieldItem";
|
|
43
33
|
import type Context from "sap/ui/model/Context";
|
|
44
|
-
import JSONModel from "sap/ui/model/json/JSONModel";
|
|
45
34
|
import type { default as ODataV4Context } from "sap/ui/model/odata/v4/Context";
|
|
46
35
|
import type ODataContextBinding from "sap/ui/model/odata/v4/ODataContextBinding";
|
|
47
36
|
import type ODataModel from "sap/ui/model/odata/v4/ODataModel";
|
|
48
37
|
import type AppComponent from "../../../AppComponent";
|
|
49
38
|
import operationsHelper, { type StrictHandlingParameters, type StrictHandlingUtilities } from "../../../operationsHelper";
|
|
50
39
|
import type MessageHandler from "../../MessageHandler";
|
|
51
|
-
|
|
52
40
|
const Constants = FELibrary.Constants,
|
|
53
41
|
InvocationGrouping = FELibrary.InvocationGrouping;
|
|
54
42
|
const Action = MessageBox.Action;
|
|
55
43
|
|
|
56
44
|
export type ActionResponse = undefined | ODataV4Context | PromiseSettledResult<undefined | ODataV4Context>[];
|
|
57
45
|
|
|
58
|
-
type ShowActionDialogParameters = {
|
|
46
|
+
export type ShowActionDialogParameters = {
|
|
59
47
|
appComponent: AppComponent;
|
|
60
48
|
fnOnSubmitted: Function;
|
|
61
49
|
fnOnResponse: Function;
|
|
@@ -67,7 +55,7 @@ type ShowActionDialogParameters = {
|
|
|
67
55
|
defaultValuesExtensionFunction?: string;
|
|
68
56
|
label?: string;
|
|
69
57
|
selectedItems: ODataV4Context[];
|
|
70
|
-
aContexts
|
|
58
|
+
aContexts: ODataV4Context[];
|
|
71
59
|
mBindingParameters?: BindContextParameters;
|
|
72
60
|
additionalSideEffect?: ActionSideEffectsType;
|
|
73
61
|
bGrouped?: boolean;
|
|
@@ -85,7 +73,7 @@ type ShowActionDialogParameters = {
|
|
|
85
73
|
internalOperationsPromiseResolve?: Function;
|
|
86
74
|
};
|
|
87
75
|
|
|
88
|
-
type CallActionParameters = {
|
|
76
|
+
export type CallActionParameters = {
|
|
89
77
|
parameterValues?: Record<string, string | boolean | number | MultiValueFieldItem[]>[];
|
|
90
78
|
label?: string;
|
|
91
79
|
invocationGrouping?: string;
|
|
@@ -118,9 +106,10 @@ type CallActionParameters = {
|
|
|
118
106
|
groupId?: string;
|
|
119
107
|
};
|
|
120
108
|
|
|
109
|
+
type BaseTypeParameter = string | number | boolean;
|
|
110
|
+
|
|
121
111
|
/**
|
|
122
112
|
* Calls a bound action for one or multiple contexts.
|
|
123
|
-
*
|
|
124
113
|
* @param sActionName The name of the action to be called
|
|
125
114
|
* @param contexts Either one context or an array with contexts for which the action is to be be called
|
|
126
115
|
* @param oModel OData Model
|
|
@@ -137,7 +126,6 @@ type CallActionParameters = {
|
|
|
137
126
|
* @param [mParameters.parentControl] If specified, the dialogs are added as dependent of the parent control
|
|
138
127
|
* @param [mParameters.bGetBoundContext] If specified, the action promise returns the bound context
|
|
139
128
|
* @param [mParameters.ignoreETag] If specified, the action is called without ETag handling
|
|
140
|
-
* @param [strictHandlingUtilities] Optional, utility flags and messages for strictHandling
|
|
141
129
|
* @returns Promise resolves with an array of response objects (TODO: to be changed)
|
|
142
130
|
*/
|
|
143
131
|
async function callBoundAction(
|
|
@@ -201,7 +189,6 @@ async function callBoundAction(
|
|
|
201
189
|
}
|
|
202
190
|
/**
|
|
203
191
|
* Calls an action import.
|
|
204
|
-
*
|
|
205
192
|
* @param actionName The name of the action import to be called
|
|
206
193
|
* @param model An instance of an OData V4 model
|
|
207
194
|
* @param appComponent The AppComponent
|
|
@@ -212,7 +199,6 @@ async function callBoundAction(
|
|
|
212
199
|
* @param [parameters.onSubmitted] Function which is called once the actions are submitted with an array of promises
|
|
213
200
|
* @param [parameters.defaultParameters] Can contain default parameters from FLP user defaults
|
|
214
201
|
* @param [parameters.ignoreETag] If specified, the action is called without ETag handling
|
|
215
|
-
* @param [strictHandlingUtilities] Optional, utility flags and messages for strictHandling
|
|
216
202
|
* @returns Promise resolves with an array of response objects (TODO: to be changed)
|
|
217
203
|
*/
|
|
218
204
|
async function callActionImport(
|
|
@@ -268,7 +254,6 @@ async function callBoundFunction(sFunctionName: string, context: Context, oModel
|
|
|
268
254
|
|
|
269
255
|
/**
|
|
270
256
|
* Calls a function import.
|
|
271
|
-
*
|
|
272
257
|
* @param sFunctionName The name of the function to be called
|
|
273
258
|
* @param oModel An instance of an OData v4 model
|
|
274
259
|
* @returns Promise resolves
|
|
@@ -296,6 +281,34 @@ async function _executeFunction(
|
|
|
296
281
|
return functionToCall.getBoundContext();
|
|
297
282
|
}
|
|
298
283
|
|
|
284
|
+
async function checkParameterTypeAndReturnConvertedValue(
|
|
285
|
+
parameter: ActionParameter,
|
|
286
|
+
value?: BaseTypeParameter | null
|
|
287
|
+
): Promise<BaseTypeParameter | undefined | null> {
|
|
288
|
+
if (value === undefined || value === null) {
|
|
289
|
+
return value;
|
|
290
|
+
}
|
|
291
|
+
const BaseType = (await import("sap/ui/mdc/enums/BaseType")).default;
|
|
292
|
+
const TypeMap = (await import("sap/ui/mdc/odata/v4/TypeMap")).default;
|
|
293
|
+
const parameterType = (
|
|
294
|
+
parameter as {
|
|
295
|
+
name: string;
|
|
296
|
+
type?: string;
|
|
297
|
+
}
|
|
298
|
+
).type
|
|
299
|
+
? TypeMap.getBaseType(
|
|
300
|
+
(
|
|
301
|
+
parameter as {
|
|
302
|
+
name: string;
|
|
303
|
+
type: string;
|
|
304
|
+
}
|
|
305
|
+
).type
|
|
306
|
+
)
|
|
307
|
+
: BaseType.String;
|
|
308
|
+
const typeInstance = TypeMap.getDataTypeInstance(parameterType);
|
|
309
|
+
return typeInstance.parseValue(value, "string");
|
|
310
|
+
}
|
|
311
|
+
|
|
299
312
|
async function callAction(
|
|
300
313
|
convertedAction: EdmAction,
|
|
301
314
|
oModel: ODataModel,
|
|
@@ -303,13 +316,14 @@ async function callAction(
|
|
|
303
316
|
oAppComponent: AppComponent,
|
|
304
317
|
mParameters: CallActionParameters
|
|
305
318
|
): Promise<ActionResponse> {
|
|
306
|
-
let strictHandlingUtilities = {
|
|
319
|
+
let strictHandlingUtilities: StrictHandlingUtilities = {
|
|
307
320
|
is412Executed: false,
|
|
308
321
|
strictHandlingTransitionFails: [],
|
|
309
322
|
strictHandlingPromises: [],
|
|
310
323
|
strictHandlingWarningMessages: [],
|
|
311
324
|
delaySuccessMessages: [],
|
|
312
|
-
processedMessageIds: new Set<string>()
|
|
325
|
+
processedMessageIds: new Set<string>(),
|
|
326
|
+
strictResponseErrorExists: false
|
|
313
327
|
};
|
|
314
328
|
const sActionName = convertedAction.isBound
|
|
315
329
|
? convertedAction.fullyQualifiedName.replace(/\(.*\)$/g, "") // remove the part related to the overlay
|
|
@@ -319,23 +333,6 @@ async function callAction(
|
|
|
319
333
|
resolve: (value: ActionResponse) => void,
|
|
320
334
|
reject: (reason?: Error | ActionResponse) => void
|
|
321
335
|
) {
|
|
322
|
-
let fnDialog:
|
|
323
|
-
| ((
|
|
324
|
-
sActionName: string,
|
|
325
|
-
oAppComponent: AppComponent,
|
|
326
|
-
sActionLabel: string | undefined,
|
|
327
|
-
mActionExecutionParameters: ShowActionDialogParameters,
|
|
328
|
-
aActionParameters: EdmActionParameter[],
|
|
329
|
-
aParameterValues: Record<string, unknown>[] | undefined,
|
|
330
|
-
oAction: Context,
|
|
331
|
-
parentControl: View,
|
|
332
|
-
entitySetName: string | undefined,
|
|
333
|
-
messageHandler: MessageHandler,
|
|
334
|
-
strictHandlingUtilities: StrictHandlingUtilities,
|
|
335
|
-
view: View | null,
|
|
336
|
-
ignoreETag?: boolean
|
|
337
|
-
) => Promise<undefined | ODataV4Context | PromiseSettledResult<ODataV4Context | undefined>[]>)
|
|
338
|
-
| null = null;
|
|
339
336
|
const sActionLabel = mParameters.label;
|
|
340
337
|
let bSkipParameterDialog = mParameters.skipParameterDialog;
|
|
341
338
|
const aContexts = mParameters.aContexts;
|
|
@@ -383,13 +380,6 @@ async function callAction(
|
|
|
383
380
|
|
|
384
381
|
// Depending on the previously determined data, either set a dialog or leave it empty which
|
|
385
382
|
// will lead to direct execution of the action without a dialog
|
|
386
|
-
if (bActionNeedsParameterDialog) {
|
|
387
|
-
if (!(bSkipParameterDialog && bValuesProvidedForAllMandatoryParameters)) {
|
|
388
|
-
fnDialog = showActionParameterDialog;
|
|
389
|
-
}
|
|
390
|
-
} else if (bIsCriticalAction) {
|
|
391
|
-
fnDialog = confirmCriticalAction;
|
|
392
|
-
}
|
|
393
383
|
|
|
394
384
|
const mActionExecutionParameters: ShowActionDialogParameters = {
|
|
395
385
|
defaultParametersValues: {},
|
|
@@ -397,6 +387,7 @@ async function callAction(
|
|
|
397
387
|
fnOnSubmitted: mParameters.onSubmitted,
|
|
398
388
|
fnOnResponse: mParameters.onResponse,
|
|
399
389
|
actionName: sActionName,
|
|
390
|
+
aContexts: [],
|
|
400
391
|
model: oModel,
|
|
401
392
|
aActionParameters: actionParameters,
|
|
402
393
|
bGetBoundContext: mParameters.bGetBoundContext,
|
|
@@ -463,7 +454,7 @@ async function callAction(
|
|
|
463
454
|
}
|
|
464
455
|
}
|
|
465
456
|
|
|
466
|
-
mActionExecutionParameters.aContexts = aContexts;
|
|
457
|
+
mActionExecutionParameters.aContexts = aContexts ?? [];
|
|
467
458
|
mActionExecutionParameters.mBindingParameters = mParameters.mBindingParameters;
|
|
468
459
|
mActionExecutionParameters.additionalSideEffect = mParameters.additionalSideEffect;
|
|
469
460
|
mActionExecutionParameters.bGrouped = mParameters.invocationGrouping === InvocationGrouping.ChangeSet;
|
|
@@ -486,9 +477,34 @@ async function callAction(
|
|
|
486
477
|
mActionExecutionParameters.bIsCreateAction = bIsCreateAction;
|
|
487
478
|
}
|
|
488
479
|
mActionExecutionParameters.isStatic = convertedAction.isBound && !!convertedAction.parameters[0]?.isCollection;
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
480
|
+
|
|
481
|
+
let operationResult;
|
|
482
|
+
let executionWitDialog = false;
|
|
483
|
+
try {
|
|
484
|
+
if (bActionNeedsParameterDialog) {
|
|
485
|
+
if (!(bSkipParameterDialog && bValuesProvidedForAllMandatoryParameters)) {
|
|
486
|
+
executionWitDialog = true;
|
|
487
|
+
const parameterDialog = getCoreUIFactory().newParameterDialog(
|
|
488
|
+
convertedAction,
|
|
489
|
+
oAction as ODataV4Context,
|
|
490
|
+
mActionExecutionParameters,
|
|
491
|
+
aParameterValues,
|
|
492
|
+
mParameters.entitySetName,
|
|
493
|
+
mParameters.view as FEView | null,
|
|
494
|
+
mParameters.messageHandler,
|
|
495
|
+
strictHandlingUtilities,
|
|
496
|
+
{
|
|
497
|
+
actionToBeExecuted: _executeAction,
|
|
498
|
+
beforeShowingMessage: actionParameterShowMessageCallback
|
|
499
|
+
},
|
|
500
|
+
mParameters.ignoreETag
|
|
501
|
+
);
|
|
502
|
+
await parameterDialog.createDialog();
|
|
503
|
+
operationResult = await parameterDialog.openDialog(mParameters.parentControl);
|
|
504
|
+
}
|
|
505
|
+
} else if (bIsCriticalAction) {
|
|
506
|
+
executionWitDialog = true;
|
|
507
|
+
operationResult = await confirmCriticalAction(
|
|
492
508
|
sActionName,
|
|
493
509
|
oAppComponent,
|
|
494
510
|
sActionLabel,
|
|
@@ -503,121 +519,133 @@ async function callAction(
|
|
|
503
519
|
mParameters.view,
|
|
504
520
|
mParameters.ignoreETag
|
|
505
521
|
);
|
|
506
|
-
afterActionResolution(mParameters, mActionExecutionParameters, actionDefinition);
|
|
507
|
-
resolve(operationResult);
|
|
508
|
-
return;
|
|
509
|
-
} catch (e) {
|
|
510
|
-
reject(e as Error | ActionResponse);
|
|
511
522
|
}
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
|
|
523
|
+
} catch (e) {
|
|
524
|
+
reject(e as Error | ActionResponse);
|
|
525
|
+
}
|
|
526
|
+
if (executionWitDialog) {
|
|
527
|
+
afterActionResolution(mParameters, mActionExecutionParameters, actionDefinition);
|
|
528
|
+
resolve(operationResult);
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
515
531
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
mActionExecutionParameters.defaultParametersValues[mActionExecutionParameters.aActionParameters[i].name] =
|
|
524
|
-
(oStartupParameters[mActionExecutionParameters.aActionParameters[i].name]?.[0] as string | boolean | number) ||
|
|
525
|
-
mActionExecutionParameters.aActionParameters[i].annotations?.UI?.ParameterDefaultValue?.valueOf();
|
|
526
|
-
}
|
|
532
|
+
// Take over all provided parameter values and call the action.
|
|
533
|
+
// This shall only happen if values are provided for all the parameters, otherwise the parameter dialog shall be shown which is ensured earlier
|
|
534
|
+
|
|
535
|
+
if (aParameterValues) {
|
|
536
|
+
for (const i in mActionExecutionParameters.aActionParameters) {
|
|
537
|
+
mActionExecutionParameters.defaultParametersValues[mActionExecutionParameters.aActionParameters[i].name] =
|
|
538
|
+
aParameterValues?.find((element) => element.name === mActionExecutionParameters.aActionParameters[i].name)?.value;
|
|
527
539
|
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
540
|
+
} else {
|
|
541
|
+
let actionParameter, parameterValueNotConverted;
|
|
542
|
+
for (const i in mActionExecutionParameters.aActionParameters) {
|
|
543
|
+
actionParameter = mActionExecutionParameters.aActionParameters[i];
|
|
544
|
+
parameterValueNotConverted =
|
|
545
|
+
(oStartupParameters[actionParameter.name]?.[0] as BaseTypeParameter) ||
|
|
546
|
+
actionParameter.annotations?.UI?.ParameterDefaultValue?.valueOf();
|
|
547
|
+
mActionExecutionParameters.defaultParametersValues[actionParameter.name] =
|
|
548
|
+
parameterValueNotConverted === undefined
|
|
549
|
+
? parameterValueNotConverted
|
|
550
|
+
: await checkParameterTypeAndReturnConvertedValue(actionParameter, parameterValueNotConverted);
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
let oOperationResult: undefined | ODataV4Context | PromiseSettledResult<ODataV4Context | undefined>[];
|
|
554
|
+
try {
|
|
555
|
+
oOperationResult = await _executeAction(
|
|
556
|
+
oAppComponent,
|
|
557
|
+
mActionExecutionParameters,
|
|
558
|
+
mParameters.parentControl,
|
|
559
|
+
mParameters.messageHandler,
|
|
560
|
+
strictHandlingUtilities,
|
|
561
|
+
mParameters.ignoreETag
|
|
562
|
+
);
|
|
538
563
|
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
564
|
+
const messages = Messaging.getMessageModel().getData();
|
|
565
|
+
if (
|
|
566
|
+
strictHandlingUtilities &&
|
|
567
|
+
strictHandlingUtilities.is412Executed &&
|
|
568
|
+
strictHandlingUtilities.strictHandlingTransitionFails.length
|
|
569
|
+
) {
|
|
570
|
+
strictHandlingUtilities.delaySuccessMessages = strictHandlingUtilities.delaySuccessMessages.concat(messages);
|
|
571
|
+
}
|
|
572
|
+
afterActionResolution(mParameters, mActionExecutionParameters, actionDefinition);
|
|
573
|
+
resolve(oOperationResult);
|
|
574
|
+
} catch {
|
|
575
|
+
reject(oOperationResult as Error | ActionResponse);
|
|
576
|
+
} finally {
|
|
577
|
+
if (
|
|
578
|
+
strictHandlingUtilities &&
|
|
579
|
+
strictHandlingUtilities.is412Executed &&
|
|
580
|
+
strictHandlingUtilities.strictHandlingTransitionFails.length &&
|
|
581
|
+
mParameters.aContexts!.length > 1
|
|
582
|
+
) {
|
|
583
|
+
try {
|
|
584
|
+
const strictHandlingFails = strictHandlingUtilities.strictHandlingTransitionFails;
|
|
585
|
+
const aFailedContexts = [] as ODataV4Context[];
|
|
586
|
+
strictHandlingFails.forEach(function (fail: { oAction: ODataContextBinding; groupId: string }): void {
|
|
587
|
+
aFailedContexts.push(fail.oAction.getContext() as ODataV4Context);
|
|
588
|
+
});
|
|
589
|
+
mActionExecutionParameters.aContexts = aFailedContexts;
|
|
590
|
+
const oFailedOperationResult = await _executeAction(
|
|
591
|
+
oAppComponent,
|
|
592
|
+
mActionExecutionParameters,
|
|
593
|
+
mParameters.parentControl,
|
|
594
|
+
mParameters.messageHandler,
|
|
595
|
+
strictHandlingUtilities,
|
|
596
|
+
mParameters.ignoreETag
|
|
597
|
+
);
|
|
598
|
+
strictHandlingUtilities.strictHandlingTransitionFails = [];
|
|
599
|
+
Messaging.addMessages(strictHandlingUtilities.delaySuccessMessages);
|
|
600
|
+
afterActionResolution(mParameters, mActionExecutionParameters, actionDefinition);
|
|
601
|
+
resolve(oFailedOperationResult);
|
|
602
|
+
} catch (oFailedOperationResult) {
|
|
603
|
+
reject(
|
|
604
|
+
oFailedOperationResult as Error | ODataV4Context | undefined | PromiseSettledResult<ODataV4Context | undefined>[]
|
|
605
|
+
);
|
|
542
606
|
}
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
const oFailedOperationResult = await _executeAction(
|
|
561
|
-
oAppComponent,
|
|
607
|
+
}
|
|
608
|
+
let showGenericErrorMessageForChangeSet = false;
|
|
609
|
+
if (
|
|
610
|
+
(mParameters.bGrouped && strictHandlingUtilities && strictHandlingUtilities.strictHandlingPromises.length) ||
|
|
611
|
+
(mParameters.bGrouped && messageHandling.hasTransitionErrorsOrWarnings())
|
|
612
|
+
) {
|
|
613
|
+
showGenericErrorMessageForChangeSet = true;
|
|
614
|
+
}
|
|
615
|
+
let isActionSuccessful = false;
|
|
616
|
+
if (Array.isArray(oOperationResult)) {
|
|
617
|
+
isActionSuccessful = oOperationResult?.every((res) => res.status === "fulfilled");
|
|
618
|
+
}
|
|
619
|
+
mParameters?.messageHandler
|
|
620
|
+
?.showMessageDialog({
|
|
621
|
+
control: mActionExecutionParameters?.control,
|
|
622
|
+
onBeforeShowMessage: function (aMessages: Message[], showMessageParametersIn: ShowMessageParameters) {
|
|
623
|
+
return actionParameterShowMessageCallback(
|
|
562
624
|
mActionExecutionParameters,
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
Messaging.addMessages(strictHandlingUtilities.delaySuccessMessages);
|
|
570
|
-
afterActionResolution(mParameters, mActionExecutionParameters, actionDefinition);
|
|
571
|
-
resolve(oFailedOperationResult);
|
|
572
|
-
} catch (oFailedOperationResult) {
|
|
573
|
-
reject(
|
|
574
|
-
oFailedOperationResult as
|
|
575
|
-
| Error
|
|
576
|
-
| ODataV4Context
|
|
577
|
-
| undefined
|
|
578
|
-
| PromiseSettledResult<ODataV4Context | undefined>[]
|
|
625
|
+
aContexts!,
|
|
626
|
+
undefined,
|
|
627
|
+
aMessages,
|
|
628
|
+
showMessageParametersIn,
|
|
629
|
+
showGenericErrorMessageForChangeSet,
|
|
630
|
+
isActionSuccessful
|
|
579
631
|
);
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
let isActionSuccessful = false;
|
|
590
|
-
if (Array.isArray(oOperationResult)) {
|
|
591
|
-
isActionSuccessful = oOperationResult?.every((res) => res.status === "fulfilled");
|
|
592
|
-
}
|
|
593
|
-
mParameters?.messageHandler
|
|
594
|
-
?.showMessageDialog({
|
|
595
|
-
control: mActionExecutionParameters?.control,
|
|
596
|
-
onBeforeShowMessage: function (aMessages: Message[], showMessageParametersIn: ShowMessageParameters) {
|
|
597
|
-
return actionParameterShowMessageCallback(
|
|
598
|
-
mActionExecutionParameters,
|
|
599
|
-
aContexts!,
|
|
600
|
-
undefined,
|
|
601
|
-
aMessages,
|
|
602
|
-
showMessageParametersIn,
|
|
603
|
-
showGenericErrorMessageForChangeSet,
|
|
604
|
-
isActionSuccessful
|
|
605
|
-
);
|
|
606
|
-
},
|
|
607
|
-
aSelectedContexts: mParameters.aContexts,
|
|
608
|
-
sActionName: sActionLabel
|
|
609
|
-
})
|
|
610
|
-
.then(() => {
|
|
611
|
-
mParameters.messageHandler.clearStrictWarningMessages();
|
|
612
|
-
return;
|
|
613
|
-
});
|
|
632
|
+
},
|
|
633
|
+
aSelectedContexts: mParameters.aContexts,
|
|
634
|
+
sActionName: sActionLabel
|
|
635
|
+
})
|
|
636
|
+
.then(() => {
|
|
637
|
+
mParameters.messageHandler.clearStrictWarningMessages();
|
|
638
|
+
return;
|
|
639
|
+
});
|
|
640
|
+
if (strictHandlingUtilities) {
|
|
614
641
|
strictHandlingUtilities = {
|
|
615
642
|
is412Executed: false,
|
|
616
643
|
strictHandlingTransitionFails: [],
|
|
617
644
|
strictHandlingPromises: [],
|
|
618
645
|
strictHandlingWarningMessages: [],
|
|
619
646
|
delaySuccessMessages: [],
|
|
620
|
-
processedMessageIds: new Set()
|
|
647
|
+
processedMessageIds: new Set(),
|
|
648
|
+
strictResponseErrorExists: false
|
|
621
649
|
};
|
|
622
650
|
}
|
|
623
651
|
}
|
|
@@ -677,100 +705,6 @@ async function confirmCriticalAction(
|
|
|
677
705
|
});
|
|
678
706
|
}
|
|
679
707
|
|
|
680
|
-
async function executeAPMAction(
|
|
681
|
-
oAppComponent: AppComponent,
|
|
682
|
-
mParameters: ShowActionDialogParameters,
|
|
683
|
-
oParentControl: View,
|
|
684
|
-
messageHandler: MessageHandler,
|
|
685
|
-
aContexts: ODataV4Context[],
|
|
686
|
-
oDialog: Dialog,
|
|
687
|
-
after412: boolean,
|
|
688
|
-
strictHandlingUtilities: StrictHandlingUtilities,
|
|
689
|
-
ignoreETag?: boolean
|
|
690
|
-
): Promise<undefined | ODataV4Context | PromiseSettledResult<ODataV4Context | undefined>[]> {
|
|
691
|
-
const aResult = await _executeAction(oAppComponent, mParameters, oParentControl, messageHandler, strictHandlingUtilities, ignoreETag);
|
|
692
|
-
// If some entries were successful, and others have failed, the overall process is still successful. However, this was treated as rejection
|
|
693
|
-
// before, and this currently is still kept, as long as dialog handling is mixed with backend process handling.
|
|
694
|
-
// TODO: Refactor to only reject in case of overall process error.
|
|
695
|
-
// For the time being: map to old logic to reject if at least one entry has failed
|
|
696
|
-
// This check is only done for bound actions => aContexts not empty
|
|
697
|
-
if (mParameters.aContexts && mParameters.aContexts.length > 0) {
|
|
698
|
-
if (
|
|
699
|
-
(aResult as PromiseSettledResult<ODataV4Context | undefined>[])?.some(
|
|
700
|
-
(oSingleResult: PromiseSettledResult<ODataV4Context | undefined>) => oSingleResult.status === "rejected"
|
|
701
|
-
)
|
|
702
|
-
) {
|
|
703
|
-
throw aResult;
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
const messages = Messaging.getMessageModel().getData();
|
|
708
|
-
if (strictHandlingUtilities.is412Executed && strictHandlingUtilities.strictHandlingTransitionFails.length) {
|
|
709
|
-
if (!after412) {
|
|
710
|
-
strictHandlingUtilities.delaySuccessMessages = strictHandlingUtilities.delaySuccessMessages.concat(messages);
|
|
711
|
-
} else {
|
|
712
|
-
Messaging.addMessages(strictHandlingUtilities.delaySuccessMessages);
|
|
713
|
-
let showGenericErrorMessageForChangeSet = false;
|
|
714
|
-
if (
|
|
715
|
-
(mParameters.bGrouped && strictHandlingUtilities.strictHandlingPromises.length) ||
|
|
716
|
-
(mParameters.bGrouped && messageHandling.hasTransitionErrorsOrWarnings())
|
|
717
|
-
) {
|
|
718
|
-
showGenericErrorMessageForChangeSet = true;
|
|
719
|
-
}
|
|
720
|
-
if (messages.length) {
|
|
721
|
-
// BOUND TRANSITION AS PART OF SAP_MESSAGE
|
|
722
|
-
oDialog.attachEventOnce("afterClose", function () {
|
|
723
|
-
messageHandler.showMessageDialog({
|
|
724
|
-
onBeforeShowMessage: function (aMessages: Message[], showMessageParametersIn: ShowMessageParameters) {
|
|
725
|
-
return actionParameterShowMessageCallback(
|
|
726
|
-
mParameters,
|
|
727
|
-
aContexts,
|
|
728
|
-
oDialog,
|
|
729
|
-
aMessages,
|
|
730
|
-
showMessageParametersIn,
|
|
731
|
-
showGenericErrorMessageForChangeSet
|
|
732
|
-
);
|
|
733
|
-
},
|
|
734
|
-
control: mParameters.control,
|
|
735
|
-
aSelectedContexts: mParameters.aContexts,
|
|
736
|
-
sActionName: mParameters.label
|
|
737
|
-
});
|
|
738
|
-
});
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
} else if (messages.length) {
|
|
742
|
-
// BOUND TRANSITION AS PART OF SAP_MESSAGE
|
|
743
|
-
let showGenericErrorMessageForChangeSet = false;
|
|
744
|
-
if (
|
|
745
|
-
(mParameters.bGrouped && strictHandlingUtilities.strictHandlingPromises.length) ||
|
|
746
|
-
(mParameters.bGrouped && messageHandling.hasTransitionErrorsOrWarnings())
|
|
747
|
-
) {
|
|
748
|
-
showGenericErrorMessageForChangeSet = true;
|
|
749
|
-
}
|
|
750
|
-
oDialog.attachEventOnce("afterClose", function () {
|
|
751
|
-
messageHandler.showMessageDialog({
|
|
752
|
-
isActionParameterDialogOpen: mParameters?.oDialog?.isOpen(),
|
|
753
|
-
forceShowUIElement: mParameters?.oDialog?.isOpen() ?? false,
|
|
754
|
-
onBeforeShowMessage: function (aMessages: Message[], showMessageParametersIn: ShowMessageParameters) {
|
|
755
|
-
return actionParameterShowMessageCallback(
|
|
756
|
-
mParameters,
|
|
757
|
-
aContexts,
|
|
758
|
-
oDialog,
|
|
759
|
-
aMessages,
|
|
760
|
-
showMessageParametersIn,
|
|
761
|
-
showGenericErrorMessageForChangeSet
|
|
762
|
-
);
|
|
763
|
-
},
|
|
764
|
-
control: mParameters.control,
|
|
765
|
-
aSelectedContexts: mParameters.aContexts,
|
|
766
|
-
sActionName: mParameters.label
|
|
767
|
-
});
|
|
768
|
-
});
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
return aResult;
|
|
772
|
-
}
|
|
773
|
-
|
|
774
708
|
function afterActionResolution(
|
|
775
709
|
mParameters: CallActionParameters,
|
|
776
710
|
mActionExecutionParameters: ShowActionDialogParameters,
|
|
@@ -811,6 +745,54 @@ function afterActionResolution(
|
|
|
811
745
|
}
|
|
812
746
|
}
|
|
813
747
|
|
|
748
|
+
/**
|
|
749
|
+
* Filters an array of messages based on various conditions and returns an object containing the filtered messages and other properties.
|
|
750
|
+
* @param messages The messages to filter.
|
|
751
|
+
* @param errorTargetsInAPD Indicates whether error targets are in APD.
|
|
752
|
+
* @param contexts An array of contexts.
|
|
753
|
+
* @param unboundMessages An array of unbound messages.
|
|
754
|
+
* @param control A control object.
|
|
755
|
+
* @param isAPDOPen Indicates whether APD is open.
|
|
756
|
+
* @param showMessageDialog Indicates whether to show the message dialog.
|
|
757
|
+
* @returns An object containing a boolean indicating whether the result contains a bound transition, an array of messages to show, and a boolean indicating whether to show the message in a dialog.
|
|
758
|
+
*/
|
|
759
|
+
function filterAPDandContextMessages(
|
|
760
|
+
messages: Message[],
|
|
761
|
+
errorTargetsInAPD?: boolean,
|
|
762
|
+
contexts?: Context[],
|
|
763
|
+
unboundMessages?: Message[],
|
|
764
|
+
control?: Control,
|
|
765
|
+
isAPDOPen?: boolean,
|
|
766
|
+
showMessageDialog?: boolean
|
|
767
|
+
): { containsBoundTransistion: boolean | undefined; messagesToShow: Message[]; showMessageInDialog?: boolean } {
|
|
768
|
+
if (isAPDOPen && errorTargetsInAPD) {
|
|
769
|
+
/* When APD is open, we need to remove the messages which are related to the objectpage context */
|
|
770
|
+
messageHandling.removeContextMessagesfromModel(messages, contexts);
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
// Filter out messages which are not related to the action parameter dialog in the edit mode and display mode
|
|
774
|
+
let containsBoundTransistion;
|
|
775
|
+
if (!control?.getModel("ui")!.getProperty("/isEditable")) {
|
|
776
|
+
if (isAPDOPen && errorTargetsInAPD) {
|
|
777
|
+
if (unboundMessages?.length === 0) {
|
|
778
|
+
containsBoundTransistion = false;
|
|
779
|
+
showMessageDialog = false;
|
|
780
|
+
}
|
|
781
|
+
messages = messageHandling.removeMessagesForActionParameterDialog(messages);
|
|
782
|
+
}
|
|
783
|
+
} else {
|
|
784
|
+
if (unboundMessages?.length === 0) {
|
|
785
|
+
containsBoundTransistion = false;
|
|
786
|
+
}
|
|
787
|
+
messages = messageHandling.removeMessagesForActionParameterDialog(messages);
|
|
788
|
+
}
|
|
789
|
+
return {
|
|
790
|
+
messagesToShow: messages,
|
|
791
|
+
containsBoundTransistion: containsBoundTransistion,
|
|
792
|
+
showMessageInDialog: showMessageDialog
|
|
793
|
+
};
|
|
794
|
+
}
|
|
795
|
+
|
|
814
796
|
function actionParameterShowMessageCallback(
|
|
815
797
|
mParameters: ShowActionDialogParameters,
|
|
816
798
|
aContexts: ODataV4Context[],
|
|
@@ -841,10 +823,8 @@ function actionParameterShowMessageCallback(
|
|
|
841
823
|
});
|
|
842
824
|
|
|
843
825
|
const errorTargetsInAPD = APDmessages.length ? true : false;
|
|
844
|
-
let hasChangeSetModifiedMessage = false;
|
|
845
826
|
//If Action is successful with warnings, dont show the generic error message for changeset in dialog
|
|
846
827
|
if (showGenericErrorMessageForChangeSet && !errorTargetsInAPD && !isActionSuccessful) {
|
|
847
|
-
hasChangeSetModifiedMessage = true;
|
|
848
828
|
let sMessage = oResourceBundle.getText("C_COMMON_DIALOG_CANCEL_ERROR_MESSAGES_TEXT");
|
|
849
829
|
let sDescriptionText = oResourceBundle.getText("C_COMMON_DIALOG_CANCEL_ERROR_MESSAGES_DETAIL_TEXT");
|
|
850
830
|
const messageModel = Messaging.getMessageModel();
|
|
@@ -932,40 +912,24 @@ function actionParameterShowMessageCallback(
|
|
|
932
912
|
oDialog.destroy();
|
|
933
913
|
}
|
|
934
914
|
}
|
|
935
|
-
|
|
915
|
+
const filteredMessages: Message[] = [];
|
|
936
916
|
const bIsAPDOpen = oDialog && oDialog.isOpen();
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
} else if (oControl) {
|
|
954
|
-
if (oControl.getModel("ui")!.getProperty("/isEditable") === false) {
|
|
955
|
-
if (bIsAPDOpen && errorTargetsInAPD) {
|
|
956
|
-
showMessageDialog = false;
|
|
957
|
-
}
|
|
958
|
-
} else if (oControl.getModel("ui")!.getProperty("/isEditable") === true) {
|
|
959
|
-
if (!bIsAPDOpen && errorTargetsInAPD) {
|
|
960
|
-
showMessageDialog = true;
|
|
961
|
-
filteredMessages = unboundMessages.concat(APDmessages);
|
|
962
|
-
} else if (!bIsAPDOpen && unboundMessages.length === 0) {
|
|
963
|
-
// error targets in APD => there is atleast one bound message. If there are unbound messages, dialog must be shown.
|
|
964
|
-
// for draft entity, we already closed the APD
|
|
965
|
-
showMessageDialog = false;
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
}
|
|
917
|
+
|
|
918
|
+
const { messagesToShow, containsBoundTransistion, showMessageInDialog } = filterAPDandContextMessages(
|
|
919
|
+
messages,
|
|
920
|
+
errorTargetsInAPD,
|
|
921
|
+
aContexts,
|
|
922
|
+
unboundMessages,
|
|
923
|
+
oControl,
|
|
924
|
+
bIsAPDOpen
|
|
925
|
+
);
|
|
926
|
+
messages = messagesToShow;
|
|
927
|
+
showMessageDialog = showMessageInDialog ?? showMessageDialog;
|
|
928
|
+
|
|
929
|
+
if (!bIsAPDOpen && errorTargetsInAPD && !mParameters.bGrouped) {
|
|
930
|
+
// If APD is not open and there are messages related to APD, then show in the message dialog. since
|
|
931
|
+
showMessageDialog = true;
|
|
932
|
+
messages = messages.concat(APDmessages);
|
|
969
933
|
}
|
|
970
934
|
|
|
971
935
|
let fnGetMessageSubtitle;
|
|
@@ -977,724 +941,11 @@ function actionParameterShowMessageCallback(
|
|
|
977
941
|
showMessageDialog: showMessageDialog,
|
|
978
942
|
filteredMessages: filteredMessages.length ? filteredMessages : messages,
|
|
979
943
|
fnGetMessageSubtitle: fnGetMessageSubtitle,
|
|
980
|
-
showChangeSetErrorDialog: mParameters.bGrouped
|
|
944
|
+
showChangeSetErrorDialog: mParameters.bGrouped,
|
|
945
|
+
containsBoundTransistion: containsBoundTransistion
|
|
981
946
|
};
|
|
982
947
|
}
|
|
983
948
|
|
|
984
|
-
/*
|
|
985
|
-
* Currently, this method is responsible for showing the dialog and executing the action. The promise returned is pending while waiting for user input, as well as while the
|
|
986
|
-
* back-end request is running. The promise is rejected when the user cancels the dialog and also when the back-end request fails.
|
|
987
|
-
* TODO: Refactoring: Separate dialog handling from backend processing. Dialog handling should return a Promise resolving to parameters to be provided to backend. If dialog is
|
|
988
|
-
* cancelled, that promise can be rejected. Method responsible for backend processing need to deal with multiple contexts - i.e. it should either return an array of Promises or
|
|
989
|
-
* a Promise resolving to an array. In the latter case, that Promise should be resolved also when some or even all contexts failed in backend - the overall process still was
|
|
990
|
-
* successful.
|
|
991
|
-
*
|
|
992
|
-
*/
|
|
993
|
-
|
|
994
|
-
async function showActionParameterDialog(
|
|
995
|
-
sActionName: string,
|
|
996
|
-
oAppComponent: AppComponent,
|
|
997
|
-
sActionLabel: string | undefined,
|
|
998
|
-
mParameters: ShowActionDialogParameters,
|
|
999
|
-
aActionParameters: EdmActionParameter[],
|
|
1000
|
-
aParameterValues: Record<string, unknown>[] | undefined,
|
|
1001
|
-
oActionContext: Context,
|
|
1002
|
-
oParentControl: View,
|
|
1003
|
-
entitySetName: string | undefined,
|
|
1004
|
-
messageHandler: MessageHandler,
|
|
1005
|
-
strictHandlingUtilities: StrictHandlingUtilities,
|
|
1006
|
-
view: View | null,
|
|
1007
|
-
ignoreETag?: boolean
|
|
1008
|
-
): Promise<undefined | ODataV4Context | PromiseSettledResult<ODataV4Context | undefined>[]> {
|
|
1009
|
-
const sPath = _getPath(oActionContext, sActionName),
|
|
1010
|
-
metaModel = oActionContext.getModel(),
|
|
1011
|
-
entitySetContext = metaModel.createBindingContext(sPath),
|
|
1012
|
-
sActionNamePath = oActionContext.getObject("$IsBound")
|
|
1013
|
-
? oActionContext.getPath().split("/@$ui5.overload/0")[0]
|
|
1014
|
-
: oActionContext.getPath().split("/0")[0],
|
|
1015
|
-
actionNameContext = metaModel.createBindingContext(sActionNamePath),
|
|
1016
|
-
bIsCreateAction = mParameters.isCreateAction,
|
|
1017
|
-
sFragmentName = "sap/fe/core/controls/ActionParameterDialog";
|
|
1018
|
-
return new Promise<undefined | ODataV4Context | PromiseSettledResult<ODataV4Context | undefined>[]>(async function (resolve, reject) {
|
|
1019
|
-
let actionParameterInfos: ActionParameterInfo[]; // to be filled after fragment (for action parameter dialog) is loaded. Actually only needed during dialog processing, i.e. could be moved into the controller and directly initialized there, but only after moving all handlers (esp. press handler for action button) to controller.
|
|
1020
|
-
|
|
1021
|
-
const _removeMessagesForActionParamter = (parameter?: EdmActionParameter): void => {
|
|
1022
|
-
if (parameter) {
|
|
1023
|
-
const allMessages = Messaging.getMessageModel().getData();
|
|
1024
|
-
const controlId = generate(["APD_", parameter.name]);
|
|
1025
|
-
// also remove messages assigned to inner controls, but avoid removing messages for different paramters (with name being substring of another parameter name)
|
|
1026
|
-
const relevantMessages = allMessages.filter((msg: Message) =>
|
|
1027
|
-
msg.getControlIds().some((id: string) => controlId.split("-").includes(id))
|
|
1028
|
-
);
|
|
1029
|
-
Messaging.removeMessages(relevantMessages);
|
|
1030
|
-
}
|
|
1031
|
-
};
|
|
1032
|
-
|
|
1033
|
-
const oController = {
|
|
1034
|
-
handleChange: async function (oEvent: Event<{ promise: Promise<string> }>): Promise<void> {
|
|
1035
|
-
const field = oEvent.getSource();
|
|
1036
|
-
const actionParameterInfo = actionParameterInfos.find(
|
|
1037
|
-
(actionParameterInfo) => actionParameterInfo.field === field
|
|
1038
|
-
) as ActionParameterInfo;
|
|
1039
|
-
// field value is being changed, thus existing messages related to that field are not valid anymore
|
|
1040
|
-
_removeMessagesForActionParamter(actionParameterInfo.parameter);
|
|
1041
|
-
// adapt info. Promise is resolved to value or rejected with exception containing message
|
|
1042
|
-
actionParameterInfo.validationPromise = oEvent.getParameter("promise");
|
|
1043
|
-
try {
|
|
1044
|
-
actionParameterInfo.value = await actionParameterInfo.validationPromise;
|
|
1045
|
-
actionParameterInfo.hasError = false;
|
|
1046
|
-
} catch (error) {
|
|
1047
|
-
delete actionParameterInfo.value;
|
|
1048
|
-
actionParameterInfo.hasError = true;
|
|
1049
|
-
ActionRuntime._addMessageForActionParameter([
|
|
1050
|
-
{
|
|
1051
|
-
actionParameterInfo: actionParameterInfo,
|
|
1052
|
-
message: (error as { message: string }).message
|
|
1053
|
-
}
|
|
1054
|
-
]);
|
|
1055
|
-
}
|
|
1056
|
-
}
|
|
1057
|
-
};
|
|
1058
|
-
|
|
1059
|
-
const oFragment = XMLTemplateProcessor.loadTemplate(sFragmentName, "fragment");
|
|
1060
|
-
const oParameterModel = new JSONModel({
|
|
1061
|
-
$displayMode: {}
|
|
1062
|
-
});
|
|
1063
|
-
|
|
1064
|
-
try {
|
|
1065
|
-
const createdFragment = await XMLPreprocessor.process(
|
|
1066
|
-
oFragment,
|
|
1067
|
-
{ name: sFragmentName },
|
|
1068
|
-
{
|
|
1069
|
-
bindingContexts: {
|
|
1070
|
-
action: oActionContext,
|
|
1071
|
-
actionName: actionNameContext,
|
|
1072
|
-
entitySet: entitySetContext
|
|
1073
|
-
},
|
|
1074
|
-
models: {
|
|
1075
|
-
action: oActionContext.getModel(),
|
|
1076
|
-
actionName: actionNameContext?.getModel(),
|
|
1077
|
-
entitySet: entitySetContext?.getModel(),
|
|
1078
|
-
metaModel: entitySetContext?.getModel()
|
|
1079
|
-
}
|
|
1080
|
-
}
|
|
1081
|
-
);
|
|
1082
|
-
// TODO: move the dialog into the fragment and move the handlers to the oController
|
|
1083
|
-
const aContexts: ODataV4Context[] = mParameters.aContexts || [];
|
|
1084
|
-
const aFunctionParams: Promise<ODataV4Context>[] = [];
|
|
1085
|
-
|
|
1086
|
-
await CommonUtils.setUserDefaults(oAppComponent, aActionParameters, oParameterModel, true);
|
|
1087
|
-
const oDialogContent = (await Fragment.load({
|
|
1088
|
-
definition: createdFragment as unknown as string,
|
|
1089
|
-
controller: oController
|
|
1090
|
-
})) as Control;
|
|
1091
|
-
|
|
1092
|
-
actionParameterInfos = aActionParameters.map((actionParameter) => {
|
|
1093
|
-
const field = Element.getElementById(generate(["APD_", actionParameter.name])) as Field | MultiValueField;
|
|
1094
|
-
const isMultiValue = field.isA("sap.ui.mdc.MultiValueField");
|
|
1095
|
-
return {
|
|
1096
|
-
parameter: actionParameter,
|
|
1097
|
-
field: field,
|
|
1098
|
-
isMultiValue: isMultiValue,
|
|
1099
|
-
hasError: false
|
|
1100
|
-
};
|
|
1101
|
-
});
|
|
1102
|
-
|
|
1103
|
-
const resourceModel = getResourceModel(oParentControl);
|
|
1104
|
-
let actionResult: {
|
|
1105
|
-
dialogCancelled: boolean;
|
|
1106
|
-
result: undefined | ODataV4Context | PromiseSettledResult<ODataV4Context | undefined>[];
|
|
1107
|
-
} = {
|
|
1108
|
-
dialogCancelled: true, // to be set to false in case of successful action exection
|
|
1109
|
-
result: undefined
|
|
1110
|
-
};
|
|
1111
|
-
|
|
1112
|
-
let buttonLock = false;
|
|
1113
|
-
|
|
1114
|
-
const oDialog = new Dialog(generate(["fe", "APD_", sActionName]), {
|
|
1115
|
-
title: sActionLabel || resourceModel.getText("C_OPERATIONS_ACTION_PARAMETER_DIALOG_TITLE"),
|
|
1116
|
-
content: [oDialogContent],
|
|
1117
|
-
escapeHandler: function (): void {
|
|
1118
|
-
// escape handler is meant to possibly suppress or postpone closing the dialog on escape (by calling "reject" on the provided object, or "resolve" only when
|
|
1119
|
-
// done with all tasks to happen before dialog can be closed). It's not intended to explicetly close the dialog here (that happens automatically when no
|
|
1120
|
-
// escapeHandler is provided or the resolve-callback is called) or for own wrap up tasks (like removing validition messages - this should happen in the
|
|
1121
|
-
// afterClose).
|
|
1122
|
-
// TODO: Move wrap up tasks to afterClose, and remove this method completely. Take care to also adapt end button press handler accordingly.
|
|
1123
|
-
// Currently only still needed to differentiate closing dialog after successful execution (uses resolve) from user cancellation (using reject)
|
|
1124
|
-
oDialog.close();
|
|
1125
|
-
// reject(Constants.CancelActionDialog);
|
|
1126
|
-
},
|
|
1127
|
-
beginButton: new Button(generate(["fe", "APD_", sActionName, "Action", "Ok"]), {
|
|
1128
|
-
text: bIsCreateAction
|
|
1129
|
-
? resourceModel.getText("C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE_BUTTON")
|
|
1130
|
-
: _getActionParameterActionName(resourceModel, sActionLabel, sActionName, entitySetName),
|
|
1131
|
-
type: "Emphasized",
|
|
1132
|
-
press: async function (): Promise<unknown> {
|
|
1133
|
-
try {
|
|
1134
|
-
// prevent multiple press events. The BusyLocker is not fast enough. (BCP: 2370130210)
|
|
1135
|
-
// buttonLock is set once and reset in
|
|
1136
|
-
// - after validation error
|
|
1137
|
-
// - in case of action error message is canceled
|
|
1138
|
-
// - in afterClose event
|
|
1139
|
-
|
|
1140
|
-
if (buttonLock === true) {
|
|
1141
|
-
return;
|
|
1142
|
-
}
|
|
1143
|
-
buttonLock = true;
|
|
1144
|
-
|
|
1145
|
-
if (!(await ActionRuntime.validateProperties(actionParameterInfos, resourceModel))) {
|
|
1146
|
-
buttonLock = false;
|
|
1147
|
-
return;
|
|
1148
|
-
}
|
|
1149
|
-
|
|
1150
|
-
BusyLocker.lock(oDialog);
|
|
1151
|
-
|
|
1152
|
-
let failedContexts: ODataV4Context[] = [];
|
|
1153
|
-
|
|
1154
|
-
try {
|
|
1155
|
-
// TODO: due to using the search and value helps on the action dialog transient messages could appear
|
|
1156
|
-
// we need an UX design for those to show them to the user - for now remove them before continuing
|
|
1157
|
-
messageHandler.removeTransitionMessages();
|
|
1158
|
-
// move parameter values from Dialog (SimpleForm) to mParameters.actionParameters so that they are available in the operation bindings for all contexts
|
|
1159
|
-
let vParameterValue;
|
|
1160
|
-
let allNullParameters = true;
|
|
1161
|
-
const oParameterContext = oOperationBinding && oOperationBinding.getParameterContext();
|
|
1162
|
-
for (const i in aActionParameters) {
|
|
1163
|
-
if (aActionParameters[i].isCollection) {
|
|
1164
|
-
const aMVFContent = (oDialog.getModel("mvfview") as JSONModel).getProperty(
|
|
1165
|
-
`/${aActionParameters[i].name}`
|
|
1166
|
-
),
|
|
1167
|
-
aKeyValues = [];
|
|
1168
|
-
for (const j in aMVFContent) {
|
|
1169
|
-
aKeyValues.push(aMVFContent[j].Key);
|
|
1170
|
-
}
|
|
1171
|
-
vParameterValue = aKeyValues;
|
|
1172
|
-
} else {
|
|
1173
|
-
vParameterValue = oParameterContext?.getProperty(aActionParameters[i].name);
|
|
1174
|
-
}
|
|
1175
|
-
mParameters.defaultParametersValues[aActionParameters[i].name] = vParameterValue;
|
|
1176
|
-
if (vParameterValue !== null && vParameterValue !== undefined) {
|
|
1177
|
-
allNullParameters = false;
|
|
1178
|
-
}
|
|
1179
|
-
vParameterValue = undefined;
|
|
1180
|
-
}
|
|
1181
|
-
if (!allNullParameters) {
|
|
1182
|
-
oAppComponent.getModel("ui").setProperty(UiModelConstants.DocumentModified, true);
|
|
1183
|
-
}
|
|
1184
|
-
// avoid overriding incoming parameters
|
|
1185
|
-
const innerParameters = Object.assign({}, mParameters);
|
|
1186
|
-
innerParameters.label = sActionLabel;
|
|
1187
|
-
try {
|
|
1188
|
-
const aResult = await executeAPMAction(
|
|
1189
|
-
oAppComponent,
|
|
1190
|
-
innerParameters,
|
|
1191
|
-
oParentControl,
|
|
1192
|
-
messageHandler,
|
|
1193
|
-
aContexts,
|
|
1194
|
-
oDialog,
|
|
1195
|
-
false,
|
|
1196
|
-
strictHandlingUtilities,
|
|
1197
|
-
ignoreETag
|
|
1198
|
-
);
|
|
1199
|
-
actionResult = {
|
|
1200
|
-
dialogCancelled: false,
|
|
1201
|
-
result: aResult
|
|
1202
|
-
};
|
|
1203
|
-
oDialog.close();
|
|
1204
|
-
// resolve(aResult);
|
|
1205
|
-
} catch (oError: unknown) {
|
|
1206
|
-
const messages = Messaging.getMessageModel().getData();
|
|
1207
|
-
if (
|
|
1208
|
-
strictHandlingUtilities.is412Executed &&
|
|
1209
|
-
strictHandlingUtilities.strictHandlingTransitionFails.length
|
|
1210
|
-
) {
|
|
1211
|
-
strictHandlingUtilities.delaySuccessMessages =
|
|
1212
|
-
strictHandlingUtilities.delaySuccessMessages.concat(messages);
|
|
1213
|
-
}
|
|
1214
|
-
throw oError;
|
|
1215
|
-
} finally {
|
|
1216
|
-
if (
|
|
1217
|
-
strictHandlingUtilities.is412Executed &&
|
|
1218
|
-
strictHandlingUtilities.strictHandlingTransitionFails.length
|
|
1219
|
-
) {
|
|
1220
|
-
try {
|
|
1221
|
-
failedContexts = strictHandlingUtilities.strictHandlingTransitionFails.map(
|
|
1222
|
-
(fail) => fail.oAction.getContext() as ODataV4Context
|
|
1223
|
-
);
|
|
1224
|
-
innerParameters.aContexts = failedContexts;
|
|
1225
|
-
const aResult = await executeAPMAction(
|
|
1226
|
-
oAppComponent,
|
|
1227
|
-
innerParameters,
|
|
1228
|
-
oParentControl,
|
|
1229
|
-
messageHandler,
|
|
1230
|
-
aContexts,
|
|
1231
|
-
oDialog,
|
|
1232
|
-
true,
|
|
1233
|
-
strictHandlingUtilities,
|
|
1234
|
-
ignoreETag
|
|
1235
|
-
);
|
|
1236
|
-
|
|
1237
|
-
strictHandlingUtilities.strictHandlingTransitionFails = [];
|
|
1238
|
-
actionResult = {
|
|
1239
|
-
dialogCancelled: false,
|
|
1240
|
-
result: aResult
|
|
1241
|
-
};
|
|
1242
|
-
// resolve(aResult);
|
|
1243
|
-
} catch {
|
|
1244
|
-
if (
|
|
1245
|
-
strictHandlingUtilities.is412Executed &&
|
|
1246
|
-
strictHandlingUtilities.strictHandlingTransitionFails.length
|
|
1247
|
-
) {
|
|
1248
|
-
Messaging.addMessages(strictHandlingUtilities.delaySuccessMessages);
|
|
1249
|
-
}
|
|
1250
|
-
let showGenericErrorMessageForChangeSet = false;
|
|
1251
|
-
if (
|
|
1252
|
-
(mParameters.bGrouped && strictHandlingUtilities.strictHandlingPromises.length) ||
|
|
1253
|
-
(mParameters.bGrouped && messageHandling.hasTransitionErrorsOrWarnings())
|
|
1254
|
-
) {
|
|
1255
|
-
showGenericErrorMessageForChangeSet = true;
|
|
1256
|
-
}
|
|
1257
|
-
await messageHandler.showMessageDialog({
|
|
1258
|
-
isActionParameterDialogOpen: oDialog.isOpen(),
|
|
1259
|
-
forceShowUIElement: oDialog.isOpen(),
|
|
1260
|
-
onBeforeShowMessage: function (
|
|
1261
|
-
aMessages: Message[],
|
|
1262
|
-
showMessageParametersIn: ShowMessageParameters
|
|
1263
|
-
) {
|
|
1264
|
-
return actionParameterShowMessageCallback(
|
|
1265
|
-
innerParameters,
|
|
1266
|
-
aContexts,
|
|
1267
|
-
oDialog,
|
|
1268
|
-
aMessages,
|
|
1269
|
-
showMessageParametersIn,
|
|
1270
|
-
showGenericErrorMessageForChangeSet
|
|
1271
|
-
);
|
|
1272
|
-
},
|
|
1273
|
-
aSelectedContexts: undefined, // not used at all
|
|
1274
|
-
sActionName: sActionLabel
|
|
1275
|
-
});
|
|
1276
|
-
}
|
|
1277
|
-
}
|
|
1278
|
-
if (BusyLocker.isLocked(oDialog)) {
|
|
1279
|
-
BusyLocker.unlock(oDialog);
|
|
1280
|
-
}
|
|
1281
|
-
}
|
|
1282
|
-
} catch (oError: unknown) {
|
|
1283
|
-
let showMessageDialog: boolean | undefined = true;
|
|
1284
|
-
let showGenericErrorMessageForChangeSet = false;
|
|
1285
|
-
if (
|
|
1286
|
-
(mParameters.bGrouped && strictHandlingUtilities.strictHandlingPromises.length) ||
|
|
1287
|
-
(mParameters.bGrouped && messageHandling.hasTransitionErrorsOrWarnings())
|
|
1288
|
-
) {
|
|
1289
|
-
showGenericErrorMessageForChangeSet = true;
|
|
1290
|
-
}
|
|
1291
|
-
await messageHandler.showMessages({
|
|
1292
|
-
context: failedContexts[0], // only used in case of failed context to reset in messageHandling showMessagesInUI
|
|
1293
|
-
isActionParameterDialogOpen: oDialog.isOpen(),
|
|
1294
|
-
forceShowUIElement: oDialog.isOpen(),
|
|
1295
|
-
messagePageNavigationCallback: function () {
|
|
1296
|
-
oDialog.close();
|
|
1297
|
-
},
|
|
1298
|
-
onBeforeShowMessage: function (aMessages: Message[], showMessageParametersIn: ShowMessageParameters) {
|
|
1299
|
-
// Why is this implemented as callback? Apparently, all needed information is available beforehand
|
|
1300
|
-
// TODO: refactor accordingly
|
|
1301
|
-
const showMessageParameters = actionParameterShowMessageCallback(
|
|
1302
|
-
mParameters,
|
|
1303
|
-
aContexts,
|
|
1304
|
-
oDialog,
|
|
1305
|
-
aMessages,
|
|
1306
|
-
showMessageParametersIn,
|
|
1307
|
-
showGenericErrorMessageForChangeSet
|
|
1308
|
-
);
|
|
1309
|
-
showMessageDialog = showMessageParameters.showMessageDialog;
|
|
1310
|
-
return showMessageParameters;
|
|
1311
|
-
},
|
|
1312
|
-
aSelectedContexts: undefined, // not used at all!
|
|
1313
|
-
sActionName: sActionLabel,
|
|
1314
|
-
control: mParameters.control
|
|
1315
|
-
});
|
|
1316
|
-
buttonLock = false; //needed if the action fails with an error popup and this one is canceld (Journey: 412WarningHandling)
|
|
1317
|
-
// In case of backend validation error(s?), message shall not be shown in message dialog but next to the field on parameter dialog, which should
|
|
1318
|
-
// stay open in this case => in this case, we must not resolve or reject the promise controlling the parameter dialog.
|
|
1319
|
-
// In all other cases (e.g. other backend errors or user cancellation), the promise controlling the parameter dialog needs to be rejected to allow
|
|
1320
|
-
// callers to react. (Example: If creation in backend after navigation to transient context fails, back navigation needs to be triggered)
|
|
1321
|
-
// TODO: Refactor to separate dialog handling from backend request instead of taking decision based on message handling
|
|
1322
|
-
if (showMessageDialog) {
|
|
1323
|
-
if (oDialog.isOpen()) {
|
|
1324
|
-
// do nothing, do not reject promise here
|
|
1325
|
-
// We do not close the APM dialog if user enters a wrong value in of the fields that results in an error from the backend.
|
|
1326
|
-
// The user can close the message dialog and the APM dialog would still be open on which he could enter a new value and trigger the action again.
|
|
1327
|
-
// Earlier we were rejecting the promise on error here, and the call stack was destroyed as the promise was rejected and returned to EditFlow invoke action.
|
|
1328
|
-
// But since the APM dialog was still open, a new promise was resolved in case the user retried the action and the object was created, but the navigation to object page was not taking place.
|
|
1329
|
-
} else {
|
|
1330
|
-
reject(oError);
|
|
1331
|
-
}
|
|
1332
|
-
}
|
|
1333
|
-
}
|
|
1334
|
-
} finally {
|
|
1335
|
-
messageHandler.clearStrictWarningMessages();
|
|
1336
|
-
strictHandlingUtilities = {
|
|
1337
|
-
is412Executed: false,
|
|
1338
|
-
strictHandlingTransitionFails: [],
|
|
1339
|
-
strictHandlingPromises: [],
|
|
1340
|
-
strictHandlingWarningMessages: [],
|
|
1341
|
-
delaySuccessMessages: [],
|
|
1342
|
-
processedMessageIds: new Set()
|
|
1343
|
-
};
|
|
1344
|
-
if (BusyLocker.isLocked(oDialog)) {
|
|
1345
|
-
BusyLocker.unlock(oDialog);
|
|
1346
|
-
}
|
|
1347
|
-
}
|
|
1348
|
-
}
|
|
1349
|
-
}),
|
|
1350
|
-
endButton: new Button(generate(["fe", "APD_", sActionName, "Action", "Cancel"]), {
|
|
1351
|
-
text: resourceModel.getText("C_COMMON_ACTION_PARAMETER_DIALOG_CANCEL"),
|
|
1352
|
-
press: function (): void {
|
|
1353
|
-
// TODO: cancel button should just close the dialog (similar to using escape). All wrap up tasks should be moved to afterClose.
|
|
1354
|
-
oDialog.close();
|
|
1355
|
-
// reject(Constants.CancelActionDialog);
|
|
1356
|
-
}
|
|
1357
|
-
}),
|
|
1358
|
-
// TODO: beforeOpen is just an event, i.e. not waiting for the Promise to be resolved. Check if tasks of this function need to be done before opening the dialog
|
|
1359
|
-
// - if yes, they need to be moved outside.
|
|
1360
|
-
// Assumption: Sometimes dialog can be seen without any fields for a short time - maybe this is caused by this asynchronity
|
|
1361
|
-
beforeOpen: async function (oEvent: Dialog$BeforeOpenEvent): Promise<void> {
|
|
1362
|
-
// clone event for actionWrapper as oEvent.oSource gets lost during processing of beforeOpen event handler
|
|
1363
|
-
const oCloneEvent = Object.assign({}, oEvent);
|
|
1364
|
-
const hasVisibleParameter = actionParameterInfos.some((info) => info.field.getVisible());
|
|
1365
|
-
messageHandler.removeTransitionMessages();
|
|
1366
|
-
const getDefaultValuesFunction = function (): string {
|
|
1367
|
-
const oMetaModel = (oDialog.getModel() as ODataModel).getMetaModel(),
|
|
1368
|
-
sActionPath = oActionContext.getPath() && oActionContext.getPath().split("/@")[0],
|
|
1369
|
-
sDefaultValuesFunction = oMetaModel.getObject(
|
|
1370
|
-
`${sActionPath}@com.sap.vocabularies.Common.v1.DefaultValuesFunction`
|
|
1371
|
-
);
|
|
1372
|
-
return sDefaultValuesFunction;
|
|
1373
|
-
};
|
|
1374
|
-
const fnSetDefaultsAndOpenDialog = async function (sBindingParameter?: string): Promise<void> {
|
|
1375
|
-
const sBoundFunctionName = getDefaultValuesFunction();
|
|
1376
|
-
const parameterModelData = oParameterModel.getData();
|
|
1377
|
-
const prefillParameter = async function (
|
|
1378
|
-
sParamName: string,
|
|
1379
|
-
vParamDefaultValue?: string | { $Path?: string }
|
|
1380
|
-
): Promise<{ paramName: string; value: unknown; bLatePropertyError?: boolean; bNoPossibleValue?: boolean }> {
|
|
1381
|
-
// Case 1: There is a ParameterDefaultValue annotation
|
|
1382
|
-
if (vParamDefaultValue !== undefined) {
|
|
1383
|
-
if (aContexts.length > 0 && typeof vParamDefaultValue === "object" && vParamDefaultValue.$Path) {
|
|
1384
|
-
try {
|
|
1385
|
-
let vParamValue = await CommonUtils.requestSingletonProperty(
|
|
1386
|
-
vParamDefaultValue.$Path,
|
|
1387
|
-
oOperationBinding.getModel()
|
|
1388
|
-
);
|
|
1389
|
-
if (vParamValue === null) {
|
|
1390
|
-
vParamValue = await oOperationBinding
|
|
1391
|
-
.getParameterContext()
|
|
1392
|
-
.requestProperty(vParamDefaultValue.$Path);
|
|
1393
|
-
}
|
|
1394
|
-
if (aContexts.length > 1) {
|
|
1395
|
-
// For multi select, need to loop over aContexts (as contexts cannot be retrieved via binding parameter of the operation binding)
|
|
1396
|
-
let sPathForContext = vParamDefaultValue.$Path;
|
|
1397
|
-
if (sPathForContext.indexOf(`${sBindingParameter}/`) === 0) {
|
|
1398
|
-
sPathForContext = sPathForContext.replace(`${sBindingParameter}/`, "");
|
|
1399
|
-
}
|
|
1400
|
-
for (let i = 1; i < aContexts.length; i++) {
|
|
1401
|
-
if (aContexts[i].getProperty(sPathForContext) !== vParamValue) {
|
|
1402
|
-
// if the values from the contexts are not all the same, do not prefill
|
|
1403
|
-
return {
|
|
1404
|
-
paramName: sParamName,
|
|
1405
|
-
value: undefined,
|
|
1406
|
-
bNoPossibleValue: true
|
|
1407
|
-
};
|
|
1408
|
-
}
|
|
1409
|
-
}
|
|
1410
|
-
}
|
|
1411
|
-
return { paramName: sParamName, value: vParamValue };
|
|
1412
|
-
} catch (oError) {
|
|
1413
|
-
Log.error("Error while reading default action parameter", sParamName, mParameters.actionName);
|
|
1414
|
-
return {
|
|
1415
|
-
paramName: sParamName,
|
|
1416
|
-
value: undefined,
|
|
1417
|
-
bLatePropertyError: true
|
|
1418
|
-
};
|
|
1419
|
-
}
|
|
1420
|
-
} else {
|
|
1421
|
-
// Case 1.2: ParameterDefaultValue defines a fixed string value (i.e. vParamDefaultValue = 'someString')
|
|
1422
|
-
return { paramName: sParamName, value: vParamDefaultValue };
|
|
1423
|
-
}
|
|
1424
|
-
} else if (parameterModelData.hasOwnProperty(sParamName)) {
|
|
1425
|
-
// Case 2: There is no ParameterDefaultValue annotation (=> look into the FLP User Defaults)
|
|
1426
|
-
|
|
1427
|
-
return {
|
|
1428
|
-
paramName: sParamName,
|
|
1429
|
-
value: parameterModelData[sParamName]
|
|
1430
|
-
};
|
|
1431
|
-
} else {
|
|
1432
|
-
return { paramName: sParamName, value: undefined };
|
|
1433
|
-
}
|
|
1434
|
-
};
|
|
1435
|
-
|
|
1436
|
-
const getParameterDefaultValue = function (sParamName: string): string | { $Path: string } {
|
|
1437
|
-
const oMetaModel = (oDialog.getModel() as ODataModel).getMetaModel(),
|
|
1438
|
-
sActionParameterAnnotationPath = CommonUtils.getParameterPath(oActionContext.getPath(), sParamName) + "@",
|
|
1439
|
-
oParameterAnnotations = oMetaModel.getObject(sActionParameterAnnotationPath),
|
|
1440
|
-
oParameterDefaultValue =
|
|
1441
|
-
oParameterAnnotations && oParameterAnnotations["@com.sap.vocabularies.UI.v1.ParameterDefaultValue"]; // either { $Path: 'somePath' } or 'someString'
|
|
1442
|
-
return oParameterDefaultValue as string | { $Path: string };
|
|
1443
|
-
};
|
|
1444
|
-
|
|
1445
|
-
const aCurrentParamDefaultValue = [];
|
|
1446
|
-
let sParamName, vParameterDefaultValue;
|
|
1447
|
-
for (const i in aActionParameters) {
|
|
1448
|
-
sParamName = aActionParameters[i].name;
|
|
1449
|
-
vParameterDefaultValue = getParameterDefaultValue(sParamName);
|
|
1450
|
-
aCurrentParamDefaultValue.push(prefillParameter(sParamName, vParameterDefaultValue));
|
|
1451
|
-
}
|
|
1452
|
-
|
|
1453
|
-
if (oActionContext.getObject("$IsBound") && aContexts.length > 0) {
|
|
1454
|
-
if (sBoundFunctionName && sBoundFunctionName.length > 0 && typeof sBoundFunctionName === "string") {
|
|
1455
|
-
for (const i in aContexts) {
|
|
1456
|
-
aFunctionParams.push(operations.callBoundFunction(sBoundFunctionName, aContexts[i], mParameters.model));
|
|
1457
|
-
}
|
|
1458
|
-
}
|
|
1459
|
-
}
|
|
1460
|
-
|
|
1461
|
-
const aPrefillParamPromises = Promise.all(aCurrentParamDefaultValue);
|
|
1462
|
-
let aExecFunctionPromises: Promise<ODataV4Context[]> = Promise.resolve([]);
|
|
1463
|
-
let oExecFunctionFromManifestPromise;
|
|
1464
|
-
if (aFunctionParams && aFunctionParams.length > 0) {
|
|
1465
|
-
aExecFunctionPromises = Promise.all(aFunctionParams);
|
|
1466
|
-
}
|
|
1467
|
-
if (mParameters.defaultValuesExtensionFunction) {
|
|
1468
|
-
const sModule = mParameters.defaultValuesExtensionFunction
|
|
1469
|
-
.substring(0, mParameters.defaultValuesExtensionFunction.lastIndexOf(".") || -1)
|
|
1470
|
-
.replace(/\./gi, "/"),
|
|
1471
|
-
sFunctionName = mParameters.defaultValuesExtensionFunction.substring(
|
|
1472
|
-
mParameters.defaultValuesExtensionFunction.lastIndexOf(".") + 1,
|
|
1473
|
-
mParameters.defaultValuesExtensionFunction.length
|
|
1474
|
-
);
|
|
1475
|
-
oExecFunctionFromManifestPromise = FPMHelper.actionWrapper(oCloneEvent, sModule, sFunctionName, {
|
|
1476
|
-
contexts: aContexts
|
|
1477
|
-
});
|
|
1478
|
-
}
|
|
1479
|
-
|
|
1480
|
-
try {
|
|
1481
|
-
const aPromises = await Promise.all([
|
|
1482
|
-
aPrefillParamPromises,
|
|
1483
|
-
aExecFunctionPromises,
|
|
1484
|
-
oExecFunctionFromManifestPromise
|
|
1485
|
-
]);
|
|
1486
|
-
const currentParamDefaultValue = aPromises[0];
|
|
1487
|
-
const functionParams = aPromises[1];
|
|
1488
|
-
const oFunctionParamsFromManifest: Record<string, unknown> = aPromises[2] as Record<string, unknown>;
|
|
1489
|
-
let sDialogParamName: string;
|
|
1490
|
-
|
|
1491
|
-
// Fill the dialog with the earlier determined parameter values from the different sources
|
|
1492
|
-
for (const i in aActionParameters) {
|
|
1493
|
-
if (aActionParameters[i].name !== "ResultIsActiveEntity") {
|
|
1494
|
-
sDialogParamName = aActionParameters[i].name;
|
|
1495
|
-
// Parameter values provided in the call of invokeAction overrule other sources
|
|
1496
|
-
const vParameterProvidedValue = aParameterValues?.find(
|
|
1497
|
-
(element) => element.name === aActionParameters[i].name
|
|
1498
|
-
)?.value;
|
|
1499
|
-
if (vParameterProvidedValue) {
|
|
1500
|
-
oOperationBinding.setParameter(aActionParameters[i].name, vParameterProvidedValue);
|
|
1501
|
-
} else if (
|
|
1502
|
-
oFunctionParamsFromManifest &&
|
|
1503
|
-
oFunctionParamsFromManifest.hasOwnProperty(sDialogParamName)
|
|
1504
|
-
) {
|
|
1505
|
-
oOperationBinding.setParameter(
|
|
1506
|
-
aActionParameters[i].name,
|
|
1507
|
-
oFunctionParamsFromManifest[sDialogParamName]
|
|
1508
|
-
);
|
|
1509
|
-
} else if (currentParamDefaultValue[i] && currentParamDefaultValue[i].value !== undefined) {
|
|
1510
|
-
oOperationBinding.setParameter(aActionParameters[i].name, currentParamDefaultValue[i].value);
|
|
1511
|
-
// if the default value had not been previously determined due to different contexts, we do nothing else
|
|
1512
|
-
} else if (sBoundFunctionName && !currentParamDefaultValue[i].bNoPossibleValue) {
|
|
1513
|
-
if (aContexts.length > 1) {
|
|
1514
|
-
// we check if the function retrieves the same param value for all the contexts:
|
|
1515
|
-
let j = 0;
|
|
1516
|
-
while (j < aContexts.length - 1) {
|
|
1517
|
-
if (
|
|
1518
|
-
functionParams[j] &&
|
|
1519
|
-
functionParams[j + 1] &&
|
|
1520
|
-
functionParams[j].getObject(sDialogParamName) ===
|
|
1521
|
-
functionParams[j + 1].getObject(sDialogParamName)
|
|
1522
|
-
) {
|
|
1523
|
-
j++;
|
|
1524
|
-
} else {
|
|
1525
|
-
break;
|
|
1526
|
-
}
|
|
1527
|
-
}
|
|
1528
|
-
//param values are all the same:
|
|
1529
|
-
if (j === aContexts.length - 1 && functionParams[j].getObject(sDialogParamName) !== undefined) {
|
|
1530
|
-
oOperationBinding.setParameter(
|
|
1531
|
-
aActionParameters[i].name,
|
|
1532
|
-
functionParams[j].getObject(sDialogParamName)
|
|
1533
|
-
);
|
|
1534
|
-
}
|
|
1535
|
-
} else if (functionParams[0] && functionParams[0].getObject(sDialogParamName) !== undefined) {
|
|
1536
|
-
//Only one context, then the default param values are to be verified from the function:
|
|
1537
|
-
|
|
1538
|
-
oOperationBinding.setParameter(
|
|
1539
|
-
aActionParameters[i].name,
|
|
1540
|
-
functionParams[0].getObject(sDialogParamName)
|
|
1541
|
-
);
|
|
1542
|
-
}
|
|
1543
|
-
}
|
|
1544
|
-
}
|
|
1545
|
-
}
|
|
1546
|
-
const bErrorFound = currentParamDefaultValue.some(function (oValue) {
|
|
1547
|
-
if (oValue.bLatePropertyError) {
|
|
1548
|
-
return oValue.bLatePropertyError;
|
|
1549
|
-
}
|
|
1550
|
-
});
|
|
1551
|
-
|
|
1552
|
-
const refresh = resourceModel.getText("C_COMMON_SAPFE_REFRESH");
|
|
1553
|
-
const close = function (action: string): void {
|
|
1554
|
-
if (action === refresh) {
|
|
1555
|
-
const extensionAPI = (view as FEView)?.getController().getExtensionAPI();
|
|
1556
|
-
(extensionAPI as ListReportExtensionAPI | ObjectPageExtensionAPI).refresh();
|
|
1557
|
-
}
|
|
1558
|
-
};
|
|
1559
|
-
|
|
1560
|
-
// If at least one Default Property is a Late Property and an eTag error was raised.
|
|
1561
|
-
if (bErrorFound) {
|
|
1562
|
-
const sText = resourceModel.getText("C_APP_COMPONENT_SAPFE_ETAG_LATE_PROPERTY");
|
|
1563
|
-
MessageBox.warning(sText, {
|
|
1564
|
-
actions: [refresh, MessageBox.Action.OK],
|
|
1565
|
-
emphasizedAction: refresh,
|
|
1566
|
-
onClose: function (action: string) {
|
|
1567
|
-
close(action);
|
|
1568
|
-
},
|
|
1569
|
-
contentWidth: "25em"
|
|
1570
|
-
} as object);
|
|
1571
|
-
} else if (!hasVisibleParameter) {
|
|
1572
|
-
// We execute the action if all parameters are hidden, otherwise all mandatory parameters without values are shown in the dialog
|
|
1573
|
-
const beginButton = oDialog.getBeginButton();
|
|
1574
|
-
beginButton.firePress();
|
|
1575
|
-
}
|
|
1576
|
-
} catch (oError: unknown) {
|
|
1577
|
-
Log.error("Error while retrieving the parameter", oError as string);
|
|
1578
|
-
// Remove messages relating to the function for default values as they aren't helpful for a user
|
|
1579
|
-
messageHandler.removeTransitionMessages();
|
|
1580
|
-
}
|
|
1581
|
-
};
|
|
1582
|
-
const fnAsyncBeforeOpen = async function (): Promise<void> {
|
|
1583
|
-
if (oActionContext.getObject("$IsBound") && aContexts.length > 0) {
|
|
1584
|
-
const aParameters = oActionContext.getObject("$Parameter");
|
|
1585
|
-
const sBindingParameter = aParameters[0] && aParameters[0].$Name;
|
|
1586
|
-
|
|
1587
|
-
try {
|
|
1588
|
-
const oContextObject = await aContexts[0].requestObject();
|
|
1589
|
-
if (oContextObject) {
|
|
1590
|
-
oOperationBinding.setParameter(sBindingParameter, oContextObject);
|
|
1591
|
-
}
|
|
1592
|
-
await fnSetDefaultsAndOpenDialog(sBindingParameter);
|
|
1593
|
-
} catch (oError: unknown) {
|
|
1594
|
-
Log.error("Error while retrieving the parameter", oError as string);
|
|
1595
|
-
}
|
|
1596
|
-
} else {
|
|
1597
|
-
await fnSetDefaultsAndOpenDialog();
|
|
1598
|
-
}
|
|
1599
|
-
};
|
|
1600
|
-
|
|
1601
|
-
await fnAsyncBeforeOpen();
|
|
1602
|
-
|
|
1603
|
-
// adding defaulted values only here after they are not set to the fields
|
|
1604
|
-
for (const actionParameterInfo of actionParameterInfos) {
|
|
1605
|
-
const value = actionParameterInfo.isMultiValue
|
|
1606
|
-
? (actionParameterInfo.field as MultiValueField).getItems()
|
|
1607
|
-
: (actionParameterInfo.field as Field).getValue();
|
|
1608
|
-
actionParameterInfo.value = value;
|
|
1609
|
-
actionParameterInfo.validationPromise = Promise.resolve(value);
|
|
1610
|
-
}
|
|
1611
|
-
},
|
|
1612
|
-
afterClose: function (): void {
|
|
1613
|
-
// when the dialog is cancelled, messages need to be removed in case the same action should be executed again
|
|
1614
|
-
aActionParameters.forEach(_removeMessagesForActionParamter);
|
|
1615
|
-
oDialog.destroy();
|
|
1616
|
-
buttonLock = false; //needed here, not in the press events finally clause. In case the UI is sluggish, begin button could be pressed again.
|
|
1617
|
-
if (actionResult.dialogCancelled) {
|
|
1618
|
-
reject(Constants.CancelActionDialog);
|
|
1619
|
-
} else {
|
|
1620
|
-
resolve(actionResult.result);
|
|
1621
|
-
}
|
|
1622
|
-
}
|
|
1623
|
-
});
|
|
1624
|
-
mParameters.oDialog = oDialog;
|
|
1625
|
-
oDialog.setModel(mParameters.model);
|
|
1626
|
-
oDialog.setModel(oParameterModel, "paramsModel");
|
|
1627
|
-
oDialog.bindElement({
|
|
1628
|
-
path: "/",
|
|
1629
|
-
model: "paramsModel"
|
|
1630
|
-
});
|
|
1631
|
-
|
|
1632
|
-
// empty model to add elements dynamically depending on number of MVF fields defined on the dialog
|
|
1633
|
-
const oMVFModel = new JSONModel({});
|
|
1634
|
-
oDialog.setModel(oMVFModel, "mvfview");
|
|
1635
|
-
|
|
1636
|
-
/* Event needed for removing messages of valid changed field */
|
|
1637
|
-
for (const actionParameterInfo of actionParameterInfos) {
|
|
1638
|
-
if (actionParameterInfo.isMultiValue) {
|
|
1639
|
-
actionParameterInfo?.field?.getBinding("items")?.attachChange(() => {
|
|
1640
|
-
_removeMessagesForActionParamter(actionParameterInfo.parameter);
|
|
1641
|
-
});
|
|
1642
|
-
} else {
|
|
1643
|
-
actionParameterInfo?.field?.getBinding("value")?.attachChange(() => {
|
|
1644
|
-
_removeMessagesForActionParamter(actionParameterInfo.parameter);
|
|
1645
|
-
});
|
|
1646
|
-
}
|
|
1647
|
-
}
|
|
1648
|
-
|
|
1649
|
-
let sActionPath = `${sActionName}(...)`;
|
|
1650
|
-
if (!aContexts.length) {
|
|
1651
|
-
sActionPath = `/${sActionPath}`;
|
|
1652
|
-
}
|
|
1653
|
-
oDialog.bindElement({
|
|
1654
|
-
path: sActionPath
|
|
1655
|
-
});
|
|
1656
|
-
if (oParentControl) {
|
|
1657
|
-
// if there is a parent control specified add the dialog as dependent
|
|
1658
|
-
oParentControl.addDependent(oDialog);
|
|
1659
|
-
}
|
|
1660
|
-
if (aContexts.length > 0) {
|
|
1661
|
-
oDialog.setBindingContext(aContexts[0]); // use context of first selected line item
|
|
1662
|
-
}
|
|
1663
|
-
const oOperationBinding = oDialog.getObjectBinding() as ODataContextBinding;
|
|
1664
|
-
oDialog.open();
|
|
1665
|
-
} catch (oError: unknown) {
|
|
1666
|
-
reject(oError);
|
|
1667
|
-
}
|
|
1668
|
-
});
|
|
1669
|
-
}
|
|
1670
|
-
|
|
1671
|
-
function _getActionParameterActionName(
|
|
1672
|
-
resourceModel: ResourceModel,
|
|
1673
|
-
sActionLabel: string | undefined,
|
|
1674
|
-
sActionName: string,
|
|
1675
|
-
sEntitySetName: string | undefined
|
|
1676
|
-
): string {
|
|
1677
|
-
let boundActionName: string = sActionName;
|
|
1678
|
-
const aActionName = boundActionName.split(".");
|
|
1679
|
-
boundActionName = boundActionName.includes(".") ? aActionName[aActionName.length - 1] : boundActionName;
|
|
1680
|
-
const suffixResourceKey = boundActionName && sEntitySetName ? `${sEntitySetName}|${boundActionName}` : "";
|
|
1681
|
-
const sKey = "ACTION_PARAMETER_DIALOG_ACTION_NAME";
|
|
1682
|
-
const bResourceKeyExists = resourceModel.checkIfResourceKeyExists(`${sKey}|${suffixResourceKey}`);
|
|
1683
|
-
if (sActionLabel) {
|
|
1684
|
-
if (bResourceKeyExists) {
|
|
1685
|
-
return resourceModel.getText(sKey, undefined, suffixResourceKey);
|
|
1686
|
-
} else if (resourceModel.checkIfResourceKeyExists(`${sKey}|${sEntitySetName}`)) {
|
|
1687
|
-
return resourceModel.getText(sKey, undefined, `${sEntitySetName}`);
|
|
1688
|
-
} else if (resourceModel.checkIfResourceKeyExists(`${sKey}`)) {
|
|
1689
|
-
return resourceModel.getText(sKey);
|
|
1690
|
-
} else {
|
|
1691
|
-
return sActionLabel;
|
|
1692
|
-
}
|
|
1693
|
-
} else {
|
|
1694
|
-
return resourceModel.getText("C_COMMON_DIALOG_OK");
|
|
1695
|
-
}
|
|
1696
|
-
}
|
|
1697
|
-
|
|
1698
949
|
async function executeDependingOnSelectedContexts(
|
|
1699
950
|
oAction: ODataContextBinding,
|
|
1700
951
|
mParameters: ShowActionDialogParameters,
|
|
@@ -1773,7 +1024,6 @@ async function executeDependingOnSelectedContexts(
|
|
|
1773
1024
|
}
|
|
1774
1025
|
/**
|
|
1775
1026
|
* Updates the strictHandling utilities with the failed and successful transition messages.
|
|
1776
|
-
*
|
|
1777
1027
|
* @param action Action executed
|
|
1778
1028
|
* @param groupId GroupId of the batch
|
|
1779
1029
|
* @param strictHandlingUtilities Utility flags and messages for strictHandling
|
|
@@ -1835,7 +1085,7 @@ function createinternalOperationsPromiseForActionExecution(): {
|
|
|
1835
1085
|
async function _executeAction(
|
|
1836
1086
|
oAppComponent: AppComponent,
|
|
1837
1087
|
mParameters: ShowActionDialogParameters,
|
|
1838
|
-
oParentControl:
|
|
1088
|
+
oParentControl: Control,
|
|
1839
1089
|
messageHandler: MessageHandler,
|
|
1840
1090
|
strictHandlingUtilities: StrictHandlingUtilities,
|
|
1841
1091
|
ignoreETag?: boolean
|
|
@@ -1994,7 +1244,10 @@ async function _executeAction(
|
|
|
1994
1244
|
await Promise.allSettled(aChangeSetLocalPromises);
|
|
1995
1245
|
if (strictHandlingUtilities.strictHandlingPromises.length) {
|
|
1996
1246
|
try {
|
|
1997
|
-
if (
|
|
1247
|
+
if (
|
|
1248
|
+
!messageHandling.hasTransitionErrorsOrWarnings() &&
|
|
1249
|
+
strictHandlingUtilities.strictHandlingWarningMessages.length
|
|
1250
|
+
) {
|
|
1998
1251
|
await operationsHelper.renderMessageView(
|
|
1999
1252
|
mParameters,
|
|
2000
1253
|
resourceModel,
|
|
@@ -2055,14 +1308,20 @@ async function _executeAction(
|
|
|
2055
1308
|
}, Promise.resolve());
|
|
2056
1309
|
|
|
2057
1310
|
if (strictHandlingUtilities.strictHandlingPromises.length) {
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
1311
|
+
if (strictHandlingUtilities.strictHandlingWarningMessages.length) {
|
|
1312
|
+
await operationsHelper.renderMessageView(
|
|
1313
|
+
mParameters,
|
|
1314
|
+
resourceModel,
|
|
1315
|
+
messageHandler,
|
|
1316
|
+
strictHandlingUtilities.strictHandlingWarningMessages,
|
|
1317
|
+
strictHandlingUtilities,
|
|
1318
|
+
aContexts.length > 1
|
|
1319
|
+
);
|
|
1320
|
+
} else {
|
|
1321
|
+
strictHandlingUtilities.strictHandlingPromises.forEach(function (shPromise) {
|
|
1322
|
+
shPromise.resolve(false);
|
|
1323
|
+
});
|
|
1324
|
+
}
|
|
2066
1325
|
}
|
|
2067
1326
|
fnHandleResults();
|
|
2068
1327
|
}
|
|
@@ -2151,11 +1410,6 @@ async function _executeAction(
|
|
|
2151
1410
|
});
|
|
2152
1411
|
}
|
|
2153
1412
|
}
|
|
2154
|
-
function _getPath(oActionContext: Context, sActionName: string): string {
|
|
2155
|
-
let sPath = oActionContext.getPath();
|
|
2156
|
-
sPath = oActionContext.getObject("$IsBound") ? sPath.split("@$ui5.overload")[0] : sPath.split("/0")[0];
|
|
2157
|
-
return sPath.split(`/${sActionName}`)[0];
|
|
2158
|
-
}
|
|
2159
1413
|
|
|
2160
1414
|
function _valuesProvidedForAllMandatoryParameters(
|
|
2161
1415
|
isCreateAction: boolean,
|
|
@@ -2249,7 +1503,6 @@ async function fnRequestSideEffects(
|
|
|
2249
1503
|
|
|
2250
1504
|
/**
|
|
2251
1505
|
* Static functions to call OData actions (bound/import) and functions (bound/import)
|
|
2252
|
-
*
|
|
2253
1506
|
* @namespace
|
|
2254
1507
|
* @experimental This module is only for experimental use! <br/><b>This is only a POC and maybe deleted</b>
|
|
2255
1508
|
* @since 1.56.0
|
|
@@ -2262,10 +1515,10 @@ const operations = {
|
|
|
2262
1515
|
executeDependingOnSelectedContexts: executeDependingOnSelectedContexts,
|
|
2263
1516
|
createinternalOperationsPromiseForActionExecution: createinternalOperationsPromiseForActionExecution,
|
|
2264
1517
|
valuesProvidedForAllMandatoryParameters: _valuesProvidedForAllMandatoryParameters,
|
|
2265
|
-
getActionParameterActionName: _getActionParameterActionName,
|
|
2266
1518
|
actionParameterShowMessageCallback: actionParameterShowMessageCallback,
|
|
2267
1519
|
afterActionResolution: afterActionResolution,
|
|
2268
|
-
fnRequestSideEffects: fnRequestSideEffects
|
|
1520
|
+
fnRequestSideEffects: fnRequestSideEffects,
|
|
1521
|
+
checkParameterTypeAndReturnConvertedValue: checkParameterTypeAndReturnConvertedValue
|
|
2269
1522
|
};
|
|
2270
1523
|
|
|
2271
1524
|
export default operations;
|