@sapui5/sap.fe.core 1.100.0 → 1.102.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 +4 -4
- package/src/sap/fe/core/.library +2 -3
- package/src/sap/fe/core/AppComponent.js +23 -30
- package/src/sap/fe/core/AppComponent.ts +35 -40
- package/src/sap/fe/core/AppStateHandler.js +8 -8
- package/src/sap/fe/core/AppStateHandler.ts +11 -11
- package/src/sap/fe/core/BaseController.js +9 -9
- package/src/sap/fe/core/BaseController.ts +3 -4
- package/src/sap/fe/core/CommonUtils.js +122 -101
- package/src/sap/fe/core/CommonUtils.ts +239 -193
- package/src/sap/fe/core/ExtensionAPI.js +12 -13
- package/src/sap/fe/core/ExtensionAPI.ts +21 -31
- package/src/sap/fe/core/PageController.js +19 -13
- package/src/sap/fe/core/PageController.ts +40 -34
- package/src/sap/fe/core/TemplateComponent.js +198 -123
- package/src/sap/fe/core/TemplateComponent.ts +109 -121
- package/src/sap/fe/core/TemplateModel.js +7 -9
- package/src/sap/fe/core/TemplateModel.ts +3 -3
- package/src/sap/fe/core/buildingBlocks/AttributeModel.js +60 -0
- package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +37 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +165 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +178 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +935 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +837 -0
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +436 -0
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +431 -0
- package/src/sap/fe/core/{BusyLocker.js → controllerextensions/BusyLocker.js} +1 -1
- package/src/sap/fe/core/{BusyLocker.ts → controllerextensions/BusyLocker.ts} +7 -7
- package/src/sap/fe/core/controllerextensions/EditFlow.js +660 -288
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +513 -331
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +11 -11
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +6 -7
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +43 -25
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +132 -103
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +16 -16
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +64 -55
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +166 -99
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +187 -149
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +14 -14
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +12 -11
- package/src/sap/fe/core/controllerextensions/MassEdit.js +13 -12
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +22 -22
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +14 -26
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +20 -30
- package/src/sap/fe/core/controllerextensions/PageReady.js +25 -23
- package/src/sap/fe/core/controllerextensions/PageReady.ts +49 -47
- package/src/sap/fe/core/controllerextensions/Paginator.js +24 -15
- package/src/sap/fe/core/controllerextensions/Paginator.ts +35 -20
- package/src/sap/fe/core/controllerextensions/Placeholder.js +10 -10
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
- package/src/sap/fe/core/controllerextensions/Routing.js +11 -11
- package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
- package/src/sap/fe/core/controllerextensions/Share.js +34 -16
- package/src/sap/fe/core/controllerextensions/Share.ts +50 -32
- package/src/sap/fe/core/controllerextensions/SideEffects.js +15 -15
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +64 -65
- package/src/sap/fe/core/controllerextensions/ViewState.js +27 -31
- package/src/sap/fe/core/controllerextensions/ViewState.ts +103 -102
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +105 -0
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +98 -0
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +360 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/ActivitySync.ts +90 -132
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +146 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/CollaborationCommon.ts +18 -8
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +264 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/Manage.ts +35 -33
- package/src/sap/fe/core/controllerextensions/collaboration/ManageDialog.fragment.xml +100 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/UserDetails.fragment.xml +5 -7
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +1584 -0
- package/src/sap/fe/core/{TransactionHelper.ts → controllerextensions/editFlow/TransactionHelper.ts} +190 -159
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +780 -0
- package/src/sap/fe/core/{actions → controllerextensions/editFlow}/draft.ts +329 -76
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js +1149 -0
- package/src/sap/fe/core/{actions → controllerextensions/editFlow}/operations.ts +169 -97
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +190 -0
- package/src/sap/fe/core/{actions → controllerextensions/editFlow}/sticky.ts +76 -12
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +592 -0
- package/src/sap/fe/core/{actions → controllerextensions/messageHandler}/messageHandling.ts +83 -60
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +940 -0
- package/src/sap/fe/core/{RouterProxy.ts → controllerextensions/routing/RouterProxy.ts} +52 -36
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +21 -18
- package/src/sap/fe/core/controls/Any.js +28 -0
- package/src/sap/fe/core/controls/Any.ts +30 -0
- package/src/sap/fe/core/controls/CommandExecution.js +50 -16
- package/src/sap/fe/core/controls/CommandExecution.ts +31 -22
- package/src/sap/fe/core/controls/ConditionalWrapper.js +136 -65
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +49 -58
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +371 -0
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +282 -0
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +74 -36
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +23 -32
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossDraft.fragment.xml +52 -5
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +127 -67
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +127 -67
- package/src/sap/fe/core/controls/FieldWrapper.js +171 -87
- package/src/sap/fe/core/controls/FieldWrapper.ts +69 -80
- package/src/sap/fe/core/controls/FileWrapper.js +360 -0
- package/src/sap/fe/core/controls/FileWrapper.ts +202 -0
- package/src/sap/fe/core/controls/FilterBar.js +154 -119
- package/src/sap/fe/core/controls/FilterBar.ts +128 -123
- package/src/sap/fe/core/controls/FormElementWrapper.js +102 -37
- package/src/sap/fe/core/controls/FormElementWrapper.ts +43 -35
- package/src/sap/fe/core/controls/MassEditSelect.js +33 -0
- package/src/sap/fe/core/controls/MassEditSelect.ts +45 -0
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +111 -89
- package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +86 -82
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +242 -193
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +211 -204
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +152 -116
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +105 -105
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +2 -2
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +23 -28
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +41 -81
- package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +107 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +550 -35
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +604 -35
- package/src/sap/fe/core/converters/ManifestSettings.js +3 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +9 -2
- package/src/sap/fe/core/converters/MetaModelConverter.js +11 -40
- package/src/sap/fe/core/converters/MetaModelConverter.ts +56 -84
- package/src/sap/fe/core/converters/annotations/DataField.js +20 -5
- package/src/sap/fe/core/converters/annotations/DataField.ts +27 -6
- package/src/sap/fe/core/converters/controls/Common/Action.js +14 -21
- package/src/sap/fe/core/converters/controls/Common/Action.ts +23 -28
- package/src/sap/fe/core/converters/controls/Common/Chart.js +17 -10
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +20 -14
- package/src/sap/fe/core/converters/controls/Common/Form.js +16 -18
- package/src/sap/fe/core/converters/controls/Common/Form.ts +20 -20
- package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +2 -3
- package/src/sap/fe/core/converters/controls/Common/Table.js +389 -173
- package/src/sap/fe/core/converters/controls/Common/Table.ts +440 -244
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +26 -16
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +27 -19
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +78 -47
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +146 -107
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +6 -6
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +20 -18
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +30 -25
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +39 -34
- package/src/sap/fe/core/converters/helpers/Aggregation.js +10 -2
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +18 -13
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +3 -2
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +6 -5
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +1 -1
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +0 -4
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +27 -24
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +49 -40
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +33 -22
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +77 -62
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +28 -28
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +38 -45
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +3 -3
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +8 -6
- package/src/sap/fe/core/formatters/KPIFormatter.js +3 -12
- package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -2
- package/src/sap/fe/core/formatters/TableFormatter.js +74 -13
- package/src/sap/fe/core/formatters/TableFormatter.ts +71 -16
- package/src/sap/fe/core/formatters/ValueFormatter.js +4 -4
- package/src/sap/fe/core/formatters/ValueFormatter.ts +4 -7
- package/src/sap/fe/core/fpm/Component.js +46 -17
- package/src/sap/fe/core/fpm/Component.ts +11 -16
- package/src/sap/fe/core/helpers/AppStartupHelper.js +4 -4
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +3 -3
- package/src/sap/fe/core/helpers/BindingExpression.js +10 -7
- package/src/sap/fe/core/helpers/BindingExpression.ts +37 -35
- package/src/sap/fe/core/helpers/ClassSupport.js +273 -256
- package/src/sap/fe/core/helpers/ClassSupport.ts +315 -237
- package/src/sap/fe/core/helpers/FPMHelper.js +3 -2
- package/src/sap/fe/core/helpers/FPMHelper.ts +9 -8
- package/src/sap/fe/core/helpers/MassEditHelper.js +522 -147
- package/src/sap/fe/core/helpers/MassEditHelper.ts +563 -236
- package/src/sap/fe/core/helpers/ModelHelper.js +29 -1
- package/src/sap/fe/core/helpers/ModelHelper.ts +39 -26
- package/src/sap/fe/core/helpers/PasteHelper.js +4 -4
- package/src/sap/fe/core/helpers/PasteHelper.ts +4 -3
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +3 -3
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +3 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +1 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +1 -1
- package/src/sap/fe/core/helpers/StableIdHelper.js +5 -7
- package/src/sap/fe/core/helpers/StableIdHelper.ts +8 -8
- package/src/sap/fe/core/{Synchronization.js → helpers/Synchronization.js} +1 -1
- package/src/sap/fe/core/{Synchronization.ts → helpers/Synchronization.ts} +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx.js +35 -5
- package/src/sap/fe/core/jsx-runtime/jsx.ts +22 -8
- package/src/sap/fe/core/library.js +13 -5
- package/src/sap/fe/core/library.ts +26 -17
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +1 -1
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +0 -3
- package/src/sap/fe/core/messagebundle.properties +135 -180
- package/src/sap/fe/core/messagebundle_ar.properties +31 -64
- package/src/sap/fe/core/messagebundle_bg.properties +31 -64
- package/src/sap/fe/core/messagebundle_ca.properties +31 -64
- package/src/sap/fe/core/messagebundle_cs.properties +31 -64
- package/src/sap/fe/core/messagebundle_cy.properties +32 -65
- package/src/sap/fe/core/messagebundle_da.properties +31 -64
- package/src/sap/fe/core/messagebundle_de.properties +29 -62
- package/src/sap/fe/core/messagebundle_el.properties +32 -65
- package/src/sap/fe/core/messagebundle_en.properties +32 -65
- package/src/sap/fe/core/messagebundle_en_GB.properties +29 -62
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +41 -74
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +32 -65
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +20 -6
- package/src/sap/fe/core/messagebundle_es.properties +31 -64
- package/src/sap/fe/core/messagebundle_es_MX.properties +31 -64
- package/src/sap/fe/core/messagebundle_et.properties +31 -64
- package/src/sap/fe/core/messagebundle_fi.properties +29 -62
- package/src/sap/fe/core/messagebundle_fr.properties +36 -69
- package/src/sap/fe/core/messagebundle_fr_CA.properties +33 -66
- package/src/sap/fe/core/messagebundle_hi.properties +29 -62
- package/src/sap/fe/core/messagebundle_hr.properties +32 -65
- package/src/sap/fe/core/messagebundle_hu.properties +30 -63
- package/src/sap/fe/core/messagebundle_id.properties +32 -65
- package/src/sap/fe/core/messagebundle_it.properties +31 -64
- package/src/sap/fe/core/messagebundle_iw.properties +31 -64
- package/src/sap/fe/core/messagebundle_ja.properties +29 -62
- package/src/sap/fe/core/messagebundle_kk.properties +31 -64
- package/src/sap/fe/core/messagebundle_ko.properties +31 -64
- package/src/sap/fe/core/messagebundle_lt.properties +31 -64
- package/src/sap/fe/core/messagebundle_lv.properties +32 -65
- package/src/sap/fe/core/messagebundle_ms.properties +31 -64
- package/src/sap/fe/core/messagebundle_nl.properties +31 -64
- package/src/sap/fe/core/messagebundle_no.properties +31 -64
- package/src/sap/fe/core/messagebundle_pl.properties +34 -67
- package/src/sap/fe/core/messagebundle_pt.properties +32 -65
- package/src/sap/fe/core/messagebundle_pt_PT.properties +31 -64
- package/src/sap/fe/core/messagebundle_ro.properties +33 -66
- package/src/sap/fe/core/messagebundle_ru.properties +33 -66
- package/src/sap/fe/core/messagebundle_sh.properties +31 -64
- package/src/sap/fe/core/messagebundle_sk.properties +31 -64
- package/src/sap/fe/core/messagebundle_sl.properties +29 -62
- package/src/sap/fe/core/messagebundle_sv.properties +30 -63
- package/src/sap/fe/core/messagebundle_th.properties +31 -64
- package/src/sap/fe/core/messagebundle_tr.properties +31 -64
- package/src/sap/fe/core/messagebundle_uk.properties +32 -65
- package/src/sap/fe/core/messagebundle_vi.properties +31 -64
- package/src/sap/fe/core/messagebundle_zh_CN.properties +32 -65
- package/src/sap/fe/core/messagebundle_zh_TW.properties +34 -67
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +4 -4
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +5 -5
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +1 -2
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +11 -8
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +15 -13
- package/src/sap/fe/core/services/NavigationServiceFactory.js +5 -5
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +9 -5
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +4 -4
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/RoutingServiceFactory.js +105 -66
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +59 -49
- package/src/sap/fe/core/services/ShellServicesFactory.js +104 -29
- package/src/sap/fe/core/services/ShellServicesFactory.ts +64 -30
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +4 -4
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +11 -10
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +38 -51
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +43 -5
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +6 -3
- package/src/sap/fe/core/support/CommonHelper.js +1 -1
- package/src/sap/fe/core/support/CommonHelper.ts +0 -3
- package/src/sap/fe/core/templating/DataModelPathHelper.js +2 -9
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +32 -38
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +23 -3
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +27 -6
- package/src/sap/fe/core/templating/EntitySetHelper.js +1 -9
- package/src/sap/fe/core/templating/EntitySetHelper.ts +11 -13
- package/src/sap/fe/core/templating/FilterHelper.js +4 -4
- package/src/sap/fe/core/templating/FilterHelper.ts +6 -5
- package/src/sap/fe/core/templating/PropertyHelper.js +70 -33
- package/src/sap/fe/core/templating/PropertyHelper.ts +49 -27
- package/src/sap/fe/core/templating/UIFormatters.js +133 -22
- package/src/sap/fe/core/templating/UIFormatters.ts +144 -50
- package/src/sap/fe/core/type/DateTimeWithTimezone.js +47 -0
- package/src/sap/fe/core/type/DateTimeWithTimezone.ts +23 -0
- package/src/sap/fe/core/type/Email.js +26 -8
- package/src/sap/fe/core/type/Email.ts +8 -7
- package/src/sap/fe/core/AnnotationHelper.js +0 -312
- package/src/sap/fe/core/AnnotationHelper.ts +0 -315
- package/src/sap/fe/core/RouterProxy.js +0 -926
- package/src/sap/fe/core/TransactionHelper.js +0 -1562
- package/src/sap/fe/core/actions/collaboration/ActivitySync.js +0 -392
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +0 -136
- package/src/sap/fe/core/actions/collaboration/Manage.js +0 -262
- package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +0 -103
- package/src/sap/fe/core/actions/draft.js +0 -523
- package/src/sap/fe/core/actions/messageHandling.js +0 -567
- package/src/sap/fe/core/actions/nonDraft.js +0 -20
- package/src/sap/fe/core/actions/nonDraft.ts +0 -12
- package/src/sap/fe/core/actions/operations.js +0 -1096
- package/src/sap/fe/core/actions/sticky.js +0 -130
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +0 -78
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.ts +0 -65
- package/src/sap/fe/core/formatters/CriticalityFormatter.js +0 -77
- package/src/sap/fe/core/formatters/CriticalityFormatter.ts +0 -58
package/src/sap/fe/core/{TransactionHelper.ts → controllerextensions/editFlow/TransactionHelper.ts}
RENAMED
|
@@ -1,32 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
import sticky from "sap/fe/core/actions/sticky";
|
|
3
|
-
import operations from "sap/fe/core/actions/operations";
|
|
4
|
-
import JSONModel from "sap/ui/model/json/JSONModel";
|
|
5
|
-
import Popover from "sap/m/Popover";
|
|
6
|
-
import VBox from "sap/m/VBox";
|
|
7
|
-
import CheckBox from "sap/m/CheckBox";
|
|
8
|
-
import Text from "sap/m/Text";
|
|
9
|
-
import Button from "sap/m/Button";
|
|
10
|
-
import MessageToast from "sap/m/MessageToast";
|
|
11
|
-
import Dialog from "sap/m/Dialog";
|
|
1
|
+
import ResourceBundle from "sap/base/i18n/ResourceBundle";
|
|
12
2
|
import Log from "sap/base/Log";
|
|
3
|
+
import UriParameters from "sap/base/util/UriParameters";
|
|
4
|
+
import AppComponent from "sap/fe/core/AppComponent";
|
|
13
5
|
import CommonUtils from "sap/fe/core/CommonUtils";
|
|
14
|
-
import BusyLocker from "sap/fe/core/BusyLocker";
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
6
|
+
import BusyLocker from "sap/fe/core/controllerextensions/BusyLocker";
|
|
7
|
+
import draft from "sap/fe/core/controllerextensions/editFlow/draft";
|
|
8
|
+
import operations from "sap/fe/core/controllerextensions/editFlow/operations";
|
|
9
|
+
import sticky from "sap/fe/core/controllerextensions/editFlow/sticky";
|
|
10
|
+
import messageHandling from "sap/fe/core/controllerextensions/messageHandler/messageHandling";
|
|
11
|
+
import FPMHelper from "sap/fe/core/helpers/FPMHelper";
|
|
19
12
|
import ModelHelper, { InternalModelContext } from "sap/fe/core/helpers/ModelHelper";
|
|
20
13
|
import FELibrary from "sap/fe/core/library";
|
|
14
|
+
import Button from "sap/m/Button";
|
|
15
|
+
import CheckBox from "sap/m/CheckBox";
|
|
16
|
+
import Dialog from "sap/m/Dialog";
|
|
17
|
+
import MessageBox from "sap/m/MessageBox";
|
|
18
|
+
import MessageToast from "sap/m/MessageToast";
|
|
19
|
+
import Popover from "sap/m/Popover";
|
|
20
|
+
import Text from "sap/m/Text";
|
|
21
|
+
import VBox from "sap/m/VBox";
|
|
22
|
+
import Core from "sap/ui/core/Core";
|
|
23
|
+
import Fragment from "sap/ui/core/Fragment";
|
|
21
24
|
import coreLibrary from "sap/ui/core/library";
|
|
22
|
-
import messageHandling from "sap/fe/core/actions/messageHandling";
|
|
23
|
-
import AppComponent from "sap/fe/core/AppComponent";
|
|
24
|
-
import ResourceBundle from "sap/base/i18n/ResourceBundle";
|
|
25
|
-
import ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
|
|
26
25
|
import View from "sap/ui/core/mvc/View";
|
|
27
|
-
import
|
|
28
|
-
|
|
26
|
+
import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
|
|
27
|
+
import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
|
|
29
28
|
import Context from "sap/ui/model/Context";
|
|
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";
|
|
32
|
+
|
|
30
33
|
const CreationMode = FELibrary.CreationMode;
|
|
31
34
|
const ProgrammingModel = FELibrary.ProgrammingModel;
|
|
32
35
|
const ValueState = coreLibrary.ValueState;
|
|
@@ -50,7 +53,7 @@ class TransactionHelper {
|
|
|
50
53
|
this._oAppComponent = oAppComponent;
|
|
51
54
|
this.oLockObject = oLockObject;
|
|
52
55
|
}
|
|
53
|
-
getProgrammingModel(oContext
|
|
56
|
+
getProgrammingModel(oContext?: any): typeof ProgrammingModel {
|
|
54
57
|
if (!this.sProgrammingModel && oContext) {
|
|
55
58
|
let sPath;
|
|
56
59
|
if (oContext.isA("sap.ui.model.odata.v4.Context")) {
|
|
@@ -110,6 +113,7 @@ class TransactionHelper {
|
|
|
110
113
|
* @param {map} [mInParameters.data] A map of data that should be sent within the POST
|
|
111
114
|
* @param {string} [mInParameters.busyMode] Global (default), Local, None TODO: to be refactored
|
|
112
115
|
* @param {map} [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 {map} [mInParameters.inactive] If set, the context is set as inactive for empty rows
|
|
113
117
|
* @param oResourceBundle
|
|
114
118
|
* @param messageHandler
|
|
115
119
|
* @param bFromCopyPaste
|
|
@@ -120,7 +124,7 @@ class TransactionHelper {
|
|
|
120
124
|
*/
|
|
121
125
|
createDocument(
|
|
122
126
|
oMainListBinding: any,
|
|
123
|
-
mInParameters: { data?: any; busyMode?: string | undefined; keepTransientContextOnFailed?: any } | undefined,
|
|
127
|
+
mInParameters: { data?: any; busyMode?: string | undefined; keepTransientContextOnFailed?: any; inactive?: boolean } | undefined,
|
|
124
128
|
oResourceBundle: any,
|
|
125
129
|
messageHandler: any,
|
|
126
130
|
bFromCopyPaste: boolean = false,
|
|
@@ -131,9 +135,7 @@ class TransactionHelper {
|
|
|
131
135
|
oModel = oMainListBinding.getModel(),
|
|
132
136
|
oMetaModel = oModel.getMetaModel(),
|
|
133
137
|
sMetaPath = oMetaModel.getMetaPath(oMainListBinding.getHeaderContext().getPath()),
|
|
134
|
-
sCreateHash = this._getAppComponent()
|
|
135
|
-
.getRouterProxy()
|
|
136
|
-
.getHash(),
|
|
138
|
+
sCreateHash = this._getAppComponent().getRouterProxy().getHash(),
|
|
137
139
|
oComponentData = this._getAppComponent().getComponentData(),
|
|
138
140
|
oStartupParameters = (oComponentData && oComponentData.startupParameters) || {},
|
|
139
141
|
sNewAction = !oMainListBinding.isRelative()
|
|
@@ -178,7 +180,7 @@ class TransactionHelper {
|
|
|
178
180
|
}
|
|
179
181
|
mParameters.beforeCreateCallBack = bFromCopyPaste ? null : mParameters.beforeCreateCallBack;
|
|
180
182
|
BusyLocker.lock(this.oLockObject, sBusyPath);
|
|
181
|
-
const oResourceBundleCore =
|
|
183
|
+
const oResourceBundleCore = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core");
|
|
182
184
|
if (sNewAction) {
|
|
183
185
|
oCreationPromise = this.callAction(
|
|
184
186
|
sNewAction,
|
|
@@ -228,18 +230,18 @@ class TransactionHelper {
|
|
|
228
230
|
}
|
|
229
231
|
|
|
230
232
|
oCreationPromise = oCreationPromise
|
|
231
|
-
.then(function(oContext: any) {
|
|
233
|
+
.then(function (oContext: any) {
|
|
232
234
|
if (oContext) {
|
|
233
235
|
return oContext.getObject();
|
|
234
236
|
} else {
|
|
235
237
|
return undefined;
|
|
236
238
|
}
|
|
237
239
|
})
|
|
238
|
-
.catch(function(oError: any) {
|
|
240
|
+
.catch(function (oError: any) {
|
|
239
241
|
Log.error("Error while executing the function " + sFunctionName, oError);
|
|
240
242
|
throw oError;
|
|
241
243
|
})
|
|
242
|
-
.then(function(oData: any) {
|
|
244
|
+
.then(function (oData: any) {
|
|
243
245
|
mParameters.data = oData ? Object.assign({}, oData, mParameters.data) : mParameters.data;
|
|
244
246
|
if (mParameters.data) {
|
|
245
247
|
delete mParameters.data["@odata.context"];
|
|
@@ -248,7 +250,7 @@ class TransactionHelper {
|
|
|
248
250
|
const oTransientListBinding = oModel.bindList(oMainListBinding.getPath(), oMainListBinding.getContext(), [], [], {
|
|
249
251
|
$$updateGroupId: "submitLater"
|
|
250
252
|
});
|
|
251
|
-
oTransientListBinding.refreshInternal = function() {
|
|
253
|
+
oTransientListBinding.refreshInternal = function () {
|
|
252
254
|
/* */
|
|
253
255
|
};
|
|
254
256
|
oNewDocumentContext = oTransientListBinding.create(mParameters.data, true);
|
|
@@ -270,19 +272,26 @@ class TransactionHelper {
|
|
|
270
272
|
} else {
|
|
271
273
|
onBeforeCreatePromise = Promise.resolve();
|
|
272
274
|
}
|
|
273
|
-
return onBeforeCreatePromise.then(function() {
|
|
274
|
-
oNewDocumentContext = oMainListBinding.create(
|
|
275
|
-
|
|
275
|
+
return onBeforeCreatePromise.then(function () {
|
|
276
|
+
oNewDocumentContext = oMainListBinding.create(
|
|
277
|
+
mParameters.data,
|
|
278
|
+
true,
|
|
279
|
+
mParameters.createAtEnd,
|
|
280
|
+
mParameters.inactive
|
|
281
|
+
);
|
|
282
|
+
if (!mParameters.inactive) {
|
|
283
|
+
return that.onAfterCreateCompletion(oMainListBinding, oNewDocumentContext, mParameters);
|
|
284
|
+
}
|
|
276
285
|
});
|
|
277
286
|
}
|
|
278
287
|
})
|
|
279
|
-
.catch(function(oError: any) {
|
|
288
|
+
.catch(function (oError: any) {
|
|
280
289
|
Log.error("Error while creating the new document", oError);
|
|
281
290
|
throw oError;
|
|
282
291
|
});
|
|
283
292
|
}
|
|
284
293
|
return oCreationPromise
|
|
285
|
-
.then(function(oResult: any) {
|
|
294
|
+
.then(function (oResult: any) {
|
|
286
295
|
if (!oMainListBinding.isRelative()) {
|
|
287
296
|
// the create mode shall currently only be set on creating a root document
|
|
288
297
|
that._bCreateMode = true;
|
|
@@ -292,12 +301,12 @@ class TransactionHelper {
|
|
|
292
301
|
if (oResult && oResult.bConsiderDocumentModified) {
|
|
293
302
|
that.handleDocumentModifications();
|
|
294
303
|
}
|
|
295
|
-
return messageHandler.showMessageDialog().then(function() {
|
|
304
|
+
return messageHandler.showMessageDialog().then(function () {
|
|
296
305
|
return oNewDocumentContext;
|
|
297
306
|
});
|
|
298
307
|
})
|
|
299
|
-
.catch(function(oError: any) {
|
|
300
|
-
return messageHandler.showMessageDialog().then(function() {
|
|
308
|
+
.catch(function (oError: any) {
|
|
309
|
+
return messageHandler.showMessageDialog().then(function () {
|
|
301
310
|
// for instance, on cancel of create dialog, the promise is rejected
|
|
302
311
|
// a return here would restore the promise chain and result in errors while routing
|
|
303
312
|
// solution - reject here as well
|
|
@@ -310,7 +319,7 @@ class TransactionHelper {
|
|
|
310
319
|
return Promise.reject(oError);
|
|
311
320
|
});
|
|
312
321
|
})
|
|
313
|
-
.finally(function() {
|
|
322
|
+
.finally(function () {
|
|
314
323
|
BusyLocker.unlock(that.oLockObject, sBusyPath);
|
|
315
324
|
});
|
|
316
325
|
}
|
|
@@ -327,7 +336,7 @@ class TransactionHelper {
|
|
|
327
336
|
if (!bFindActiveContexts) {
|
|
328
337
|
return Promise.resolve();
|
|
329
338
|
}
|
|
330
|
-
const activeContexts = aContexts.reduce(function(aResult: any, oContext: any) {
|
|
339
|
+
const activeContexts = aContexts.reduce(function (aResult: any, oContext: any) {
|
|
331
340
|
const oMetaModel = oContext.getModel().getMetaModel();
|
|
332
341
|
const sMetaPath = oMetaModel.getMetaPath(oContext.getPath());
|
|
333
342
|
if (oMetaModel.getObject(sMetaPath + "@com.sap.vocabularies.Common.v1.DraftRoot")) {
|
|
@@ -344,12 +353,12 @@ class TransactionHelper {
|
|
|
344
353
|
return aResult;
|
|
345
354
|
}, []);
|
|
346
355
|
return Promise.all(
|
|
347
|
-
activeContexts.map(function(oContext: any) {
|
|
356
|
+
activeContexts.map(function (oContext: any) {
|
|
348
357
|
return oContext.requestCanonicalPath().then(
|
|
349
|
-
function() {
|
|
358
|
+
function () {
|
|
350
359
|
return oContext;
|
|
351
360
|
},
|
|
352
|
-
function() {
|
|
361
|
+
function () {
|
|
353
362
|
return;
|
|
354
363
|
}
|
|
355
364
|
);
|
|
@@ -363,7 +372,7 @@ class TransactionHelper {
|
|
|
363
372
|
//if unsaved objects are not deleted then we need to set the enabled to true and update the model data for next deletion
|
|
364
373
|
oInternalModelContext.setProperty("deleteEnabled", true);
|
|
365
374
|
const obj = Object.assign(oInternalModelContext.getObject(), {});
|
|
366
|
-
obj.selectedContexts = obj.selectedContexts.filter(function(element: any) {
|
|
375
|
+
obj.selectedContexts = obj.selectedContexts.filter(function (element: any) {
|
|
367
376
|
return obj.deletableContexts.indexOf(element) === -1;
|
|
368
377
|
});
|
|
369
378
|
obj.deletableContexts = [];
|
|
@@ -422,17 +431,18 @@ class TransactionHelper {
|
|
|
422
431
|
bDialogConfirmed = false;
|
|
423
432
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
424
433
|
const that = this,
|
|
425
|
-
oResourceBundleCore =
|
|
434
|
+
oResourceBundleCore = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core") as ResourceBundle;
|
|
426
435
|
let aParams;
|
|
427
436
|
let oDeleteMessage: any = {
|
|
428
437
|
title: oResourceBundleCore.getText("C_COMMON_OBJECT_PAGE_DELETE")
|
|
429
438
|
};
|
|
439
|
+
messageHandling.removeBoundTransitionMessages();
|
|
430
440
|
BusyLocker.lock(this.oLockObject);
|
|
431
441
|
if (!Array.isArray(vContexts)) {
|
|
432
442
|
vContexts = [vContexts];
|
|
433
443
|
}
|
|
434
444
|
Promise.resolve(this.getProgrammingModel(vContexts[0]))
|
|
435
|
-
.then(function(sProgrammingModel: any) {
|
|
445
|
+
.then(function (sProgrammingModel: any) {
|
|
436
446
|
if (mParameters) {
|
|
437
447
|
if (!mParameters.numberOfSelectedContexts) {
|
|
438
448
|
if (sProgrammingModel === ProgrammingModel.Draft) {
|
|
@@ -658,7 +668,7 @@ class TransactionHelper {
|
|
|
658
668
|
new CheckBox({
|
|
659
669
|
text: oDeleteMessage.checkBoxText,
|
|
660
670
|
selected: true,
|
|
661
|
-
select: function(oEvent: any) {
|
|
671
|
+
select: function (oEvent: any) {
|
|
662
672
|
const selected = oEvent.getSource().getSelected();
|
|
663
673
|
if (selected) {
|
|
664
674
|
aDeletableContexts = vContexts.concat(mParameters.unSavedContexts);
|
|
@@ -673,7 +683,7 @@ class TransactionHelper {
|
|
|
673
683
|
]
|
|
674
684
|
});
|
|
675
685
|
const sTitle = oResourceBundleCore.getText("C_COMMON_OBJECT_PAGE_DELETE");
|
|
676
|
-
const fnConfirm = function() {
|
|
686
|
+
const fnConfirm = function () {
|
|
677
687
|
bDialogConfirmed = true;
|
|
678
688
|
BusyLocker.lock(that.oLockObject);
|
|
679
689
|
const aContexts = aDeletableContexts;
|
|
@@ -685,31 +695,31 @@ class TransactionHelper {
|
|
|
685
695
|
}
|
|
686
696
|
return onBeforeDeletePromise
|
|
687
697
|
.then(that.findActiveDraftRootContexts.bind(that, aContexts, mParameters.bFindActiveContexts))
|
|
688
|
-
.then(function(activeContexts: any) {
|
|
698
|
+
.then(function (activeContexts: any) {
|
|
689
699
|
//make sure to fetch the active contexts before deleting the drafts
|
|
690
700
|
return Promise.all(
|
|
691
|
-
aContexts.map(function(oContext: any) {
|
|
701
|
+
aContexts.map(function (oContext: any) {
|
|
692
702
|
//delete the draft
|
|
693
703
|
return draft.deleteDraft(oContext);
|
|
694
704
|
})
|
|
695
705
|
)
|
|
696
|
-
.catch(function(oError: any) {
|
|
697
|
-
return messageHandler.showMessages().then(function() {
|
|
706
|
+
.catch(function (oError: any) {
|
|
707
|
+
return messageHandler.showMessages().then(function () {
|
|
698
708
|
// re-throw error to enforce rejecting the general promise
|
|
699
709
|
throw oError;
|
|
700
710
|
});
|
|
701
711
|
})
|
|
702
|
-
.then(function() {
|
|
712
|
+
.then(function () {
|
|
703
713
|
const checkBox = {
|
|
704
714
|
"isCheckBoxVisible": isCheckBoxVisible,
|
|
705
715
|
"isCheckBoxSelected": isCheckBoxSelected
|
|
706
716
|
};
|
|
707
717
|
if (activeContexts && activeContexts.length) {
|
|
708
718
|
return Promise.all(
|
|
709
|
-
activeContexts.map(function(oContext: any) {
|
|
719
|
+
activeContexts.map(function (oContext: any) {
|
|
710
720
|
return oContext.delete();
|
|
711
721
|
})
|
|
712
|
-
).then(function() {
|
|
722
|
+
).then(function () {
|
|
713
723
|
that.afterDeleteProcess(mParameters, checkBox, aContexts, oResourceBundle);
|
|
714
724
|
return messageHandler.showMessageDialog().then(fnResolve);
|
|
715
725
|
});
|
|
@@ -719,10 +729,10 @@ class TransactionHelper {
|
|
|
719
729
|
}
|
|
720
730
|
});
|
|
721
731
|
})
|
|
722
|
-
.catch(function() {
|
|
732
|
+
.catch(function () {
|
|
723
733
|
fnReject();
|
|
724
734
|
})
|
|
725
|
-
.finally(function() {
|
|
735
|
+
.finally(function () {
|
|
726
736
|
BusyLocker.unlock(that.oLockObject);
|
|
727
737
|
});
|
|
728
738
|
};
|
|
@@ -736,18 +746,18 @@ class TransactionHelper {
|
|
|
736
746
|
beginButton: new Button({
|
|
737
747
|
text: oResourceBundleCore.getText("C_COMMON_OBJECT_PAGE_DELETE"),
|
|
738
748
|
type: "Emphasized",
|
|
739
|
-
press: function() {
|
|
749
|
+
press: function () {
|
|
740
750
|
oDialog.close();
|
|
741
751
|
return fnConfirm();
|
|
742
752
|
}
|
|
743
753
|
}),
|
|
744
754
|
endButton: new Button({
|
|
745
|
-
text: CommonUtils.getTranslatedText("
|
|
746
|
-
press: function() {
|
|
755
|
+
text: CommonUtils.getTranslatedText("C_COMMON_DIALOG_CANCEL", oResourceBundle),
|
|
756
|
+
press: function () {
|
|
747
757
|
oDialog.close();
|
|
748
758
|
}
|
|
749
759
|
}),
|
|
750
|
-
afterClose: function() {
|
|
760
|
+
afterClose: function () {
|
|
751
761
|
oDialog.destroy();
|
|
752
762
|
// if dialog is closed unconfirmed (e.g. via "Cancel" or Escape button), ensure to reject promise
|
|
753
763
|
if (!bDialogConfirmed) {
|
|
@@ -762,14 +772,14 @@ class TransactionHelper {
|
|
|
762
772
|
oDialog.open();
|
|
763
773
|
}
|
|
764
774
|
})
|
|
765
|
-
.finally(function() {
|
|
775
|
+
.finally(function () {
|
|
766
776
|
BusyLocker.unlock(that.oLockObject);
|
|
767
777
|
})
|
|
768
|
-
.catch(function() {
|
|
778
|
+
.catch(function () {
|
|
769
779
|
Log.warning("Couldn't get Programming model");
|
|
770
780
|
fnReject();
|
|
771
781
|
});
|
|
772
|
-
return new Promise(function(resolve: (value: any) => void, reject: (reason?: any) => void) {
|
|
782
|
+
return new Promise(function (resolve: (value: any) => void, reject: (reason?: any) => void) {
|
|
773
783
|
fnReject = reject;
|
|
774
784
|
fnResolve = resolve;
|
|
775
785
|
});
|
|
@@ -810,18 +820,18 @@ class TransactionHelper {
|
|
|
810
820
|
return Promise.reject(new Error("Edit is only allowed for draft or sticky session supported services"));
|
|
811
821
|
}
|
|
812
822
|
return oEditPromise
|
|
813
|
-
.then(function(oNewContext: any) {
|
|
823
|
+
.then(function (oNewContext: any) {
|
|
814
824
|
that._bCreateMode = false;
|
|
815
|
-
return messageHandler.showMessageDialog().then(function() {
|
|
825
|
+
return messageHandler.showMessageDialog().then(function () {
|
|
816
826
|
return oNewContext;
|
|
817
827
|
});
|
|
818
828
|
})
|
|
819
|
-
.catch(function(err: any) {
|
|
820
|
-
return messageHandler.showMessages().then(function() {
|
|
829
|
+
.catch(function (err: any) {
|
|
830
|
+
return messageHandler.showMessages().then(function () {
|
|
821
831
|
return Promise.reject(err);
|
|
822
832
|
});
|
|
823
833
|
})
|
|
824
|
-
.finally(function() {
|
|
834
|
+
.finally(function () {
|
|
825
835
|
BusyLocker.unlock(that.oLockObject);
|
|
826
836
|
});
|
|
827
837
|
}
|
|
@@ -860,12 +870,12 @@ class TransactionHelper {
|
|
|
860
870
|
oModel = oParamsContext.getModel();
|
|
861
871
|
let onBeforeCancelPromise, sCanonicalPath: string;
|
|
862
872
|
return Promise.resolve(this.getProgrammingModel(oContext))
|
|
863
|
-
.then(function(sPModel: any) {
|
|
873
|
+
.then(function (sPModel: any) {
|
|
864
874
|
sProgrammingModel = sPModel;
|
|
865
875
|
if (sPModel === ProgrammingModel.Draft) {
|
|
866
876
|
const draftDataContext = oModel.bindContext(oParamsContext.getPath() + "/DraftAdministrativeData").getBoundContext();
|
|
867
877
|
if (!that._bIsModified) {
|
|
868
|
-
return draftDataContext.requestObject().then(function(draftAdminData: any) {
|
|
878
|
+
return draftDataContext.requestObject().then(function (draftAdminData: any) {
|
|
869
879
|
if (draftAdminData) {
|
|
870
880
|
that._bIsModified = !(draftAdminData.CreationDateTime === draftAdminData.LastChangeDateTime);
|
|
871
881
|
}
|
|
@@ -873,14 +883,14 @@ class TransactionHelper {
|
|
|
873
883
|
}
|
|
874
884
|
}
|
|
875
885
|
})
|
|
876
|
-
.then(function() {
|
|
886
|
+
.then(function () {
|
|
877
887
|
if (!mParameters.skipDiscardPopover) {
|
|
878
888
|
return that._showDiscardPopover(oCancelButton, that._bIsModified, oResourceBundle);
|
|
879
889
|
} else {
|
|
880
890
|
return Promise.resolve();
|
|
881
891
|
}
|
|
882
892
|
})
|
|
883
|
-
.then(function() {
|
|
893
|
+
.then(function () {
|
|
884
894
|
if (mParameters.beforeCancelCallBack) {
|
|
885
895
|
onBeforeCancelPromise = mParameters.beforeCancelCallBack({ context: oContext });
|
|
886
896
|
} else {
|
|
@@ -888,11 +898,11 @@ class TransactionHelper {
|
|
|
888
898
|
}
|
|
889
899
|
return onBeforeCancelPromise;
|
|
890
900
|
})
|
|
891
|
-
.then(function() {
|
|
901
|
+
.then(function () {
|
|
892
902
|
// eslint-disable-next-line default-case
|
|
893
903
|
switch (sProgrammingModel) {
|
|
894
904
|
case ProgrammingModel.Draft:
|
|
895
|
-
return oParamsContext.requestObject("HasActiveEntity").then(function(bHasActiveEntity: any) {
|
|
905
|
+
return oParamsContext.requestObject("HasActiveEntity").then(function (bHasActiveEntity: any) {
|
|
896
906
|
let oDeletePromise;
|
|
897
907
|
if (!bHasActiveEntity) {
|
|
898
908
|
if (oParamsContext && oParamsContext.hasPendingChanges()) {
|
|
@@ -905,7 +915,7 @@ class TransactionHelper {
|
|
|
905
915
|
return oActiveContext
|
|
906
916
|
.requestCanonicalPath()
|
|
907
917
|
.then(
|
|
908
|
-
function(sPath: any) {
|
|
918
|
+
function (sPath: any) {
|
|
909
919
|
sCanonicalPath = sPath;
|
|
910
920
|
if (oParamsContext && oParamsContext.hasPendingChanges()) {
|
|
911
921
|
oParamsContext.getBinding().resetChanges();
|
|
@@ -913,12 +923,12 @@ class TransactionHelper {
|
|
|
913
923
|
oDeletePromise = draft.deleteDraft(oParamsContext);
|
|
914
924
|
return oDeletePromise;
|
|
915
925
|
},
|
|
916
|
-
function() {
|
|
926
|
+
function () {
|
|
917
927
|
draft.deleteDraft(oParamsContext);
|
|
918
928
|
return;
|
|
919
929
|
}
|
|
920
930
|
)
|
|
921
|
-
.then(function() {
|
|
931
|
+
.then(function () {
|
|
922
932
|
//oParamsContext.delete() in the previous promise doesnt return anything upon success.
|
|
923
933
|
if (!sCanonicalPath) {
|
|
924
934
|
return;
|
|
@@ -933,7 +943,7 @@ class TransactionHelper {
|
|
|
933
943
|
}
|
|
934
944
|
});
|
|
935
945
|
case ProgrammingModel.Sticky:
|
|
936
|
-
return sticky.discardDocument(oContext).then(function(oContext: any) {
|
|
946
|
+
return sticky.discardDocument(oContext).then(function (oContext: any) {
|
|
937
947
|
if (oContext) {
|
|
938
948
|
if (oContext.hasPendingChanges()) {
|
|
939
949
|
oContext.getBinding().resetChanges();
|
|
@@ -949,21 +959,21 @@ class TransactionHelper {
|
|
|
949
959
|
return Promise.reject("Cancel document only allowed for draft or sticky session supported services");
|
|
950
960
|
}
|
|
951
961
|
})
|
|
952
|
-
.then(function(context: any) {
|
|
962
|
+
.then(function (context: any) {
|
|
953
963
|
that._bIsModified = false;
|
|
954
964
|
// remove existing bound transition messages
|
|
955
965
|
messageHandler.removeTransitionMessages();
|
|
956
966
|
// show unbound messages
|
|
957
|
-
return messageHandler.showMessages().then(function() {
|
|
967
|
+
return messageHandler.showMessages().then(function () {
|
|
958
968
|
return context;
|
|
959
969
|
});
|
|
960
970
|
})
|
|
961
|
-
.catch(function(err: any) {
|
|
962
|
-
return messageHandler.showMessages().then(function() {
|
|
971
|
+
.catch(function (err: any) {
|
|
972
|
+
return messageHandler.showMessages().then(function () {
|
|
963
973
|
return Promise.reject(err);
|
|
964
974
|
});
|
|
965
975
|
})
|
|
966
|
-
.finally(function() {
|
|
976
|
+
.finally(function () {
|
|
967
977
|
BusyLocker.unlock(that.oLockObject);
|
|
968
978
|
});
|
|
969
979
|
}
|
|
@@ -996,13 +1006,14 @@ class TransactionHelper {
|
|
|
996
1006
|
if (sProgrammingModel === ProgrammingModel.Draft) {
|
|
997
1007
|
oSavePromise = draft.activateDocument(oContext, this._getAppComponent(), {});
|
|
998
1008
|
} else if (sProgrammingModel === ProgrammingModel.Sticky) {
|
|
999
|
-
|
|
1009
|
+
const bEnableStrictHandling = UriParameters.fromQuery(window.location.search).get("sap-fe-save-strict-mode") === "true";
|
|
1010
|
+
oSavePromise = sticky.activateDocument(oContext, bEnableStrictHandling);
|
|
1000
1011
|
} else {
|
|
1001
1012
|
BusyLocker.unlock(that.oLockObject);
|
|
1002
1013
|
return Promise.reject(new Error("Save is only allowed for draft or sticky session supported services"));
|
|
1003
1014
|
}
|
|
1004
1015
|
return oSavePromise
|
|
1005
|
-
.then(function(oActiveDocument: any) {
|
|
1016
|
+
.then(function (oActiveDocument: any) {
|
|
1006
1017
|
const bNewObject =
|
|
1007
1018
|
that.sProgrammingModel === ProgrammingModel.Sticky ? that._bCreateMode : !oContext.getObject().HasActiveEntity;
|
|
1008
1019
|
MessageToast.show(
|
|
@@ -1011,25 +1022,25 @@ class TransactionHelper {
|
|
|
1011
1022
|
: CommonUtils.getTranslatedText("C_TRANSACTION_HELPER_OBJECT_SAVED", oResourceBundle)
|
|
1012
1023
|
);
|
|
1013
1024
|
that._bIsModified = false;
|
|
1014
|
-
return messageHandler.showMessageDialog().then(function() {
|
|
1025
|
+
return messageHandler.showMessageDialog().then(function () {
|
|
1015
1026
|
return oActiveDocument;
|
|
1016
1027
|
});
|
|
1017
1028
|
})
|
|
1018
|
-
.catch(function(err: any) {
|
|
1029
|
+
.catch(function (err: any) {
|
|
1019
1030
|
if (aBindings && aBindings.length > 0) {
|
|
1020
1031
|
/* The sideEffects are executed only for table items in transient state */
|
|
1021
|
-
aBindings.forEach(function(oListBinding: any) {
|
|
1032
|
+
aBindings.forEach(function (oListBinding: any) {
|
|
1022
1033
|
if (!CommonUtils.hasTransientContext(oListBinding) && bExecuteSideEffectsOnError) {
|
|
1023
1034
|
const oAppComponent = that._getAppComponent();
|
|
1024
1035
|
oAppComponent.getSideEffectsService().requestSideEffectsForNavigationProperty(oListBinding.getPath(), oContext);
|
|
1025
1036
|
}
|
|
1026
1037
|
});
|
|
1027
1038
|
}
|
|
1028
|
-
return messageHandler.showMessages().then(function() {
|
|
1039
|
+
return messageHandler.showMessages().then(function () {
|
|
1029
1040
|
return Promise.reject(err);
|
|
1030
1041
|
});
|
|
1031
1042
|
})
|
|
1032
|
-
.finally(function() {
|
|
1043
|
+
.finally(function () {
|
|
1033
1044
|
BusyLocker.unlock(that.oLockObject);
|
|
1034
1045
|
});
|
|
1035
1046
|
}
|
|
@@ -1084,21 +1095,21 @@ class TransactionHelper {
|
|
|
1084
1095
|
const oAppComponent = that._getAppComponent();
|
|
1085
1096
|
const mSideEffectsParameters = oAppComponent.getSideEffectsService().getODataActionSideEffects(sActionName, oContext) || {};
|
|
1086
1097
|
if (oContext && oModel) {
|
|
1087
|
-
oPromise = new Promise<void>(function(resolve, reject) {
|
|
1098
|
+
oPromise = new Promise<void>(function (resolve, reject) {
|
|
1088
1099
|
let oApplicableContextDialog: Dialog;
|
|
1089
1100
|
const oController = {
|
|
1090
|
-
onClose: function() {
|
|
1101
|
+
onClose: function () {
|
|
1091
1102
|
// User cancels action
|
|
1092
1103
|
oApplicableContextDialog.close();
|
|
1093
1104
|
resolve();
|
|
1094
1105
|
},
|
|
1095
|
-
onContinue: function() {
|
|
1106
|
+
onContinue: function () {
|
|
1096
1107
|
// Users continues the action with the bound contexts
|
|
1097
1108
|
oApplicableContextDialog.close();
|
|
1098
1109
|
resolve(mParameters.applicableContext);
|
|
1099
1110
|
}
|
|
1100
1111
|
};
|
|
1101
|
-
const fnOpenAndFillDialog = function() {
|
|
1112
|
+
const fnOpenAndFillDialog = function () {
|
|
1102
1113
|
let oDialogContent;
|
|
1103
1114
|
const nNotApplicable = mParameters.notApplicableContext.length,
|
|
1104
1115
|
aNotApplicableItems = [];
|
|
@@ -1139,10 +1150,10 @@ class TransactionHelper {
|
|
|
1139
1150
|
}
|
|
1140
1151
|
)
|
|
1141
1152
|
)
|
|
1142
|
-
.then(function(oFragment: any) {
|
|
1153
|
+
.then(function (oFragment: any) {
|
|
1143
1154
|
return Fragment.load({ definition: oFragment, controller: oController });
|
|
1144
1155
|
})
|
|
1145
|
-
.then(function(oPopover: any) {
|
|
1156
|
+
.then(function (oPopover: any) {
|
|
1146
1157
|
oApplicableContextDialog = oPopover;
|
|
1147
1158
|
mParameters.parentControl.addDependent(oPopover);
|
|
1148
1159
|
fnOpenAndFillDialog();
|
|
@@ -1151,7 +1162,7 @@ class TransactionHelper {
|
|
|
1151
1162
|
} else {
|
|
1152
1163
|
resolve(mParameters.contexts);
|
|
1153
1164
|
}
|
|
1154
|
-
}).then(function(contextToProcess: any) {
|
|
1165
|
+
}).then(function (contextToProcess: any) {
|
|
1155
1166
|
if (contextToProcess) {
|
|
1156
1167
|
return operations.callBoundAction(sActionName, contextToProcess, oModel, oAppComponent, {
|
|
1157
1168
|
invocationGrouping: mParameters.invocationGrouping,
|
|
@@ -1160,14 +1171,15 @@ class TransactionHelper {
|
|
|
1160
1171
|
mBindingParameters: mBindingParameters,
|
|
1161
1172
|
entitySetName: mParameters.entitySetName,
|
|
1162
1173
|
additionalSideEffect: mSideEffectsParameters,
|
|
1163
|
-
onSubmitted: function() {
|
|
1174
|
+
onSubmitted: function () {
|
|
1164
1175
|
messageHandler.removeTransitionMessages();
|
|
1165
1176
|
BusyLocker.lock(that.oLockObject);
|
|
1166
1177
|
},
|
|
1167
|
-
onResponse: function() {
|
|
1178
|
+
onResponse: function () {
|
|
1168
1179
|
BusyLocker.unlock(that.oLockObject);
|
|
1169
1180
|
},
|
|
1170
1181
|
parentControl: mParameters.parentControl,
|
|
1182
|
+
controlId: mParameters.controlId,
|
|
1171
1183
|
internalModelContext: mParameters.internalModelContext,
|
|
1172
1184
|
operationAvailableMap: mParameters.operationAvailableMap,
|
|
1173
1185
|
bIsCreateAction: mParameters.bIsCreateAction,
|
|
@@ -1187,10 +1199,10 @@ class TransactionHelper {
|
|
|
1187
1199
|
showActionParameterDialog: true,
|
|
1188
1200
|
bindingParameters: mBindingParameters,
|
|
1189
1201
|
entitySetName: mParameters.entitySetName,
|
|
1190
|
-
onSubmitted: function() {
|
|
1202
|
+
onSubmitted: function () {
|
|
1191
1203
|
BusyLocker.lock(that.oLockObject);
|
|
1192
1204
|
},
|
|
1193
|
-
onResponse: function() {
|
|
1205
|
+
onResponse: function () {
|
|
1194
1206
|
BusyLocker.unlock(that.oLockObject);
|
|
1195
1207
|
},
|
|
1196
1208
|
parentControl: mParameters.parentControl,
|
|
@@ -1201,14 +1213,14 @@ class TransactionHelper {
|
|
|
1201
1213
|
});
|
|
1202
1214
|
}
|
|
1203
1215
|
return oPromise
|
|
1204
|
-
.then(function(oResult: any) {
|
|
1216
|
+
.then(function (oResult: any) {
|
|
1205
1217
|
// Succeeded
|
|
1206
|
-
return that._handleActionResponse(messageHandler, mParameters, sActionName).then(function() {
|
|
1218
|
+
return that._handleActionResponse(messageHandler, mParameters, sActionName).then(function () {
|
|
1207
1219
|
return oResult;
|
|
1208
1220
|
});
|
|
1209
1221
|
})
|
|
1210
|
-
.catch(function(err: any) {
|
|
1211
|
-
return that._handleActionResponse(messageHandler, mParameters, sActionName).then(function() {
|
|
1222
|
+
.catch(function (err: any) {
|
|
1223
|
+
return that._handleActionResponse(messageHandler, mParameters, sActionName).then(function () {
|
|
1212
1224
|
return Promise.reject(err);
|
|
1213
1225
|
});
|
|
1214
1226
|
});
|
|
@@ -1244,11 +1256,11 @@ class TransactionHelper {
|
|
|
1244
1256
|
* @final
|
|
1245
1257
|
*/
|
|
1246
1258
|
handleValidationError() {
|
|
1247
|
-
const oMessageManager =
|
|
1259
|
+
const oMessageManager = Core.getMessageManager(),
|
|
1248
1260
|
errorToRemove = oMessageManager
|
|
1249
1261
|
.getMessageModel()
|
|
1250
1262
|
.getData()
|
|
1251
|
-
.filter(function(error: any) {
|
|
1263
|
+
.filter(function (error: any) {
|
|
1252
1264
|
// only needs to handle validation messages, technical and persistent errors needs not to be checked here.
|
|
1253
1265
|
if (error.validation) {
|
|
1254
1266
|
return error;
|
|
@@ -1276,13 +1288,13 @@ class TransactionHelper {
|
|
|
1276
1288
|
const that = this;
|
|
1277
1289
|
that._bContinueDiscard = false;
|
|
1278
1290
|
// to be implemented
|
|
1279
|
-
return new Promise<void>(function(resolve, reject) {
|
|
1291
|
+
return new Promise<void>(function (resolve, reject) {
|
|
1280
1292
|
if (!oCancelButton) {
|
|
1281
1293
|
reject("Cancel button not found");
|
|
1282
1294
|
}
|
|
1283
1295
|
//Show popover only when data is changed.
|
|
1284
1296
|
if (bIsModified) {
|
|
1285
|
-
const fnOnAfterDiscard = function() {
|
|
1297
|
+
const fnOnAfterDiscard = function () {
|
|
1286
1298
|
oCancelButton.setEnabled(true);
|
|
1287
1299
|
if (that._bContinueDiscard) {
|
|
1288
1300
|
resolve();
|
|
@@ -1300,7 +1312,7 @@ class TransactionHelper {
|
|
|
1300
1312
|
oButton = new Button({
|
|
1301
1313
|
text: CommonUtils.getTranslatedText("C_TRANSACTION_HELPER_DRAFT_DISCARD_BUTTON", oResourceBundle),
|
|
1302
1314
|
width: "100%",
|
|
1303
|
-
press: function() {
|
|
1315
|
+
press: function () {
|
|
1304
1316
|
that.handleValidationError();
|
|
1305
1317
|
that._bContinueDiscard = true;
|
|
1306
1318
|
that._oPopover.close();
|
|
@@ -1315,7 +1327,7 @@ class TransactionHelper {
|
|
|
1315
1327
|
items: [oText, oButton]
|
|
1316
1328
|
})
|
|
1317
1329
|
],
|
|
1318
|
-
beforeOpen: function() {
|
|
1330
|
+
beforeOpen: function () {
|
|
1319
1331
|
// make sure to NOT trigger multiple cancel flows
|
|
1320
1332
|
oCancelButton.setEnabled(false);
|
|
1321
1333
|
that._oPopover.setInitialFocus(oButton);
|
|
@@ -1359,6 +1371,32 @@ class TransactionHelper {
|
|
|
1359
1371
|
_getAppComponent() {
|
|
1360
1372
|
return this._oAppComponent;
|
|
1361
1373
|
}
|
|
1374
|
+
|
|
1375
|
+
_onFieldChange(oEvent: any, oCreateButton: any, messageHandler: any, fnValidateRequiredProperties: Function) {
|
|
1376
|
+
messageHandler.removeTransitionMessages();
|
|
1377
|
+
const oField = oEvent.getSource();
|
|
1378
|
+
const oFieldPromise = oEvent.getParameter("promise");
|
|
1379
|
+
if (oFieldPromise) {
|
|
1380
|
+
return oFieldPromise
|
|
1381
|
+
.then(function (value: any) {
|
|
1382
|
+
// Setting value of field as '' in case of value help and validating other fields
|
|
1383
|
+
oField.setValue(value);
|
|
1384
|
+
fnValidateRequiredProperties();
|
|
1385
|
+
return oField.getValue();
|
|
1386
|
+
})
|
|
1387
|
+
.catch(function (value: any) {
|
|
1388
|
+
if (value !== "") {
|
|
1389
|
+
//disabling the continue button in case of invalid value in field
|
|
1390
|
+
oCreateButton.setEnabled(false);
|
|
1391
|
+
} else {
|
|
1392
|
+
// validating all the fields in case of empty value in field
|
|
1393
|
+
oField.setValue(value);
|
|
1394
|
+
fnValidateRequiredProperties();
|
|
1395
|
+
}
|
|
1396
|
+
});
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1362
1400
|
_launchDialogWithKeyFields(
|
|
1363
1401
|
oListBinding: any,
|
|
1364
1402
|
oTransientListBinding: any,
|
|
@@ -1373,7 +1411,7 @@ class TransactionHelper {
|
|
|
1373
1411
|
let oDialog: Dialog;
|
|
1374
1412
|
const oParentControl = mParameters.parentControl,
|
|
1375
1413
|
bSuccess = false;
|
|
1376
|
-
return new Promise(function(resolve: (value: any) => void, reject: (reason?: any) => void) {
|
|
1414
|
+
return new Promise(function (resolve: (value: any) => void, reject: (reason?: any) => void) {
|
|
1377
1415
|
const sFragmentName = "sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog";
|
|
1378
1416
|
const oFragment = XMLTemplateProcessor.loadTemplate(sFragmentName, "fragment"),
|
|
1379
1417
|
oResourceBundle = oParentControl.getController().oResourceBundle,
|
|
@@ -1404,42 +1442,43 @@ class TransactionHelper {
|
|
|
1404
1442
|
}
|
|
1405
1443
|
}
|
|
1406
1444
|
)
|
|
1407
|
-
).then(function(oFragment: any) {
|
|
1445
|
+
).then(function (oFragment: any) {
|
|
1408
1446
|
let aFormElements: any[] = [];
|
|
1409
1447
|
const mFieldValueMap: any = {};
|
|
1410
1448
|
let oCreateButton: Button;
|
|
1411
|
-
const validateRequiredProperties = function() {
|
|
1449
|
+
const validateRequiredProperties = function () {
|
|
1412
1450
|
return Promise.all(
|
|
1413
1451
|
aFormElements
|
|
1414
|
-
.map(function(oFormElement: any) {
|
|
1452
|
+
.map(function (oFormElement: any) {
|
|
1415
1453
|
return oFormElement.getFields()[0];
|
|
1416
1454
|
})
|
|
1417
|
-
.filter(function(oField: any) {
|
|
1418
|
-
|
|
1455
|
+
.filter(function (oField: any) {
|
|
1456
|
+
// The continue button should remain disabled in case of error in any field of the create dialog
|
|
1457
|
+
return oField.getRequired() || (oField.getValueState() === ValueState.Error && oField.getValue() !== "");
|
|
1419
1458
|
})
|
|
1420
|
-
.map(function(oField: any) {
|
|
1459
|
+
.map(function (oField: any) {
|
|
1421
1460
|
const sFieldId = oField.getId();
|
|
1422
1461
|
if (sFieldId in mFieldValueMap) {
|
|
1423
1462
|
return Promise.resolve(mFieldValueMap[sFieldId])
|
|
1424
|
-
.then(function(vValue: any) {
|
|
1425
|
-
return vValue;
|
|
1463
|
+
.then(function (vValue: any) {
|
|
1464
|
+
return oField.getValueState() === ValueState.Error ? undefined : vValue;
|
|
1426
1465
|
})
|
|
1427
|
-
.catch(function() {
|
|
1466
|
+
.catch(function () {
|
|
1428
1467
|
return undefined;
|
|
1429
1468
|
});
|
|
1430
1469
|
}
|
|
1431
1470
|
return oField.getValueState() === ValueState.Error ? undefined : oField.getValue();
|
|
1432
1471
|
})
|
|
1433
1472
|
)
|
|
1434
|
-
.then(function(aResults: any[]) {
|
|
1435
|
-
return aResults.every(function(vValue: any) {
|
|
1473
|
+
.then(function (aResults: any[]) {
|
|
1474
|
+
return aResults.every(function (vValue: any) {
|
|
1436
1475
|
return vValue !== undefined && vValue !== null && vValue !== "";
|
|
1437
1476
|
});
|
|
1438
1477
|
})
|
|
1439
|
-
.catch(function() {
|
|
1478
|
+
.catch(function () {
|
|
1440
1479
|
return false;
|
|
1441
1480
|
})
|
|
1442
|
-
.then(function(bEnabled: boolean) {
|
|
1481
|
+
.then(function (bEnabled: boolean) {
|
|
1443
1482
|
oCreateButton.setEnabled(bEnabled);
|
|
1444
1483
|
});
|
|
1445
1484
|
};
|
|
@@ -1450,24 +1489,16 @@ class TransactionHelper {
|
|
|
1450
1489
|
liveChange is not fired when value is added from valuehelp.
|
|
1451
1490
|
value validation is not done for create button enablement.
|
|
1452
1491
|
*/
|
|
1453
|
-
handleChange: function(oEvent: any) {
|
|
1454
|
-
messageHandler.removeTransitionMessages();
|
|
1455
|
-
const oField = oEvent.getSource();
|
|
1492
|
+
handleChange: function (oEvent: any) {
|
|
1456
1493
|
const sFieldId = oEvent.getParameter("id");
|
|
1457
|
-
|
|
1458
|
-
if (oFieldPromise) {
|
|
1459
|
-
mFieldValueMap[sFieldId] = oFieldPromise.then(function() {
|
|
1460
|
-
return oField.getValue();
|
|
1461
|
-
});
|
|
1462
|
-
}
|
|
1463
|
-
validateRequiredProperties();
|
|
1494
|
+
mFieldValueMap[sFieldId] = that._onFieldChange(oEvent, oCreateButton, messageHandler, validateRequiredProperties);
|
|
1464
1495
|
},
|
|
1465
1496
|
/*
|
|
1466
1497
|
fired on key press. the create button is enabled when a value is added.
|
|
1467
1498
|
liveChange is not fired when value is added from valuehelp.
|
|
1468
1499
|
value validation is not done for create button enablement.
|
|
1469
1500
|
*/
|
|
1470
|
-
handleLiveChange: function(oEvent: any) {
|
|
1501
|
+
handleLiveChange: function (oEvent: any) {
|
|
1471
1502
|
const sFieldId = oEvent.getParameter("id");
|
|
1472
1503
|
const vValue = oEvent.getParameter("value");
|
|
1473
1504
|
mFieldValueMap[sFieldId] = vValue;
|
|
@@ -1477,28 +1508,28 @@ class TransactionHelper {
|
|
|
1477
1508
|
return Fragment.load({
|
|
1478
1509
|
definition: oFragment,
|
|
1479
1510
|
controller: oController
|
|
1480
|
-
}).then(function(oDialogContent: any) {
|
|
1511
|
+
}).then(function (oDialogContent: any) {
|
|
1481
1512
|
oDialog = new Dialog({
|
|
1482
1513
|
title: CommonUtils.getTranslatedText("C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE", oResourceBundle),
|
|
1483
1514
|
content: [oDialogContent],
|
|
1484
1515
|
beginButton: {
|
|
1485
1516
|
text: CommonUtils.getTranslatedText("C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE_BUTTON", oResourceBundle),
|
|
1486
1517
|
type: "Emphasized",
|
|
1487
|
-
press: function(oEvent: any) {
|
|
1518
|
+
press: function (oEvent: any) {
|
|
1488
1519
|
const oCreateButton = oEvent.getSource();
|
|
1489
1520
|
oCreateButton.setEnabled(false);
|
|
1490
1521
|
BusyLocker.lock(oDialog);
|
|
1491
1522
|
mParameters.bIsCreateDialog = true;
|
|
1492
1523
|
return Promise.all(
|
|
1493
|
-
Object.keys(mFieldValueMap).map(function(sKey: string) {
|
|
1494
|
-
return mFieldValueMap[sKey].then(function(oValue: any) {
|
|
1524
|
+
Object.keys(mFieldValueMap).map(function (sKey: string) {
|
|
1525
|
+
return mFieldValueMap[sKey].then(function (oValue: any) {
|
|
1495
1526
|
const oDialogValue: any = {};
|
|
1496
1527
|
oDialogValue[sKey] = oValue;
|
|
1497
1528
|
return oDialogValue;
|
|
1498
1529
|
});
|
|
1499
1530
|
})
|
|
1500
1531
|
)
|
|
1501
|
-
.then(function(aValues: any[]) {
|
|
1532
|
+
.then(function (aValues: any[]) {
|
|
1502
1533
|
let onBeforeCreatePromise;
|
|
1503
1534
|
if (mParameters.beforeCreateCallBack) {
|
|
1504
1535
|
onBeforeCreatePromise = mParameters.beforeCreateCallBack({
|
|
@@ -1510,7 +1541,7 @@ class TransactionHelper {
|
|
|
1510
1541
|
}
|
|
1511
1542
|
return onBeforeCreatePromise;
|
|
1512
1543
|
})
|
|
1513
|
-
.then(function() {
|
|
1544
|
+
.then(function () {
|
|
1514
1545
|
const oPromise = that.onAfterCreateCompletion(
|
|
1515
1546
|
oTransientListBinding,
|
|
1516
1547
|
oTransientContext,
|
|
@@ -1519,17 +1550,17 @@ class TransactionHelper {
|
|
|
1519
1550
|
oModel.submitBatch("submitLater");
|
|
1520
1551
|
return oPromise;
|
|
1521
1552
|
})
|
|
1522
|
-
.then(function(oResponse: any) {
|
|
1553
|
+
.then(function (oResponse: any) {
|
|
1523
1554
|
if (!oResponse || (oResponse && oResponse.bKeepDialogOpen !== true)) {
|
|
1524
1555
|
oDialog.setBindingContext(null as any);
|
|
1525
1556
|
oDialog.close();
|
|
1526
1557
|
resolve(oResponse);
|
|
1527
1558
|
}
|
|
1528
1559
|
})
|
|
1529
|
-
.catch(function(oError: any) {
|
|
1560
|
+
.catch(function (oError: any) {
|
|
1530
1561
|
reject(oError);
|
|
1531
1562
|
})
|
|
1532
|
-
.finally(function() {
|
|
1563
|
+
.finally(function () {
|
|
1533
1564
|
BusyLocker.unlock(oDialog);
|
|
1534
1565
|
oCreateButton.setEnabled(true);
|
|
1535
1566
|
return messageHandler.showMessages();
|
|
@@ -1538,11 +1569,11 @@ class TransactionHelper {
|
|
|
1538
1569
|
},
|
|
1539
1570
|
endButton: {
|
|
1540
1571
|
text: CommonUtils.getTranslatedText("C_COMMON_ACTION_PARAMETER_DIALOG_CANCEL", oResourceBundle),
|
|
1541
|
-
press: function() {
|
|
1572
|
+
press: function () {
|
|
1542
1573
|
oDialog.close();
|
|
1543
1574
|
}
|
|
1544
1575
|
},
|
|
1545
|
-
afterClose: function() {
|
|
1576
|
+
afterClose: function () {
|
|
1546
1577
|
// show footer as per UX guidelines when dialog is not open
|
|
1547
1578
|
(oDialog.getBindingContext("internal") as InternalModelContext)?.setProperty("isCreateDialogOpen", false);
|
|
1548
1579
|
oDialog.destroy();
|
|
@@ -1572,14 +1603,14 @@ class TransactionHelper {
|
|
|
1572
1603
|
mParameters.createAction,
|
|
1573
1604
|
mParameters.data
|
|
1574
1605
|
)
|
|
1575
|
-
.then(function() {
|
|
1606
|
+
.then(function () {
|
|
1576
1607
|
validateRequiredProperties();
|
|
1577
1608
|
// footer must not be visible when the dialog is open as per UX guidelines
|
|
1578
1609
|
(oDialog.getBindingContext("internal") as InternalModelContext).setProperty("isCreateDialogOpen", true);
|
|
1579
1610
|
oDialog.open();
|
|
1580
1611
|
})
|
|
1581
|
-
.catch(function(oError: any) {
|
|
1582
|
-
return messageHandler.showMessages().then(function() {
|
|
1612
|
+
.catch(function (oError: any) {
|
|
1613
|
+
return messageHandler.showMessages().then(function () {
|
|
1583
1614
|
return Promise.reject(oError);
|
|
1584
1615
|
});
|
|
1585
1616
|
});
|
|
@@ -1589,14 +1620,14 @@ class TransactionHelper {
|
|
|
1589
1620
|
}
|
|
1590
1621
|
onAfterCreateCompletion(oListBinding: any, oNewDocumentContext: any, mParameters: any) {
|
|
1591
1622
|
let fnResolve: Function, fnReject: Function;
|
|
1592
|
-
const oPromise = new Promise(function(resolve, reject) {
|
|
1623
|
+
const oPromise = new Promise(function (resolve, reject) {
|
|
1593
1624
|
fnResolve = resolve;
|
|
1594
1625
|
fnReject = reject;
|
|
1595
1626
|
});
|
|
1596
1627
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
1597
1628
|
const that = this;
|
|
1598
1629
|
// Workaround suggested by OData model v4 colleagues
|
|
1599
|
-
const fnCreateCompleted = function(oEvent: any) {
|
|
1630
|
+
const fnCreateCompleted = function (oEvent: any) {
|
|
1600
1631
|
const oContext = oEvent.getParameter("context"),
|
|
1601
1632
|
bSuccess = oEvent.getParameter("success");
|
|
1602
1633
|
if (oContext === oNewDocumentContext) {
|
|
@@ -1609,10 +1640,10 @@ class TransactionHelper {
|
|
|
1609
1640
|
// this is needed to avoid console errors TO be checked with model colleagues
|
|
1610
1641
|
oContext
|
|
1611
1642
|
.created()
|
|
1612
|
-
.then(undefined, function() {
|
|
1643
|
+
.then(undefined, function () {
|
|
1613
1644
|
Log.trace("transient creation context deleted");
|
|
1614
1645
|
})
|
|
1615
|
-
.catch(function(oError: any) {
|
|
1646
|
+
.catch(function (oError: any) {
|
|
1616
1647
|
Log.trace("transient creation context deletion error", oError);
|
|
1617
1648
|
});
|
|
1618
1649
|
if (!mParameters.bIsCreateDialog) {
|
|
@@ -1690,11 +1721,11 @@ class TransactionHelper {
|
|
|
1690
1721
|
sNewAction: string,
|
|
1691
1722
|
oResourceBundleCore: ResourceBundle
|
|
1692
1723
|
) {
|
|
1693
|
-
const fnGetLabelFromLineItemAnnotation = function() {
|
|
1724
|
+
const fnGetLabelFromLineItemAnnotation = function () {
|
|
1694
1725
|
if (oMetaModel && oMetaModel.getObject(sMetaPath + "/@com.sap.vocabularies.UI.v1.LineItem")) {
|
|
1695
1726
|
const iLineItemIndex = oMetaModel
|
|
1696
1727
|
.getObject(sMetaPath + "/@com.sap.vocabularies.UI.v1.LineItem")
|
|
1697
|
-
.findIndex(function(oLineItem: any) {
|
|
1728
|
+
.findIndex(function (oLineItem: any) {
|
|
1698
1729
|
const aLineItemAction = oLineItem.Action ? oLineItem.Action.split("(") : undefined;
|
|
1699
1730
|
return aLineItemAction ? aLineItemAction[0] === sNewAction : false;
|
|
1700
1731
|
});
|