@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
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import MessageBox from "sap/m/MessageBox";
|
|
2
|
-
import Dialog from "sap/m/Dialog";
|
|
3
|
-
import JSONModel from "sap/ui/model/json/JSONModel";
|
|
4
|
-
import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
|
|
5
|
-
import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
|
|
6
|
-
import Fragment from "sap/ui/core/Fragment";
|
|
7
|
-
import messageHandling from "sap/fe/core/actions/messageHandling";
|
|
8
|
-
import BusyLocker from "sap/fe/core/BusyLocker";
|
|
9
|
-
import CommonUtils from "sap/fe/core/CommonUtils";
|
|
10
1
|
import Log from "sap/base/Log";
|
|
11
|
-
import
|
|
2
|
+
import CommonUtils from "sap/fe/core/CommonUtils";
|
|
3
|
+
import BusyLocker from "sap/fe/core/controllerextensions/BusyLocker";
|
|
4
|
+
import messageHandling from "sap/fe/core/controllerextensions/messageHandler/messageHandling";
|
|
12
5
|
import FPMHelper from "sap/fe/core/helpers/FPMHelper";
|
|
13
|
-
import Button from "sap/m/Button";
|
|
14
6
|
import { generate } from "sap/fe/core/helpers/StableIdHelper";
|
|
7
|
+
import FELibrary from "sap/fe/core/library";
|
|
8
|
+
import Button from "sap/m/Button";
|
|
9
|
+
import Dialog from "sap/m/Dialog";
|
|
10
|
+
import MessageBox from "sap/m/MessageBox";
|
|
11
|
+
import Core from "sap/ui/core/Core";
|
|
12
|
+
import Fragment from "sap/ui/core/Fragment";
|
|
13
|
+
import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
|
|
14
|
+
import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
|
|
15
|
+
import JSONModel from "sap/ui/model/json/JSONModel";
|
|
16
|
+
import Context from "sap/ui/model/odata/v4/Context";
|
|
15
17
|
|
|
16
18
|
const Constants = FELibrary.Constants,
|
|
17
19
|
InvocationGrouping = FELibrary.InvocationGrouping;
|
|
@@ -138,12 +140,12 @@ function _executeFunction(sFunctionName: any, oModel: any, oFunction: any, conte
|
|
|
138
140
|
}
|
|
139
141
|
const oFunctionPromise = oFunction.execute(sGroupId);
|
|
140
142
|
oModel.submitBatch(sGroupId);
|
|
141
|
-
return oFunctionPromise.then(function() {
|
|
143
|
+
return oFunctionPromise.then(function () {
|
|
142
144
|
return oFunction.getBoundContext();
|
|
143
145
|
});
|
|
144
146
|
}
|
|
145
147
|
function callAction(sActionName: any, oModel: any, oAction: any, oAppComponent: any, mParameters: any) {
|
|
146
|
-
return new Promise(function(resolve: (value: any) => void, reject: (reason?: any) => void) {
|
|
148
|
+
return new Promise(function (resolve: (value: any) => void, reject: (reason?: any) => void) {
|
|
147
149
|
let aActionParameters = mParameters.actionParameters || [];
|
|
148
150
|
let mActionExecutionParameters: any = {};
|
|
149
151
|
let fnDialog;
|
|
@@ -157,6 +159,9 @@ function callAction(sActionName: any, oModel: any, oAction: any, oAppComponent:
|
|
|
157
159
|
let sMetaPath;
|
|
158
160
|
let sMessagesPath: any;
|
|
159
161
|
let iMessageSideEffect;
|
|
162
|
+
let bIsSameEntity;
|
|
163
|
+
let oReturnType;
|
|
164
|
+
let bStaticAction;
|
|
160
165
|
if (!oAction || !oAction.getObject()) {
|
|
161
166
|
return reject(new Error("Action " + sActionName + " not found"));
|
|
162
167
|
}
|
|
@@ -188,13 +193,19 @@ function callAction(sActionName: any, oModel: any, oAction: any, oAppComponent:
|
|
|
188
193
|
sMessagesPath = oMetaModel.getObject(sMetaPath + "/@com.sap.vocabularies.Common.v1.Messages/$Path");
|
|
189
194
|
|
|
190
195
|
if (sMessagesPath) {
|
|
191
|
-
iMessageSideEffect = mParameters.additionalSideEffect.pathExpressions.findIndex(function(exp: any) {
|
|
192
|
-
return exp
|
|
196
|
+
iMessageSideEffect = mParameters.additionalSideEffect.pathExpressions.findIndex(function (exp: any) {
|
|
197
|
+
return typeof exp === "string" && exp === sMessagesPath;
|
|
193
198
|
});
|
|
194
199
|
|
|
195
|
-
if
|
|
200
|
+
// Add SAP_Messages by default if not annotated by side effects, action does not return a collection and
|
|
201
|
+
// the return type is the same as the bound type
|
|
202
|
+
oReturnType = oAction.getObject("$ReturnType");
|
|
203
|
+
bIsSameEntity =
|
|
204
|
+
oReturnType && !oReturnType.$isCollection && oAction.getModel().getObject(sMetaPath).$Type === oReturnType.$Type;
|
|
205
|
+
|
|
206
|
+
if (iMessageSideEffect > -1 || bIsSameEntity) {
|
|
196
207
|
// the message path is annotated as side effect. As there's no binding for it and the model does currently not allow
|
|
197
|
-
// to add it at a later point of time we have to take care it's part of the $select of the POST, therefore moving it
|
|
208
|
+
// to add it at a later point of time we have to take care it's part of the $select of the POST, therefore moving it.
|
|
198
209
|
mParameters.mBindingParameters = mParameters.mBindingParameters || {};
|
|
199
210
|
|
|
200
211
|
if (
|
|
@@ -206,7 +217,7 @@ function callAction(sActionName: any, oModel: any, oAction: any, oAppComponent:
|
|
|
206
217
|
? mParameters.mBindingParameters.$select + "," + sMessagesPath
|
|
207
218
|
: sMessagesPath;
|
|
208
219
|
|
|
209
|
-
if (mParameters.additionalSideEffect.triggerActions.length === 0) {
|
|
220
|
+
if (mParameters.additionalSideEffect.triggerActions.length === 0 && iMessageSideEffect > -1) {
|
|
210
221
|
// no trigger action therefore no need to request messages again
|
|
211
222
|
mParameters.additionalSideEffect.pathExpressions.splice(iMessageSideEffect, 1);
|
|
212
223
|
}
|
|
@@ -223,6 +234,11 @@ function callAction(sActionName: any, oModel: any, oAction: any, oAppComponent:
|
|
|
223
234
|
mActionExecutionParameters.internalModelContext = mParameters.internalModelContext;
|
|
224
235
|
mActionExecutionParameters.operationAvailableMap = mParameters.operationAvailableMap;
|
|
225
236
|
mActionExecutionParameters.bObjectPage = mParameters.bObjectPage;
|
|
237
|
+
if (mParameters.controlId) {
|
|
238
|
+
mActionExecutionParameters.control = mParameters.parentControl.byId(mParameters.controlId);
|
|
239
|
+
} else {
|
|
240
|
+
mActionExecutionParameters.control = mParameters.parentControl;
|
|
241
|
+
}
|
|
226
242
|
}
|
|
227
243
|
if (bIsCreateAction) {
|
|
228
244
|
mActionExecutionParameters.bIsCreateAction = bIsCreateAction;
|
|
@@ -243,10 +259,28 @@ function callAction(sActionName: any, oModel: any, oAction: any, oAppComponent:
|
|
|
243
259
|
oActionPromise = _executeAction(oAppComponent, mActionExecutionParameters);
|
|
244
260
|
}
|
|
245
261
|
return oActionPromise
|
|
246
|
-
.then(function(oOperationResult: any) {
|
|
262
|
+
.then(function (oOperationResult: any) {
|
|
263
|
+
if (
|
|
264
|
+
mActionExecutionParameters.internalModelContext &&
|
|
265
|
+
mActionExecutionParameters.operationAvailableMap &&
|
|
266
|
+
mActionExecutionParameters.aContexts &&
|
|
267
|
+
mActionExecutionParameters.aContexts.length
|
|
268
|
+
) {
|
|
269
|
+
const selectedContext = mActionExecutionParameters.aContexts.filter((oContext: Context) => {
|
|
270
|
+
const binding = oContext.getBinding();
|
|
271
|
+
return !binding.isA("sap.ui.model.odata.v4.ODataListBinding");
|
|
272
|
+
});
|
|
273
|
+
if (selectedContext && selectedContext.length) {
|
|
274
|
+
CommonUtils.setActionEnablement(
|
|
275
|
+
mActionExecutionParameters.internalModelContext,
|
|
276
|
+
JSON.parse(mActionExecutionParameters.operationAvailableMap),
|
|
277
|
+
mActionExecutionParameters.aContexts
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
247
281
|
resolve(oOperationResult);
|
|
248
282
|
})
|
|
249
|
-
.catch(function(oOperationResult: any) {
|
|
283
|
+
.catch(function (oOperationResult: any) {
|
|
250
284
|
reject(oOperationResult);
|
|
251
285
|
});
|
|
252
286
|
});
|
|
@@ -276,19 +310,19 @@ function confirmCriticalAction(
|
|
|
276
310
|
);
|
|
277
311
|
|
|
278
312
|
MessageBox.confirm(sConfirmationText, {
|
|
279
|
-
onClose: function(sAction: any) {
|
|
313
|
+
onClose: function (sAction: any) {
|
|
280
314
|
if (sAction === Action.OK) {
|
|
281
315
|
return _executeAction(oAppComponent, mParameters)
|
|
282
|
-
.then(function(oOperation: any) {
|
|
316
|
+
.then(function (oOperation: any) {
|
|
283
317
|
resolve(oOperation);
|
|
284
318
|
})
|
|
285
|
-
.catch(function(oError: any) {
|
|
319
|
+
.catch(function (oError: any) {
|
|
286
320
|
messageHandler
|
|
287
321
|
.showMessageDialog()
|
|
288
|
-
.then(function() {
|
|
322
|
+
.then(function () {
|
|
289
323
|
reject(oError);
|
|
290
324
|
})
|
|
291
|
-
.catch(function() {
|
|
325
|
+
.catch(function () {
|
|
292
326
|
reject(oError);
|
|
293
327
|
});
|
|
294
328
|
});
|
|
@@ -318,7 +352,7 @@ function showActionParameterDialog(
|
|
|
318
352
|
: oActionContext.getPath().split("/0")[0],
|
|
319
353
|
actionNameContext = metaModel.createBindingContext(sActionNamePath),
|
|
320
354
|
sFragmentName = "sap/fe/core/controls/ActionParameterDialog";
|
|
321
|
-
return new Promise(function(resolve: (value: any) => void, reject: (reason?: any) => void) {
|
|
355
|
+
return new Promise(function (resolve: (value: any) => void, reject: (reason?: any) => void) {
|
|
322
356
|
const oFragment = XMLTemplateProcessor.loadTemplate(sFragmentName, "fragment");
|
|
323
357
|
const oParameterModel = new JSONModel({
|
|
324
358
|
$displayMode: {}
|
|
@@ -326,30 +360,30 @@ function showActionParameterDialog(
|
|
|
326
360
|
let aFieldInvalid: any[] = [];
|
|
327
361
|
let aFormElements: any[] = [];
|
|
328
362
|
const mFieldValueMap: any = {};
|
|
329
|
-
const validateRequiredProperties = function() {
|
|
363
|
+
const validateRequiredProperties = function () {
|
|
330
364
|
return Promise.all(
|
|
331
365
|
aFormElements
|
|
332
|
-
.filter(function(oFormElement: any) {
|
|
366
|
+
.filter(function (oFormElement: any) {
|
|
333
367
|
const oField = oFormElement.getFields()[0];
|
|
334
368
|
return oField.getRequired() && oField.getValueState() !== "Error";
|
|
335
369
|
})
|
|
336
|
-
.map(function(oFormElement: any) {
|
|
370
|
+
.map(function (oFormElement: any) {
|
|
337
371
|
const value = oFormElement.getFields()[0].isA("sap.ui.mdc.MultiValueField")
|
|
338
372
|
? oFormElement.getFields()[0].getItems()
|
|
339
373
|
: oFormElement.getFields()[0].getValue();
|
|
340
|
-
if (value === undefined || value === null || value === "") {
|
|
374
|
+
if (value === undefined || value === null || value === "" || (Array.isArray(value) && !value.length)) {
|
|
341
375
|
return oFormElement.getLabel().getText();
|
|
342
376
|
}
|
|
343
377
|
})
|
|
344
|
-
).then(function(aResults: any[]) {
|
|
345
|
-
aResults = aResults.filter(function(result: any) {
|
|
378
|
+
).then(function (aResults: any[]) {
|
|
379
|
+
aResults = aResults.filter(function (result: any) {
|
|
346
380
|
return result !== undefined;
|
|
347
381
|
});
|
|
348
382
|
return aResults;
|
|
349
383
|
});
|
|
350
384
|
};
|
|
351
|
-
const _validateMessages = function(aActionParameters: any, aFieldInvalid: any, bClearTarget?: boolean) {
|
|
352
|
-
const oMessageManager =
|
|
385
|
+
const _validateMessages = function (aActionParameters: any, aFieldInvalid: any, bClearTarget?: boolean) {
|
|
386
|
+
const oMessageManager = Core.getMessageManager();
|
|
353
387
|
const aMessages = oMessageManager.getMessageModel().getData();
|
|
354
388
|
|
|
355
389
|
aFieldInvalid = aFieldInvalid || [];
|
|
@@ -357,9 +391,9 @@ function showActionParameterDialog(
|
|
|
357
391
|
if (!aMessages.length) {
|
|
358
392
|
aFieldInvalid = [];
|
|
359
393
|
}
|
|
360
|
-
aActionParameters.forEach(function(oActionParameters: any) {
|
|
394
|
+
aActionParameters.forEach(function (oActionParameters: any) {
|
|
361
395
|
const sParameter = oActionParameters.$Name;
|
|
362
|
-
aMessages.forEach(function(oMessage: any) {
|
|
396
|
+
aMessages.forEach(function (oMessage: any) {
|
|
363
397
|
const sParam = sParameter.replace("-inner", "");
|
|
364
398
|
if (
|
|
365
399
|
oMessage.controlIds.length > 0 &&
|
|
@@ -386,13 +420,13 @@ function showActionParameterDialog(
|
|
|
386
420
|
return aFieldInvalid;
|
|
387
421
|
};
|
|
388
422
|
const oController = {
|
|
389
|
-
handleChange: function(oEvent: any) {
|
|
423
|
+
handleChange: function (oEvent: any) {
|
|
390
424
|
messageHandler.removeTransitionMessages();
|
|
391
425
|
const oField = oEvent.getSource();
|
|
392
426
|
const sFieldId = oEvent.getParameter("id");
|
|
393
427
|
const oFieldPromise = oEvent.getParameter("promise");
|
|
394
428
|
if (oFieldPromise) {
|
|
395
|
-
mFieldValueMap[sFieldId] = oFieldPromise.then(function() {
|
|
429
|
+
mFieldValueMap[sFieldId] = oFieldPromise.then(function () {
|
|
396
430
|
return oField.getValue();
|
|
397
431
|
});
|
|
398
432
|
}
|
|
@@ -419,21 +453,21 @@ function showActionParameterDialog(
|
|
|
419
453
|
}
|
|
420
454
|
)
|
|
421
455
|
)
|
|
422
|
-
.then(function(oFragment: any) {
|
|
456
|
+
.then(function (oFragment: any) {
|
|
423
457
|
// TODO: move the dialog into the fragment and move the handlers to the oController
|
|
424
458
|
let aContexts: any[];
|
|
425
459
|
const aFunctionParams: any[] = [];
|
|
426
460
|
let oOperationBinding: any;
|
|
427
|
-
return CommonUtils.setUserDefaults(oAppComponent, aActionParameters, oParameterModel, true).then(function() {
|
|
461
|
+
return CommonUtils.setUserDefaults(oAppComponent, aActionParameters, oParameterModel, true).then(function () {
|
|
428
462
|
// TODO: move the dialog into the fragment and move the handlers to the oController
|
|
429
|
-
return Fragment.load({ definition: oFragment, controller: oController }).then(function(oDialogContent: any) {
|
|
463
|
+
return Fragment.load({ definition: oFragment, controller: oController }).then(function (oDialogContent: any) {
|
|
430
464
|
const oResourceBundle = oParentControl.getController().oResourceBundle;
|
|
431
465
|
const oDialog = new Dialog(undefined, {
|
|
432
466
|
title:
|
|
433
467
|
sActionLabel ||
|
|
434
468
|
CommonUtils.getTranslatedText("C_OPERATIONS_ACTION_PARAMETER_DIALOG_TITLE", oResourceBundle),
|
|
435
469
|
content: [oDialogContent],
|
|
436
|
-
escapeHandler: function() {
|
|
470
|
+
escapeHandler: function () {
|
|
437
471
|
oDialog.close();
|
|
438
472
|
messageHandler.removeTransitionMessages();
|
|
439
473
|
reject();
|
|
@@ -441,9 +475,9 @@ function showActionParameterDialog(
|
|
|
441
475
|
beginButton: new Button(generate(["fe", "APD_", sActionName, "Action", "Ok"]), {
|
|
442
476
|
text: sActionLabel || CommonUtils.getTranslatedText("C_COMMON_DIALOG_OK", oResourceBundle),
|
|
443
477
|
type: "Emphasized",
|
|
444
|
-
press: function() {
|
|
478
|
+
press: function () {
|
|
445
479
|
validateRequiredProperties()
|
|
446
|
-
.then(function(aEmptyMandatoryFields: any[]) {
|
|
480
|
+
.then(function (aEmptyMandatoryFields: any[]) {
|
|
447
481
|
if (aEmptyMandatoryFields.length) {
|
|
448
482
|
const oMessages = [];
|
|
449
483
|
for (let i = 0; i < aEmptyMandatoryFields.length; i++) {
|
|
@@ -470,11 +504,11 @@ function showActionParameterDialog(
|
|
|
470
504
|
}
|
|
471
505
|
BusyLocker.lock(oDialog);
|
|
472
506
|
return Promise.all(
|
|
473
|
-
Object.keys(mFieldValueMap).map(function(sKey: string) {
|
|
507
|
+
Object.keys(mFieldValueMap).map(function (sKey: string) {
|
|
474
508
|
return mFieldValueMap[sKey];
|
|
475
509
|
})
|
|
476
510
|
)
|
|
477
|
-
.then(function() {
|
|
511
|
+
.then(function () {
|
|
478
512
|
// TODO: due to using the search and value helps on the action dialog transient messages could appear
|
|
479
513
|
// we need an UX design for those to show them to the user - for now remove them before continuing
|
|
480
514
|
messageHandler.removeTransitionMessages();
|
|
@@ -499,16 +533,49 @@ function showActionParameterDialog(
|
|
|
499
533
|
}
|
|
500
534
|
mParameters.label = sActionLabel;
|
|
501
535
|
return _executeAction(oAppComponent, mParameters)
|
|
502
|
-
.then(function(oOperation: any) {
|
|
536
|
+
.then(function (oOperation: any) {
|
|
503
537
|
oDialog.close();
|
|
504
538
|
resolve(oOperation);
|
|
505
539
|
})
|
|
506
|
-
.catch(function(oError: any) {
|
|
540
|
+
.catch(function (oError: any) {
|
|
541
|
+
let messages = messageHandling.getMessages();
|
|
542
|
+
messages = messages.concat(messageHandling.getMessages(true, true));
|
|
543
|
+
if (
|
|
544
|
+
!mParameters.bGrouped &&
|
|
545
|
+
!(!mParameters.control.isA("sap.ui.mdc.Table") && aContexts.length === 1) &&
|
|
546
|
+
messages.length
|
|
547
|
+
) {
|
|
548
|
+
oDialog.close();
|
|
549
|
+
}
|
|
507
550
|
throw oError;
|
|
508
551
|
});
|
|
509
552
|
})
|
|
510
|
-
.catch(function() {
|
|
511
|
-
const oMessageManager =
|
|
553
|
+
.catch(function () {
|
|
554
|
+
const oMessageManager = Core.getMessageManager();
|
|
555
|
+
let messages = oMessageManager.getMessageModel().getData();
|
|
556
|
+
const subtitleColumn = CommonUtils.getMessageColumn(mParameters.control);
|
|
557
|
+
let errorContext = undefined;
|
|
558
|
+
let errorTargetsInAPM = false;
|
|
559
|
+
messages.forEach(function (message: any) {
|
|
560
|
+
const messageTargets = message.getTargets();
|
|
561
|
+
if (messageTargets && messageTargets.length === 1 && messageTargets[0].length) {
|
|
562
|
+
errorContext = aContexts.find(function (oContext: any) {
|
|
563
|
+
return message.getTarget().indexOf(oContext.getPath()) !== -1;
|
|
564
|
+
});
|
|
565
|
+
message.additionalText = errorContext
|
|
566
|
+
? errorContext.getObject()[subtitleColumn]
|
|
567
|
+
: undefined;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
if (
|
|
571
|
+
message.getTarget().indexOf(mParameters.actionName) !== -1 &&
|
|
572
|
+
message.getTarget().indexOf(mParameters.aActionParameters[0].$Name) !== -1 &&
|
|
573
|
+
errorTargetsInAPM === false
|
|
574
|
+
) {
|
|
575
|
+
errorTargetsInAPM = true;
|
|
576
|
+
}
|
|
577
|
+
});
|
|
578
|
+
|
|
512
579
|
const bHasEtagMessage = messageHandling.modifyETagMessagesOnly(
|
|
513
580
|
oMessageManager,
|
|
514
581
|
oResourceBundle
|
|
@@ -517,39 +584,40 @@ function showActionParameterDialog(
|
|
|
517
584
|
messageHandler.showMessages({
|
|
518
585
|
bHasEtagMessage: bHasEtagMessage,
|
|
519
586
|
context: mParameters.aContexts[0],
|
|
520
|
-
isActionParameterDialogOpen:
|
|
521
|
-
messagePageNavigationCallback: function() {
|
|
587
|
+
isActionParameterDialogOpen: oDialog.isOpen(),
|
|
588
|
+
messagePageNavigationCallback: function () {
|
|
522
589
|
oDialog.close();
|
|
523
|
-
}
|
|
590
|
+
},
|
|
591
|
+
errorTargetsInAPM: errorTargetsInAPM
|
|
524
592
|
});
|
|
525
|
-
if (oDialog && bHasEtagMessage) {
|
|
593
|
+
if (oDialog && bHasEtagMessage && oDialog.isOpen()) {
|
|
526
594
|
oDialog.close(); //close the action parameter dialog after refresh of the context after etag mismatch
|
|
527
595
|
}
|
|
528
596
|
})
|
|
529
|
-
.finally(function() {
|
|
597
|
+
.finally(function () {
|
|
530
598
|
BusyLocker.unlock(oDialog);
|
|
531
599
|
});
|
|
532
600
|
})
|
|
533
|
-
.catch(function() {
|
|
601
|
+
.catch(function () {
|
|
534
602
|
return messageHandler.showMessageDialog();
|
|
535
603
|
});
|
|
536
604
|
}
|
|
537
605
|
}),
|
|
538
606
|
endButton: new Button(generate(["fe", "APD_", sActionName, "Action", "Cancel"]), {
|
|
539
607
|
text: CommonUtils.getTranslatedText("C_COMMON_ACTION_PARAMETER_DIALOG_CANCEL", oResourceBundle),
|
|
540
|
-
press: function() {
|
|
608
|
+
press: function () {
|
|
541
609
|
_validateMessages(aActionParameters, aFieldInvalid, true);
|
|
542
610
|
oDialog.close();
|
|
543
611
|
messageHandler.removeTransitionMessages();
|
|
544
612
|
reject(Constants.CancelActionDialog);
|
|
545
613
|
}
|
|
546
614
|
}),
|
|
547
|
-
beforeOpen: function(oEvent: any) {
|
|
615
|
+
beforeOpen: function (oEvent: any) {
|
|
548
616
|
// clone event for actionWrapper as oEvent.oSource gets lost during processing of beforeOpen event handler
|
|
549
617
|
const oCloneEvent = Object.assign({}, oEvent);
|
|
550
618
|
|
|
551
619
|
messageHandler.removeTransitionMessages();
|
|
552
|
-
const getDefaultValuesFunction = function() {
|
|
620
|
+
const getDefaultValuesFunction = function () {
|
|
553
621
|
const oMetaModel = oDialog.getModel().getMetaModel(),
|
|
554
622
|
sActionPath = oActionContext.sPath && oActionContext.sPath.split("/@")[0],
|
|
555
623
|
sDefaultValuesFunction = oMetaModel.getObject(
|
|
@@ -557,10 +625,10 @@ function showActionParameterDialog(
|
|
|
557
625
|
);
|
|
558
626
|
return sDefaultValuesFunction;
|
|
559
627
|
};
|
|
560
|
-
const fnSetDefaultsAndOpenDialog = function(sBindingParameter?: any) {
|
|
628
|
+
const fnSetDefaultsAndOpenDialog = function (sBindingParameter?: any) {
|
|
561
629
|
const sBoundFunctionName = getDefaultValuesFunction();
|
|
562
|
-
const prefillParameter = function(sParamName: any, vParamDefaultValue: any) {
|
|
563
|
-
return new Promise(resolve => {
|
|
630
|
+
const prefillParameter = function (sParamName: any, vParamDefaultValue: any) {
|
|
631
|
+
return new Promise((resolve) => {
|
|
564
632
|
// Case 1: There is a ParameterDefaultValue annotation
|
|
565
633
|
if (vParamDefaultValue !== undefined) {
|
|
566
634
|
if (aContexts.length > 0 && vParamDefaultValue.$Path) {
|
|
@@ -569,7 +637,7 @@ function showActionParameterDialog(
|
|
|
569
637
|
oOperationBinding.getModel()
|
|
570
638
|
);
|
|
571
639
|
oPromise
|
|
572
|
-
.then(function(oValue: any) {
|
|
640
|
+
.then(function (oValue: any) {
|
|
573
641
|
if (oValue === null) {
|
|
574
642
|
return oOperationBinding
|
|
575
643
|
.getParameterContext()
|
|
@@ -577,7 +645,7 @@ function showActionParameterDialog(
|
|
|
577
645
|
}
|
|
578
646
|
return oValue;
|
|
579
647
|
})
|
|
580
|
-
.then(function(vParamValue: any) {
|
|
648
|
+
.then(function (vParamValue: any) {
|
|
581
649
|
if (aContexts.length > 1) {
|
|
582
650
|
// For multi select, need to loop over aContexts (as contexts cannot be retrieved via binding parameter of the operation binding)
|
|
583
651
|
let sPathForContext = vParamDefaultValue.$Path;
|
|
@@ -597,7 +665,7 @@ function showActionParameterDialog(
|
|
|
597
665
|
}
|
|
598
666
|
resolve({ paramName: sParamName, value: vParamValue });
|
|
599
667
|
})
|
|
600
|
-
.catch(function() {
|
|
668
|
+
.catch(function () {
|
|
601
669
|
// Simply clear parameter default if an error has occurred
|
|
602
670
|
Log.error(
|
|
603
671
|
"Error while reading default action parameter",
|
|
@@ -628,7 +696,7 @@ function showActionParameterDialog(
|
|
|
628
696
|
});
|
|
629
697
|
};
|
|
630
698
|
|
|
631
|
-
const getParameterDefaultValue = function(sParamName: any) {
|
|
699
|
+
const getParameterDefaultValue = function (sParamName: any) {
|
|
632
700
|
const oMetaModel = oDialog.getModel().getMetaModel(),
|
|
633
701
|
sActionPath = oActionContext.sPath && oActionContext.sPath.split("/@")[0],
|
|
634
702
|
sActionParameterAnnotationTarget = sActionPath + "/" + sParamName + "@",
|
|
@@ -677,7 +745,7 @@ function showActionParameterDialog(
|
|
|
677
745
|
}
|
|
678
746
|
|
|
679
747
|
Promise.all([aPrefillParamPromises, aExecFunctionPromises, oExecFunctionFromManifestPromise])
|
|
680
|
-
.then(function(aPromises: [any[], any[], any]) {
|
|
748
|
+
.then(function (aPromises: [any[], any[], any]) {
|
|
681
749
|
const aCurrentParamDefaultValue: any = aPromises[0];
|
|
682
750
|
const aFunctionParams = aPromises[1];
|
|
683
751
|
const oFunctionParamsFromManifest = aPromises[2];
|
|
@@ -736,7 +804,7 @@ function showActionParameterDialog(
|
|
|
736
804
|
}
|
|
737
805
|
}
|
|
738
806
|
}
|
|
739
|
-
const bErrorFound = aCurrentParamDefaultValue.some(function(oValue: any) {
|
|
807
|
+
const bErrorFound = aCurrentParamDefaultValue.some(function (oValue: any) {
|
|
740
808
|
if (oValue.bLatePropertyError) {
|
|
741
809
|
return oValue.bLatePropertyError;
|
|
742
810
|
}
|
|
@@ -758,20 +826,20 @@ function showActionParameterDialog(
|
|
|
758
826
|
sBindingParameter = aParameters[0] && aParameters[0].$Name;
|
|
759
827
|
aContexts[0]
|
|
760
828
|
.requestObject()
|
|
761
|
-
.then(function(oContextObject: any) {
|
|
829
|
+
.then(function (oContextObject: any) {
|
|
762
830
|
if (oContextObject) {
|
|
763
831
|
oOperationBinding.setParameter(sBindingParameter, oContextObject);
|
|
764
832
|
}
|
|
765
833
|
fnSetDefaultsAndOpenDialog(sBindingParameter);
|
|
766
834
|
})
|
|
767
|
-
.catch(function(oError: any) {
|
|
835
|
+
.catch(function (oError: any) {
|
|
768
836
|
Log.error("Error while retrieving the parameter", oError);
|
|
769
837
|
});
|
|
770
838
|
} else {
|
|
771
839
|
fnSetDefaultsAndOpenDialog();
|
|
772
840
|
}
|
|
773
841
|
},
|
|
774
|
-
afterClose: function() {
|
|
842
|
+
afterClose: function () {
|
|
775
843
|
oDialog.destroy();
|
|
776
844
|
}
|
|
777
845
|
});
|
|
@@ -846,7 +914,7 @@ function getIsActionCritical(oMetaModel: any, sPath: any, contexts?: any, oBound
|
|
|
846
914
|
aBindingParams && aBindingParams.length && typeof aBindingParams === "object" && sCriticalPath && contexts && contexts.length;
|
|
847
915
|
if (bCondition) {
|
|
848
916
|
//in case binding patameters are there in path need to remove eg: - _it/isVerified => need to remove _it and the path should be isVerified
|
|
849
|
-
aBindingParams.filter(function(oParams: any) {
|
|
917
|
+
aBindingParams.filter(function (oParams: any) {
|
|
850
918
|
const index = aPaths && aPaths.indexOf(oParams.$Name);
|
|
851
919
|
if (index > -1) {
|
|
852
920
|
aPaths.splice(index, 1);
|
|
@@ -864,7 +932,7 @@ function executeDependingOnSelectedContexts(oAction: any, mParameters: any, bGet
|
|
|
864
932
|
let oActionPromise;
|
|
865
933
|
if (mParameters.internalModelContext && mParameters.internalModelContext.getObject().numberOfSelectedContexts > 1) {
|
|
866
934
|
oActionPromise = bGetBoundContext
|
|
867
|
-
? oAction.execute(sGroupId).then(function() {
|
|
935
|
+
? oAction.execute(sGroupId).then(function () {
|
|
868
936
|
return oAction.getBoundContext();
|
|
869
937
|
})
|
|
870
938
|
: oAction.execute(sGroupId);
|
|
@@ -876,7 +944,7 @@ function executeDependingOnSelectedContexts(oAction: any, mParameters: any, bGet
|
|
|
876
944
|
undefined,
|
|
877
945
|
CommonUtils.fnOnStrictHandlingFailed.bind(operations, sGroupId, mParameters.label, mParameters.model)
|
|
878
946
|
)
|
|
879
|
-
.then(function() {
|
|
947
|
+
.then(function () {
|
|
880
948
|
return oAction.getBoundContext();
|
|
881
949
|
})
|
|
882
950
|
: oAction.execute(
|
|
@@ -898,18 +966,21 @@ function _executeAction(oAppComponent: any, mParameters: any) {
|
|
|
898
966
|
const fnOnResponse = mParameters.fnOnResponse;
|
|
899
967
|
const bIsCreateAction = mParameters.bIsCreateAction;
|
|
900
968
|
let oAction: any;
|
|
969
|
+
// let contextIndex = 0;
|
|
970
|
+
// let aMessages: any[] = [];
|
|
901
971
|
|
|
902
972
|
function fnDifferentiate(promise: any) {
|
|
903
973
|
return promise.then(
|
|
904
|
-
function(response: any) {
|
|
905
|
-
|
|
974
|
+
function (response: any) {
|
|
975
|
+
let aMessages = messageHandling.getMessages();
|
|
976
|
+
aMessages = aMessages.concat(messageHandling.getMessages(true, true));
|
|
906
977
|
// Action Dialog must remain open if there are response error-messages, because in the java stack the dialog would be closed immediately.
|
|
907
978
|
if (aMessages.length > iExistingMessages && aMessages[aMessages.length - 1].type === "Error") {
|
|
908
979
|
return { response: response, status: "rejected" };
|
|
909
980
|
}
|
|
910
981
|
return { response: response, status: "resolved" };
|
|
911
982
|
},
|
|
912
|
-
function(response: any) {
|
|
983
|
+
function (response: any) {
|
|
913
984
|
return { response: response, status: "rejected" };
|
|
914
985
|
}
|
|
915
986
|
);
|
|
@@ -943,7 +1014,7 @@ function _executeAction(oAppComponent: any, mParameters: any) {
|
|
|
943
1014
|
}
|
|
944
1015
|
|
|
945
1016
|
if (aContexts.length) {
|
|
946
|
-
return new Promise(function(resolve: (value: any) => void, reject: (reason?: any) => void) {
|
|
1017
|
+
return new Promise(function (resolve: (value: any) => void, reject: (reason?: any) => void) {
|
|
947
1018
|
const mBindingParameters = mParameters.mBindingParameters;
|
|
948
1019
|
const bGrouped = mParameters.bGrouped;
|
|
949
1020
|
const bReturnAsArray = mParameters.bReturnAsArray;
|
|
@@ -952,7 +1023,7 @@ function _executeAction(oAppComponent: any, mParameters: any) {
|
|
|
952
1023
|
let oActionPromise;
|
|
953
1024
|
let i;
|
|
954
1025
|
let sGroupId: string;
|
|
955
|
-
const fnExecuteAction = function(oAction: any, index: any, oSideEffect: any) {
|
|
1026
|
+
const fnExecuteAction = function (oAction: any, index: any, oSideEffect: any) {
|
|
956
1027
|
setActionParameterDefaultValue();
|
|
957
1028
|
// For invocation grouping "isolated" need batch group per action call
|
|
958
1029
|
sGroupId = !bGrouped ? "$auto." + index : oAction.getUpdateGroupId();
|
|
@@ -961,7 +1032,7 @@ function _executeAction(oAppComponent: any, mParameters: any) {
|
|
|
961
1032
|
const oSideEffectsService = oAppComponent.getSideEffectsService();
|
|
962
1033
|
// trigger actions from side effects
|
|
963
1034
|
if (oSideEffect && oSideEffect.triggerActions && oSideEffect.triggerActions.length) {
|
|
964
|
-
oSideEffect.triggerActions.forEach(function(sTriggerAction: any) {
|
|
1035
|
+
oSideEffect.triggerActions.forEach(function (sTriggerAction: any) {
|
|
965
1036
|
if (sTriggerAction) {
|
|
966
1037
|
oSideEffectsService.executeAction(sTriggerAction, oSideEffect.context, sGroupId);
|
|
967
1038
|
}
|
|
@@ -972,7 +1043,7 @@ function _executeAction(oAppComponent: any, mParameters: any) {
|
|
|
972
1043
|
if (oSideEffect && oSideEffect.pathExpressions && oSideEffect.pathExpressions.length > 0) {
|
|
973
1044
|
oSideEffectsService
|
|
974
1045
|
.requestSideEffects(oSideEffect.pathExpressions, oSideEffect.context, sGroupId)
|
|
975
|
-
.then(function() {
|
|
1046
|
+
.then(function () {
|
|
976
1047
|
if (mParameters.operationAvailableMap && mParameters.internalModelContext) {
|
|
977
1048
|
CommonUtils.setActionEnablement(
|
|
978
1049
|
mParameters.internalModelContext,
|
|
@@ -981,13 +1052,13 @@ function _executeAction(oAppComponent: any, mParameters: any) {
|
|
|
981
1052
|
);
|
|
982
1053
|
}
|
|
983
1054
|
})
|
|
984
|
-
.catch(function(oError: any) {
|
|
1055
|
+
.catch(function (oError: any) {
|
|
985
1056
|
Log.error("Error while requesting side effects", oError);
|
|
986
1057
|
});
|
|
987
1058
|
}
|
|
988
1059
|
};
|
|
989
|
-
const fnExecuteSingleAction = function(oAction: any, index: any, oSideEffect: any) {
|
|
990
|
-
const oPromise = new Promise<void>(resolve => {
|
|
1060
|
+
const fnExecuteSingleAction = function (oAction: any, index: any, oSideEffect: any) {
|
|
1061
|
+
const oPromise = new Promise<void>((resolve) => {
|
|
991
1062
|
let oLocalPromise;
|
|
992
1063
|
const aLocalPromise = [];
|
|
993
1064
|
setActionParameterDefaultValue();
|
|
@@ -999,7 +1070,7 @@ function _executeAction(oAppComponent: any, mParameters: any) {
|
|
|
999
1070
|
const oSideEffectsService = oAppComponent.getSideEffectsService();
|
|
1000
1071
|
// trigger actions from side effects
|
|
1001
1072
|
if (oSideEffect && oSideEffect.triggerActions && oSideEffect.triggerActions.length) {
|
|
1002
|
-
oSideEffect.triggerActions.forEach(function(sTriggerAction: any) {
|
|
1073
|
+
oSideEffect.triggerActions.forEach(function (sTriggerAction: any) {
|
|
1003
1074
|
if (sTriggerAction) {
|
|
1004
1075
|
oLocalPromise = oSideEffectsService.executeAction(sTriggerAction, oSideEffect.context, sGroupId);
|
|
1005
1076
|
aLocalPromise.push(oLocalPromise);
|
|
@@ -1012,7 +1083,7 @@ function _executeAction(oAppComponent: any, mParameters: any) {
|
|
|
1012
1083
|
oLocalPromise = oSideEffectsService.requestSideEffects(oSideEffect.pathExpressions, oSideEffect.context, sGroupId);
|
|
1013
1084
|
aLocalPromise.push(oLocalPromise);
|
|
1014
1085
|
oLocalPromise
|
|
1015
|
-
.then(function() {
|
|
1086
|
+
.then(function () {
|
|
1016
1087
|
if (mParameters.operationAvailableMap && mParameters.internalModelContext) {
|
|
1017
1088
|
CommonUtils.setActionEnablement(
|
|
1018
1089
|
mParameters.internalModelContext,
|
|
@@ -1021,16 +1092,16 @@ function _executeAction(oAppComponent: any, mParameters: any) {
|
|
|
1021
1092
|
);
|
|
1022
1093
|
}
|
|
1023
1094
|
})
|
|
1024
|
-
.catch(function(oError: any) {
|
|
1095
|
+
.catch(function (oError: any) {
|
|
1025
1096
|
Log.error("Error while requesting side effects", oError);
|
|
1026
1097
|
});
|
|
1027
1098
|
}
|
|
1028
1099
|
oModel.submitBatch(sGroupId);
|
|
1029
1100
|
Promise.all(aLocalPromise)
|
|
1030
|
-
.then(function() {
|
|
1101
|
+
.then(function () {
|
|
1031
1102
|
return resolve();
|
|
1032
1103
|
})
|
|
1033
|
-
.catch(function() {
|
|
1104
|
+
.catch(function () {
|
|
1034
1105
|
return resolve();
|
|
1035
1106
|
});
|
|
1036
1107
|
});
|
|
@@ -1056,22 +1127,23 @@ function _executeAction(oAppComponent: any, mParameters: any) {
|
|
|
1056
1127
|
|
|
1057
1128
|
let oActionAndSideEffectPromise = Promise.resolve();
|
|
1058
1129
|
let j = 0;
|
|
1059
|
-
aContexts.forEach(function(context: any) {
|
|
1130
|
+
aContexts.forEach(function (context: any) {
|
|
1060
1131
|
const id = ++j;
|
|
1061
|
-
oActionAndSideEffectPromise = oActionAndSideEffectPromise.then(function() {
|
|
1132
|
+
oActionAndSideEffectPromise = oActionAndSideEffectPromise.then(function () {
|
|
1062
1133
|
return processOneAction(context, id);
|
|
1063
1134
|
});
|
|
1064
1135
|
});
|
|
1065
1136
|
oActionAndSideEffectPromise
|
|
1066
|
-
.then(function() {
|
|
1137
|
+
.then(function () {
|
|
1067
1138
|
fnHandleResults();
|
|
1068
1139
|
})
|
|
1069
1140
|
.catch();
|
|
1070
1141
|
}
|
|
1071
1142
|
|
|
1072
|
-
if (
|
|
1073
|
-
// For invocation grouping "isolated"
|
|
1143
|
+
if (!bGrouped) {
|
|
1144
|
+
// For invocation grouping "isolated", ensure that each action and matching side effects
|
|
1074
1145
|
// are processed before the next set is submitted. Workaround until JSON batch is available.
|
|
1146
|
+
// Allow also for List Report.
|
|
1075
1147
|
fnExecuteSequentially(aContexts);
|
|
1076
1148
|
} else {
|
|
1077
1149
|
for (i = 0; i < aContexts.length; i++) {
|
|
@@ -1093,7 +1165,7 @@ function _executeAction(oAppComponent: any, mParameters: any) {
|
|
|
1093
1165
|
|
|
1094
1166
|
function fnHandleResults() {
|
|
1095
1167
|
Promise.all(aActionPromises.map(fnDifferentiate))
|
|
1096
|
-
.then(function(results: any[]) {
|
|
1168
|
+
.then(function (results: any[]) {
|
|
1097
1169
|
const aRejectedItems = [];
|
|
1098
1170
|
const aResolvedItems = [];
|
|
1099
1171
|
let iResultCount;
|
|
@@ -1131,7 +1203,7 @@ function _executeAction(oAppComponent: any, mParameters: any) {
|
|
|
1131
1203
|
})
|
|
1132
1204
|
.catch(reject);
|
|
1133
1205
|
}
|
|
1134
|
-
}).finally(function() {
|
|
1206
|
+
}).finally(function () {
|
|
1135
1207
|
(
|
|
1136
1208
|
fnOnResponse ||
|
|
1137
1209
|
function noop() {
|
|
@@ -1156,7 +1228,7 @@ function _executeAction(oAppComponent: any, mParameters: any) {
|
|
|
1156
1228
|
/**/
|
|
1157
1229
|
}
|
|
1158
1230
|
)(oActionPromise);
|
|
1159
|
-
return oActionPromise.finally(function() {
|
|
1231
|
+
return oActionPromise.finally(function () {
|
|
1160
1232
|
(
|
|
1161
1233
|
fnOnResponse ||
|
|
1162
1234
|
function noop() {
|