@sapui5/sap.fe.core 1.102.2 → 1.104.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AppComponent.js +73 -30
- package/src/sap/fe/core/AppComponent.ts +65 -43
- package/src/sap/fe/core/AppStateHandler.js +82 -70
- package/src/sap/fe/core/AppStateHandler.ts +32 -37
- package/src/sap/fe/core/BaseController.js +11 -9
- package/src/sap/fe/core/BaseController.ts +15 -13
- package/src/sap/fe/core/CommonUtils.js +227 -126
- package/src/sap/fe/core/CommonUtils.ts +240 -163
- package/src/sap/fe/core/ExtensionAPI.js +24 -27
- package/src/sap/fe/core/ExtensionAPI.ts +36 -38
- package/src/sap/fe/core/PageController.js +4 -4
- package/src/sap/fe/core/PageController.ts +4 -5
- package/src/sap/fe/core/TemplateComponent.js +1 -1
- package/src/sap/fe/core/TemplateComponent.ts +6 -6
- package/src/sap/fe/core/TemplateModel.js +1 -1
- package/src/sap/fe/core/TemplateModel.ts +1 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel.js +1 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +1 -1
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +181 -43
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +150 -24
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +585 -210
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +246 -96
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +30 -30
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +32 -29
- package/src/sap/fe/core/controllerextensions/EditFlow.js +379 -330
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +253 -245
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +9 -9
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +10 -10
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +101 -74
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +69 -79
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +67 -67
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +76 -76
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +85 -77
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +103 -99
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +66 -68
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +106 -123
- package/src/sap/fe/core/controllerextensions/MassEdit.js +9 -9
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +20 -27
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +20 -12
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +21 -14
- package/src/sap/fe/core/controllerextensions/PageReady.js +97 -25
- package/src/sap/fe/core/controllerextensions/PageReady.ts +98 -34
- package/src/sap/fe/core/controllerextensions/Paginator.js +21 -22
- package/src/sap/fe/core/controllerextensions/Paginator.ts +24 -25
- package/src/sap/fe/core/controllerextensions/Placeholder.js +4 -6
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
- package/src/sap/fe/core/controllerextensions/Routing.js +10 -11
- package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
- package/src/sap/fe/core/controllerextensions/Share.js +170 -139
- package/src/sap/fe/core/controllerextensions/Share.ts +117 -118
- package/src/sap/fe/core/controllerextensions/SideEffects.js +46 -50
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +56 -60
- package/src/sap/fe/core/controllerextensions/ViewState.js +200 -131
- package/src/sap/fe/core/controllerextensions/ViewState.ts +141 -148
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +5 -5
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +8 -7
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +11 -10
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.ts +17 -20
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +2 -2
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +4 -4
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +7 -9
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.ts +18 -19
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +190 -141
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +258 -210
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +183 -125
- package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +213 -156
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js +164 -140
- package/src/sap/fe/core/controllerextensions/editFlow/operations.ts +180 -150
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +24 -26
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +35 -33
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +71 -41
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +102 -82
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +61 -71
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +56 -64
- package/src/sap/fe/core/controls/Any.js +9 -5
- package/src/sap/fe/core/controls/Any.ts +10 -4
- package/src/sap/fe/core/controls/CommandExecution.js +11 -25
- package/src/sap/fe/core/controls/CommandExecution.ts +11 -25
- package/src/sap/fe/core/controls/ConditionalWrapper.js +2 -2
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +3 -3
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +22 -22
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +25 -24
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +2 -2
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +2 -2
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +3 -3
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +5 -5
- package/src/sap/fe/core/controls/FieldWrapper.js +2 -2
- package/src/sap/fe/core/controls/FieldWrapper.ts +3 -3
- package/src/sap/fe/core/controls/FileWrapper.js +7 -2
- package/src/sap/fe/core/controls/FileWrapper.ts +15 -11
- package/src/sap/fe/core/controls/FilterBar.js +6 -2
- package/src/sap/fe/core/controls/FilterBar.ts +13 -9
- package/src/sap/fe/core/controls/FormElementWrapper.js +1 -1
- package/src/sap/fe/core/controls/FormElementWrapper.ts +2 -2
- package/src/sap/fe/core/controls/MassEditSelect.js +1 -1
- package/src/sap/fe/core/controls/MassEditSelect.ts +0 -4
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +3 -3
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +16 -12
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +20 -22
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -3
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +8 -8
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +49 -49
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +54 -54
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +8 -2
- package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +22 -35
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +89 -88
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +107 -106
- package/src/sap/fe/core/converters/ConverterContext.js +26 -33
- package/src/sap/fe/core/converters/ConverterContext.ts +52 -61
- package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +17 -15
- package/src/sap/fe/core/converters/ManifestWrapper.js +59 -45
- package/src/sap/fe/core/converters/ManifestWrapper.ts +55 -45
- package/src/sap/fe/core/converters/MetaModelConverter.js +64 -35
- package/src/sap/fe/core/converters/MetaModelConverter.ts +154 -129
- package/src/sap/fe/core/converters/TemplateConverter.js +21 -20
- package/src/sap/fe/core/converters/TemplateConverter.ts +27 -24
- package/src/sap/fe/core/converters/annotations/DataField.js +58 -35
- package/src/sap/fe/core/converters/annotations/DataField.ts +102 -76
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +1911 -1495
- package/src/sap/fe/core/converters/controls/Common/Action.js +50 -41
- package/src/sap/fe/core/converters/controls/Common/Action.ts +56 -46
- package/src/sap/fe/core/converters/controls/Common/Chart.js +14 -14
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +26 -33
- package/src/sap/fe/core/converters/controls/Common/Criticality.js +3 -3
- package/src/sap/fe/core/converters/controls/Common/Criticality.ts +4 -4
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +30 -28
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +60 -61
- package/src/sap/fe/core/converters/controls/Common/Form.js +27 -28
- package/src/sap/fe/core/converters/controls/Common/Form.ts +44 -57
- package/src/sap/fe/core/converters/controls/Common/KPI.js +11 -11
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +49 -52
- package/src/sap/fe/core/converters/controls/Common/Table.js +181 -197
- package/src/sap/fe/core/converters/controls/Common/Table.ts +251 -280
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +119 -119
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +144 -141
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +45 -41
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +65 -59
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +28 -26
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +46 -43
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.js +9 -9
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.ts +14 -13
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +67 -64
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +69 -66
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +77 -73
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +101 -97
- package/src/sap/fe/core/converters/helpers/Aggregation.js +2 -4
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +12 -15
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +31 -31
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +30 -29
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +4 -4
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +9 -9
- package/src/sap/fe/core/converters/helpers/ID.js +48 -46
- package/src/sap/fe/core/converters/helpers/ID.ts +26 -25
- package/src/sap/fe/core/converters/helpers/Key.js +7 -7
- package/src/sap/fe/core/converters/helpers/Key.ts +7 -7
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.js +1 -1
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.ts +4 -5
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +6 -6
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +10 -10
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +46 -62
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +54 -82
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +55 -42
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +81 -66
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +39 -38
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +52 -61
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +4 -4
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +4 -4
- package/src/sap/fe/core/formatters/CollaborationFormatter.js +2 -2
- package/src/sap/fe/core/formatters/CollaborationFormatter.ts +3 -3
- package/src/sap/fe/core/formatters/FPMFormatter.js +5 -5
- package/src/sap/fe/core/formatters/FPMFormatter.ts +10 -10
- package/src/sap/fe/core/formatters/KPIFormatter.js +7 -7
- package/src/sap/fe/core/formatters/KPIFormatter.ts +10 -10
- package/src/sap/fe/core/formatters/StandardFormatter.js +96 -0
- package/src/sap/fe/core/formatters/StandardFormatter.ts +70 -0
- package/src/sap/fe/core/formatters/TableFormatter.js +11 -11
- package/src/sap/fe/core/formatters/TableFormatter.ts +12 -12
- package/src/sap/fe/core/formatters/ValueFormatter.js +8 -8
- package/src/sap/fe/core/formatters/ValueFormatter.ts +9 -9
- package/src/sap/fe/core/helpers/AppStartupHelper.js +15 -15
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +37 -40
- package/src/sap/fe/core/helpers/BindingToolkit.js +1832 -0
- package/src/sap/fe/core/helpers/{BindingExpression.ts → BindingToolkit.ts} +396 -269
- package/src/sap/fe/core/helpers/ClassSupport.js +49 -12
- package/src/sap/fe/core/helpers/ClassSupport.ts +37 -10
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +2 -2
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +1 -1
- package/src/sap/fe/core/helpers/EditState.js +1 -6
- package/src/sap/fe/core/helpers/EditState.ts +5 -10
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +2 -2
- package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +4 -4
- package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
- package/src/sap/fe/core/helpers/FPMHelper.ts +2 -2
- package/src/sap/fe/core/helpers/KeepAliveHelper.js +31 -31
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +52 -56
- package/src/sap/fe/core/helpers/MassEditHelper.js +306 -280
- package/src/sap/fe/core/helpers/MassEditHelper.ts +380 -360
- package/src/sap/fe/core/helpers/MessageStrip.js +81 -0
- package/src/sap/fe/core/helpers/MessageStrip.ts +79 -0
- package/src/sap/fe/core/helpers/ModelHelper.js +25 -25
- package/src/sap/fe/core/helpers/ModelHelper.ts +34 -32
- package/src/sap/fe/core/helpers/PasteHelper.js +3 -10
- package/src/sap/fe/core/helpers/PasteHelper.ts +20 -25
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +1 -1
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +11 -11
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +3 -3
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +8 -8
- package/src/sap/fe/core/helpers/StableIdHelper.js +12 -12
- package/src/sap/fe/core/helpers/StableIdHelper.ts +12 -12
- package/src/sap/fe/core/helpers/ToES6Promise.js +32 -0
- package/src/sap/fe/core/helpers/ToES6Promise.ts +19 -0
- package/src/sap/fe/core/jsx-runtime/Fragment.js +16 -0
- package/src/sap/fe/core/jsx-runtime/Fragment.ts +3 -0
- package/src/sap/fe/core/jsx-runtime/jsx-control.js +99 -0
- package/src/sap/fe/core/jsx-runtime/jsx-control.ts +82 -0
- package/src/sap/fe/core/jsx-runtime/jsx-xml.js +105 -0
- package/src/sap/fe/core/jsx-runtime/jsx-xml.ts +89 -0
- package/src/sap/fe/core/jsx-runtime/jsx.js +12 -90
- package/src/sap/fe/core/jsx-runtime/jsx.ts +24 -85
- package/src/sap/fe/core/library.js +42 -3
- package/src/sap/fe/core/library.ts +38 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +3 -3
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +2 -2
- package/src/sap/fe/core/messagebundle.properties +39 -63
- package/src/sap/fe/core/messagebundle_ar.properties +25 -39
- package/src/sap/fe/core/messagebundle_bg.properties +25 -39
- package/src/sap/fe/core/messagebundle_ca.properties +25 -39
- package/src/sap/fe/core/messagebundle_cs.properties +25 -39
- package/src/sap/fe/core/messagebundle_cy.properties +25 -39
- package/src/sap/fe/core/messagebundle_da.properties +25 -39
- package/src/sap/fe/core/messagebundle_de.properties +25 -39
- package/src/sap/fe/core/messagebundle_el.properties +26 -40
- package/src/sap/fe/core/messagebundle_en.properties +25 -39
- package/src/sap/fe/core/messagebundle_en_GB.properties +25 -39
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +25 -39
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +25 -39
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +26 -18
- package/src/sap/fe/core/messagebundle_es.properties +27 -41
- package/src/sap/fe/core/messagebundle_es_MX.properties +25 -39
- package/src/sap/fe/core/messagebundle_et.properties +25 -39
- package/src/sap/fe/core/messagebundle_fi.properties +25 -39
- package/src/sap/fe/core/messagebundle_fr.properties +26 -40
- package/src/sap/fe/core/messagebundle_fr_CA.properties +25 -39
- package/src/sap/fe/core/messagebundle_hi.properties +25 -39
- package/src/sap/fe/core/messagebundle_hr.properties +25 -39
- package/src/sap/fe/core/messagebundle_hu.properties +25 -39
- package/src/sap/fe/core/messagebundle_id.properties +25 -39
- package/src/sap/fe/core/messagebundle_it.properties +41 -55
- package/src/sap/fe/core/messagebundle_iw.properties +25 -39
- package/src/sap/fe/core/messagebundle_ja.properties +25 -39
- package/src/sap/fe/core/messagebundle_kk.properties +25 -39
- package/src/sap/fe/core/messagebundle_ko.properties +30 -44
- package/src/sap/fe/core/messagebundle_lt.properties +25 -39
- package/src/sap/fe/core/messagebundle_lv.properties +25 -39
- package/src/sap/fe/core/messagebundle_ms.properties +25 -39
- package/src/sap/fe/core/messagebundle_nl.properties +27 -41
- package/src/sap/fe/core/messagebundle_no.properties +25 -39
- package/src/sap/fe/core/messagebundle_pl.properties +26 -40
- package/src/sap/fe/core/messagebundle_pt.properties +26 -40
- package/src/sap/fe/core/messagebundle_pt_PT.properties +25 -39
- package/src/sap/fe/core/messagebundle_ro.properties +25 -39
- package/src/sap/fe/core/messagebundle_ru.properties +25 -39
- package/src/sap/fe/core/messagebundle_sh.properties +25 -39
- package/src/sap/fe/core/messagebundle_sk.properties +25 -39
- package/src/sap/fe/core/messagebundle_sl.properties +25 -39
- package/src/sap/fe/core/messagebundle_sv.properties +25 -39
- package/src/sap/fe/core/messagebundle_th.properties +25 -39
- package/src/sap/fe/core/messagebundle_tr.properties +25 -39
- package/src/sap/fe/core/messagebundle_uk.properties +25 -39
- package/src/sap/fe/core/messagebundle_vi.properties +25 -39
- package/src/sap/fe/core/messagebundle_zh_CN.properties +25 -39
- package/src/sap/fe/core/messagebundle_zh_TW.properties +25 -39
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +5 -5
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +97 -69
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +68 -69
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +1 -1
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +3 -2
- package/src/sap/fe/core/services/NavigationServiceFactory.js +61 -49
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +63 -52
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +2 -2
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +4 -4
- package/src/sap/fe/core/services/RoutingServiceFactory.js +55 -55
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +67 -65
- package/src/sap/fe/core/services/ShellServicesFactory.js +92 -76
- package/src/sap/fe/core/services/ShellServicesFactory.ts +95 -82
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +61 -61
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +102 -92
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +224 -198
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +138 -139
- package/src/sap/fe/core/support/CommonHelper.js +3 -2
- package/src/sap/fe/core/support/CommonHelper.ts +9 -13
- package/src/sap/fe/core/support/Diagnostics.js +1 -1
- package/src/sap/fe/core/support/Diagnostics.ts +5 -5
- package/src/sap/fe/core/templating/CommonFormatters.js +84 -0
- package/src/sap/fe/core/templating/CommonFormatters.ts +86 -0
- package/src/sap/fe/core/templating/CriticalityFormatters.js +31 -31
- package/src/sap/fe/core/templating/CriticalityFormatters.ts +42 -40
- package/src/sap/fe/core/templating/DataFieldFormatters.js +8 -8
- package/src/sap/fe/core/templating/DataFieldFormatters.ts +13 -10
- package/src/sap/fe/core/templating/DataModelPathHelper.js +16 -15
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +42 -32
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +1 -1
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +2 -3
- package/src/sap/fe/core/templating/EntitySetHelper.js +7 -7
- package/src/sap/fe/core/templating/EntitySetHelper.ts +6 -8
- package/src/sap/fe/core/templating/FieldControlHelper.js +35 -34
- package/src/sap/fe/core/templating/FieldControlHelper.ts +29 -46
- package/src/sap/fe/core/templating/FilterHelper.js +16 -15
- package/src/sap/fe/core/templating/FilterHelper.ts +18 -18
- package/src/sap/fe/core/templating/FilterTemplating.js +1 -1
- package/src/sap/fe/core/templating/FilterTemplating.ts +3 -3
- package/src/sap/fe/core/templating/PropertyFormatters.js +7 -7
- package/src/sap/fe/core/templating/PropertyFormatters.ts +21 -19
- package/src/sap/fe/core/templating/PropertyHelper.js +25 -25
- package/src/sap/fe/core/templating/PropertyHelper.ts +25 -26
- package/src/sap/fe/core/templating/UIFormatters.js +152 -95
- package/src/sap/fe/core/templating/UIFormatters.ts +202 -128
- package/src/sap/fe/core/type/Email.js +2 -2
- package/src/sap/fe/core/type/Email.ts +2 -2
- package/src/sap/fe/core/helpers/BindingExpression.js +0 -1732
|
@@ -1,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,31 +583,24 @@ 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
|
|
575
601
|
isLockedTextVisible = true;
|
|
576
602
|
oDeleteMessage.nonDeletableText = CommonUtils.getTranslatedText(
|
|
577
|
-
"
|
|
603
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_ONE_OBJECT_LOCKED",
|
|
578
604
|
oResourceBundle,
|
|
579
605
|
[mParameters.numberOfSelectedContexts]
|
|
580
606
|
);
|
|
@@ -583,7 +609,7 @@ class TransactionHelper {
|
|
|
583
609
|
//setting the locked text if locked objects exist
|
|
584
610
|
isLockedTextVisible = true;
|
|
585
611
|
oDeleteMessage.nonDeletableText = CommonUtils.getTranslatedText(
|
|
586
|
-
"
|
|
612
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_FEW_OBJECTS_LOCKED",
|
|
587
613
|
oResourceBundle,
|
|
588
614
|
[mParameters.lockedContexts.length, mParameters.numberOfSelectedContexts]
|
|
589
615
|
);
|
|
@@ -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",
|
|
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",
|
|
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);
|
|
@@ -745,7 +768,7 @@ class TransactionHelper {
|
|
|
745
768
|
? [oNonDeletableMessageTextControl, oDeleteMessageTextControl]
|
|
746
769
|
: oDeleteMessageTextControl,
|
|
747
770
|
beginButton: new Button({
|
|
748
|
-
text: oResourceBundleCore.getText("
|
|
771
|
+
text: oResourceBundleCore.getText("C_COMMON_DELETE"),
|
|
749
772
|
type: "Emphasized",
|
|
750
773
|
press: function () {
|
|
751
774
|
oDialog.close();
|
|
@@ -790,14 +813,14 @@ class TransactionHelper {
|
|
|
790
813
|
*
|
|
791
814
|
* @memberof sap.fe.core.TransactionHelper
|
|
792
815
|
* @static
|
|
793
|
-
* @param
|
|
794
|
-
* @param
|
|
816
|
+
* @param oContext Context of the active document
|
|
817
|
+
* @param oView Current view
|
|
795
818
|
* @param messageHandler
|
|
796
|
-
* @returns
|
|
819
|
+
* @returns Promise resolves with the new draft context in case of draft programming model
|
|
797
820
|
* @ui5-restricted
|
|
798
821
|
* @final
|
|
799
822
|
*/
|
|
800
|
-
editDocument(oContext:
|
|
823
|
+
editDocument(oContext: V4Context, oView: View, messageHandler: any) {
|
|
801
824
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
802
825
|
const that = this;
|
|
803
826
|
const sProgrammingModel = this.getProgrammingModel(oContext);
|
|
@@ -841,18 +864,18 @@ class TransactionHelper {
|
|
|
841
864
|
*
|
|
842
865
|
* @memberof sap.fe.core.TransactionHelper
|
|
843
866
|
* @static
|
|
844
|
-
* @param
|
|
845
|
-
* @param
|
|
846
|
-
* @param
|
|
847
|
-
* @param
|
|
867
|
+
* @param oContext Context of the document to be canceled or deleted
|
|
868
|
+
* @param [mInParameters] Optional, can contain the following attributes:
|
|
869
|
+
* @param mInParameters.cancelButton Cancel Button of the discard popover (mandatory for now)
|
|
870
|
+
* @param mInParameters.skipDiscardPopover Optional, supresses the discard popover incase of draft applications while navigating out of OP
|
|
848
871
|
* @param oResourceBundle
|
|
849
872
|
* @param messageHandler
|
|
850
|
-
* @returns
|
|
873
|
+
* @returns Promise resolves with ???
|
|
851
874
|
* @ui5-restricted
|
|
852
875
|
* @final
|
|
853
876
|
*/
|
|
854
877
|
cancelDocument(
|
|
855
|
-
oContext:
|
|
878
|
+
oContext: V4Context,
|
|
856
879
|
mInParameters: { cancelButton: any; skipDiscardPopover: boolean } | undefined,
|
|
857
880
|
oResourceBundle: any,
|
|
858
881
|
messageHandler: any
|
|
@@ -874,7 +897,7 @@ class TransactionHelper {
|
|
|
874
897
|
.then(function (sPModel: any) {
|
|
875
898
|
sProgrammingModel = sPModel;
|
|
876
899
|
if (sPModel === ProgrammingModel.Draft) {
|
|
877
|
-
const draftDataContext = oModel.bindContext(oParamsContext.getPath()
|
|
900
|
+
const draftDataContext = oModel.bindContext(`${oParamsContext.getPath()}/DraftAdministrativeData`).getBoundContext();
|
|
878
901
|
if (!that._bIsModified) {
|
|
879
902
|
return draftDataContext.requestObject().then(function (draftAdminData: any) {
|
|
880
903
|
if (draftAdminData) {
|
|
@@ -903,6 +926,8 @@ class TransactionHelper {
|
|
|
903
926
|
// eslint-disable-next-line default-case
|
|
904
927
|
switch (sProgrammingModel) {
|
|
905
928
|
case ProgrammingModel.Draft:
|
|
929
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
930
|
+
// @ts-ignore
|
|
906
931
|
return oParamsContext.requestObject("HasActiveEntity").then(function (bHasActiveEntity: any) {
|
|
907
932
|
let oDeletePromise;
|
|
908
933
|
if (!bHasActiveEntity) {
|
|
@@ -912,7 +937,7 @@ class TransactionHelper {
|
|
|
912
937
|
oDeletePromise = draft.deleteDraft(oParamsContext);
|
|
913
938
|
return oDeletePromise;
|
|
914
939
|
} else {
|
|
915
|
-
let oActiveContext = oModel.bindContext(oParamsContext.getPath()
|
|
940
|
+
let oActiveContext = oModel.bindContext(`${oParamsContext.getPath()}/SiblingEntity`).getBoundContext();
|
|
916
941
|
return oActiveContext
|
|
917
942
|
.requestCanonicalPath()
|
|
918
943
|
.then(
|
|
@@ -926,7 +951,6 @@ class TransactionHelper {
|
|
|
926
951
|
},
|
|
927
952
|
function () {
|
|
928
953
|
draft.deleteDraft(oParamsContext);
|
|
929
|
-
return;
|
|
930
954
|
}
|
|
931
955
|
)
|
|
932
956
|
.then(function () {
|
|
@@ -944,14 +968,14 @@ class TransactionHelper {
|
|
|
944
968
|
}
|
|
945
969
|
});
|
|
946
970
|
case ProgrammingModel.Sticky:
|
|
947
|
-
return sticky.discardDocument(oContext).then(function (
|
|
948
|
-
if (
|
|
949
|
-
if (
|
|
950
|
-
|
|
971
|
+
return sticky.discardDocument(oContext).then(function (discardedContext: any) {
|
|
972
|
+
if (discardedContext) {
|
|
973
|
+
if (discardedContext.hasPendingChanges()) {
|
|
974
|
+
discardedContext.getBinding().resetChanges();
|
|
951
975
|
}
|
|
952
976
|
if (!that._bCreateMode) {
|
|
953
|
-
|
|
954
|
-
return
|
|
977
|
+
discardedContext.refresh();
|
|
978
|
+
return discardedContext;
|
|
955
979
|
}
|
|
956
980
|
}
|
|
957
981
|
return false;
|
|
@@ -983,16 +1007,16 @@ class TransactionHelper {
|
|
|
983
1007
|
*
|
|
984
1008
|
* @memberof sap.fe.core.TransactionHelper
|
|
985
1009
|
* @static
|
|
986
|
-
* @param
|
|
1010
|
+
* @param oContext Context of the document to be saved
|
|
987
1011
|
* @param oResourceBundle
|
|
988
1012
|
* @param bExecuteSideEffectsOnError
|
|
989
1013
|
* @param aBindings
|
|
990
1014
|
* @param messageHandler
|
|
991
|
-
* @returns
|
|
1015
|
+
* @returns Promise resolves with ???
|
|
992
1016
|
* @ui5-restricted
|
|
993
1017
|
* @final
|
|
994
1018
|
*/
|
|
995
|
-
saveDocument(oContext:
|
|
1019
|
+
saveDocument(oContext: V4Context, oResourceBundle: any, bExecuteSideEffectsOnError: any, aBindings: any, messageHandler: any) {
|
|
996
1020
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
997
1021
|
const that = this;
|
|
998
1022
|
const sProgrammingModel = this.getProgrammingModel(oContext);
|
|
@@ -1007,8 +1031,7 @@ class TransactionHelper {
|
|
|
1007
1031
|
if (sProgrammingModel === ProgrammingModel.Draft) {
|
|
1008
1032
|
oSavePromise = draft.activateDocument(oContext, this._getAppComponent(), {});
|
|
1009
1033
|
} else if (sProgrammingModel === ProgrammingModel.Sticky) {
|
|
1010
|
-
|
|
1011
|
-
oSavePromise = sticky.activateDocument(oContext, bEnableStrictHandling);
|
|
1034
|
+
oSavePromise = sticky.activateDocument(oContext);
|
|
1012
1035
|
} else {
|
|
1013
1036
|
BusyLocker.unlock(that.oLockObject);
|
|
1014
1037
|
return Promise.reject(new Error("Save is only allowed for draft or sticky session supported services"));
|
|
@@ -1023,9 +1046,7 @@ class TransactionHelper {
|
|
|
1023
1046
|
: CommonUtils.getTranslatedText("C_TRANSACTION_HELPER_OBJECT_SAVED", oResourceBundle)
|
|
1024
1047
|
);
|
|
1025
1048
|
that._bIsModified = false;
|
|
1026
|
-
return
|
|
1027
|
-
return oActiveDocument;
|
|
1028
|
-
});
|
|
1049
|
+
return oActiveDocument;
|
|
1029
1050
|
})
|
|
1030
1051
|
.catch(function (err: any) {
|
|
1031
1052
|
if (aBindings && aBindings.length > 0) {
|
|
@@ -1052,19 +1073,19 @@ class TransactionHelper {
|
|
|
1052
1073
|
* @static
|
|
1053
1074
|
* @name sap.fe.core.TransactionHelper.callAction
|
|
1054
1075
|
* @memberof sap.fe.core.TransactionHelper
|
|
1055
|
-
* @param
|
|
1056
|
-
* @param
|
|
1057
|
-
* @param
|
|
1058
|
-
* @param
|
|
1059
|
-
* @param
|
|
1060
|
-
* @param
|
|
1061
|
-
* @param
|
|
1062
|
-
* @param
|
|
1076
|
+
* @param sActionName The name of the action to be called
|
|
1077
|
+
* @param [mParameters] Contains the following attributes:
|
|
1078
|
+
* @param [mParameters.contexts] Mandatory for a bound action: Either one context or an array with contexts for which the action is to be called
|
|
1079
|
+
* @param [mParameters.model] Mandatory for an unbound action: An instance of an OData V4 model
|
|
1080
|
+
* @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
|
|
1081
|
+
* @param [mParameters.label] A human-readable label for the action
|
|
1082
|
+
* @param [mParameters.bGetBoundContext] If specified, the action promise returns the bound context
|
|
1083
|
+
* @param oView Contains the object of the current view
|
|
1063
1084
|
* @param messageHandler
|
|
1064
|
-
* @returns
|
|
1085
|
+
* @returns Promise resolves with an array of response objects (TODO: to be changed)
|
|
1065
1086
|
* @ui5-restricted
|
|
1066
1087
|
* @final
|
|
1067
|
-
|
|
1088
|
+
*/
|
|
1068
1089
|
callAction(sActionName: string, mParameters: any, oView: View | null, messageHandler: any) {
|
|
1069
1090
|
mParameters = getParameters(mParameters);
|
|
1070
1091
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
@@ -1130,7 +1151,7 @@ class TransactionHelper {
|
|
|
1130
1151
|
const oDialogFragment = XMLTemplateProcessor.loadTemplate(sFragmentName, "fragment");
|
|
1131
1152
|
const oMetaModel = oModel.getMetaModel();
|
|
1132
1153
|
const sCanonicalPath = mParameters.contexts[0].getCanonicalPath();
|
|
1133
|
-
const sEntitySet = sCanonicalPath.substr(0, sCanonicalPath.indexOf("("))
|
|
1154
|
+
const sEntitySet = `${sCanonicalPath.substr(0, sCanonicalPath.indexOf("("))}/`;
|
|
1134
1155
|
const oDialogLabelModel = new JSONModel({
|
|
1135
1156
|
title: mParameters.label
|
|
1136
1157
|
});
|
|
@@ -1233,9 +1254,9 @@ class TransactionHelper {
|
|
|
1233
1254
|
* @name sap.fe.core.TransactionHelper#_handleActionResponse
|
|
1234
1255
|
* @memberof sap.fe.core.TransactionHelper
|
|
1235
1256
|
* @param messageHandler
|
|
1236
|
-
* @param
|
|
1237
|
-
* @param
|
|
1238
|
-
* @returns
|
|
1257
|
+
* @param mParameters Parameters to be considered for the action.
|
|
1258
|
+
* @param sActionName The name of the action to be called
|
|
1259
|
+
* @returns Promise after message dialog is opened if required.
|
|
1239
1260
|
* @ui5-restricted
|
|
1240
1261
|
* @final
|
|
1241
1262
|
*/
|
|
@@ -1273,13 +1294,14 @@ class TransactionHelper {
|
|
|
1273
1294
|
* Shows a popover if it needs to be shown.
|
|
1274
1295
|
* TODO: Popover is shown if user has modified any data.
|
|
1275
1296
|
* TODO: Popover is shown if there's a difference from draft admin data.
|
|
1297
|
+
*
|
|
1276
1298
|
* @static
|
|
1277
1299
|
* @name sap.fe.core.TransactionHelper._showDiscardPopover
|
|
1278
1300
|
* @memberof sap.fe.core.TransactionHelper
|
|
1279
|
-
* @param
|
|
1301
|
+
* @param oCancelButton The control which will open the popover
|
|
1280
1302
|
* @param bIsModified
|
|
1281
1303
|
* @param oResourceBundle
|
|
1282
|
-
* @returns
|
|
1304
|
+
* @returns Promise resolves if user confirms discard, rejects if otherwise, rejects if no control passed to open popover
|
|
1283
1305
|
* @ui5-restricted
|
|
1284
1306
|
* @final
|
|
1285
1307
|
*/
|
|
@@ -1365,10 +1387,10 @@ class TransactionHelper {
|
|
|
1365
1387
|
* @private
|
|
1366
1388
|
* @name sap.fe.core.TransactionHelper._getOwnerComponent
|
|
1367
1389
|
* @memberof sap.fe.core.TransactionHelper
|
|
1368
|
-
* @returns
|
|
1390
|
+
* @returns The app component
|
|
1369
1391
|
* @ui5-restricted
|
|
1370
1392
|
* @final
|
|
1371
|
-
|
|
1393
|
+
*/
|
|
1372
1394
|
_getAppComponent() {
|
|
1373
1395
|
return this._oAppComponent;
|
|
1374
1396
|
}
|
|
@@ -1383,6 +1405,7 @@ class TransactionHelper {
|
|
|
1383
1405
|
// Setting value of field as '' in case of value help and validating other fields
|
|
1384
1406
|
oField.setValue(value);
|
|
1385
1407
|
fnValidateRequiredProperties();
|
|
1408
|
+
|
|
1386
1409
|
return oField.getValue();
|
|
1387
1410
|
})
|
|
1388
1411
|
.catch(function (value: any) {
|
|
@@ -1397,6 +1420,23 @@ class TransactionHelper {
|
|
|
1397
1420
|
});
|
|
1398
1421
|
}
|
|
1399
1422
|
}
|
|
1423
|
+
_getNonDeletableText(mParameters: any, vContexts: any, oResourceBundle: any) {
|
|
1424
|
+
const aNonDeletableContexts = mParameters.numberOfSelectedContexts - vContexts.concat(mParameters.unSavedContexts).length;
|
|
1425
|
+
return aNonDeletableContexts === 1
|
|
1426
|
+
? CommonUtils.getTranslatedText(
|
|
1427
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_ONE_OBJECT_NON_DELETABLE",
|
|
1428
|
+
oResourceBundle,
|
|
1429
|
+
[mParameters.numberOfSelectedContexts]
|
|
1430
|
+
)
|
|
1431
|
+
: CommonUtils.getTranslatedText(
|
|
1432
|
+
"C_TRANSACTION_HELPER_CONFIRM_DELETE_WITH_OBJECTINFO_AND_FEW_OBJECTS_NON_DELETABLE",
|
|
1433
|
+
oResourceBundle,
|
|
1434
|
+
[
|
|
1435
|
+
mParameters.numberOfSelectedContexts - vContexts.concat(mParameters.unSavedContexts).length,
|
|
1436
|
+
mParameters.numberOfSelectedContexts
|
|
1437
|
+
]
|
|
1438
|
+
);
|
|
1439
|
+
}
|
|
1400
1440
|
|
|
1401
1441
|
_launchDialogWithKeyFields(
|
|
1402
1442
|
oListBinding: any,
|
|
@@ -1423,10 +1463,13 @@ class TransactionHelper {
|
|
|
1423
1463
|
oEntitySetContext = oMetaModel.createBindingContext(sPath),
|
|
1424
1464
|
sMetaPath = oMetaModel.getMetaPath(sPath);
|
|
1425
1465
|
for (const i in mFields) {
|
|
1426
|
-
aImmutableFields.push(oMetaModel.createBindingContext(sMetaPath
|
|
1466
|
+
aImmutableFields.push(oMetaModel.createBindingContext(`${sMetaPath}/${mFields[i]}`));
|
|
1427
1467
|
}
|
|
1428
1468
|
const oImmutableCtxModel = new JSONModel(aImmutableFields);
|
|
1429
1469
|
const oImmutableCtx = oImmutableCtxModel.createBindingContext("/") as Context;
|
|
1470
|
+
const aRequiredProperties = CommonUtils.getRequiredPropertiesFromInsertRestrictions(sMetaPath, oMetaModel);
|
|
1471
|
+
const oRequiredPropertyPathsCtxModel = new JSONModel(aRequiredProperties);
|
|
1472
|
+
const oRequiredPropertyPathsCtx = oRequiredPropertyPathsCtxModel.createBindingContext("/") as Context;
|
|
1430
1473
|
return Promise.resolve(
|
|
1431
1474
|
XMLPreprocessor.process(
|
|
1432
1475
|
oFragment,
|
|
@@ -1434,16 +1477,18 @@ class TransactionHelper {
|
|
|
1434
1477
|
{
|
|
1435
1478
|
bindingContexts: {
|
|
1436
1479
|
entitySet: oEntitySetContext,
|
|
1437
|
-
fields: oImmutableCtx
|
|
1480
|
+
fields: oImmutableCtx,
|
|
1481
|
+
requiredProperties: oRequiredPropertyPathsCtx
|
|
1438
1482
|
},
|
|
1439
1483
|
models: {
|
|
1440
1484
|
entitySet: oEntitySetContext.getModel(),
|
|
1441
1485
|
fields: oImmutableCtx.getModel(),
|
|
1442
|
-
metaModel: oMetaModel
|
|
1486
|
+
metaModel: oMetaModel,
|
|
1487
|
+
requiredProperties: oRequiredPropertyPathsCtxModel
|
|
1443
1488
|
}
|
|
1444
1489
|
}
|
|
1445
1490
|
)
|
|
1446
|
-
).then(function (
|
|
1491
|
+
).then(function (oNewFragment: any) {
|
|
1447
1492
|
let aFormElements: any[] = [];
|
|
1448
1493
|
const mFieldValueMap: any = {};
|
|
1449
1494
|
let oCreateButton: Button;
|
|
@@ -1454,25 +1499,28 @@ class TransactionHelper {
|
|
|
1454
1499
|
return oFormElement.getFields()[0];
|
|
1455
1500
|
})
|
|
1456
1501
|
.filter(function (oField: any) {
|
|
1457
|
-
// The continue button should remain disabled in case of
|
|
1458
|
-
return oField.getRequired() ||
|
|
1502
|
+
// The continue button should remain disabled in case of empty required fields.
|
|
1503
|
+
return oField.getRequired() || oField.getValueState() === ValueState.Error;
|
|
1459
1504
|
})
|
|
1460
1505
|
.map(function (oField: any) {
|
|
1461
1506
|
const sFieldId = oField.getId();
|
|
1462
1507
|
if (sFieldId in mFieldValueMap) {
|
|
1463
1508
|
return Promise.resolve(mFieldValueMap[sFieldId])
|
|
1464
1509
|
.then(function (vValue: any) {
|
|
1465
|
-
return oField.
|
|
1510
|
+
return oField.getValue() === "" ? undefined : vValue;
|
|
1466
1511
|
})
|
|
1467
1512
|
.catch(function () {
|
|
1468
1513
|
return undefined;
|
|
1469
1514
|
});
|
|
1470
1515
|
}
|
|
1471
|
-
return oField.
|
|
1516
|
+
return oField.getValue() === "" ? undefined : oField.getValue();
|
|
1472
1517
|
})
|
|
1473
1518
|
)
|
|
1474
1519
|
.then(function (aResults: any[]) {
|
|
1475
1520
|
return aResults.every(function (vValue: any) {
|
|
1521
|
+
if (Array.isArray(vValue)) {
|
|
1522
|
+
vValue = vValue[0];
|
|
1523
|
+
}
|
|
1476
1524
|
return vValue !== undefined && vValue !== null && vValue !== "";
|
|
1477
1525
|
});
|
|
1478
1526
|
})
|
|
@@ -1507,7 +1555,7 @@ class TransactionHelper {
|
|
|
1507
1555
|
}
|
|
1508
1556
|
};
|
|
1509
1557
|
return Fragment.load({
|
|
1510
|
-
definition:
|
|
1558
|
+
definition: oNewFragment,
|
|
1511
1559
|
controller: oController
|
|
1512
1560
|
}).then(function (oDialogContent: any) {
|
|
1513
1561
|
oDialog = new Dialog({
|
|
@@ -1517,8 +1565,8 @@ class TransactionHelper {
|
|
|
1517
1565
|
text: CommonUtils.getTranslatedText("C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE_BUTTON", oResourceBundle),
|
|
1518
1566
|
type: "Emphasized",
|
|
1519
1567
|
press: function (oEvent: any) {
|
|
1520
|
-
const
|
|
1521
|
-
|
|
1568
|
+
const createButton = oEvent.getSource();
|
|
1569
|
+
createButton.setEnabled(false);
|
|
1522
1570
|
BusyLocker.lock(oDialog);
|
|
1523
1571
|
mParameters.bIsCreateDialog = true;
|
|
1524
1572
|
return Promise.all(
|
|
@@ -1563,8 +1611,8 @@ class TransactionHelper {
|
|
|
1563
1611
|
})
|
|
1564
1612
|
.finally(function () {
|
|
1565
1613
|
BusyLocker.unlock(oDialog);
|
|
1566
|
-
|
|
1567
|
-
|
|
1614
|
+
createButton.setEnabled(true);
|
|
1615
|
+
messageHandler.showMessages();
|
|
1568
1616
|
});
|
|
1569
1617
|
}
|
|
1570
1618
|
},
|
|
@@ -1644,8 +1692,8 @@ class TransactionHelper {
|
|
|
1644
1692
|
.then(undefined, function () {
|
|
1645
1693
|
Log.trace("transient creation context deleted");
|
|
1646
1694
|
})
|
|
1647
|
-
.catch(function (
|
|
1648
|
-
Log.trace("transient creation context deletion error",
|
|
1695
|
+
.catch(function (contextError: any) {
|
|
1696
|
+
Log.trace("transient creation context deletion error", contextError);
|
|
1649
1697
|
});
|
|
1650
1698
|
if (!mParameters.bIsCreateDialog) {
|
|
1651
1699
|
// if current state is transient (...), browser will come back to previous state
|
|
@@ -1671,14 +1719,14 @@ class TransactionHelper {
|
|
|
1671
1719
|
* @private
|
|
1672
1720
|
* @name sap.fe.core.TransactionHelper._getNewAction
|
|
1673
1721
|
* @memberof sap.fe.core.TransactionHelper
|
|
1674
|
-
* @param
|
|
1675
|
-
* @param
|
|
1676
|
-
* @param
|
|
1677
|
-
* @param
|
|
1678
|
-
* @returns
|
|
1722
|
+
* @param oStartupParameters Startup parameters of the application
|
|
1723
|
+
* @param sCreateHash Hash to be checked for action type
|
|
1724
|
+
* @param oMetaModel The MetaModel used to check for NewAction parameter
|
|
1725
|
+
* @param sMetaPath The MetaPath
|
|
1726
|
+
* @returns The name of the action
|
|
1679
1727
|
* @ui5-restricted
|
|
1680
1728
|
* @final
|
|
1681
|
-
|
|
1729
|
+
*/
|
|
1682
1730
|
_getNewAction(oStartupParameters: any, sCreateHash: string, oMetaModel: ODataMetaModel, sMetaPath: string) {
|
|
1683
1731
|
let sNewAction;
|
|
1684
1732
|
|
|
@@ -1689,8 +1737,8 @@ class TransactionHelper {
|
|
|
1689
1737
|
} else {
|
|
1690
1738
|
sNewAction =
|
|
1691
1739
|
oMetaModel && oMetaModel.getObject !== undefined
|
|
1692
|
-
? oMetaModel.getObject(sMetaPath
|
|
1693
|
-
oMetaModel.getObject(sMetaPath
|
|
1740
|
+
? oMetaModel.getObject(`${sMetaPath}@com.sap.vocabularies.Session.v1.StickySessionSupported/NewAction`) ||
|
|
1741
|
+
oMetaModel.getObject(`${sMetaPath}@com.sap.vocabularies.Common.v1.DraftRoot/NewAction`)
|
|
1694
1742
|
: undefined;
|
|
1695
1743
|
}
|
|
1696
1744
|
return sNewAction;
|
|
@@ -1708,14 +1756,14 @@ class TransactionHelper {
|
|
|
1708
1756
|
* @private
|
|
1709
1757
|
* @name sap.fe.core.TransactionHelper._getSpecificCreateActionDialogLabel
|
|
1710
1758
|
* @memberof sap.fe.core.TransactionHelper
|
|
1711
|
-
* @param
|
|
1712
|
-
* @param
|
|
1713
|
-
* @param
|
|
1714
|
-
* @param
|
|
1715
|
-
* @returns
|
|
1759
|
+
* @param oMetaModel The MetaModel used to check for the NewAction parameter
|
|
1760
|
+
* @param sMetaPath The MetaPath
|
|
1761
|
+
* @param sNewAction Contains the name of the action to be executed
|
|
1762
|
+
* @param oResourceBundleCore ResourceBundle to access the default Create label
|
|
1763
|
+
* @returns The label for the Create Action Dialog
|
|
1716
1764
|
* @ui5-restricted
|
|
1717
1765
|
* @final
|
|
1718
|
-
|
|
1766
|
+
*/
|
|
1719
1767
|
_getSpecificCreateActionDialogLabel(
|
|
1720
1768
|
oMetaModel: ODataMetaModel,
|
|
1721
1769
|
sMetaPath: string,
|
|
@@ -1723,15 +1771,15 @@ class TransactionHelper {
|
|
|
1723
1771
|
oResourceBundleCore: ResourceBundle
|
|
1724
1772
|
) {
|
|
1725
1773
|
const fnGetLabelFromLineItemAnnotation = function () {
|
|
1726
|
-
if (oMetaModel && oMetaModel.getObject(sMetaPath
|
|
1774
|
+
if (oMetaModel && oMetaModel.getObject(`${sMetaPath}/@com.sap.vocabularies.UI.v1.LineItem`)) {
|
|
1727
1775
|
const iLineItemIndex = oMetaModel
|
|
1728
|
-
.getObject(sMetaPath
|
|
1776
|
+
.getObject(`${sMetaPath}/@com.sap.vocabularies.UI.v1.LineItem`)
|
|
1729
1777
|
.findIndex(function (oLineItem: any) {
|
|
1730
1778
|
const aLineItemAction = oLineItem.Action ? oLineItem.Action.split("(") : undefined;
|
|
1731
1779
|
return aLineItemAction ? aLineItemAction[0] === sNewAction : false;
|
|
1732
1780
|
});
|
|
1733
1781
|
return iLineItemIndex > -1
|
|
1734
|
-
? oMetaModel.getObject(sMetaPath
|
|
1782
|
+
? oMetaModel.getObject(`${sMetaPath}/@com.sap.vocabularies.UI.v1.LineItem`)[iLineItemIndex].Label
|
|
1735
1783
|
: undefined;
|
|
1736
1784
|
} else {
|
|
1737
1785
|
return undefined;
|
|
@@ -1740,7 +1788,7 @@ class TransactionHelper {
|
|
|
1740
1788
|
|
|
1741
1789
|
return (
|
|
1742
1790
|
fnGetLabelFromLineItemAnnotation() ||
|
|
1743
|
-
(oMetaModel && oMetaModel.getObject(sMetaPath
|
|
1791
|
+
(oMetaModel && oMetaModel.getObject(`${sMetaPath}/${sNewAction}@com.sap.vocabularies.Common.v1.Label`)) ||
|
|
1744
1792
|
(oResourceBundleCore && oResourceBundleCore.getText("C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE"))
|
|
1745
1793
|
);
|
|
1746
1794
|
}
|