@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,7 +1,6 @@
|
|
|
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 AppComponent from "sap/fe/core/AppComponent";
|
|
3
|
+
import type AppComponent from "sap/fe/core/AppComponent";
|
|
5
4
|
import CommonUtils from "sap/fe/core/CommonUtils";
|
|
6
5
|
import BusyLocker from "sap/fe/core/controllerextensions/BusyLocker";
|
|
7
6
|
import draft from "sap/fe/core/controllerextensions/editFlow/draft";
|
|
@@ -9,7 +8,8 @@ import operations from "sap/fe/core/controllerextensions/editFlow/operations";
|
|
|
9
8
|
import sticky from "sap/fe/core/controllerextensions/editFlow/sticky";
|
|
10
9
|
import messageHandling from "sap/fe/core/controllerextensions/messageHandler/messageHandling";
|
|
11
10
|
import FPMHelper from "sap/fe/core/helpers/FPMHelper";
|
|
12
|
-
import
|
|
11
|
+
import type { InternalModelContext } from "sap/fe/core/helpers/ModelHelper";
|
|
12
|
+
import ModelHelper from "sap/fe/core/helpers/ModelHelper";
|
|
13
13
|
import FELibrary from "sap/fe/core/library";
|
|
14
14
|
import Button from "sap/m/Button";
|
|
15
15
|
import CheckBox from "sap/m/CheckBox";
|
|
@@ -22,13 +22,13 @@ import VBox from "sap/m/VBox";
|
|
|
22
22
|
import Core from "sap/ui/core/Core";
|
|
23
23
|
import Fragment from "sap/ui/core/Fragment";
|
|
24
24
|
import coreLibrary from "sap/ui/core/library";
|
|
25
|
-
import View from "sap/ui/core/mvc/View";
|
|
25
|
+
import type View from "sap/ui/core/mvc/View";
|
|
26
26
|
import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
|
|
27
27
|
import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
|
|
28
|
-
import Context from "sap/ui/model/Context";
|
|
28
|
+
import type Context from "sap/ui/model/Context";
|
|
29
29
|
import JSONModel from "sap/ui/model/json/JSONModel";
|
|
30
|
-
import ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
|
|
31
|
-
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";
|
|
32
32
|
|
|
33
33
|
const CreationMode = FELibrary.CreationMode;
|
|
34
34
|
const ProgrammingModel = FELibrary.ProgrammingModel;
|
|
@@ -71,7 +71,7 @@ class TransactionHelper {
|
|
|
71
71
|
return ProgrammingModel.NonDraft;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
return this.sProgrammingModel
|
|
74
|
+
return this.sProgrammingModel;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
/**
|
|
@@ -79,16 +79,16 @@ class TransactionHelper {
|
|
|
79
79
|
*
|
|
80
80
|
* @memberof sap.fe.core.TransactionHelper
|
|
81
81
|
* @static
|
|
82
|
-
* @param
|
|
83
|
-
* @param
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* @param
|
|
87
|
-
* @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
|
|
88
88
|
* @ui5-restricted
|
|
89
89
|
* @final
|
|
90
90
|
*/
|
|
91
|
-
validateDocument(oContext:
|
|
91
|
+
validateDocument(oContext: V4Context, mParameters: any, oView: View): Promise<any> {
|
|
92
92
|
const sCustomValidationFunction = mParameters && mParameters.customValidationFunction;
|
|
93
93
|
if (sCustomValidationFunction) {
|
|
94
94
|
const sModule = sCustomValidationFunction.substring(0, sCustomValidationFunction.lastIndexOf(".") || -1).replace(/\./gi, "/"),
|
|
@@ -108,22 +108,22 @@ class TransactionHelper {
|
|
|
108
108
|
*
|
|
109
109
|
* @memberof sap.fe.core.TransactionHelper
|
|
110
110
|
* @static
|
|
111
|
-
* @param
|
|
112
|
-
* @param
|
|
113
|
-
* @param
|
|
114
|
-
* @param
|
|
115
|
-
* @param
|
|
116
|
-
* @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
|
|
117
117
|
* @param oResourceBundle
|
|
118
118
|
* @param messageHandler
|
|
119
119
|
* @param bFromCopyPaste
|
|
120
120
|
* @param oView The current view
|
|
121
|
-
* @returns
|
|
121
|
+
* @returns Promise resolves with new binding context
|
|
122
122
|
* @ui5-restricted
|
|
123
123
|
* @final
|
|
124
124
|
*/
|
|
125
125
|
createDocument(
|
|
126
|
-
oMainListBinding:
|
|
126
|
+
oMainListBinding: ODataListBinding,
|
|
127
127
|
mInParameters: { data?: any; busyMode?: string | undefined; keepTransientContextOnFailed?: any; inactive?: boolean } | undefined,
|
|
128
128
|
oResourceBundle: any,
|
|
129
129
|
messageHandler: any,
|
|
@@ -143,18 +143,18 @@ class TransactionHelper {
|
|
|
143
143
|
: undefined;
|
|
144
144
|
let oCreationPromise;
|
|
145
145
|
const mBindingParameters: any = { "$$patchWithoutSideEffects": true };
|
|
146
|
-
const sMessagesPath = oMetaModel.getObject(sMetaPath
|
|
146
|
+
const sMessagesPath = oMetaModel.getObject(`${sMetaPath}/@com.sap.vocabularies.Common.v1.Messages/$Path`);
|
|
147
147
|
let sBusyPath = "/busy";
|
|
148
148
|
let sFunctionName =
|
|
149
|
-
oMetaModel.getObject(sMetaPath
|
|
149
|
+
oMetaModel.getObject(`${sMetaPath}@com.sap.vocabularies.Common.v1.DefaultValuesFunction`) ||
|
|
150
150
|
oMetaModel.getObject(
|
|
151
|
-
ModelHelper.getTargetEntitySet(oMetaModel.getContext(sMetaPath))
|
|
151
|
+
`${ModelHelper.getTargetEntitySet(oMetaModel.getContext(sMetaPath))}@com.sap.vocabularies.Common.v1.DefaultValuesFunction`
|
|
152
152
|
);
|
|
153
153
|
let bFunctionOnNavProp;
|
|
154
154
|
let oNewDocumentContext: any;
|
|
155
155
|
if (sFunctionName) {
|
|
156
156
|
if (
|
|
157
|
-
oMetaModel.getObject(sMetaPath
|
|
157
|
+
oMetaModel.getObject(`${sMetaPath}@com.sap.vocabularies.Common.v1.DefaultValuesFunction`) &&
|
|
158
158
|
ModelHelper.getTargetEntitySet(oMetaModel.getContext(sMetaPath)) !== sMetaPath
|
|
159
159
|
) {
|
|
160
160
|
bFunctionOnNavProp = true;
|
|
@@ -176,7 +176,7 @@ class TransactionHelper {
|
|
|
176
176
|
if (mParameters.busyMode === "Local") {
|
|
177
177
|
// in case of local busy mode we use the list binding name
|
|
178
178
|
// there's no APY yet so we have to use the .sId TODO provide a public method?
|
|
179
|
-
sBusyPath =
|
|
179
|
+
sBusyPath = `/busyLocal/${oMainListBinding.sId}`;
|
|
180
180
|
}
|
|
181
181
|
mParameters.beforeCreateCallBack = bFromCopyPaste ? null : mParameters.beforeCreateCallBack;
|
|
182
182
|
BusyLocker.lock(this.oLockObject, sBusyPath);
|
|
@@ -187,12 +187,7 @@ class TransactionHelper {
|
|
|
187
187
|
{
|
|
188
188
|
contexts: oMainListBinding.getHeaderContext(),
|
|
189
189
|
showActionParameterDialog: true,
|
|
190
|
-
label: this._getSpecificCreateActionDialogLabel(
|
|
191
|
-
oMetaModel,
|
|
192
|
-
sMetaPath,
|
|
193
|
-
sNewAction,
|
|
194
|
-
oResourceBundleCore as ResourceBundle
|
|
195
|
-
),
|
|
190
|
+
label: this._getSpecificCreateActionDialogLabel(oMetaModel, sMetaPath, sNewAction, oResourceBundleCore),
|
|
196
191
|
bindingParameters: mBindingParameters,
|
|
197
192
|
parentControl: mParameters.parentControl,
|
|
198
193
|
bIsCreateAction: true
|
|
@@ -213,16 +208,16 @@ class TransactionHelper {
|
|
|
213
208
|
if (bFunctionOnNavProp) {
|
|
214
209
|
sFunctionPath =
|
|
215
210
|
oMainListBinding.getContext() &&
|
|
216
|
-
oMetaModel.getMetaPath(oMainListBinding.getContext().getPath())
|
|
211
|
+
`${oMetaModel.getMetaPath(oMainListBinding.getContext().getPath())}/${sFunctionName}`;
|
|
217
212
|
oFunctionContext = oMainListBinding.getContext();
|
|
218
213
|
} else {
|
|
219
214
|
sFunctionPath =
|
|
220
215
|
oMainListBinding.getHeaderContext() &&
|
|
221
|
-
oMetaModel.getMetaPath(oMainListBinding.getHeaderContext().getPath())
|
|
216
|
+
`${oMetaModel.getMetaPath(oMainListBinding.getHeaderContext().getPath())}/${sFunctionName}`;
|
|
222
217
|
oFunctionContext = oMainListBinding.getHeaderContext();
|
|
223
218
|
}
|
|
224
219
|
}
|
|
225
|
-
const oFunction = sFunctionPath && oMetaModel.createBindingContext(sFunctionPath);
|
|
220
|
+
const oFunction = sFunctionPath && (oMetaModel.createBindingContext(sFunctionPath) as any);
|
|
226
221
|
if (oFunction && oFunction.getObject() && oFunction.getObject()[0].$IsBound) {
|
|
227
222
|
oCreationPromise = operations.callBoundFunction(sFunctionName, oFunctionContext, oModel);
|
|
228
223
|
} else {
|
|
@@ -238,7 +233,7 @@ class TransactionHelper {
|
|
|
238
233
|
}
|
|
239
234
|
})
|
|
240
235
|
.catch(function (oError: any) {
|
|
241
|
-
Log.error(
|
|
236
|
+
Log.error(`Error while executing the function ${sFunctionName}`, oError);
|
|
242
237
|
throw oError;
|
|
243
238
|
})
|
|
244
239
|
.then(function (oData: any) {
|
|
@@ -249,7 +244,7 @@ class TransactionHelper {
|
|
|
249
244
|
if (aNonComputedVisibleKeyFields.length > 0) {
|
|
250
245
|
const oTransientListBinding = oModel.bindList(oMainListBinding.getPath(), oMainListBinding.getContext(), [], [], {
|
|
251
246
|
$$updateGroupId: "submitLater"
|
|
252
|
-
});
|
|
247
|
+
}) as ODataListBinding;
|
|
253
248
|
oTransientListBinding.refreshInternal = function () {
|
|
254
249
|
/* */
|
|
255
250
|
};
|
|
@@ -328,25 +323,22 @@ class TransactionHelper {
|
|
|
328
323
|
*
|
|
329
324
|
* @memberof sap.fe.core.TransactionHelper
|
|
330
325
|
* @static
|
|
331
|
-
* @param
|
|
326
|
+
* @param aContexts Contexts Either one context or an array with contexts to be deleted
|
|
332
327
|
* @param bFindActiveContexts
|
|
333
|
-
* @returns
|
|
328
|
+
* @returns Array of the active contexts
|
|
334
329
|
*/
|
|
335
|
-
findActiveDraftRootContexts(aContexts:
|
|
330
|
+
findActiveDraftRootContexts(aContexts: V4Context[], bFindActiveContexts: any) {
|
|
336
331
|
if (!bFindActiveContexts) {
|
|
337
332
|
return Promise.resolve();
|
|
338
333
|
}
|
|
339
334
|
const activeContexts = aContexts.reduce(function (aResult: any, oContext: any) {
|
|
340
335
|
const oMetaModel = oContext.getModel().getMetaModel();
|
|
341
336
|
const sMetaPath = oMetaModel.getMetaPath(oContext.getPath());
|
|
342
|
-
if (oMetaModel.getObject(sMetaPath
|
|
337
|
+
if (oMetaModel.getObject(`${sMetaPath}@com.sap.vocabularies.Common.v1.DraftRoot`)) {
|
|
343
338
|
const bIsActiveEntity = oContext.getObject().IsActiveEntity,
|
|
344
339
|
bHasActiveEntity = oContext.getObject().HasActiveEntity;
|
|
345
340
|
if (!bIsActiveEntity && bHasActiveEntity) {
|
|
346
|
-
const oActiveContext = oContext
|
|
347
|
-
.getModel()
|
|
348
|
-
.bindContext(oContext.getPath() + "/SiblingEntity")
|
|
349
|
-
.getBoundContext();
|
|
341
|
+
const oActiveContext = oContext.getModel().bindContext(`${oContext.getPath()}/SiblingEntity`).getBoundContext();
|
|
350
342
|
aResult.push(oActiveContext);
|
|
351
343
|
}
|
|
352
344
|
}
|
|
@@ -354,14 +346,9 @@ class TransactionHelper {
|
|
|
354
346
|
}, []);
|
|
355
347
|
return Promise.all(
|
|
356
348
|
activeContexts.map(function (oContext: any) {
|
|
357
|
-
return oContext.requestCanonicalPath().then(
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
},
|
|
361
|
-
function () {
|
|
362
|
-
return;
|
|
363
|
-
}
|
|
364
|
-
);
|
|
349
|
+
return oContext.requestCanonicalPath().then(function () {
|
|
350
|
+
return oContext;
|
|
351
|
+
});
|
|
365
352
|
})
|
|
366
353
|
);
|
|
367
354
|
}
|
|
@@ -388,7 +375,7 @@ class TransactionHelper {
|
|
|
388
375
|
if (aContexts.length === 1) {
|
|
389
376
|
MessageToast.show(
|
|
390
377
|
CommonUtils.getTranslatedText(
|
|
391
|
-
"
|
|
378
|
+
"C_TRANSACTION_HELPER_DELETE_TOAST_SINGULAR",
|
|
392
379
|
oResourceBundle,
|
|
393
380
|
null,
|
|
394
381
|
mParameters.entitySetName
|
|
@@ -396,12 +383,7 @@ class TransactionHelper {
|
|
|
396
383
|
);
|
|
397
384
|
} else {
|
|
398
385
|
MessageToast.show(
|
|
399
|
-
CommonUtils.getTranslatedText(
|
|
400
|
-
"C_TRANSACTION_HELPER_OBJECT_PAGE_DELETE_TOAST_PLURAL",
|
|
401
|
-
oResourceBundle,
|
|
402
|
-
null,
|
|
403
|
-
mParameters.entitySetName
|
|
404
|
-
)
|
|
386
|
+
CommonUtils.getTranslatedText("C_TRANSACTION_HELPER_DELETE_TOAST_PLURAL", oResourceBundle, null, mParameters.entitySetName)
|
|
405
387
|
);
|
|
406
388
|
}
|
|
407
389
|
}
|
|
@@ -410,17 +392,17 @@ class TransactionHelper {
|
|
|
410
392
|
*
|
|
411
393
|
* @memberof sap.fe.core.TransactionHelper
|
|
412
394
|
* @static
|
|
413
|
-
* @param
|
|
414
|
-
* @param
|
|
415
|
-
* @param
|
|
416
|
-
* @param
|
|
417
|
-
* @param
|
|
418
|
-
* @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
|
|
419
401
|
* @param oResourceBundle
|
|
420
402
|
* @param messageHandler
|
|
421
|
-
* @returns
|
|
403
|
+
* @returns A Promise resolved once the document are deleted
|
|
422
404
|
*/
|
|
423
|
-
deleteDocument(
|
|
405
|
+
deleteDocument(vInContexts: V4Context, mParameters: any, oResourceBundle: any, messageHandler: any) {
|
|
424
406
|
let fnReject: Function,
|
|
425
407
|
fnResolve: Function,
|
|
426
408
|
aDeletableContexts: any[] = [],
|
|
@@ -431,15 +413,18 @@ class TransactionHelper {
|
|
|
431
413
|
bDialogConfirmed = false;
|
|
432
414
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
433
415
|
const that = this,
|
|
434
|
-
oResourceBundleCore = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core")
|
|
416
|
+
oResourceBundleCore = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core");
|
|
435
417
|
let aParams;
|
|
436
418
|
let oDeleteMessage: any = {
|
|
437
|
-
title: oResourceBundleCore.getText("
|
|
419
|
+
title: oResourceBundleCore.getText("C_COMMON_DELETE")
|
|
438
420
|
};
|
|
439
421
|
messageHandling.removeBoundTransitionMessages();
|
|
440
422
|
BusyLocker.lock(this.oLockObject);
|
|
441
|
-
|
|
442
|
-
|
|
423
|
+
let vContexts: V4Context[];
|
|
424
|
+
if (Array.isArray(vInContexts)) {
|
|
425
|
+
vContexts = vInContexts;
|
|
426
|
+
} else {
|
|
427
|
+
vContexts = [vInContexts];
|
|
443
428
|
}
|
|
444
429
|
Promise.resolve(this.getProgrammingModel(vContexts[0]))
|
|
445
430
|
.then(function (sProgrammingModel: any) {
|
|
@@ -455,13 +440,20 @@ class TransactionHelper {
|
|
|
455
440
|
oContextData.DraftAdministrativeData.InProcessByUser &&
|
|
456
441
|
!oContextData.DraftAdministrativeData.DraftIsCreatedByMe
|
|
457
442
|
) {
|
|
443
|
+
let sLockedUser = "";
|
|
444
|
+
const draftAdminData = oContextData && oContextData.DraftAdministrativeData;
|
|
445
|
+
if (draftAdminData) {
|
|
446
|
+
sLockedUser = draftAdminData["InProcessByUser"];
|
|
447
|
+
}
|
|
448
|
+
aParams = [sLockedUser];
|
|
458
449
|
MessageBox.show(
|
|
459
450
|
CommonUtils.getTranslatedText(
|
|
460
|
-
"
|
|
461
|
-
oResourceBundle
|
|
451
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_SINGLE_OBJECT_LOCKED",
|
|
452
|
+
oResourceBundle,
|
|
453
|
+
aParams
|
|
462
454
|
),
|
|
463
455
|
{
|
|
464
|
-
title: oResourceBundleCore.getText("
|
|
456
|
+
title: oResourceBundleCore.getText("C_COMMON_DELETE"),
|
|
465
457
|
onClose: fnReject
|
|
466
458
|
}
|
|
467
459
|
);
|
|
@@ -472,35 +464,76 @@ class TransactionHelper {
|
|
|
472
464
|
mParameters = getParameters(mParameters);
|
|
473
465
|
if (mParameters.title) {
|
|
474
466
|
if (mParameters.description) {
|
|
475
|
-
aParams = [mParameters.title, mParameters.description];
|
|
467
|
+
aParams = [mParameters.title, mParameters.description + " "];
|
|
476
468
|
} else {
|
|
477
469
|
aParams = [mParameters.title, ""];
|
|
478
470
|
}
|
|
479
471
|
oDeleteMessage.text = CommonUtils.getTranslatedText(
|
|
480
|
-
"
|
|
472
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO",
|
|
481
473
|
oResourceBundle,
|
|
482
474
|
aParams,
|
|
483
475
|
mParameters.entitySetName
|
|
484
476
|
);
|
|
485
477
|
} else {
|
|
486
478
|
oDeleteMessage.text = CommonUtils.getTranslatedText(
|
|
487
|
-
"
|
|
479
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_SINGULAR",
|
|
488
480
|
oResourceBundle
|
|
489
481
|
);
|
|
490
482
|
}
|
|
491
483
|
aDeletableContexts = vContexts;
|
|
492
484
|
} else {
|
|
493
485
|
oDeleteMessage = {
|
|
494
|
-
title: oResourceBundleCore.getText("
|
|
486
|
+
title: oResourceBundleCore.getText("C_COMMON_DELETE")
|
|
495
487
|
};
|
|
496
488
|
if (mParameters.numberOfSelectedContexts === 1 && mParameters.numberOfSelectedContexts === vContexts.length) {
|
|
497
489
|
aDeletableContexts = vContexts;
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
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
|
+
}
|
|
504
537
|
} else if (mParameters.numberOfSelectedContexts === 1 && mParameters.unSavedContexts.length === 1) {
|
|
505
538
|
//only one unsaved object
|
|
506
539
|
aDeletableContexts = mParameters.unSavedContexts;
|
|
@@ -512,7 +545,7 @@ class TransactionHelper {
|
|
|
512
545
|
}
|
|
513
546
|
aParams = [sLastChangedByUser];
|
|
514
547
|
oDeleteMessage.text = CommonUtils.getTranslatedText(
|
|
515
|
-
"
|
|
548
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_UNSAVED_CHANGES",
|
|
516
549
|
oResourceBundle,
|
|
517
550
|
aParams
|
|
518
551
|
);
|
|
@@ -520,7 +553,7 @@ class TransactionHelper {
|
|
|
520
553
|
//only multiple unsaved objects
|
|
521
554
|
aDeletableContexts = mParameters.unSavedContexts;
|
|
522
555
|
oDeleteMessage.text = CommonUtils.getTranslatedText(
|
|
523
|
-
"
|
|
556
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_UNSAVED_CHANGES_MULTIPLE_OBJECTS",
|
|
524
557
|
oResourceBundle
|
|
525
558
|
);
|
|
526
559
|
} else if (
|
|
@@ -532,13 +565,13 @@ class TransactionHelper {
|
|
|
532
565
|
oDeleteMessage.text =
|
|
533
566
|
aDeletableContexts.length === 1
|
|
534
567
|
? CommonUtils.getTranslatedText(
|
|
535
|
-
"
|
|
568
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_SINGULAR",
|
|
536
569
|
oResourceBundle,
|
|
537
570
|
null,
|
|
538
571
|
mParameters.entitySetName
|
|
539
572
|
)
|
|
540
573
|
: CommonUtils.getTranslatedText(
|
|
541
|
-
"
|
|
574
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_PLURAL",
|
|
542
575
|
oResourceBundle,
|
|
543
576
|
null,
|
|
544
577
|
mParameters.entitySetName
|
|
@@ -550,25 +583,18 @@ class TransactionHelper {
|
|
|
550
583
|
oDeleteMessage.text =
|
|
551
584
|
aDeletableContexts.length === 1
|
|
552
585
|
? CommonUtils.getTranslatedText(
|
|
553
|
-
"
|
|
586
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_SINGULAR_NON_DELETABLE",
|
|
554
587
|
oResourceBundle,
|
|
555
588
|
null,
|
|
556
589
|
mParameters.entitySetName
|
|
557
590
|
)
|
|
558
591
|
: CommonUtils.getTranslatedText(
|
|
559
|
-
"
|
|
592
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTTITLE_PLURAL_NON_DELETABLE",
|
|
560
593
|
oResourceBundle,
|
|
561
|
-
|
|
594
|
+
[aDeletableContexts.length],
|
|
562
595
|
mParameters.entitySetName
|
|
563
596
|
);
|
|
564
|
-
oDeleteMessage.nonDeletableText =
|
|
565
|
-
"C_TRANSACTION_HELPER_OBJECT_PAGE_CONFIRM_DELETE_WITH_OBJECTINFO_AND_FEW_OBJECTS_NON_DELETABLE",
|
|
566
|
-
oResourceBundle,
|
|
567
|
-
[
|
|
568
|
-
mParameters.numberOfSelectedContexts - vContexts.concat(mParameters.unSavedContexts).length,
|
|
569
|
-
mParameters.numberOfSelectedContexts
|
|
570
|
-
]
|
|
571
|
-
);
|
|
597
|
+
oDeleteMessage.nonDeletableText = that._getNonDeletableText(mParameters, vContexts, oResourceBundle);
|
|
572
598
|
}
|
|
573
599
|
if (mParameters.lockedContexts.length == 1) {
|
|
574
600
|
//setting the locked text if locked objects exist
|
|
@@ -601,24 +627,24 @@ class TransactionHelper {
|
|
|
601
627
|
aDeletableContexts = mParameters.unSavedContexts;
|
|
602
628
|
if (mParameters.unSavedContexts.length === 1) {
|
|
603
629
|
oDeleteMessage.text = CommonUtils.getTranslatedText(
|
|
604
|
-
"
|
|
630
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_UNSAVED_AND_FEW_OBJECTS_LOCKED_SINGULAR",
|
|
605
631
|
oResourceBundle
|
|
606
632
|
);
|
|
607
633
|
} else {
|
|
608
634
|
oDeleteMessage.text = CommonUtils.getTranslatedText(
|
|
609
|
-
"
|
|
635
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_UNSAVED_AND_FEW_OBJECTS_LOCKED_PLURAL",
|
|
610
636
|
oResourceBundle
|
|
611
637
|
);
|
|
612
638
|
}
|
|
613
639
|
} else {
|
|
614
640
|
if (mParameters.unSavedContexts.length === 1) {
|
|
615
641
|
oDeleteMessage.checkBoxText = CommonUtils.getTranslatedText(
|
|
616
|
-
"
|
|
642
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_FEW_OBJECTS_UNSAVED_SINGULAR",
|
|
617
643
|
oResourceBundle
|
|
618
644
|
);
|
|
619
645
|
} else {
|
|
620
646
|
oDeleteMessage.checkBoxText = CommonUtils.getTranslatedText(
|
|
621
|
-
"
|
|
647
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_FEW_OBJECTS_UNSAVED_PLURAL",
|
|
622
648
|
oResourceBundle
|
|
623
649
|
);
|
|
624
650
|
}
|
|
@@ -626,31 +652,28 @@ class TransactionHelper {
|
|
|
626
652
|
}
|
|
627
653
|
}
|
|
628
654
|
if (cannotBeDeletedTextVisible && isLockedTextVisible) {
|
|
655
|
+
//if non-deletable objects exist along with deletable objects
|
|
656
|
+
const sNonDeletableContextText = that._getNonDeletableText(mParameters, vContexts, oResourceBundle);
|
|
629
657
|
//if both locked and non-deletable objects exist along with deletable objects
|
|
630
658
|
if (mParameters.unSavedContexts.length > 1) {
|
|
631
|
-
oDeleteMessage.nonDeletableText =
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
mParameters.numberOfSelectedContexts
|
|
640
|
-
]
|
|
641
|
-
);
|
|
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
|
+
);
|
|
642
667
|
}
|
|
643
668
|
if (mParameters.unSavedContexts.length == 1) {
|
|
644
|
-
oDeleteMessage.nonDeletableText =
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
]
|
|
653
|
-
);
|
|
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
|
+
);
|
|
654
677
|
}
|
|
655
678
|
}
|
|
656
679
|
}
|
|
@@ -682,7 +705,7 @@ class TransactionHelper {
|
|
|
682
705
|
})
|
|
683
706
|
]
|
|
684
707
|
});
|
|
685
|
-
const sTitle = oResourceBundleCore.getText("
|
|
708
|
+
const sTitle = oResourceBundleCore.getText("C_COMMON_DELETE");
|
|
686
709
|
const fnConfirm = function () {
|
|
687
710
|
bDialogConfirmed = true;
|
|
688
711
|
BusyLocker.lock(that.oLockObject);
|
|
@@ -744,7 +767,7 @@ class TransactionHelper {
|
|
|
744
767
|
? [oNonDeletableMessageTextControl, oDeleteMessageTextControl]
|
|
745
768
|
: oDeleteMessageTextControl,
|
|
746
769
|
beginButton: new Button({
|
|
747
|
-
text: oResourceBundleCore.getText("
|
|
770
|
+
text: oResourceBundleCore.getText("C_COMMON_DELETE"),
|
|
748
771
|
type: "Emphasized",
|
|
749
772
|
press: function () {
|
|
750
773
|
oDialog.close();
|
|
@@ -789,14 +812,14 @@ class TransactionHelper {
|
|
|
789
812
|
*
|
|
790
813
|
* @memberof sap.fe.core.TransactionHelper
|
|
791
814
|
* @static
|
|
792
|
-
* @param
|
|
793
|
-
* @param
|
|
815
|
+
* @param oContext Context of the active document
|
|
816
|
+
* @param oView Current view
|
|
794
817
|
* @param messageHandler
|
|
795
|
-
* @returns
|
|
818
|
+
* @returns Promise resolves with the new draft context in case of draft programming model
|
|
796
819
|
* @ui5-restricted
|
|
797
820
|
* @final
|
|
798
821
|
*/
|
|
799
|
-
editDocument(oContext:
|
|
822
|
+
editDocument(oContext: V4Context, oView: View, messageHandler: any) {
|
|
800
823
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
801
824
|
const that = this;
|
|
802
825
|
const sProgrammingModel = this.getProgrammingModel(oContext);
|
|
@@ -827,7 +850,7 @@ class TransactionHelper {
|
|
|
827
850
|
});
|
|
828
851
|
})
|
|
829
852
|
.catch(function (err: any) {
|
|
830
|
-
return messageHandler.showMessages().then(function () {
|
|
853
|
+
return messageHandler.showMessages({ concurrentEditFlag: true }).then(function () {
|
|
831
854
|
return Promise.reject(err);
|
|
832
855
|
});
|
|
833
856
|
})
|
|
@@ -840,18 +863,18 @@ class TransactionHelper {
|
|
|
840
863
|
*
|
|
841
864
|
* @memberof sap.fe.core.TransactionHelper
|
|
842
865
|
* @static
|
|
843
|
-
* @param
|
|
844
|
-
* @param
|
|
845
|
-
* @param
|
|
846
|
-
* @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
|
|
847
870
|
* @param oResourceBundle
|
|
848
871
|
* @param messageHandler
|
|
849
|
-
* @returns
|
|
872
|
+
* @returns Promise resolves with ???
|
|
850
873
|
* @ui5-restricted
|
|
851
874
|
* @final
|
|
852
875
|
*/
|
|
853
876
|
cancelDocument(
|
|
854
|
-
oContext:
|
|
877
|
+
oContext: V4Context,
|
|
855
878
|
mInParameters: { cancelButton: any; skipDiscardPopover: boolean } | undefined,
|
|
856
879
|
oResourceBundle: any,
|
|
857
880
|
messageHandler: any
|
|
@@ -873,7 +896,7 @@ class TransactionHelper {
|
|
|
873
896
|
.then(function (sPModel: any) {
|
|
874
897
|
sProgrammingModel = sPModel;
|
|
875
898
|
if (sPModel === ProgrammingModel.Draft) {
|
|
876
|
-
const draftDataContext = oModel.bindContext(oParamsContext.getPath()
|
|
899
|
+
const draftDataContext = oModel.bindContext(`${oParamsContext.getPath()}/DraftAdministrativeData`).getBoundContext();
|
|
877
900
|
if (!that._bIsModified) {
|
|
878
901
|
return draftDataContext.requestObject().then(function (draftAdminData: any) {
|
|
879
902
|
if (draftAdminData) {
|
|
@@ -902,6 +925,8 @@ class TransactionHelper {
|
|
|
902
925
|
// eslint-disable-next-line default-case
|
|
903
926
|
switch (sProgrammingModel) {
|
|
904
927
|
case ProgrammingModel.Draft:
|
|
928
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
929
|
+
// @ts-ignore
|
|
905
930
|
return oParamsContext.requestObject("HasActiveEntity").then(function (bHasActiveEntity: any) {
|
|
906
931
|
let oDeletePromise;
|
|
907
932
|
if (!bHasActiveEntity) {
|
|
@@ -911,7 +936,7 @@ class TransactionHelper {
|
|
|
911
936
|
oDeletePromise = draft.deleteDraft(oParamsContext);
|
|
912
937
|
return oDeletePromise;
|
|
913
938
|
} else {
|
|
914
|
-
let oActiveContext = oModel.bindContext(oParamsContext.getPath()
|
|
939
|
+
let oActiveContext = oModel.bindContext(`${oParamsContext.getPath()}/SiblingEntity`).getBoundContext();
|
|
915
940
|
return oActiveContext
|
|
916
941
|
.requestCanonicalPath()
|
|
917
942
|
.then(
|
|
@@ -925,7 +950,6 @@ class TransactionHelper {
|
|
|
925
950
|
},
|
|
926
951
|
function () {
|
|
927
952
|
draft.deleteDraft(oParamsContext);
|
|
928
|
-
return;
|
|
929
953
|
}
|
|
930
954
|
)
|
|
931
955
|
.then(function () {
|
|
@@ -943,14 +967,14 @@ class TransactionHelper {
|
|
|
943
967
|
}
|
|
944
968
|
});
|
|
945
969
|
case ProgrammingModel.Sticky:
|
|
946
|
-
return sticky.discardDocument(oContext).then(function (
|
|
947
|
-
if (
|
|
948
|
-
if (
|
|
949
|
-
|
|
970
|
+
return sticky.discardDocument(oContext).then(function (discardedContext: any) {
|
|
971
|
+
if (discardedContext) {
|
|
972
|
+
if (discardedContext.hasPendingChanges()) {
|
|
973
|
+
discardedContext.getBinding().resetChanges();
|
|
950
974
|
}
|
|
951
975
|
if (!that._bCreateMode) {
|
|
952
|
-
|
|
953
|
-
return
|
|
976
|
+
discardedContext.refresh();
|
|
977
|
+
return discardedContext;
|
|
954
978
|
}
|
|
955
979
|
}
|
|
956
980
|
return false;
|
|
@@ -982,16 +1006,16 @@ class TransactionHelper {
|
|
|
982
1006
|
*
|
|
983
1007
|
* @memberof sap.fe.core.TransactionHelper
|
|
984
1008
|
* @static
|
|
985
|
-
* @param
|
|
1009
|
+
* @param oContext Context of the document to be saved
|
|
986
1010
|
* @param oResourceBundle
|
|
987
1011
|
* @param bExecuteSideEffectsOnError
|
|
988
1012
|
* @param aBindings
|
|
989
1013
|
* @param messageHandler
|
|
990
|
-
* @returns
|
|
1014
|
+
* @returns Promise resolves with ???
|
|
991
1015
|
* @ui5-restricted
|
|
992
1016
|
* @final
|
|
993
1017
|
*/
|
|
994
|
-
saveDocument(oContext:
|
|
1018
|
+
saveDocument(oContext: V4Context, oResourceBundle: any, bExecuteSideEffectsOnError: any, aBindings: any, messageHandler: any) {
|
|
995
1019
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
996
1020
|
const that = this;
|
|
997
1021
|
const sProgrammingModel = this.getProgrammingModel(oContext);
|
|
@@ -1006,8 +1030,7 @@ class TransactionHelper {
|
|
|
1006
1030
|
if (sProgrammingModel === ProgrammingModel.Draft) {
|
|
1007
1031
|
oSavePromise = draft.activateDocument(oContext, this._getAppComponent(), {});
|
|
1008
1032
|
} else if (sProgrammingModel === ProgrammingModel.Sticky) {
|
|
1009
|
-
|
|
1010
|
-
oSavePromise = sticky.activateDocument(oContext, bEnableStrictHandling);
|
|
1033
|
+
oSavePromise = sticky.activateDocument(oContext);
|
|
1011
1034
|
} else {
|
|
1012
1035
|
BusyLocker.unlock(that.oLockObject);
|
|
1013
1036
|
return Promise.reject(new Error("Save is only allowed for draft or sticky session supported services"));
|
|
@@ -1022,9 +1045,7 @@ class TransactionHelper {
|
|
|
1022
1045
|
: CommonUtils.getTranslatedText("C_TRANSACTION_HELPER_OBJECT_SAVED", oResourceBundle)
|
|
1023
1046
|
);
|
|
1024
1047
|
that._bIsModified = false;
|
|
1025
|
-
return
|
|
1026
|
-
return oActiveDocument;
|
|
1027
|
-
});
|
|
1048
|
+
return oActiveDocument;
|
|
1028
1049
|
})
|
|
1029
1050
|
.catch(function (err: any) {
|
|
1030
1051
|
if (aBindings && aBindings.length > 0) {
|
|
@@ -1051,19 +1072,19 @@ class TransactionHelper {
|
|
|
1051
1072
|
* @static
|
|
1052
1073
|
* @name sap.fe.core.TransactionHelper.callAction
|
|
1053
1074
|
* @memberof sap.fe.core.TransactionHelper
|
|
1054
|
-
* @param
|
|
1055
|
-
* @param
|
|
1056
|
-
* @param
|
|
1057
|
-
* @param
|
|
1058
|
-
* @param
|
|
1059
|
-
* @param
|
|
1060
|
-
* @param
|
|
1061
|
-
* @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
|
|
1062
1083
|
* @param messageHandler
|
|
1063
|
-
* @returns
|
|
1084
|
+
* @returns Promise resolves with an array of response objects (TODO: to be changed)
|
|
1064
1085
|
* @ui5-restricted
|
|
1065
1086
|
* @final
|
|
1066
|
-
|
|
1087
|
+
*/
|
|
1067
1088
|
callAction(sActionName: string, mParameters: any, oView: View | null, messageHandler: any) {
|
|
1068
1089
|
mParameters = getParameters(mParameters);
|
|
1069
1090
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
@@ -1129,7 +1150,7 @@ class TransactionHelper {
|
|
|
1129
1150
|
const oDialogFragment = XMLTemplateProcessor.loadTemplate(sFragmentName, "fragment");
|
|
1130
1151
|
const oMetaModel = oModel.getMetaModel();
|
|
1131
1152
|
const sCanonicalPath = mParameters.contexts[0].getCanonicalPath();
|
|
1132
|
-
const sEntitySet = sCanonicalPath.substr(0, sCanonicalPath.indexOf("("))
|
|
1153
|
+
const sEntitySet = `${sCanonicalPath.substr(0, sCanonicalPath.indexOf("("))}/`;
|
|
1133
1154
|
const oDialogLabelModel = new JSONModel({
|
|
1134
1155
|
title: mParameters.label
|
|
1135
1156
|
});
|
|
@@ -1232,9 +1253,9 @@ class TransactionHelper {
|
|
|
1232
1253
|
* @name sap.fe.core.TransactionHelper#_handleActionResponse
|
|
1233
1254
|
* @memberof sap.fe.core.TransactionHelper
|
|
1234
1255
|
* @param messageHandler
|
|
1235
|
-
* @param
|
|
1236
|
-
* @param
|
|
1237
|
-
* @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.
|
|
1238
1259
|
* @ui5-restricted
|
|
1239
1260
|
* @final
|
|
1240
1261
|
*/
|
|
@@ -1272,13 +1293,14 @@ class TransactionHelper {
|
|
|
1272
1293
|
* Shows a popover if it needs to be shown.
|
|
1273
1294
|
* TODO: Popover is shown if user has modified any data.
|
|
1274
1295
|
* TODO: Popover is shown if there's a difference from draft admin data.
|
|
1296
|
+
*
|
|
1275
1297
|
* @static
|
|
1276
1298
|
* @name sap.fe.core.TransactionHelper._showDiscardPopover
|
|
1277
1299
|
* @memberof sap.fe.core.TransactionHelper
|
|
1278
|
-
* @param
|
|
1300
|
+
* @param oCancelButton The control which will open the popover
|
|
1279
1301
|
* @param bIsModified
|
|
1280
1302
|
* @param oResourceBundle
|
|
1281
|
-
* @returns
|
|
1303
|
+
* @returns Promise resolves if user confirms discard, rejects if otherwise, rejects if no control passed to open popover
|
|
1282
1304
|
* @ui5-restricted
|
|
1283
1305
|
* @final
|
|
1284
1306
|
*/
|
|
@@ -1364,10 +1386,10 @@ class TransactionHelper {
|
|
|
1364
1386
|
* @private
|
|
1365
1387
|
* @name sap.fe.core.TransactionHelper._getOwnerComponent
|
|
1366
1388
|
* @memberof sap.fe.core.TransactionHelper
|
|
1367
|
-
* @returns
|
|
1389
|
+
* @returns The app component
|
|
1368
1390
|
* @ui5-restricted
|
|
1369
1391
|
* @final
|
|
1370
|
-
|
|
1392
|
+
*/
|
|
1371
1393
|
_getAppComponent() {
|
|
1372
1394
|
return this._oAppComponent;
|
|
1373
1395
|
}
|
|
@@ -1396,6 +1418,26 @@ class TransactionHelper {
|
|
|
1396
1418
|
});
|
|
1397
1419
|
}
|
|
1398
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
|
+
}
|
|
1399
1441
|
|
|
1400
1442
|
_launchDialogWithKeyFields(
|
|
1401
1443
|
oListBinding: any,
|
|
@@ -1422,10 +1464,13 @@ class TransactionHelper {
|
|
|
1422
1464
|
oEntitySetContext = oMetaModel.createBindingContext(sPath),
|
|
1423
1465
|
sMetaPath = oMetaModel.getMetaPath(sPath);
|
|
1424
1466
|
for (const i in mFields) {
|
|
1425
|
-
aImmutableFields.push(oMetaModel.createBindingContext(sMetaPath
|
|
1467
|
+
aImmutableFields.push(oMetaModel.createBindingContext(`${sMetaPath}/${mFields[i]}`));
|
|
1426
1468
|
}
|
|
1427
1469
|
const oImmutableCtxModel = new JSONModel(aImmutableFields);
|
|
1428
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;
|
|
1429
1474
|
return Promise.resolve(
|
|
1430
1475
|
XMLPreprocessor.process(
|
|
1431
1476
|
oFragment,
|
|
@@ -1433,16 +1478,18 @@ class TransactionHelper {
|
|
|
1433
1478
|
{
|
|
1434
1479
|
bindingContexts: {
|
|
1435
1480
|
entitySet: oEntitySetContext,
|
|
1436
|
-
fields: oImmutableCtx
|
|
1481
|
+
fields: oImmutableCtx,
|
|
1482
|
+
requiredProperties: oRequiredPropertyPathsCtx
|
|
1437
1483
|
},
|
|
1438
1484
|
models: {
|
|
1439
1485
|
entitySet: oEntitySetContext.getModel(),
|
|
1440
1486
|
fields: oImmutableCtx.getModel(),
|
|
1441
|
-
metaModel: oMetaModel
|
|
1487
|
+
metaModel: oMetaModel,
|
|
1488
|
+
requiredProperties: oRequiredPropertyPathsCtxModel
|
|
1442
1489
|
}
|
|
1443
1490
|
}
|
|
1444
1491
|
)
|
|
1445
|
-
).then(function (
|
|
1492
|
+
).then(function (oNewFragment: any) {
|
|
1446
1493
|
let aFormElements: any[] = [];
|
|
1447
1494
|
const mFieldValueMap: any = {};
|
|
1448
1495
|
let oCreateButton: Button;
|
|
@@ -1506,7 +1553,7 @@ class TransactionHelper {
|
|
|
1506
1553
|
}
|
|
1507
1554
|
};
|
|
1508
1555
|
return Fragment.load({
|
|
1509
|
-
definition:
|
|
1556
|
+
definition: oNewFragment,
|
|
1510
1557
|
controller: oController
|
|
1511
1558
|
}).then(function (oDialogContent: any) {
|
|
1512
1559
|
oDialog = new Dialog({
|
|
@@ -1516,8 +1563,8 @@ class TransactionHelper {
|
|
|
1516
1563
|
text: CommonUtils.getTranslatedText("C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE_BUTTON", oResourceBundle),
|
|
1517
1564
|
type: "Emphasized",
|
|
1518
1565
|
press: function (oEvent: any) {
|
|
1519
|
-
const
|
|
1520
|
-
|
|
1566
|
+
const createButton = oEvent.getSource();
|
|
1567
|
+
createButton.setEnabled(false);
|
|
1521
1568
|
BusyLocker.lock(oDialog);
|
|
1522
1569
|
mParameters.bIsCreateDialog = true;
|
|
1523
1570
|
return Promise.all(
|
|
@@ -1562,8 +1609,8 @@ class TransactionHelper {
|
|
|
1562
1609
|
})
|
|
1563
1610
|
.finally(function () {
|
|
1564
1611
|
BusyLocker.unlock(oDialog);
|
|
1565
|
-
|
|
1566
|
-
|
|
1612
|
+
createButton.setEnabled(true);
|
|
1613
|
+
messageHandler.showMessages();
|
|
1567
1614
|
});
|
|
1568
1615
|
}
|
|
1569
1616
|
},
|
|
@@ -1643,8 +1690,8 @@ class TransactionHelper {
|
|
|
1643
1690
|
.then(undefined, function () {
|
|
1644
1691
|
Log.trace("transient creation context deleted");
|
|
1645
1692
|
})
|
|
1646
|
-
.catch(function (
|
|
1647
|
-
Log.trace("transient creation context deletion error",
|
|
1693
|
+
.catch(function (contextError: any) {
|
|
1694
|
+
Log.trace("transient creation context deletion error", contextError);
|
|
1648
1695
|
});
|
|
1649
1696
|
if (!mParameters.bIsCreateDialog) {
|
|
1650
1697
|
// if current state is transient (...), browser will come back to previous state
|
|
@@ -1655,7 +1702,7 @@ class TransactionHelper {
|
|
|
1655
1702
|
}
|
|
1656
1703
|
fnResolve({ bKeepDialogOpen: true });
|
|
1657
1704
|
} else {
|
|
1658
|
-
|
|
1705
|
+
return oContext.created().then(fnResolve);
|
|
1659
1706
|
}
|
|
1660
1707
|
}
|
|
1661
1708
|
};
|
|
@@ -1670,14 +1717,14 @@ class TransactionHelper {
|
|
|
1670
1717
|
* @private
|
|
1671
1718
|
* @name sap.fe.core.TransactionHelper._getNewAction
|
|
1672
1719
|
* @memberof sap.fe.core.TransactionHelper
|
|
1673
|
-
* @param
|
|
1674
|
-
* @param
|
|
1675
|
-
* @param
|
|
1676
|
-
* @param
|
|
1677
|
-
* @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
|
|
1678
1725
|
* @ui5-restricted
|
|
1679
1726
|
* @final
|
|
1680
|
-
|
|
1727
|
+
*/
|
|
1681
1728
|
_getNewAction(oStartupParameters: any, sCreateHash: string, oMetaModel: ODataMetaModel, sMetaPath: string) {
|
|
1682
1729
|
let sNewAction;
|
|
1683
1730
|
|
|
@@ -1688,8 +1735,8 @@ class TransactionHelper {
|
|
|
1688
1735
|
} else {
|
|
1689
1736
|
sNewAction =
|
|
1690
1737
|
oMetaModel && oMetaModel.getObject !== undefined
|
|
1691
|
-
? oMetaModel.getObject(sMetaPath
|
|
1692
|
-
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`)
|
|
1693
1740
|
: undefined;
|
|
1694
1741
|
}
|
|
1695
1742
|
return sNewAction;
|
|
@@ -1707,14 +1754,14 @@ class TransactionHelper {
|
|
|
1707
1754
|
* @private
|
|
1708
1755
|
* @name sap.fe.core.TransactionHelper._getSpecificCreateActionDialogLabel
|
|
1709
1756
|
* @memberof sap.fe.core.TransactionHelper
|
|
1710
|
-
* @param
|
|
1711
|
-
* @param
|
|
1712
|
-
* @param
|
|
1713
|
-
* @param
|
|
1714
|
-
* @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
|
|
1715
1762
|
* @ui5-restricted
|
|
1716
1763
|
* @final
|
|
1717
|
-
|
|
1764
|
+
*/
|
|
1718
1765
|
_getSpecificCreateActionDialogLabel(
|
|
1719
1766
|
oMetaModel: ODataMetaModel,
|
|
1720
1767
|
sMetaPath: string,
|
|
@@ -1722,15 +1769,15 @@ class TransactionHelper {
|
|
|
1722
1769
|
oResourceBundleCore: ResourceBundle
|
|
1723
1770
|
) {
|
|
1724
1771
|
const fnGetLabelFromLineItemAnnotation = function () {
|
|
1725
|
-
if (oMetaModel && oMetaModel.getObject(sMetaPath
|
|
1772
|
+
if (oMetaModel && oMetaModel.getObject(`${sMetaPath}/@com.sap.vocabularies.UI.v1.LineItem`)) {
|
|
1726
1773
|
const iLineItemIndex = oMetaModel
|
|
1727
|
-
.getObject(sMetaPath
|
|
1774
|
+
.getObject(`${sMetaPath}/@com.sap.vocabularies.UI.v1.LineItem`)
|
|
1728
1775
|
.findIndex(function (oLineItem: any) {
|
|
1729
1776
|
const aLineItemAction = oLineItem.Action ? oLineItem.Action.split("(") : undefined;
|
|
1730
1777
|
return aLineItemAction ? aLineItemAction[0] === sNewAction : false;
|
|
1731
1778
|
});
|
|
1732
1779
|
return iLineItemIndex > -1
|
|
1733
|
-
? oMetaModel.getObject(sMetaPath
|
|
1780
|
+
? oMetaModel.getObject(`${sMetaPath}/@com.sap.vocabularies.UI.v1.LineItem`)[iLineItemIndex].Label
|
|
1734
1781
|
: undefined;
|
|
1735
1782
|
} else {
|
|
1736
1783
|
return undefined;
|
|
@@ -1739,7 +1786,7 @@ class TransactionHelper {
|
|
|
1739
1786
|
|
|
1740
1787
|
return (
|
|
1741
1788
|
fnGetLabelFromLineItemAnnotation() ||
|
|
1742
|
-
(oMetaModel && oMetaModel.getObject(sMetaPath
|
|
1789
|
+
(oMetaModel && oMetaModel.getObject(`${sMetaPath}/${sNewAction}@com.sap.vocabularies.Common.v1.Label`)) ||
|
|
1743
1790
|
(oResourceBundleCore && oResourceBundleCore.getText("C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE"))
|
|
1744
1791
|
);
|
|
1745
1792
|
}
|