@sapui5/sap.fe.core 1.98.0 → 1.99.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 (231) hide show
  1. package/package.json +3 -2
  2. package/src/sap/fe/core/.library +1 -1
  3. package/src/sap/fe/core/AnnotationHelper.js +377 -405
  4. package/src/sap/fe/core/AnnotationHelper.ts +385 -0
  5. package/src/sap/fe/core/AppComponent.js +3 -2
  6. package/src/sap/fe/core/AppStateHandler.js +229 -181
  7. package/src/sap/fe/core/AppStateHandler.ts +171 -0
  8. package/src/sap/fe/core/BaseController.js +3 -2
  9. package/src/sap/fe/core/BusyLocker.js +105 -121
  10. package/src/sap/fe/core/BusyLocker.ts +98 -0
  11. package/src/sap/fe/core/CommonUtils.js +2073 -2399
  12. package/src/sap/fe/core/CommonUtils.ts +2078 -0
  13. package/src/sap/fe/core/ExtensionAPI.js +3 -2
  14. package/src/sap/fe/core/PageController.js +84 -125
  15. package/src/sap/fe/core/PageController.ts +101 -0
  16. package/src/sap/fe/core/RouterProxy.js +986 -823
  17. package/src/sap/fe/core/RouterProxy.ts +838 -0
  18. package/src/sap/fe/core/Synchronization.js +51 -35
  19. package/src/sap/fe/core/Synchronization.ts +29 -0
  20. package/src/sap/fe/core/TemplateComponent.js +173 -164
  21. package/src/sap/fe/core/TemplateComponent.ts +166 -0
  22. package/src/sap/fe/core/TemplateModel.js +97 -54
  23. package/src/sap/fe/core/TemplateModel.ts +63 -0
  24. package/src/sap/fe/core/TransactionHelper.js +1576 -1664
  25. package/src/sap/fe/core/TransactionHelper.ts +1706 -0
  26. package/src/sap/fe/core/actions/draft.js +559 -608
  27. package/src/sap/fe/core/actions/draft.ts +593 -0
  28. package/src/sap/fe/core/actions/messageHandling.js +545 -514
  29. package/src/sap/fe/core/actions/messageHandling.ts +532 -0
  30. package/src/sap/fe/core/actions/nonDraft.js +17 -19
  31. package/src/sap/fe/core/actions/nonDraft.ts +12 -0
  32. package/src/sap/fe/core/actions/operations.js +1074 -1215
  33. package/src/sap/fe/core/actions/operations.ts +1162 -0
  34. package/src/sap/fe/core/actions/sticky.js +102 -105
  35. package/src/sap/fe/core/actions/sticky.ts +102 -0
  36. package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +3 -2
  37. package/src/sap/fe/core/controllerextensions/EditFlow.js +54 -211
  38. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +3 -2
  39. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +279 -11
  40. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +8 -6
  41. package/src/sap/fe/core/controllerextensions/InternalRouting.js +47 -45
  42. package/src/sap/fe/core/controllerextensions/KPIManagement.js +2 -3
  43. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +29 -26
  44. package/src/sap/fe/core/controllerextensions/MassEdit.js +101 -8
  45. package/src/sap/fe/core/controllerextensions/MessageHandler.js +17 -8
  46. package/src/sap/fe/core/controllerextensions/PageReady.js +2 -2
  47. package/src/sap/fe/core/controllerextensions/PageReady.ts +12 -8
  48. package/src/sap/fe/core/controllerextensions/Paginator.js +3 -2
  49. package/src/sap/fe/core/controllerextensions/Placeholder.js +3 -2
  50. package/src/sap/fe/core/controllerextensions/Routing.js +9 -4
  51. package/src/sap/fe/core/controllerextensions/RoutingListener.js +3 -2
  52. package/src/sap/fe/core/controllerextensions/Share.js +3 -2
  53. package/src/sap/fe/core/controllerextensions/SideEffects.js +3 -3
  54. package/src/sap/fe/core/controllerextensions/SideEffects.ts +18 -18
  55. package/src/sap/fe/core/controllerextensions/ViewState.js +3 -2
  56. package/src/sap/fe/core/controls/CommandExecution.js +3 -2
  57. package/src/sap/fe/core/controls/ConditionalWrapper.js +3 -2
  58. package/src/sap/fe/core/controls/CustomQuickViewPage.js +3 -2
  59. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +3 -2
  60. package/src/sap/fe/core/controls/FieldWrapper.js +11 -22
  61. package/src/sap/fe/core/controls/FilterBar.js +3 -2
  62. package/src/sap/fe/core/controls/FormElementWrapper.js +3 -2
  63. package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +3 -2
  64. package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +1 -0
  65. package/src/sap/fe/core/controls/filterbar/FilterContainer.js +3 -2
  66. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +5 -4
  67. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -2
  68. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +3 -2
  69. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +3 -2
  70. package/src/sap/fe/core/converters/ConverterContext.js +2 -2
  71. package/src/sap/fe/core/converters/ConverterContext.ts +4 -3
  72. package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
  73. package/src/sap/fe/core/converters/ManifestSettings.ts +1 -0
  74. package/src/sap/fe/core/converters/ManifestWrapper.js +39 -26
  75. package/src/sap/fe/core/converters/ManifestWrapper.ts +9 -0
  76. package/src/sap/fe/core/converters/MetaModelConverter.js +11 -8
  77. package/src/sap/fe/core/converters/MetaModelConverter.ts +16 -16
  78. package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
  79. package/src/sap/fe/core/converters/TemplateConverter.ts +2 -2
  80. package/src/sap/fe/core/converters/common/AnnotationConverter.js +17 -13
  81. package/src/sap/fe/core/converters/controls/Common/Action.js +2 -2
  82. package/src/sap/fe/core/converters/controls/Common/Action.ts +2 -2
  83. package/src/sap/fe/core/converters/controls/Common/Chart.js +5 -3
  84. package/src/sap/fe/core/converters/controls/Common/Chart.ts +11 -3
  85. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +3 -3
  86. package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +2 -2
  87. package/src/sap/fe/core/converters/controls/Common/Form.js +4 -2
  88. package/src/sap/fe/core/converters/controls/Common/Form.ts +16 -2
  89. package/src/sap/fe/core/converters/controls/Common/Table.js +250 -146
  90. package/src/sap/fe/core/converters/controls/Common/Table.ts +300 -167
  91. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +115 -56
  92. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +120 -74
  93. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +467 -32
  94. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +483 -54
  95. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +6 -6
  96. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +9 -15
  97. package/src/sap/fe/core/converters/helpers/Aggregation.js +13 -5
  98. package/src/sap/fe/core/converters/helpers/Aggregation.ts +20 -5
  99. package/src/sap/fe/core/converters/helpers/IssueManager.js +4 -1
  100. package/src/sap/fe/core/converters/helpers/IssueManager.ts +3 -0
  101. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +4 -4
  102. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +3 -3
  103. package/src/sap/fe/core/converters/templates/ListReportConverter.js +13 -6
  104. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +26 -15
  105. package/src/sap/fe/core/designtime/AppComponent.designtime.js +3 -2
  106. package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
  107. package/src/sap/fe/core/formatters/CriticalityFormatter.ts +1 -1
  108. package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
  109. package/src/sap/fe/core/formatters/FPMFormatter.ts +4 -10
  110. package/src/sap/fe/core/formatters/KPIFormatter.js +1 -1
  111. package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -1
  112. package/src/sap/fe/core/formatters/TableFormatter.js +39 -28
  113. package/src/sap/fe/core/formatters/TableFormatter.ts +43 -28
  114. package/src/sap/fe/core/formatters/ValueFormatter.js +1 -1
  115. package/src/sap/fe/core/formatters/ValueFormatter.ts +7 -6
  116. package/src/sap/fe/core/fpm/Component.js +3 -2
  117. package/src/sap/fe/core/helpers/AppStartupHelper.js +2 -2
  118. package/src/sap/fe/core/helpers/AppStartupHelper.ts +7 -4
  119. package/src/sap/fe/core/helpers/BindingExpression.js +314 -355
  120. package/src/sap/fe/core/helpers/BindingExpression.ts +317 -391
  121. package/src/sap/fe/core/helpers/ClassSupport.js +27 -15
  122. package/src/sap/fe/core/helpers/ClassSupport.ts +31 -20
  123. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +63 -59
  124. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +56 -0
  125. package/src/sap/fe/core/helpers/EditState.js +81 -84
  126. package/src/sap/fe/core/helpers/EditState.ts +81 -0
  127. package/src/sap/fe/core/helpers/ExcelFormatHelper.js +62 -48
  128. package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +49 -0
  129. package/src/sap/fe/core/helpers/FPMHelper.js +52 -56
  130. package/src/sap/fe/core/helpers/FPMHelper.ts +62 -0
  131. package/src/sap/fe/core/helpers/KeepAliveHelper.js +3 -4
  132. package/src/sap/fe/core/helpers/KeepAliveHelper.ts +9 -9
  133. package/src/sap/fe/core/helpers/MassEditHelper.js +27 -18
  134. package/src/sap/fe/core/helpers/ModelHelper.js +229 -225
  135. package/src/sap/fe/core/helpers/ModelHelper.ts +227 -0
  136. package/src/sap/fe/core/helpers/PasteHelper.js +210 -132
  137. package/src/sap/fe/core/helpers/PasteHelper.ts +196 -0
  138. package/src/sap/fe/core/helpers/SemanticDateOperators.js +332 -313
  139. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +330 -0
  140. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +66 -67
  141. package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +73 -0
  142. package/src/sap/fe/core/helpers/StableIdHelper.js +4 -7
  143. package/src/sap/fe/core/helpers/StableIdHelper.ts +2 -6
  144. package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
  145. package/src/sap/fe/core/jsx-runtime/jsx.ts +1 -1
  146. package/src/sap/fe/core/library.js +4 -3
  147. package/src/sap/fe/core/library.support.js +3 -2
  148. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +1 -1
  149. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +1 -1
  150. package/src/sap/fe/core/messagebundle.properties +23 -10
  151. package/src/sap/fe/core/messagebundle_ar.properties +9 -0
  152. package/src/sap/fe/core/messagebundle_bg.properties +9 -0
  153. package/src/sap/fe/core/messagebundle_ca.properties +9 -0
  154. package/src/sap/fe/core/messagebundle_cs.properties +10 -1
  155. package/src/sap/fe/core/messagebundle_cy.properties +9 -0
  156. package/src/sap/fe/core/messagebundle_da.properties +9 -0
  157. package/src/sap/fe/core/messagebundle_de.properties +9 -0
  158. package/src/sap/fe/core/messagebundle_el.properties +9 -0
  159. package/src/sap/fe/core/messagebundle_en.properties +9 -0
  160. package/src/sap/fe/core/messagebundle_en_GB.properties +9 -0
  161. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +9 -0
  162. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +9 -0
  163. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +9 -0
  164. package/src/sap/fe/core/messagebundle_es.properties +9 -0
  165. package/src/sap/fe/core/messagebundle_es_MX.properties +9 -0
  166. package/src/sap/fe/core/messagebundle_et.properties +9 -0
  167. package/src/sap/fe/core/messagebundle_fi.properties +9 -0
  168. package/src/sap/fe/core/messagebundle_fr.properties +13 -4
  169. package/src/sap/fe/core/messagebundle_fr_CA.properties +15 -6
  170. package/src/sap/fe/core/messagebundle_hi.properties +15 -6
  171. package/src/sap/fe/core/messagebundle_hr.properties +15 -6
  172. package/src/sap/fe/core/messagebundle_hu.properties +9 -0
  173. package/src/sap/fe/core/messagebundle_id.properties +10 -1
  174. package/src/sap/fe/core/messagebundle_it.properties +9 -0
  175. package/src/sap/fe/core/messagebundle_iw.properties +9 -0
  176. package/src/sap/fe/core/messagebundle_ja.properties +9 -0
  177. package/src/sap/fe/core/messagebundle_kk.properties +15 -6
  178. package/src/sap/fe/core/messagebundle_ko.properties +9 -0
  179. package/src/sap/fe/core/messagebundle_lt.properties +9 -0
  180. package/src/sap/fe/core/messagebundle_lv.properties +15 -6
  181. package/src/sap/fe/core/messagebundle_ms.properties +14 -5
  182. package/src/sap/fe/core/messagebundle_nl.properties +9 -0
  183. package/src/sap/fe/core/messagebundle_no.properties +9 -0
  184. package/src/sap/fe/core/messagebundle_pl.properties +9 -0
  185. package/src/sap/fe/core/messagebundle_pt.properties +9 -0
  186. package/src/sap/fe/core/messagebundle_pt_PT.properties +9 -0
  187. package/src/sap/fe/core/messagebundle_ro.properties +9 -0
  188. package/src/sap/fe/core/messagebundle_ru.properties +9 -0
  189. package/src/sap/fe/core/messagebundle_sh.properties +11 -2
  190. package/src/sap/fe/core/messagebundle_sk.properties +9 -0
  191. package/src/sap/fe/core/messagebundle_sl.properties +15 -6
  192. package/src/sap/fe/core/messagebundle_sv.properties +9 -0
  193. package/src/sap/fe/core/messagebundle_th.properties +9 -0
  194. package/src/sap/fe/core/messagebundle_tr.properties +9 -0
  195. package/src/sap/fe/core/messagebundle_uk.properties +9 -0
  196. package/src/sap/fe/core/messagebundle_vi.properties +9 -0
  197. package/src/sap/fe/core/messagebundle_zh_CN.properties +9 -0
  198. package/src/sap/fe/core/messagebundle_zh_TW.properties +15 -6
  199. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +1 -1
  200. package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
  201. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +269 -202
  202. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +212 -0
  203. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +1 -1
  204. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +7 -6
  205. package/src/sap/fe/core/services/NavigationServiceFactory.js +406 -300
  206. package/src/sap/fe/core/services/NavigationServiceFactory.ts +316 -0
  207. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +149 -81
  208. package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +80 -0
  209. package/src/sap/fe/core/services/RoutingServiceFactory.js +987 -899
  210. package/src/sap/fe/core/services/RoutingServiceFactory.ts +898 -0
  211. package/src/sap/fe/core/services/ShellServicesFactory.js +1 -1
  212. package/src/sap/fe/core/services/ShellServicesFactory.ts +15 -10
  213. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +35 -81
  214. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +46 -94
  215. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +461 -487
  216. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +453 -0
  217. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +10 -8
  218. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +8 -0
  219. package/src/sap/fe/core/support/AnnotationIssue.support.js +15 -3
  220. package/src/sap/fe/core/support/AnnotationIssue.support.ts +16 -2
  221. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -2
  222. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.ts +1 -1
  223. package/src/sap/fe/core/templating/FieldControlHelper.js +8 -8
  224. package/src/sap/fe/core/templating/FieldControlHelper.ts +25 -7
  225. package/src/sap/fe/core/templating/FilterHelper.js +138 -72
  226. package/src/sap/fe/core/templating/FilterHelper.ts +139 -71
  227. package/src/sap/fe/core/templating/UIFormatters.js +31 -1
  228. package/src/sap/fe/core/templating/UIFormatters.ts +33 -2
  229. package/src/sap/fe/core/type/Email.js +1 -1
  230. package/src/sap/fe/core/type/Email.ts +4 -6
  231. package/ui5.yaml +0 -3
