@sapui5/sap.fe.core 1.95.0 → 1.98.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 +5 -5
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AnnotationHelper.js +3 -3
- package/src/sap/fe/core/AppComponent.js +9 -44
- package/src/sap/fe/core/AppStateHandler.js +2 -2
- package/src/sap/fe/core/BaseController.js +1 -1
- package/src/sap/fe/core/BusyLocker.js +13 -1
- package/src/sap/fe/core/CommonUtils.js +129 -219
- package/src/sap/fe/core/ExtensionAPI.js +14 -6
- package/src/sap/fe/core/PageController.js +9 -35
- package/src/sap/fe/core/RouterProxy.js +79 -75
- package/src/sap/fe/core/Synchronization.js +1 -1
- package/src/sap/fe/core/TemplateComponent.js +16 -7
- package/src/sap/fe/core/TemplateModel.js +1 -1
- package/src/sap/fe/core/TransactionHelper.js +183 -65
- package/src/sap/fe/core/actions/draft.js +50 -23
- package/src/sap/fe/core/actions/messageHandling.js +86 -7
- package/src/sap/fe/core/actions/nonDraft.js +1 -1
- package/src/sap/fe/core/actions/operations.js +75 -33
- package/src/sap/fe/core/actions/sticky.js +1 -1
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +1 -1
- package/src/sap/fe/core/controllerextensions/EditFlow.js +276 -122
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +1 -1
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +14 -6
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +90 -46
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +234 -232
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +539 -209
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +550 -213
- package/src/sap/fe/core/controllerextensions/MassEdit.js +79 -0
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +227 -103
- package/src/sap/fe/core/controllerextensions/PageReady.js +2 -2
- package/src/sap/fe/core/controllerextensions/PageReady.ts +3 -7
- package/src/sap/fe/core/controllerextensions/Paginator.js +38 -12
- package/src/sap/fe/core/controllerextensions/Placeholder.js +16 -19
- package/src/sap/fe/core/controllerextensions/Routing.js +17 -2
- package/src/sap/fe/core/controllerextensions/RoutingListener.js +1 -1
- package/src/sap/fe/core/controllerextensions/Share.js +20 -7
- package/src/sap/fe/core/controllerextensions/SideEffects.js +8 -9
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +19 -17
- package/src/sap/fe/core/controllerextensions/ViewState.js +54 -9
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +40 -34
- package/src/sap/fe/core/controls/ActionParameterDialogValueHelp.fragment.xml +35 -0
- package/src/sap/fe/core/controls/CommandExecution.js +1 -1
- package/src/sap/fe/core/controls/ConditionalWrapper.js +1 -1
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +110 -109
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +7 -4
- package/src/sap/fe/core/controls/FieldWrapper.js +10 -4
- package/src/sap/fe/core/controls/FilterBar.js +1 -1
- package/src/sap/fe/core/controls/FormElementWrapper.js +1 -6
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +45 -0
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +1 -1
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +1 -1
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +1 -1
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +1 -1
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +1 -1
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +106 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +78 -0
- package/src/sap/fe/core/converters/ConverterContext.js +13 -1
- package/src/sap/fe/core/converters/ConverterContext.ts +10 -0
- package/src/sap/fe/core/converters/ManifestSettings.js +2 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +7 -1
- package/src/sap/fe/core/converters/ManifestWrapper.js +18 -7
- package/src/sap/fe/core/converters/ManifestWrapper.ts +15 -6
- package/src/sap/fe/core/converters/MetaModelConverter.js +920 -882
- package/src/sap/fe/core/converters/MetaModelConverter.ts +829 -853
- package/src/sap/fe/core/converters/annotations/DataField.js +54 -4
- package/src/sap/fe/core/converters/annotations/DataField.ts +53 -3
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +83 -48
- package/src/sap/fe/core/converters/controls/Common/Action.js +15 -3
- package/src/sap/fe/core/converters/controls/Common/Action.ts +12 -3
- package/src/sap/fe/core/converters/controls/Common/Chart.js +1 -3
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +0 -2
- package/src/sap/fe/core/converters/controls/Common/Form.js +68 -21
- package/src/sap/fe/core/converters/controls/Common/Form.ts +60 -16
- package/src/sap/fe/core/converters/controls/Common/KPI.js +331 -248
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +355 -287
- package/src/sap/fe/core/converters/controls/Common/Table.js +426 -332
- package/src/sap/fe/core/converters/controls/Common/Table.ts +516 -383
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +468 -0
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +609 -0
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +30 -13
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +31 -12
- 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 +15 -7
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +27 -6
- package/src/sap/fe/core/converters/helpers/Aggregation.js +8 -1
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +9 -1
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +3 -2
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +2 -2
- package/src/sap/fe/core/converters/helpers/ID.js +9 -1
- package/src/sap/fe/core/converters/helpers/ID.ts +6 -2
- package/src/sap/fe/core/converters/helpers/IssueManager.js +7 -5
- package/src/sap/fe/core/converters/helpers/IssueManager.ts +6 -4
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +2 -2
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +1 -1
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +34 -4
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +36 -7
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +2 -5
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +1 -2
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +11 -2
- package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.ts +8 -3
- package/src/sap/fe/core/formatters/TableFormatter.js +27 -4
- package/src/sap/fe/core/formatters/TableFormatter.ts +20 -3
- package/src/sap/fe/core/formatters/ValueFormatter.js +30 -5
- package/src/sap/fe/core/formatters/ValueFormatter.ts +25 -3
- package/src/sap/fe/core/fpm/Component.js +2 -2
- package/src/sap/fe/core/helpers/AppStartupHelper.js +359 -0
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +388 -0
- package/src/sap/fe/core/helpers/BindingExpression.js +199 -111
- package/src/sap/fe/core/helpers/BindingExpression.ts +193 -102
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +1 -1
- package/src/sap/fe/core/helpers/EditState.js +1 -1
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +1 -3
- package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
- package/src/sap/fe/core/helpers/KeepAliveHelper.js +211 -0
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +202 -0
- package/src/sap/fe/core/helpers/KeepAliveRefreshTypes.js +32 -0
- package/src/sap/fe/core/helpers/KeepAliveRefreshTypes.ts +36 -0
- package/src/sap/fe/core/helpers/MassEditHelper.js +678 -0
- package/src/sap/fe/core/helpers/ModelHelper.js +64 -1
- package/src/sap/fe/core/helpers/PasteHelper.js +7 -1
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +1 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +1 -1
- package/src/sap/fe/core/helpers/StableIdHelper.js +2 -2
- package/src/sap/fe/core/helpers/StableIdHelper.ts +1 -1
- package/src/sap/fe/core/library.js +28 -2
- package/src/sap/fe/core/library.support.js +10 -4
- 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 +67 -3
- package/src/sap/fe/core/messagebundle_ar.properties +40 -3
- package/src/sap/fe/core/messagebundle_bg.properties +40 -3
- package/src/sap/fe/core/messagebundle_ca.properties +41 -4
- package/src/sap/fe/core/messagebundle_cs.properties +41 -4
- package/src/sap/fe/core/messagebundle_cy.properties +40 -3
- package/src/sap/fe/core/messagebundle_da.properties +40 -3
- package/src/sap/fe/core/messagebundle_de.properties +40 -3
- package/src/sap/fe/core/messagebundle_el.properties +40 -3
- package/src/sap/fe/core/messagebundle_en.properties +37 -0
- package/src/sap/fe/core/messagebundle_en_GB.properties +37 -0
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +37 -0
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +46 -2
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +44 -0
- package/src/sap/fe/core/messagebundle_es.properties +40 -3
- package/src/sap/fe/core/messagebundle_es_MX.properties +41 -4
- package/src/sap/fe/core/messagebundle_et.properties +40 -3
- package/src/sap/fe/core/messagebundle_fi.properties +40 -3
- package/src/sap/fe/core/messagebundle_fr.properties +41 -4
- package/src/sap/fe/core/messagebundle_fr_CA.properties +40 -3
- package/src/sap/fe/core/messagebundle_hi.properties +40 -3
- package/src/sap/fe/core/messagebundle_hr.properties +40 -3
- package/src/sap/fe/core/messagebundle_hu.properties +41 -4
- package/src/sap/fe/core/messagebundle_id.properties +42 -5
- package/src/sap/fe/core/messagebundle_it.properties +40 -3
- package/src/sap/fe/core/messagebundle_iw.properties +40 -3
- package/src/sap/fe/core/messagebundle_ja.properties +49 -12
- package/src/sap/fe/core/messagebundle_kk.properties +40 -3
- package/src/sap/fe/core/messagebundle_ko.properties +40 -3
- package/src/sap/fe/core/messagebundle_lt.properties +40 -3
- package/src/sap/fe/core/messagebundle_lv.properties +40 -3
- package/src/sap/fe/core/messagebundle_ms.properties +40 -3
- package/src/sap/fe/core/messagebundle_nl.properties +40 -3
- package/src/sap/fe/core/messagebundle_no.properties +40 -3
- package/src/sap/fe/core/messagebundle_pl.properties +40 -3
- package/src/sap/fe/core/messagebundle_pt.properties +42 -5
- package/src/sap/fe/core/messagebundle_pt_PT.properties +40 -3
- package/src/sap/fe/core/messagebundle_ro.properties +40 -3
- package/src/sap/fe/core/messagebundle_ru.properties +40 -3
- package/src/sap/fe/core/messagebundle_sh.properties +40 -3
- package/src/sap/fe/core/messagebundle_sk.properties +40 -3
- package/src/sap/fe/core/messagebundle_sl.properties +40 -3
- package/src/sap/fe/core/messagebundle_sv.properties +41 -4
- package/src/sap/fe/core/messagebundle_th.properties +40 -3
- package/src/sap/fe/core/messagebundle_tr.properties +40 -3
- package/src/sap/fe/core/messagebundle_uk.properties +40 -3
- package/src/sap/fe/core/messagebundle_vi.properties +40 -3
- package/src/sap/fe/core/messagebundle_zh_CN.properties +40 -3
- package/src/sap/fe/core/messagebundle_zh_TW.properties +40 -3
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +1 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +1 -1
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +4 -3
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +3 -0
- package/src/sap/fe/core/services/NavigationServiceFactory.js +1 -1
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +1 -1
- package/src/sap/fe/core/services/RoutingServiceFactory.js +98 -328
- package/src/sap/fe/core/services/ShellServicesFactory.js +31 -2
- package/src/sap/fe/core/services/ShellServicesFactory.ts +30 -1
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +8 -5
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +11 -6
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +14 -5
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +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 +8 -37
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +13 -33
- 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/EntitySetHelper.js +86 -3
- package/src/sap/fe/core/templating/EntitySetHelper.ts +44 -0
- package/src/sap/fe/core/templating/FilterHelper.js +10 -7
- package/src/sap/fe/core/templating/FilterHelper.ts +8 -6
- 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 +47 -107
- package/src/sap/fe/core/templating/UIFormatters.ts +76 -72
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* SAPUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
sap.ui.define(
|
|
6
6
|
[
|
|
@@ -17,7 +17,9 @@ sap.ui.define(
|
|
|
17
17
|
"sap/fe/core/helpers/ModelHelper",
|
|
18
18
|
"sap/fe/core/helpers/EditState",
|
|
19
19
|
"sap/fe/core/actions/messageHandling",
|
|
20
|
-
"sap/fe/core/controllerextensions/Placeholder"
|
|
20
|
+
"sap/fe/core/controllerextensions/Placeholder",
|
|
21
|
+
"sap/fe/core/helpers/AppStartupHelper",
|
|
22
|
+
"sap/ui/model/odata/v4/ODataUtils"
|
|
21
23
|
],
|
|
22
24
|
function(
|
|
23
25
|
Service,
|
|
@@ -33,7 +35,9 @@ sap.ui.define(
|
|
|
33
35
|
ModelHelper,
|
|
34
36
|
EditState,
|
|
35
37
|
MessageHandling,
|
|
36
|
-
Placeholder
|
|
38
|
+
Placeholder,
|
|
39
|
+
AppStartupHelper,
|
|
40
|
+
ODataUtils
|
|
37
41
|
) {
|
|
38
42
|
"use strict";
|
|
39
43
|
|
|
@@ -71,10 +75,11 @@ sap.ui.define(
|
|
|
71
75
|
|
|
72
76
|
this.initPromise = Promise.resolve(that);
|
|
73
77
|
},
|
|
74
|
-
|
|
75
|
-
exit: function() {
|
|
78
|
+
beforeExit: function() {
|
|
76
79
|
this.oRouter.detachRouteMatched(this._fnOnRouteMatched);
|
|
77
80
|
this.eventProvider.fireEvent("routeMatched", {});
|
|
81
|
+
},
|
|
82
|
+
exit: function() {
|
|
78
83
|
this.eventProvider.destroy();
|
|
79
84
|
},
|
|
80
85
|
|
|
@@ -113,7 +118,7 @@ sap.ui.define(
|
|
|
113
118
|
|
|
114
119
|
// Check route pattern: all patterns need to end with ':?query:', that we use for parameters
|
|
115
120
|
if (sRoutePattern.length < 8 || sRoutePattern.indexOf(":?query:") !== sRoutePattern.length - 8) {
|
|
116
|
-
Log.
|
|
121
|
+
Log.warning("Pattern for route " + sRouteName + " doesn't end with ':?query:' : " + sRoutePattern);
|
|
117
122
|
}
|
|
118
123
|
var iRouteLevel = that._getViewLevelFromPattern(sRoutePattern, 0);
|
|
119
124
|
that._mRoutes[sRouteName] = {
|
|
@@ -211,13 +216,13 @@ sap.ui.define(
|
|
|
211
216
|
that.sContextPath = oSettings.contextPath || "/" + oSettings.entitySet;
|
|
212
217
|
}
|
|
213
218
|
if (!that.sContextPath) {
|
|
214
|
-
Log.
|
|
219
|
+
Log.warning(
|
|
215
220
|
"Cannot determine default contextPath: contextPath or entitySet missing in default target: " +
|
|
216
221
|
sDefaultTargetName
|
|
217
222
|
);
|
|
218
223
|
}
|
|
219
224
|
} else {
|
|
220
|
-
Log.
|
|
225
|
+
Log.warning("Cannot determine default contextPath: no default route found.");
|
|
221
226
|
}
|
|
222
227
|
|
|
223
228
|
// We need to establish the correct path to the different pages, including the navigation properties
|
|
@@ -234,11 +239,7 @@ sap.ui.define(
|
|
|
234
239
|
var settings = target.options.settings;
|
|
235
240
|
var sContextPath = settings.contextPath || (settings.entitySet ? "/" + settings.entitySet : "");
|
|
236
241
|
if (!settings.fullContextPath && sContextPath) {
|
|
237
|
-
|
|
238
|
-
settings.fullContextPath = "/";
|
|
239
|
-
} else {
|
|
240
|
-
settings.fullContextPath = sContextPath + "/";
|
|
241
|
-
}
|
|
242
|
+
settings.fullContextPath = sContextPath + "/";
|
|
242
243
|
}
|
|
243
244
|
Object.keys(settings.navigation || {}).forEach(function(sNavName) {
|
|
244
245
|
// Check if it's a navigation property
|
|
@@ -250,13 +251,12 @@ sap.ui.define(
|
|
|
250
251
|
that._mTargets[sTargetName].options.settings &&
|
|
251
252
|
!that._mTargets[sTargetName].options.settings.fullContextPath
|
|
252
253
|
) {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
targetNav = sNavName;
|
|
254
|
+
if (target.viewLevel === 0) {
|
|
255
|
+
that._mTargets[sTargetName].options.settings.fullContextPath = "/" + sNavName + "/";
|
|
256
256
|
} else {
|
|
257
|
-
|
|
257
|
+
that._mTargets[sTargetName].options.settings.fullContextPath =
|
|
258
|
+
settings.fullContextPath + sNavName + "/";
|
|
258
259
|
}
|
|
259
|
-
that._mTargets[sTargetName].options.settings.fullContextPath = targetNav + "/";
|
|
260
260
|
}
|
|
261
261
|
});
|
|
262
262
|
}
|
|
@@ -365,6 +365,7 @@ sap.ui.define(
|
|
|
365
365
|
var oParametersPromise;
|
|
366
366
|
try {
|
|
367
367
|
var sContextPath = oContext.getPath();
|
|
368
|
+
var oMetaModel = oContext.getModel().getMetaModel();
|
|
368
369
|
var aContextPathParts = sContextPath.split("/");
|
|
369
370
|
var aAllResolvedParameterPromises = Object.keys(mParameters).map(
|
|
370
371
|
function(sParameterKey) {
|
|
@@ -377,7 +378,14 @@ sap.ui.define(
|
|
|
377
378
|
// We go up the current context path as many times as necessary
|
|
378
379
|
var aLocalParts = aContextPathParts.slice(0, aContextPathParts.length - aRelativeParts.length + 1);
|
|
379
380
|
aLocalParts.push(aRelativeParts[aRelativeParts.length - 1]);
|
|
380
|
-
|
|
381
|
+
|
|
382
|
+
var sPropertyPath = aLocalParts.join("/");
|
|
383
|
+
var oMetaContext = oMetaModel.getMetaContext(sPropertyPath);
|
|
384
|
+
return oContext.requestProperty(sPropertyPath).then(function(oValue) {
|
|
385
|
+
var oPropertyInfo = oMetaContext.getObject();
|
|
386
|
+
var sEdmType = oPropertyInfo.$Type;
|
|
387
|
+
return ODataUtils.formatLiteral(oValue, sEdmType);
|
|
388
|
+
});
|
|
381
389
|
});
|
|
382
390
|
|
|
383
391
|
return Promise.all(aResolvedParameterPromises).then(
|
|
@@ -425,7 +433,8 @@ sap.ui.define(
|
|
|
425
433
|
* @param {boolean} [mParameters.bPersistOPScroll] The bPersistOPScroll will be used for scrolling to first tab
|
|
426
434
|
* @param {number} [mParameters.updateFCLLevel] `+1` if we add a column in FCL, `-1` to remove a column, 0 to stay on the same column
|
|
427
435
|
* @param {boolean} [mParameters.noPreservationCache] Do navigation without taking into account the preserved cache mechanism
|
|
428
|
-
* @param {boolean} [mParameters.bRecreateContext] Force re-creation of the context
|
|
436
|
+
* @param {boolean} [mParameters.bRecreateContext] Force re-creation of the context instead of using the one passed as parameter
|
|
437
|
+
* @param {boolean} [mParameters.bForceFocus] Forces focus selection after navigation
|
|
429
438
|
* @param {object} [oViewData] View data
|
|
430
439
|
* @param {object} [oCurrentTargetInfo] The target information from which the navigation is triggered
|
|
431
440
|
* @returns {Promise} Promise which is resolved once the navigation is triggered
|
|
@@ -485,10 +494,7 @@ sap.ui.define(
|
|
|
485
494
|
mEventParameters.routeInformation = this._getRouteInformation(this.sCurrentRouteName);
|
|
486
495
|
mEventParameters.routePattern = this.sCurrentRoutePattern;
|
|
487
496
|
mEventParameters.views = this.aCurrentViews;
|
|
488
|
-
|
|
489
|
-
// Store a fake focus information for the current hash, so that the logic to find the first editable / clickable
|
|
490
|
-
// element in the OP gets triggered
|
|
491
|
-
this.oRouterProxy.storeFocusForHash(0, null, this.oRouterProxy.getHash());
|
|
497
|
+
this.oRouterProxy.setFocusForced(mParameters.bForceFocus);
|
|
492
498
|
|
|
493
499
|
this._fireRouteMatchEvents(mEventParameters);
|
|
494
500
|
|
|
@@ -531,7 +537,35 @@ sap.ui.define(
|
|
|
531
537
|
}.bind(this)
|
|
532
538
|
);
|
|
533
539
|
}
|
|
534
|
-
|
|
540
|
+
|
|
541
|
+
var that = this;
|
|
542
|
+
return this.oRouterProxy
|
|
543
|
+
.navToHash(sTargetPath, false, mParameters.noPreservationCache, mParameters.bForceFocus)
|
|
544
|
+
.then(function(bNavigated) {
|
|
545
|
+
if (!bNavigated) {
|
|
546
|
+
// The navigation did not happen --> remove the navigation parameters from the queue as they shouldn't be used
|
|
547
|
+
that.navigationInfoQueue.pop();
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
},
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Navigates to a route.
|
|
554
|
+
*
|
|
555
|
+
* @function
|
|
556
|
+
* @name sap.fe.core.controllerextensions.Routing#navigateToRoute
|
|
557
|
+
* @memberof sap.fe.core.controllerextensions.Routing
|
|
558
|
+
* @static
|
|
559
|
+
* @param {string} [sTargetRouteName] Name of the target route
|
|
560
|
+
* @param {object} [oRouteParameters] Parameters to be used with route to create the target hash
|
|
561
|
+
* @returns {Promise} Promise that is resolved when the navigation is finalized
|
|
562
|
+
*
|
|
563
|
+
* @ui5-restricted
|
|
564
|
+
* @final
|
|
565
|
+
*/
|
|
566
|
+
navigateToRoute: function(sTargetRouteName, oRouteParameters) {
|
|
567
|
+
var sTargetURL = this.oRouter.getURL(sTargetRouteName, oRouteParameters);
|
|
568
|
+
return this.oRouterProxy.navToHash(sTargetURL);
|
|
535
569
|
},
|
|
536
570
|
|
|
537
571
|
/**
|
|
@@ -773,14 +807,15 @@ sap.ui.define(
|
|
|
773
807
|
.getStartupParameters()
|
|
774
808
|
.then(function(oStartupParameters) {
|
|
775
809
|
var bHasStartUpParameters = oStartupParameters !== undefined && Object.keys(oStartupParameters).length !== 0;
|
|
810
|
+
var sHash = that.oRouter.getHashChanger().getHash();
|
|
776
811
|
// Manage startup parameters (in case of no iapp-state)
|
|
777
|
-
if (!bIsIappState && bHasStartUpParameters) {
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
return that._managePreferredModeCreateStartup();
|
|
812
|
+
if (!bIsIappState && bHasStartUpParameters && !sHash) {
|
|
813
|
+
if (oStartupParameters.preferredMode && oStartupParameters.preferredMode[0].indexOf("create") !== -1) {
|
|
814
|
+
// Create mode
|
|
815
|
+
return that._manageCreateStartup(oStartupParameters);
|
|
782
816
|
} else {
|
|
783
|
-
|
|
817
|
+
// Deep link
|
|
818
|
+
return that._manageDeepLinkStartup(oStartupParameters);
|
|
784
819
|
}
|
|
785
820
|
}
|
|
786
821
|
})
|
|
@@ -791,317 +826,52 @@ sap.ui.define(
|
|
|
791
826
|
return initPromise;
|
|
792
827
|
},
|
|
793
828
|
|
|
794
|
-
getDefaultCreateHash: function() {
|
|
795
|
-
|
|
796
|
-
var sHash = sContextPath.substring(1) + "(...)?i-action=create";
|
|
797
|
-
if (this.oRouter.getRouteInfoByHash(sHash)) {
|
|
798
|
-
return sHash;
|
|
799
|
-
} else {
|
|
800
|
-
throw new Error("No route match for creating a new " + sContextPath.substring(1));
|
|
801
|
-
}
|
|
829
|
+
getDefaultCreateHash: function(oStartupParameters) {
|
|
830
|
+
return AppStartupHelper.getDefaultCreateHash(oStartupParameters, this.getContextPath(), this.oRouter);
|
|
802
831
|
},
|
|
803
832
|
|
|
804
|
-
|
|
833
|
+
_manageCreateStartup: function(oStartupParameters) {
|
|
805
834
|
var that = this;
|
|
806
|
-
return this.oMetaModel
|
|
807
|
-
.requestObject(this.getContextPath() + "@")
|
|
808
|
-
.then(function(oEntitySetAnnotations) {
|
|
809
|
-
var sMetaPath,
|
|
810
|
-
bCreatable = true;
|
|
811
|
-
if (
|
|
812
|
-
oEntitySetAnnotations["@com.sap.vocabularies.Common.v1.DraftRoot"] &&
|
|
813
|
-
oEntitySetAnnotations["@com.sap.vocabularies.Common.v1.DraftRoot"]["NewAction"]
|
|
814
|
-
) {
|
|
815
|
-
sMetaPath =
|
|
816
|
-
that.getContextPath() +
|
|
817
|
-
"@com.sap.vocabularies.Common.v1.DraftRoot/NewAction@Org.OData.Core.V1.OperationAvailable";
|
|
818
|
-
} else if (
|
|
819
|
-
oEntitySetAnnotations["@com.sap.vocabularies.Session.v1.StickySessionSupported"] &&
|
|
820
|
-
oEntitySetAnnotations["@com.sap.vocabularies.Session.v1.StickySessionSupported"]["NewAction"]
|
|
821
|
-
) {
|
|
822
|
-
sMetaPath =
|
|
823
|
-
that.getContextPath() +
|
|
824
|
-
"@com.sap.vocabularies.Session.v1.StickySessionSupported/NewAction@Org.OData.Core.V1.OperationAvailable";
|
|
825
|
-
}
|
|
826
|
-
if (sMetaPath) {
|
|
827
|
-
var bNewActionOperationAvailable = that.oMetaModel.getObject(sMetaPath);
|
|
828
|
-
if (bNewActionOperationAvailable === false) {
|
|
829
|
-
bCreatable = false;
|
|
830
|
-
}
|
|
831
|
-
} else {
|
|
832
|
-
var oInsertRestrictions = oEntitySetAnnotations["@Org.OData.Capabilities.V1.InsertRestrictions"];
|
|
833
|
-
if (oInsertRestrictions && oInsertRestrictions.Insertable === false) {
|
|
834
|
-
bCreatable = false;
|
|
835
|
-
}
|
|
836
|
-
}
|
|
837
|
-
if (bCreatable) {
|
|
838
|
-
var sPath = that.getDefaultCreateHash();
|
|
839
|
-
that.oRouter.getHashChanger().replaceHash(sPath);
|
|
840
|
-
that.bExitOnNavigateBackToRoot = true;
|
|
841
|
-
}
|
|
842
|
-
})
|
|
843
|
-
.catch(function() {
|
|
844
|
-
Log.error("Cannot fetch the Annotations");
|
|
845
|
-
});
|
|
846
|
-
},
|
|
847
835
|
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
return this.oMetaModel
|
|
854
|
-
.requestObject("/$EntityContainer/")
|
|
855
|
-
.then(function() {
|
|
856
|
-
// Check if semantic keys are present in url parameters for every object page at each level
|
|
857
|
-
var oLevelOfObjectPages = that._getNavigablePages(that.oAppComponent.getManifest()["sap.ui5"].routing);
|
|
858
|
-
|
|
859
|
-
aExternallyNavigablePages = that._findTargetPagesFromStartupParams(oLevelOfObjectPages, oStartUpParameters);
|
|
860
|
-
|
|
861
|
-
// Load the respective objects for all object pages found in the previous step
|
|
862
|
-
var aContextPromises = aExternallyNavigablePages.map(function(oPage) {
|
|
863
|
-
var oCompleteFilter, oListBind;
|
|
864
|
-
if (oPage.isSemanticKeyNavigation) {
|
|
865
|
-
oCompleteFilter = that._createFilter(oPage.draft, oPage.semanticKeys, oStartUpParameters);
|
|
866
|
-
} else {
|
|
867
|
-
oCompleteFilter = that._createFilter(oPage.draft, oPage.technicalKeys, oStartUpParameters);
|
|
868
|
-
}
|
|
869
|
-
oListBind = that.oModel.bindList(oPage.contextPath, undefined, undefined, oCompleteFilter);
|
|
870
|
-
return oListBind.requestContexts(0, 2);
|
|
871
|
-
});
|
|
872
|
-
|
|
873
|
-
return Promise.all(aContextPromises);
|
|
874
|
-
})
|
|
875
|
-
.then(function(aValues) {
|
|
876
|
-
if (aValues.length) {
|
|
877
|
-
// Make sure we only get 1 context per promise, and flatten the array
|
|
878
|
-
var aContexts = [];
|
|
879
|
-
aValues.forEach(function(aFoundContexts) {
|
|
880
|
-
if (aFoundContexts.length === 1) {
|
|
881
|
-
aContexts.push(aFoundContexts[0]);
|
|
882
|
-
}
|
|
883
|
-
});
|
|
884
|
-
|
|
885
|
-
// Keep hash if navigation has been done, navigation takes precedence over Startup parameters
|
|
886
|
-
if (aContexts.length === aValues.length && !that.oRouter.getHashChanger().getHash()) {
|
|
887
|
-
var sHash = that._buildStartupHash(aExternallyNavigablePages, aContexts);
|
|
888
|
-
if (sHash) {
|
|
889
|
-
//Replace the hash with newly created hash
|
|
890
|
-
that.oRouter.getHashChanger().replaceHash(sHash);
|
|
891
|
-
}
|
|
892
|
-
}
|
|
836
|
+
return AppStartupHelper.getCreateStartupHash(oStartupParameters, that.getContextPath(), that.oRouter, that.oMetaModel).then(
|
|
837
|
+
function(sNewHash) {
|
|
838
|
+
if (sNewHash) {
|
|
839
|
+
that.oRouter.getHashChanger().replaceHash(sNewHash);
|
|
840
|
+
that.bExitOnNavigateBackToRoot = true;
|
|
893
841
|
}
|
|
894
|
-
})
|
|
895
|
-
.catch(function(error) {
|
|
896
|
-
Log.info("Could not find results for list bind: " + error);
|
|
897
|
-
});
|
|
898
|
-
},
|
|
899
|
-
|
|
900
|
-
_getNavigablePages: function(oRouting) {
|
|
901
|
-
var aRoutes = oRouting.routes,
|
|
902
|
-
oTargets = oRouting.targets,
|
|
903
|
-
mPageMap = {};
|
|
904
|
-
for (var i = 0; i < aRoutes.length; i++) {
|
|
905
|
-
var oPage = {},
|
|
906
|
-
sPattern = aRoutes[i].pattern,
|
|
907
|
-
sTarget = aRoutes[i].target,
|
|
908
|
-
iLevel = sPattern.split("/").length - 1;
|
|
909
|
-
oPage["pattern"] = sPattern;
|
|
910
|
-
if (sPattern === ":?query:" || sPattern === "") {
|
|
911
|
-
continue;
|
|
912
|
-
}
|
|
913
|
-
if (iLevel === 1 && sPattern.split("/")[iLevel] === ":?query:") {
|
|
914
|
-
iLevel = 0;
|
|
915
842
|
}
|
|
916
|
-
|
|
917
|
-
if (Array.isArray(sTarget)) {
|
|
918
|
-
//target is Array in case of FCL
|
|
919
|
-
oPage["target"] = sTarget[sTarget.length - 1];
|
|
920
|
-
} else {
|
|
921
|
-
oPage["target"] = sTarget;
|
|
922
|
-
}
|
|
923
|
-
if (oTargets[oPage.target].options && oTargets[oPage.target].options.settings) {
|
|
924
|
-
oPage["allowDeepLinking"] = oTargets[oPage.target].options.settings.allowDeepLinking;
|
|
925
|
-
var sContextPath =
|
|
926
|
-
oTargets[oPage.target].options.settings.contextPath ||
|
|
927
|
-
(oTargets[oPage.target].options.settings.entitySet && "/" + oTargets[oPage.target].options.settings.entitySet);
|
|
928
|
-
oPage["contextPath"] = sContextPath;
|
|
929
|
-
}
|
|
930
|
-
if (!oPage["allowDeepLinking"] && oPage["level"] !== 0) {
|
|
931
|
-
continue;
|
|
932
|
-
} else if (!mPageMap[oPage.level]) {
|
|
933
|
-
mPageMap[oPage.level] = [];
|
|
934
|
-
}
|
|
935
|
-
mPageMap[oPage.level].push(oPage);
|
|
936
|
-
}
|
|
937
|
-
return mPageMap;
|
|
843
|
+
);
|
|
938
844
|
},
|
|
939
845
|
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
* that can be determined with the keys passed as startup parameters.
|
|
943
|
-
* Stop when no OP that can be can be found for a given level.
|
|
944
|
-
*
|
|
945
|
-
* @param {object} mPagesByLevel A map (level --> array of pages at that level)
|
|
946
|
-
* @param {object} oStartupParameters The startup parameters of the application
|
|
947
|
-
* @returns {Array} Array of all pages that can be reached with the provided parameters
|
|
948
|
-
*/
|
|
949
|
-
_findTargetPagesFromStartupParams: function(mPagesByLevel, oStartupParameters) {
|
|
950
|
-
var iLevel = 0,
|
|
951
|
-
aReachablePages = [],
|
|
952
|
-
bFound = true;
|
|
953
|
-
|
|
954
|
-
while (bFound && iLevel in mPagesByLevel) {
|
|
955
|
-
var aObjectPages = mPagesByLevel[iLevel];
|
|
956
|
-
|
|
957
|
-
// loop through pages at each level
|
|
958
|
-
// use for-loop to break early
|
|
959
|
-
bFound = false;
|
|
960
|
-
for (var i = 0; i < aObjectPages.length; ++i) {
|
|
961
|
-
var oObjectPage = aObjectPages[i];
|
|
962
|
-
if (!oObjectPage.contextPath && oObjectPage.level === 0) {
|
|
963
|
-
oObjectPage.contextPath = this.getContextPath();
|
|
964
|
-
}
|
|
965
|
-
if (!oObjectPage.contextPath) {
|
|
966
|
-
continue;
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
oObjectPage.entityType = this.oMetaModel.getObject("/$EntityContainer" + oObjectPage.contextPath + "/");
|
|
970
|
-
oObjectPage.draft =
|
|
971
|
-
this.oMetaModel.getObject(
|
|
972
|
-
"/$EntityContainer" + oObjectPage.contextPath + "@com.sap.vocabularies.Common.v1.DraftRoot"
|
|
973
|
-
) ||
|
|
974
|
-
this.oMetaModel.getObject(
|
|
975
|
-
"/$EntityContainer" + oObjectPage.contextPath + "@com.sap.vocabularies.Common.v1.DraftNode"
|
|
976
|
-
);
|
|
977
|
-
oObjectPage.technicalKeys = oObjectPage.entityType["$Key"];
|
|
978
|
-
oObjectPage.semanticKeys = this.oMetaModel.getObject(
|
|
979
|
-
"/$EntityContainer" + oObjectPage.contextPath + "/@com.sap.vocabularies.Common.v1.SemanticKey"
|
|
980
|
-
);
|
|
981
|
-
|
|
982
|
-
if (this._checkForKeys(oObjectPage.semanticKeys, oStartupParameters)) {
|
|
983
|
-
// make record if semantic keys are available in URL params
|
|
984
|
-
oObjectPage.isSemanticKeyNavigation = true;
|
|
985
|
-
aReachablePages.push(oObjectPage);
|
|
986
|
-
bFound = true;
|
|
987
|
-
break;
|
|
988
|
-
} else if (oObjectPage.level === 0 && this._checkForKeys(oObjectPage.technicalKeys, oStartupParameters)) {
|
|
989
|
-
// Support for Technical Keys for root level object page
|
|
990
|
-
oObjectPage.isSemanticKeyNavigation = false;
|
|
991
|
-
aReachablePages.push(oObjectPage);
|
|
992
|
-
bFound = true;
|
|
993
|
-
break;
|
|
994
|
-
}
|
|
995
|
-
}
|
|
996
|
-
|
|
997
|
-
++iLevel;
|
|
998
|
-
}
|
|
999
|
-
|
|
1000
|
-
return aReachablePages;
|
|
1001
|
-
},
|
|
846
|
+
_manageDeepLinkStartup: function(oStartupParameters) {
|
|
847
|
+
var that = this;
|
|
1002
848
|
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
if (!sProperty) {
|
|
1018
|
-
// Technical Keys Scenario
|
|
1019
|
-
sProperty = aKeys[j];
|
|
1020
|
-
if (sProperty === "IsActiveEntity") {
|
|
1021
|
-
oDraftDetail = false;
|
|
849
|
+
return AppStartupHelper.getDeepLinkStartupHash(
|
|
850
|
+
this.oAppComponent.getManifest()["sap.ui5"].routing,
|
|
851
|
+
oStartupParameters,
|
|
852
|
+
this.oModel
|
|
853
|
+
).then(function(oDeepLink) {
|
|
854
|
+
var sHash;
|
|
855
|
+
if (oDeepLink.context) {
|
|
856
|
+
var sTechnicalPath = oDeepLink.context.getPath(),
|
|
857
|
+
sSemanticPath = SemanticKeyHelper.getSemanticPath(oDeepLink.context);
|
|
858
|
+
|
|
859
|
+
if (sSemanticPath !== sTechnicalPath) {
|
|
860
|
+
// Store the mapping technical <-> semantic path to avoid recalculating it later
|
|
861
|
+
// and use the semantic path instead of the technical one
|
|
862
|
+
that.setLastSemanticMapping({ technicalPath: sTechnicalPath, semanticPath: sSemanticPath });
|
|
1022
863
|
}
|
|
1023
|
-
}
|
|
1024
|
-
var sValue = oStartUpParameters[sProperty][0];
|
|
1025
|
-
if (sValue) {
|
|
1026
|
-
aFilters.push(
|
|
1027
|
-
new Filter({
|
|
1028
|
-
path: sProperty,
|
|
1029
|
-
operator: FilterOperator.EQ,
|
|
1030
|
-
value1: sValue,
|
|
1031
|
-
caseSensitive: bFilteringCaseSensitive
|
|
1032
|
-
})
|
|
1033
|
-
);
|
|
1034
|
-
} else {
|
|
1035
|
-
return undefined;
|
|
1036
|
-
}
|
|
1037
|
-
}
|
|
1038
|
-
if (oDraftDetail) {
|
|
1039
|
-
var oDraftFilter = new Filter({
|
|
1040
|
-
filters: [new Filter("IsActiveEntity", "EQ", false), new Filter("SiblingEntity/IsActiveEntity", "EQ", null)],
|
|
1041
|
-
and: false
|
|
1042
|
-
});
|
|
1043
|
-
aFilters.push(oDraftFilter);
|
|
1044
|
-
}
|
|
1045
|
-
var oCompleteFilter = new Filter(aFilters, true);
|
|
1046
|
-
return oCompleteFilter;
|
|
1047
|
-
},
|
|
1048
864
|
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
* @param {Array} aKeys Array of semantic keys or technical keys of the page
|
|
1053
|
-
* @param {object} oParameters URL parameters
|
|
1054
|
-
* @returns {boolean} True if Semantic Keys are available in URL
|
|
1055
|
-
*/
|
|
1056
|
-
_checkForKeys: function(aKeys, oParameters) {
|
|
1057
|
-
if (aKeys && aKeys.length) {
|
|
1058
|
-
for (var j = 0; j < aKeys.length; j++) {
|
|
1059
|
-
var sPropertyPath = aKeys[j].$PropertyPath;
|
|
1060
|
-
if (!sPropertyPath) {
|
|
1061
|
-
// Technical Keys do not require $ProperyPath
|
|
1062
|
-
sPropertyPath = aKeys[j];
|
|
1063
|
-
}
|
|
1064
|
-
var aPropertyValue = oParameters[sPropertyPath];
|
|
1065
|
-
if (!aPropertyValue || (aPropertyValue && aPropertyValue.length > 1)) {
|
|
1066
|
-
return false;
|
|
1067
|
-
}
|
|
865
|
+
sHash = sSemanticPath.substring(1); // To remove the leading '/'
|
|
866
|
+
} else if (oDeepLink.hash) {
|
|
867
|
+
sHash = oDeepLink.hash;
|
|
1068
868
|
}
|
|
1069
|
-
return true;
|
|
1070
|
-
}
|
|
1071
|
-
return false;
|
|
1072
|
-
},
|
|
1073
|
-
|
|
1074
|
-
_buildStartupHash: function(aReachablePages, aContexts) {
|
|
1075
|
-
var sHash;
|
|
1076
869
|
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
var sTechnicalPath = aContexts[0].getPath(),
|
|
1081
|
-
sSemanticPath = SemanticKeyHelper.getSemanticPath(aContexts[0]);
|
|
1082
|
-
|
|
1083
|
-
if (sSemanticPath !== sTechnicalPath) {
|
|
1084
|
-
// Store the mapping technical <-> semantic path to avoid recalculating it later
|
|
1085
|
-
// and use the semantic path instead of the technical one
|
|
1086
|
-
this.setLastSemanticMapping({ technicalPath: sTechnicalPath, semanticPath: sSemanticPath });
|
|
870
|
+
if (sHash) {
|
|
871
|
+
//Replace the hash with newly created hash
|
|
872
|
+
that.oRouter.getHashChanger().replaceHash(sHash);
|
|
1087
873
|
}
|
|
1088
|
-
|
|
1089
|
-
sHash = sSemanticPath.substring(1); // To remove the leading '/'
|
|
1090
|
-
} else if (aContexts.length > 1) {
|
|
1091
|
-
// Navigation to a deeper level --> use the pattern of the deepest object page
|
|
1092
|
-
// and replace the parameters by the ID from the contexts
|
|
1093
|
-
var aParts = aReachablePages[aReachablePages.length - 1].pattern.split("/");
|
|
1094
|
-
|
|
1095
|
-
sHash = aParts
|
|
1096
|
-
.map(function(sPart, iIndex) {
|
|
1097
|
-
var sKey = sPart.split("(")[0];
|
|
1098
|
-
var sValue = aContexts[iIndex].getPath().split("(")[1];
|
|
1099
|
-
return sKey + "(" + sValue; // sValue contains the closing ')'
|
|
1100
|
-
})
|
|
1101
|
-
.join("/");
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
return sHash;
|
|
874
|
+
});
|
|
1105
875
|
},
|
|
1106
876
|
|
|
1107
877
|
getOutbounds: function() {
|