@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,59 +1,68 @@
|
|
|
1
|
-
import Event from "sap/ui/base/Event";
|
|
2
|
-
import ControllerExtension from "sap/ui/core/mvc/ControllerExtension";
|
|
3
|
-
import ControllerExtensionMetadata from "sap/fe/core/controllerextensions/ControllerExtensionMetadata";
|
|
4
|
-
import OverrideExecution from "sap/ui/core/mvc/OverrideExecution";
|
|
5
|
-
import Component from "sap/ui/core/Component";
|
|
6
|
-
import CommonUtils from "sap/fe/core/CommonUtils";
|
|
7
|
-
import BusyLocker from "sap/fe/core/BusyLocker";
|
|
8
|
-
import SemanticKeyHelper from "sap/fe/core/helpers/SemanticKeyHelper";
|
|
9
|
-
import Filter from "sap/ui/model/Filter";
|
|
10
|
-
import FilterOperator from "sap/ui/model/FilterOperator";
|
|
11
1
|
import Log from "sap/base/Log";
|
|
2
|
+
import AppComponent from "sap/fe/core/AppComponent";
|
|
3
|
+
import CommonUtils from "sap/fe/core/CommonUtils";
|
|
4
|
+
import BusyLocker from "sap/fe/core/controllerextensions/BusyLocker";
|
|
5
|
+
import ActivitySync from "sap/fe/core/controllerextensions/collaboration/ActivitySync";
|
|
6
|
+
import draft from "sap/fe/core/controllerextensions/editFlow/draft";
|
|
7
|
+
import RouterProxy from "sap/fe/core/controllerextensions/routing/RouterProxy";
|
|
8
|
+
import {
|
|
9
|
+
defineUI5Class,
|
|
10
|
+
EnhanceWithUI5,
|
|
11
|
+
extensible,
|
|
12
|
+
finalExtension,
|
|
13
|
+
methodOverride,
|
|
14
|
+
publicExtension
|
|
15
|
+
} from "sap/fe/core/helpers/ClassSupport";
|
|
12
16
|
import EditState from "sap/fe/core/helpers/EditState";
|
|
13
17
|
import ModelHelper from "sap/fe/core/helpers/ModelHelper";
|
|
14
|
-
import
|
|
18
|
+
import SemanticKeyHelper from "sap/fe/core/helpers/SemanticKeyHelper";
|
|
19
|
+
import FELibrary from "sap/fe/core/library";
|
|
15
20
|
import PageController from "sap/fe/core/PageController";
|
|
21
|
+
import { RoutingService } from "sap/fe/core/services/RoutingServiceFactory";
|
|
22
|
+
import TemplateComponent from "sap/fe/core/TemplateComponent";
|
|
23
|
+
import Event from "sap/ui/base/Event";
|
|
24
|
+
import Component from "sap/ui/core/Component";
|
|
25
|
+
import Core from "sap/ui/core/Core";
|
|
26
|
+
import ControllerExtension from "sap/ui/core/mvc/ControllerExtension";
|
|
27
|
+
import OverrideExecution from "sap/ui/core/mvc/OverrideExecution";
|
|
16
28
|
import View from "sap/ui/core/mvc/View";
|
|
17
|
-
import AppComponent from "sap/fe/core/AppComponent";
|
|
18
|
-
import { TemplateComponentType } from "sap/fe/core/TemplateComponent";
|
|
19
29
|
import Router from "sap/ui/core/routing/Router";
|
|
20
|
-
import
|
|
21
|
-
import
|
|
30
|
+
import Filter from "sap/ui/model/Filter";
|
|
31
|
+
import FilterOperator from "sap/ui/model/FilterOperator";
|
|
22
32
|
import JSONModel from "sap/ui/model/json/JSONModel";
|
|
23
|
-
import ResourceBundle from "sap/base/i18n/ResourceBundle";
|
|
24
33
|
import Context from "sap/ui/model/odata/v4/Context";
|
|
34
|
+
import { CoreEx } from "types/extension_types";
|
|
25
35
|
|
|
26
36
|
/**
|
|
27
37
|
* {@link sap.ui.core.mvc.ControllerExtension Controller extension}
|
|
28
38
|
*
|
|
29
39
|
* @namespace
|
|
30
40
|
* @alias sap.fe.core.controllerextensions.InternalRouting
|
|
31
|
-
*
|
|
32
41
|
* @private
|
|
33
42
|
* @since 1.74.0
|
|
34
43
|
*/
|
|
35
|
-
@
|
|
44
|
+
@defineUI5Class("sap.fe.core.controllerextensions.InternalRouting")
|
|
36
45
|
class InternalRouting extends ControllerExtension {
|
|
37
46
|
private base!: PageController;
|
|
38
47
|
private _oView!: View;
|
|
39
48
|
private _oAppComponent!: AppComponent;
|
|
40
|
-
private _oPageComponent!:
|
|
49
|
+
private _oPageComponent!: EnhanceWithUI5<TemplateComponent> | null;
|
|
41
50
|
private _oRouter!: Router;
|
|
42
51
|
private _oRoutingService!: RoutingService;
|
|
43
52
|
private _oRouterProxy!: RouterProxy;
|
|
44
53
|
private _fnRouteMatchedBound!: Function;
|
|
45
54
|
private _oTargetInformation: any;
|
|
46
55
|
|
|
47
|
-
@
|
|
56
|
+
@methodOverride()
|
|
48
57
|
onExit() {
|
|
49
58
|
this._oRoutingService && this._oRoutingService.detachRouteMatched(this._fnRouteMatchedBound);
|
|
50
59
|
}
|
|
51
60
|
|
|
52
|
-
@
|
|
61
|
+
@methodOverride()
|
|
53
62
|
onInit() {
|
|
54
63
|
this._oView = this.base.getView();
|
|
55
64
|
this._oAppComponent = CommonUtils.getAppComponent(this._oView);
|
|
56
|
-
this._oPageComponent = Component.getOwnerComponentFor(this._oView) as
|
|
65
|
+
this._oPageComponent = Component.getOwnerComponentFor(this._oView) as EnhanceWithUI5<TemplateComponent>;
|
|
57
66
|
this._oRouter = this._oAppComponent.getRouter();
|
|
58
67
|
this._oRouterProxy = (this._oAppComponent as any).getRouterProxy();
|
|
59
68
|
|
|
@@ -77,7 +86,7 @@ class InternalRouting extends ControllerExtension {
|
|
|
77
86
|
this._oRoutingService.attachRouteMatched(this._fnRouteMatchedBound);
|
|
78
87
|
this._oTargetInformation = oRoutingService.getTargetInformationFor(this._oPageComponent || this._oView);
|
|
79
88
|
})
|
|
80
|
-
.catch(function() {
|
|
89
|
+
.catch(function () {
|
|
81
90
|
throw new Error("This controller extension cannot work without a 'routingService' on the main AppComponent");
|
|
82
91
|
});
|
|
83
92
|
}
|
|
@@ -85,20 +94,20 @@ class InternalRouting extends ControllerExtension {
|
|
|
85
94
|
/**
|
|
86
95
|
* Triggered every time this controller is a navigation target.
|
|
87
96
|
*/
|
|
88
|
-
@
|
|
89
|
-
@
|
|
97
|
+
@publicExtension()
|
|
98
|
+
@extensible(OverrideExecution.After)
|
|
90
99
|
onRouteMatched() {
|
|
91
100
|
/**/
|
|
92
101
|
}
|
|
93
102
|
|
|
94
|
-
@
|
|
95
|
-
@
|
|
103
|
+
@publicExtension()
|
|
104
|
+
@extensible(OverrideExecution.After)
|
|
96
105
|
onRouteMatchedFinished() {
|
|
97
106
|
/**/
|
|
98
107
|
}
|
|
99
108
|
|
|
100
|
-
@
|
|
101
|
-
@
|
|
109
|
+
@publicExtension()
|
|
110
|
+
@extensible(OverrideExecution.After)
|
|
102
111
|
onBeforeBinding(oBindingContext: any, mParameters?: any) {
|
|
103
112
|
const oRouting = (this.base.getView().getController() as any).routing;
|
|
104
113
|
if (oRouting && oRouting.onBeforeBinding) {
|
|
@@ -106,8 +115,8 @@ class InternalRouting extends ControllerExtension {
|
|
|
106
115
|
}
|
|
107
116
|
}
|
|
108
117
|
|
|
109
|
-
@
|
|
110
|
-
@
|
|
118
|
+
@publicExtension()
|
|
119
|
+
@extensible(OverrideExecution.After)
|
|
111
120
|
onAfterBinding(oBindingContext: any, mParameters?: any) {
|
|
112
121
|
(this._oAppComponent as any).getRootViewController().onContextBoundToView(oBindingContext);
|
|
113
122
|
const oRouting = (this.base.getView().getController() as any).routing;
|
|
@@ -130,7 +139,7 @@ class InternalRouting extends ControllerExtension {
|
|
|
130
139
|
* @param {boolean} bPreserveHistory True to force the new URL to be added at the end of the browser history (no replace)
|
|
131
140
|
* @ui5-restricted
|
|
132
141
|
*/
|
|
133
|
-
@
|
|
142
|
+
@publicExtension()
|
|
134
143
|
navigateToTarget(oContext: any, sNavigationTargetName: string, oSemanticObject?: object, bPreserveHistory?: boolean) {
|
|
135
144
|
const oNavigationConfiguration =
|
|
136
145
|
this._oPageComponent &&
|
|
@@ -155,7 +164,7 @@ class InternalRouting extends ControllerExtension {
|
|
|
155
164
|
* @returns {Promise} Promise that is resolved when the navigation is finalized
|
|
156
165
|
* @ui5-restricted
|
|
157
166
|
*/
|
|
158
|
-
@
|
|
167
|
+
@publicExtension()
|
|
159
168
|
navigateToRoute(sTargetRouteName: string, oParameters?: object) {
|
|
160
169
|
return this._oRoutingService.navigateToRoute(sTargetRouteName, oParameters);
|
|
161
170
|
}
|
|
@@ -166,12 +175,11 @@ class InternalRouting extends ControllerExtension {
|
|
|
166
175
|
* @param {sap.ui.model.odata.v4.Context} oContext The context to be navigated to
|
|
167
176
|
* @param {object} [mParameters] Optional navigation parameters
|
|
168
177
|
* @returns {Promise} Promise resolved when the navigation has been triggered
|
|
169
|
-
*
|
|
170
178
|
* @ui5-restricted
|
|
171
179
|
*/
|
|
172
|
-
@
|
|
173
|
-
@
|
|
174
|
-
navigateToContext(oContext: any, mParameters?: any): Promise<
|
|
180
|
+
@publicExtension()
|
|
181
|
+
@finalExtension()
|
|
182
|
+
navigateToContext(oContext: any, mParameters?: any): Promise<boolean> {
|
|
175
183
|
const oContextInfo: any = {};
|
|
176
184
|
mParameters = mParameters || {};
|
|
177
185
|
|
|
@@ -190,10 +198,11 @@ class InternalRouting extends ControllerExtension {
|
|
|
190
198
|
editable: mParameters.editable,
|
|
191
199
|
bPersistOPScroll: mParameters.bPersistOPScroll,
|
|
192
200
|
updateFCLLevel: mParameters.updateFCLLevel,
|
|
193
|
-
bForceFocus: mParameters.bForceFocus
|
|
201
|
+
bForceFocus: mParameters.bForceFocus,
|
|
202
|
+
bNavigateToSiblingEntity: mParameters.bNavigateToSiblingEntity
|
|
194
203
|
});
|
|
195
204
|
})
|
|
196
|
-
.catch(function(oError: any) {
|
|
205
|
+
.catch(function (oError: any) {
|
|
197
206
|
Log.error("Error with the async context", oError);
|
|
198
207
|
});
|
|
199
208
|
} else if (!mParameters.bDeferredContext) {
|
|
@@ -215,7 +224,7 @@ class InternalRouting extends ControllerExtension {
|
|
|
215
224
|
const bOverrideNav = (this.base.getView().getController() as any).routing.onBeforeNavigation(oContextInfo);
|
|
216
225
|
if (bOverrideNav) {
|
|
217
226
|
oInternalModel.setProperty("/paginatorCurrentContext", oContext);
|
|
218
|
-
return Promise.resolve();
|
|
227
|
+
return Promise.resolve(true);
|
|
219
228
|
}
|
|
220
229
|
}
|
|
221
230
|
mParameters.FCLLevel = this._getFCLLevel();
|
|
@@ -229,11 +238,10 @@ class InternalRouting extends ControllerExtension {
|
|
|
229
238
|
* @param {sap.ui.model.odata.v4.Context} oContext Context to be navigated from
|
|
230
239
|
* @param {object} [mParameters] Optional navigation parameters
|
|
231
240
|
* @returns {Promise} Promise resolved when the navigation has been triggered
|
|
232
|
-
*
|
|
233
241
|
* @ui5-restricted
|
|
234
242
|
*/
|
|
235
|
-
@
|
|
236
|
-
@
|
|
243
|
+
@publicExtension()
|
|
244
|
+
@finalExtension()
|
|
237
245
|
navigateBackFromContext(oContext: any, mParameters?: any) {
|
|
238
246
|
mParameters = mParameters || {};
|
|
239
247
|
mParameters.updateFCLLevel = -1;
|
|
@@ -247,14 +255,13 @@ class InternalRouting extends ControllerExtension {
|
|
|
247
255
|
* @param {sap.ui.model.odata.v4.Context} oContext Context to be navigated to
|
|
248
256
|
* @param {object} mParameters Optional navigation parameters
|
|
249
257
|
* @returns {Promise} Promise resolved when the navigation has been triggered
|
|
250
|
-
*
|
|
251
258
|
* @ui5-restricted
|
|
252
259
|
*/
|
|
253
|
-
@
|
|
254
|
-
@
|
|
255
|
-
navigateForwardToContext(oContext: any, mParameters?: any) {
|
|
260
|
+
@publicExtension()
|
|
261
|
+
@finalExtension()
|
|
262
|
+
navigateForwardToContext(oContext: any, mParameters?: any): Promise<boolean> {
|
|
256
263
|
if (this._oView.getBindingContext("internal")?.getProperty("messageFooterContainsErrors") === true) {
|
|
257
|
-
return Promise.resolve();
|
|
264
|
+
return Promise.resolve(true);
|
|
258
265
|
}
|
|
259
266
|
mParameters = mParameters || {};
|
|
260
267
|
mParameters.updateFCLLevel = 1;
|
|
@@ -265,8 +272,8 @@ class InternalRouting extends ControllerExtension {
|
|
|
265
272
|
/**
|
|
266
273
|
* Navigates back in history if the current hash corresponds to a transient state.
|
|
267
274
|
*/
|
|
268
|
-
@
|
|
269
|
-
@
|
|
275
|
+
@publicExtension()
|
|
276
|
+
@finalExtension()
|
|
270
277
|
navigateBackFromTransientState() {
|
|
271
278
|
const sHash = this._oRouterProxy.getHash();
|
|
272
279
|
|
|
@@ -276,8 +283,8 @@ class InternalRouting extends ControllerExtension {
|
|
|
276
283
|
}
|
|
277
284
|
}
|
|
278
285
|
|
|
279
|
-
@
|
|
280
|
-
@
|
|
286
|
+
@publicExtension()
|
|
287
|
+
@finalExtension()
|
|
281
288
|
navigateToMessagePage(sErrorMessage: any, mParameters: any) {
|
|
282
289
|
mParameters = mParameters || {};
|
|
283
290
|
if (this._oRouterProxy.getHash().indexOf("i-action=create") > -1) {
|
|
@@ -294,11 +301,10 @@ class InternalRouting extends ControllerExtension {
|
|
|
294
301
|
*
|
|
295
302
|
* @param {sap.ui.model.odata.v4.Context} oContext
|
|
296
303
|
* @returns {boolean}
|
|
297
|
-
*
|
|
298
304
|
* @ui5-restricted
|
|
299
305
|
*/
|
|
300
|
-
@
|
|
301
|
-
@
|
|
306
|
+
@publicExtension()
|
|
307
|
+
@finalExtension()
|
|
302
308
|
isCurrentStateImpactedBy(oContext: any) {
|
|
303
309
|
return this._oRoutingService.isCurrentStateImpactedBy(oContext);
|
|
304
310
|
}
|
|
@@ -312,7 +318,6 @@ class InternalRouting extends ControllerExtension {
|
|
|
312
318
|
* Builds the binding context from the navigation parameters, and bind the page accordingly.
|
|
313
319
|
*
|
|
314
320
|
* @param {object} oEvent
|
|
315
|
-
*
|
|
316
321
|
* @ui5-restricted
|
|
317
322
|
*/
|
|
318
323
|
_onRouteMatched(oEvent: Event) {
|
|
@@ -405,9 +410,7 @@ class InternalRouting extends ControllerExtension {
|
|
|
405
410
|
if (this._getBindingContext() && this._getBindingContext().hasPendingChanges()) {
|
|
406
411
|
// For now remove the pending changes to avoid the model raises errors and the object page is at least bound
|
|
407
412
|
// Ideally the user should be asked for
|
|
408
|
-
this._getBindingContext()
|
|
409
|
-
.getBinding()
|
|
410
|
-
.resetChanges();
|
|
413
|
+
this._getBindingContext().getBinding().resetChanges();
|
|
411
414
|
}
|
|
412
415
|
|
|
413
416
|
// remove the context to avoid showing old data
|
|
@@ -436,7 +439,7 @@ class InternalRouting extends ControllerExtension {
|
|
|
436
439
|
})
|
|
437
440
|
.catch((oError: any) => {
|
|
438
441
|
// Error handling for erroneous metadata request
|
|
439
|
-
const oResourceBundle =
|
|
442
|
+
const oResourceBundle = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core");
|
|
440
443
|
|
|
441
444
|
this.navigateToMessagePage(oResourceBundle.getText("C_COMMON_SAPFE_DATA_RECEIVED_ERROR"), {
|
|
442
445
|
title: oResourceBundle.getText("C_COMMON_SAPFE_ERROR"),
|
|
@@ -453,11 +456,10 @@ class InternalRouting extends ControllerExtension {
|
|
|
453
456
|
* @param {Array} aSemanticKeys The semantic keys for the path
|
|
454
457
|
* @param {object} oMetaModel The instance of the meta model
|
|
455
458
|
* @returns {sap.ui.model.Filter} The filter
|
|
456
|
-
*
|
|
457
459
|
* @ui5-restricted
|
|
458
460
|
*/
|
|
459
461
|
_createFilterFromSemanticPath(sSemanticPath: string, aSemanticKeys: any[], oMetaModel: object) {
|
|
460
|
-
const fnUnquoteAndDecode = function(sValue: any) {
|
|
462
|
+
const fnUnquoteAndDecode = function (sValue: any) {
|
|
461
463
|
if (sValue.indexOf("'") === 0 && sValue.lastIndexOf("'") === sValue.length - 1) {
|
|
462
464
|
// Remove the quotes from the value and decode special chars
|
|
463
465
|
sValue = decodeURIComponent(sValue.substring(1, sValue.length - 1));
|
|
@@ -487,7 +489,7 @@ class InternalRouting extends ControllerExtension {
|
|
|
487
489
|
} else {
|
|
488
490
|
const mKeyValues: any = {};
|
|
489
491
|
// Create a map of all key values
|
|
490
|
-
aKeyValues.forEach(function(sKeyAssignment: string) {
|
|
492
|
+
aKeyValues.forEach(function (sKeyAssignment: string) {
|
|
491
493
|
const aParts = sKeyAssignment.split("="),
|
|
492
494
|
sKeyValue = fnUnquoteAndDecode(aParts[1]);
|
|
493
495
|
|
|
@@ -495,7 +497,7 @@ class InternalRouting extends ControllerExtension {
|
|
|
495
497
|
});
|
|
496
498
|
|
|
497
499
|
let bFailed = false;
|
|
498
|
-
aFilters = aSemanticKeys.map(function(oSemanticKey: any) {
|
|
500
|
+
aFilters = aSemanticKeys.map(function (oSemanticKey: any) {
|
|
499
501
|
const sKey = oSemanticKey.$PropertyPath,
|
|
500
502
|
sValue = mKeyValues[sKey];
|
|
501
503
|
|
|
@@ -538,7 +540,6 @@ class InternalRouting extends ControllerExtension {
|
|
|
538
540
|
* @param {sap.ui.model.odata.v4.ODataModel} oModel The model for the path
|
|
539
541
|
* @param {Array} aSemanticKeys The semantic keys for the path
|
|
540
542
|
* @returns {Promise} A Promise containing the path with technical keys if sSemanticPath could be interpreted as a semantic path, null otherwise
|
|
541
|
-
*
|
|
542
543
|
* @ui5-restricted
|
|
543
544
|
*/
|
|
544
545
|
_getTechnicalPathFromSemanticPath(sSemanticPath: string, oModel: any, aSemanticKeys: any[]) {
|
|
@@ -565,7 +566,7 @@ class InternalRouting extends ControllerExtension {
|
|
|
565
566
|
"$$groupId": "$auto.Heroes"
|
|
566
567
|
});
|
|
567
568
|
|
|
568
|
-
return oListBinding.requestContexts(0, 2).then(function(oContexts: any) {
|
|
569
|
+
return oListBinding.requestContexts(0, 2).then(function (oContexts: any) {
|
|
569
570
|
if (oContexts && oContexts.length) {
|
|
570
571
|
return oContexts[0].getPath();
|
|
571
572
|
} else {
|
|
@@ -581,7 +582,6 @@ class InternalRouting extends ControllerExtension {
|
|
|
581
582
|
* @param {string} sPath The path to test
|
|
582
583
|
* @param {sap.ui.model.odata.v4.ODataMetaModel} oMetaModel The associated metadata model
|
|
583
584
|
* @returns {boolean} `true` if the path is eligible
|
|
584
|
-
*
|
|
585
585
|
* @ui5-restricted
|
|
586
586
|
*/
|
|
587
587
|
_checkPathForSemanticBookmarking(sPath: string, oMetaModel: any) {
|
|
@@ -600,18 +600,16 @@ class InternalRouting extends ControllerExtension {
|
|
|
600
600
|
|
|
601
601
|
/**
|
|
602
602
|
* Builds a path with semantic keys from a path with technical keys.
|
|
603
|
+
*
|
|
603
604
|
* @param {string} sPathToResolve The path to be transformed
|
|
604
|
-
* @param oModel
|
|
605
|
+
* @param oModel The OData model
|
|
605
606
|
* @returns {Promise} String promise for the new path. If sPathToResolved couldn't be interpreted as a semantic path, it is returned as is.
|
|
606
607
|
* @ui5-restricted
|
|
607
608
|
*/
|
|
608
609
|
_resolveSemanticPath(sPathToResolve: string, oModel: any): Promise<string> {
|
|
609
610
|
const oMetaModel = oModel.getMetaModel();
|
|
610
611
|
const oLastSemanticMapping = this._oRoutingService.getLastSemanticMapping();
|
|
611
|
-
let sCurrentHashNoParams = this._oRouter
|
|
612
|
-
.getHashChanger()
|
|
613
|
-
.getHash()
|
|
614
|
-
.split("?")[0];
|
|
612
|
+
let sCurrentHashNoParams = this._oRouter.getHashChanger().getHash().split("?")[0];
|
|
615
613
|
|
|
616
614
|
if (sCurrentHashNoParams && sCurrentHashNoParams.lastIndexOf("/") === sCurrentHashNoParams.length - 1) {
|
|
617
615
|
// Remove trailing '/'
|
|
@@ -653,7 +651,6 @@ class InternalRouting extends ControllerExtension {
|
|
|
653
651
|
* @param {string} sTargetPath The path to build the context. Needs to contain technical keys only.
|
|
654
652
|
* @param {sap.ui.model.odata.v4.ODataModel} oModel The OData model
|
|
655
653
|
* @param {object} oNavigationParameters Navigation parameters
|
|
656
|
-
*
|
|
657
654
|
* @ui5-restricted
|
|
658
655
|
*/
|
|
659
656
|
_bindPageToPath(sTargetPath: string, oModel: any, oNavigationParameters: any) {
|
|
@@ -670,7 +667,7 @@ class InternalRouting extends ControllerExtension {
|
|
|
670
667
|
oTargetContext = oUseContext;
|
|
671
668
|
} else {
|
|
672
669
|
// Otherwise we need to create it from sTargetPath
|
|
673
|
-
oTargetContext = this.
|
|
670
|
+
oTargetContext = this._createContext(sTargetPath, oModel, oNavigationParameters.bNavigateToSiblingEntity);
|
|
674
671
|
}
|
|
675
672
|
if (oTargetContext !== oCurrentContext) {
|
|
676
673
|
this._bindPageToContext(oTargetContext, oModel, oNavigationParameters);
|
|
@@ -686,7 +683,6 @@ class InternalRouting extends ControllerExtension {
|
|
|
686
683
|
* @param {sap.ui.model.odata.v4.Context} oContext Context to be bound
|
|
687
684
|
* @param {sap.ui.model.odata.v4.ODataModel} oModel The OData model
|
|
688
685
|
* @param {object} oNavigationParameters Navigation parameters
|
|
689
|
-
*
|
|
690
686
|
* @ui5-restricted
|
|
691
687
|
*/
|
|
692
688
|
_bindPageToContext(oContext: any, oModel: any, oNavigationParameters: any) {
|
|
@@ -695,18 +691,25 @@ class InternalRouting extends ControllerExtension {
|
|
|
695
691
|
this.onAfterBinding(null);
|
|
696
692
|
} else {
|
|
697
693
|
const oParentListBinding = oContext.getBinding();
|
|
698
|
-
|
|
699
|
-
if (
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
//
|
|
706
|
-
|
|
707
|
-
this._refreshBindingContext(oContext);
|
|
708
|
-
}, 0);
|
|
694
|
+
const oRootViewController = (this._oAppComponent as any).getRootViewController();
|
|
695
|
+
if (oRootViewController.isFclEnabled()) {
|
|
696
|
+
if (
|
|
697
|
+
!oParentListBinding ||
|
|
698
|
+
!oParentListBinding.isA("sap.ui.model.odata.v4.ODataListBinding") ||
|
|
699
|
+
oParentListBinding.getUpdateGroupId() === "submitLater"
|
|
700
|
+
) {
|
|
701
|
+
// if the parentBinding is not a listBinding or the transient one from the create, we create a new context
|
|
702
|
+
oContext = this._createContext(oContext.getPath(), oModel);
|
|
709
703
|
}
|
|
704
|
+
oContext.setKeepAlive(true, () => {
|
|
705
|
+
// it is possible that the context is no longer kept alive
|
|
706
|
+
if (oContext.isKeepAlive() && oRootViewController.isContextUsedInPages(oContext)) {
|
|
707
|
+
this.navigateBackFromContext(oContext);
|
|
708
|
+
}
|
|
709
|
+
});
|
|
710
|
+
} else if (!oParentListBinding || oParentListBinding.isA("sap.ui.model.odata.v4.ODataListBinding")) {
|
|
711
|
+
// We need to recreate the context otherwise we get errors
|
|
712
|
+
oContext = this._createContext(oContext.getPath(), oModel, oNavigationParameters.bNavigateToSiblingEntity);
|
|
710
713
|
}
|
|
711
714
|
|
|
712
715
|
// Set the binding context with the proper before/after callbacks
|
|
@@ -724,80 +727,109 @@ class InternalRouting extends ControllerExtension {
|
|
|
724
727
|
}
|
|
725
728
|
|
|
726
729
|
/**
|
|
727
|
-
* Creates a
|
|
730
|
+
* Creates a context from a path.
|
|
728
731
|
*
|
|
729
732
|
* @param {string} sPath The path
|
|
730
733
|
* @param {sap.ui.model.odata.v4.ODataModel} oModel The OData model
|
|
731
|
-
* @
|
|
732
|
-
*
|
|
734
|
+
* @param {boolean} navigateToSiblingEntity A parameter that tells whether to navigate to the context on data received
|
|
735
|
+
* @returns {sap.ui.model.odata.v4.Context} The created context
|
|
733
736
|
* @ui5-restricted
|
|
734
737
|
*/
|
|
735
|
-
|
|
738
|
+
@publicExtension()
|
|
739
|
+
_createContext(sPath: string, oModel: any, navigateToSiblingEntity: boolean = true) {
|
|
736
740
|
const oPageComponent = this._oPageComponent,
|
|
737
741
|
sEntitySet = oPageComponent && oPageComponent.getEntitySet && oPageComponent.getEntitySet(),
|
|
738
742
|
sContextPath =
|
|
739
743
|
(oPageComponent && oPageComponent.getContextPath && oPageComponent.getContextPath()) || (sEntitySet && "/" + sEntitySet),
|
|
740
744
|
oMetaModel = oModel.getMetaModel(),
|
|
741
745
|
mParameters: any = {
|
|
742
|
-
$$patchWithoutSideEffects: true,
|
|
743
746
|
$$groupId: "$auto.Heroes",
|
|
744
|
-
$$updateGroupId: "$auto"
|
|
747
|
+
$$updateGroupId: "$auto",
|
|
748
|
+
$$patchWithoutSideEffects: true
|
|
745
749
|
};
|
|
746
|
-
|
|
747
|
-
if (sEntitySet) {
|
|
748
|
-
const sMessagesPath = oMetaModel.getObject(sContextPath + "/@com.sap.vocabularies.Common.v1.Messages/$Path");
|
|
749
|
-
if (sMessagesPath) {
|
|
750
|
-
mParameters.$select = sMessagesPath;
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
|
|
754
750
|
// In case of draft: $select the state flags (HasActiveEntity, HasDraftEntity, and IsActiveEntity)
|
|
755
751
|
const oDraftRoot = oMetaModel.getObject(sContextPath + "@com.sap.vocabularies.Common.v1.DraftRoot");
|
|
756
752
|
const oDraftNode = oMetaModel.getObject(sContextPath + "@com.sap.vocabularies.Common.v1.DraftNode");
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
753
|
+
const oRootViewController = (this._oAppComponent as any).getRootViewController();
|
|
754
|
+
if (oRootViewController.isFclEnabled()) {
|
|
755
|
+
const oContext = oModel.getKeepAliveContext(sPath, false, mParameters);
|
|
756
|
+
if (oDraftRoot || oDraftNode) {
|
|
757
|
+
// when switching between draft and edit we need to ensure those properties are requested again even if they are in the binding's cache
|
|
758
|
+
// otherwise when you edit and go to the saved version you have no way of switching back to the edit version
|
|
759
|
+
oContext.requestSideEffects(["HasActiveEntity", "HasDraftEntity", "IsActiveEntity", "DraftAdministrativeData"]);
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
return oContext;
|
|
763
|
+
} else {
|
|
764
|
+
if (sEntitySet) {
|
|
765
|
+
const sMessagesPath = oMetaModel.getObject(sContextPath + "/@com.sap.vocabularies.Common.v1.Messages/$Path");
|
|
766
|
+
if (sMessagesPath) {
|
|
767
|
+
mParameters.$select = sMessagesPath;
|
|
768
|
+
}
|
|
762
769
|
}
|
|
763
|
-
}
|
|
764
770
|
|
|
765
|
-
|
|
771
|
+
// In case of draft: $select the state flags (HasActiveEntity, HasDraftEntity, and IsActiveEntity)
|
|
772
|
+
if (oDraftRoot || oDraftNode) {
|
|
773
|
+
if (mParameters.$select === undefined) {
|
|
774
|
+
mParameters.$select = "HasActiveEntity,HasDraftEntity,IsActiveEntity";
|
|
775
|
+
} else {
|
|
776
|
+
mParameters.$select += ",HasActiveEntity,HasDraftEntity,IsActiveEntity";
|
|
777
|
+
}
|
|
778
|
+
}
|
|
766
779
|
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
780
|
+
const oHiddenBinding = oModel.bindContext(sPath, undefined, mParameters);
|
|
781
|
+
|
|
782
|
+
oHiddenBinding.attachEventOnce("dataRequested", () => {
|
|
783
|
+
BusyLocker.lock(this._oView);
|
|
784
|
+
});
|
|
785
|
+
oHiddenBinding.attachEventOnce("dataReceived", this._dataReceivedEventHandler.bind(this, navigateToSiblingEntity));
|
|
786
|
+
return oHiddenBinding.getBoundContext();
|
|
787
|
+
}
|
|
772
788
|
}
|
|
773
789
|
|
|
774
|
-
_dataReceivedEventHandler(oEvent: Event) {
|
|
790
|
+
async _dataReceivedEventHandler(navigateToSiblingEntity: boolean, oEvent: Event) {
|
|
791
|
+
const context = oEvent?.getSource && (oEvent?.getSource() as any)?.getBoundContext();
|
|
792
|
+
const ProgrammingModel = FELibrary.ProgrammingModel;
|
|
793
|
+
const programmingModel = (this._oView?.getController() as PageController)?._editFlow?.getProgrammingModel(context);
|
|
775
794
|
const sErrorDescription = oEvent && oEvent.getParameter("error");
|
|
776
795
|
BusyLocker.unlock(this._oView);
|
|
796
|
+
if (
|
|
797
|
+
programmingModel === ProgrammingModel.Draft &&
|
|
798
|
+
ActivitySync.isCollaborationEnabled(this._oView) &&
|
|
799
|
+
navigateToSiblingEntity &&
|
|
800
|
+
context.getProperty("IsActiveEntity") &&
|
|
801
|
+
context.getObject().DraftAdministrativeData
|
|
802
|
+
) {
|
|
803
|
+
const siblingInfo = await draft.computeSiblingInformation(context, context);
|
|
804
|
+
if (siblingInfo) {
|
|
805
|
+
this.navigateToContext(siblingInfo.targetContext);
|
|
806
|
+
return;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
|
|
777
810
|
if (sErrorDescription) {
|
|
778
811
|
// TODO: in case of 404 the text shall be different
|
|
779
|
-
|
|
780
|
-
.
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
.
|
|
799
|
-
|
|
800
|
-
});
|
|
812
|
+
try {
|
|
813
|
+
const oResourceBundle = await (Core as CoreEx).getLibraryResourceBundle("sap.fe.core", true);
|
|
814
|
+
const messageHandler = this.base.messageHandler;
|
|
815
|
+
let mParams = {};
|
|
816
|
+
if (sErrorDescription && sErrorDescription.status === 503) {
|
|
817
|
+
mParams = {
|
|
818
|
+
isInitialLoad503Error: true,
|
|
819
|
+
shellBack: true
|
|
820
|
+
};
|
|
821
|
+
} else {
|
|
822
|
+
mParams = {
|
|
823
|
+
title: oResourceBundle.getText("SAPFE_ERROR"),
|
|
824
|
+
description: sErrorDescription,
|
|
825
|
+
isDataReceivedError: true,
|
|
826
|
+
shellBack: true
|
|
827
|
+
};
|
|
828
|
+
}
|
|
829
|
+
messageHandler.showMessages(mParams);
|
|
830
|
+
} catch (oError: any) {
|
|
831
|
+
Log.error("Error while getting the core resource bundle", oError);
|
|
832
|
+
}
|
|
801
833
|
}
|
|
802
834
|
}
|
|
803
835
|
|
|
@@ -810,7 +842,6 @@ class InternalRouting extends ControllerExtension {
|
|
|
810
842
|
* request them.
|
|
811
843
|
*
|
|
812
844
|
* @param {sap.ui.model.odata.v4.Context} oBindingContext Context to be refreshed
|
|
813
|
-
*
|
|
814
845
|
* @ui5-restricted
|
|
815
846
|
*/
|
|
816
847
|
_refreshBindingContext(oBindingContext: any) {
|
|
@@ -884,7 +915,6 @@ class InternalRouting extends ControllerExtension {
|
|
|
884
915
|
* Gets the binding context of the page or the component.
|
|
885
916
|
*
|
|
886
917
|
* @returns {sap.ui.model.odata.v4.Context} The binding context
|
|
887
|
-
*
|
|
888
918
|
* @ui5-restricted
|
|
889
919
|
*/
|
|
890
920
|
_getBindingContext(): Context {
|
|
@@ -899,14 +929,22 @@ class InternalRouting extends ControllerExtension {
|
|
|
899
929
|
* Sets the binding context of the page or the component.
|
|
900
930
|
*
|
|
901
931
|
* @param {sap.ui.model.odata.v4.Context} oContext The binding context
|
|
902
|
-
*
|
|
903
932
|
* @ui5-restricted
|
|
904
933
|
*/
|
|
905
934
|
_setBindingContext(oContext: any) {
|
|
935
|
+
let oPreviousContext, oTargetControl;
|
|
906
936
|
if (this._oPageComponent) {
|
|
907
|
-
this._oPageComponent.
|
|
937
|
+
oPreviousContext = this._oPageComponent.getBindingContext() as Context;
|
|
938
|
+
oTargetControl = this._oPageComponent;
|
|
908
939
|
} else {
|
|
909
|
-
this._oView.
|
|
940
|
+
oPreviousContext = this._oView.getBindingContext() as Context;
|
|
941
|
+
oTargetControl = this._oView;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
oTargetControl.setBindingContext(oContext);
|
|
945
|
+
|
|
946
|
+
if (oPreviousContext && oPreviousContext.isKeepAlive()) {
|
|
947
|
+
oPreviousContext.setKeepAlive(false);
|
|
910
948
|
}
|
|
911
949
|
}
|
|
912
950
|
|
|
@@ -914,7 +952,6 @@ class InternalRouting extends ControllerExtension {
|
|
|
914
952
|
* Gets the flexible column layout (FCL) level corresponding to the view (-1 if the app is not FCL).
|
|
915
953
|
*
|
|
916
954
|
* @returns {number} The level
|
|
917
|
-
*
|
|
918
955
|
* @ui5-restricted
|
|
919
956
|
*/
|
|
920
957
|
_getFCLLevel() {
|
|
@@ -927,8 +964,8 @@ class InternalRouting extends ControllerExtension {
|
|
|
927
964
|
* @ui5-restricted
|
|
928
965
|
*/
|
|
929
966
|
|
|
930
|
-
@
|
|
931
|
-
@
|
|
967
|
+
@publicExtension()
|
|
968
|
+
@finalExtension()
|
|
932
969
|
switchFullScreen() {
|
|
933
970
|
const oSource = this.base.getView();
|
|
934
971
|
const oFCLHelperModel = oSource.getModel("fclhelper"),
|
|
@@ -940,7 +977,7 @@ class InternalRouting extends ControllerExtension {
|
|
|
940
977
|
|
|
941
978
|
const oContext = oRootViewController.getRightmostContext ? oRootViewController.getRightmostContext() : oSource.getBindingContext();
|
|
942
979
|
|
|
943
|
-
this.base._routing.navigateToContext(oContext, { sLayout: sNextLayout }).catch(function() {
|
|
980
|
+
this.base._routing.navigateToContext(oContext, { sLayout: sNextLayout }).catch(function () {
|
|
944
981
|
Log.warning("cannot switch between column and fullscreen");
|
|
945
982
|
});
|
|
946
983
|
}
|
|
@@ -950,8 +987,8 @@ class InternalRouting extends ControllerExtension {
|
|
|
950
987
|
*
|
|
951
988
|
* @ui5-restricted
|
|
952
989
|
*/
|
|
953
|
-
@
|
|
954
|
-
@
|
|
990
|
+
@publicExtension()
|
|
991
|
+
@extensible(OverrideExecution.Before)
|
|
955
992
|
closeColumn() {
|
|
956
993
|
const oSource = this.base.getView();
|
|
957
994
|
const oViewData = oSource.getViewData() as any;
|
|
@@ -960,14 +997,15 @@ class InternalRouting extends ControllerExtension {
|
|
|
960
997
|
const oMetaModel = oContext.getModel().getMetaModel();
|
|
961
998
|
|
|
962
999
|
if (oViewData && oViewData.viewLevel === 1 && ModelHelper.isDraftSupported(oMetaModel, oContext.getPath())) {
|
|
963
|
-
|
|
964
|
-
function() {
|
|
1000
|
+
draft.processDataLossOrDraftDiscardConfirmation(
|
|
1001
|
+
function () {
|
|
965
1002
|
base._routing.navigateBackFromContext(oContext, { noPreservationCache: true });
|
|
966
1003
|
},
|
|
967
1004
|
Function.prototype,
|
|
968
1005
|
oContext,
|
|
969
1006
|
oSource.getController(),
|
|
970
|
-
false
|
|
1007
|
+
false,
|
|
1008
|
+
draft.NavigationType.BackNavigation
|
|
971
1009
|
);
|
|
972
1010
|
} else {
|
|
973
1011
|
base._routing.navigateBackFromContext(oContext, { noPreservationCache: true });
|