@sapui5/sap.fe.core 1.93.3 → 1.96.2

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 (182) hide show
  1. package/package.json +2 -2
  2. package/src/sap/fe/core/.library +1 -1
  3. package/src/sap/fe/core/AppComponent.js +9 -40
  4. package/src/sap/fe/core/BusyLocker.js +12 -0
  5. package/src/sap/fe/core/CommonUtils.js +430 -27
  6. package/src/sap/fe/core/ExtensionAPI.js +1 -1
  7. package/src/sap/fe/core/PageController.js +13 -2
  8. package/src/sap/fe/core/TemplateComponent.js +6 -0
  9. package/src/sap/fe/core/TransactionHelper.js +248 -170
  10. package/src/sap/fe/core/actions/draft.js +13 -1
  11. package/src/sap/fe/core/actions/operations.js +165 -45
  12. package/src/sap/fe/core/controllerextensions/EditFlow.js +56 -37
  13. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +13 -6
  14. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +127 -24
  15. package/src/sap/fe/core/controllerextensions/InternalRouting.js +183 -164
  16. package/src/sap/fe/core/controllerextensions/KPIManagement.js +834 -170
  17. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +890 -189
  18. package/src/sap/fe/core/controllerextensions/PageReady.js +48 -33
  19. package/src/sap/fe/core/controllerextensions/PageReady.ts +49 -14
  20. package/src/sap/fe/core/controllerextensions/Paginator.js +150 -0
  21. package/src/sap/fe/core/controllerextensions/Placeholder.js +133 -270
  22. package/src/sap/fe/core/controllerextensions/Share.js +31 -13
  23. package/src/sap/fe/core/controllerextensions/SideEffects.js +5 -6
  24. package/src/sap/fe/core/controllerextensions/SideEffects.ts +13 -12
  25. package/src/sap/fe/core/controllerextensions/ViewState.js +173 -6
  26. package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +39 -34
  27. package/src/sap/fe/core/controls/ActionParameterDialogValueHelp.fragment.xml +35 -0
  28. package/src/sap/fe/core/controls/ActionPartial.fragment.xml +1 -1
  29. package/src/sap/fe/core/controls/CustomQuickViewPage.js +3 -0
  30. package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +45 -0
  31. package/src/sap/fe/core/controls/filterbar/FilterContainer.js +15 -4
  32. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +250 -94
  33. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +129 -135
  34. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +325 -0
  35. package/src/sap/fe/core/converters/ConverterContext.js +19 -5
  36. package/src/sap/fe/core/converters/ConverterContext.ts +13 -3
  37. package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
  38. package/src/sap/fe/core/converters/ManifestSettings.ts +9 -2
  39. package/src/sap/fe/core/converters/ManifestWrapper.js +9 -9
  40. package/src/sap/fe/core/converters/MetaModelConverter.js +858 -871
  41. package/src/sap/fe/core/converters/MetaModelConverter.ts +763 -826
  42. package/src/sap/fe/core/converters/TemplateConverter.js +4 -4
  43. package/src/sap/fe/core/converters/annotations/DataField.js +57 -7
  44. package/src/sap/fe/core/converters/annotations/DataField.ts +52 -2
  45. package/src/sap/fe/core/converters/common/AnnotationConverter.js +80 -46
  46. package/src/sap/fe/core/converters/controls/Common/Action.js +56 -54
  47. package/src/sap/fe/core/converters/controls/Common/Action.ts +48 -36
  48. package/src/sap/fe/core/converters/controls/Common/Chart.js +101 -9
  49. package/src/sap/fe/core/converters/controls/Common/Chart.ts +100 -5
  50. package/src/sap/fe/core/converters/controls/Common/Criticality.js +1 -1
  51. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +15 -16
  52. package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +16 -30
  53. package/src/sap/fe/core/converters/controls/Common/Form.js +21 -12
  54. package/src/sap/fe/core/converters/controls/Common/Form.ts +28 -8
  55. package/src/sap/fe/core/converters/controls/Common/KPI.js +287 -109
  56. package/src/sap/fe/core/converters/controls/Common/KPI.ts +314 -139
  57. package/src/sap/fe/core/converters/controls/Common/Table.js +414 -171
  58. package/src/sap/fe/core/converters/controls/Common/Table.ts +412 -130
  59. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +487 -0
  60. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +541 -0
  61. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +364 -0
  62. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +338 -0
  63. package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.js +74 -0
  64. package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.ts +50 -0
  65. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +11 -11
  66. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +47 -35
  67. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +45 -29
  68. package/src/sap/fe/core/converters/helpers/Aggregation.js +31 -32
  69. package/src/sap/fe/core/converters/helpers/Aggregation.ts +26 -27
  70. package/src/sap/fe/core/converters/helpers/BindingHelper.js +27 -2
  71. package/src/sap/fe/core/converters/helpers/BindingHelper.ts +22 -2
  72. package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +1 -1
  73. package/src/sap/fe/core/converters/helpers/ID.js +1 -3
  74. package/src/sap/fe/core/converters/helpers/ID.ts +2 -3
  75. package/src/sap/fe/core/converters/helpers/IssueManager.js +5 -4
  76. package/src/sap/fe/core/converters/helpers/IssueManager.ts +4 -3
  77. package/src/sap/fe/core/converters/helpers/Key.js +3 -3
  78. package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.js +11 -6
  79. package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.ts +9 -5
  80. package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +18 -5
  81. package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +14 -14
  82. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +91 -20
  83. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +77 -5
  84. package/src/sap/fe/core/converters/templates/ListReportConverter.js +76 -714
  85. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +75 -807
  86. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +106 -17
  87. package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +121 -16
  88. package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
  89. package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
  90. package/src/sap/fe/core/formatters/FPMFormatter.ts +8 -3
  91. package/src/sap/fe/core/formatters/KPIFormatter.js +1 -1
  92. package/src/sap/fe/core/formatters/TableFormatter.js +1 -1
  93. package/src/sap/fe/core/formatters/TableFormatterTypes.js +1 -1
  94. package/src/sap/fe/core/formatters/ValueFormatter.js +1 -1
  95. package/src/sap/fe/core/fpm/Component.js +1 -1
  96. package/src/sap/fe/core/helpers/AnnotationEnum.js +3 -3
  97. package/src/sap/fe/core/helpers/BindingExpression.js +6 -6
  98. package/src/sap/fe/core/helpers/ClassSupport.js +4 -4
  99. package/src/sap/fe/core/helpers/ExcelFormatHelper.js +0 -2
  100. package/src/sap/fe/core/helpers/ModelHelper.js +27 -0
  101. package/src/sap/fe/core/helpers/PasteHelper.js +6 -0
  102. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +2 -2
  103. package/src/sap/fe/core/helpers/StableIdHelper.js +1 -1
  104. package/src/sap/fe/core/helpers/StableIdHelper.ts +1 -1
  105. package/src/sap/fe/core/jsx-runtime/jsx.js +2 -2
  106. package/src/sap/fe/core/jsx-runtime/jsxs.js +1 -1
  107. package/src/sap/fe/core/library.js +1 -1
  108. package/src/sap/fe/core/messagebundle.properties +30 -1
  109. package/src/sap/fe/core/messagebundle_ar.properties +43 -1
  110. package/src/sap/fe/core/messagebundle_bg.properties +42 -0
  111. package/src/sap/fe/core/messagebundle_ca.properties +44 -2
  112. package/src/sap/fe/core/messagebundle_cs.properties +42 -0
  113. package/src/sap/fe/core/messagebundle_cy.properties +42 -0
  114. package/src/sap/fe/core/messagebundle_da.properties +43 -1
  115. package/src/sap/fe/core/messagebundle_de.properties +45 -3
  116. package/src/sap/fe/core/messagebundle_el.properties +43 -1
  117. package/src/sap/fe/core/messagebundle_en.properties +42 -0
  118. package/src/sap/fe/core/messagebundle_en_GB.properties +43 -1
  119. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +43 -1
  120. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +48 -0
  121. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +42 -0
  122. package/src/sap/fe/core/messagebundle_es.properties +50 -8
  123. package/src/sap/fe/core/messagebundle_es_MX.properties +45 -3
  124. package/src/sap/fe/core/messagebundle_et.properties +42 -0
  125. package/src/sap/fe/core/messagebundle_fi.properties +42 -0
  126. package/src/sap/fe/core/messagebundle_fr.properties +51 -9
  127. package/src/sap/fe/core/messagebundle_fr_CA.properties +42 -0
  128. package/src/sap/fe/core/messagebundle_hi.properties +43 -1
  129. package/src/sap/fe/core/messagebundle_hr.properties +43 -1
  130. package/src/sap/fe/core/messagebundle_hu.properties +42 -0
  131. package/src/sap/fe/core/messagebundle_id.properties +43 -1
  132. package/src/sap/fe/core/messagebundle_it.properties +43 -1
  133. package/src/sap/fe/core/messagebundle_iw.properties +44 -2
  134. package/src/sap/fe/core/messagebundle_ja.properties +43 -1
  135. package/src/sap/fe/core/messagebundle_kk.properties +43 -1
  136. package/src/sap/fe/core/messagebundle_ko.properties +43 -1
  137. package/src/sap/fe/core/messagebundle_lt.properties +43 -1
  138. package/src/sap/fe/core/messagebundle_lv.properties +43 -1
  139. package/src/sap/fe/core/messagebundle_ms.properties +43 -1
  140. package/src/sap/fe/core/messagebundle_nl.properties +47 -5
  141. package/src/sap/fe/core/messagebundle_no.properties +44 -2
  142. package/src/sap/fe/core/messagebundle_pl.properties +43 -1
  143. package/src/sap/fe/core/messagebundle_pt.properties +43 -1
  144. package/src/sap/fe/core/messagebundle_pt_PT.properties +43 -1
  145. package/src/sap/fe/core/messagebundle_ro.properties +43 -1
  146. package/src/sap/fe/core/messagebundle_ru.properties +43 -1
  147. package/src/sap/fe/core/messagebundle_sh.properties +43 -1
  148. package/src/sap/fe/core/messagebundle_sk.properties +42 -0
  149. package/src/sap/fe/core/messagebundle_sl.properties +43 -1
  150. package/src/sap/fe/core/messagebundle_sv.properties +43 -1
  151. package/src/sap/fe/core/messagebundle_th.properties +42 -0
  152. package/src/sap/fe/core/messagebundle_tr.properties +42 -0
  153. package/src/sap/fe/core/messagebundle_uk.properties +42 -0
  154. package/src/sap/fe/core/messagebundle_vi.properties +43 -1
  155. package/src/sap/fe/core/messagebundle_zh_CN.properties +43 -1
  156. package/src/sap/fe/core/messagebundle_zh_TW.properties +43 -1
  157. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +5 -5
  158. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +5 -5
  159. package/src/sap/fe/core/services/RoutingServiceFactory.js +155 -76
  160. package/src/sap/fe/core/services/ShellServicesFactory.js +9 -9
  161. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +11 -12
  162. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +11 -1
  163. package/src/sap/fe/core/support/AnnotationIssue.support.js +2 -4
  164. package/src/sap/fe/core/support/CollectionFacetMissingID.support.js +2 -4
  165. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -4
  166. package/src/sap/fe/core/support/CommonHelper.js +2 -4
  167. package/src/sap/fe/core/support/Diagnostics.js +1 -1
  168. package/src/sap/fe/core/templating/CriticalityFormatters.js +4 -4
  169. package/src/sap/fe/core/templating/DataFieldFormatters.js +1 -1
  170. package/src/sap/fe/core/templating/DataModelPathHelper.js +54 -6
  171. package/src/sap/fe/core/templating/DataModelPathHelper.ts +54 -4
  172. package/src/sap/fe/core/templating/EntitySetHelper.js +13 -3
  173. package/src/sap/fe/core/templating/EntitySetHelper.ts +4 -0
  174. package/src/sap/fe/core/templating/FieldControlHelper.js +1 -1
  175. package/src/sap/fe/core/templating/FilterHelper.js +23 -5
  176. package/src/sap/fe/core/templating/FilterHelper.ts +15 -1
  177. package/src/sap/fe/core/templating/FilterTemplating.js +1 -1
  178. package/src/sap/fe/core/templating/PropertyFormatters.js +1 -1
  179. package/src/sap/fe/core/templating/PropertyHelper.js +8 -8
  180. package/src/sap/fe/core/templating/UIFormatters.js +72 -4
  181. package/src/sap/fe/core/templating/UIFormatters.ts +98 -3
  182. package/src/sap/fe/core/type/Email.js +1 -1