@@ -1,15 +1,19 @@
1
- import { ServiceFactory, Service, ServiceContext } from "sap/ui/core/service";
1
+ import ServiceFactory from "sap/ui/core/service/ServiceFactory";
2
+ import Service from "sap/ui/core/service/Service";
3
+ import { ServiceContext } from "sap/ui/core/service";
2
4
  import { ComplexType, ConverterOutput, EntityType, NavigationProperty, Property } from "@sap-ux/annotation-converter";
3
- import { Context, ODataMetaModel } from "sap/ui/model/odata/v4";
5
+ import Context from "sap/ui/model/odata/v4/Context";
6
+ import ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
4
7
  import { convertTypes, EnvironmentCapabilities } from "sap/fe/core/converters/MetaModelConverter";
5
8
  import { CommonAnnotationTypes, QualifiedName } from "@sap-ux/vocabularies-types/dist/generated/Common";
6
9
  import { Action, NavigationPropertyPath, PropertyPath } from "@sap-ux/vocabularies-types";
7
- import { Log } from "sap/base";
10
+ import Log from "sap/base/Log";
8
11
 
9
12
  type SideEffectsSettings = {};
10
13
 
11
14
  type SideEffectsTargetEntityType = {
12
15
  $NavigationPropertyPath: string;
16
+ $PropertyPath?: string;
13
17
  };
