@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.
Files changed (207) hide show
  1. package/package.json +5 -5
  2. package/src/sap/fe/core/.library +1 -1
  3. package/src/sap/fe/core/AnnotationHelper.js +3 -3
  4. package/src/sap/fe/core/AppComponent.js +9 -44
  5. package/src/sap/fe/core/AppStateHandler.js +2 -2
  6. package/src/sap/fe/core/BaseController.js +1 -1
  7. package/src/sap/fe/core/BusyLocker.js +13 -1
  8. package/src/sap/fe/core/CommonUtils.js +129 -219
  9. package/src/sap/fe/core/ExtensionAPI.js +14 -6
  10. package/src/sap/fe/core/PageController.js +9 -35
  11. package/src/sap/fe/core/RouterProxy.js +79 -75
  12. package/src/sap/fe/core/Synchronization.js +1 -1
  13. package/src/sap/fe/core/TemplateComponent.js +16 -7
  14. package/src/sap/fe/core/TemplateModel.js +1 -1
  15. package/src/sap/fe/core/TransactionHelper.js +183 -65
  16. package/src/sap/fe/core/actions/draft.js +50 -23
  17. package/src/sap/fe/core/actions/messageHandling.js +86 -7
  18. package/src/sap/fe/core/actions/nonDraft.js +1 -1
  19. package/src/sap/fe/core/actions/operations.js +75 -33
  20. package/src/sap/fe/core/actions/sticky.js +1 -1
  21. package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +1 -1
  22. package/src/sap/fe/core/controllerextensions/EditFlow.js +276 -122
  23. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +1 -1
  24. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +14 -6
  25. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +90 -46
  26. package/src/sap/fe/core/controllerextensions/InternalRouting.js +234 -232
  27. package/src/sap/fe/core/controllerextensions/KPIManagement.js +539 -209
  28. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +550 -213
  29. package/src/sap/fe/core/controllerextensions/MassEdit.js +79 -0
  30. package/src/sap/fe/core/controllerextensions/MessageHandler.js +227 -103
  31. package/src/sap/fe/core/controllerextensions/PageReady.js +2 -2
  32. package/src/sap/fe/core/controllerextensions/PageReady.ts +3 -7
  33. package/src/sap/fe/core/controllerextensions/Paginator.js +38 -12
  34. package/src/sap/fe/core/controllerextensions/Placeholder.js +16 -19
  35. package/src/sap/fe/core/controllerextensions/Routing.js +17 -2
  36. package/src/sap/fe/core/controllerextensions/RoutingListener.js +1 -1
  37. package/src/sap/fe/core/controllerextensions/Share.js +20 -7
  38. package/src/sap/fe/core/controllerextensions/SideEffects.js +8 -9
  39. package/src/sap/fe/core/controllerextensions/SideEffects.ts +19 -17
  40. package/src/sap/fe/core/controllerextensions/ViewState.js +54 -9
  41. package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +40 -34
  42. package/src/sap/fe/core/controls/ActionParameterDialogValueHelp.fragment.xml +35 -0
  43. package/src/sap/fe/core/controls/CommandExecution.js +1 -1
  44. package/src/sap/fe/core/controls/ConditionalWrapper.js +1 -1
  45. package/src/sap/fe/core/controls/CustomQuickViewPage.js +110 -109
  46. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +7 -4
  47. package/src/sap/fe/core/controls/FieldWrapper.js +10 -4
  48. package/src/sap/fe/core/controls/FilterBar.js +1 -1
  49. package/src/sap/fe/core/controls/FormElementWrapper.js +1 -6
  50. package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +45 -0
  51. package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +1 -1
  52. package/src/sap/fe/core/controls/filterbar/FilterContainer.js +1 -1
  53. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +1 -1
  54. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +1 -1
  55. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +1 -1
  56. package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +106 -0
  57. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +78 -0
  58. package/src/sap/fe/core/converters/ConverterContext.js +13 -1
  59. package/src/sap/fe/core/converters/ConverterContext.ts +10 -0
  60. package/src/sap/fe/core/converters/ManifestSettings.js +2 -1
  61. package/src/sap/fe/core/converters/ManifestSettings.ts +7 -1
  62. package/src/sap/fe/core/converters/ManifestWrapper.js +18 -7
  63. package/src/sap/fe/core/converters/ManifestWrapper.ts +15 -6
  64. package/src/sap/fe/core/converters/MetaModelConverter.js +920 -882
  65. package/src/sap/fe/core/converters/MetaModelConverter.ts +829 -853
  66. package/src/sap/fe/core/converters/annotations/DataField.js +54 -4
  67. package/src/sap/fe/core/converters/annotations/DataField.ts +53 -3
  68. package/src/sap/fe/core/converters/common/AnnotationConverter.js +83 -48
  69. package/src/sap/fe/core/converters/controls/Common/Action.js +15 -3
  70. package/src/sap/fe/core/converters/controls/Common/Action.ts +12 -3
  71. package/src/sap/fe/core/converters/controls/Common/Chart.js +1 -3
  72. package/src/sap/fe/core/converters/controls/Common/Chart.ts +0 -2
  73. package/src/sap/fe/core/converters/controls/Common/Form.js +68 -21
  74. package/src/sap/fe/core/converters/controls/Common/Form.ts +60 -16
  75. package/src/sap/fe/core/converters/controls/Common/KPI.js +331 -248
  76. package/src/sap/fe/core/converters/controls/Common/KPI.ts +355 -287
  77. package/src/sap/fe/core/converters/controls/Common/Table.js +426 -332
  78. package/src/sap/fe/core/converters/controls/Common/Table.ts +516 -383
  79. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +468 -0
  80. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +609 -0
  81. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +30 -13
  82. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +31 -12
  83. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +2 -2
  84. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +1 -1
  85. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +15 -7
  86. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +27 -6
  87. package/src/sap/fe/core/converters/helpers/Aggregation.js +8 -1
  88. package/src/sap/fe/core/converters/helpers/Aggregation.ts +9 -1
  89. package/src/sap/fe/core/converters/helpers/BindingHelper.js +3 -2
  90. package/src/sap/fe/core/converters/helpers/BindingHelper.ts +2 -2
  91. package/src/sap/fe/core/converters/helpers/ID.js +9 -1
  92. package/src/sap/fe/core/converters/helpers/ID.ts +6 -2
  93. package/src/sap/fe/core/converters/helpers/IssueManager.js +7 -5
  94. package/src/sap/fe/core/converters/helpers/IssueManager.ts +6 -4
  95. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +2 -2
  96. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +1 -1
  97. package/src/sap/fe/core/converters/templates/ListReportConverter.js +34 -4
  98. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +36 -7
  99. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +2 -5
  100. package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +1 -2
  101. package/src/sap/fe/core/designtime/AppComponent.designtime.js +11 -2
  102. package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
  103. package/src/sap/fe/core/formatters/FPMFormatter.ts +8 -3
  104. package/src/sap/fe/core/formatters/TableFormatter.js +27 -4
  105. package/src/sap/fe/core/formatters/TableFormatter.ts +20 -3
  106. package/src/sap/fe/core/formatters/ValueFormatter.js +30 -5
  107. package/src/sap/fe/core/formatters/ValueFormatter.ts +25 -3
  108. package/src/sap/fe/core/fpm/Component.js +2 -2
  109. package/src/sap/fe/core/helpers/AppStartupHelper.js +359 -0
  110. package/src/sap/fe/core/helpers/AppStartupHelper.ts +388 -0
  111. package/src/sap/fe/core/helpers/BindingExpression.js +199 -111
  112. package/src/sap/fe/core/helpers/BindingExpression.ts +193 -102
  113. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +1 -1
  114. package/src/sap/fe/core/helpers/EditState.js +1 -1
  115. package/src/sap/fe/core/helpers/ExcelFormatHelper.js +1 -3
  116. package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
  117. package/src/sap/fe/core/helpers/KeepAliveHelper.js +211 -0
  118. package/src/sap/fe/core/helpers/KeepAliveHelper.ts +202 -0
  119. package/src/sap/fe/core/helpers/KeepAliveRefreshTypes.js +32 -0
  120. package/src/sap/fe/core/helpers/KeepAliveRefreshTypes.ts +36 -0
  121. package/src/sap/fe/core/helpers/MassEditHelper.js +678 -0
  122. package/src/sap/fe/core/helpers/ModelHelper.js +64 -1
  123. package/src/sap/fe/core/helpers/PasteHelper.js +7 -1
  124. package/src/sap/fe/core/helpers/SemanticDateOperators.js +1 -1
  125. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +1 -1
  126. package/src/sap/fe/core/helpers/StableIdHelper.js +2 -2
  127. package/src/sap/fe/core/helpers/StableIdHelper.ts +1 -1
  128. package/src/sap/fe/core/library.js +28 -2
  129. package/src/sap/fe/core/library.support.js +10 -4
  130. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +62 -0
  131. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +66 -0
  132. package/src/sap/fe/core/messagebundle.properties +67 -3
  133. package/src/sap/fe/core/messagebundle_ar.properties +40 -3
  134. package/src/sap/fe/core/messagebundle_bg.properties +40 -3
  135. package/src/sap/fe/core/messagebundle_ca.properties +41 -4
  136. package/src/sap/fe/core/messagebundle_cs.properties +41 -4
  137. package/src/sap/fe/core/messagebundle_cy.properties +40 -3
  138. package/src/sap/fe/core/messagebundle_da.properties +40 -3
  139. package/src/sap/fe/core/messagebundle_de.properties +40 -3
  140. package/src/sap/fe/core/messagebundle_el.properties +40 -3
  141. package/src/sap/fe/core/messagebundle_en.properties +37 -0
  142. package/src/sap/fe/core/messagebundle_en_GB.properties +37 -0
  143. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +37 -0
  144. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +46 -2
  145. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +44 -0
  146. package/src/sap/fe/core/messagebundle_es.properties +40 -3
  147. package/src/sap/fe/core/messagebundle_es_MX.properties +41 -4
  148. package/src/sap/fe/core/messagebundle_et.properties +40 -3
  149. package/src/sap/fe/core/messagebundle_fi.properties +40 -3
  150. package/src/sap/fe/core/messagebundle_fr.properties +41 -4
  151. package/src/sap/fe/core/messagebundle_fr_CA.properties +40 -3
  152. package/src/sap/fe/core/messagebundle_hi.properties +40 -3
  153. package/src/sap/fe/core/messagebundle_hr.properties +40 -3
  154. package/src/sap/fe/core/messagebundle_hu.properties +41 -4
  155. package/src/sap/fe/core/messagebundle_id.properties +42 -5
  156. package/src/sap/fe/core/messagebundle_it.properties +40 -3
  157. package/src/sap/fe/core/messagebundle_iw.properties +40 -3
  158. package/src/sap/fe/core/messagebundle_ja.properties +49 -12
  159. package/src/sap/fe/core/messagebundle_kk.properties +40 -3
  160. package/src/sap/fe/core/messagebundle_ko.properties +40 -3
  161. package/src/sap/fe/core/messagebundle_lt.properties +40 -3
  162. package/src/sap/fe/core/messagebundle_lv.properties +40 -3
  163. package/src/sap/fe/core/messagebundle_ms.properties +40 -3
  164. package/src/sap/fe/core/messagebundle_nl.properties +40 -3
  165. package/src/sap/fe/core/messagebundle_no.properties +40 -3
  166. package/src/sap/fe/core/messagebundle_pl.properties +40 -3
  167. package/src/sap/fe/core/messagebundle_pt.properties +42 -5
  168. package/src/sap/fe/core/messagebundle_pt_PT.properties +40 -3
  169. package/src/sap/fe/core/messagebundle_ro.properties +40 -3
  170. package/src/sap/fe/core/messagebundle_ru.properties +40 -3
  171. package/src/sap/fe/core/messagebundle_sh.properties +40 -3
  172. package/src/sap/fe/core/messagebundle_sk.properties +40 -3
  173. package/src/sap/fe/core/messagebundle_sl.properties +40 -3
  174. package/src/sap/fe/core/messagebundle_sv.properties +41 -4
  175. package/src/sap/fe/core/messagebundle_th.properties +40 -3
  176. package/src/sap/fe/core/messagebundle_tr.properties +40 -3
  177. package/src/sap/fe/core/messagebundle_uk.properties +40 -3
  178. package/src/sap/fe/core/messagebundle_vi.properties +40 -3
  179. package/src/sap/fe/core/messagebundle_zh_CN.properties +40 -3
  180. package/src/sap/fe/core/messagebundle_zh_TW.properties +40 -3
  181. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +1 -1
  182. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +1 -1
  183. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +4 -3
  184. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +3 -0
  185. package/src/sap/fe/core/services/NavigationServiceFactory.js +1 -1
  186. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +1 -1
  187. package/src/sap/fe/core/services/RoutingServiceFactory.js +98 -328
  188. package/src/sap/fe/core/services/ShellServicesFactory.js +31 -2
  189. package/src/sap/fe/core/services/ShellServicesFactory.ts +30 -1
  190. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +8 -5
  191. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +11 -6
  192. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +14 -5
  193. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +1 -1
  194. package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.js +38 -0
  195. package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.ts +18 -0
  196. package/src/sap/fe/core/templating/DataModelPathHelper.js +8 -37
  197. package/src/sap/fe/core/templating/DataModelPathHelper.ts +13 -33
  198. package/src/sap/fe/core/templating/DisplayModeFormatter.js +114 -0
  199. package/src/sap/fe/core/templating/DisplayModeFormatter.ts +86 -0
  200. package/src/sap/fe/core/templating/EntitySetHelper.js +86 -3
  201. package/src/sap/fe/core/templating/EntitySetHelper.ts +44 -0
  202. package/src/sap/fe/core/templating/FilterHelper.js +10 -7
  203. package/src/sap/fe/core/templating/FilterHelper.ts +8 -6
  204. package/src/sap/fe/core/templating/PropertyHelper.js +2 -2
  205. package/src/sap/fe/core/templating/PropertyHelper.ts +1 -1
  206. package/src/sap/fe/core/templating/UIFormatters.js +47 -107
  207. package/src/sap/fe/core/templating/UIFormatters.ts +76 -72
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * SAPUI5
3
- * (c) Copyright 2009-2021 SAP SE. All rights reserved.
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
- this.base
329
- .getView()
330
- .getController()
331
- .routing.onBeforeNavigation(oContextInfo)
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 oOut;
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(sTargetPath, oNavigationParameters.bActionCreate);
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
- * Builds a path with semantic keys from a path with technical keys.
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 oModel = this._oView.getModel(),
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 = checkPathForSemanticBookmarking(sCurrentHashNoParams, oMetaModel),
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 getTechnicalPathFromSemanticPath(sCurrentHashNoParams, oModel, aSemanticKeys).then(function(sTechnicalPath) {
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.getProperty(sContextPath + "/@com.sap.vocabularies.Common.v1.Messages/$Path");
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.getProperty(sContextPath + "/@com.sap.vocabularies.Common.v1.Messages/$Path");
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
- * Sets the current column of a FCL to fullscreen mode.
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 oContext = oSource.getBindingContext(),
918
- sNextLayout = oSource.getModel("fclhelper").getProperty("/actionButtonsInfo/exitFullScreen");
919
-
920
- var oRouterProxy = this._oRouterProxy;
921
- var sCurrentFocusedControlId = this.sCurrentFocusedControlId;
922
- this.base._routing
923
- .navigateToContext(oContext, { sLayout: sNextLayout })
924
- .then(function() {
925
- var oLastHistoryEntry = oRouterProxy.getLastHistoryEntry();
926
- oLastHistoryEntry.oLastFocusControl = Object.assign({}, oLastHistoryEntry.oLastFocusControl, {
927
- controlId: sCurrentFocusedControlId,
928
- focusInfo: { id: sCurrentFocusedControlId }
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
  /**