@sapui5/sap.fe.core 1.102.2 → 1.104.1
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 +6 -6
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AppComponent.js +73 -30
- package/src/sap/fe/core/AppComponent.ts +65 -43
- package/src/sap/fe/core/AppStateHandler.js +82 -70
- package/src/sap/fe/core/AppStateHandler.ts +32 -37
- package/src/sap/fe/core/BaseController.js +11 -9
- package/src/sap/fe/core/BaseController.ts +15 -13
- package/src/sap/fe/core/CommonUtils.js +227 -126
- package/src/sap/fe/core/CommonUtils.ts +240 -163
- package/src/sap/fe/core/ExtensionAPI.js +24 -27
- package/src/sap/fe/core/ExtensionAPI.ts +36 -38
- package/src/sap/fe/core/PageController.js +4 -4
- package/src/sap/fe/core/PageController.ts +4 -5
- package/src/sap/fe/core/TemplateComponent.js +1 -1
- package/src/sap/fe/core/TemplateComponent.ts +6 -6
- package/src/sap/fe/core/TemplateModel.js +1 -1
- package/src/sap/fe/core/TemplateModel.ts +1 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel.js +1 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +1 -1
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +181 -43
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +150 -24
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +585 -210
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +246 -96
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +30 -30
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +32 -29
- package/src/sap/fe/core/controllerextensions/EditFlow.js +379 -330
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +253 -245
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +9 -9
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +10 -10
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +101 -74
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +69 -79
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +67 -67
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +76 -76
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +85 -77
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +103 -99
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +66 -68
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +106 -123
- package/src/sap/fe/core/controllerextensions/MassEdit.js +9 -9
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +20 -27
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +20 -12
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +21 -14
- package/src/sap/fe/core/controllerextensions/PageReady.js +97 -25
- package/src/sap/fe/core/controllerextensions/PageReady.ts +98 -34
- package/src/sap/fe/core/controllerextensions/Paginator.js +21 -22
- package/src/sap/fe/core/controllerextensions/Paginator.ts +24 -25
- package/src/sap/fe/core/controllerextensions/Placeholder.js +4 -6
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
- package/src/sap/fe/core/controllerextensions/Routing.js +10 -11
- package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
- package/src/sap/fe/core/controllerextensions/Share.js +170 -139
- package/src/sap/fe/core/controllerextensions/Share.ts +117 -118
- package/src/sap/fe/core/controllerextensions/SideEffects.js +46 -50
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +56 -60
- package/src/sap/fe/core/controllerextensions/ViewState.js +200 -131
- package/src/sap/fe/core/controllerextensions/ViewState.ts +141 -148
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +5 -5
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +8 -7
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +11 -10
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.ts +17 -20
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +2 -2
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +4 -4
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +7 -9
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.ts +18 -19
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +190 -141
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +258 -210
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +183 -125
- package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +213 -156
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js +164 -140
- package/src/sap/fe/core/controllerextensions/editFlow/operations.ts +180 -150
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +24 -26
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +35 -33
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +71 -41
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +102 -82
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +61 -71
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +56 -64
- package/src/sap/fe/core/controls/Any.js +9 -5
- package/src/sap/fe/core/controls/Any.ts +10 -4
- package/src/sap/fe/core/controls/CommandExecution.js +11 -25
- package/src/sap/fe/core/controls/CommandExecution.ts +11 -25
- package/src/sap/fe/core/controls/ConditionalWrapper.js +2 -2
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +3 -3
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +22 -22
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +25 -24
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +2 -2
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +2 -2
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +3 -3
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +5 -5
- package/src/sap/fe/core/controls/FieldWrapper.js +2 -2
- package/src/sap/fe/core/controls/FieldWrapper.ts +3 -3
- package/src/sap/fe/core/controls/FileWrapper.js +7 -2
- package/src/sap/fe/core/controls/FileWrapper.ts +15 -11
- package/src/sap/fe/core/controls/FilterBar.js +6 -2
- package/src/sap/fe/core/controls/FilterBar.ts +13 -9
- package/src/sap/fe/core/controls/FormElementWrapper.js +1 -1
- package/src/sap/fe/core/controls/FormElementWrapper.ts +2 -2
- package/src/sap/fe/core/controls/MassEditSelect.js +1 -1
- package/src/sap/fe/core/controls/MassEditSelect.ts +0 -4
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +3 -3
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +16 -12
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +20 -22
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -3
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +8 -8
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +49 -49
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +54 -54
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +8 -2
- package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +22 -35
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +89 -88
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +107 -106
- package/src/sap/fe/core/converters/ConverterContext.js +26 -33
- package/src/sap/fe/core/converters/ConverterContext.ts +52 -61
- package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +17 -15
- package/src/sap/fe/core/converters/ManifestWrapper.js +59 -45
- package/src/sap/fe/core/converters/ManifestWrapper.ts +55 -45
- package/src/sap/fe/core/converters/MetaModelConverter.js +64 -35
- package/src/sap/fe/core/converters/MetaModelConverter.ts +154 -129
- package/src/sap/fe/core/converters/TemplateConverter.js +21 -20
- package/src/sap/fe/core/converters/TemplateConverter.ts +27 -24
- package/src/sap/fe/core/converters/annotations/DataField.js +58 -35
- package/src/sap/fe/core/converters/annotations/DataField.ts +102 -76
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +1911 -1495
- package/src/sap/fe/core/converters/controls/Common/Action.js +50 -41
- package/src/sap/fe/core/converters/controls/Common/Action.ts +56 -46
- package/src/sap/fe/core/converters/controls/Common/Chart.js +14 -14
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +26 -33
- package/src/sap/fe/core/converters/controls/Common/Criticality.js +3 -3
- package/src/sap/fe/core/converters/controls/Common/Criticality.ts +4 -4
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +30 -28
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +60 -61
- package/src/sap/fe/core/converters/controls/Common/Form.js +27 -28
- package/src/sap/fe/core/converters/controls/Common/Form.ts +44 -57
- package/src/sap/fe/core/converters/controls/Common/KPI.js +11 -11
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +49 -52
- package/src/sap/fe/core/converters/controls/Common/Table.js +181 -197
- package/src/sap/fe/core/converters/controls/Common/Table.ts +251 -280
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +119 -119
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +144 -141
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +45 -41
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +65 -59
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +28 -26
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +46 -43
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.js +9 -9
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.ts +14 -13
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +67 -64
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +69 -66
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +77 -73
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +101 -97
- package/src/sap/fe/core/converters/helpers/Aggregation.js +2 -4
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +12 -15
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +31 -31
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +30 -29
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +4 -4
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +9 -9
- package/src/sap/fe/core/converters/helpers/ID.js +48 -46
- package/src/sap/fe/core/converters/helpers/ID.ts +26 -25
- package/src/sap/fe/core/converters/helpers/Key.js +7 -7
- package/src/sap/fe/core/converters/helpers/Key.ts +7 -7
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.js +1 -1
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.ts +4 -5
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +6 -6
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +10 -10
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +46 -62
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +54 -82
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +55 -42
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +81 -66
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +39 -38
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +52 -61
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +4 -4
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +4 -4
- package/src/sap/fe/core/formatters/CollaborationFormatter.js +2 -2
- package/src/sap/fe/core/formatters/CollaborationFormatter.ts +3 -3
- package/src/sap/fe/core/formatters/FPMFormatter.js +5 -5
- package/src/sap/fe/core/formatters/FPMFormatter.ts +10 -10
- package/src/sap/fe/core/formatters/KPIFormatter.js +7 -7
- package/src/sap/fe/core/formatters/KPIFormatter.ts +10 -10
- package/src/sap/fe/core/formatters/StandardFormatter.js +96 -0
- package/src/sap/fe/core/formatters/StandardFormatter.ts +70 -0
- package/src/sap/fe/core/formatters/TableFormatter.js +11 -11
- package/src/sap/fe/core/formatters/TableFormatter.ts +12 -12
- package/src/sap/fe/core/formatters/ValueFormatter.js +8 -8
- package/src/sap/fe/core/formatters/ValueFormatter.ts +9 -9
- package/src/sap/fe/core/helpers/AppStartupHelper.js +15 -15
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +37 -40
- package/src/sap/fe/core/helpers/BindingToolkit.js +1832 -0
- package/src/sap/fe/core/helpers/{BindingExpression.ts → BindingToolkit.ts} +396 -269
- package/src/sap/fe/core/helpers/ClassSupport.js +49 -12
- package/src/sap/fe/core/helpers/ClassSupport.ts +37 -10
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +2 -2
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +1 -1
- package/src/sap/fe/core/helpers/EditState.js +1 -6
- package/src/sap/fe/core/helpers/EditState.ts +5 -10
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +2 -2
- package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +4 -4
- package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
- package/src/sap/fe/core/helpers/FPMHelper.ts +2 -2
- package/src/sap/fe/core/helpers/KeepAliveHelper.js +31 -31
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +52 -56
- package/src/sap/fe/core/helpers/MassEditHelper.js +306 -280
- package/src/sap/fe/core/helpers/MassEditHelper.ts +380 -360
- package/src/sap/fe/core/helpers/MessageStrip.js +81 -0
- package/src/sap/fe/core/helpers/MessageStrip.ts +79 -0
- package/src/sap/fe/core/helpers/ModelHelper.js +25 -25
- package/src/sap/fe/core/helpers/ModelHelper.ts +34 -32
- package/src/sap/fe/core/helpers/PasteHelper.js +3 -10
- package/src/sap/fe/core/helpers/PasteHelper.ts +20 -25
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +1 -1
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +11 -11
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +3 -3
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +8 -8
- package/src/sap/fe/core/helpers/StableIdHelper.js +12 -12
- package/src/sap/fe/core/helpers/StableIdHelper.ts +12 -12
- package/src/sap/fe/core/helpers/ToES6Promise.js +32 -0
- package/src/sap/fe/core/helpers/ToES6Promise.ts +19 -0
- package/src/sap/fe/core/jsx-runtime/Fragment.js +16 -0
- package/src/sap/fe/core/jsx-runtime/Fragment.ts +3 -0
- package/src/sap/fe/core/jsx-runtime/jsx-control.js +99 -0
- package/src/sap/fe/core/jsx-runtime/jsx-control.ts +82 -0
- package/src/sap/fe/core/jsx-runtime/jsx-xml.js +105 -0
- package/src/sap/fe/core/jsx-runtime/jsx-xml.ts +89 -0
- package/src/sap/fe/core/jsx-runtime/jsx.js +12 -90
- package/src/sap/fe/core/jsx-runtime/jsx.ts +24 -85
- package/src/sap/fe/core/library.js +42 -3
- package/src/sap/fe/core/library.ts +38 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +3 -3
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +2 -2
- package/src/sap/fe/core/messagebundle.properties +39 -63
- package/src/sap/fe/core/messagebundle_ar.properties +25 -39
- package/src/sap/fe/core/messagebundle_bg.properties +25 -39
- package/src/sap/fe/core/messagebundle_ca.properties +25 -39
- package/src/sap/fe/core/messagebundle_cs.properties +25 -39
- package/src/sap/fe/core/messagebundle_cy.properties +25 -39
- package/src/sap/fe/core/messagebundle_da.properties +25 -39
- package/src/sap/fe/core/messagebundle_de.properties +25 -39
- package/src/sap/fe/core/messagebundle_el.properties +26 -40
- package/src/sap/fe/core/messagebundle_en.properties +25 -39
- package/src/sap/fe/core/messagebundle_en_GB.properties +25 -39
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +25 -39
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +25 -39
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +26 -18
- package/src/sap/fe/core/messagebundle_es.properties +27 -41
- package/src/sap/fe/core/messagebundle_es_MX.properties +25 -39
- package/src/sap/fe/core/messagebundle_et.properties +25 -39
- package/src/sap/fe/core/messagebundle_fi.properties +25 -39
- package/src/sap/fe/core/messagebundle_fr.properties +26 -40
- package/src/sap/fe/core/messagebundle_fr_CA.properties +25 -39
- package/src/sap/fe/core/messagebundle_hi.properties +25 -39
- package/src/sap/fe/core/messagebundle_hr.properties +25 -39
- package/src/sap/fe/core/messagebundle_hu.properties +25 -39
- package/src/sap/fe/core/messagebundle_id.properties +25 -39
- package/src/sap/fe/core/messagebundle_it.properties +41 -55
- package/src/sap/fe/core/messagebundle_iw.properties +25 -39
- package/src/sap/fe/core/messagebundle_ja.properties +25 -39
- package/src/sap/fe/core/messagebundle_kk.properties +25 -39
- package/src/sap/fe/core/messagebundle_ko.properties +30 -44
- package/src/sap/fe/core/messagebundle_lt.properties +25 -39
- package/src/sap/fe/core/messagebundle_lv.properties +25 -39
- package/src/sap/fe/core/messagebundle_ms.properties +25 -39
- package/src/sap/fe/core/messagebundle_nl.properties +27 -41
- package/src/sap/fe/core/messagebundle_no.properties +25 -39
- package/src/sap/fe/core/messagebundle_pl.properties +26 -40
- package/src/sap/fe/core/messagebundle_pt.properties +26 -40
- package/src/sap/fe/core/messagebundle_pt_PT.properties +25 -39
- package/src/sap/fe/core/messagebundle_ro.properties +25 -39
- package/src/sap/fe/core/messagebundle_ru.properties +25 -39
- package/src/sap/fe/core/messagebundle_sh.properties +25 -39
- package/src/sap/fe/core/messagebundle_sk.properties +25 -39
- package/src/sap/fe/core/messagebundle_sl.properties +25 -39
- package/src/sap/fe/core/messagebundle_sv.properties +25 -39
- package/src/sap/fe/core/messagebundle_th.properties +25 -39
- package/src/sap/fe/core/messagebundle_tr.properties +25 -39
- package/src/sap/fe/core/messagebundle_uk.properties +25 -39
- package/src/sap/fe/core/messagebundle_vi.properties +25 -39
- package/src/sap/fe/core/messagebundle_zh_CN.properties +25 -39
- package/src/sap/fe/core/messagebundle_zh_TW.properties +25 -39
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +5 -5
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +97 -69
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +68 -69
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +1 -1
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +3 -2
- package/src/sap/fe/core/services/NavigationServiceFactory.js +61 -49
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +63 -52
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +2 -2
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +4 -4
- package/src/sap/fe/core/services/RoutingServiceFactory.js +55 -55
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +67 -65
- package/src/sap/fe/core/services/ShellServicesFactory.js +92 -76
- package/src/sap/fe/core/services/ShellServicesFactory.ts +95 -82
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +61 -61
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +102 -92
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +224 -198
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +138 -139
- package/src/sap/fe/core/support/CommonHelper.js +3 -2
- package/src/sap/fe/core/support/CommonHelper.ts +9 -13
- package/src/sap/fe/core/support/Diagnostics.js +1 -1
- package/src/sap/fe/core/support/Diagnostics.ts +5 -5
- package/src/sap/fe/core/templating/CommonFormatters.js +84 -0
- package/src/sap/fe/core/templating/CommonFormatters.ts +86 -0
- package/src/sap/fe/core/templating/CriticalityFormatters.js +31 -31
- package/src/sap/fe/core/templating/CriticalityFormatters.ts +42 -40
- package/src/sap/fe/core/templating/DataFieldFormatters.js +8 -8
- package/src/sap/fe/core/templating/DataFieldFormatters.ts +13 -10
- package/src/sap/fe/core/templating/DataModelPathHelper.js +16 -15
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +42 -32
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +1 -1
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +2 -3
- package/src/sap/fe/core/templating/EntitySetHelper.js +7 -7
- package/src/sap/fe/core/templating/EntitySetHelper.ts +6 -8
- package/src/sap/fe/core/templating/FieldControlHelper.js +35 -34
- package/src/sap/fe/core/templating/FieldControlHelper.ts +29 -46
- package/src/sap/fe/core/templating/FilterHelper.js +16 -15
- package/src/sap/fe/core/templating/FilterHelper.ts +18 -18
- package/src/sap/fe/core/templating/FilterTemplating.js +1 -1
- package/src/sap/fe/core/templating/FilterTemplating.ts +3 -3
- package/src/sap/fe/core/templating/PropertyFormatters.js +7 -7
- package/src/sap/fe/core/templating/PropertyFormatters.ts +21 -19
- package/src/sap/fe/core/templating/PropertyHelper.js +25 -25
- package/src/sap/fe/core/templating/PropertyHelper.ts +25 -26
- package/src/sap/fe/core/templating/UIFormatters.js +152 -95
- package/src/sap/fe/core/templating/UIFormatters.ts +202 -128
- package/src/sap/fe/core/type/Email.js +2 -2
- package/src/sap/fe/core/type/Email.ts +2 -2
- package/src/sap/fe/core/helpers/BindingExpression.js +0 -1732
|
@@ -1,37 +1,40 @@
|
|
|
1
1
|
import Log from "sap/base/Log";
|
|
2
|
-
import FlexibleColumnLayout from "sap/f/FlexibleColumnLayout";
|
|
2
|
+
import type FlexibleColumnLayout from "sap/f/FlexibleColumnLayout";
|
|
3
3
|
import CommonUtils from "sap/fe/core/CommonUtils";
|
|
4
4
|
import BusyLocker from "sap/fe/core/controllerextensions/BusyLocker";
|
|
5
5
|
import { send } from "sap/fe/core/controllerextensions/collaboration/ActivitySync";
|
|
6
6
|
import { Activity } from "sap/fe/core/controllerextensions/collaboration/CollaborationCommon";
|
|
7
|
-
import
|
|
7
|
+
import type { SiblingInformation } from "sap/fe/core/controllerextensions/editFlow/draft";
|
|
8
|
+
import draft from "sap/fe/core/controllerextensions/editFlow/draft";
|
|
8
9
|
import { defineUI5Class, extensible, finalExtension, publicExtension } from "sap/fe/core/helpers/ClassSupport";
|
|
9
10
|
import EditState from "sap/fe/core/helpers/EditState";
|
|
10
|
-
import
|
|
11
|
+
import type { InternalModelContext } from "sap/fe/core/helpers/ModelHelper";
|
|
12
|
+
import ModelHelper from "sap/fe/core/helpers/ModelHelper";
|
|
11
13
|
import SemanticKeyHelper from "sap/fe/core/helpers/SemanticKeyHelper";
|
|
12
14
|
import FELibrary from "sap/fe/core/library";
|
|
13
|
-
import PageController from "sap/fe/core/PageController";
|
|
14
|
-
import { SemanticMapping } from "sap/fe/core/services/RoutingServiceFactory";
|
|
15
|
-
import {
|
|
16
|
-
import NavContainer from "sap/m/NavContainer";
|
|
17
|
-
import Control from "sap/ui/core/Control";
|
|
15
|
+
import type PageController from "sap/fe/core/PageController";
|
|
16
|
+
import type { SemanticMapping } from "sap/fe/core/services/RoutingServiceFactory";
|
|
17
|
+
import { StandardActions, triggerConfiguredSurvey, TriggerType } from "sap/fe/templates/Feedback";
|
|
18
|
+
import type NavContainer from "sap/m/NavContainer";
|
|
19
|
+
import type Control from "sap/ui/core/Control";
|
|
18
20
|
import Core from "sap/ui/core/Core";
|
|
19
21
|
import coreLibrary from "sap/ui/core/library";
|
|
20
22
|
import Message from "sap/ui/core/message/Message";
|
|
21
23
|
import ControllerExtension from "sap/ui/core/mvc/ControllerExtension";
|
|
22
24
|
import OverrideExecution from "sap/ui/core/mvc/OverrideExecution";
|
|
23
|
-
import Table from "sap/ui/mdc/Table";
|
|
24
|
-
import Context from "sap/ui/model/odata/v4/Context";
|
|
25
|
+
import type Table from "sap/ui/mdc/Table";
|
|
26
|
+
import type Context from "sap/ui/model/odata/v4/Context";
|
|
25
27
|
import ODataListBinding from "sap/ui/model/odata/v4/ODataListBinding";
|
|
26
|
-
import ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
|
|
27
|
-
import ODataModel from "sap/ui/model/odata/v4/ODataModel";
|
|
28
|
-
import { CoreEx } from "types/extension_types";
|
|
28
|
+
import type ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
|
|
29
|
+
import type ODataModel from "sap/ui/model/odata/v4/ODataModel";
|
|
30
|
+
import type { CoreEx, V4Context } from "types/extension_types";
|
|
29
31
|
|
|
30
32
|
const CreationMode = FELibrary.CreationMode,
|
|
31
33
|
ProgrammingModel = FELibrary.ProgrammingModel,
|
|
32
34
|
Constants = FELibrary.Constants,
|
|
33
35
|
DraftStatus = FELibrary.DraftStatus,
|
|
34
36
|
EditMode = FELibrary.EditMode,
|
|
37
|
+
StartupMode = FELibrary.StartupMode,
|
|
35
38
|
MessageType = coreLibrary.MessageType;
|
|
36
39
|
|
|
37
40
|
/**
|
|
@@ -58,15 +61,15 @@ class EditFlow extends ControllerExtension {
|
|
|
58
61
|
* Creates a draft document for an existing active document.
|
|
59
62
|
*
|
|
60
63
|
* @memberof sap.fe.core.controllerextensions.EditFlow
|
|
61
|
-
* @param
|
|
62
|
-
* @returns
|
|
64
|
+
* @param oContext Context of the active document
|
|
65
|
+
* @returns Promise resolves once the editable document is available
|
|
63
66
|
* @alias sap.fe.core.controllerextensions.EditFlow#editDocument
|
|
64
67
|
* @public
|
|
65
68
|
* @since 1.90.0
|
|
66
69
|
*/
|
|
67
70
|
@publicExtension()
|
|
68
71
|
@finalExtension()
|
|
69
|
-
async editDocument(oContext:
|
|
72
|
+
async editDocument(oContext: V4Context): Promise<void> {
|
|
70
73
|
const bDraftNavigation = true;
|
|
71
74
|
const transactionHelper = this._getTransactionHelper();
|
|
72
75
|
const oRootViewController = this._getRootViewController() as any;
|
|
@@ -124,9 +127,9 @@ class EditFlow extends ControllerExtension {
|
|
|
124
127
|
* Updates the draft status and displays the error messages if there are errors during an update.
|
|
125
128
|
*
|
|
126
129
|
* @memberof sap.fe.core.controllerextensions.EditFlow
|
|
127
|
-
* @param
|
|
128
|
-
* @param
|
|
129
|
-
* @returns
|
|
130
|
+
* @param oContext Context of the updated field
|
|
131
|
+
* @param oPromise Promise to determine when the update operation is completed. The promise should be resolved when the update operation is completed, so the draft status can be updated.
|
|
132
|
+
* @returns Promise resolves once draft status has been updated
|
|
130
133
|
* @alias sap.fe.core.controllerextensions.EditFlow#updateDocument
|
|
131
134
|
* @public
|
|
132
135
|
* @since 1.90.0
|
|
@@ -139,7 +142,7 @@ class EditFlow extends ControllerExtension {
|
|
|
139
142
|
const bIsDraft = this._getProgrammingModel(oContext) === ProgrammingModel.Draft;
|
|
140
143
|
|
|
141
144
|
this._getMessageHandler().removeTransitionMessages();
|
|
142
|
-
return this._syncTask(() => {
|
|
145
|
+
return this._syncTask(async () => {
|
|
143
146
|
if (originalBindingContext) {
|
|
144
147
|
transactionHelper.handleDocumentModifications();
|
|
145
148
|
if (!this._isFclEnabled()) {
|
|
@@ -152,45 +155,38 @@ class EditFlow extends ControllerExtension {
|
|
|
152
155
|
}
|
|
153
156
|
this._getMessageHandler().removeTransitionMessages();
|
|
154
157
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
} else {
|
|
175
|
-
this._setDraftStatus(DraftStatus.Saved);
|
|
176
|
-
}
|
|
177
|
-
} else {
|
|
178
|
-
this._setDraftStatus(DraftStatus.Saved);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
() => {
|
|
183
|
-
if (bIsDraft && originalBindingContext) {
|
|
184
|
-
this._setDraftStatus(DraftStatus.Clear);
|
|
158
|
+
try {
|
|
159
|
+
await oPromise;
|
|
160
|
+
// If a navigation happened while oPromise was being resolved, the binding context of the page changed
|
|
161
|
+
// In that case, we shouldn't do anything
|
|
162
|
+
const oBindingContext = this.getView().getBindingContext();
|
|
163
|
+
if (bIsDraft && oBindingContext && oBindingContext === originalBindingContext) {
|
|
164
|
+
const oMetaModel = oBindingContext.getModel().getMetaModel() as ODataMetaModel,
|
|
165
|
+
sEntitySetName = (oMetaModel as any).getMetaContext(oBindingContext.getPath()).getObject("@sapui.name"),
|
|
166
|
+
aSemanticKeys = SemanticKeyHelper.getSemanticKeys(oMetaModel, sEntitySetName);
|
|
167
|
+
if (aSemanticKeys && aSemanticKeys.length) {
|
|
168
|
+
const oCurrentSemanticMapping = this._getSemanticMapping(),
|
|
169
|
+
sCurrentSemanticPath = oCurrentSemanticMapping && oCurrentSemanticMapping.semanticPath,
|
|
170
|
+
sChangedPath = SemanticKeyHelper.getSemanticPath(oBindingContext, true);
|
|
171
|
+
// sCurrentSemanticPath could be null if we have navigated via deep link then there are no semanticMappings to calculate it from
|
|
172
|
+
if (sCurrentSemanticPath && sCurrentSemanticPath !== sChangedPath) {
|
|
173
|
+
await this._handleNewContext(oBindingContext, true, false, true);
|
|
174
|
+
this._setDraftStatus(DraftStatus.Saved);
|
|
175
|
+
} else {
|
|
176
|
+
this._setDraftStatus(DraftStatus.Saved);
|
|
185
177
|
}
|
|
178
|
+
} else {
|
|
179
|
+
this._setDraftStatus(DraftStatus.Saved);
|
|
186
180
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
181
|
+
}
|
|
182
|
+
} catch (oError: any) {
|
|
183
|
+
Log.error("Error while updating the document", oError);
|
|
184
|
+
if (bIsDraft && originalBindingContext) {
|
|
185
|
+
this._setDraftStatus(DraftStatus.Clear);
|
|
186
|
+
}
|
|
187
|
+
} finally {
|
|
188
|
+
this._getMessageHandler().showMessages();
|
|
189
|
+
}
|
|
194
190
|
});
|
|
195
191
|
}
|
|
196
192
|
|
|
@@ -207,15 +203,15 @@ class EditFlow extends ControllerExtension {
|
|
|
207
203
|
* Creates a new document.
|
|
208
204
|
*
|
|
209
205
|
* @memberof sap.fe.core.controllerextensions.EditFlow
|
|
210
|
-
* @param
|
|
211
|
-
* @param
|
|
212
|
-
* @param
|
|
206
|
+
* @param vListBinding ODataListBinding object or the binding path for a temporary list binding
|
|
207
|
+
* @param mInParameters Contains the following attributes:
|
|
208
|
+
* @param mInParameters.creationMode The creation mode using one of the following:
|
|
213
209
|
* NewPage - the created document is shown in a new page, depending on whether metadata 'Sync', 'Async' or 'Deferred' is used
|
|
214
210
|
* Inline - The creation is done inline (in a table)
|
|
215
211
|
* External - The creation is done in a different application specified via the parameter 'outbound'
|
|
216
|
-
* @param
|
|
217
|
-
* @param
|
|
218
|
-
* @returns
|
|
212
|
+
* @param mInParameters.outbound The navigation target where the document is created in case of creationMode 'External'
|
|
213
|
+
* @param mInParameters.createAtEnd Specifies if the new entry should be created at the top or bottom of a table in case of creationMode 'Inline'
|
|
214
|
+
* @returns Promise resolves once the object has been created
|
|
219
215
|
* @alias sap.fe.core.controllerextensions.EditFlow#createDocument
|
|
220
216
|
* @public
|
|
221
217
|
* @since 1.90.0
|
|
@@ -263,13 +259,13 @@ class EditFlow extends ControllerExtension {
|
|
|
263
259
|
oTable.getBindingContext(),
|
|
264
260
|
{
|
|
265
261
|
data: oCreationRowObjects,
|
|
266
|
-
customValidationFunction:
|
|
262
|
+
customValidationFunction: oTable.getCreationRow().data("customValidationFunction")
|
|
267
263
|
},
|
|
268
264
|
this.base.getView()
|
|
269
265
|
);
|
|
270
266
|
|
|
271
267
|
// disableAddRowButtonForEmptyData is set to false in manifest converter (Table.ts) if customValidationFunction exists
|
|
272
|
-
if (
|
|
268
|
+
if (oTable.getCreationRow().data("disableAddRowButtonForEmptyData") === "true") {
|
|
273
269
|
const oInternalModelContext = oTable.getBindingContext("internal") as InternalModelContext;
|
|
274
270
|
oInternalModelContext.setProperty("creationRowFieldValidity", {});
|
|
275
271
|
}
|
|
@@ -279,10 +275,14 @@ class EditFlow extends ControllerExtension {
|
|
|
279
275
|
oTable = this.getView().byId(mParameters.tableId) as Table;
|
|
280
276
|
}
|
|
281
277
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
278
|
+
if (oTable && oTable.isA("sap.ui.mdc.Table")) {
|
|
279
|
+
const fnFocusOrScroll =
|
|
280
|
+
mParameters.creationMode === CreationMode.Inline ? oTable.focusRow.bind(oTable) : oTable.scrollToIndex.bind(oTable);
|
|
281
|
+
oTable.getRowBinding().attachEventOnce("change", function () {
|
|
282
|
+
fnFocusOrScroll(mParameters.createAtEnd ? oTable.getRowBinding().getLength() : 0, true);
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
|
|
286
286
|
const handleSideEffects = (oListBinding: any, oCreationPromise: Promise<Context>) => {
|
|
287
287
|
oCreationPromise
|
|
288
288
|
.then(function (oNewContext: any) {
|
|
@@ -295,8 +295,8 @@ class EditFlow extends ControllerExtension {
|
|
|
295
295
|
// this is avoid a potential list refresh, there could be a side effect that refreshes the list binding
|
|
296
296
|
// if list binding is refreshed, transient contexts might be lost
|
|
297
297
|
if (!CommonUtils.hasTransientContext(oListBinding)) {
|
|
298
|
-
const
|
|
299
|
-
|
|
298
|
+
const appComponent = CommonUtils.getAppComponent(this.getView());
|
|
299
|
+
appComponent
|
|
300
300
|
.getSideEffectsService()
|
|
301
301
|
.requestSideEffectsForNavigationProperty(oListBinding.getPath(), oBindingContext);
|
|
302
302
|
}
|
|
@@ -307,10 +307,10 @@ class EditFlow extends ControllerExtension {
|
|
|
307
307
|
};
|
|
308
308
|
|
|
309
309
|
/**
|
|
310
|
-
* @param
|
|
310
|
+
* @param aValidationMessages Error messages from custom validation function
|
|
311
311
|
*/
|
|
312
312
|
const createCustomValidationMessages = (aValidationMessages: any[]) => {
|
|
313
|
-
const sCustomValidationFunction = oTable &&
|
|
313
|
+
const sCustomValidationFunction = oTable && oTable.getCreationRow().data("customValidationFunction");
|
|
314
314
|
const mCustomValidity = oTable && oTable.getBindingContext("internal")?.getProperty("creationRowCustomValidity");
|
|
315
315
|
const oMessageManager = Core.getMessageManager();
|
|
316
316
|
const aCustomMessages: any[] = [];
|
|
@@ -331,7 +331,7 @@ class EditFlow extends ControllerExtension {
|
|
|
331
331
|
// Handle Bound CustomValidation message
|
|
332
332
|
if (oValidationMessage.messageTarget) {
|
|
333
333
|
oFieldControl = Core.getControl(mCustomValidity[oValidationMessage.messageTarget].fieldId) as Control;
|
|
334
|
-
sTarget = oFieldControl.getBindingContext()?.getPath()
|
|
334
|
+
sTarget = `${oFieldControl.getBindingContext()?.getPath()}/${oFieldControl.getBindingPath("value")}`;
|
|
335
335
|
// Add validation message if still not exists
|
|
336
336
|
if (
|
|
337
337
|
oMessageManager
|
|
@@ -379,8 +379,9 @@ class EditFlow extends ControllerExtension {
|
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
381
|
};
|
|
382
|
-
|
|
383
|
-
|
|
382
|
+
if (bShouldBusyLock) {
|
|
383
|
+
BusyLocker.lock(oLockObject);
|
|
384
|
+
}
|
|
384
385
|
return this._syncTask(oExecCustomValidation)
|
|
385
386
|
.then((aValidationMessages: any) => {
|
|
386
387
|
if (aValidationMessages.length > 0) {
|
|
@@ -424,12 +425,12 @@ class EditFlow extends ControllerExtension {
|
|
|
424
425
|
// in the absence of NewAction or NewAction with parameters, creation is async
|
|
425
426
|
sNewAction =
|
|
426
427
|
sProgrammingModel === ProgrammingModel.Draft
|
|
427
|
-
? oMetaModel.getObject(sPath
|
|
428
|
+
? oMetaModel.getObject(`${sPath}@com.sap.vocabularies.Common.v1.DraftRoot/NewAction`)
|
|
428
429
|
: oMetaModel.getObject(
|
|
429
|
-
sPath
|
|
430
|
+
`${sPath}@com.sap.vocabularies.Session.v1.StickySessionSupported/NewAction`
|
|
430
431
|
);
|
|
431
432
|
if (sNewAction) {
|
|
432
|
-
const aParameters = oMetaModel.getObject(
|
|
433
|
+
const aParameters = oMetaModel.getObject(`/${sNewAction}/@$ui5.overload/0/$Parameter`) || [];
|
|
433
434
|
// binding parameter (eg: _it) is not considered
|
|
434
435
|
if (aParameters.length > 1) {
|
|
435
436
|
return CreationMode.Deferred;
|
|
@@ -448,7 +449,7 @@ class EditFlow extends ControllerExtension {
|
|
|
448
449
|
return CreationMode.Async;
|
|
449
450
|
}
|
|
450
451
|
})
|
|
451
|
-
.then((
|
|
452
|
+
.then((resolvedCreationMode: any) => {
|
|
452
453
|
let oCreation: any;
|
|
453
454
|
let mArgs: any;
|
|
454
455
|
const oCreationRow = mParameters.creationRow;
|
|
@@ -459,15 +460,15 @@ class EditFlow extends ControllerExtension {
|
|
|
459
460
|
const oMetaModel = oModel.getMetaModel();
|
|
460
461
|
const oRoutingListener = this._getRoutingListener();
|
|
461
462
|
|
|
462
|
-
if (
|
|
463
|
-
if (
|
|
463
|
+
if (resolvedCreationMode !== CreationMode.Deferred) {
|
|
464
|
+
if (resolvedCreationMode === CreationMode.CreationRow) {
|
|
464
465
|
oCreationRowContext = oCreationRow.getBindingContext();
|
|
465
466
|
sMetaPath = oMetaModel.getMetaPath(oCreationRowContext.getPath());
|
|
466
467
|
// prefill data from creation row
|
|
467
468
|
oPayload = oCreationRowContext.getObject();
|
|
468
469
|
mParameters.data = {};
|
|
469
470
|
Object.keys(oPayload).forEach(function (sPropertyPath: string) {
|
|
470
|
-
const oProperty = oMetaModel.getObject(sMetaPath
|
|
471
|
+
const oProperty = oMetaModel.getObject(`${sMetaPath}/${sPropertyPath}`);
|
|
471
472
|
// ensure navigation properties are not part of the payload, deep create not supported
|
|
472
473
|
if (oProperty && oProperty.$kind === "NavigationProperty") {
|
|
473
474
|
return;
|
|
@@ -476,7 +477,7 @@ class EditFlow extends ControllerExtension {
|
|
|
476
477
|
});
|
|
477
478
|
oValidationCheck = this._checkForValidationErrors(/*oCreationRowContext*/);
|
|
478
479
|
}
|
|
479
|
-
if (
|
|
480
|
+
if (resolvedCreationMode === CreationMode.CreationRow || resolvedCreationMode === CreationMode.Inline) {
|
|
480
481
|
mParameters.keepTransientContextOnFailed = false; // currently not fully supported
|
|
481
482
|
// busy handling shall be done locally only
|
|
482
483
|
mParameters.busyMode = "Local";
|
|
@@ -503,7 +504,7 @@ class EditFlow extends ControllerExtension {
|
|
|
503
504
|
}
|
|
504
505
|
|
|
505
506
|
let oNavigation;
|
|
506
|
-
switch (
|
|
507
|
+
switch (resolvedCreationMode) {
|
|
507
508
|
case CreationMode.Deferred:
|
|
508
509
|
oNavigation = oRoutingListener.navigateForwardToContext(oListBinding, {
|
|
509
510
|
bDeferredContext: true,
|
|
@@ -528,12 +529,12 @@ class EditFlow extends ControllerExtension {
|
|
|
528
529
|
}
|
|
529
530
|
oNavigation = oCreation.then(function (oNewDocumentContext: any) {
|
|
530
531
|
if (!oNewDocumentContext) {
|
|
531
|
-
const
|
|
532
|
+
const coreResourceBundle = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core");
|
|
532
533
|
return oRoutingListener.navigateToMessagePage(
|
|
533
|
-
|
|
534
|
+
coreResourceBundle.getText("C_COMMON_SAPFE_DATA_RECEIVED_ERROR"),
|
|
534
535
|
{
|
|
535
|
-
title:
|
|
536
|
-
description:
|
|
536
|
+
title: coreResourceBundle.getText("C_COMMON_SAPFE_ERROR"),
|
|
537
|
+
description: coreResourceBundle.getText("C_EDITFLOW_SAPFE_CREATION_FAILED_DESCRIPTION")
|
|
537
538
|
}
|
|
538
539
|
);
|
|
539
540
|
} else {
|
|
@@ -574,7 +575,7 @@ class EditFlow extends ControllerExtension {
|
|
|
574
575
|
});
|
|
575
576
|
break;
|
|
576
577
|
default:
|
|
577
|
-
oNavigation = Promise.reject(
|
|
578
|
+
oNavigation = Promise.reject(`Unhandled creationMode ${resolvedCreationMode}`);
|
|
578
579
|
break;
|
|
579
580
|
}
|
|
580
581
|
|
|
@@ -618,14 +619,9 @@ class EditFlow extends ControllerExtension {
|
|
|
618
619
|
});
|
|
619
620
|
})
|
|
620
621
|
.finally(function () {
|
|
621
|
-
if (
|
|
622
|
-
|
|
623
|
-
mParameters.creationMode === CreationMode.Inline ? oTable.focusRow.bind(oTable) : oTable.scrollToIndex.bind(oTable);
|
|
624
|
-
oTable.getRowBinding().attachEventOnce("change", function () {
|
|
625
|
-
fnFocusOrScroll(mParameters.createAtEnd ? oTable.getRowBinding().getLength() : 0, true);
|
|
626
|
-
});
|
|
622
|
+
if (bShouldBusyLock) {
|
|
623
|
+
BusyLocker.unlock(oLockObject);
|
|
627
624
|
}
|
|
628
|
-
bShouldBusyLock && BusyLocker.unlock(oLockObject);
|
|
629
625
|
});
|
|
630
626
|
}
|
|
631
627
|
|
|
@@ -636,9 +632,10 @@ class EditFlow extends ControllerExtension {
|
|
|
636
632
|
*
|
|
637
633
|
* This function is meant to be individually overridden by consuming controllers, but not to be called directly.
|
|
638
634
|
* The override execution is: {@link sap.ui.core.mvc.OverrideExecution.After}.
|
|
639
|
-
*
|
|
640
|
-
* @param
|
|
641
|
-
* @
|
|
635
|
+
*
|
|
636
|
+
* @param mParameters Object containing the parameters passed to onBeforeSave
|
|
637
|
+
* @param mParameters.context Page context that is going to be saved.
|
|
638
|
+
* @returns A promise to be returned by the overridden method. If resolved, the 'Save' action is triggered. If rejected, the 'Save' action is not triggered and the user stays in edit mode.
|
|
642
639
|
* @memberof sap.fe.core.controllerextensions.EditFlow
|
|
643
640
|
* @alias sap.fe.core.controllerextensions.EditFlow#onBeforeSave
|
|
644
641
|
* @public
|
|
@@ -658,10 +655,11 @@ class EditFlow extends ControllerExtension {
|
|
|
658
655
|
*
|
|
659
656
|
* This function is meant to be individually overridden by consuming controllers, but not to be called directly.
|
|
660
657
|
* The override execution is: {@link sap.ui.core.mvc.OverrideExecution.After}.
|
|
661
|
-
*
|
|
662
|
-
* @param
|
|
663
|
-
* @param
|
|
664
|
-
* @
|
|
658
|
+
*
|
|
659
|
+
* @param mParameters Object containing the parameters passed to onBeforeCreate
|
|
660
|
+
* @param mParameters.contextPath Path pointing to the context on which Create action is triggered
|
|
661
|
+
* @param mParameters.createParameters Array of values that are filled in the Action Parameter Dialog
|
|
662
|
+
* @returns A promise to be returned by the overridden method. If resolved, the 'Create' action is triggered. If rejected, the 'Create' action is not triggered.
|
|
665
663
|
* @memberof sap.fe.core.controllerextensions.EditFlow
|
|
666
664
|
* @alias sap.fe.core.controllerextensions.EditFlow#onBeforeCreate
|
|
667
665
|
* @public
|
|
@@ -681,9 +679,10 @@ class EditFlow extends ControllerExtension {
|
|
|
681
679
|
*
|
|
682
680
|
* This function is meant to be individually overridden by consuming controllers, but not to be called directly.
|
|
683
681
|
* The override execution is: {@link sap.ui.core.mvc.OverrideExecution.After}.
|
|
684
|
-
*
|
|
685
|
-
* @param
|
|
686
|
-
* @
|
|
682
|
+
*
|
|
683
|
+
* @param mParameters Object containing the parameters passed to onBeforeEdit
|
|
684
|
+
* @param mParameters.context Page context that is going to be edited.
|
|
685
|
+
* @returns A promise to be returned by the overridden method. If resolved, the 'Edit' action is triggered. If rejected, the 'Edit' action is not triggered and the user stays in display mode.
|
|
687
686
|
* @memberof sap.fe.core.controllerextensions.EditFlow
|
|
688
687
|
* @alias sap.fe.core.controllerextensions.EditFlow#onBeforeEdit
|
|
689
688
|
* @public
|
|
@@ -703,9 +702,10 @@ class EditFlow extends ControllerExtension {
|
|
|
703
702
|
*
|
|
704
703
|
* This function is meant to be individually overridden by consuming controllers, but not to be called directly.
|
|
705
704
|
* The override execution is: {@link sap.ui.core.mvc.OverrideExecution.After}.
|
|
706
|
-
*
|
|
707
|
-
* @param
|
|
708
|
-
* @
|
|
705
|
+
*
|
|
706
|
+
* @param mParameters Object containing the parameters passed to onBeforeDiscard
|
|
707
|
+
* @param mParameters.context Page context that is going to be discarded.
|
|
708
|
+
* @returns A promise to be returned by the overridden method. If resolved, the 'Discard' action is triggered. If rejected, the 'Discard' action is not triggered and the user stays in edit mode.
|
|
709
709
|
* @memberof sap.fe.core.controllerextensions.EditFlow
|
|
710
710
|
* @alias sap.fe.core.controllerextensions.EditFlow#onBeforeDiscard
|
|
711
711
|
* @public
|
|
@@ -725,9 +725,10 @@ class EditFlow extends ControllerExtension {
|
|
|
725
725
|
*
|
|
726
726
|
* This function is meant to be individually overridden by consuming controllers, but not to be called directly.
|
|
727
727
|
* The override execution is: {@link sap.ui.core.mvc.OverrideExecution.After}.
|
|
728
|
-
*
|
|
729
|
-
* @param
|
|
730
|
-
* @
|
|
728
|
+
*
|
|
729
|
+
* @param mParameters Object containing the parameters passed to onBeforeDelete
|
|
730
|
+
* @param mParameters.contexts An array of contexts that are going to be deleted
|
|
731
|
+
* @returns A promise to be returned by the overridden method. If resolved, the 'Delete' action is triggered. If rejected, the 'Delete' action is not triggered.
|
|
731
732
|
* @memberof sap.fe.core.controllerextensions.EditFlow
|
|
732
733
|
* @alias sap.fe.core.controllerextensions.EditFlow#onBeforeDelete
|
|
733
734
|
* @public
|
|
@@ -752,15 +753,15 @@ class EditFlow extends ControllerExtension {
|
|
|
752
753
|
* Saves a new document after checking it.
|
|
753
754
|
*
|
|
754
755
|
* @memberof sap.fe.core.controllerextensions.EditFlow
|
|
755
|
-
* @param
|
|
756
|
-
* @returns
|
|
756
|
+
* @param oContext Context of the editable document
|
|
757
|
+
* @returns Promise resolves once save is complete
|
|
757
758
|
* @alias sap.fe.core.controllerextensions.EditFlow#saveDocument
|
|
758
759
|
* @public
|
|
759
760
|
* @since 1.90.0
|
|
760
761
|
*/
|
|
761
762
|
@publicExtension()
|
|
762
763
|
@finalExtension()
|
|
763
|
-
async saveDocument(oContext:
|
|
764
|
+
async saveDocument(oContext: V4Context, mParameters: any): Promise<void> {
|
|
764
765
|
mParameters = mParameters || {};
|
|
765
766
|
const bExecuteSideEffectsOnError = mParameters.bExecuteSideEffectsOnError || undefined;
|
|
766
767
|
const bDraftNavigation = true;
|
|
@@ -802,7 +803,7 @@ class EditFlow extends ControllerExtension {
|
|
|
802
803
|
this._removeStickySessionInternalProperties(sProgrammingModel);
|
|
803
804
|
|
|
804
805
|
this._sendActivity(Activity.Activate, activeDocumentContext);
|
|
805
|
-
this._triggerConfiguredSurvey(
|
|
806
|
+
this._triggerConfiguredSurvey(StandardActions.save, TriggerType.standardAction);
|
|
806
807
|
|
|
807
808
|
this._setEditMode(EditMode.Display, false);
|
|
808
809
|
this._getMessageHandler().showMessageDialog();
|
|
@@ -828,7 +829,7 @@ class EditFlow extends ControllerExtension {
|
|
|
828
829
|
}
|
|
829
830
|
@publicExtension()
|
|
830
831
|
@finalExtension()
|
|
831
|
-
async toggleDraftActive(oContext:
|
|
832
|
+
async toggleDraftActive(oContext: V4Context): Promise<void> {
|
|
832
833
|
const oContextData = oContext.getObject();
|
|
833
834
|
let bEditable: boolean;
|
|
834
835
|
const bIsDraft = oContext && this._getProgrammingModel(oContext) === ProgrammingModel.Draft;
|
|
@@ -863,7 +864,7 @@ class EditFlow extends ControllerExtension {
|
|
|
863
864
|
const lastSemanticMapping = this._getSemanticMapping();
|
|
864
865
|
if (lastSemanticMapping?.technicalPath === oContext.getPath()) {
|
|
865
866
|
const targetPath = siblingInfo.pathMapping[siblingInfo.pathMapping.length - 1].newPath;
|
|
866
|
-
siblingInfo.pathMapping.push({ oldPath: lastSemanticMapping
|
|
867
|
+
siblingInfo.pathMapping.push({ oldPath: lastSemanticMapping.semanticPath, newPath: targetPath });
|
|
867
868
|
}
|
|
868
869
|
this._updatePathsInHistory(siblingInfo.pathMapping);
|
|
869
870
|
}
|
|
@@ -873,7 +874,7 @@ class EditFlow extends ControllerExtension {
|
|
|
873
874
|
return Promise.reject("Error in EditFlow.toggleDraftActive - Cannot find sibling");
|
|
874
875
|
}
|
|
875
876
|
} catch (oError) {
|
|
876
|
-
return Promise.reject(
|
|
877
|
+
return Promise.reject(`Error in EditFlow.toggleDraftActive:${oError}` as any);
|
|
877
878
|
}
|
|
878
879
|
}
|
|
879
880
|
|
|
@@ -886,17 +887,17 @@ class EditFlow extends ControllerExtension {
|
|
|
886
887
|
*
|
|
887
888
|
* @memberof sap.fe.core.controllerextensions.EditFlow
|
|
888
889
|
* @param oContext Context of the editable document
|
|
889
|
-
* @param
|
|
890
|
-
* @param
|
|
891
|
-
* @param
|
|
892
|
-
* @returns
|
|
890
|
+
* @param mParameters Can contain the following attributes:
|
|
891
|
+
* @param mParameters.control This is the control used to open the discard popover
|
|
892
|
+
* @param mParameters.skipDiscardPopover Optional, supresses the discard popover and allows custom handling
|
|
893
|
+
* @returns Promise resolves once editable document has been discarded
|
|
893
894
|
* @alias sap.fe.core.controllerextensions.EditFlow#cancelDocument
|
|
894
895
|
* @public
|
|
895
896
|
* @since 1.90.0
|
|
896
897
|
*/
|
|
897
898
|
@publicExtension()
|
|
898
899
|
@finalExtension()
|
|
899
|
-
async cancelDocument(oContext:
|
|
900
|
+
async cancelDocument(oContext: V4Context, mParameters: { control: object; skipDiscardPopover?: boolean }): Promise<any> {
|
|
900
901
|
const transactionHelper = this._getTransactionHelper();
|
|
901
902
|
const oResourceBundle = this._getResourceBundle();
|
|
902
903
|
const mInParameters: any = mParameters;
|
|
@@ -983,11 +984,11 @@ class EditFlow extends ControllerExtension {
|
|
|
983
984
|
* Deletes the document.
|
|
984
985
|
*
|
|
985
986
|
* @memberof sap.fe.core.controllerextensions.EditFlow
|
|
986
|
-
* @param
|
|
987
|
-
* @param
|
|
988
|
-
* @param
|
|
989
|
-
* @param
|
|
990
|
-
* @returns
|
|
987
|
+
* @param oContext Context of the document
|
|
988
|
+
* @param mInParameters Can contain the following attributes:
|
|
989
|
+
* @param mInParameters.title Title of the object being deleted
|
|
990
|
+
* @param mInParameters.description Description of the object being deleted
|
|
991
|
+
* @returns Promise resolves once document has been deleted
|
|
991
992
|
* @alias sap.fe.core.controllerextensions.EditFlow#deleteDocument
|
|
992
993
|
* @public
|
|
993
994
|
* @since 1.90.0
|
|
@@ -1014,11 +1015,18 @@ class EditFlow extends ControllerExtension {
|
|
|
1014
1015
|
}
|
|
1015
1016
|
this._sendActivity(Activity.Delete, oContext);
|
|
1016
1017
|
|
|
1017
|
-
|
|
1018
|
-
// After delete is successfull, we need to dettch the setBackNavigation Methods
|
|
1018
|
+
// After delete is successfull, we need to detach the setBackNavigation Methods
|
|
1019
1019
|
if (oAppComponent) {
|
|
1020
1020
|
oAppComponent.getShellServices().setBackNavigation();
|
|
1021
1021
|
}
|
|
1022
|
+
|
|
1023
|
+
if (oAppComponent?.getStartupMode() === StartupMode.Deeplink && !this._isFclEnabled()) {
|
|
1024
|
+
// In case the app has been launched with semantic keys, deleting the object we've landed on shall navigate back
|
|
1025
|
+
// to the app we came from (except for FCL, where we navigate to LR as usual)
|
|
1026
|
+
oAppComponent.getRouterProxy().exitFromApp();
|
|
1027
|
+
} else {
|
|
1028
|
+
this._getRoutingListener().navigateBackFromContext(oContext);
|
|
1029
|
+
}
|
|
1022
1030
|
})
|
|
1023
1031
|
.catch(function (oError: any) {
|
|
1024
1032
|
Log.error("Error while deleting the document", oError);
|
|
@@ -1029,8 +1037,8 @@ class EditFlow extends ControllerExtension {
|
|
|
1029
1037
|
* Submit the current set of changes and navigate back.
|
|
1030
1038
|
*
|
|
1031
1039
|
* @memberof sap.fe.core.controllerextensions.EditFlow
|
|
1032
|
-
* @param
|
|
1033
|
-
* @returns
|
|
1040
|
+
* @param oContext Context of the document
|
|
1041
|
+
* @returns Promise resolves once the changes have been saved
|
|
1034
1042
|
* @alias sap.fe.core.controllerextensions.EditFlow#applyDocument
|
|
1035
1043
|
* @public
|
|
1036
1044
|
* @since 1.90.0
|
|
@@ -1063,23 +1071,23 @@ class EditFlow extends ControllerExtension {
|
|
|
1063
1071
|
* Invokes an action (bound or unbound) and tracks the changes so that other pages can be refreshed and show the updated data upon navigation.
|
|
1064
1072
|
*
|
|
1065
1073
|
* @memberof sap.fe.core.controllerextensions.EditFlow
|
|
1066
|
-
* @param
|
|
1067
|
-
* @param
|
|
1068
|
-
* @param
|
|
1069
|
-
* @param
|
|
1070
|
-
* @param
|
|
1071
|
-
* @param
|
|
1072
|
-
* @param
|
|
1073
|
-
* @param
|
|
1074
|
-
* @returns
|
|
1074
|
+
* @param sActionName The name of the action to be called
|
|
1075
|
+
* @param mInParameters Contains the following attributes:
|
|
1076
|
+
* @param mInParameters.contexts For a bound action, a context or an array with contexts for which the action is to be called must be provided
|
|
1077
|
+
* @param mInParameters.model For an unbound action, an instance of an OData V4 model must be provided
|
|
1078
|
+
* @param mInParameters.requiresNavigation Boolean value indicating whether navigation is required after the action has been executed. Navigation takes place to the context returned by the action
|
|
1079
|
+
* @param mInParameters.label A human-readable label for the action. This is needed in case the action has a parameter and a parameter dialog is shown to the user. The label will be used for the title of the dialog and for the confirmation button
|
|
1080
|
+
* @param mInParameters.invocationGrouping Mode how actions are to be called: 'ChangeSet' to put all action calls into one changeset, 'Isolated' to put them into separate changesets
|
|
1081
|
+
* @param mExtraParams PRIVATE
|
|
1082
|
+
* @returns A promise once the action has been invoked
|
|
1075
1083
|
* @alias sap.fe.core.controllerextensions.EditFlow#invokeAction
|
|
1076
1084
|
* @public
|
|
1077
1085
|
* @since 1.90.0
|
|
1078
1086
|
* @final
|
|
1079
|
-
|
|
1087
|
+
*/
|
|
1080
1088
|
@publicExtension()
|
|
1081
1089
|
@finalExtension()
|
|
1082
|
-
invokeAction(
|
|
1090
|
+
async invokeAction(
|
|
1083
1091
|
sActionName: string,
|
|
1084
1092
|
mInParameters?: {
|
|
1085
1093
|
contexts?: Context | Context[];
|
|
@@ -1104,7 +1112,11 @@ class EditFlow extends ControllerExtension {
|
|
|
1104
1112
|
// Due to a mistake the invokeAction in the extensionAPI had a different API than this one.
|
|
1105
1113
|
// The one from the extensionAPI doesn't exist anymore as we expose the full edit flow now but
|
|
1106
1114
|
// due to compatibility reasons we still need to support the old signature
|
|
1107
|
-
if (
|
|
1115
|
+
if (
|
|
1116
|
+
(mParameters.isA && mParameters.isA("sap.ui.model.odata.v4.Context")) ||
|
|
1117
|
+
Array.isArray(mParameters) ||
|
|
1118
|
+
mExtraParams !== undefined
|
|
1119
|
+
) {
|
|
1108
1120
|
const contexts = mParameters;
|
|
1109
1121
|
mParameters = mExtraParams || {};
|
|
1110
1122
|
if (contexts) {
|
|
@@ -1181,7 +1193,7 @@ class EditFlow extends ControllerExtension {
|
|
|
1181
1193
|
}
|
|
1182
1194
|
|
|
1183
1195
|
if (!mParameters.contexts) {
|
|
1184
|
-
|
|
1196
|
+
throw new Error(`Context not found for entity type ${sOverloadEntityType}`);
|
|
1185
1197
|
}
|
|
1186
1198
|
}
|
|
1187
1199
|
}
|
|
@@ -1193,92 +1205,88 @@ class EditFlow extends ControllerExtension {
|
|
|
1193
1205
|
mParameters.bGetBoundContext = this._getBoundContext(oView, mParameters);
|
|
1194
1206
|
// Need to know that the action is called from ObjectPage for changeSet Isolated workaround
|
|
1195
1207
|
mParameters.bObjectPage = (oView.getViewData() as any).converterType === "ObjectPage";
|
|
1196
|
-
return this._syncTask()
|
|
1197
|
-
.then(transactionHelper.callAction.bind(transactionHelper, sActionName, mParameters, this.getView(), this._getMessageHandler()))
|
|
1198
|
-
.then((oResponse: any) => {
|
|
1199
|
-
// if the returned context for the bound action is different than the context on which action was called,
|
|
1200
|
-
// refresh the corresponding list binding
|
|
1201
|
-
if (mParameters.contexts) {
|
|
1202
|
-
return this._refreshListIfRequired(
|
|
1203
|
-
this._getActionResponseDataAndKeys(sActionName, oResponse),
|
|
1204
|
-
mParameters.contexts[0]
|
|
1205
|
-
).then(function () {
|
|
1206
|
-
return oResponse;
|
|
1207
|
-
});
|
|
1208
|
-
}
|
|
1209
|
-
})
|
|
1210
|
-
.then((oResponse: any) => {
|
|
1211
|
-
this._sendActivity(Activity.Action, mParameters.contexts);
|
|
1212
|
-
this._triggerConfiguredSurvey(sActionName, triggerType.action);
|
|
1213
1208
|
|
|
1214
|
-
|
|
1215
|
-
|
|
1209
|
+
try {
|
|
1210
|
+
await this._syncTask();
|
|
1211
|
+
const oResponse = await transactionHelper.callAction.bind(
|
|
1212
|
+
transactionHelper,
|
|
1213
|
+
sActionName,
|
|
1214
|
+
mParameters,
|
|
1215
|
+
this.getView(),
|
|
1216
|
+
this._getMessageHandler()
|
|
1217
|
+
)();
|
|
1218
|
+
if (mParameters.contexts) {
|
|
1219
|
+
await this._refreshListIfRequired(this._getActionResponseDataAndKeys(sActionName, oResponse), mParameters.contexts[0]);
|
|
1220
|
+
}
|
|
1221
|
+
this._sendActivity(Activity.Action, mParameters.contexts);
|
|
1222
|
+
this._triggerConfiguredSurvey(sActionName, TriggerType.action);
|
|
1223
|
+
|
|
1224
|
+
if (oCurrentActionCallBacks) {
|
|
1225
|
+
oCurrentActionCallBacks.fResolver(oResponse);
|
|
1226
|
+
}
|
|
1227
|
+
/*
|
|
1228
|
+
We set the (upper) pages to dirty after an execution of an action
|
|
1229
|
+
TODO: get rid of this workaround
|
|
1230
|
+
This workaround is only needed as long as the model does not support the synchronization.
|
|
1231
|
+
Once this is supported we don't need to set the pages to dirty anymore as the context itself
|
|
1232
|
+
is already refreshed (it's just not reflected in the object page)
|
|
1233
|
+
we explicitly don't call this method from the list report but only call it from the object page
|
|
1234
|
+
as if it is called in the list report it's not needed - as we anyway will remove this logic
|
|
1235
|
+
we can live with this
|
|
1236
|
+
we need a context to set the upper pages to dirty - if there are more than one we use the
|
|
1237
|
+
first one as they are anyway siblings
|
|
1238
|
+
*/
|
|
1239
|
+
if (mParameters.contexts) {
|
|
1240
|
+
if (!this._isFclEnabled()) {
|
|
1241
|
+
EditState.setEditStateDirty();
|
|
1216
1242
|
}
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
we explicitly don't call this method from the list report but only call it from the object page
|
|
1224
|
-
as if it is called in the list report it's not needed - as we anyway will remove this logic
|
|
1225
|
-
we can live with this
|
|
1226
|
-
we need a context to set the upper pages to dirty - if there are more than one we use the
|
|
1227
|
-
first one as they are anyway siblings
|
|
1228
|
-
*/
|
|
1229
|
-
if (mParameters.contexts) {
|
|
1230
|
-
if (!this._isFclEnabled()) {
|
|
1231
|
-
EditState.setEditStateDirty();
|
|
1232
|
-
}
|
|
1233
|
-
this._getInternalModel().setProperty("/sCustomAction", sActionName);
|
|
1243
|
+
this._getInternalModel().setProperty("/sCustomAction", sActionName);
|
|
1244
|
+
}
|
|
1245
|
+
if (mParameters.isNavigable) {
|
|
1246
|
+
let vContext = oResponse;
|
|
1247
|
+
if (Array.isArray(vContext) && vContext.length === 1) {
|
|
1248
|
+
vContext = vContext[0];
|
|
1234
1249
|
}
|
|
1235
|
-
if (
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
if (
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
this._getRoutingListener().navigateForwardToContext(vContext, {
|
|
1248
|
-
noHistoryEntry: false
|
|
1249
|
-
});
|
|
1250
|
-
} else {
|
|
1251
|
-
Log.info("Navigation to the same context is not allowed");
|
|
1252
|
-
}
|
|
1250
|
+
if (vContext && !Array.isArray(vContext)) {
|
|
1251
|
+
const oMetaModel = oView.getModel().getMetaModel() as ODataMetaModel;
|
|
1252
|
+
const sContextMetaPath = oMetaModel.getMetaPath(vContext.getPath());
|
|
1253
|
+
const oActionContext = Array.isArray(mParameters.contexts) ? mParameters.contexts[0] : mParameters.contexts;
|
|
1254
|
+
const sActionContextMetaPath = oActionContext && oMetaModel.getMetaPath(oActionContext.getPath());
|
|
1255
|
+
if (sContextMetaPath != undefined && sContextMetaPath === sActionContextMetaPath) {
|
|
1256
|
+
if (oActionContext.getPath() !== vContext.getPath()) {
|
|
1257
|
+
this._getRoutingListener().navigateForwardToContext(vContext, {
|
|
1258
|
+
noHistoryEntry: false
|
|
1259
|
+
});
|
|
1260
|
+
} else {
|
|
1261
|
+
Log.info("Navigation to the same context is not allowed");
|
|
1253
1262
|
}
|
|
1254
1263
|
}
|
|
1255
1264
|
}
|
|
1256
|
-
}
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
});
|
|
1265
|
+
}
|
|
1266
|
+
} catch (err: any) {
|
|
1267
|
+
if (oCurrentActionCallBacks) {
|
|
1268
|
+
oCurrentActionCallBacks.fRejector();
|
|
1269
|
+
}
|
|
1270
|
+
// FIXME: in most situations there is no handler for the rejected promises returned
|
|
1271
|
+
if (err === Constants.CancelActionDialog) {
|
|
1272
|
+
throw new Error("Dialog cancelled");
|
|
1273
|
+
} else if (!(err && (err.canceled || (err.rejectedItems && err.rejectedItems[0].canceled)))) {
|
|
1274
|
+
throw new Error(`Error in EditFlow.invokeAction:${err}`);
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1269
1277
|
}
|
|
1270
1278
|
|
|
1271
1279
|
/**
|
|
1272
1280
|
* Secured execution of the given function. Ensures that the function is only executed when certain conditions are fulfilled.
|
|
1273
1281
|
*
|
|
1274
1282
|
* @memberof sap.fe.core.controllerextensions.EditFlow
|
|
1275
|
-
* @param
|
|
1276
|
-
* @param
|
|
1277
|
-
* @param
|
|
1278
|
-
* @param
|
|
1279
|
-
* @param
|
|
1280
|
-
* @param
|
|
1281
|
-
* @returns
|
|
1283
|
+
* @param fnFunction The function to be executed. Should return a promise that is settled after completion of the execution. If nothing is returned, immediate completion is assumed.
|
|
1284
|
+
* @param mParameters Definitions of the preconditions to be checked before execution
|
|
1285
|
+
* @param mParameters.busy Defines the busy indicator
|
|
1286
|
+
* @param mParameters.busy.set Triggers a busy indicator when the function is executed.
|
|
1287
|
+
* @param mParameters.busy.check Executes function only if application isn't busy.
|
|
1288
|
+
* @param mParameters.updatesDocument This operation updates the current document without using the bound model and context. As a result, the draft status is updated if a draft document exists, and the user has to confirm the cancellation of the editing process.
|
|
1289
|
+
* @returns A promise that is rejected if the execution is prohibited and resolved by the promise returned by the fnFunction.
|
|
1282
1290
|
* @alias sap.fe.core.controllerextensions.EditFlow#securedExecution
|
|
1283
1291
|
* @public
|
|
1284
1292
|
* @experimental As of version 1.90.0
|
|
@@ -1339,7 +1347,7 @@ class EditFlow extends ControllerExtension {
|
|
|
1339
1347
|
if (bBusySet) {
|
|
1340
1348
|
BusyLocker.unlock(oLockObject);
|
|
1341
1349
|
}
|
|
1342
|
-
|
|
1350
|
+
this._getMessageHandler().showMessageDialog();
|
|
1343
1351
|
});
|
|
1344
1352
|
}
|
|
1345
1353
|
|
|
@@ -1353,8 +1361,8 @@ class EditFlow extends ControllerExtension {
|
|
|
1353
1361
|
if (!(this.base.getView()?.getBindingContext("internal") as InternalModelContext)?.getProperty("skipPatchHandlers")) {
|
|
1354
1362
|
// Create a promise that will be resolved or rejected when the path is completed
|
|
1355
1363
|
const oPatchPromise = new Promise<void>((resolve, reject) => {
|
|
1356
|
-
oEvent.getSource().attachEventOnce("patchCompleted", (
|
|
1357
|
-
const bSuccess =
|
|
1364
|
+
oEvent.getSource().attachEventOnce("patchCompleted", (patchCompletedEvent: any) => {
|
|
1365
|
+
const bSuccess = patchCompletedEvent.getParameter("success");
|
|
1358
1366
|
if (bSuccess) {
|
|
1359
1367
|
resolve();
|
|
1360
1368
|
} else {
|
|
@@ -1455,7 +1463,6 @@ class EditFlow extends ControllerExtension {
|
|
|
1455
1463
|
* @function
|
|
1456
1464
|
* @name _createActionPromise
|
|
1457
1465
|
* @memberof sap.fe.core.controllerextensions.EditFlow
|
|
1458
|
-
*
|
|
1459
1466
|
* @returns {Function} The resolver function which can be used to externally resolve the promise
|
|
1460
1467
|
*/
|
|
1461
1468
|
|
|
@@ -1480,7 +1487,7 @@ class EditFlow extends ControllerExtension {
|
|
|
1480
1487
|
send(this.getView(), action, content);
|
|
1481
1488
|
}
|
|
1482
1489
|
|
|
1483
|
-
_triggerConfiguredSurvey(sActionName: string, triggerType:
|
|
1490
|
+
_triggerConfiguredSurvey(sActionName: string, triggerType: TriggerType) {
|
|
1484
1491
|
triggerConfiguredSurvey(this.getView(), sActionName, triggerType);
|
|
1485
1492
|
}
|
|
1486
1493
|
|
|
@@ -1488,9 +1495,9 @@ class EditFlow extends ControllerExtension {
|
|
|
1488
1495
|
* @function
|
|
1489
1496
|
* @name _getActionResponseDataAndKeys
|
|
1490
1497
|
* @memberof sap.fe.core.controllerextensions.EditFlow
|
|
1491
|
-
* @param
|
|
1492
|
-
* @param
|
|
1493
|
-
* @returns
|
|
1498
|
+
* @param sActionName The name of the action that is executed
|
|
1499
|
+
* @param oResponse The bound action's response data or response context
|
|
1500
|
+
* @returns Object with data and names of the key fields of the response
|
|
1494
1501
|
*/
|
|
1495
1502
|
_getActionResponseDataAndKeys(sActionName: string, oResponse: object) {
|
|
1496
1503
|
return (this.base.getView().getController() as PageController)._editFlow.getActionResponseDataAndKeys(sActionName, oResponse);
|
|
@@ -1580,7 +1587,7 @@ class EditFlow extends ControllerExtension {
|
|
|
1580
1587
|
}
|
|
1581
1588
|
|
|
1582
1589
|
_getBoundContext(view: any, params: any) {
|
|
1583
|
-
const viewLevel =
|
|
1590
|
+
const viewLevel = view.getViewData().viewLevel;
|
|
1584
1591
|
const bRefreshAfterAction = viewLevel > 1 || (viewLevel === 1 && params.controlId);
|
|
1585
1592
|
return !params.isNavigable || !!bRefreshAfterAction;
|
|
1586
1593
|
}
|
|
@@ -1624,9 +1631,9 @@ class EditFlow extends ControllerExtension {
|
|
|
1624
1631
|
* @function
|
|
1625
1632
|
* @name _refreshListIfRequired
|
|
1626
1633
|
* @memberof sap.fe.core.controllerextensions.EditFlow
|
|
1627
|
-
* @param
|
|
1628
|
-
* @param
|
|
1629
|
-
* @returns
|
|
1634
|
+
* @param oResponse The response of the bound action and the names of the key fields
|
|
1635
|
+
* @param oContext The bound context on which the action was executed
|
|
1636
|
+
* @returns Always resolves to param oResponse
|
|
1630
1637
|
*/
|
|
1631
1638
|
_refreshListIfRequired(oResponse: any, oContext: Context) {
|
|
1632
1639
|
if (!oContext || !oResponse || !oResponse.oData) {
|
|
@@ -1736,7 +1743,7 @@ class EditFlow extends ControllerExtension {
|
|
|
1736
1743
|
.getMetaContext(oActionBindingContext.getPath())
|
|
1737
1744
|
.getObject("$Type") === sOverloadEntityType
|
|
1738
1745
|
) {
|
|
1739
|
-
throw "context found - stop actions loop";
|
|
1746
|
+
throw new Error("context found - stop actions loop");
|
|
1740
1747
|
}
|
|
1741
1748
|
});
|
|
1742
1749
|
return undefined;
|
|
@@ -1750,7 +1757,7 @@ class EditFlow extends ControllerExtension {
|
|
|
1750
1757
|
try {
|
|
1751
1758
|
aSubSections.forEach(function (oSubSection: any) {
|
|
1752
1759
|
if (oActionBindingContext) {
|
|
1753
|
-
throw "context found - stop SubSections loop";
|
|
1760
|
+
throw new Error("context found - stop SubSections loop");
|
|
1754
1761
|
}
|
|
1755
1762
|
if (oSubSection.getBindingContext() === null) {
|
|
1756
1763
|
oSubSection.setBindingContext(undefined);
|
|
@@ -1786,7 +1793,7 @@ class EditFlow extends ControllerExtension {
|
|
|
1786
1793
|
}
|
|
1787
1794
|
}
|
|
1788
1795
|
|
|
1789
|
-
_createSiblingInfo(currentContext:
|
|
1796
|
+
_createSiblingInfo(currentContext: V4Context, newContext: V4Context): SiblingInformation {
|
|
1790
1797
|
return {
|
|
1791
1798
|
targetContext: newContext,
|
|
1792
1799
|
pathMapping: [
|
|
@@ -1810,21 +1817,22 @@ class EditFlow extends ControllerExtension {
|
|
|
1810
1817
|
}
|
|
1811
1818
|
|
|
1812
1819
|
/**
|
|
1813
|
-
* This methods creates a sibling context for a
|
|
1820
|
+
* This methods creates a sibling context for a subobject page, and calculates a sibling path for
|
|
1814
1821
|
* all intermediates paths between the OP and the sub-OP.
|
|
1815
1822
|
*
|
|
1816
|
-
* @param
|
|
1817
|
-
* @param
|
|
1818
|
-
* @param
|
|
1819
|
-
* @param
|
|
1820
|
-
* @returns
|
|
1823
|
+
* @param rootCurrentContext The context for the root of the draft
|
|
1824
|
+
* @param rightmostCurrentContext The context of the subobject
|
|
1825
|
+
* @param sProgrammingModel The programming model
|
|
1826
|
+
* @param doNotComputeIfRoot If true, we don't compute siblingInfo if the root and the rightmost contexts are the same
|
|
1827
|
+
* @returns Returns the siblingInformation object
|
|
1821
1828
|
*/
|
|
1822
1829
|
async _computeSiblingInformation(
|
|
1823
|
-
rootCurrentContext:
|
|
1824
|
-
rightmostCurrentContext:
|
|
1830
|
+
rootCurrentContext: V4Context,
|
|
1831
|
+
rightmostCurrentContext: V4Context | null | undefined,
|
|
1825
1832
|
sProgrammingModel: string,
|
|
1826
1833
|
doNotComputeIfRoot: boolean
|
|
1827
1834
|
): Promise<SiblingInformation | undefined> {
|
|
1835
|
+
rightmostCurrentContext = rightmostCurrentContext ?? rootCurrentContext;
|
|
1828
1836
|
if (!rightmostCurrentContext.getPath().startsWith(rootCurrentContext.getPath())) {
|
|
1829
1837
|
// Wrong usage !!
|
|
1830
1838
|
Log.error("Cannot compute rightmost sibling context");
|
|
@@ -1841,7 +1849,7 @@ class EditFlow extends ControllerExtension {
|
|
|
1841
1849
|
// If not in draft mode, we just recreate a context from the path of the rightmost context
|
|
1842
1850
|
// No path mapping is needed
|
|
1843
1851
|
return {
|
|
1844
|
-
targetContext: model.bindContext(rightmostCurrentContext.getPath()).getBoundContext()
|
|
1852
|
+
targetContext: model.bindContext(rightmostCurrentContext.getPath()).getBoundContext(),
|
|
1845
1853
|
pathMapping: []
|
|
1846
1854
|
};
|
|
1847
1855
|
}
|