@@ -13,7 +13,8 @@ sap.ui.define(
13
13
  "sap/ui/core/Fragment",
14
14
  "sap/ui/model/json/JSONModel",
15
15
  "sap/base/Log",
16
- "sap/fe/core/CommonUtils"
16
+ "sap/fe/core/CommonUtils",
17
+ "sap/base/util/merge"
17
18
  ],
18
19
  function(
19
20
  ControllerExtension,
@@ -25,7 +26,8 @@ sap.ui.define(
25
26
  Fragment,
26
27
  JSONModel,
27
28
  Log,
28
- CommonUtils
29
+ CommonUtils,
30
+ mergeObjects
29
31
  ) {
30
32
  "use strict";
31
33
 
@@ -73,20 +75,27 @@ sap.ui.define(
73
75
  prepareFiltersForExternalNavigation: {
74
76
  "final": true,
75
77
  "public": true
78
+ },
79
+ getOutboundParams: {
80
+ "final": true,
81
+ "public": true
76
82
  }
77
83
  }
78
84
  },
79
85
  /**
80
- * Allows for Navigation to a given Intent(SemanticObject-Action) with the provided context.
81
- * If Semantic Object mapping is provided that is also applied to the Selection Variant after adaptation by a consumer.
86
+ * Enables intent-based navigation (SemanticObject-Action) with the provided context.
87
+ * If semantic object mapping is provided, this is also applied to the selection variant after the adaptation by a consumer.
82
88
  * This takes care of removing any technical parameters and determines if an explace or inplace navigation should take place.
83
89
  *
84
- * @param {string} sSemanticObject Semantic Object for the target app
90
+ * @param {string} sSemanticObject Semantic object for the target app
85
91
  * @param {string} sAction Action for the target app
86
92
  * @param {object} [mNavigationParameters] Optional parameters to be passed to the external navigation
87
- * @param {Array|object} [mNavigationParameters.navigationContexts] Single instance or multiple instances of {@link sap.ui.model.odata.v4.Context} or alternatively an object or array of objects to be passed to intent.
88
- * if an array of contexts is passed the context is used to determine the meta path and accordingly remove the sensitive data
89
- * if an array of objects is passed the following format is expected :
93
+ * @param {Array|object} [mNavigationParameters.navigationContexts] Uses one of the following to be passed to the intent:
94
+ * a single instance of {@link sap.ui.model.odata.v4.Context}
95
+ * multiple instances of {@link sap.ui.model.odata.v4.Context}
96
+ * an object or an array of objects
97
+ * If an array of objects is passed, the context is used to determine the metaPath and to remove any sensitive data
98
+ * If an array of objects is passed, the following format ix expected:
90
99
  * {
91
100
  * data: {
92
101
  * ProductID: 7634,
@@ -94,8 +103,9 @@ sap.ui.define(
94
103
  * },
95
104
  * metaPath: "/SalesOrderManage"
96
105
  * }
97
- * The metaPath is used to remove any sensitive data.
98
106
  * @param {string | object} [mNavigationParameters.semanticObjectMapping] String representation of the SemanticObjectMapping or SemanticObjectMapping that applies to this navigation
107
+ * @param {object} [mNavigationParameters.defaultRefreshStrategy] Default refresh strategy to be used in case no refresh strategy is specified for the intent in the view.
108
+ * @param {object} [mNavigationParameters.additionalNavigationParameters] Additional navigation parameters configured in the crossAppNavigation outbound parameters.
99
109
  **/
100
110
  navigate: function(sSemanticObject, sAction, mNavigationParameters) {
101
111
  var that = this;
@@ -104,10 +114,13 @@ sap.ui.define(
104
114
  aNavigationContexts =
105
115
  vNavigationContexts && !Array.isArray(vNavigationContexts) ? [vNavigationContexts] : vNavigationContexts,
106
116
  vSemanticObjectMapping = mNavigationParameters && mNavigationParameters.semanticObjectMapping,
117
+ vOutboundParams = mNavigationParameters && mNavigationParameters.additionalNavigationParameters,
107
118
  oTargetInfo = {
108
119
  semanticObject: sSemanticObject,
109
120
  action: sAction
110
- };
121
+ },
122
+ oView = that.base.getView(),
123
+ oController = oView.getController();
111
124
 
112
125
  if (oContext) {
113
126
  that._oView.setBindingContext(oContext);
@@ -161,27 +174,40 @@ sap.ui.define(
161
174
  oSelectionVariant.setFilterContextUrl(sContextUrl);
162
175
  }
163
176
 
177
+ // Apply Outbound Parameters to the SV
178
+ if (vOutboundParams) {
179
+ that._applyOutboundParams(oSelectionVariant, vOutboundParams);
180
+ }
181
+
164
182
  // 4. give an opportunity for the application to influence the SelectionVariant
165
- that.base
166
- .getView()
167
- .getController()
168
- .intentBasedNavigation.adaptNavigationContext(oSelectionVariant, oTargetInfo);
183
+ oController.intentBasedNavigation.adaptNavigationContext(oSelectionVariant, oTargetInfo);
169
184
 
170
185
  // 5. Apply semantic object mappings to the SV
171
186
  if (vSemanticObjectMapping) {
172
187
  that._applySemanticObjectMappings(oSelectionVariant, vSemanticObjectMapping);
173
188
  }
174
189
 
175
- // 6. remove tehnical parameters from Selection Variant
190
+ // 6. remove technical parameters from Selection Variant
176
191
  that._removeTechnicalParameters(oSelectionVariant);
177
192
 
178
193
  // 7. check if programming model is sticky and page is editable
179
- var sNavMode = that.base
180
- .getView()
181
- .getController()
182
- ._intentBasedNavigation.getNavigationMode();
194
+ var sNavMode = oController._intentBasedNavigation.getNavigationMode();
195
+
196
+ // 8. Updating refresh strategy in internal model
197
+ var mRefreshStrategies = (mNavigationParameters && mNavigationParameters.refreshStrategies) || {},
198
+ oInternalModel = oView.getModel("internal");
199
+ if (oInternalModel) {
200
+ if (oView && oView.getViewData().refreshStrategyOnAppRestore) {
201
+ var mViewRefreshStrategies = oView.getViewData().refreshStrategyOnAppRestore || {};
202
+ mergeObjects(mRefreshStrategies, mViewRefreshStrategies);
203
+ }
204
+ var mRefreshStrategy = CommonUtils.getRefreshStrategyForIntent(mRefreshStrategies, sSemanticObject, sAction);
205
+ if (mRefreshStrategy) {
206
+ oInternalModel.setProperty("/refreshStrategyOnAppRestore", mRefreshStrategy);
207
+ }
208
+ }
183
209
 
184
- // 7. Navigate via NavigationHandler
210
+ // 9. Navigate via NavigationHandler
185
211
  var onError = function() {
186
212
  sap.ui.require(["sap/m/MessageBox"], function(MessageBox) {
187
213
  var oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.fe.core");
@@ -425,7 +451,7 @@ sap.ui.define(
425
451
  * @returns {string}
426
452
  */
427
453
  getNavigationMode: function() {
428
- return "inplace";
454
+ return undefined;
429
455
  },
430
456
  /**
431
457
  * Allows for Navigation to a given Intent(SemanticObject-Action) with the provided context with a dialog showing the contexts which cannot be passed
@@ -640,7 +666,7 @@ sap.ui.define(
640
666
  }
641
667
  var sSemanticObject = oOutbound.semanticObject,
642
668
  sAction = oOutbound.action,
643
- outboundParams = oOutbound.parameters && this._getOutboundParams(oOutbound.parameters);
669
+ outboundParams = oOutbound.parameters && this.getOutboundParams(oOutbound.parameters);
644
670
 
645
671
  if (mNavigationParameters) {
646
672
  var aNavParams = [];
@@ -670,13 +696,29 @@ sap.ui.define(
670
696
  },
671
697
 
672
698
  /**
673
- * Gets parameters in app descriptor outbounds.
699
+ * Method to apply outbound parameters defined in the manifest.
700
+ * @param {object} oSelectionVariant SelectionVariant consisting of a filter bar, a table, and a page context
701
+ * @param {object} vOutboundParams Outbound Properties defined in the manifest
702
+ * @returns {object} - The modified SelectionVariant with outbound parameters.
703
+ */
704
+ _applyOutboundParams: function(oSelectionVariant, vOutboundParams) {
705
+ var aParameters = Object.keys(vOutboundParams);
706
+ var aSelectProperties = oSelectionVariant.getSelectOptionsPropertyNames();
707
+ aParameters.forEach(function(key) {
708
+ if (!aSelectProperties.includes(key)) {
709
+ oSelectionVariant.addSelectOption(key, "I", "EQ", vOutboundParams[key]);
710
+ }
711
+ });
712
+ return oSelectionVariant;
713
+ },
714
+ /**
715
+ * Method to get the outbound parameters defined in the manifest.
674
716
  *
675
717
  * @function
676
718
  * @param {object} [oOutboundParams] Parameters defined in the outbounds. Only "plain" is supported
677
719
  * @returns {Array} Parameters with the key-Value pair
678
720
  **/
679
- _getOutboundParams: function(oOutboundParams) {
721
+ getOutboundParams: function(oOutboundParams) {
680
722
  var oParamsMapping = {};
681
723
  if (oOutboundParams) {
682
724
  var aParameters = Object.keys(oOutboundParams) || [];
@@ -693,6 +735,67 @@ sap.ui.define(
693
735
  }
694
736
  return oParamsMapping;
695
737
  },
738
+
739
+ /**
740
+ * Triggers an outbound navigation when a user chooses the chevron.
741
+ *
742
+ * @param {object} oController
743
+ * @param {string} sOutboundTarget Name of the outbound target (needs to be defined in the manifest)
744
+ * @param {sap.ui.model.odata.v4.Context} oContext The context that contains the data for the target app
745
+ * @param {string} sCreatePath Create path when the chevron is created.
746
+ * @returns {Promise} Promise which is resolved once the navigation is triggered
747
+ */
748
+
749
+ onChevronPressNavigateOutBound: function(oController, sOutboundTarget, oContext, sCreatePath) {
750
+ var oOutbounds = oController
751
+ .getAppComponent()
752
+ .getRoutingService()
753
+ .getOutbounds(),
754
+ oDisplayOutbound = oOutbounds[sOutboundTarget],
755
+ additionalNavigationParameters;
756
+ if (oDisplayOutbound && oDisplayOutbound.semanticObject && oDisplayOutbound.action) {
757
+ var oRefreshStrategies = {
758
+ intents: {}
759
+ },
760
+ oDefaultRefreshStrategy = {},
761
+ sMetaPath;
762
+
763
+ if (oContext) {
764
+ if (oContext.isA && oContext.isA("sap.ui.model.odata.v4.Context")) {
765
+ sMetaPath = CommonUtils.getMetaPathForContext(oContext);
766
+ oContext = [oContext];
767
+ } else {
768
+ sMetaPath = CommonUtils.getMetaPathForContext(oContext[0]);
769
+ }
770
+ oDefaultRefreshStrategy[sMetaPath] = "self";
771
+ oRefreshStrategies["_feDefault"] = oDefaultRefreshStrategy;
772
+ }
773
+
774
+ if (sCreatePath) {
775
+ var sKey = oDisplayOutbound.semanticObject + "-" + oDisplayOutbound.action;
776
+ oRefreshStrategies.intents[sKey] = {};
777
+ oRefreshStrategies.intents[sKey][sCreatePath] = "self";
778
+ }
779
+ if (oDisplayOutbound && oDisplayOutbound.parameters) {
780
+ var oParams = oDisplayOutbound.parameters && this.getOutboundParams(oDisplayOutbound.parameters);
781
+ if (Object.keys(oParams).length > 0) {
782
+ additionalNavigationParameters = oParams;
783
+ }
784
+ }
785
+
786
+ oController._intentBasedNavigation.navigate(oDisplayOutbound.semanticObject, oDisplayOutbound.action, {
787
+ navigationContexts: oContext,
788
+ refreshStrategies: oRefreshStrategies,
789
+ additionalNavigationParameters: additionalNavigationParameters
790
+ });
791
+
792
+ //TODO: check why returning a promise is required
793
+ return Promise.resolve();
794
+ } else {
795
+ throw new Error("outbound target " + sOutboundTarget + " not found in cross navigation definition of manifest");
796
+ }
797
+ },
798
+
696
799
  override: {
697
800
  onInit: function() {
698
801
  this._oAppComponent = this.base.getAppComponent();