@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
|
[
|
|
@@ -38,158 +38,6 @@ sap.ui.define(
|
|
|
38
38
|
ModelHelper
|
|
39
39
|
) {
|
|
40
40
|
"use strict";
|
|
41
|
-
|
|
42
|
-
//////////////////////////////////////////////
|
|
43
|
-
// Helper functions for semantic keys
|
|
44
|
-
//////////////////////////////////////////////
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Creates the filter to retrieve a context corresponding to a semantic path.
|
|
48
|
-
*
|
|
49
|
-
* @param {string} sSemanticPath The semantic path
|
|
50
|
-
* @param {Array} aSemanticKeys The semantic keys for the path
|
|
51
|
-
* @param {object} oMetaModel The instance of the meta model
|
|
52
|
-
* @returns {sap.ui.model.Filter} The filter
|
|
53
|
-
*
|
|
54
|
-
* @ui5-restricted
|
|
55
|
-
*/
|
|
56
|
-
function createFilterFromSemanticPath(sSemanticPath, aSemanticKeys, oMetaModel) {
|
|
57
|
-
var aKeyValues = sSemanticPath.substring(sSemanticPath.indexOf("(") + 1, sSemanticPath.length - 1).split(","),
|
|
58
|
-
aFilters;
|
|
59
|
-
|
|
60
|
-
if (aSemanticKeys.length != aKeyValues.length) {
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
var bFilteringCaseSensitive = ModelHelper.isFilteringCaseSensitive(oMetaModel);
|
|
65
|
-
|
|
66
|
-
if (aSemanticKeys.length === 1) {
|
|
67
|
-
// Take the first key value
|
|
68
|
-
var sKeyValue = aKeyValues[0];
|
|
69
|
-
if (sKeyValue.indexOf("'") === 0 && sKeyValue.lastIndexOf("'") === sKeyValue.length - 1) {
|
|
70
|
-
// Remove the quotes from the value and decode special chars
|
|
71
|
-
sKeyValue = decodeURIComponent(sKeyValue.substring(1, sKeyValue.length - 1));
|
|
72
|
-
}
|
|
73
|
-
aFilters = [
|
|
74
|
-
new Filter({
|
|
75
|
-
path: aSemanticKeys[0].$PropertyPath,
|
|
76
|
-
operator: FilterOperator.EQ,
|
|
77
|
-
value1: sKeyValue,
|
|
78
|
-
caseSensitive: bFilteringCaseSensitive
|
|
79
|
-
})
|
|
80
|
-
];
|
|
81
|
-
} else {
|
|
82
|
-
var mKeyValues = {};
|
|
83
|
-
// Create a map of all key values
|
|
84
|
-
aKeyValues.forEach(function(sKeyAssignment) {
|
|
85
|
-
var aParts = sKeyAssignment.split("="),
|
|
86
|
-
sKeyValue = aParts[1];
|
|
87
|
-
|
|
88
|
-
if (sKeyValue.indexOf("'") === 0 && sKeyValue.lastIndexOf("'") === sKeyValue.length - 1) {
|
|
89
|
-
// Remove the quotes from the value and decode special chars
|
|
90
|
-
sKeyValue = decodeURIComponent(sKeyValue.substring(1, sKeyValue.length - 1));
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
mKeyValues[aParts[0]] = sKeyValue;
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
var bFailed = false;
|
|
97
|
-
aFilters = aSemanticKeys.map(function(oSemanticKey) {
|
|
98
|
-
var sKey = oSemanticKey.$PropertyPath,
|
|
99
|
-
sValue = mKeyValues[sKey];
|
|
100
|
-
|
|
101
|
-
if (sValue !== undefined) {
|
|
102
|
-
return new Filter({
|
|
103
|
-
path: sKey,
|
|
104
|
-
operator: FilterOperator.EQ,
|
|
105
|
-
value1: sValue,
|
|
106
|
-
caseSensitive: bFilteringCaseSensitive
|
|
107
|
-
});
|
|
108
|
-
} else {
|
|
109
|
-
bFailed = true;
|
|
110
|
-
return "XX";
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
if (bFailed) {
|
|
115
|
-
return null;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// Add a draft filter to make sure we take the draft entity if there is one
|
|
120
|
-
// Or the active entity otherwise
|
|
121
|
-
var oDraftFilter = new Filter({
|
|
122
|
-
filters: [new Filter("IsActiveEntity", "EQ", false), new Filter("SiblingEntity/IsActiveEntity", "EQ", null)],
|
|
123
|
-
and: false
|
|
124
|
-
});
|
|
125
|
-
aFilters.push(oDraftFilter);
|
|
126
|
-
|
|
127
|
-
var oCombinedFilter = new Filter(aFilters, true);
|
|
128
|
-
return oCombinedFilter;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Converts a path with semantic keys to a path with technical keys.
|
|
133
|
-
*
|
|
134
|
-
* @param {string} sSemanticPath The path with semantic keys
|
|
135
|
-
* @param {sap.ui.model.odata.v4.ODataModel} oModel The model for the path
|
|
136
|
-
* @param {Array} aSemanticKeys The semantic keys for the path
|
|
137
|
-
* @returns {Promise} A Promise containing the path with technical keys if sSemanticPath could be interpreted as a semantic path, null otherwise
|
|
138
|
-
*
|
|
139
|
-
* @ui5-restricted
|
|
140
|
-
*/
|
|
141
|
-
function getTechnicalPathFromSemanticPath(sSemanticPath, oModel, aSemanticKeys) {
|
|
142
|
-
var oMetaModel = oModel.getMetaModel(),
|
|
143
|
-
sEntitySetName = oMetaModel.getMetaContext(sSemanticPath).getPath();
|
|
144
|
-
|
|
145
|
-
if (!aSemanticKeys || aSemanticKeys.length === 0) {
|
|
146
|
-
// No semantic keys
|
|
147
|
-
return Promise.resolve(null);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// Create a set of filters corresponding to all keys
|
|
151
|
-
var oFilter = createFilterFromSemanticPath(sSemanticPath, aSemanticKeys, oMetaModel);
|
|
152
|
-
if (oFilter === null) {
|
|
153
|
-
// Couldn't interpret the path as a semantic one
|
|
154
|
-
return Promise.resolve(null);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// Load the corresponding object
|
|
158
|
-
var oListBinding = oModel.bindList("/" + sEntitySetName, undefined, undefined, oFilter, { "$$groupId": "$auto.Heroes" });
|
|
159
|
-
|
|
160
|
-
return oListBinding.requestContexts(0, 2).then(function(oContexts) {
|
|
161
|
-
if (oContexts && oContexts.length) {
|
|
162
|
-
return oContexts[0].getPath();
|
|
163
|
-
} else {
|
|
164
|
-
// No data could be loaded
|
|
165
|
-
return null;
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* Checks if a path is eligible for semantic bookmarking.
|
|
172
|
-
*
|
|
173
|
-
* @param {string} sPath The path to test
|
|
174
|
-
* @param {sap.ui.model.odata.v4.ODataMetaModel} oMetaModel The associated metadata model
|
|
175
|
-
* @returns {boolean} `true` is the path is eligible
|
|
176
|
-
*
|
|
177
|
-
* @ui5-restricted
|
|
178
|
-
*/
|
|
179
|
-
function checkPathForSemanticBookmarking(sPath, oMetaModel) {
|
|
180
|
-
// Only path on root objects allow semantic bookmarking, i.e. sPath = xxx(yyy)
|
|
181
|
-
var aMatches = /^[\/]?(\w+)\([^\/]+\)$/.exec(sPath);
|
|
182
|
-
if (!aMatches) {
|
|
183
|
-
return false;
|
|
184
|
-
}
|
|
185
|
-
// Get the entitySet name
|
|
186
|
-
var sEntitySetPath = "/" + aMatches[1];
|
|
187
|
-
// Check the entity set supports draft (otherwise we don't support semantic bookmarking)
|
|
188
|
-
var oDraftRoot = oMetaModel.getObject(sEntitySetPath + "@com.sap.vocabularies.Common.v1.DraftRoot");
|
|
189
|
-
var oDraftNode = oMetaModel.getObject(sEntitySetPath + "@com.sap.vocabularies.Common.v1.DraftNode");
|
|
190
|
-
return oDraftRoot || oDraftNode ? true : false;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
41
|
/**
|
|
194
42
|
* {@link sap.ui.core.mvc.ControllerExtension Controller extension}
|
|
195
43
|
*
|
|
@@ -205,6 +53,7 @@ sap.ui.define(
|
|
|
205
53
|
metadata: {
|
|
206
54
|
methods: {
|
|
207
55
|
"navigateToTarget": { "public": true, "final": false },
|
|
56
|
+
"navigateToRoute": { "public": true, "final": false },
|
|
208
57
|
"byId": { "public": false },
|
|
209
58
|
"getView": { "public": false },
|
|
210
59
|
"onRouteMatched": { "public": true, "final": false, overrideExecution: OverrideExecution.After },
|
|
@@ -279,6 +128,18 @@ sap.ui.define(
|
|
|
279
128
|
this._oView.getViewData();
|
|
280
129
|
},
|
|
281
130
|
|
|
131
|
+
/**
|
|
132
|
+
* Navigates to the specified navigation target route.
|
|
133
|
+
*
|
|
134
|
+
* @param {string} [sTargetRouteName] Name of the target route
|
|
135
|
+
* @param {object} [oParameters] Parameters to be used with route to create the target hash
|
|
136
|
+
* @returns {Promise} Promise that is resolved when the navigation is finalized
|
|
137
|
+
* @ui5-restricted
|
|
138
|
+
*/
|
|
139
|
+
navigateToRoute: function(sTargetRouteName, oParameters) {
|
|
140
|
+
return this._oRoutingService.navigateToRoute(sTargetRouteName, oParameters);
|
|
141
|
+
},
|
|
142
|
+
|
|
282
143
|
/**
|
|
283
144
|
* Navigates to a specific context.
|
|
284
145
|
*
|
|
@@ -292,6 +153,16 @@ sap.ui.define(
|
|
|
292
153
|
var that = this;
|
|
293
154
|
var oContextInfo = {};
|
|
294
155
|
mParameters = mParameters || {};
|
|
156
|
+
|
|
157
|
+
//Setting shell back navigation to undefined only for draft applications
|
|
158
|
+
if (oContext.getModel() && oContext.getModel().getMetaModel) {
|
|
159
|
+
var bIsStickyMode = ModelHelper.isStickySessionSupported(oContext.getModel().getMetaModel());
|
|
160
|
+
if (!bIsStickyMode) {
|
|
161
|
+
CommonUtils.getAppComponent(that.getView())
|
|
162
|
+
.getShellServices()
|
|
163
|
+
.setBackNavigation();
|
|
164
|
+
}
|
|
165
|
+
}
|
|
295
166
|
if (oContext.isA("sap.ui.model.odata.v4.ODataListBinding")) {
|
|
296
167
|
if (mParameters.asyncContext) {
|
|
297
168
|
// the context is either created async (Promise)
|
|
@@ -306,7 +177,8 @@ sap.ui.define(
|
|
|
306
177
|
checkNoHashChange: mParameters.checkNoHashChange,
|
|
307
178
|
editable: mParameters.editable,
|
|
308
179
|
bPersistOPScroll: mParameters.bPersistOPScroll,
|
|
309
|
-
updateFCLLevel: mParameters.updateFCLLevel
|
|
180
|
+
updateFCLLevel: mParameters.updateFCLLevel,
|
|
181
|
+
bForceFocus: mParameters.bForceFocus
|
|
310
182
|
});
|
|
311
183
|
})
|
|
312
184
|
.catch(function(oError) {
|
|
@@ -319,17 +191,21 @@ sap.ui.define(
|
|
|
319
191
|
}
|
|
320
192
|
|
|
321
193
|
if (mParameters.callExtension) {
|
|
194
|
+
var oInternalModel = this._oView.getModel("internal");
|
|
195
|
+
oInternalModel.setProperty("/paginatorCurrentContext", null);
|
|
196
|
+
|
|
322
197
|
oContextInfo.sourceBindingContext = oContext.getObject();
|
|
323
198
|
oContextInfo.bindingContext = oContext;
|
|
324
199
|
if (mParameters.oEvent) {
|
|
325
200
|
oContextInfo.oEvent = mParameters.oEvent;
|
|
326
201
|
}
|
|
327
|
-
if
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
) {
|
|
202
|
+
// Storing the selected context to use it in internal route navigation if neccessary.
|
|
203
|
+
var bOverrideNav = this.base
|
|
204
|
+
.getView()
|
|
205
|
+
.getController()
|
|
206
|
+
.routing.onBeforeNavigation(oContextInfo);
|
|
207
|
+
if (bOverrideNav) {
|
|
208
|
+
oInternalModel.setProperty("/paginatorCurrentContext", oContext);
|
|
333
209
|
return Promise.resolve();
|
|
334
210
|
}
|
|
335
211
|
}
|
|
@@ -393,11 +269,11 @@ sap.ui.define(
|
|
|
393
269
|
navigateToMessagePage: function(sErrorMessage, mParameters) {
|
|
394
270
|
mParameters = mParameters || {};
|
|
395
271
|
if (this._oRouterProxy.getHash().indexOf("i-action=create") > -1) {
|
|
396
|
-
this._oRouterProxy.navToHash(this._oRoutingService.getDefaultCreateHash());
|
|
272
|
+
return this._oRouterProxy.navToHash(this._oRoutingService.getDefaultCreateHash());
|
|
397
273
|
} else {
|
|
398
274
|
mParameters.FCLLevel = this._getFCLLevel();
|
|
399
275
|
|
|
400
|
-
this._oAppComponent.getRootViewController().displayMessagePage(sErrorMessage, mParameters);
|
|
276
|
+
return this._oAppComponent.getRootViewController().displayMessagePage(sErrorMessage, mParameters);
|
|
401
277
|
}
|
|
402
278
|
},
|
|
403
279
|
|
|
@@ -472,11 +348,12 @@ sap.ui.define(
|
|
|
472
348
|
|
|
473
349
|
this.onRouteMatched();
|
|
474
350
|
|
|
475
|
-
var
|
|
351
|
+
var oModel = this._oView.getModel(),
|
|
352
|
+
oOut;
|
|
476
353
|
if (bDeferred) {
|
|
477
354
|
oOut = this._bindDeferred(sTarget, oNavigationParameters);
|
|
478
355
|
} else {
|
|
479
|
-
oOut = this._bindPage(sTarget, oNavigationParameters);
|
|
356
|
+
oOut = this._bindPage(sTarget, oModel, oNavigationParameters);
|
|
480
357
|
}
|
|
481
358
|
var that = this;
|
|
482
359
|
// eslint-disable-next-line promise/catch-or-return
|
|
@@ -504,7 +381,11 @@ sap.ui.define(
|
|
|
504
381
|
// TODO: currently the target component creates this document but we shall move this to
|
|
505
382
|
// a central place
|
|
506
383
|
if (this._oPageComponent && this._oPageComponent.createDeferredContext) {
|
|
507
|
-
this._oPageComponent.createDeferredContext(
|
|
384
|
+
this._oPageComponent.createDeferredContext(
|
|
385
|
+
sTargetPath,
|
|
386
|
+
oNavigationParameters.useContext,
|
|
387
|
+
oNavigationParameters.bActionCreate
|
|
388
|
+
);
|
|
508
389
|
}
|
|
509
390
|
}
|
|
510
391
|
|
|
@@ -527,19 +408,20 @@ sap.ui.define(
|
|
|
527
408
|
* Sets the binding context of the page from a path.
|
|
528
409
|
*
|
|
529
410
|
* @param {string} sTargetPath The path to the context
|
|
411
|
+
* @param {sap.ui.model.odata.v4.ODataModel} oModel The OData model
|
|
530
412
|
* @param {object} oNavigationParameters Navigation parameters
|
|
531
413
|
* @returns {Promise}
|
|
532
414
|
* @ui5-restricted
|
|
533
415
|
*/
|
|
534
|
-
_bindPage: function(sTargetPath, oNavigationParameters) {
|
|
416
|
+
_bindPage: function(sTargetPath, oModel, oNavigationParameters) {
|
|
535
417
|
var that = this;
|
|
536
418
|
|
|
537
419
|
if (sTargetPath === "") {
|
|
538
|
-
return Promise.resolve(this._bindPageToContext(null, oNavigationParameters));
|
|
420
|
+
return Promise.resolve(this._bindPageToContext(null, oModel, oNavigationParameters));
|
|
539
421
|
} else {
|
|
540
|
-
return this._resolveSemanticPath(sTargetPath)
|
|
422
|
+
return this._resolveSemanticPath(sTargetPath, oModel)
|
|
541
423
|
.then(function(sTechnicalPath) {
|
|
542
|
-
that._bindPageToPath(sTechnicalPath, oNavigationParameters);
|
|
424
|
+
that._bindPageToPath(sTechnicalPath, oModel, oNavigationParameters);
|
|
543
425
|
})
|
|
544
426
|
.catch(function(oError) {
|
|
545
427
|
// Error handling for erroneous metadata request
|
|
@@ -554,16 +436,163 @@ sap.ui.define(
|
|
|
554
436
|
},
|
|
555
437
|
|
|
556
438
|
/**
|
|
557
|
-
*
|
|
439
|
+
* Creates the filter to retrieve a context corresponding to a semantic path.
|
|
440
|
+
*
|
|
441
|
+
* @param {string} sSemanticPath The semantic path
|
|
442
|
+
* @param {Array} aSemanticKeys The semantic keys for the path
|
|
443
|
+
* @param {object} oMetaModel The instance of the meta model
|
|
444
|
+
* @returns {sap.ui.model.Filter} The filter
|
|
558
445
|
*
|
|
446
|
+
* @ui5-restricted
|
|
447
|
+
*/
|
|
448
|
+
_createFilterFromSemanticPath: function(sSemanticPath, aSemanticKeys, oMetaModel) {
|
|
449
|
+
var aKeyValues = sSemanticPath.substring(sSemanticPath.indexOf("(") + 1, sSemanticPath.length - 1).split(","),
|
|
450
|
+
aFilters;
|
|
451
|
+
|
|
452
|
+
if (aSemanticKeys.length != aKeyValues.length) {
|
|
453
|
+
return null;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
var bFilteringCaseSensitive = ModelHelper.isFilteringCaseSensitive(oMetaModel);
|
|
457
|
+
|
|
458
|
+
if (aSemanticKeys.length === 1) {
|
|
459
|
+
// Take the first key value
|
|
460
|
+
var sKeyValue = aKeyValues[0];
|
|
461
|
+
if (sKeyValue.indexOf("'") === 0 && sKeyValue.lastIndexOf("'") === sKeyValue.length - 1) {
|
|
462
|
+
// Remove the quotes from the value and decode special chars
|
|
463
|
+
sKeyValue = decodeURIComponent(sKeyValue.substring(1, sKeyValue.length - 1));
|
|
464
|
+
}
|
|
465
|
+
aFilters = [
|
|
466
|
+
new Filter({
|
|
467
|
+
path: aSemanticKeys[0].$PropertyPath,
|
|
468
|
+
operator: FilterOperator.EQ,
|
|
469
|
+
value1: sKeyValue,
|
|
470
|
+
caseSensitive: bFilteringCaseSensitive
|
|
471
|
+
})
|
|
472
|
+
];
|
|
473
|
+
} else {
|
|
474
|
+
var mKeyValues = {};
|
|
475
|
+
// Create a map of all key values
|
|
476
|
+
aKeyValues.forEach(function(sKeyAssignment) {
|
|
477
|
+
var aParts = sKeyAssignment.split("="),
|
|
478
|
+
sKeyValue = aParts[1];
|
|
479
|
+
|
|
480
|
+
if (sKeyValue.indexOf("'") === 0 && sKeyValue.lastIndexOf("'") === sKeyValue.length - 1) {
|
|
481
|
+
// Remove the quotes from the value and decode special chars
|
|
482
|
+
sKeyValue = decodeURIComponent(sKeyValue.substring(1, sKeyValue.length - 1));
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
mKeyValues[aParts[0]] = sKeyValue;
|
|
486
|
+
});
|
|
487
|
+
|
|
488
|
+
var bFailed = false;
|
|
489
|
+
aFilters = aSemanticKeys.map(function(oSemanticKey) {
|
|
490
|
+
var sKey = oSemanticKey.$PropertyPath,
|
|
491
|
+
sValue = mKeyValues[sKey];
|
|
492
|
+
|
|
493
|
+
if (sValue !== undefined) {
|
|
494
|
+
return new Filter({
|
|
495
|
+
path: sKey,
|
|
496
|
+
operator: FilterOperator.EQ,
|
|
497
|
+
value1: sValue,
|
|
498
|
+
caseSensitive: bFilteringCaseSensitive
|
|
499
|
+
});
|
|
500
|
+
} else {
|
|
501
|
+
bFailed = true;
|
|
502
|
+
return "XX";
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
|
|
506
|
+
if (bFailed) {
|
|
507
|
+
return null;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
// Add a draft filter to make sure we take the draft entity if there is one
|
|
512
|
+
// Or the active entity otherwise
|
|
513
|
+
var oDraftFilter = new Filter({
|
|
514
|
+
filters: [new Filter("IsActiveEntity", "EQ", false), new Filter("SiblingEntity/IsActiveEntity", "EQ", null)],
|
|
515
|
+
and: false
|
|
516
|
+
});
|
|
517
|
+
aFilters.push(oDraftFilter);
|
|
518
|
+
|
|
519
|
+
var oCombinedFilter = new Filter(aFilters, true);
|
|
520
|
+
return oCombinedFilter;
|
|
521
|
+
},
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* Converts a path with semantic keys to a path with technical keys.
|
|
525
|
+
*
|
|
526
|
+
* @param {string} sSemanticPath The path with semantic keys
|
|
527
|
+
* @param {sap.ui.model.odata.v4.ODataModel} oModel The model for the path
|
|
528
|
+
* @param {Array} aSemanticKeys The semantic keys for the path
|
|
529
|
+
* @returns {Promise} A Promise containing the path with technical keys if sSemanticPath could be interpreted as a semantic path, null otherwise
|
|
530
|
+
*
|
|
531
|
+
* @ui5-restricted
|
|
532
|
+
*/
|
|
533
|
+
_getTechnicalPathFromSemanticPath: function(sSemanticPath, oModel, aSemanticKeys) {
|
|
534
|
+
var oMetaModel = oModel.getMetaModel(),
|
|
535
|
+
sEntitySetName = oMetaModel.getMetaContext(sSemanticPath).getPath();
|
|
536
|
+
|
|
537
|
+
if (!aSemanticKeys || aSemanticKeys.length === 0) {
|
|
538
|
+
// No semantic keys
|
|
539
|
+
return Promise.resolve(null);
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
// Create a set of filters corresponding to all keys
|
|
543
|
+
var oFilter = this._createFilterFromSemanticPath(sSemanticPath, aSemanticKeys, oMetaModel);
|
|
544
|
+
if (oFilter === null) {
|
|
545
|
+
// Couldn't interpret the path as a semantic one
|
|
546
|
+
return Promise.resolve(null);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
// Load the corresponding object
|
|
550
|
+
var oListBinding = oModel.bindList("/" + sEntitySetName, undefined, undefined, oFilter, {
|
|
551
|
+
"$$groupId": "$auto.Heroes"
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
return oListBinding.requestContexts(0, 2).then(function(oContexts) {
|
|
555
|
+
if (oContexts && oContexts.length) {
|
|
556
|
+
return oContexts[0].getPath();
|
|
557
|
+
} else {
|
|
558
|
+
// No data could be loaded
|
|
559
|
+
return null;
|
|
560
|
+
}
|
|
561
|
+
});
|
|
562
|
+
},
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* Checks if a path is eligible for semantic bookmarking.
|
|
566
|
+
*
|
|
567
|
+
* @param {string} sPath The path to test
|
|
568
|
+
* @param {sap.ui.model.odata.v4.ODataMetaModel} oMetaModel The associated metadata model
|
|
569
|
+
* @returns {boolean} `true` if the path is eligible
|
|
570
|
+
*
|
|
571
|
+
* @ui5-restricted
|
|
572
|
+
*/
|
|
573
|
+
_checkPathForSemanticBookmarking: function(sPath, oMetaModel) {
|
|
574
|
+
// Only path on root objects allow semantic bookmarking, i.e. sPath = xxx(yyy)
|
|
575
|
+
var aMatches = /^[\/]?(\w+)\([^\/]+\)$/.exec(sPath);
|
|
576
|
+
if (!aMatches) {
|
|
577
|
+
return false;
|
|
578
|
+
}
|
|
579
|
+
// Get the entitySet name
|
|
580
|
+
var sEntitySetPath = "/" + aMatches[1];
|
|
581
|
+
// Check the entity set supports draft (otherwise we don't support semantic bookmarking)
|
|
582
|
+
var oDraftRoot = oMetaModel.getObject(sEntitySetPath + "@com.sap.vocabularies.Common.v1.DraftRoot");
|
|
583
|
+
var oDraftNode = oMetaModel.getObject(sEntitySetPath + "@com.sap.vocabularies.Common.v1.DraftNode");
|
|
584
|
+
return oDraftRoot || oDraftNode ? true : false;
|
|
585
|
+
},
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* Builds a path with semantic keys from a path with technical keys.
|
|
559
589
|
* @param {string} sPathToResolve The path to be transformed
|
|
590
|
+
* @param oModel
|
|
560
591
|
* @returns {Promise} String promise for the new path. If sPathToResolved couldn't be interpreted as a semantic path, it is returned as is.
|
|
561
|
-
*
|
|
562
592
|
* @ui5-restricted
|
|
563
593
|
*/
|
|
564
|
-
_resolveSemanticPath: function(sPathToResolve) {
|
|
565
|
-
var
|
|
566
|
-
oMetaModel = oModel.getMetaModel(),
|
|
594
|
+
_resolveSemanticPath: function(sPathToResolve, oModel) {
|
|
595
|
+
var oMetaModel = oModel.getMetaModel(),
|
|
567
596
|
oLastSemanticMapping = this._oRoutingService.getLastSemanticMapping(),
|
|
568
597
|
sCurrentHashNoParams = this._oRouter
|
|
569
598
|
.getHashChanger()
|
|
@@ -580,7 +609,7 @@ sap.ui.define(
|
|
|
580
609
|
if (sRootEntityName.indexOf("/") === 0) {
|
|
581
610
|
sRootEntityName = sRootEntityName.substring(1);
|
|
582
611
|
}
|
|
583
|
-
var bAllowSemanticBookmark =
|
|
612
|
+
var bAllowSemanticBookmark = this._checkPathForSemanticBookmarking(sCurrentHashNoParams, oMetaModel),
|
|
584
613
|
aSemanticKeys = bAllowSemanticBookmark && SemanticKeyHelper.getSemanticKeys(oMetaModel, sRootEntityName);
|
|
585
614
|
if (!aSemanticKeys) {
|
|
586
615
|
// No semantic keys available --> use the path as is
|
|
@@ -590,7 +619,9 @@ sap.ui.define(
|
|
|
590
619
|
return Promise.resolve(oLastSemanticMapping.technicalPath);
|
|
591
620
|
} else {
|
|
592
621
|
// We need resolve the semantic path to get the technical keys
|
|
593
|
-
return
|
|
622
|
+
return this._getTechnicalPathFromSemanticPath(sCurrentHashNoParams, oModel, aSemanticKeys).then(function(
|
|
623
|
+
sTechnicalPath
|
|
624
|
+
) {
|
|
594
625
|
if (sTechnicalPath && sTechnicalPath !== sPathToResolve) {
|
|
595
626
|
// The semantic path was resolved (otherwise keep the original value for target)
|
|
596
627
|
that._oRoutingService.setLastSemanticMapping({
|
|
@@ -609,11 +640,12 @@ sap.ui.define(
|
|
|
609
640
|
* Sets the binding context of the page from a path.
|
|
610
641
|
*
|
|
611
642
|
* @param {string} sTargetPath The path to build the context. Needs to contain technical keys only.
|
|
643
|
+
* @param {sap.ui.model.odata.v4.ODataModel} oModel The OData model
|
|
612
644
|
* @param {object} oNavigationParameters Navigation parameters
|
|
613
645
|
*
|
|
614
646
|
* @ui5-restricted
|
|
615
647
|
*/
|
|
616
|
-
_bindPageToPath: function(sTargetPath, oNavigationParameters) {
|
|
648
|
+
_bindPageToPath: function(sTargetPath, oModel, oNavigationParameters) {
|
|
617
649
|
var oCurrentContext = this._getBindingContext(),
|
|
618
650
|
sCurrentPath = oCurrentContext && oCurrentContext.getPath(),
|
|
619
651
|
oUseContext = oNavigationParameters.useContext;
|
|
@@ -627,10 +659,10 @@ sap.ui.define(
|
|
|
627
659
|
oTargetContext = oUseContext;
|
|
628
660
|
} else {
|
|
629
661
|
// Otherwise we need to create it from sTargetPath
|
|
630
|
-
oTargetContext = this._createBindingContext(sTargetPath);
|
|
662
|
+
oTargetContext = this._createBindingContext(sTargetPath, oModel);
|
|
631
663
|
}
|
|
632
664
|
if (oTargetContext !== oCurrentContext) {
|
|
633
|
-
this._bindPageToContext(oTargetContext, oNavigationParameters);
|
|
665
|
+
this._bindPageToContext(oTargetContext, oModel, oNavigationParameters);
|
|
634
666
|
}
|
|
635
667
|
} else if (!oNavigationParameters.bReasonIsIappState && EditState.isEditStateDirty()) {
|
|
636
668
|
this._refreshBindingContext(oCurrentContext);
|
|
@@ -641,11 +673,12 @@ sap.ui.define(
|
|
|
641
673
|
* Binds the page to a context.
|
|
642
674
|
*
|
|
643
675
|
* @param {sap.ui.model.odata.v4.Context} oContext Context to be bound
|
|
676
|
+
* @param {sap.ui.model.odata.v4.ODataModel} oModel The OData model
|
|
644
677
|
* @param {object} oNavigationParameters Navigation parameters
|
|
645
678
|
*
|
|
646
679
|
* @ui5-restricted
|
|
647
680
|
*/
|
|
648
|
-
_bindPageToContext: function(oContext, oNavigationParameters) {
|
|
681
|
+
_bindPageToContext: function(oContext, oModel, oNavigationParameters) {
|
|
649
682
|
var that = this;
|
|
650
683
|
if (!oContext) {
|
|
651
684
|
this.onBeforeBinding(null);
|
|
@@ -655,7 +688,7 @@ sap.ui.define(
|
|
|
655
688
|
|
|
656
689
|
if (!oContext.getBinding() || oContext.getBinding().isA("sap.ui.model.odata.v4.ODataListBinding")) {
|
|
657
690
|
// We need to recreate the context otherwise we get errors
|
|
658
|
-
oContext = this._createBindingContext(oContext.getPath());
|
|
691
|
+
oContext = this._createBindingContext(oContext.getPath(), oModel);
|
|
659
692
|
if (EditState.isEditStateDirty()) {
|
|
660
693
|
// TODO: as a workaround we invalidate the model cache while the app is dirty
|
|
661
694
|
// as the manage model sets the parent in an async task and the request side effects
|
|
@@ -684,17 +717,17 @@ sap.ui.define(
|
|
|
684
717
|
* Creates a binding context from a path.
|
|
685
718
|
*
|
|
686
719
|
* @param {string} sPath The path
|
|
720
|
+
* @param {sap.ui.model.odata.v4.ODataModel} oModel The OData model
|
|
687
721
|
* @returns {sap.ui.model.odata.v4.Context} Created context
|
|
688
722
|
*
|
|
689
723
|
* @ui5-restricted
|
|
690
724
|
*/
|
|
691
|
-
_createBindingContext: function(sPath) {
|
|
725
|
+
_createBindingContext: function(sPath, oModel) {
|
|
692
726
|
var oPageComponent = this._oPageComponent,
|
|
693
727
|
sEntitySet = oPageComponent && oPageComponent.getEntitySet && oPageComponent.getEntitySet(),
|
|
694
728
|
sContextPath =
|
|
695
729
|
(oPageComponent && oPageComponent.getContextPath && oPageComponent.getContextPath()) ||
|
|
696
730
|
(sEntitySet && "/" + sEntitySet),
|
|
697
|
-
oModel = this._oView.getModel(),
|
|
698
731
|
oMetaModel = oModel.getMetaModel(),
|
|
699
732
|
that = this,
|
|
700
733
|
mParameters = {
|
|
@@ -704,7 +737,7 @@ sap.ui.define(
|
|
|
704
737
|
};
|
|
705
738
|
|
|
706
739
|
if (sEntitySet) {
|
|
707
|
-
var sMessagesPath = oMetaModel.
|
|
740
|
+
var sMessagesPath = oMetaModel.getObject(sContextPath + "/@com.sap.vocabularies.Common.v1.Messages/$Path");
|
|
708
741
|
if (sMessagesPath) {
|
|
709
742
|
mParameters.$select = sMessagesPath;
|
|
710
743
|
}
|
|
@@ -813,7 +846,7 @@ sap.ui.define(
|
|
|
813
846
|
}
|
|
814
847
|
|
|
815
848
|
if (sContextPath) {
|
|
816
|
-
sMessagesPath = oMetaModel.
|
|
849
|
+
sMessagesPath = oMetaModel.getObject(sContextPath + "/@com.sap.vocabularies.Common.v1.Messages/$Path");
|
|
817
850
|
}
|
|
818
851
|
|
|
819
852
|
// binding of the context must have $$PatchWithoutSideEffects true, this bound context may be needed to be fetched from the dependent binding
|
|
@@ -878,59 +911,28 @@ sap.ui.define(
|
|
|
878
911
|
return this._oTargetInformation.FCLLevel;
|
|
879
912
|
},
|
|
880
913
|
|
|
881
|
-
overflowToolbarButtonHover: function() {
|
|
882
|
-
this.sCurrentFocusedControlId = sap.ui.getCore().getCurrentFocusedControlId();
|
|
883
|
-
},
|
|
884
914
|
/**
|
|
885
|
-
*
|
|
915
|
+
* Switches between column and full-screen mode when FCL is used.
|
|
886
916
|
*
|
|
887
917
|
* @ui5-restricted
|
|
888
918
|
*/
|
|
889
|
-
enterFullScreen: function() {
|
|
890
|
-
var oSource = this.base.getView();
|
|
891
|
-
var oContext = oSource.getBindingContext(),
|
|
892
|
-
sNextLayout = oSource.getModel("fclhelper").getProperty("/actionButtonsInfo/fullScreen");
|
|
893
|
-
|
|
894
|
-
var oRouterProxy = this._oRouterProxy;
|
|
895
|
-
var sCurrentFocusedControlId = this.sCurrentFocusedControlId;
|
|
896
|
-
this.base._routing
|
|
897
|
-
.navigateToContext(oContext, { sLayout: sNextLayout })
|
|
898
|
-
.then(function() {
|
|
899
|
-
var oLastHistoryEntry = oRouterProxy.getLastHistoryEntry();
|
|
900
|
-
oLastHistoryEntry.oLastFocusControl = Object.assign({}, oLastHistoryEntry.oLastFocusControl, {
|
|
901
|
-
controlId: sCurrentFocusedControlId,
|
|
902
|
-
focusInfo: { id: sCurrentFocusedControlId }
|
|
903
|
-
});
|
|
904
|
-
})
|
|
905
|
-
.catch(function() {
|
|
906
|
-
Log.warning("cannot set focus on last focused control");
|
|
907
|
-
});
|
|
908
|
-
},
|
|
909
919
|
|
|
910
|
-
|
|
911
|
-
* Exits fullscreen mode for the current column of a FCL.
|
|
912
|
-
*
|
|
913
|
-
* @ui5-restricted
|
|
914
|
-
*/
|
|
915
|
-
exitFullScreen: function() {
|
|
920
|
+
switchFullScreen: function() {
|
|
916
921
|
var oSource = this.base.getView();
|
|
917
|
-
var
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
.catch(function() {
|
|
932
|
-
Log.warning("cannot set focus on last focused control");
|
|
933
|
-
});
|
|
922
|
+
var oFCLHelperModel = oSource.getModel("fclhelper"),
|
|
923
|
+
bIsFullScreen = oFCLHelperModel.getProperty("/actionButtonsInfo/isFullScreen"),
|
|
924
|
+
sNextLayout = oFCLHelperModel.getProperty(
|
|
925
|
+
bIsFullScreen ? "/actionButtonsInfo/exitFullScreen" : "/actionButtonsInfo/fullScreen"
|
|
926
|
+
),
|
|
927
|
+
oRootViewController = this._oAppComponent.getRootViewController();
|
|
928
|
+
|
|
929
|
+
var oContext = oRootViewController.getRightmostContext
|
|
930
|
+
? oRootViewController.getRightmostContext()
|
|
931
|
+
: oSource.getBindingContext();
|
|
932
|
+
|
|
933
|
+
this.base._routing.navigateToContext(oContext, { sLayout: sNextLayout }).catch(function() {
|
|
934
|
+
Log.warning("cannot switch between column and fullscreen");
|
|
935
|
+
});
|
|
934
936
|
},
|
|
935
937
|
|
|
936
938
|
/**
|