@sapui5/sap.fe.core 1.101.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 +66 -30
- package/src/sap/fe/core/AppComponent.ts +68 -51
- package/src/sap/fe/core/AppStateHandler.js +13 -13
- package/src/sap/fe/core/AppStateHandler.ts +18 -18
- 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 +279 -188
- package/src/sap/fe/core/CommonUtils.ts +306 -215
- package/src/sap/fe/core/ExtensionAPI.js +25 -30
- package/src/sap/fe/core/ExtensionAPI.ts +37 -41
- package/src/sap/fe/core/PageController.js +12 -7
- package/src/sap/fe/core/PageController.ts +10 -5
- package/src/sap/fe/core/TemplateComponent.js +6 -6
- package/src/sap/fe/core/TemplateComponent.ts +11 -11
- package/src/sap/fe/core/TemplateModel.js +2 -2
- package/src/sap/fe/core/TemplateModel.ts +3 -3
- 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 +306 -78
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +280 -70
- 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/{BusyLocker.js → controllerextensions/BusyLocker.js} +1 -1
- package/src/sap/fe/core/{BusyLocker.ts → controllerextensions/BusyLocker.ts} +7 -7
- package/src/sap/fe/core/controllerextensions/EditFlow.js +351 -229
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +321 -246
- 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 +59 -34
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +71 -45
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +72 -72
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +82 -80
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +152 -131
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +171 -152
- 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 +11 -10
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +31 -37
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +21 -13
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +30 -15
- 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 +19 -11
- package/src/sap/fe/core/controllerextensions/Paginator.ts +22 -14
- 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 +39 -21
- package/src/sap/fe/core/controllerextensions/Share.ts +45 -26
- package/src/sap/fe/core/controllerextensions/SideEffects.js +47 -51
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +58 -62
- package/src/sap/fe/core/controllerextensions/ViewState.js +75 -62
- package/src/sap/fe/core/controllerextensions/ViewState.ts +78 -63
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +105 -0
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +99 -0
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +360 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/ActivitySync.ts +58 -112
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/CollaborationCommon.js +2 -2
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/CollaborationCommon.ts +7 -7
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +262 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/Manage.ts +20 -21
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/ManageDialog.fragment.xml +0 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/UserDetails.fragment.xml +5 -7
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +1631 -0
- package/src/sap/fe/core/{TransactionHelper.ts → controllerextensions/editFlow/TransactionHelper.ts} +270 -211
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +772 -0
- package/src/sap/fe/core/{actions → controllerextensions/editFlow}/draft.ts +240 -100
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js +1199 -0
- package/src/sap/fe/core/{actions → controllerextensions/editFlow}/operations.ts +364 -229
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +188 -0
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +185 -0
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +626 -0
- package/src/sap/fe/core/{actions → controllerextensions/messageHandler}/messageHandling.ts +112 -69
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +937 -0
- package/src/sap/fe/core/{RouterProxy.ts → controllerextensions/routing/RouterProxy.ts} +72 -73
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +21 -18
- 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 +21 -24
- package/src/sap/fe/core/controls/CommandExecution.ts +19 -24
- 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 +48 -43
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +51 -46
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +3 -2
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +3 -2
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossDraft.fragment.xml +11 -3
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +19 -9
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +14 -8
- 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 +50 -3
- package/src/sap/fe/core/controls/FileWrapper.ts +45 -12
- 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 +12 -2
- package/src/sap/fe/core/controls/FormElementWrapper.ts +14 -3
- package/src/sap/fe/core/controls/MassEditSelect.js +33 -0
- package/src/sap/fe/core/controls/MassEditSelect.ts +41 -0
- 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 +48 -48
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +71 -76
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +36 -65
- package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +107 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +551 -36
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +605 -36
- 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 +2 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +17 -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 +56 -67
- package/src/sap/fe/core/converters/MetaModelConverter.ts +183 -193
- 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 +73 -37
- package/src/sap/fe/core/converters/annotations/DataField.ts +121 -77
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +1911 -1495
- package/src/sap/fe/core/converters/controls/Common/Action.js +51 -49
- package/src/sap/fe/core/converters/controls/Common/Action.ts +58 -54
- package/src/sap/fe/core/converters/controls/Common/Chart.js +22 -15
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +29 -27
- 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 +30 -34
- package/src/sap/fe/core/converters/controls/Common/Form.ts +48 -58
- 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 +318 -244
- package/src/sap/fe/core/converters/controls/Common/Table.ts +368 -297
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +135 -125
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +162 -148
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +51 -45
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +79 -67
- 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 +92 -89
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +124 -120
- package/src/sap/fe/core/converters/helpers/Aggregation.js +11 -5
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +25 -23
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +31 -30
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +31 -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 +56 -55
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +65 -77
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +6 -6
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +10 -8
- 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 +83 -22
- package/src/sap/fe/core/formatters/TableFormatter.ts +80 -25
- 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/fpm/Component.js +2 -2
- package/src/sap/fe/core/fpm/Component.ts +1 -1
- 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} +388 -285
- package/src/sap/fe/core/helpers/ClassSupport.js +20 -11
- package/src/sap/fe/core/helpers/ClassSupport.ts +15 -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 +3 -2
- package/src/sap/fe/core/helpers/FPMHelper.ts +10 -9
- 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 +532 -264
- package/src/sap/fe/core/helpers/MassEditHelper.ts +560 -289
- package/src/sap/fe/core/helpers/ModelHelper.js +25 -25
- package/src/sap/fe/core/helpers/ModelHelper.ts +50 -58
- 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 +16 -12
- package/src/sap/fe/core/helpers/StableIdHelper.ts +20 -16
- package/src/sap/fe/core/{Synchronization.js → helpers/Synchronization.js} +1 -1
- package/src/sap/fe/core/{Synchronization.ts → helpers/Synchronization.ts} +1 -1
- 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 +51 -3
- package/src/sap/fe/core/library.ts +47 -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 +151 -197
- package/src/sap/fe/core/messagebundle_ar.properties +36 -63
- package/src/sap/fe/core/messagebundle_bg.properties +36 -63
- package/src/sap/fe/core/messagebundle_ca.properties +36 -63
- package/src/sap/fe/core/messagebundle_cs.properties +36 -63
- package/src/sap/fe/core/messagebundle_cy.properties +36 -63
- package/src/sap/fe/core/messagebundle_da.properties +37 -64
- package/src/sap/fe/core/messagebundle_de.properties +36 -63
- package/src/sap/fe/core/messagebundle_el.properties +38 -65
- package/src/sap/fe/core/messagebundle_en.properties +37 -64
- package/src/sap/fe/core/messagebundle_en_GB.properties +37 -64
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +44 -73
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +37 -64
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +52 -81
- package/src/sap/fe/core/messagebundle_es.properties +36 -63
- package/src/sap/fe/core/messagebundle_es_MX.properties +36 -63
- package/src/sap/fe/core/messagebundle_et.properties +36 -63
- package/src/sap/fe/core/messagebundle_fi.properties +36 -63
- package/src/sap/fe/core/messagebundle_fr.properties +39 -66
- package/src/sap/fe/core/messagebundle_fr_CA.properties +36 -63
- package/src/sap/fe/core/messagebundle_hi.properties +36 -63
- package/src/sap/fe/core/messagebundle_hr.properties +36 -63
- package/src/sap/fe/core/messagebundle_hu.properties +35 -62
- package/src/sap/fe/core/messagebundle_id.properties +37 -64
- package/src/sap/fe/core/messagebundle_it.properties +54 -81
- package/src/sap/fe/core/messagebundle_iw.properties +36 -63
- package/src/sap/fe/core/messagebundle_ja.properties +36 -63
- package/src/sap/fe/core/messagebundle_kk.properties +36 -63
- package/src/sap/fe/core/messagebundle_ko.properties +36 -63
- package/src/sap/fe/core/messagebundle_lt.properties +36 -63
- package/src/sap/fe/core/messagebundle_lv.properties +36 -63
- package/src/sap/fe/core/messagebundle_ms.properties +37 -64
- package/src/sap/fe/core/messagebundle_nl.properties +37 -64
- package/src/sap/fe/core/messagebundle_no.properties +36 -63
- package/src/sap/fe/core/messagebundle_pl.properties +37 -64
- package/src/sap/fe/core/messagebundle_pt.properties +37 -64
- package/src/sap/fe/core/messagebundle_pt_PT.properties +36 -63
- package/src/sap/fe/core/messagebundle_ro.properties +36 -63
- package/src/sap/fe/core/messagebundle_ru.properties +36 -63
- package/src/sap/fe/core/messagebundle_sh.properties +36 -63
- package/src/sap/fe/core/messagebundle_sk.properties +36 -63
- package/src/sap/fe/core/messagebundle_sl.properties +38 -65
- package/src/sap/fe/core/messagebundle_sv.properties +36 -63
- package/src/sap/fe/core/messagebundle_th.properties +36 -63
- package/src/sap/fe/core/messagebundle_tr.properties +36 -63
- package/src/sap/fe/core/messagebundle_uk.properties +37 -64
- package/src/sap/fe/core/messagebundle_vi.properties +37 -64
- package/src/sap/fe/core/messagebundle_zh_CN.properties +36 -63
- package/src/sap/fe/core/messagebundle_zh_TW.properties +37 -64
- 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 +6 -3
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +12 -10
- package/src/sap/fe/core/services/NavigationServiceFactory.js +54 -45
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +61 -49
- 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 +63 -60
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +76 -73
- package/src/sap/fe/core/services/ShellServicesFactory.js +102 -71
- package/src/sap/fe/core/services/ShellServicesFactory.ts +109 -78
- 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 +24 -18
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +53 -50
- 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 +3 -4
- package/src/sap/fe/core/templating/EntitySetHelper.js +7 -15
- package/src/sap/fe/core/templating/EntitySetHelper.ts +14 -18
- 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 +12 -11
- package/src/sap/fe/core/templating/FilterHelper.ts +17 -16
- 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 +79 -56
- package/src/sap/fe/core/templating/PropertyHelper.ts +41 -27
- package/src/sap/fe/core/templating/UIFormatters.js +163 -97
- package/src/sap/fe/core/templating/UIFormatters.ts +210 -129
- package/src/sap/fe/core/type/DateTimeWithTimezone.js +47 -0
- package/src/sap/fe/core/type/DateTimeWithTimezone.ts +23 -0
- 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/AnnotationHelper.js +0 -331
- package/src/sap/fe/core/AnnotationHelper.ts +0 -321
- package/src/sap/fe/core/RouterProxy.js +0 -938
- package/src/sap/fe/core/TransactionHelper.js +0 -1577
- package/src/sap/fe/core/actions/collaboration/ActivitySync.js +0 -406
- package/src/sap/fe/core/actions/collaboration/Manage.js +0 -264
- package/src/sap/fe/core/actions/draft.js +0 -665
- package/src/sap/fe/core/actions/messageHandling.js +0 -579
- package/src/sap/fe/core/actions/nonDraft.js +0 -20
- package/src/sap/fe/core/actions/nonDraft.ts +0 -12
- package/src/sap/fe/core/actions/operations.js +0 -1096
- package/src/sap/fe/core/actions/sticky.js +0 -130
- package/src/sap/fe/core/actions/sticky.ts +0 -119
- package/src/sap/fe/core/formatters/CriticalityFormatter.js +0 -77
- package/src/sap/fe/core/formatters/CriticalityFormatter.ts +0 -58
- package/src/sap/fe/core/helpers/BindingExpression.js +0 -1729
package/src/sap/fe/core/{TransactionHelper.ts → controllerextensions/editFlow/TransactionHelper.ts}
RENAMED
|
@@ -1,14 +1,15 @@
|
|
|
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
|
|
4
|
-
import messageHandling from "sap/fe/core/actions/messageHandling";
|
|
5
|
-
import operations from "sap/fe/core/actions/operations";
|
|
6
|
-
import sticky from "sap/fe/core/actions/sticky";
|
|
7
|
-
import AppComponent from "sap/fe/core/AppComponent";
|
|
8
|
-
import BusyLocker from "sap/fe/core/BusyLocker";
|
|
3
|
+
import type AppComponent from "sap/fe/core/AppComponent";
|
|
9
4
|
import CommonUtils from "sap/fe/core/CommonUtils";
|
|
5
|
+
import BusyLocker from "sap/fe/core/controllerextensions/BusyLocker";
|
|
6
|
+
import draft from "sap/fe/core/controllerextensions/editFlow/draft";
|
|
7
|
+
import operations from "sap/fe/core/controllerextensions/editFlow/operations";
|
|
8
|
+
import sticky from "sap/fe/core/controllerextensions/editFlow/sticky";
|
|
9
|
+
import messageHandling from "sap/fe/core/controllerextensions/messageHandler/messageHandling";
|
|
10
10
|
import FPMHelper from "sap/fe/core/helpers/FPMHelper";
|
|
11
|
-
import
|
|
11
|
+
import type { InternalModelContext } from "sap/fe/core/helpers/ModelHelper";
|
|
12
|
+
import ModelHelper from "sap/fe/core/helpers/ModelHelper";
|
|
12
13
|
import FELibrary from "sap/fe/core/library";
|
|
13
14
|
import Button from "sap/m/Button";
|
|
14
15
|
import CheckBox from "sap/m/CheckBox";
|
|
@@ -21,13 +22,13 @@ import VBox from "sap/m/VBox";
|
|
|
21
22
|
import Core from "sap/ui/core/Core";
|
|
22
23
|
import Fragment from "sap/ui/core/Fragment";
|
|
23
24
|
import coreLibrary from "sap/ui/core/library";
|
|
24
|
-
import View from "sap/ui/core/mvc/View";
|
|
25
|
+
import type View from "sap/ui/core/mvc/View";
|
|
25
26
|
import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
|
|
26
27
|
import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
|
|
27
|
-
import Context from "sap/ui/model/Context";
|
|
28
|
+
import type Context from "sap/ui/model/Context";
|
|
28
29
|
import JSONModel from "sap/ui/model/json/JSONModel";
|
|
29
|
-
import ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
|
|
30
|
-
import { CoreEx } from "types/extension_types";
|
|
30
|
+
import type ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
|
|
31
|
+
import type { CoreEx, ODataListBinding, V4Context } from "types/extension_types";
|
|
31
32
|
|
|
32
33
|
const CreationMode = FELibrary.CreationMode;
|
|
33
34
|
const ProgrammingModel = FELibrary.ProgrammingModel;
|
|
@@ -70,7 +71,7 @@ class TransactionHelper {
|
|
|
70
71
|
return ProgrammingModel.NonDraft;
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
|
-
return this.sProgrammingModel
|
|
74
|
+
return this.sProgrammingModel;
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
/**
|
|
@@ -78,16 +79,16 @@ class TransactionHelper {
|
|
|
78
79
|
*
|
|
79
80
|
* @memberof sap.fe.core.TransactionHelper
|
|
80
81
|
* @static
|
|
81
|
-
* @param
|
|
82
|
-
* @param
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
* @param
|
|
86
|
-
* @returns
|
|
82
|
+
* @param oContext Context of the document to be validated
|
|
83
|
+
* @param [mParameters] Can contain the following attributes:
|
|
84
|
+
* @param [mParameters.data] A map of data that should be validated
|
|
85
|
+
* @param [mParameters.customValidationFunction] A string representing the path to the validation function
|
|
86
|
+
* @param oView Contains the object of the current view
|
|
87
|
+
* @returns Promise resolves with result of the custom validation function
|
|
87
88
|
* @ui5-restricted
|
|
88
89
|
* @final
|
|
89
90
|
*/
|
|
90
|
-
validateDocument(oContext:
|
|
91
|
+
validateDocument(oContext: V4Context, mParameters: any, oView: View): Promise<any> {
|
|
91
92
|
const sCustomValidationFunction = mParameters && mParameters.customValidationFunction;
|
|
92
93
|
if (sCustomValidationFunction) {
|
|
93
94
|
const sModule = sCustomValidationFunction.substring(0, sCustomValidationFunction.lastIndexOf(".") || -1).replace(/\./gi, "/"),
|
|
@@ -107,22 +108,23 @@ class TransactionHelper {
|
|
|
107
108
|
*
|
|
108
109
|
* @memberof sap.fe.core.TransactionHelper
|
|
109
110
|
* @static
|
|
110
|
-
* @param
|
|
111
|
-
* @param
|
|
112
|
-
* @param
|
|
113
|
-
* @param
|
|
114
|
-
* @param
|
|
111
|
+
* @param oMainListBinding OData V4 ListBinding object
|
|
112
|
+
* @param [mInParameters] Optional, can contain the following attributes:
|
|
113
|
+
* @param [mInParameters.data] A map of data that should be sent within the POST
|
|
114
|
+
* @param [mInParameters.busyMode] Global (default), Local, None TODO: to be refactored
|
|
115
|
+
* @param [mInParameters.keepTransientContextOnFailed] If set, the context stays in the list if the POST failed and POST will be repeated with the next change
|
|
116
|
+
* @param [mInParameters.inactive] If set, the context is set as inactive for empty rows
|
|
115
117
|
* @param oResourceBundle
|
|
116
118
|
* @param messageHandler
|
|
117
119
|
* @param bFromCopyPaste
|
|
118
120
|
* @param oView The current view
|
|
119
|
-
* @returns
|
|
121
|
+
* @returns Promise resolves with new binding context
|
|
120
122
|
* @ui5-restricted
|
|
121
123
|
* @final
|
|
122
124
|
*/
|
|
123
125
|
createDocument(
|
|
124
|
-
oMainListBinding:
|
|
125
|
-
mInParameters: { data?: any; busyMode?: string | undefined; keepTransientContextOnFailed?: any } | undefined,
|
|
126
|
+
oMainListBinding: ODataListBinding,
|
|
127
|
+
mInParameters: { data?: any; busyMode?: string | undefined; keepTransientContextOnFailed?: any; inactive?: boolean } | undefined,
|
|
126
128
|
oResourceBundle: any,
|
|
127
129
|
messageHandler: any,
|
|
128
130
|
bFromCopyPaste: boolean = false,
|
|
@@ -141,18 +143,18 @@ class TransactionHelper {
|
|
|
141
143
|
: undefined;
|
|
142
144
|
let oCreationPromise;
|
|
143
145
|
const mBindingParameters: any = { "$$patchWithoutSideEffects": true };
|
|
144
|
-
const sMessagesPath = oMetaModel.getObject(sMetaPath
|
|
146
|
+
const sMessagesPath = oMetaModel.getObject(`${sMetaPath}/@com.sap.vocabularies.Common.v1.Messages/$Path`);
|
|
145
147
|
let sBusyPath = "/busy";
|
|
146
148
|
let sFunctionName =
|
|
147
|
-
oMetaModel.getObject(sMetaPath
|
|
149
|
+
oMetaModel.getObject(`${sMetaPath}@com.sap.vocabularies.Common.v1.DefaultValuesFunction`) ||
|
|
148
150
|
oMetaModel.getObject(
|
|
149
|
-
ModelHelper.getTargetEntitySet(oMetaModel.getContext(sMetaPath))
|
|
151
|
+
`${ModelHelper.getTargetEntitySet(oMetaModel.getContext(sMetaPath))}@com.sap.vocabularies.Common.v1.DefaultValuesFunction`
|
|
150
152
|
);
|
|
151
153
|
let bFunctionOnNavProp;
|
|
152
154
|
let oNewDocumentContext: any;
|
|
153
155
|
if (sFunctionName) {
|
|
154
156
|
if (
|
|
155
|
-
oMetaModel.getObject(sMetaPath
|
|
157
|
+
oMetaModel.getObject(`${sMetaPath}@com.sap.vocabularies.Common.v1.DefaultValuesFunction`) &&
|
|
156
158
|
ModelHelper.getTargetEntitySet(oMetaModel.getContext(sMetaPath)) !== sMetaPath
|
|
157
159
|
) {
|
|
158
160
|
bFunctionOnNavProp = true;
|
|
@@ -174,7 +176,7 @@ class TransactionHelper {
|
|
|
174
176
|
if (mParameters.busyMode === "Local") {
|
|
175
177
|
// in case of local busy mode we use the list binding name
|
|
176
178
|
// there's no APY yet so we have to use the .sId TODO provide a public method?
|
|
177
|
-
sBusyPath =
|
|
179
|
+
sBusyPath = `/busyLocal/${oMainListBinding.sId}`;
|
|
178
180
|
}
|
|
179
181
|
mParameters.beforeCreateCallBack = bFromCopyPaste ? null : mParameters.beforeCreateCallBack;
|
|
180
182
|
BusyLocker.lock(this.oLockObject, sBusyPath);
|
|
@@ -185,12 +187,7 @@ class TransactionHelper {
|
|
|
185
187
|
{
|
|
186
188
|
contexts: oMainListBinding.getHeaderContext(),
|
|
187
189
|
showActionParameterDialog: true,
|
|
188
|
-
label: this._getSpecificCreateActionDialogLabel(
|
|
189
|
-
oMetaModel,
|
|
190
|
-
sMetaPath,
|
|
191
|
-
sNewAction,
|
|
192
|
-
oResourceBundleCore as ResourceBundle
|
|
193
|
-
),
|
|
190
|
+
label: this._getSpecificCreateActionDialogLabel(oMetaModel, sMetaPath, sNewAction, oResourceBundleCore),
|
|
194
191
|
bindingParameters: mBindingParameters,
|
|
195
192
|
parentControl: mParameters.parentControl,
|
|
196
193
|
bIsCreateAction: true
|
|
@@ -211,16 +208,16 @@ class TransactionHelper {
|
|
|
211
208
|
if (bFunctionOnNavProp) {
|
|
212
209
|
sFunctionPath =
|
|
213
210
|
oMainListBinding.getContext() &&
|
|
214
|
-
oMetaModel.getMetaPath(oMainListBinding.getContext().getPath())
|
|
211
|
+
`${oMetaModel.getMetaPath(oMainListBinding.getContext().getPath())}/${sFunctionName}`;
|
|
215
212
|
oFunctionContext = oMainListBinding.getContext();
|
|
216
213
|
} else {
|
|
217
214
|
sFunctionPath =
|
|
218
215
|
oMainListBinding.getHeaderContext() &&
|
|
219
|
-
oMetaModel.getMetaPath(oMainListBinding.getHeaderContext().getPath())
|
|
216
|
+
`${oMetaModel.getMetaPath(oMainListBinding.getHeaderContext().getPath())}/${sFunctionName}`;
|
|
220
217
|
oFunctionContext = oMainListBinding.getHeaderContext();
|
|
221
218
|
}
|
|
222
219
|
}
|
|
223
|
-
const oFunction = sFunctionPath && oMetaModel.createBindingContext(sFunctionPath);
|
|
220
|
+
const oFunction = sFunctionPath && (oMetaModel.createBindingContext(sFunctionPath) as any);
|
|
224
221
|
if (oFunction && oFunction.getObject() && oFunction.getObject()[0].$IsBound) {
|
|
225
222
|
oCreationPromise = operations.callBoundFunction(sFunctionName, oFunctionContext, oModel);
|
|
226
223
|
} else {
|
|
@@ -236,7 +233,7 @@ class TransactionHelper {
|
|
|
236
233
|
}
|
|
237
234
|
})
|
|
238
235
|
.catch(function (oError: any) {
|
|
239
|
-
Log.error(
|
|
236
|
+
Log.error(`Error while executing the function ${sFunctionName}`, oError);
|
|
240
237
|
throw oError;
|
|
241
238
|
})
|
|
242
239
|
.then(function (oData: any) {
|
|
@@ -247,7 +244,7 @@ class TransactionHelper {
|
|
|
247
244
|
if (aNonComputedVisibleKeyFields.length > 0) {
|
|
248
245
|
const oTransientListBinding = oModel.bindList(oMainListBinding.getPath(), oMainListBinding.getContext(), [], [], {
|
|
249
246
|
$$updateGroupId: "submitLater"
|
|
250
|
-
});
|
|
247
|
+
}) as ODataListBinding;
|
|
251
248
|
oTransientListBinding.refreshInternal = function () {
|
|
252
249
|
/* */
|
|
253
250
|
};
|
|
@@ -271,8 +268,15 @@ class TransactionHelper {
|
|
|
271
268
|
onBeforeCreatePromise = Promise.resolve();
|
|
272
269
|
}
|
|
273
270
|
return onBeforeCreatePromise.then(function () {
|
|
274
|
-
oNewDocumentContext = oMainListBinding.create(
|
|
275
|
-
|
|
271
|
+
oNewDocumentContext = oMainListBinding.create(
|
|
272
|
+
mParameters.data,
|
|
273
|
+
true,
|
|
274
|
+
mParameters.createAtEnd,
|
|
275
|
+
mParameters.inactive
|
|
276
|
+
);
|
|
277
|
+
if (!mParameters.inactive) {
|
|
278
|
+
return that.onAfterCreateCompletion(oMainListBinding, oNewDocumentContext, mParameters);
|
|
279
|
+
}
|
|
276
280
|
});
|
|
277
281
|
}
|
|
278
282
|
})
|
|
@@ -319,25 +323,22 @@ class TransactionHelper {
|
|
|
319
323
|
*
|
|
320
324
|
* @memberof sap.fe.core.TransactionHelper
|
|
321
325
|
* @static
|
|
322
|
-
* @param
|
|
326
|
+
* @param aContexts Contexts Either one context or an array with contexts to be deleted
|
|
323
327
|
* @param bFindActiveContexts
|
|
324
|
-
* @returns
|
|
328
|
+
* @returns Array of the active contexts
|
|
325
329
|
*/
|
|
326
|
-
findActiveDraftRootContexts(aContexts:
|
|
330
|
+
findActiveDraftRootContexts(aContexts: V4Context[], bFindActiveContexts: any) {
|
|
327
331
|
if (!bFindActiveContexts) {
|
|
328
332
|
return Promise.resolve();
|
|
329
333
|
}
|
|
330
334
|
const activeContexts = aContexts.reduce(function (aResult: any, oContext: any) {
|
|
331
335
|
const oMetaModel = oContext.getModel().getMetaModel();
|
|
332
336
|
const sMetaPath = oMetaModel.getMetaPath(oContext.getPath());
|
|
333
|
-
if (oMetaModel.getObject(sMetaPath
|
|
337
|
+
if (oMetaModel.getObject(`${sMetaPath}@com.sap.vocabularies.Common.v1.DraftRoot`)) {
|
|
334
338
|
const bIsActiveEntity = oContext.getObject().IsActiveEntity,
|
|
335
339
|
bHasActiveEntity = oContext.getObject().HasActiveEntity;
|
|
336
340
|
if (!bIsActiveEntity && bHasActiveEntity) {
|
|
337
|
-
const oActiveContext = oContext
|
|
338
|
-
.getModel()
|
|
339
|
-
.bindContext(oContext.getPath() + "/SiblingEntity")
|
|
340
|
-
.getBoundContext();
|
|
341
|
+
const oActiveContext = oContext.getModel().bindContext(`${oContext.getPath()}/SiblingEntity`).getBoundContext();
|
|
341
342
|
aResult.push(oActiveContext);
|
|
342
343
|
}
|
|
343
344
|
}
|
|
@@ -345,14 +346,9 @@ class TransactionHelper {
|
|
|
345
346
|
}, []);
|
|
346
347
|
return Promise.all(
|
|
347
348
|
activeContexts.map(function (oContext: any) {
|
|
348
|
-
return oContext.requestCanonicalPath().then(
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
},
|
|
352
|
-
function () {
|
|
353
|
-
return;
|
|
354
|
-
}
|
|
355
|
-
);
|
|
349
|
+
return oContext.requestCanonicalPath().then(function () {
|
|
350
|
+
return oContext;
|
|
351
|
+
});
|
|
356
352
|
})
|
|
357
353
|
);
|
|
358
354
|
}
|
|
@@ -379,7 +375,7 @@ class TransactionHelper {
|
|
|
379
375
|
if (aContexts.length === 1) {
|
|
380
376
|
MessageToast.show(
|
|
381
377
|
CommonUtils.getTranslatedText(
|
|
382
|
-
"
|
|
378
|
+
"C_TRANSACTION_HELPER_DELETE_TOAST_SINGULAR",
|
|
383
379
|
oResourceBundle,
|
|
384
380
|
null,
|
|
385
381
|
mParameters.entitySetName
|
|
@@ -387,12 +383,7 @@ class TransactionHelper {
|
|
|
387
383
|
);
|
|
388
384
|
} else {
|
|
389
385
|
MessageToast.show(
|
|
390
|
-
CommonUtils.getTranslatedText(
|
|
391
|
-
"C_TRANSACTION_HELPER_OBJECT_PAGE_DELETE_TOAST_PLURAL",
|
|
392
|
-
oResourceBundle,
|
|
393
|
-
null,
|
|
394
|
-
mParameters.entitySetName
|
|
395
|
-
)
|
|
386
|
+
CommonUtils.getTranslatedText("C_TRANSACTION_HELPER_DELETE_TOAST_PLURAL", oResourceBundle, null, mParameters.entitySetName)
|
|
396
387
|
);
|
|
397
388
|
}
|
|
398
389
|
}
|
|
@@ -401,17 +392,17 @@ class TransactionHelper {
|
|
|
401
392
|
*
|
|
402
393
|
* @memberof sap.fe.core.TransactionHelper
|
|
403
394
|
* @static
|
|
404
|
-
* @param
|
|
405
|
-
* @param
|
|
406
|
-
* @param
|
|
407
|
-
* @param
|
|
408
|
-
* @param
|
|
409
|
-
* @param
|
|
395
|
+
* @param vInContexts Contexts Either one context or an array with contexts to be deleted
|
|
396
|
+
* @param mParameters Optional, can contain the following attributes:
|
|
397
|
+
* @param mParameters.title Title of the object to be deleted
|
|
398
|
+
* @param mParameters.description Description of the object to be deleted
|
|
399
|
+
* @param mParameters.numberOfSelectedContexts Number of objects selected
|
|
400
|
+
* @param mParameters.noDialog To disable the confirmation dialog
|
|
410
401
|
* @param oResourceBundle
|
|
411
402
|
* @param messageHandler
|
|
412
|
-
* @returns
|
|
403
|
+
* @returns A Promise resolved once the document are deleted
|
|
413
404
|
*/
|
|
414
|
-
deleteDocument(
|
|
405
|
+
deleteDocument(vInContexts: V4Context, mParameters: any, oResourceBundle: any, messageHandler: any) {
|
|
415
406
|
let fnReject: Function,
|
|
416
407
|
fnResolve: Function,
|
|
417
408
|
aDeletableContexts: any[] = [],
|
|
@@ -422,14 +413,18 @@ class TransactionHelper {
|
|
|
422
413
|
bDialogConfirmed = false;
|
|
423
414
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
424
415
|
const that = this,
|
|
425
|
-
oResourceBundleCore = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core")
|
|
416
|
+
oResourceBundleCore = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core");
|
|
426
417
|
let aParams;
|
|
427
418
|
let oDeleteMessage: any = {
|
|
428
|
-
title: oResourceBundleCore.getText("
|
|
419
|
+
title: oResourceBundleCore.getText("C_COMMON_DELETE")
|
|
429
420
|
};
|
|
421
|
+
messageHandling.removeBoundTransitionMessages();
|
|
430
422
|
BusyLocker.lock(this.oLockObject);
|
|
431
|
-
|
|
432
|
-
|
|
423
|
+
let vContexts: V4Context[];
|
|
424
|
+
if (Array.isArray(vInContexts)) {
|
|
425
|
+
vContexts = vInContexts;
|
|
426
|
+
} else {
|
|
427
|
+
vContexts = [vInContexts];
|
|
433
428
|
}
|
|
434
429
|
Promise.resolve(this.getProgrammingModel(vContexts[0]))
|
|
435
430
|
.then(function (sProgrammingModel: any) {
|
|
@@ -445,13 +440,20 @@ class TransactionHelper {
|
|
|
445
440
|
oContextData.DraftAdministrativeData.InProcessByUser &&
|
|
446
441
|
!oContextData.DraftAdministrativeData.DraftIsCreatedByMe
|
|
447
442
|
) {
|
|
443
|
+
let sLockedUser = "";
|
|
444
|
+
const draftAdminData = oContextData && oContextData.DraftAdministrativeData;
|
|
445
|
+
if (draftAdminData) {
|
|
446
|
+
sLockedUser = draftAdminData["InProcessByUser"];
|
|
447
|
+
}
|
|
448
|
+
aParams = [sLockedUser];
|
|
448
449
|
MessageBox.show(
|
|
449
450
|
CommonUtils.getTranslatedText(
|
|
450
|
-
"
|
|
451
|
-
oResourceBundle
|
|
451
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_SINGLE_OBJECT_LOCKED",
|
|
452
|
+
oResourceBundle,
|
|
453
|
+
aParams
|
|
452
454
|
),
|
|
453
455
|
{
|
|
454
|
-
title: oResourceBundleCore.getText("
|
|
456
|
+
title: oResourceBundleCore.getText("C_COMMON_DELETE"),
|
|
455
457
|
onClose: fnReject
|
|
456
458
|
}
|
|
457
459
|
);
|
|
@@ -462,35 +464,76 @@ class TransactionHelper {
|
|
|
462
464
|
mParameters = getParameters(mParameters);
|
|
463
465
|
if (mParameters.title) {
|
|
464
466
|
if (mParameters.description) {
|
|
465
|
-
aParams = [mParameters.title, mParameters.description];
|
|
467
|
+
aParams = [mParameters.title, mParameters.description + " "];
|
|
466
468
|
} else {
|
|
467
469
|
aParams = [mParameters.title, ""];
|
|
468
470
|
}
|
|
469
471
|
oDeleteMessage.text = CommonUtils.getTranslatedText(
|
|
470
|
-
"
|
|
472
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO",
|
|
471
473
|
oResourceBundle,
|
|
472
474
|
aParams,
|
|
473
475
|
mParameters.entitySetName
|
|
474
476
|
);
|
|
475
477
|
} else {
|
|
476
478
|
oDeleteMessage.text = CommonUtils.getTranslatedText(
|
|
477
|
-
"
|
|
479
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_SINGULAR",
|
|
478
480
|
oResourceBundle
|
|
479
481
|
);
|
|
480
482
|
}
|
|
481
483
|
aDeletableContexts = vContexts;
|
|
482
484
|
} else {
|
|
483
485
|
oDeleteMessage = {
|
|
484
|
-
title: oResourceBundleCore.getText("
|
|
486
|
+
title: oResourceBundleCore.getText("C_COMMON_DELETE")
|
|
485
487
|
};
|
|
486
488
|
if (mParameters.numberOfSelectedContexts === 1 && mParameters.numberOfSelectedContexts === vContexts.length) {
|
|
487
489
|
aDeletableContexts = vContexts;
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
490
|
+
const oLineContextData = vContexts[0].getObject();
|
|
491
|
+
if (mParameters.title && mParameters.title.path) {
|
|
492
|
+
const sTitle = oLineContextData[mParameters.title.path];
|
|
493
|
+
const sKey = CommonUtils.getKeys(
|
|
494
|
+
that._oAppComponent.getMetaModel(),
|
|
495
|
+
vContexts[0].getPath(),
|
|
496
|
+
mParameters.entitySetName
|
|
497
|
+
);
|
|
498
|
+
const sKeyValue = sKey ? oLineContextData[sKey] : undefined;
|
|
499
|
+
const sDescription =
|
|
500
|
+
mParameters.description && mParameters.description.path
|
|
501
|
+
? oLineContextData[mParameters.description.path]
|
|
502
|
+
: undefined;
|
|
503
|
+
if (sTitle) {
|
|
504
|
+
if (sDescription) {
|
|
505
|
+
aParams = [sTitle, sDescription + " "];
|
|
506
|
+
} else {
|
|
507
|
+
aParams = [sTitle, ""];
|
|
508
|
+
}
|
|
509
|
+
oDeleteMessage.text = CommonUtils.getTranslatedText(
|
|
510
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO",
|
|
511
|
+
oResourceBundle,
|
|
512
|
+
aParams,
|
|
513
|
+
mParameters.entitySetName
|
|
514
|
+
);
|
|
515
|
+
} else if (sKeyValue) {
|
|
516
|
+
aParams = [sKeyValue, ""];
|
|
517
|
+
oDeleteMessage.text = CommonUtils.getTranslatedText(
|
|
518
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO",
|
|
519
|
+
oResourceBundle,
|
|
520
|
+
aParams,
|
|
521
|
+
mParameters.entitySetName
|
|
522
|
+
);
|
|
523
|
+
} else {
|
|
524
|
+
oDeleteMessage.text = CommonUtils.getTranslatedText(
|
|
525
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_SINGULAR",
|
|
526
|
+
oResourceBundle
|
|
527
|
+
);
|
|
528
|
+
}
|
|
529
|
+
} else {
|
|
530
|
+
oDeleteMessage.text = CommonUtils.getTranslatedText(
|
|
531
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_SINGULAR",
|
|
532
|
+
oResourceBundle,
|
|
533
|
+
null,
|
|
534
|
+
mParameters.entitySetName
|
|
535
|
+
);
|
|
536
|
+
}
|
|
494
537
|
} else if (mParameters.numberOfSelectedContexts === 1 && mParameters.unSavedContexts.length === 1) {
|
|
495
538
|
//only one unsaved object
|
|
496
539
|
aDeletableContexts = mParameters.unSavedContexts;
|
|
@@ -502,7 +545,7 @@ class TransactionHelper {
|
|
|
502
545
|
}
|
|
503
546
|
aParams = [sLastChangedByUser];
|
|
504
547
|
oDeleteMessage.text = CommonUtils.getTranslatedText(
|
|
505
|
-
"
|
|
548
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_UNSAVED_CHANGES",
|
|
506
549
|
oResourceBundle,
|
|
507
550
|
aParams
|
|
508
551
|
);
|
|
@@ -510,7 +553,7 @@ class TransactionHelper {
|
|
|
510
553
|
//only multiple unsaved objects
|
|
511
554
|
aDeletableContexts = mParameters.unSavedContexts;
|
|
512
555
|
oDeleteMessage.text = CommonUtils.getTranslatedText(
|
|
513
|
-
"
|
|
556
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_UNSAVED_CHANGES_MULTIPLE_OBJECTS",
|
|
514
557
|
oResourceBundle
|
|
515
558
|
);
|
|
516
559
|
} else if (
|
|
@@ -522,13 +565,13 @@ class TransactionHelper {
|
|
|
522
565
|
oDeleteMessage.text =
|
|
523
566
|
aDeletableContexts.length === 1
|
|
524
567
|
? CommonUtils.getTranslatedText(
|
|
525
|
-
"
|
|
568
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_SINGULAR",
|
|
526
569
|
oResourceBundle,
|
|
527
570
|
null,
|
|
528
571
|
mParameters.entitySetName
|
|
529
572
|
)
|
|
530
573
|
: CommonUtils.getTranslatedText(
|
|
531
|
-
"
|
|
574
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_PLURAL",
|
|
532
575
|
oResourceBundle,
|
|
533
576
|
null,
|
|
534
577
|
mParameters.entitySetName
|
|
@@ -540,25 +583,18 @@ class TransactionHelper {
|
|
|
540
583
|
oDeleteMessage.text =
|
|
541
584
|
aDeletableContexts.length === 1
|
|
542
585
|
? CommonUtils.getTranslatedText(
|
|
543
|
-
"
|
|
586
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_SINGULAR_NON_DELETABLE",
|
|
544
587
|
oResourceBundle,
|
|
545
588
|
null,
|
|
546
589
|
mParameters.entitySetName
|
|
547
590
|
)
|
|
548
591
|
: CommonUtils.getTranslatedText(
|
|
549
|
-
"
|
|
592
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_PLURAL_NON_DELETABLE",
|
|
550
593
|
oResourceBundle,
|
|
551
|
-
|
|
594
|
+
[aDeletableContexts.length],
|
|
552
595
|
mParameters.entitySetName
|
|
553
596
|
);
|
|
554
|
-
oDeleteMessage.nonDeletableText =
|
|
555
|
-
"C_TRANSACTION_HELPER_OBJECT_PAGE_CONFIRM_DELETE_WITH_OBJECTINFO_AND_FEW_OBJECTS_NON_DELETABLE",
|
|
556
|
-
oResourceBundle,
|
|
557
|
-
[
|
|
558
|
-
mParameters.numberOfSelectedContexts - vContexts.concat(mParameters.unSavedContexts).length,
|
|
559
|
-
mParameters.numberOfSelectedContexts
|
|
560
|
-
]
|
|
561
|
-
);
|
|
597
|
+
oDeleteMessage.nonDeletableText = that._getNonDeletableText(mParameters, vContexts, oResourceBundle);
|
|
562
598
|
}
|
|
563
599
|
if (mParameters.lockedContexts.length == 1) {
|
|
564
600
|
//setting the locked text if locked objects exist
|
|
@@ -591,24 +627,24 @@ class TransactionHelper {
|
|
|
591
627
|
aDeletableContexts = mParameters.unSavedContexts;
|
|
592
628
|
if (mParameters.unSavedContexts.length === 1) {
|
|
593
629
|
oDeleteMessage.text = CommonUtils.getTranslatedText(
|
|
594
|
-
"
|
|
630
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_UNSAVED_AND_FEW_OBJECTS_LOCKED_SINGULAR",
|
|
595
631
|
oResourceBundle
|
|
596
632
|
);
|
|
597
633
|
} else {
|
|
598
634
|
oDeleteMessage.text = CommonUtils.getTranslatedText(
|
|
599
|
-
"
|
|
635
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_UNSAVED_AND_FEW_OBJECTS_LOCKED_PLURAL",
|
|
600
636
|
oResourceBundle
|
|
601
637
|
);
|
|
602
638
|
}
|
|
603
639
|
} else {
|
|
604
640
|
if (mParameters.unSavedContexts.length === 1) {
|
|
605
641
|
oDeleteMessage.checkBoxText = CommonUtils.getTranslatedText(
|
|
606
|
-
"
|
|
642
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_FEW_OBJECTS_UNSAVED_SINGULAR",
|
|
607
643
|
oResourceBundle
|
|
608
644
|
);
|
|
609
645
|
} else {
|
|
610
646
|
oDeleteMessage.checkBoxText = CommonUtils.getTranslatedText(
|
|
611
|
-
"
|
|
647
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_FEW_OBJECTS_UNSAVED_PLURAL",
|
|
612
648
|
oResourceBundle
|
|
613
649
|
);
|
|
614
650
|
}
|
|
@@ -616,31 +652,28 @@ class TransactionHelper {
|
|
|
616
652
|
}
|
|
617
653
|
}
|
|
618
654
|
if (cannotBeDeletedTextVisible && isLockedTextVisible) {
|
|
655
|
+
//if non-deletable objects exist along with deletable objects
|
|
656
|
+
const sNonDeletableContextText = that._getNonDeletableText(mParameters, vContexts, oResourceBundle);
|
|
619
657
|
//if both locked and non-deletable objects exist along with deletable objects
|
|
620
658
|
if (mParameters.unSavedContexts.length > 1) {
|
|
621
|
-
oDeleteMessage.nonDeletableText =
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
mParameters.numberOfSelectedContexts
|
|
630
|
-
]
|
|
631
|
-
);
|
|
659
|
+
oDeleteMessage.nonDeletableText =
|
|
660
|
+
sNonDeletableContextText +
|
|
661
|
+
" " +
|
|
662
|
+
CommonUtils.getTranslatedText(
|
|
663
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_FEW_OBJECTS_LOCKED_AND_NON_DELETABLE",
|
|
664
|
+
oResourceBundle,
|
|
665
|
+
[mParameters.lockedContexts.length, mParameters.numberOfSelectedContexts]
|
|
666
|
+
);
|
|
632
667
|
}
|
|
633
668
|
if (mParameters.unSavedContexts.length == 1) {
|
|
634
|
-
oDeleteMessage.nonDeletableText =
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
]
|
|
643
|
-
);
|
|
669
|
+
oDeleteMessage.nonDeletableText =
|
|
670
|
+
sNonDeletableContextText +
|
|
671
|
+
" " +
|
|
672
|
+
CommonUtils.getTranslatedText(
|
|
673
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_ONE_OBJECT_LOCKED_AND_NON_DELETABLE",
|
|
674
|
+
oResourceBundle,
|
|
675
|
+
[mParameters.numberOfSelectedContexts]
|
|
676
|
+
);
|
|
644
677
|
}
|
|
645
678
|
}
|
|
646
679
|
}
|
|
@@ -672,7 +705,7 @@ class TransactionHelper {
|
|
|
672
705
|
})
|
|
673
706
|
]
|
|
674
707
|
});
|
|
675
|
-
const sTitle = oResourceBundleCore.getText("
|
|
708
|
+
const sTitle = oResourceBundleCore.getText("C_COMMON_DELETE");
|
|
676
709
|
const fnConfirm = function () {
|
|
677
710
|
bDialogConfirmed = true;
|
|
678
711
|
BusyLocker.lock(that.oLockObject);
|
|
@@ -734,7 +767,7 @@ class TransactionHelper {
|
|
|
734
767
|
? [oNonDeletableMessageTextControl, oDeleteMessageTextControl]
|
|
735
768
|
: oDeleteMessageTextControl,
|
|
736
769
|
beginButton: new Button({
|
|
737
|
-
text: oResourceBundleCore.getText("
|
|
770
|
+
text: oResourceBundleCore.getText("C_COMMON_DELETE"),
|
|
738
771
|
type: "Emphasized",
|
|
739
772
|
press: function () {
|
|
740
773
|
oDialog.close();
|
|
@@ -742,7 +775,7 @@ class TransactionHelper {
|
|
|
742
775
|
}
|
|
743
776
|
}),
|
|
744
777
|
endButton: new Button({
|
|
745
|
-
text: CommonUtils.getTranslatedText("
|
|
778
|
+
text: CommonUtils.getTranslatedText("C_COMMON_DIALOG_CANCEL", oResourceBundle),
|
|
746
779
|
press: function () {
|
|
747
780
|
oDialog.close();
|
|
748
781
|
}
|
|
@@ -779,14 +812,14 @@ class TransactionHelper {
|
|
|
779
812
|
*
|
|
780
813
|
* @memberof sap.fe.core.TransactionHelper
|
|
781
814
|
* @static
|
|
782
|
-
* @param
|
|
783
|
-
* @param
|
|
815
|
+
* @param oContext Context of the active document
|
|
816
|
+
* @param oView Current view
|
|
784
817
|
* @param messageHandler
|
|
785
|
-
* @returns
|
|
818
|
+
* @returns Promise resolves with the new draft context in case of draft programming model
|
|
786
819
|
* @ui5-restricted
|
|
787
820
|
* @final
|
|
788
821
|
*/
|
|
789
|
-
editDocument(oContext:
|
|
822
|
+
editDocument(oContext: V4Context, oView: View, messageHandler: any) {
|
|
790
823
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
791
824
|
const that = this;
|
|
792
825
|
const sProgrammingModel = this.getProgrammingModel(oContext);
|
|
@@ -817,7 +850,7 @@ class TransactionHelper {
|
|
|
817
850
|
});
|
|
818
851
|
})
|
|
819
852
|
.catch(function (err: any) {
|
|
820
|
-
return messageHandler.showMessages().then(function () {
|
|
853
|
+
return messageHandler.showMessages({ concurrentEditFlag: true }).then(function () {
|
|
821
854
|
return Promise.reject(err);
|
|
822
855
|
});
|
|
823
856
|
})
|
|
@@ -830,18 +863,18 @@ class TransactionHelper {
|
|
|
830
863
|
*
|
|
831
864
|
* @memberof sap.fe.core.TransactionHelper
|
|
832
865
|
* @static
|
|
833
|
-
* @param
|
|
834
|
-
* @param
|
|
835
|
-
* @param
|
|
836
|
-
* @param
|
|
866
|
+
* @param oContext Context of the document to be canceled or deleted
|
|
867
|
+
* @param [mInParameters] Optional, can contain the following attributes:
|
|
868
|
+
* @param mInParameters.cancelButton Cancel Button of the discard popover (mandatory for now)
|
|
869
|
+
* @param mInParameters.skipDiscardPopover Optional, supresses the discard popover incase of draft applications while navigating out of OP
|
|
837
870
|
* @param oResourceBundle
|
|
838
871
|
* @param messageHandler
|
|
839
|
-
* @returns
|
|
872
|
+
* @returns Promise resolves with ???
|
|
840
873
|
* @ui5-restricted
|
|
841
874
|
* @final
|
|
842
875
|
*/
|
|
843
876
|
cancelDocument(
|
|
844
|
-
oContext:
|
|
877
|
+
oContext: V4Context,
|
|
845
878
|
mInParameters: { cancelButton: any; skipDiscardPopover: boolean } | undefined,
|
|
846
879
|
oResourceBundle: any,
|
|
847
880
|
messageHandler: any
|
|
@@ -863,7 +896,7 @@ class TransactionHelper {
|
|
|
863
896
|
.then(function (sPModel: any) {
|
|
864
897
|
sProgrammingModel = sPModel;
|
|
865
898
|
if (sPModel === ProgrammingModel.Draft) {
|
|
866
|
-
const draftDataContext = oModel.bindContext(oParamsContext.getPath()
|
|
899
|
+
const draftDataContext = oModel.bindContext(`${oParamsContext.getPath()}/DraftAdministrativeData`).getBoundContext();
|
|
867
900
|
if (!that._bIsModified) {
|
|
868
901
|
return draftDataContext.requestObject().then(function (draftAdminData: any) {
|
|
869
902
|
if (draftAdminData) {
|
|
@@ -892,6 +925,8 @@ class TransactionHelper {
|
|
|
892
925
|
// eslint-disable-next-line default-case
|
|
893
926
|
switch (sProgrammingModel) {
|
|
894
927
|
case ProgrammingModel.Draft:
|
|
928
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
929
|
+
// @ts-ignore
|
|
895
930
|
return oParamsContext.requestObject("HasActiveEntity").then(function (bHasActiveEntity: any) {
|
|
896
931
|
let oDeletePromise;
|
|
897
932
|
if (!bHasActiveEntity) {
|
|
@@ -901,7 +936,7 @@ class TransactionHelper {
|
|
|
901
936
|
oDeletePromise = draft.deleteDraft(oParamsContext);
|
|
902
937
|
return oDeletePromise;
|
|
903
938
|
} else {
|
|
904
|
-
let oActiveContext = oModel.bindContext(oParamsContext.getPath()
|
|
939
|
+
let oActiveContext = oModel.bindContext(`${oParamsContext.getPath()}/SiblingEntity`).getBoundContext();
|
|
905
940
|
return oActiveContext
|
|
906
941
|
.requestCanonicalPath()
|
|
907
942
|
.then(
|
|
@@ -915,7 +950,6 @@ class TransactionHelper {
|
|
|
915
950
|
},
|
|
916
951
|
function () {
|
|
917
952
|
draft.deleteDraft(oParamsContext);
|
|
918
|
-
return;
|
|
919
953
|
}
|
|
920
954
|
)
|
|
921
955
|
.then(function () {
|
|
@@ -933,14 +967,14 @@ class TransactionHelper {
|
|
|
933
967
|
}
|
|
934
968
|
});
|
|
935
969
|
case ProgrammingModel.Sticky:
|
|
936
|
-
return sticky.discardDocument(oContext).then(function (
|
|
937
|
-
if (
|
|
938
|
-
if (
|
|
939
|
-
|
|
970
|
+
return sticky.discardDocument(oContext).then(function (discardedContext: any) {
|
|
971
|
+
if (discardedContext) {
|
|
972
|
+
if (discardedContext.hasPendingChanges()) {
|
|
973
|
+
discardedContext.getBinding().resetChanges();
|
|
940
974
|
}
|
|
941
975
|
if (!that._bCreateMode) {
|
|
942
|
-
|
|
943
|
-
return
|
|
976
|
+
discardedContext.refresh();
|
|
977
|
+
return discardedContext;
|
|
944
978
|
}
|
|
945
979
|
}
|
|
946
980
|
return false;
|
|
@@ -972,16 +1006,16 @@ class TransactionHelper {
|
|
|
972
1006
|
*
|
|
973
1007
|
* @memberof sap.fe.core.TransactionHelper
|
|
974
1008
|
* @static
|
|
975
|
-
* @param
|
|
1009
|
+
* @param oContext Context of the document to be saved
|
|
976
1010
|
* @param oResourceBundle
|
|
977
1011
|
* @param bExecuteSideEffectsOnError
|
|
978
1012
|
* @param aBindings
|
|
979
1013
|
* @param messageHandler
|
|
980
|
-
* @returns
|
|
1014
|
+
* @returns Promise resolves with ???
|
|
981
1015
|
* @ui5-restricted
|
|
982
1016
|
* @final
|
|
983
1017
|
*/
|
|
984
|
-
saveDocument(oContext:
|
|
1018
|
+
saveDocument(oContext: V4Context, oResourceBundle: any, bExecuteSideEffectsOnError: any, aBindings: any, messageHandler: any) {
|
|
985
1019
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
986
1020
|
const that = this;
|
|
987
1021
|
const sProgrammingModel = this.getProgrammingModel(oContext);
|
|
@@ -1011,9 +1045,7 @@ class TransactionHelper {
|
|
|
1011
1045
|
: CommonUtils.getTranslatedText("C_TRANSACTION_HELPER_OBJECT_SAVED", oResourceBundle)
|
|
1012
1046
|
);
|
|
1013
1047
|
that._bIsModified = false;
|
|
1014
|
-
return
|
|
1015
|
-
return oActiveDocument;
|
|
1016
|
-
});
|
|
1048
|
+
return oActiveDocument;
|
|
1017
1049
|
})
|
|
1018
1050
|
.catch(function (err: any) {
|
|
1019
1051
|
if (aBindings && aBindings.length > 0) {
|
|
@@ -1040,19 +1072,19 @@ class TransactionHelper {
|
|
|
1040
1072
|
* @static
|
|
1041
1073
|
* @name sap.fe.core.TransactionHelper.callAction
|
|
1042
1074
|
* @memberof sap.fe.core.TransactionHelper
|
|
1043
|
-
* @param
|
|
1044
|
-
* @param
|
|
1045
|
-
* @param
|
|
1046
|
-
* @param
|
|
1047
|
-
* @param
|
|
1048
|
-
* @param
|
|
1049
|
-
* @param
|
|
1050
|
-
* @param
|
|
1075
|
+
* @param sActionName The name of the action to be called
|
|
1076
|
+
* @param [mParameters] Contains the following attributes:
|
|
1077
|
+
* @param [mParameters.contexts] Mandatory for a bound action: Either one context or an array with contexts for which the action is to be called
|
|
1078
|
+
* @param [mParameters.model] Mandatory for an unbound action: An instance of an OData V4 model
|
|
1079
|
+
* @param [mParameters.invocationGrouping] Mode how actions are to be called: 'ChangeSet' to put all action calls into one changeset, 'Isolated' to put them into separate changesets
|
|
1080
|
+
* @param [mParameters.label] A human-readable label for the action
|
|
1081
|
+
* @param [mParameters.bGetBoundContext] If specified, the action promise returns the bound context
|
|
1082
|
+
* @param oView Contains the object of the current view
|
|
1051
1083
|
* @param messageHandler
|
|
1052
|
-
* @returns
|
|
1084
|
+
* @returns Promise resolves with an array of response objects (TODO: to be changed)
|
|
1053
1085
|
* @ui5-restricted
|
|
1054
1086
|
* @final
|
|
1055
|
-
|
|
1087
|
+
*/
|
|
1056
1088
|
callAction(sActionName: string, mParameters: any, oView: View | null, messageHandler: any) {
|
|
1057
1089
|
mParameters = getParameters(mParameters);
|
|
1058
1090
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
@@ -1118,7 +1150,7 @@ class TransactionHelper {
|
|
|
1118
1150
|
const oDialogFragment = XMLTemplateProcessor.loadTemplate(sFragmentName, "fragment");
|
|
1119
1151
|
const oMetaModel = oModel.getMetaModel();
|
|
1120
1152
|
const sCanonicalPath = mParameters.contexts[0].getCanonicalPath();
|
|
1121
|
-
const sEntitySet = sCanonicalPath.substr(0, sCanonicalPath.indexOf("("))
|
|
1153
|
+
const sEntitySet = `${sCanonicalPath.substr(0, sCanonicalPath.indexOf("("))}/`;
|
|
1122
1154
|
const oDialogLabelModel = new JSONModel({
|
|
1123
1155
|
title: mParameters.label
|
|
1124
1156
|
});
|
|
@@ -1168,6 +1200,7 @@ class TransactionHelper {
|
|
|
1168
1200
|
BusyLocker.unlock(that.oLockObject);
|
|
1169
1201
|
},
|
|
1170
1202
|
parentControl: mParameters.parentControl,
|
|
1203
|
+
controlId: mParameters.controlId,
|
|
1171
1204
|
internalModelContext: mParameters.internalModelContext,
|
|
1172
1205
|
operationAvailableMap: mParameters.operationAvailableMap,
|
|
1173
1206
|
bIsCreateAction: mParameters.bIsCreateAction,
|
|
@@ -1220,9 +1253,9 @@ class TransactionHelper {
|
|
|
1220
1253
|
* @name sap.fe.core.TransactionHelper#_handleActionResponse
|
|
1221
1254
|
* @memberof sap.fe.core.TransactionHelper
|
|
1222
1255
|
* @param messageHandler
|
|
1223
|
-
* @param
|
|
1224
|
-
* @param
|
|
1225
|
-
* @returns
|
|
1256
|
+
* @param mParameters Parameters to be considered for the action.
|
|
1257
|
+
* @param sActionName The name of the action to be called
|
|
1258
|
+
* @returns Promise after message dialog is opened if required.
|
|
1226
1259
|
* @ui5-restricted
|
|
1227
1260
|
* @final
|
|
1228
1261
|
*/
|
|
@@ -1260,13 +1293,14 @@ class TransactionHelper {
|
|
|
1260
1293
|
* Shows a popover if it needs to be shown.
|
|
1261
1294
|
* TODO: Popover is shown if user has modified any data.
|
|
1262
1295
|
* TODO: Popover is shown if there's a difference from draft admin data.
|
|
1296
|
+
*
|
|
1263
1297
|
* @static
|
|
1264
1298
|
* @name sap.fe.core.TransactionHelper._showDiscardPopover
|
|
1265
1299
|
* @memberof sap.fe.core.TransactionHelper
|
|
1266
|
-
* @param
|
|
1300
|
+
* @param oCancelButton The control which will open the popover
|
|
1267
1301
|
* @param bIsModified
|
|
1268
1302
|
* @param oResourceBundle
|
|
1269
|
-
* @returns
|
|
1303
|
+
* @returns Promise resolves if user confirms discard, rejects if otherwise, rejects if no control passed to open popover
|
|
1270
1304
|
* @ui5-restricted
|
|
1271
1305
|
* @final
|
|
1272
1306
|
*/
|
|
@@ -1352,10 +1386,10 @@ class TransactionHelper {
|
|
|
1352
1386
|
* @private
|
|
1353
1387
|
* @name sap.fe.core.TransactionHelper._getOwnerComponent
|
|
1354
1388
|
* @memberof sap.fe.core.TransactionHelper
|
|
1355
|
-
* @returns
|
|
1389
|
+
* @returns The app component
|
|
1356
1390
|
* @ui5-restricted
|
|
1357
1391
|
* @final
|
|
1358
|
-
|
|
1392
|
+
*/
|
|
1359
1393
|
_getAppComponent() {
|
|
1360
1394
|
return this._oAppComponent;
|
|
1361
1395
|
}
|
|
@@ -1384,6 +1418,26 @@ class TransactionHelper {
|
|
|
1384
1418
|
});
|
|
1385
1419
|
}
|
|
1386
1420
|
}
|
|
1421
|
+
_getNonDeletableText(mParameters: any, vContexts: any, oResourceBundle: any) {
|
|
1422
|
+
const aNonDeletableContexts = mParameters.numberOfSelectedContexts - vContexts.concat(mParameters.unSavedContexts).length;
|
|
1423
|
+
return aNonDeletableContexts === 1
|
|
1424
|
+
? CommonUtils.getTranslatedText(
|
|
1425
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_ONE_OBJECT_NON_DELETABLE",
|
|
1426
|
+
oResourceBundle,
|
|
1427
|
+
[
|
|
1428
|
+
mParameters.numberOfSelectedContexts - vContexts.concat(mParameters.unSavedContexts).length,
|
|
1429
|
+
mParameters.numberOfSelectedContexts
|
|
1430
|
+
]
|
|
1431
|
+
)
|
|
1432
|
+
: CommonUtils.getTranslatedText(
|
|
1433
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_FEW_OBJECTS_NON_DELETABLE",
|
|
1434
|
+
oResourceBundle,
|
|
1435
|
+
[
|
|
1436
|
+
mParameters.numberOfSelectedContexts - vContexts.concat(mParameters.unSavedContexts).length,
|
|
1437
|
+
mParameters.numberOfSelectedContexts
|
|
1438
|
+
]
|
|
1439
|
+
);
|
|
1440
|
+
}
|
|
1387
1441
|
|
|
1388
1442
|
_launchDialogWithKeyFields(
|
|
1389
1443
|
oListBinding: any,
|
|
@@ -1410,10 +1464,13 @@ class TransactionHelper {
|
|
|
1410
1464
|
oEntitySetContext = oMetaModel.createBindingContext(sPath),
|
|
1411
1465
|
sMetaPath = oMetaModel.getMetaPath(sPath);
|
|
1412
1466
|
for (const i in mFields) {
|
|
1413
|
-
aImmutableFields.push(oMetaModel.createBindingContext(sMetaPath
|
|
1467
|
+
aImmutableFields.push(oMetaModel.createBindingContext(`${sMetaPath}/${mFields[i]}`));
|
|
1414
1468
|
}
|
|
1415
1469
|
const oImmutableCtxModel = new JSONModel(aImmutableFields);
|
|
1416
1470
|
const oImmutableCtx = oImmutableCtxModel.createBindingContext("/") as Context;
|
|
1471
|
+
const aRequiredProperties = CommonUtils.getRequiredPropertiesFromInsertRestrictions(sMetaPath, oMetaModel);
|
|
1472
|
+
const oRequiredPropertyPathsCtxModel = new JSONModel(aRequiredProperties);
|
|
1473
|
+
const oRequiredPropertyPathsCtx = oRequiredPropertyPathsCtxModel.createBindingContext("/") as Context;
|
|
1417
1474
|
return Promise.resolve(
|
|
1418
1475
|
XMLPreprocessor.process(
|
|
1419
1476
|
oFragment,
|
|
@@ -1421,16 +1478,18 @@ class TransactionHelper {
|
|
|
1421
1478
|
{
|
|
1422
1479
|
bindingContexts: {
|
|
1423
1480
|
entitySet: oEntitySetContext,
|
|
1424
|
-
fields: oImmutableCtx
|
|
1481
|
+
fields: oImmutableCtx,
|
|
1482
|
+
requiredProperties: oRequiredPropertyPathsCtx
|
|
1425
1483
|
},
|
|
1426
1484
|
models: {
|
|
1427
1485
|
entitySet: oEntitySetContext.getModel(),
|
|
1428
1486
|
fields: oImmutableCtx.getModel(),
|
|
1429
|
-
metaModel: oMetaModel
|
|
1487
|
+
metaModel: oMetaModel,
|
|
1488
|
+
requiredProperties: oRequiredPropertyPathsCtxModel
|
|
1430
1489
|
}
|
|
1431
1490
|
}
|
|
1432
1491
|
)
|
|
1433
|
-
).then(function (
|
|
1492
|
+
).then(function (oNewFragment: any) {
|
|
1434
1493
|
let aFormElements: any[] = [];
|
|
1435
1494
|
const mFieldValueMap: any = {};
|
|
1436
1495
|
let oCreateButton: Button;
|
|
@@ -1494,7 +1553,7 @@ class TransactionHelper {
|
|
|
1494
1553
|
}
|
|
1495
1554
|
};
|
|
1496
1555
|
return Fragment.load({
|
|
1497
|
-
definition:
|
|
1556
|
+
definition: oNewFragment,
|
|
1498
1557
|
controller: oController
|
|
1499
1558
|
}).then(function (oDialogContent: any) {
|
|
1500
1559
|
oDialog = new Dialog({
|
|
@@ -1504,8 +1563,8 @@ class TransactionHelper {
|
|
|
1504
1563
|
text: CommonUtils.getTranslatedText("C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE_BUTTON", oResourceBundle),
|
|
1505
1564
|
type: "Emphasized",
|
|
1506
1565
|
press: function (oEvent: any) {
|
|
1507
|
-
const
|
|
1508
|
-
|
|
1566
|
+
const createButton = oEvent.getSource();
|
|
1567
|
+
createButton.setEnabled(false);
|
|
1509
1568
|
BusyLocker.lock(oDialog);
|
|
1510
1569
|
mParameters.bIsCreateDialog = true;
|
|
1511
1570
|
return Promise.all(
|
|
@@ -1550,8 +1609,8 @@ class TransactionHelper {
|
|
|
1550
1609
|
})
|
|
1551
1610
|
.finally(function () {
|
|
1552
1611
|
BusyLocker.unlock(oDialog);
|
|
1553
|
-
|
|
1554
|
-
|
|
1612
|
+
createButton.setEnabled(true);
|
|
1613
|
+
messageHandler.showMessages();
|
|
1555
1614
|
});
|
|
1556
1615
|
}
|
|
1557
1616
|
},
|
|
@@ -1631,8 +1690,8 @@ class TransactionHelper {
|
|
|
1631
1690
|
.then(undefined, function () {
|
|
1632
1691
|
Log.trace("transient creation context deleted");
|
|
1633
1692
|
})
|
|
1634
|
-
.catch(function (
|
|
1635
|
-
Log.trace("transient creation context deletion error",
|
|
1693
|
+
.catch(function (contextError: any) {
|
|
1694
|
+
Log.trace("transient creation context deletion error", contextError);
|
|
1636
1695
|
});
|
|
1637
1696
|
if (!mParameters.bIsCreateDialog) {
|
|
1638
1697
|
// if current state is transient (...), browser will come back to previous state
|
|
@@ -1643,7 +1702,7 @@ class TransactionHelper {
|
|
|
1643
1702
|
}
|
|
1644
1703
|
fnResolve({ bKeepDialogOpen: true });
|
|
1645
1704
|
} else {
|
|
1646
|
-
|
|
1705
|
+
return oContext.created().then(fnResolve);
|
|
1647
1706
|
}
|
|
1648
1707
|
}
|
|
1649
1708
|
};
|
|
@@ -1658,14 +1717,14 @@ class TransactionHelper {
|
|
|
1658
1717
|
* @private
|
|
1659
1718
|
* @name sap.fe.core.TransactionHelper._getNewAction
|
|
1660
1719
|
* @memberof sap.fe.core.TransactionHelper
|
|
1661
|
-
* @param
|
|
1662
|
-
* @param
|
|
1663
|
-
* @param
|
|
1664
|
-
* @param
|
|
1665
|
-
* @returns
|
|
1720
|
+
* @param oStartupParameters Startup parameters of the application
|
|
1721
|
+
* @param sCreateHash Hash to be checked for action type
|
|
1722
|
+
* @param oMetaModel The MetaModel used to check for NewAction parameter
|
|
1723
|
+
* @param sMetaPath The MetaPath
|
|
1724
|
+
* @returns The name of the action
|
|
1666
1725
|
* @ui5-restricted
|
|
1667
1726
|
* @final
|
|
1668
|
-
|
|
1727
|
+
*/
|
|
1669
1728
|
_getNewAction(oStartupParameters: any, sCreateHash: string, oMetaModel: ODataMetaModel, sMetaPath: string) {
|
|
1670
1729
|
let sNewAction;
|
|
1671
1730
|
|
|
@@ -1676,8 +1735,8 @@ class TransactionHelper {
|
|
|
1676
1735
|
} else {
|
|
1677
1736
|
sNewAction =
|
|
1678
1737
|
oMetaModel && oMetaModel.getObject !== undefined
|
|
1679
|
-
? oMetaModel.getObject(sMetaPath
|
|
1680
|
-
oMetaModel.getObject(sMetaPath
|
|
1738
|
+
? oMetaModel.getObject(`${sMetaPath}@com.sap.vocabularies.Session.v1.StickySessionSupported/NewAction`) ||
|
|
1739
|
+
oMetaModel.getObject(`${sMetaPath}@com.sap.vocabularies.Common.v1.DraftRoot/NewAction`)
|
|
1681
1740
|
: undefined;
|
|
1682
1741
|
}
|
|
1683
1742
|
return sNewAction;
|
|
@@ -1695,14 +1754,14 @@ class TransactionHelper {
|
|
|
1695
1754
|
* @private
|
|
1696
1755
|
* @name sap.fe.core.TransactionHelper._getSpecificCreateActionDialogLabel
|
|
1697
1756
|
* @memberof sap.fe.core.TransactionHelper
|
|
1698
|
-
* @param
|
|
1699
|
-
* @param
|
|
1700
|
-
* @param
|
|
1701
|
-
* @param
|
|
1702
|
-
* @returns
|
|
1757
|
+
* @param oMetaModel The MetaModel used to check for the NewAction parameter
|
|
1758
|
+
* @param sMetaPath The MetaPath
|
|
1759
|
+
* @param sNewAction Contains the name of the action to be executed
|
|
1760
|
+
* @param oResourceBundleCore ResourceBundle to access the default Create label
|
|
1761
|
+
* @returns The label for the Create Action Dialog
|
|
1703
1762
|
* @ui5-restricted
|
|
1704
1763
|
* @final
|
|
1705
|
-
|
|
1764
|
+
*/
|
|
1706
1765
|
_getSpecificCreateActionDialogLabel(
|
|
1707
1766
|
oMetaModel: ODataMetaModel,
|
|
1708
1767
|
sMetaPath: string,
|
|
@@ -1710,15 +1769,15 @@ class TransactionHelper {
|
|
|
1710
1769
|
oResourceBundleCore: ResourceBundle
|
|
1711
1770
|
) {
|
|
1712
1771
|
const fnGetLabelFromLineItemAnnotation = function () {
|
|
1713
|
-
if (oMetaModel && oMetaModel.getObject(sMetaPath
|
|
1772
|
+
if (oMetaModel && oMetaModel.getObject(`${sMetaPath}/@com.sap.vocabularies.UI.v1.LineItem`)) {
|
|
1714
1773
|
const iLineItemIndex = oMetaModel
|
|
1715
|
-
.getObject(sMetaPath
|
|
1774
|
+
.getObject(`${sMetaPath}/@com.sap.vocabularies.UI.v1.LineItem`)
|
|
1716
1775
|
.findIndex(function (oLineItem: any) {
|
|
1717
1776
|
const aLineItemAction = oLineItem.Action ? oLineItem.Action.split("(") : undefined;
|
|
1718
1777
|
return aLineItemAction ? aLineItemAction[0] === sNewAction : false;
|
|
1719
1778
|
});
|
|
1720
1779
|
return iLineItemIndex > -1
|
|
1721
|
-
? oMetaModel.getObject(sMetaPath
|
|
1780
|
+
? oMetaModel.getObject(`${sMetaPath}/@com.sap.vocabularies.UI.v1.LineItem`)[iLineItemIndex].Label
|
|
1722
1781
|
: undefined;
|
|
1723
1782
|
} else {
|
|
1724
1783
|
return undefined;
|
|
@@ -1727,7 +1786,7 @@ class TransactionHelper {
|
|
|
1727
1786
|
|
|
1728
1787
|
return (
|
|
1729
1788
|
fnGetLabelFromLineItemAnnotation() ||
|
|
1730
|
-
(oMetaModel && oMetaModel.getObject(sMetaPath
|
|
1789
|
+
(oMetaModel && oMetaModel.getObject(`${sMetaPath}/${sNewAction}@com.sap.vocabularies.Common.v1.Label`)) ||
|
|
1731
1790
|
(oResourceBundleCore && oResourceBundleCore.getText("C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE"))
|
|
1732
1791
|
);
|
|
1733
1792
|
}
|