@sapui5/sap.fe.core 1.102.0 → 1.103.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 +5 -5
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AppComponent.js +62 -26
- package/src/sap/fe/core/AppComponent.ts +56 -40
- package/src/sap/fe/core/AppStateHandler.js +10 -10
- package/src/sap/fe/core/AppStateHandler.ts +9 -9
- 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 +236 -109
- package/src/sap/fe/core/CommonUtils.ts +252 -136
- 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/BuildingBlockRuntime.js +8 -8
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +11 -10
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +27 -27
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +28 -26
- package/src/sap/fe/core/controllerextensions/EditFlow.js +129 -118
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +154 -141
- 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 +31 -26
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +34 -35
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +70 -70
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +77 -77
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +84 -78
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +105 -101
- 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 +8 -8
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +19 -26
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +20 -12
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +29 -14
- package/src/sap/fe/core/controllerextensions/PageReady.js +97 -25
- package/src/sap/fe/core/controllerextensions/PageReady.ts +94 -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 +22 -22
- package/src/sap/fe/core/controllerextensions/Share.ts +30 -29
- 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 +65 -62
- package/src/sap/fe/core/controllerextensions/ViewState.ts +68 -63
- 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 +6 -6
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.ts +12 -17
- 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 +184 -137
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +253 -206
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +113 -121
- package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +148 -158
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js +198 -148
- package/src/sap/fe/core/controllerextensions/editFlow/operations.ts +223 -159
- 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 +78 -44
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +90 -60
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +52 -55
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +55 -58
- 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 +2 -2
- package/src/sap/fe/core/controls/FileWrapper.ts +11 -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 +47 -47
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +52 -52
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +8 -2
- 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 +51 -60
- package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +14 -14
- 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 +50 -32
- package/src/sap/fe/core/converters/MetaModelConverter.ts +145 -127
- 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 +54 -34
- package/src/sap/fe/core/converters/annotations/DataField.ts +97 -75
- 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 +23 -26
- 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 +28 -28
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +40 -36
- package/src/sap/fe/core/converters/controls/Common/Form.js +25 -27
- package/src/sap/fe/core/converters/controls/Common/Form.ts +37 -45
- package/src/sap/fe/core/converters/controls/Common/KPI.js +11 -11
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +35 -39
- package/src/sap/fe/core/converters/controls/Common/Table.js +174 -183
- package/src/sap/fe/core/converters/controls/Common/Table.ts +237 -250
- 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 +64 -57
- 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 +73 -72
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +98 -96
- package/src/sap/fe/core/converters/helpers/Aggregation.js +2 -4
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +10 -13
- 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 +46 -46
- package/src/sap/fe/core/converters/helpers/ID.ts +25 -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 -4
- 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 +30 -29
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +40 -40
- 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 +89 -0
- package/src/sap/fe/core/formatters/StandardFormatter.ts +64 -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 +1809 -0
- package/src/sap/fe/core/helpers/{BindingExpression.ts → BindingToolkit.ts} +365 -264
- package/src/sap/fe/core/helpers/ClassSupport.js +20 -11
- package/src/sap/fe/core/helpers/ClassSupport.ts +14 -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 +281 -254
- package/src/sap/fe/core/helpers/MassEditHelper.ts +337 -289
- 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/jsx-runtime/jsx.js +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx.ts +8 -8
- 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 +49 -35
- package/src/sap/fe/core/messagebundle_ar.properties +13 -5
- package/src/sap/fe/core/messagebundle_bg.properties +13 -5
- package/src/sap/fe/core/messagebundle_ca.properties +13 -5
- package/src/sap/fe/core/messagebundle_cs.properties +13 -5
- package/src/sap/fe/core/messagebundle_cy.properties +14 -6
- package/src/sap/fe/core/messagebundle_da.properties +13 -5
- package/src/sap/fe/core/messagebundle_de.properties +15 -7
- package/src/sap/fe/core/messagebundle_el.properties +14 -6
- package/src/sap/fe/core/messagebundle_en.properties +9 -1
- package/src/sap/fe/core/messagebundle_en_GB.properties +11 -3
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +7 -1
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +9 -1
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +44 -85
- package/src/sap/fe/core/messagebundle_es.properties +13 -5
- package/src/sap/fe/core/messagebundle_es_MX.properties +13 -5
- package/src/sap/fe/core/messagebundle_et.properties +13 -5
- package/src/sap/fe/core/messagebundle_fi.properties +14 -6
- package/src/sap/fe/core/messagebundle_fr.properties +14 -6
- package/src/sap/fe/core/messagebundle_fr_CA.properties +14 -6
- package/src/sap/fe/core/messagebundle_hi.properties +14 -6
- package/src/sap/fe/core/messagebundle_hr.properties +14 -6
- package/src/sap/fe/core/messagebundle_hu.properties +13 -5
- package/src/sap/fe/core/messagebundle_id.properties +13 -5
- package/src/sap/fe/core/messagebundle_it.properties +33 -25
- package/src/sap/fe/core/messagebundle_iw.properties +13 -5
- package/src/sap/fe/core/messagebundle_ja.properties +14 -6
- package/src/sap/fe/core/messagebundle_kk.properties +13 -5
- package/src/sap/fe/core/messagebundle_ko.properties +13 -5
- package/src/sap/fe/core/messagebundle_lt.properties +13 -5
- package/src/sap/fe/core/messagebundle_lv.properties +14 -6
- package/src/sap/fe/core/messagebundle_ms.properties +13 -5
- package/src/sap/fe/core/messagebundle_nl.properties +13 -5
- package/src/sap/fe/core/messagebundle_no.properties +13 -5
- package/src/sap/fe/core/messagebundle_pl.properties +13 -5
- package/src/sap/fe/core/messagebundle_pt.properties +13 -5
- package/src/sap/fe/core/messagebundle_pt_PT.properties +14 -6
- package/src/sap/fe/core/messagebundle_ro.properties +13 -5
- package/src/sap/fe/core/messagebundle_ru.properties +13 -5
- package/src/sap/fe/core/messagebundle_sh.properties +13 -5
- package/src/sap/fe/core/messagebundle_sk.properties +13 -5
- package/src/sap/fe/core/messagebundle_sl.properties +17 -9
- package/src/sap/fe/core/messagebundle_sv.properties +14 -6
- package/src/sap/fe/core/messagebundle_th.properties +13 -5
- package/src/sap/fe/core/messagebundle_tr.properties +13 -5
- package/src/sap/fe/core/messagebundle_uk.properties +13 -5
- package/src/sap/fe/core/messagebundle_vi.properties +13 -5
- package/src/sap/fe/core/messagebundle_zh_CN.properties +14 -6
- package/src/sap/fe/core/messagebundle_zh_TW.properties +13 -5
- 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 +2 -2
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +14 -14
- 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 +53 -44
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +54 -46
- 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 +72 -76
- package/src/sap/fe/core/services/ShellServicesFactory.ts +76 -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 +20 -15
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +26 -21
- 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 +10 -9
- package/src/sap/fe/core/templating/FilterHelper.ts +13 -13
- 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 +148 -93
- package/src/sap/fe/core/templating/UIFormatters.ts +196 -124
- 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,25 +1,23 @@
|
|
|
1
|
-
import ResourceBundle from "sap/base/i18n/ResourceBundle";
|
|
1
|
+
import type ResourceBundle from "sap/base/i18n/ResourceBundle";
|
|
2
2
|
import Log from "sap/base/Log";
|
|
3
|
-
import AppComponent from "sap/fe/core/AppComponent";
|
|
3
|
+
import type AppComponent from "sap/fe/core/AppComponent";
|
|
4
4
|
import CommonUtils from "sap/fe/core/CommonUtils";
|
|
5
5
|
import ActivitySync from "sap/fe/core/controllerextensions/collaboration/ActivitySync";
|
|
6
6
|
import messageHandling from "sap/fe/core/controllerextensions/messageHandler/messageHandling";
|
|
7
7
|
import DataLossOrDraftDiscardHandler from "sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler";
|
|
8
8
|
import EditState from "sap/fe/core/helpers/EditState";
|
|
9
|
-
import { SideEffectsService } from "sap/fe/core/services/SideEffectsServiceFactory";
|
|
9
|
+
import type { SideEffectsService } from "sap/fe/core/services/SideEffectsServiceFactory";
|
|
10
10
|
import Button from "sap/m/Button";
|
|
11
11
|
import Dialog from "sap/m/Dialog";
|
|
12
12
|
import MessageBox from "sap/m/MessageBox";
|
|
13
13
|
import Text from "sap/m/Text";
|
|
14
14
|
import Core from "sap/ui/core/Core";
|
|
15
|
-
import View from "sap/ui/core/mvc/View";
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import ResourceModel from "sap/ui/model/resource/ResourceModel";
|
|
19
|
-
import { CoreEx } from "types/extension_types";
|
|
15
|
+
import type View from "sap/ui/core/mvc/View";
|
|
16
|
+
import type ResourceModel from "sap/ui/model/resource/ResourceModel";
|
|
17
|
+
import type { CoreEx, V4Context } from "types/extension_types";
|
|
20
18
|
|
|
21
19
|
export type SiblingInformation = {
|
|
22
|
-
targetContext:
|
|
20
|
+
targetContext: V4Context;
|
|
23
21
|
pathMapping: { oldPath: string; newPath: string }[];
|
|
24
22
|
};
|
|
25
23
|
|
|
@@ -36,18 +34,19 @@ export type SiblingInformation = {
|
|
|
36
34
|
|
|
37
35
|
/**
|
|
38
36
|
* Callback to approve or reject the creation of a draft
|
|
37
|
+
*
|
|
39
38
|
* @name sap.fe.core.actions.draft.ICallback.beforeCreateDraftFromActiveDocument
|
|
40
39
|
* @function
|
|
41
40
|
* @static
|
|
42
41
|
* @abstract
|
|
43
42
|
* @param {sap.ui.model.odata.v4.Context} oContext Context of the active document for the new draft
|
|
44
43
|
* @returns {(boolean|Promise)} Approval of draft creation [true|false] or Promise that resolves with the boolean value
|
|
45
|
-
*
|
|
46
44
|
* @private
|
|
47
45
|
*/
|
|
48
46
|
|
|
49
47
|
/**
|
|
50
48
|
* Callback after a draft was successully created
|
|
49
|
+
*
|
|
51
50
|
* @name sap.fe.core.actions.draft.ICallback.afterCreateDraftFromActiveDocument
|
|
52
51
|
* @function
|
|
53
52
|
* @static
|
|
@@ -55,21 +54,19 @@ export type SiblingInformation = {
|
|
|
55
54
|
* @param {sap.ui.model.odata.v4.Context} oContext Context of the new draft
|
|
56
55
|
* @param {sap.ui.model.odata.v4.Context} oActiveDocumentContext Context of the active document for the new draft
|
|
57
56
|
* @returns {sap.ui.model.odata.v4.Context} oActiveDocumentContext
|
|
58
|
-
*
|
|
59
57
|
* @private
|
|
60
58
|
*/
|
|
61
59
|
|
|
62
60
|
/**
|
|
63
61
|
* Callback to approve or reject overwriting an unsaved draft of another user
|
|
62
|
+
*
|
|
64
63
|
* @name sap.fe.core.actions.draft.ICallback.whenDecisionToOverwriteDocumentIsRequired
|
|
65
64
|
* @function
|
|
66
65
|
* @public
|
|
67
66
|
* @static
|
|
68
67
|
* @abstract
|
|
69
|
-
*
|
|
70
68
|
* @param {sap.ui.model.odata.v4.Context} oContext Context of the active document for the new draft
|
|
71
69
|
* @returns {(boolean|Promise)} Approval to overwrite unsaved draft [true|false] or Promise that resolves with the boolean value
|
|
72
|
-
*
|
|
73
70
|
* @ui5-restricted
|
|
74
71
|
*/
|
|
75
72
|
/* Constants for draft operations */
|
|
@@ -97,50 +94,50 @@ enum NavigationType {
|
|
|
97
94
|
/**
|
|
98
95
|
* Determines action name for a draft operation.
|
|
99
96
|
*
|
|
100
|
-
* @param
|
|
101
|
-
* @param
|
|
102
|
-
* @returns
|
|
97
|
+
* @param oContext The context that should be bound to the operation
|
|
98
|
+
* @param sOperation The operation name
|
|
99
|
+
* @returns The name of the draft operation
|
|
103
100
|
*/
|
|
104
|
-
function getActionName(oContext:
|
|
101
|
+
function getActionName(oContext: V4Context, sOperation: string) {
|
|
105
102
|
const oModel = oContext.getModel(),
|
|
106
103
|
oMetaModel = oModel.getMetaModel(),
|
|
107
104
|
sEntitySetPath = oMetaModel.getMetaPath(oContext.getPath());
|
|
108
105
|
|
|
109
|
-
return oMetaModel.getObject(sEntitySetPath
|
|
106
|
+
return oMetaModel.getObject(`${sEntitySetPath}@com.sap.vocabularies.Common.v1.DraftRoot/${sOperation}`);
|
|
110
107
|
}
|
|
111
108
|
/**
|
|
112
109
|
* Creates an operation context binding for the given context and operation.
|
|
113
110
|
*
|
|
114
|
-
* @param
|
|
115
|
-
* @param
|
|
111
|
+
* @param oContext The context that should be bound to the operation
|
|
112
|
+
* @param sOperation The operation (action or function import)
|
|
116
113
|
* @param oOptions Options to create the operation context
|
|
117
|
-
* @returns
|
|
114
|
+
* @returns The context binding of the bound operation
|
|
118
115
|
*/
|
|
119
|
-
function createOperation(oContext:
|
|
116
|
+
function createOperation(oContext: V4Context, sOperation: string, oOptions?: any) {
|
|
120
117
|
const sOperationName = getActionName(oContext, sOperation);
|
|
121
118
|
|
|
122
|
-
return oContext.getModel().bindContext(sOperationName
|
|
119
|
+
return oContext.getModel().bindContext(`${sOperationName}(...)`, oContext, oOptions);
|
|
123
120
|
}
|
|
124
121
|
/**
|
|
125
122
|
* Check if optional draft prepare action exists.
|
|
126
123
|
*
|
|
127
|
-
* @param
|
|
128
|
-
* @returns
|
|
124
|
+
* @param oContext The context that should be bound to the operation
|
|
125
|
+
* @returns True if a a prepare action exists
|
|
129
126
|
*/
|
|
130
|
-
function hasPrepareAction(oContext:
|
|
127
|
+
function hasPrepareAction(oContext: V4Context) {
|
|
131
128
|
return !!getActionName(oContext, draftOperations.PREPARE);
|
|
132
129
|
}
|
|
133
130
|
/**
|
|
134
131
|
* Creates a new draft from an active document.
|
|
135
132
|
*
|
|
136
133
|
* @function
|
|
137
|
-
* @param
|
|
138
|
-
* @param
|
|
139
|
-
* @returns
|
|
134
|
+
* @param oContext Context for which the action should be performed
|
|
135
|
+
* @param bPreserveChanges If true - existing changes from another user that are not locked are preserved and an error message (http status 409) is send from the backend, otherwise false - existing changes from another user that are not locked are overwritten</li>
|
|
136
|
+
* @returns Resolve function returns the context of the operation
|
|
140
137
|
* @private
|
|
141
138
|
* @ui5-restricted
|
|
142
139
|
*/
|
|
143
|
-
function executeDraftEditAction(oContext:
|
|
140
|
+
function executeDraftEditAction(oContext: V4Context, bPreserveChanges: boolean): Promise<V4Context> {
|
|
144
141
|
if (oContext.getProperty("IsActiveEntity")) {
|
|
145
142
|
const oOptions = { $$inheritExpandSelect: true };
|
|
146
143
|
const oOperation = createOperation(oContext, draftOperations.EDIT, oOptions);
|
|
@@ -170,14 +167,14 @@ function executeDraftEditAction(oContext: any, bPreserveChanges: boolean) {
|
|
|
170
167
|
* Activates a draft document. The draft will replace the sibling entity and will be deleted by the back end.
|
|
171
168
|
*
|
|
172
169
|
* @function
|
|
173
|
-
* @param
|
|
174
|
-
* @param
|
|
175
|
-
* @param
|
|
176
|
-
* @returns
|
|
170
|
+
* @param oContext Context for which the action should be performed
|
|
171
|
+
* @param oAppComponent The AppComponent
|
|
172
|
+
* @param [sGroupId] The optional batch group in which the operation is to be executed
|
|
173
|
+
* @returns Resolve function returns the context of the operation
|
|
177
174
|
* @private
|
|
178
175
|
* @ui5-restricted
|
|
179
176
|
*/
|
|
180
|
-
function executeDraftActivationAction(oContext:
|
|
177
|
+
function executeDraftActivationAction(oContext: V4Context, oAppComponent: AppComponent, sGroupId?: string): Promise<V4Context> {
|
|
181
178
|
const bHasPrepareAction = hasPrepareAction(oContext);
|
|
182
179
|
|
|
183
180
|
// According to the draft spec if the service contains a prepare action and we trigger both prepare and
|
|
@@ -202,9 +199,9 @@ function executeDraftActivationAction(oContext: any, oAppComponent: AppComponent
|
|
|
202
199
|
//if ACTIVATE action fails then we request either the sideEffects against PREPARE action (if annotated) or the messages as fallback:
|
|
203
200
|
function () {
|
|
204
201
|
if (bHasPrepareAction) {
|
|
205
|
-
const
|
|
202
|
+
const actionName = getActionName(oContext, draftOperations.PREPARE),
|
|
206
203
|
oSideEffectsService = oAppComponent.getSideEffectsService(),
|
|
207
|
-
oBindingParameters = oSideEffectsService.getODataActionSideEffects(
|
|
204
|
+
oBindingParameters = oSideEffectsService.getODataActionSideEffects(actionName, oContext),
|
|
208
205
|
aTargetPaths = oBindingParameters && oBindingParameters.pathExpressions;
|
|
209
206
|
if (aTargetPaths && aTargetPaths.length > 0) {
|
|
210
207
|
oSideEffectsService.requestSideEffects(aTargetPaths, oContext).catch(function (oError: any) {
|
|
@@ -227,13 +224,13 @@ function executeDraftActivationAction(oContext: any, oAppComponent: AppComponent
|
|
|
227
224
|
* Execute a preparation action.
|
|
228
225
|
*
|
|
229
226
|
* @function
|
|
230
|
-
* @param
|
|
231
|
-
* @param
|
|
232
|
-
* @returns
|
|
227
|
+
* @param oContext Context for which the action should be performed
|
|
228
|
+
* @param groupId The optional batch group in which we want to execute the operation
|
|
229
|
+
* @returns Resolve function returns the context of the operation
|
|
233
230
|
* @private
|
|
234
231
|
* @ui5-restricted
|
|
235
232
|
*/
|
|
236
|
-
function executeDraftPreparationAction(oContext:
|
|
233
|
+
function executeDraftPreparationAction(oContext: V4Context, groupId?: string) {
|
|
237
234
|
if (!oContext.getProperty("IsActiveEntity")) {
|
|
238
235
|
const oOperation = createOperation(oContext, draftOperations.PREPARE);
|
|
239
236
|
|
|
@@ -257,28 +254,28 @@ function executeDraftPreparationAction(oContext: Context, groupId?: string) {
|
|
|
257
254
|
* Determines the message path for a context.
|
|
258
255
|
*
|
|
259
256
|
* @function
|
|
260
|
-
* @param
|
|
261
|
-
* @returns
|
|
257
|
+
* @param oContext Context for which the path shall be determined
|
|
258
|
+
* @returns Message path, empty if not annotated
|
|
262
259
|
* @private
|
|
263
260
|
* @ui5-restricted
|
|
264
261
|
*/
|
|
265
|
-
function getMessagesPath(oContext:
|
|
262
|
+
function getMessagesPath(oContext: V4Context): string {
|
|
266
263
|
const oModel = oContext.getModel(),
|
|
267
|
-
oMetaModel = oModel.getMetaModel()
|
|
264
|
+
oMetaModel = oModel.getMetaModel(),
|
|
268
265
|
sEntitySetPath = oMetaModel.getMetaPath(oContext.getPath());
|
|
269
|
-
return oMetaModel.getObject(sEntitySetPath
|
|
266
|
+
return oMetaModel.getObject(`${sEntitySetPath}/@com.sap.vocabularies.Common.v1.Messages/$Path`);
|
|
270
267
|
}
|
|
271
268
|
/**
|
|
272
269
|
* Requests the messages if annotated for a given context.
|
|
273
270
|
*
|
|
274
271
|
* @function
|
|
275
|
-
* @param
|
|
276
|
-
* @param
|
|
277
|
-
* @returns
|
|
272
|
+
* @param oContext Context for which the messages shall be requested
|
|
273
|
+
* @param oSideEffectsService Service for the SideEffects on SAP Fiori elements
|
|
274
|
+
* @returns Promise which is resolved once messages were requested
|
|
278
275
|
* @private
|
|
279
276
|
* @ui5-restricted
|
|
280
277
|
*/
|
|
281
|
-
function requestMessages(oContext:
|
|
278
|
+
function requestMessages(oContext: V4Context, oSideEffectsService: SideEffectsService) {
|
|
282
279
|
const sMessagesPath = getMessagesPath(oContext);
|
|
283
280
|
if (sMessagesPath) {
|
|
284
281
|
return oSideEffectsService.requestSideEffects([{ $PropertyPath: sMessagesPath }] as any, oContext);
|
|
@@ -289,12 +286,12 @@ function requestMessages(oContext: any, oSideEffectsService: SideEffectsService)
|
|
|
289
286
|
* Executes discard of a draft function using HTTP Post.
|
|
290
287
|
*
|
|
291
288
|
* @function
|
|
292
|
-
* @param
|
|
293
|
-
* @returns
|
|
289
|
+
* @param oContext Context for which the action should be performed
|
|
290
|
+
* @returns Resolve function returns the context of the operation
|
|
294
291
|
* @private
|
|
295
292
|
* @ui5-restricted
|
|
296
293
|
*/
|
|
297
|
-
function executeDraftDiscardAction(oContext:
|
|
294
|
+
function executeDraftDiscardAction(oContext: V4Context): Promise<boolean> {
|
|
298
295
|
if (!oContext.getProperty("IsActiveEntity")) {
|
|
299
296
|
const oDiscardOperation = createOperation(oContext, draftOperations.DISCARD);
|
|
300
297
|
const localI18nRef = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core");
|
|
@@ -318,13 +315,13 @@ function executeDraftDiscardAction(oContext: any): Promise<boolean> {
|
|
|
318
315
|
* This method creates a sibling context for a subobject page and calculates a sibling path for all intermediate paths
|
|
319
316
|
* between the object page and the subobject page.
|
|
320
317
|
*
|
|
321
|
-
* @param
|
|
322
|
-
* @param
|
|
323
|
-
* @returns
|
|
318
|
+
* @param rootCurrentContext The context for the root of the draft
|
|
319
|
+
* @param rightmostCurrentContext The context of the subobject page
|
|
320
|
+
* @returns The siblingInformation object
|
|
324
321
|
*/
|
|
325
322
|
async function computeSiblingInformation(
|
|
326
|
-
rootCurrentContext:
|
|
327
|
-
rightmostCurrentContext:
|
|
323
|
+
rootCurrentContext: V4Context,
|
|
324
|
+
rightmostCurrentContext: V4Context
|
|
328
325
|
): Promise<SiblingInformation | undefined> {
|
|
329
326
|
if (!rightmostCurrentContext.getPath().startsWith(rootCurrentContext.getPath())) {
|
|
330
327
|
// Wrong usage !!
|
|
@@ -355,7 +352,7 @@ async function computeSiblingInformation(
|
|
|
355
352
|
const canonicalPathPromises = segments.map((segment) => {
|
|
356
353
|
currentPath += `/${segment}`;
|
|
357
354
|
oldPaths.unshift(currentPath);
|
|
358
|
-
const siblingContext = model.bindContext(currentPath
|
|
355
|
+
const siblingContext = model.bindContext(`${currentPath}/SiblingEntity`).getBoundContext();
|
|
359
356
|
return siblingContext.requestCanonicalPath();
|
|
360
357
|
});
|
|
361
358
|
|
|
@@ -377,7 +374,7 @@ async function computeSiblingInformation(
|
|
|
377
374
|
});
|
|
378
375
|
|
|
379
376
|
return {
|
|
380
|
-
targetContext: model.bindContext(siblingPath).getBoundContext()
|
|
377
|
+
targetContext: model.bindContext(siblingPath).getBoundContext(), // Create the rightmost sibling context from its path
|
|
381
378
|
pathMapping: oldPaths.map((oldPath, index) => {
|
|
382
379
|
return {
|
|
383
380
|
oldPath,
|
|
@@ -400,15 +397,15 @@ async function computeSiblingInformation(
|
|
|
400
397
|
* @name sap.fe.core.actions.draft#createDraftFromActiveDocument
|
|
401
398
|
* @memberof sap.fe.core.actions.draft
|
|
402
399
|
* @static
|
|
403
|
-
* @param
|
|
404
|
-
* @param
|
|
405
|
-
* @param
|
|
406
|
-
* @param
|
|
407
|
-
* @param
|
|
408
|
-
* @param
|
|
409
|
-
* @param
|
|
410
|
-
* @param
|
|
411
|
-
* @returns
|
|
400
|
+
* @param oContext Context of the active document for the new draft
|
|
401
|
+
* @param oAppComponent The AppComponent
|
|
402
|
+
* @param mParameters The parameters
|
|
403
|
+
* @param [mParameters.oView] The view
|
|
404
|
+
* @param [mParameters.bPreserveChanges] Preserve changes of an existing draft of another user
|
|
405
|
+
* @param [mParameters.fnBeforeCreateDraftFromActiveDocument] Callback that allows veto before create request is executed
|
|
406
|
+
* @param [mParameters.fnAfterCreateDraftFromActiveDocument] Callback for postprocessiong after draft document was created
|
|
407
|
+
* @param [mParameters.fnWhenDecisionToOverwriteDocumentIsRequired] Callback for deciding on overwriting an unsaved change by another user
|
|
408
|
+
* @returns Promise resolves with the {@link sap.ui.model.odata.v4.Context context} of the new draft document
|
|
412
409
|
* @private
|
|
413
410
|
* @ui5-restricted
|
|
414
411
|
*/
|
|
@@ -431,14 +428,14 @@ async function createDraftFromActiveDocument(
|
|
|
431
428
|
/**
|
|
432
429
|
* Overwrite or reject based on fnWhenDecisionToOverwriteDocumentIsRequired.
|
|
433
430
|
*
|
|
434
|
-
* @param
|
|
435
|
-
* @returns
|
|
431
|
+
* @param bOverwrite Overwrite the change or not
|
|
432
|
+
* @returns Resolves with result of {@link sap.fe.core.actions#executeDraftEditAction}
|
|
436
433
|
*/
|
|
437
|
-
function overwriteOnDemand(bOverwrite:
|
|
434
|
+
function overwriteOnDemand(bOverwrite: boolean) {
|
|
438
435
|
if (bOverwrite) {
|
|
439
436
|
//Overwrite existing changes
|
|
440
437
|
const oModel = oContext.getModel();
|
|
441
|
-
const draftDataContext = oModel.bindContext(oContext.getPath()
|
|
438
|
+
const draftDataContext = oModel.bindContext(`${oContext.getPath()}/DraftAdministrativeData`).getBoundContext();
|
|
442
439
|
let oResourceBundle: ResourceBundle;
|
|
443
440
|
|
|
444
441
|
return ((mParameters.oView.getModel("sap.fe.i18n") as ResourceModel).getResourceBundle() as Promise<ResourceBundle>)
|
|
@@ -476,7 +473,7 @@ async function createDraftFromActiveDocument(
|
|
|
476
473
|
}
|
|
477
474
|
});
|
|
478
475
|
}
|
|
479
|
-
return Promise.reject(new Error(
|
|
476
|
+
return Promise.reject(new Error(`Draft creation aborted for document: ${oContext.getPath()}`));
|
|
480
477
|
}
|
|
481
478
|
|
|
482
479
|
function showMessageBox(sUnsavedChangesMsg: any) {
|
|
@@ -499,7 +496,7 @@ async function createDraftFromActiveDocument(
|
|
|
499
496
|
text: localI18nRef.getText("C_COMMON_OBJECT_PAGE_CANCEL"),
|
|
500
497
|
press: function () {
|
|
501
498
|
oDialog.close();
|
|
502
|
-
reject(
|
|
499
|
+
reject(`Draft creation aborted for document: ${oContext.getPath()}`);
|
|
503
500
|
}
|
|
504
501
|
}),
|
|
505
502
|
afterClose: function () {
|
|
@@ -520,16 +517,17 @@ async function createDraftFromActiveDocument(
|
|
|
520
517
|
: true;
|
|
521
518
|
|
|
522
519
|
if (!bExecute) {
|
|
523
|
-
throw new Error(
|
|
520
|
+
throw new Error(`Draft creation was aborted by extension for document: ${oContext.getPath()}`);
|
|
524
521
|
}
|
|
525
522
|
let openingSiblingContext = false;
|
|
526
523
|
try {
|
|
527
|
-
let oDraftContext:
|
|
524
|
+
let oDraftContext: V4Context | undefined;
|
|
528
525
|
try {
|
|
529
526
|
oDraftContext = await draft.executeDraftEditAction(oContext, bRunPreserveChangesFlow);
|
|
530
527
|
} catch (oResponse: any) {
|
|
531
528
|
//Only call back if error 409
|
|
532
529
|
if (bRunPreserveChangesFlow && oResponse.status === 409) {
|
|
530
|
+
messageHandling.removeBoundTransitionMessages();
|
|
533
531
|
messageHandling.removeUnboundTransitionMessages();
|
|
534
532
|
if (ActivitySync.isCollaborationEnabled(mParameters.oView)) {
|
|
535
533
|
const siblingInfo = await draft.computeSiblingInformation(oContext, oContext);
|
|
@@ -544,10 +542,8 @@ async function createDraftFromActiveDocument(
|
|
|
544
542
|
mParam.fnWhenDecisionToOverwriteDocumentIsRequired ? mParam.fnWhenDecisionToOverwriteDocumentIsRequired() : true
|
|
545
543
|
);
|
|
546
544
|
}
|
|
547
|
-
} else {
|
|
548
|
-
|
|
549
|
-
throw new Error(oResponse);
|
|
550
|
-
}
|
|
545
|
+
} else if (!(oResponse && oResponse.canceled)) {
|
|
546
|
+
throw new Error(oResponse);
|
|
551
547
|
}
|
|
552
548
|
}
|
|
553
549
|
if (openingSiblingContext) {
|
|
@@ -583,17 +579,17 @@ async function createDraftFromActiveDocument(
|
|
|
583
579
|
* @name sap.fe.core.actions.draft#activateDocument
|
|
584
580
|
* @memberof sap.fe.core.actions.draft
|
|
585
581
|
* @static
|
|
586
|
-
* @param
|
|
587
|
-
* @param
|
|
588
|
-
* @param
|
|
589
|
-
* @param
|
|
590
|
-
* @param
|
|
591
|
-
* @returns
|
|
582
|
+
* @param oContext Context of the active document for the new draft
|
|
583
|
+
* @param oAppComponent The AppComponent
|
|
584
|
+
* @param mParameters The parameters
|
|
585
|
+
* @param [mParameters.fnBeforeActivateDocument] Callback that allows veto before create request is executed
|
|
586
|
+
* @param [mParameters.fnAfterActivateDocument] Callback for postprocessiong after document was activated.
|
|
587
|
+
* @returns Promise resolves with the {@link sap.ui.model.odata.v4.Context context} of the new draft document
|
|
592
588
|
* @private
|
|
593
589
|
* @ui5-restricted
|
|
594
590
|
*/
|
|
595
591
|
function activateDocument(
|
|
596
|
-
oContext:
|
|
592
|
+
oContext: V4Context,
|
|
597
593
|
oAppComponent: AppComponent,
|
|
598
594
|
mParameters: { fnBeforeActivateDocument?: any; fnAfterActivateDocument?: any }
|
|
599
595
|
) {
|
|
@@ -605,7 +601,7 @@ function activateDocument(
|
|
|
605
601
|
return Promise.resolve(mParam.fnBeforeActivateDocument ? mParam.fnBeforeActivateDocument(oContext) : true)
|
|
606
602
|
.then(function (bExecute: any) {
|
|
607
603
|
if (!bExecute) {
|
|
608
|
-
return Promise.reject(new Error(
|
|
604
|
+
return Promise.reject(new Error(`Activation of the document was aborted by extension for document: ${oContext.getPath()}`));
|
|
609
605
|
}
|
|
610
606
|
|
|
611
607
|
if (!hasPrepareAction(oContext)) {
|
|
@@ -645,12 +641,12 @@ function activateDocument(
|
|
|
645
641
|
* @name sap.fe.core.actions.draft#deleteDraft
|
|
646
642
|
* @memberof sap.fe.core.actions.draft
|
|
647
643
|
* @static
|
|
648
|
-
* @param
|
|
644
|
+
* @param oContext Context of the document to be discarded
|
|
649
645
|
* @private
|
|
650
|
-
* @returns
|
|
646
|
+
* @returns A Promise resolved when the context is deleted
|
|
651
647
|
* @ui5-restricted
|
|
652
648
|
*/
|
|
653
|
-
function deleteDraft(oContext:
|
|
649
|
+
function deleteDraft(oContext: V4Context): Promise<boolean> {
|
|
654
650
|
const sDiscardAction = getActionName(oContext, draftOperations.DISCARD),
|
|
655
651
|
bIsActiveEntity = oContext.getObject().IsActiveEntity;
|
|
656
652
|
|
|
@@ -692,7 +688,7 @@ function processDataLossOrDraftDiscardConfirmation(
|
|
|
692
688
|
navigationType: NavigationType = NavigationType.BackNavigation
|
|
693
689
|
) {
|
|
694
690
|
const oModel = oContext.getModel();
|
|
695
|
-
const draftDataContext = oModel.bindContext(oContext.getPath()
|
|
691
|
+
const draftDataContext = oModel.bindContext(`${oContext.getPath()}/DraftAdministrativeData`).getBoundContext();
|
|
696
692
|
|
|
697
693
|
const collaborationConnected = ActivitySync.isConnected(oController.getView());
|
|
698
694
|
const processFunctionForDrafts = !collaborationConnected
|
|
@@ -727,74 +723,68 @@ function processDataLossOrDraftDiscardConfirmation(
|
|
|
727
723
|
} else {
|
|
728
724
|
processFunctionForDrafts();
|
|
729
725
|
}
|
|
730
|
-
} else {
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
);
|
|
745
|
-
} else {
|
|
746
|
-
// We are editing a draft which has been created earlier but never saved to active
|
|
747
|
-
// version and since the edit state is not dirty, there have been no user changes
|
|
748
|
-
// so in this case we want to silently navigate and do nothing
|
|
749
|
-
processFunctionForDrafts();
|
|
750
|
-
}
|
|
726
|
+
} else if (!oContext.getObject().HasActiveEntity) {
|
|
727
|
+
// There is no active entity so we are editing either newly created data or
|
|
728
|
+
// a draft which has never been saved to active version
|
|
729
|
+
// Since we want to react differently in the two situations, we have to check the
|
|
730
|
+
// dirty state
|
|
731
|
+
if (EditState.isEditStateDirty()) {
|
|
732
|
+
// In this case data is being newly created and then we always want to
|
|
733
|
+
// show the dataloss dialog on navigation
|
|
734
|
+
DataLossOrDraftDiscardHandler.performAfterDiscardorKeepDraft(
|
|
735
|
+
processFunctionForDrafts,
|
|
736
|
+
fnCancelFunction,
|
|
737
|
+
oController,
|
|
738
|
+
bSkipBindingToView
|
|
739
|
+
);
|
|
751
740
|
} else {
|
|
752
|
-
// We are editing a draft
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
} else {
|
|
773
|
-
// In case of a forward navigation we silently keep the draft and only
|
|
774
|
-
// execute the followup function.
|
|
775
|
-
processFunctionForDrafts();
|
|
776
|
-
}
|
|
777
|
-
} else {
|
|
778
|
-
// The CreationDateTime and LastChangeDateTime are NOT equal, so we are currently editing
|
|
779
|
-
// an existing draft and need to distinguish depending on if any changes
|
|
780
|
-
// have been made in the current editing session or not
|
|
781
|
-
if (EditState.isEditStateDirty()) {
|
|
782
|
-
// Changes have been made in the current editing session so we want
|
|
783
|
-
// to show the dataloss dialog and let the user decide
|
|
784
|
-
DataLossOrDraftDiscardHandler.performAfterDiscardorKeepDraft(
|
|
785
|
-
processFunctionForDrafts,
|
|
786
|
-
fnCancelFunction,
|
|
787
|
-
oController,
|
|
788
|
-
bSkipBindingToView
|
|
789
|
-
);
|
|
790
|
-
} else {
|
|
791
|
-
// The user started editing the existing draft but did not make any changes
|
|
792
|
-
// in the current editing session, so in this case we do not want
|
|
793
|
-
// to show the dataloss dialog but just keep the draft
|
|
741
|
+
// We are editing a draft which has been created earlier but never saved to active
|
|
742
|
+
// version and since the edit state is not dirty, there have been no user changes
|
|
743
|
+
// so in this case we want to silently navigate and do nothing
|
|
744
|
+
processFunctionForDrafts();
|
|
745
|
+
}
|
|
746
|
+
} else if (draftAdminData.CreationDateTime === draftAdminData.LastChangeDateTime) {
|
|
747
|
+
// We are editing a draft for an existing active entity
|
|
748
|
+
// The CreationDateTime and LastChangeDateTime are equal, so this draft was
|
|
749
|
+
// never saved before, hence we're currently editing a newly created draft for
|
|
750
|
+
// an existing active entity for the first time.
|
|
751
|
+
// Also there have so far been no changes made to the draft and in this
|
|
752
|
+
// case we want to silently navigate and delete the draftin case of a back
|
|
753
|
+
// navigation but in case of a forward navigation we want to silently keep it!
|
|
754
|
+
if (navigationType === NavigationType.BackNavigation) {
|
|
755
|
+
const mParameters = {
|
|
756
|
+
skipDiscardPopover: true
|
|
757
|
+
};
|
|
758
|
+
oController.editFlow
|
|
759
|
+
.cancelDocument(oContext, mParameters)
|
|
760
|
+
.then(() => {
|
|
794
761
|
processFunctionForDrafts();
|
|
795
|
-
}
|
|
796
|
-
|
|
762
|
+
})
|
|
763
|
+
.catch((error: any) => {
|
|
764
|
+
Log.error("Error while canceling the document", error);
|
|
765
|
+
});
|
|
766
|
+
} else {
|
|
767
|
+
// In case of a forward navigation we silently keep the draft and only
|
|
768
|
+
// execute the followup function.
|
|
769
|
+
processFunctionForDrafts();
|
|
797
770
|
}
|
|
771
|
+
} else if (EditState.isEditStateDirty()) {
|
|
772
|
+
// The CreationDateTime and LastChangeDateTime are NOT equal, so we are currently editing
|
|
773
|
+
// an existing draft and need to distinguish depending on if any changes
|
|
774
|
+
// have been made in the current editing session or not
|
|
775
|
+
// Changes have been made in the current editing session so we want
|
|
776
|
+
// to show the dataloss dialog and let the user decide
|
|
777
|
+
DataLossOrDraftDiscardHandler.performAfterDiscardorKeepDraft(
|
|
778
|
+
processFunctionForDrafts,
|
|
779
|
+
fnCancelFunction,
|
|
780
|
+
oController,
|
|
781
|
+
bSkipBindingToView
|
|
782
|
+
);
|
|
783
|
+
} else {
|
|
784
|
+
// The user started editing the existing draft but did not make any changes
|
|
785
|
+
// in the current editing session, so in this case we do not want
|
|
786
|
+
// to show the dataloss dialog but just keep the draft
|
|
787
|
+
processFunctionForDrafts();
|
|
798
788
|
}
|
|
799
789
|
} else {
|
|
800
790
|
fnProcessFunction();
|