@sapui5/sap.fe.core 1.97.0 → 1.99.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -4
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AnnotationHelper.js +377 -405
- package/src/sap/fe/core/AnnotationHelper.ts +385 -0
- package/src/sap/fe/core/AppComponent.js +6 -3
- package/src/sap/fe/core/AppStateHandler.js +229 -181
- package/src/sap/fe/core/AppStateHandler.ts +171 -0
- package/src/sap/fe/core/BaseController.js +3 -2
- package/src/sap/fe/core/BusyLocker.js +105 -121
- package/src/sap/fe/core/BusyLocker.ts +98 -0
- package/src/sap/fe/core/CommonUtils.js +2073 -2379
- package/src/sap/fe/core/CommonUtils.ts +2078 -0
- package/src/sap/fe/core/ExtensionAPI.js +16 -7
- package/src/sap/fe/core/PageController.js +84 -119
- package/src/sap/fe/core/PageController.ts +101 -0
- package/src/sap/fe/core/RouterProxy.js +986 -807
- package/src/sap/fe/core/RouterProxy.ts +838 -0
- package/src/sap/fe/core/Synchronization.js +51 -35
- package/src/sap/fe/core/Synchronization.ts +29 -0
- package/src/sap/fe/core/TemplateComponent.js +173 -155
- package/src/sap/fe/core/TemplateComponent.ts +166 -0
- package/src/sap/fe/core/TemplateModel.js +97 -54
- package/src/sap/fe/core/TemplateModel.ts +64 -0
- package/src/sap/fe/core/TransactionHelper.js +1576 -1579
- package/src/sap/fe/core/TransactionHelper.ts +1706 -0
- package/src/sap/fe/core/actions/draft.js +560 -581
- package/src/sap/fe/core/actions/draft.ts +594 -0
- package/src/sap/fe/core/actions/messageHandling.js +545 -511
- package/src/sap/fe/core/actions/messageHandling.ts +532 -0
- package/src/sap/fe/core/actions/nonDraft.js +17 -19
- package/src/sap/fe/core/actions/nonDraft.ts +12 -0
- package/src/sap/fe/core/actions/operations.js +1074 -1211
- package/src/sap/fe/core/actions/operations.ts +1162 -0
- package/src/sap/fe/core/actions/sticky.js +102 -105
- package/src/sap/fe/core/actions/sticky.ts +102 -0
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +3 -2
- package/src/sap/fe/core/controllerextensions/EditFlow.js +229 -260
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +3 -2
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +288 -13
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +27 -23
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +82 -46
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +113 -25
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +135 -44
- package/src/sap/fe/core/controllerextensions/MassEdit.js +172 -0
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +22 -9
- package/src/sap/fe/core/controllerextensions/PageReady.js +3 -3
- package/src/sap/fe/core/controllerextensions/PageReady.ts +12 -8
- package/src/sap/fe/core/controllerextensions/Paginator.js +37 -9
- package/src/sap/fe/core/controllerextensions/Placeholder.js +8 -4
- package/src/sap/fe/core/controllerextensions/Routing.js +25 -5
- package/src/sap/fe/core/controllerextensions/RoutingListener.js +3 -2
- package/src/sap/fe/core/controllerextensions/Share.js +22 -8
- package/src/sap/fe/core/controllerextensions/SideEffects.js +9 -9
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +22 -21
- package/src/sap/fe/core/controllerextensions/ViewState.js +3 -2
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +2 -1
- package/src/sap/fe/core/controls/CommandExecution.js +3 -2
- package/src/sap/fe/core/controls/ConditionalWrapper.js +3 -2
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +3 -2
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +9 -5
- package/src/sap/fe/core/controls/FieldWrapper.js +18 -23
- package/src/sap/fe/core/controls/FilterBar.js +3 -2
- package/src/sap/fe/core/controls/FormElementWrapper.js +3 -7
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +3 -2
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +2 -1
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +3 -2
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +5 -4
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -2
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +3 -2
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +106 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +79 -0
- package/src/sap/fe/core/converters/ConverterContext.js +14 -2
- package/src/sap/fe/core/converters/ConverterContext.ts +14 -3
- package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +4 -0
- package/src/sap/fe/core/converters/ManifestWrapper.js +56 -32
- package/src/sap/fe/core/converters/ManifestWrapper.ts +24 -6
- package/src/sap/fe/core/converters/MetaModelConverter.js +67 -6
- package/src/sap/fe/core/converters/MetaModelConverter.ts +70 -14
- package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
- package/src/sap/fe/core/converters/TemplateConverter.ts +2 -2
- package/src/sap/fe/core/converters/annotations/DataField.js +3 -3
- package/src/sap/fe/core/converters/annotations/DataField.ts +1 -1
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +33 -21
- package/src/sap/fe/core/converters/controls/Common/Action.js +11 -2
- package/src/sap/fe/core/converters/controls/Common/Action.ts +8 -2
- package/src/sap/fe/core/converters/controls/Common/Chart.js +5 -3
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +11 -3
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +3 -3
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +2 -2
- package/src/sap/fe/core/converters/controls/Common/Form.js +20 -10
- package/src/sap/fe/core/converters/controls/Common/Form.ts +24 -4
- package/src/sap/fe/core/converters/controls/Common/KPI.js +69 -4
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +72 -0
- package/src/sap/fe/core/converters/controls/Common/Table.js +390 -398
- package/src/sap/fe/core/converters/controls/Common/Table.ts +497 -484
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +527 -0
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +655 -0
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +489 -37
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +506 -58
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +2 -2
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +1 -1
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +17 -9
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +24 -9
- package/src/sap/fe/core/converters/helpers/Aggregation.js +18 -3
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +28 -5
- package/src/sap/fe/core/converters/helpers/IssueManager.js +7 -1
- package/src/sap/fe/core/converters/helpers/IssueManager.ts +6 -0
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +4 -4
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +3 -3
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +13 -6
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +26 -15
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +11 -2
- package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
- package/src/sap/fe/core/formatters/CriticalityFormatter.ts +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.ts +4 -10
- package/src/sap/fe/core/formatters/KPIFormatter.js +1 -1
- package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -1
- package/src/sap/fe/core/formatters/TableFormatter.js +39 -28
- package/src/sap/fe/core/formatters/TableFormatter.ts +43 -28
- package/src/sap/fe/core/formatters/ValueFormatter.js +30 -5
- package/src/sap/fe/core/formatters/ValueFormatter.ts +30 -7
- package/src/sap/fe/core/fpm/Component.js +3 -2
- package/src/sap/fe/core/helpers/AppStartupHelper.js +359 -0
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +391 -0
- package/src/sap/fe/core/helpers/BindingExpression.js +484 -437
- package/src/sap/fe/core/helpers/BindingExpression.ts +480 -463
- package/src/sap/fe/core/helpers/ClassSupport.js +27 -15
- package/src/sap/fe/core/helpers/ClassSupport.ts +31 -20
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +63 -59
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +56 -0
- package/src/sap/fe/core/helpers/EditState.js +81 -84
- package/src/sap/fe/core/helpers/EditState.ts +81 -0
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +62 -48
- package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +49 -0
- package/src/sap/fe/core/helpers/FPMHelper.js +52 -56
- package/src/sap/fe/core/helpers/FPMHelper.ts +62 -0
- package/src/sap/fe/core/helpers/KeepAliveHelper.js +4 -5
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +10 -10
- package/src/sap/fe/core/helpers/MassEditHelper.js +687 -0
- package/src/sap/fe/core/helpers/ModelHelper.js +229 -225
- package/src/sap/fe/core/helpers/ModelHelper.ts +227 -0
- package/src/sap/fe/core/helpers/PasteHelper.js +210 -132
- package/src/sap/fe/core/helpers/PasteHelper.ts +196 -0
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +332 -313
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +330 -0
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +66 -67
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +73 -0
- package/src/sap/fe/core/helpers/StableIdHelper.js +4 -7
- package/src/sap/fe/core/helpers/StableIdHelper.ts +2 -6
- package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx.ts +1 -1
- package/src/sap/fe/core/library.js +30 -3
- package/src/sap/fe/core/library.support.js +12 -5
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +62 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +66 -0
- package/src/sap/fe/core/messagebundle.properties +61 -13
- package/src/sap/fe/core/messagebundle_ar.properties +33 -2
- package/src/sap/fe/core/messagebundle_bg.properties +33 -2
- package/src/sap/fe/core/messagebundle_ca.properties +33 -2
- package/src/sap/fe/core/messagebundle_cs.properties +34 -3
- package/src/sap/fe/core/messagebundle_cy.properties +33 -2
- package/src/sap/fe/core/messagebundle_da.properties +33 -2
- package/src/sap/fe/core/messagebundle_de.properties +33 -2
- package/src/sap/fe/core/messagebundle_el.properties +33 -2
- package/src/sap/fe/core/messagebundle_en.properties +32 -1
- package/src/sap/fe/core/messagebundle_en_GB.properties +32 -1
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +36 -1
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +33 -2
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +33 -2
- package/src/sap/fe/core/messagebundle_es.properties +33 -2
- package/src/sap/fe/core/messagebundle_es_MX.properties +33 -2
- package/src/sap/fe/core/messagebundle_et.properties +33 -2
- package/src/sap/fe/core/messagebundle_fi.properties +34 -3
- package/src/sap/fe/core/messagebundle_fr.properties +38 -7
- package/src/sap/fe/core/messagebundle_fr_CA.properties +33 -2
- package/src/sap/fe/core/messagebundle_hi.properties +33 -2
- package/src/sap/fe/core/messagebundle_hr.properties +33 -2
- package/src/sap/fe/core/messagebundle_hu.properties +34 -3
- package/src/sap/fe/core/messagebundle_id.properties +36 -5
- package/src/sap/fe/core/messagebundle_it.properties +33 -2
- package/src/sap/fe/core/messagebundle_iw.properties +33 -2
- package/src/sap/fe/core/messagebundle_ja.properties +33 -2
- package/src/sap/fe/core/messagebundle_kk.properties +33 -2
- package/src/sap/fe/core/messagebundle_ko.properties +33 -2
- package/src/sap/fe/core/messagebundle_lt.properties +33 -2
- package/src/sap/fe/core/messagebundle_lv.properties +33 -2
- package/src/sap/fe/core/messagebundle_ms.properties +33 -2
- package/src/sap/fe/core/messagebundle_nl.properties +33 -2
- package/src/sap/fe/core/messagebundle_no.properties +33 -2
- package/src/sap/fe/core/messagebundle_pl.properties +33 -2
- package/src/sap/fe/core/messagebundle_pt.properties +34 -3
- package/src/sap/fe/core/messagebundle_pt_PT.properties +33 -2
- package/src/sap/fe/core/messagebundle_ro.properties +33 -2
- package/src/sap/fe/core/messagebundle_ru.properties +33 -2
- package/src/sap/fe/core/messagebundle_sh.properties +33 -2
- package/src/sap/fe/core/messagebundle_sk.properties +33 -2
- package/src/sap/fe/core/messagebundle_sl.properties +33 -2
- package/src/sap/fe/core/messagebundle_sv.properties +34 -3
- package/src/sap/fe/core/messagebundle_th.properties +33 -2
- package/src/sap/fe/core/messagebundle_tr.properties +33 -2
- package/src/sap/fe/core/messagebundle_uk.properties +33 -2
- package/src/sap/fe/core/messagebundle_vi.properties +33 -2
- package/src/sap/fe/core/messagebundle_zh_CN.properties +33 -2
- package/src/sap/fe/core/messagebundle_zh_TW.properties +33 -2
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +269 -202
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +212 -0
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +4 -3
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +9 -5
- package/src/sap/fe/core/services/NavigationServiceFactory.js +406 -300
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +316 -0
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +149 -81
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +80 -0
- package/src/sap/fe/core/services/RoutingServiceFactory.js +987 -1152
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +898 -0
- package/src/sap/fe/core/services/ShellServicesFactory.js +31 -2
- package/src/sap/fe/core/services/ShellServicesFactory.ts +45 -11
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +42 -85
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +57 -100
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +461 -478
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +453 -0
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +10 -8
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +8 -0
- package/src/sap/fe/core/support/AnnotationIssue.support.js +15 -3
- package/src/sap/fe/core/support/AnnotationIssue.support.ts +16 -2
- package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -2
- package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.ts +1 -1
- package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.js +38 -0
- package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.ts +18 -0
- package/src/sap/fe/core/templating/DataModelPathHelper.js +10 -48
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +14 -46
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +114 -0
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +86 -0
- package/src/sap/fe/core/templating/FieldControlHelper.js +8 -8
- package/src/sap/fe/core/templating/FieldControlHelper.ts +25 -7
- package/src/sap/fe/core/templating/FilterHelper.js +139 -70
- package/src/sap/fe/core/templating/FilterHelper.ts +140 -70
- package/src/sap/fe/core/templating/PropertyHelper.js +2 -2
- package/src/sap/fe/core/templating/PropertyHelper.ts +1 -1
- package/src/sap/fe/core/templating/UIFormatters.js +45 -110
- package/src/sap/fe/core/templating/UIFormatters.ts +39 -75
- package/src/sap/fe/core/type/Email.js +1 -1
- package/src/sap/fe/core/type/Email.ts +4 -6
- package/ui5.yaml +0 -3
- package/src/sap/fe/core/controls/filterbar.d.js +0 -8
- package/src/sap/fe/core/controls/filterbar.d.ts +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SAPUI5
|
|
3
|
-
|
|
2
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
|
|
4
5
|
*/
|
|
5
6
|
sap.ui.define(["sap/ui/core/mvc/ControllerExtension", "sap/ui/core/mvc/OverrideExecution"], function(
|
|
6
7
|
ControllerExtension,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SAPUI5
|
|
3
|
-
|
|
2
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
|
|
4
5
|
*/
|
|
5
6
|
sap.ui.define(
|
|
6
7
|
[
|
|
@@ -12,7 +13,10 @@ sap.ui.define(
|
|
|
12
13
|
"sap/fe/core/CommonUtils",
|
|
13
14
|
"sap/fe/core/BusyLocker",
|
|
14
15
|
"sap/fe/core/library",
|
|
15
|
-
"sap/fe/core/helpers/EditState"
|
|
16
|
+
"sap/fe/core/helpers/EditState",
|
|
17
|
+
"sap/m/Button",
|
|
18
|
+
"sap/m/Dialog",
|
|
19
|
+
"sap/fe/core/actions/sticky"
|
|
16
20
|
],
|
|
17
21
|
function(
|
|
18
22
|
ControllerExtension,
|
|
@@ -23,15 +27,117 @@ sap.ui.define(
|
|
|
23
27
|
CommonUtils,
|
|
24
28
|
BusyLocker,
|
|
25
29
|
FELibrary,
|
|
26
|
-
EditState
|
|
30
|
+
EditState,
|
|
31
|
+
Button,
|
|
32
|
+
Dialog,
|
|
33
|
+
sticky
|
|
27
34
|
) {
|
|
28
35
|
"use strict";
|
|
29
36
|
|
|
30
37
|
var ProgrammingModel = FELibrary.ProgrammingModel,
|
|
31
38
|
DraftStatus = FELibrary.DraftStatus,
|
|
32
|
-
EditMode = FELibrary.EditMode
|
|
39
|
+
EditMode = FELibrary.EditMode,
|
|
40
|
+
CreationMode = FELibrary.CreationMode;
|
|
41
|
+
|
|
42
|
+
function _registerDirtyStateProvider(oContext, oAppComponent, oInternalModel, sHashTracker) {
|
|
43
|
+
function fnDirtyStateProvider(oNavigationContext) {
|
|
44
|
+
var sTargetHash = oNavigationContext.innerAppRoute,
|
|
45
|
+
oRouterProxy = oAppComponent.getRouterProxy(),
|
|
46
|
+
bDirty,
|
|
47
|
+
bSessionON = oInternalModel.getProperty("/sessionOn");
|
|
48
|
+
|
|
49
|
+
if (!bSessionON) {
|
|
50
|
+
// If the sticky session was terminated before hand.
|
|
51
|
+
// Eexample in case of navigating away from application using IBN.
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (!oRouterProxy.isNavigationFinalized()) {
|
|
56
|
+
// If navigation is currently happening in RouterProxy, it's a transient state
|
|
57
|
+
// (not dirty)
|
|
58
|
+
bDirty = false;
|
|
59
|
+
sHashTracker = sTargetHash;
|
|
60
|
+
} else if (sHashTracker === sTargetHash) {
|
|
61
|
+
// the hash didn't change so either the user attempts to refresh or to leave the app
|
|
62
|
+
bDirty = true;
|
|
63
|
+
} else if (oRouterProxy.checkHashWithGuard(sTargetHash) || oRouterProxy.isGuardCrossAllowedByUser()) {
|
|
64
|
+
// the user attempts to navigate within the root object
|
|
65
|
+
// or crossing the guard has already been allowed by the RouterProxy
|
|
66
|
+
sHashTracker = sTargetHash;
|
|
67
|
+
bDirty = false;
|
|
68
|
+
} else {
|
|
69
|
+
// the user attempts to navigate within the app, for example back to the list report
|
|
70
|
+
bDirty = true;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (bDirty) {
|
|
74
|
+
// the FLP doesn't call the dirty state provider anymore once it's dirty, as they can't
|
|
75
|
+
// change this due to compatibility reasons we set it back to not-dirty
|
|
76
|
+
setTimeout(function() {
|
|
77
|
+
oAppComponent.getShellServices().setDirtyFlag(false);
|
|
78
|
+
}, 0);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return bDirty;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
oContext.fnDirtyStateProvider = fnDirtyStateProvider;
|
|
85
|
+
oAppComponent.getShellServices().registerDirtyStateProvider(oContext.fnDirtyStateProvider);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function _attachSessionTimeout(oContext, i18nModel) {
|
|
89
|
+
var that = oContext;
|
|
90
|
+
|
|
91
|
+
function fnHandleSessionTimeout() {
|
|
92
|
+
// remove transient messages since we will showing our own message
|
|
93
|
+
that.getMessageHandler().removeTransitionMessages();
|
|
94
|
+
|
|
95
|
+
var oDialog = new Dialog({
|
|
96
|
+
title: "{sap.fe.i18n>C_EDITFLOW_OBJECT_PAGE_SESSION_EXPIRED_DIALOG_TITLE}",
|
|
97
|
+
state: "Warning",
|
|
98
|
+
content: new Text({ text: "{sap.fe.i18n>C_EDITFLOW_OBJECT_PAGE_SESSION_EXPIRED_DIALOG_MESSAGE}" }),
|
|
99
|
+
beginButton: new Button({
|
|
100
|
+
text: "{sap.fe.i18n>C_COMMON_DIALOG_OK}",
|
|
101
|
+
type: "Emphasized",
|
|
102
|
+
press: function() {
|
|
103
|
+
// remove sticky handling after navigation since session has already been terminated
|
|
104
|
+
that.handleStickyOff();
|
|
105
|
+
that.getRoutingListener().navigateBackFromContext(oContext);
|
|
106
|
+
}
|
|
107
|
+
}),
|
|
108
|
+
afterClose: function() {
|
|
109
|
+
oDialog.destroy();
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
oDialog.addStyleClass("sapUiContentPadding");
|
|
113
|
+
oDialog.setModel(i18nModel, "sap.fe.i18n");
|
|
114
|
+
that.getView().addDependent(oDialog);
|
|
115
|
+
oDialog.open();
|
|
116
|
+
}
|
|
33
117
|
|
|
34
|
-
|
|
118
|
+
// handle session timeout
|
|
119
|
+
that.fnHandleSessionTimeout = fnHandleSessionTimeout;
|
|
120
|
+
that.getView()
|
|
121
|
+
.getModel()
|
|
122
|
+
.attachSessionTimeout(that.fnHandleSessionTimeout);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function _attachRouteMatched(oFnContext, oContext, oAppComponent) {
|
|
126
|
+
var that = oFnContext;
|
|
127
|
+
|
|
128
|
+
function fnStickyDiscardAfterNavigation() {
|
|
129
|
+
var sCurrentHash = oAppComponent.getRouterProxy().getHash();
|
|
130
|
+
// either current hash is empty so the user left the app or he navigated away from the object
|
|
131
|
+
if (!sCurrentHash || !oAppComponent.getRouterProxy().checkHashWithGuard(sCurrentHash)) {
|
|
132
|
+
that.discardStickySession(oContext);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
that.fnStickyDiscardAfterNavigation = fnStickyDiscardAfterNavigation;
|
|
137
|
+
oAppComponent.getRoutingService().attachRouteMatched(that.fnStickyDiscardAfterNavigation);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return ControllerExtension.extend("sap.fe.core.controllerextensions.InternalEditFlow", {
|
|
35
141
|
metadata: {
|
|
36
142
|
methods: {
|
|
37
143
|
createMultipleDocuments: { "public": true, "final": true },
|
|
@@ -52,7 +158,9 @@ sap.ui.define(
|
|
|
52
158
|
deleteCurrentActionPromise: { "public": true, "final": true },
|
|
53
159
|
getActionResponseDataAndKeys: { "public": true, "final": true },
|
|
54
160
|
setCreationMode: { "public": false, "final": false, "overrideExecution": OverrideExecution.After },
|
|
55
|
-
getMessageHandler: { "public": true, "final": true }
|
|
161
|
+
getMessageHandler: { "public": true, "final": true },
|
|
162
|
+
handleStickyOn: { "public": true, "final": true },
|
|
163
|
+
handleStickyOff: { "public": true, "final": true }
|
|
56
164
|
}
|
|
57
165
|
},
|
|
58
166
|
|
|
@@ -67,7 +175,7 @@ sap.ui.define(
|
|
|
67
175
|
// to be overridden
|
|
68
176
|
},
|
|
69
177
|
|
|
70
|
-
createMultipleDocuments: function(oListBinding, aData, bCreateAtEnd, bFromCopyPaste) {
|
|
178
|
+
createMultipleDocuments: function(oListBinding, aData, bCreateAtEnd, bFromCopyPaste, beforeCreateCallBack) {
|
|
71
179
|
var that = this,
|
|
72
180
|
transactionHelper = this.getTransactionHelper(),
|
|
73
181
|
oLockObject = this.getGlobalUIModel(),
|
|
@@ -75,6 +183,12 @@ sap.ui.define(
|
|
|
75
183
|
|
|
76
184
|
BusyLocker.lock(oLockObject);
|
|
77
185
|
return this.syncTask()
|
|
186
|
+
.then(function() {
|
|
187
|
+
var onBeforeCreatePromise = beforeCreateCallBack
|
|
188
|
+
? beforeCreateCallBack({ contextPath: oListBinding && oListBinding.getPath() })
|
|
189
|
+
: Promise.resolve();
|
|
190
|
+
return onBeforeCreatePromise;
|
|
191
|
+
})
|
|
78
192
|
.then(function() {
|
|
79
193
|
var oModel = oListBinding.getModel(),
|
|
80
194
|
oMetaModel = oModel.getMetaModel(),
|
|
@@ -94,7 +208,7 @@ sap.ui.define(
|
|
|
94
208
|
|
|
95
209
|
mParameters.keepTransientContextOnFailed = false; // currently not fully supported
|
|
96
210
|
mParameters.busyMode = "None";
|
|
97
|
-
mParameters.creationMode =
|
|
211
|
+
mParameters.creationMode = CreationMode.CreationRow;
|
|
98
212
|
mParameters.parentControl = that.getView();
|
|
99
213
|
mParameters.createAtEnd = bCreateAtEnd;
|
|
100
214
|
|
|
@@ -111,7 +225,8 @@ sap.ui.define(
|
|
|
111
225
|
mParameters,
|
|
112
226
|
oResourceBundle,
|
|
113
227
|
that.getMessageHandler(),
|
|
114
|
-
bFromCopyPaste
|
|
228
|
+
bFromCopyPaste,
|
|
229
|
+
that.getView()
|
|
115
230
|
);
|
|
116
231
|
});
|
|
117
232
|
|
|
@@ -200,6 +315,9 @@ sap.ui.define(
|
|
|
200
315
|
|
|
201
316
|
return oResult;
|
|
202
317
|
})
|
|
318
|
+
.catch(function(oError) {
|
|
319
|
+
Log.error("Error while deleting the document(s)", oError);
|
|
320
|
+
})
|
|
203
321
|
.finally(function() {
|
|
204
322
|
BusyLocker.unlock(oLockObject);
|
|
205
323
|
});
|
|
@@ -216,7 +334,8 @@ sap.ui.define(
|
|
|
216
334
|
*/
|
|
217
335
|
|
|
218
336
|
computeEditMode: function(oContext) {
|
|
219
|
-
var that = this
|
|
337
|
+
var that = this,
|
|
338
|
+
sCustomAction = that.getInternalModel().getProperty("/sCustomAction");
|
|
220
339
|
|
|
221
340
|
return Promise.resolve(
|
|
222
341
|
(function() {
|
|
@@ -243,6 +362,19 @@ sap.ui.define(
|
|
|
243
362
|
Log.error("Error while determining the editMode for draft", oError);
|
|
244
363
|
throw oError;
|
|
245
364
|
});
|
|
365
|
+
} else if (sProgrammingModel === ProgrammingModel.Sticky) {
|
|
366
|
+
if (
|
|
367
|
+
sCustomAction &&
|
|
368
|
+
sCustomAction !== "" &&
|
|
369
|
+
that._hasNewActionForSticky(oContext, that.getView(), sCustomAction)
|
|
370
|
+
) {
|
|
371
|
+
that.getTransactionHelper()._bCreateMode = true;
|
|
372
|
+
that.getTransactionHelper().handleDocumentModifications();
|
|
373
|
+
that.setEditMode(EditMode.Editable, true);
|
|
374
|
+
EditState.setEditStateDirty();
|
|
375
|
+
that.handleStickyOn(oContext);
|
|
376
|
+
that.getInternalModel().setProperty("/sCustomAction", "");
|
|
377
|
+
}
|
|
246
378
|
}
|
|
247
379
|
})()
|
|
248
380
|
);
|
|
@@ -363,6 +495,9 @@ sap.ui.define(
|
|
|
363
495
|
)
|
|
364
496
|
.then(function() {
|
|
365
497
|
that.getInternalModel().setProperty("/sessionOn", false);
|
|
498
|
+
})
|
|
499
|
+
.catch(function(oError) {
|
|
500
|
+
return Promise.reject(oError);
|
|
366
501
|
});
|
|
367
502
|
},
|
|
368
503
|
|
|
@@ -499,9 +634,149 @@ sap.ui.define(
|
|
|
499
634
|
onInit: function() {
|
|
500
635
|
this._oAppComponent = this.base.getAppComponent();
|
|
501
636
|
}
|
|
637
|
+
},
|
|
638
|
+
|
|
639
|
+
handleStickyOn: function(oContext) {
|
|
640
|
+
var that = this,
|
|
641
|
+
oAppComponent = CommonUtils.getAppComponent(this.getView());
|
|
642
|
+
|
|
643
|
+
try {
|
|
644
|
+
if (oAppComponent === undefined || oContext === undefined) {
|
|
645
|
+
throw new Error("undefined AppComponent or Context for function handleStickyOn");
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
if (!oAppComponent.getRouterProxy().hasNavigationGuard()) {
|
|
649
|
+
var sHashTracker = oAppComponent.getRouterProxy().getHash(),
|
|
650
|
+
oInternalModel = this.getInternalModel();
|
|
651
|
+
|
|
652
|
+
// Set a guard in the RouterProxy
|
|
653
|
+
// A timeout is necessary, as with deferred creation the hashChanger is not updated yet with
|
|
654
|
+
// the new hash, and the guard cannot be found in the managed history of the router proxy
|
|
655
|
+
setTimeout(function() {
|
|
656
|
+
oAppComponent.getRouterProxy().setNavigationGuard();
|
|
657
|
+
}, 0);
|
|
658
|
+
|
|
659
|
+
// Setting back navigation on shell service, to get the dicard message box in case of sticky
|
|
660
|
+
oAppComponent.getShellServices().setBackNavigation(that.onBackNavigationInSession.bind(that));
|
|
661
|
+
|
|
662
|
+
_registerDirtyStateProvider(that, oAppComponent, oInternalModel, sHashTracker);
|
|
663
|
+
|
|
664
|
+
var i18nModel = this.getView().getModel("sap.fe.i18n");
|
|
665
|
+
_attachSessionTimeout(that, i18nModel);
|
|
666
|
+
|
|
667
|
+
_attachRouteMatched(that, oContext, oAppComponent);
|
|
668
|
+
}
|
|
669
|
+
} catch (error) {
|
|
670
|
+
Log.info(error);
|
|
671
|
+
return undefined;
|
|
672
|
+
}
|
|
673
|
+
return true;
|
|
674
|
+
},
|
|
675
|
+
|
|
676
|
+
handleStickyOff: function() {
|
|
677
|
+
var oAppComponent = CommonUtils.getAppComponent(this.getView());
|
|
678
|
+
try {
|
|
679
|
+
if (oAppComponent === undefined) {
|
|
680
|
+
throw new Error("undefined AppComponent for function handleStickyOff");
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
if (oAppComponent && oAppComponent.getRouterProxy) {
|
|
684
|
+
// If we have exited from the app, CommonUtils.getAppComponent doesn't return a
|
|
685
|
+
// sap.fe.core.AppComponent, hence the 'if' above
|
|
686
|
+
oAppComponent.getRouterProxy().discardNavigationGuard();
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
if (this.fnDirtyStateProvider) {
|
|
690
|
+
oAppComponent.getShellServices().deregisterDirtyStateProvider(this.fnDirtyStateProvider);
|
|
691
|
+
this.fnDirtyStateProvider = null;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
if (this.getView().getModel() && this.fnHandleSessionTimeout) {
|
|
695
|
+
this.getView()
|
|
696
|
+
.getModel()
|
|
697
|
+
.detachSessionTimeout(this.fnHandleSessionTimeout);
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
oAppComponent.getRoutingService().detachRouteMatched(this.fnStickyDiscardAfterNavigation);
|
|
701
|
+
this.fnStickyDiscardAfterNavigation = null;
|
|
702
|
+
|
|
703
|
+
this.getTransactionHelper()._bCreateMode = false;
|
|
704
|
+
this.setEditMode(EditMode.Display, false);
|
|
705
|
+
|
|
706
|
+
if (oAppComponent) {
|
|
707
|
+
// If we have exited from the app, CommonUtils.getAppComponent doesn't return a
|
|
708
|
+
// sap.fe.core.AppComponent, hence the 'if' above
|
|
709
|
+
oAppComponent.getShellServices().setBackNavigation();
|
|
710
|
+
}
|
|
711
|
+
} catch (error) {
|
|
712
|
+
Log.info(error);
|
|
713
|
+
return undefined;
|
|
714
|
+
}
|
|
715
|
+
return true;
|
|
716
|
+
},
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* @description Method to display a 'discard' popover when exiting a sticky session.
|
|
720
|
+
*
|
|
721
|
+
* @function
|
|
722
|
+
* @name onBackNavigationInSession
|
|
723
|
+
* @memberof sap.fe.core.controllerextensions.InternalEditFlow
|
|
724
|
+
*/
|
|
725
|
+
onBackNavigationInSession: function() {
|
|
726
|
+
var that = this,
|
|
727
|
+
oView = that.getView(),
|
|
728
|
+
oAppComponent = CommonUtils.getAppComponent(oView),
|
|
729
|
+
oRouterProxy = oAppComponent.getRouterProxy();
|
|
730
|
+
|
|
731
|
+
if (oRouterProxy.checkIfBackIsOutOfGuard()) {
|
|
732
|
+
var oBindingContext = oView && oView.getBindingContext();
|
|
733
|
+
|
|
734
|
+
CommonUtils.processDataLossConfirmation(
|
|
735
|
+
function() {
|
|
736
|
+
that.discardStickySession(oBindingContext);
|
|
737
|
+
history.back();
|
|
738
|
+
},
|
|
739
|
+
oView,
|
|
740
|
+
that.getProgrammingModel(oBindingContext)
|
|
741
|
+
);
|
|
742
|
+
|
|
743
|
+
return;
|
|
744
|
+
}
|
|
745
|
+
history.back();
|
|
746
|
+
},
|
|
747
|
+
|
|
748
|
+
discardStickySession: function(oContext) {
|
|
749
|
+
sticky.discardDocument(oContext);
|
|
750
|
+
this.handleStickyOff();
|
|
751
|
+
},
|
|
752
|
+
|
|
753
|
+
_hasNewActionForSticky: function(oContext, oView, sCustomAction) {
|
|
754
|
+
try {
|
|
755
|
+
if (oContext === undefined || oView === undefined) {
|
|
756
|
+
throw new Error("Invalid input parameters for function _hasNewActionForSticky");
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
var oMetaModel = oView.getModel().getMetaModel(),
|
|
760
|
+
sMetaPath = oContext.getPath().substring(0, oContext.getPath().indexOf("(")),
|
|
761
|
+
oStickySession = oMetaModel.getObject(sMetaPath + "@com.sap.vocabularies.Session.v1.StickySessionSupported");
|
|
762
|
+
|
|
763
|
+
if (oStickySession && oStickySession.NewAction && oStickySession.NewAction === sCustomAction) {
|
|
764
|
+
return true;
|
|
765
|
+
} else if (oStickySession && oStickySession.AdditionalNewActions) {
|
|
766
|
+
return sCustomAction ===
|
|
767
|
+
oStickySession.AdditionalNewActions.find(function(sAdditionalAction) {
|
|
768
|
+
return sAdditionalAction === sCustomAction;
|
|
769
|
+
})
|
|
770
|
+
? true
|
|
771
|
+
: false;
|
|
772
|
+
} else {
|
|
773
|
+
return false;
|
|
774
|
+
}
|
|
775
|
+
} catch (error) {
|
|
776
|
+
Log.info(error);
|
|
777
|
+
return undefined;
|
|
778
|
+
}
|
|
502
779
|
}
|
|
503
780
|
});
|
|
504
|
-
|
|
505
|
-
return Extension;
|
|
506
781
|
}
|
|
507
782
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SAPUI5
|
|
3
|
-
|
|
2
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
|
|
4
5
|
*/
|
|
5
6
|
sap.ui.define(
|
|
6
7
|
[
|
|
@@ -260,6 +261,14 @@ sap.ui.define(
|
|
|
260
261
|
* @returns {object} Object of prepared attributes for external navigation and no conflict properties.
|
|
261
262
|
*/
|
|
262
263
|
prepareContextForExternalNavigation: function(oSemanticAttributes, oContext) {
|
|
264
|
+
// 1. Find all distinct keys in the object SemanticAttributes
|
|
265
|
+
// Store meta path for each occurence of the key
|
|
266
|
+
var oDistinctKeys = {},
|
|
267
|
+
sContextPath = oContext.getPath(),
|
|
268
|
+
oMetaModel = oContext.getModel().getMetaModel(),
|
|
269
|
+
sMetaPath = oMetaModel.getMetaPath(sContextPath),
|
|
270
|
+
aMetaPathParts = sMetaPath.split("/").filter(Boolean);
|
|
271
|
+
|
|
263
272
|
function _findDistinctKeysInObject(LookUpObject, sLookUpObjectMetaPath) {
|
|
264
273
|
for (var sKey in LookUpObject) {
|
|
265
274
|
// null case??
|
|
@@ -277,13 +286,7 @@ sap.ui.define(
|
|
|
277
286
|
}
|
|
278
287
|
}
|
|
279
288
|
}
|
|
280
|
-
|
|
281
|
-
// Store meta path for each occurence of the key
|
|
282
|
-
var oDistinctKeys = {},
|
|
283
|
-
sContextPath = oContext.getPath(),
|
|
284
|
-
oMetaModel = oContext.getModel().getMetaModel(),
|
|
285
|
-
sMetaPath = oMetaModel.getMetaPath(sContextPath),
|
|
286
|
-
aMetaPathParts = sMetaPath.split("/").filter(Boolean);
|
|
289
|
+
|
|
287
290
|
_findDistinctKeysInObject(oSemanticAttributes, sMetaPath);
|
|
288
291
|
|
|
289
292
|
// 2. Determine distinct key value and add conflicted paths to semantic attributes
|
|
@@ -371,7 +374,11 @@ sap.ui.define(
|
|
|
371
374
|
* @returns {object} Object of prepared filter conditions for external navigation and no conflict filters.
|
|
372
375
|
*/
|
|
373
376
|
prepareFiltersForExternalNavigation: function(oFilterBarConditions, sRootPath, aParameters) {
|
|
374
|
-
|
|
377
|
+
var oDistinctKeys = {};
|
|
378
|
+
var oFilterConditionsWithoutConflict = {};
|
|
379
|
+
var sMainEntityValuePath, sCurrentValuePath, sFullContextPath, sWinnerValuePath, sPathInContext;
|
|
380
|
+
function _findDistinctKeysInObject(LookUpObject) {
|
|
381
|
+
var sLookUpObjectMetaPath;
|
|
375
382
|
for (var sKey in LookUpObject) {
|
|
376
383
|
if (LookUpObject[sKey]) {
|
|
377
384
|
if (sKey.includes("/")) {
|
|
@@ -391,11 +398,8 @@ sap.ui.define(
|
|
|
391
398
|
}
|
|
392
399
|
}
|
|
393
400
|
}
|
|
394
|
-
var oDistinctKeys = {};
|
|
395
401
|
|
|
396
|
-
_findDistinctKeysInObject(oFilterBarConditions
|
|
397
|
-
var oFilterConditionsWithoutConflict = {};
|
|
398
|
-
var sMainEntityValuePath, sCurrentValuePath, sFullContextPath, sWinnerValuePath, sPathInContext;
|
|
402
|
+
_findDistinctKeysInObject(oFilterBarConditions);
|
|
399
403
|
for (var sDistinctKey in oDistinctKeys) {
|
|
400
404
|
var aConflictingPaths = oDistinctKeys[sDistinctKey];
|
|
401
405
|
|
|
@@ -457,21 +461,21 @@ sap.ui.define(
|
|
|
457
461
|
* @returns {string}
|
|
458
462
|
*/
|
|
459
463
|
getNavigationMode: function() {
|
|
460
|
-
return
|
|
464
|
+
return undefined;
|
|
461
465
|
},
|
|
462
466
|
/**
|
|
463
|
-
* Allows for
|
|
464
|
-
* If
|
|
465
|
-
* This
|
|
467
|
+
* Allows for navigation to a given intent (SemanticObject-Action) with the provided context, using a dialog that shows the contexts which cannot be passed
|
|
468
|
+
* If semantic object mapping is provided, this setting is also applied to the selection variant after adaptation by a consumer.
|
|
469
|
+
* This setting also removes any technical parameters and determines if an inplace or explace navigation should take place.
|
|
466
470
|
*
|
|
467
|
-
* @param {string} sSemanticObject Semantic
|
|
471
|
+
* @param {string} sSemanticObject Semantic object for the target app
|
|
468
472
|
* @param {string} sAction Action for the target app
|
|
469
473
|
* @param {object} [mNavigationParameters] Optional parameters to be passed to the external navigation
|
|
470
|
-
* @param {Array|object} [mNavigationParameters.navigationContexts] Single instance or multiple instances of {@link sap.ui.model.odata.v4.Context} or alternatively an object or array of objects to be passed to intent.
|
|
471
|
-
* @param {Array|object} [mNavigationParameters.applicableContexts] Single instance or multiple instances of {@link sap.ui.model.odata.v4.Context} or alternatively an object or array of objects to be passed to intent and for which the IBN button is enabled
|
|
472
|
-
* @param {Array|object} [mNavigationParameters.notApplicableContexts] Single instance or multiple instances of {@link sap.ui.model.odata.v4.Context} or alternatively an object or array of objects which cannot be passed to the intent.
|
|
474
|
+
* @param {Array|object} [mNavigationParameters.navigationContexts] Single instance or multiple instances of {@link sap.ui.model.odata.v4.Context}, or alternatively an object or array of objects, to be passed to the intent.
|
|
475
|
+
* @param {Array|object} [mNavigationParameters.applicableContexts] Single instance or multiple instances of {@link sap.ui.model.odata.v4.Context}, or alternatively an object or array of objects, to be passed to the intent and for which the IBN button is enabled
|
|
476
|
+
* @param {Array|object} [mNavigationParameters.notApplicableContexts] Single instance or multiple instances of {@link sap.ui.model.odata.v4.Context}, or alternatively an object or array of objects, which cannot be passed to the intent.
|
|
473
477
|
* if an array of contexts is passed the context is used to determine the meta path and accordingly remove the sensitive data
|
|
474
|
-
*
|
|
478
|
+
* If an array of objects is passed, the following format is expected:
|
|
475
479
|
* {
|
|
476
480
|
* data: {
|
|
477
481
|
* ProductID: 7634,
|