14
18
  type SideEffectsTarget = SideEffectsTargetEntityType | string;
15
19
 
@@ -70,11 +74,11 @@ type ExtractorPropertyInfo = {
70
74
  navigationPath?: string;
71
75
  };
72
76
 
73
- class SideEffectsService extends Service<SideEffectsSettings> {
77
+ export class SideEffectsService extends Service<SideEffectsSettings> {
74
78
  initPromise!: Promise<any>;
75
79
  _oSideEffectsType!: SideEffectsOriginRegistry;
76
80
  _oCapabilities!: EnvironmentCapabilities | undefined;
77
- _bInitialized!: Boolean;
81
+ _bInitialized!: boolean;
78
82
  // !: means that we know it will be assigned before usage
79
83
  init() {
80
84
  this._oSideEffectsType = {
@@ -123,7 +127,7 @@ class SideEffectsService extends Service<SideEffectsSettings> {
123
127
  * @param {object} oContext Context
124
128
  * @param {string} sGroupId The group ID to be used for the request
125
129
  */
126
- public executeAction(sTriggerAction: String, oContext: Context, sGroupId?: string) {
130
+ public executeAction(sTriggerAction: string, oContext: Context, sGroupId?: string) {
127
131
  const oTriggerAction: any = oContext.getModel().bindContext(sTriggerAction + "(...)", oContext);
128
132
  oTriggerAction.execute(sGroupId || (oContext as any).getBinding().getUpdateGroupId());
129
133
  }
@@ -284,7 +288,7 @@ class SideEffectsService extends Service<SideEffectsSettings> {
284
288
  .forEach(sAnnotationName => {
285
289
  const oSideEffects: ODataSideEffectsType = aSideEffects[sAnnotationName];
286
290
  if (oSideEffects.TriggerAction) {
287
- this.executeAction(oSideEffects.TriggerAction, oContext);
291
+ this.executeAction(oSideEffects.TriggerAction as string, oContext);
288
292
  }
289
293
  ((oSideEffects.TargetEntities as any[]) || [])
290
294
  .concat((oSideEffects.TargetProperties as any[]) || [])
@@ -315,7 +319,7 @@ class SideEffectsService extends Service<SideEffectsSettings> {
315
319
 
316
320
  /**
317
321
  * Adds the text properties required for SideEffects
318
- * If a property has an associated text then this text needs to be added as targetProperties.
322
+ * If a property has an associated text then this text needs to be added as targetProperties or targetEntities.
319
323
  *
320
324
  * @private
321
325
  * @ui5-restricted
@@ -324,7 +328,7 @@ class SideEffectsService extends Service<SideEffectsSettings> {
324
328
  * @returns {object} SideEffects definition with added text properties
325
329
  */
326
330
  private _addRequiredTextProperties(oSideEffect: BaseSideEffectsType, mEntityType: EntityType): BaseSideEffectsType {
327
- const aInitialProperties: string[] = (oSideEffect.TargetProperties || []) as string[],
331
+ const aInitialProperties: string[] = oSideEffect.TargetProperties || [],
328
332
  aEntitiesRequested: string[] = (oSideEffect.TargetEntities || []).map(navigation => navigation.$NavigationPropertyPath);
329
333
  let aDerivedProperties: ExtractorPropertyInfo[] = [];
330
334
 
@@ -342,18 +346,16 @@ class SideEffectsService extends Service<SideEffectsSettings> {
342
346
  (mTarget as NavigationProperty).targetType.entityProperties;
343
347
  if (aTargetEntityProperties) {
344
348
  if (bIsStarProperty) {
345
- if (aTargetEntityProperties) {
346
- // Add all required properties behind the *
347
- aEntitiesRequested.push(sNavigationPropertyPath);
348
- aDerivedProperties = aDerivedProperties.concat(
349
- aTargetEntityProperties.map(mProperty => {
350
- return {
351
- navigationPath: sRelativePath,
352
- property: mProperty
353
- };
354
- })
355
- );
356
- }
349
+ // Add all required properties behind the *
350
+ aEntitiesRequested.push(sNavigationPropertyPath);
351
+ aDerivedProperties = aDerivedProperties.concat(
352
+ aTargetEntityProperties.map(mProperty => {
353
+ return {
354
+ navigationPath: sRelativePath,
355
+ property: mProperty
356
+ };
357
+ })
358
+ );
357
359
  } else {
358
360
  aDerivedProperties.push({
359
361
  property: aTargetEntityProperties.find(
@@ -373,7 +375,8 @@ class SideEffectsService extends Service<SideEffectsSettings> {
373
375
  aDerivedProperties.forEach(mPropertyInfo => {
374
376
  if (mPropertyInfo.property) {
375
377
  const sTargetTextPath = (mPropertyInfo.property.annotations?.Common?.Text as any)?.path,
376
- sTextPathFromInitialEntity = mPropertyInfo.navigationPath + sTargetTextPath;
378
+ sTextPathFromInitialEntity = mPropertyInfo.navigationPath + sTargetTextPath,
379
+ sTargetCollectionPath = sTextPathFromInitialEntity.substring(0, sTextPathFromInitialEntity.lastIndexOf("/"));
377
380
  /**
378
381
  * The property Text must be added only if the property is
379
382
  * - not part of a star property (.i.e '*' or 'navigation/*') or a targeted Entity
@@ -383,11 +386,20 @@ class SideEffectsService extends Service<SideEffectsSettings> {
383
386
 
384
387
  if (
385
388
  sTargetTextPath &&
386
- aEntitiesRequested.indexOf(sTextPathFromInitialEntity.substring(0, sTextPathFromInitialEntity.lastIndexOf("/"))) ===
387
- -1 &&
389
+ aEntitiesRequested.indexOf(sTargetCollectionPath) === -1 &&
388
390
  aInitialProperties.indexOf(sTextPathFromInitialEntity) === -1
389
391
  ) {
390
- oSideEffect.TargetProperties.push(sTextPathFromInitialEntity);
392
+ // The Text association is added as TargetEntities if it's contained on a different entitySet and not a complexType
393
+ // Otherwise it's added as targetProperties
394
+ if (
395
+ sTargetTextPath.lastIndexOf("/") > -1 &&
396
+ mEntityType.resolvePath(sTargetCollectionPath)?._type === "NavigationProperty"
397
+ ) {
398
+ oSideEffect.TargetEntities.push({ $NavigationPropertyPath: sTargetCollectionPath });
399
+ aEntitiesRequested.push(sTargetCollectionPath);
400
+ } else {
401
+ oSideEffect.TargetProperties.push(sTextPathFromInitialEntity);
402
+ }
391
403
  }
392
404
  }
393
405
  });
@@ -404,22 +416,17 @@ class SideEffectsService extends Service<SideEffectsSettings> {
404
416
  * @private
405
417
  * @ui5-restricted
406
418
  * @param {object} oSideEffects SideEffects definition
407
- * @param {string} sEntityType Name of the entity type
419
+ * @param {object} mEntityType Entity type
408
420
  * @param {string} sBindingParameter Name of the binding parameter
409
421
  * @returns {object} SideEffects definition
410
422
  */
411
423
  private _convertSideEffects(
412
424
  oSideEffects: BaseSideEffectsType | BaseAnnotationSideEffectsType,
413
- sEntityType: string | undefined,
425
+ mEntityType: EntityType,
414
426
  sBindingParameter?: string
415
427
  ): ODataSideEffectsType {
416
- const mEntityType = (this.getConvertedMetaModel() as ConverterOutput).entityTypes.find(oEntityType => {
417
- return oEntityType.fullyQualifiedName === sEntityType;
418
- });
419
428
  const oTempSideEffects = this._removeBindingParameter(this._convertTargetsFormat(oSideEffects), sBindingParameter);
420
- return mEntityType
421
- ? this._replaceReferencedProperties(this._addRequiredTextProperties(oTempSideEffects, mEntityType), mEntityType)
422
- : oTempSideEffects;
429
+ return this._addRequiredTextProperties(oTempSideEffects, mEntityType);
423
430
  }
424
431
 
425
432
  /**
@@ -471,15 +478,13 @@ class SideEffectsService extends Service<SideEffectsSettings> {
471
478
  if (mEntityType) {
472
479
  const mCommonAnnotation: any = oSource.annotations?.Common || {};
473
480
  const mBindingParameter = ((oSource as Action).parameters || []).find(
474
- mParameter => mParameter.type === (mEntityType || oSource).fullyQualifiedName
481
+ mParameter => mParameter.type === mEntityType.fullyQualifiedName
475
482
  );
476
483
  const sBindingParameter = mBindingParameter ? mBindingParameter.fullyQualifiedName.split("/")[1] : "";
477
484
  Object.keys(mCommonAnnotation)
478
485
  .filter(sAnnotationName => mCommonAnnotation[sAnnotationName].$Type === CommonAnnotationTypes.SideEffectsType)
479
486
  .forEach(sAnnotationName => {
480
- aSideEffects.push(
481
- this._convertSideEffects(mCommonAnnotation[sAnnotationName], mEntityType.fullyQualifiedName, sBindingParameter)
482
- );
487
+ aSideEffects.push(this._convertSideEffects(mCommonAnnotation[sAnnotationName], mEntityType, sBindingParameter));
483
488
  });
484
489
  }
485
490
  }
@@ -551,59 +556,6 @@ class SideEffectsService extends Service<SideEffectsSettings> {
551
556
  );
552
557
  }
553
558
 
554
- /**
555
- * Replaces TargetProperties having reference to Source Properties for a SideEffects
556
- * If a SideEffects Source Property is an navigation entity reference, the SideEffects Target Properties cannot be a property of this navigation entity.
557
- * Indeed this configuration leads to error into the OData V4 Model since response cannot be processed because this would mean that we merge properties of the new target into the old target of the navigation property.
558
- * In order to request new value of these target properties the SideEffects will request for the entire Entity instead of just a set of properties.
559
- * For the first version, we remove all navigation properties and replace them by targetEntities. This change could be improved in next version.
560
- *
561
- * @private
562
- * @ui5-restricted
563
- * @param {object} oSideEffect SideEffects definition
564
- * @param {object} mEntityType Entity type
565
- * @returns {object} SideEffects definition without referenced target properties
566
- */
567
- private _replaceReferencedProperties(oSideEffect: BaseSideEffectsType, mEntityType: EntityType): BaseSideEffectsType {
568
- let bSideEffectsChanged: boolean = false;
569
- const aEntities: string[] =
570
- (oSideEffect.TargetEntities || []).map(mNavigation => {
571
- return mNavigation.$NavigationPropertyPath;
572
- }) || [],
573
- aProperties: string[] = [];
574
-
575
- oSideEffect.TargetProperties.forEach(sPropertyPath => {
576
- let bTargetChanged = false;
577
- const iLastPathSeparatorIndex = sPropertyPath.lastIndexOf("/");
578
- if (iLastPathSeparatorIndex !== -1) {
579
- const sNavigationPath = sPropertyPath.substring(0, iLastPathSeparatorIndex);
580
- const oTarget = mEntityType.resolvePath(sNavigationPath);
581
- if (oTarget && oTarget._type === "NavigationProperty") {
582
- //Test if it's not a property bound on complexType (_ComplexType/MyProperty)
583
- bSideEffectsChanged = true;
584
- bTargetChanged = true;
585
- if (!aEntities.includes(sNavigationPath)) {
586
- aEntities.push(sNavigationPath);
587
- }
588
- }
589
- }
590
- if (!bTargetChanged) {
591
- aProperties.push(sPropertyPath);
592
- }
593
- });
594
-
595
- if (bSideEffectsChanged) {
596
- oSideEffect.TargetProperties = aProperties;
597
- oSideEffect.TargetEntities = aEntities.map(sNavigationPath => {
598
- return {
599
- $NavigationPropertyPath: sNavigationPath
600
- };
601
- });
602
- }
603
-
604
- return oSideEffect;
605
- }
606
-
607
559
  /**
608
560
  * Gets SideEffects action type that come from an OData Service
609
561
  * Internal routine to get, from converted oData metaModel, SideEffects on actions
@@ -621,15 +573,15 @@ class SideEffectsService extends Service<SideEffectsSettings> {
621
573
  if (aActions) {
622
574
  Object.keys(aActions).forEach(sActionName => {
623
575
  const oAction = mEntityType.actions[sActionName];
624
- const triggerActions: String[] = [];
576
+ const triggerActions: string[] = [];
625
577
  let pathExpressions: SideEffectsTarget[] = [];
626
578
  let aTargets: SideEffectsTarget[] = [];
627
579
 
628
580
  this._getSideEffectsFromSource(oAction).forEach(oSideEffect => {
629
581
  const sTriggerAction = oSideEffect.TriggerAction;
630
582
  aTargets = aTargets.concat(oSideEffect.TargetEntities || []).concat((oSideEffect.TargetProperties as any[]) || []);
631
- if (sTriggerAction && triggerActions.indexOf(sTriggerAction) === -1) {
632
- triggerActions.push(sTriggerAction);
583
+ if (sTriggerAction && triggerActions.indexOf(sTriggerAction as string) === -1) {
584
+ triggerActions.push(sTriggerAction as string);
633
585
  }
634
586
  });
635
587
  pathExpressions = this._removeDuplicateTargets(aTargets);
@@ -664,7 +616,7 @@ class SideEffectsService extends Service<SideEffectsSettings> {
664
616
  }
665
617
 
666
618
  class SideEffectsServiceFactory extends ServiceFactory<SideEffectsSettings> {
667
- createInstance(oServiceContext: ServiceContext<SideEffectsSettings>) {
619
+ createInstance(oServiceContext: ServiceContext<SideEffectsSettings>): Promise<any> {
668
620
  const SideEffectsServiceService = new SideEffectsService(oServiceContext);
669
621
  return SideEffectsServiceService.initPromise;
670
622
  }