@sapui5/sap.fe.core 1.97.0 → 1.99.1

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 (249) hide show
  1. package/package.json +5 -4
  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 +6 -3
  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 -2379
  12. package/src/sap/fe/core/CommonUtils.ts +2078 -0
  13. package/src/sap/fe/core/ExtensionAPI.js +16 -7
  14. package/src/sap/fe/core/PageController.js +84 -119
  15. package/src/sap/fe/core/PageController.ts +101 -0
  16. package/src/sap/fe/core/RouterProxy.js +986 -807
  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 -155
  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 +64 -0
  24. package/src/sap/fe/core/TransactionHelper.js +1576 -1579
  25. package/src/sap/fe/core/TransactionHelper.ts +1706 -0
  26. package/src/sap/fe/core/actions/draft.js +560 -581
  27. package/src/sap/fe/core/actions/draft.ts +594 -0
  28. package/src/sap/fe/core/actions/messageHandling.js +545 -511
  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 -1211
  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 +229 -260
  38. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +3 -2
  39. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +288 -13
  40. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +27 -23
  41. package/src/sap/fe/core/controllerextensions/InternalRouting.js +82 -46
  42. package/src/sap/fe/core/controllerextensions/KPIManagement.js +113 -25
  43. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +135 -44
  44. package/src/sap/fe/core/controllerextensions/MassEdit.js +172 -0
  45. package/src/sap/fe/core/controllerextensions/MessageHandler.js +22 -9
  46. package/src/sap/fe/core/controllerextensions/PageReady.js +3 -3
  47. package/src/sap/fe/core/controllerextensions/PageReady.ts +12 -8
  48. package/src/sap/fe/core/controllerextensions/Paginator.js +37 -9
  49. package/src/sap/fe/core/controllerextensions/Placeholder.js +8 -4
  50. package/src/sap/fe/core/controllerextensions/Routing.js +25 -5
  51. package/src/sap/fe/core/controllerextensions/RoutingListener.js +3 -2
  52. package/src/sap/fe/core/controllerextensions/Share.js +22 -8
  53. package/src/sap/fe/core/controllerextensions/SideEffects.js +9 -9
  54. package/src/sap/fe/core/controllerextensions/SideEffects.ts +22 -21
  55. package/src/sap/fe/core/controllerextensions/ViewState.js +3 -2
  56. package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +2 -1
  57. package/src/sap/fe/core/controls/CommandExecution.js +3 -2
  58. package/src/sap/fe/core/controls/ConditionalWrapper.js +3 -2
  59. package/src/sap/fe/core/controls/CustomQuickViewPage.js +3 -2
  60. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +9 -5
  61. package/src/sap/fe/core/controls/FieldWrapper.js +18 -23
  62. package/src/sap/fe/core/controls/FilterBar.js +3 -2
  63. package/src/sap/fe/core/controls/FormElementWrapper.js +3 -7
  64. package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +3 -2
  65. package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +2 -1
  66. package/src/sap/fe/core/controls/filterbar/FilterContainer.js +3 -2
  67. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +5 -4
  68. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -2
  69. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +3 -2
  70. package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +106 -0
  71. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +79 -0
  72. package/src/sap/fe/core/converters/ConverterContext.js +14 -2
  73. package/src/sap/fe/core/converters/ConverterContext.ts +14 -3
  74. package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
  75. package/src/sap/fe/core/converters/ManifestSettings.ts +4 -0
  76. package/src/sap/fe/core/converters/ManifestWrapper.js +56 -32
  77. package/src/sap/fe/core/converters/ManifestWrapper.ts +24 -6
  78. package/src/sap/fe/core/converters/MetaModelConverter.js +67 -6
  79. package/src/sap/fe/core/converters/MetaModelConverter.ts +70 -14
  80. package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
  81. package/src/sap/fe/core/converters/TemplateConverter.ts +2 -2
  82. package/src/sap/fe/core/converters/annotations/DataField.js +3 -3
  83. package/src/sap/fe/core/converters/annotations/DataField.ts +1 -1
  84. package/src/sap/fe/core/converters/common/AnnotationConverter.js +33 -21
  85. package/src/sap/fe/core/converters/controls/Common/Action.js +11 -2
  86. package/src/sap/fe/core/converters/controls/Common/Action.ts +8 -2
  87. package/src/sap/fe/core/converters/controls/Common/Chart.js +5 -3
  88. package/src/sap/fe/core/converters/controls/Common/Chart.ts +11 -3
  89. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +3 -3
  90. package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +2 -2
  91. package/src/sap/fe/core/converters/controls/Common/Form.js +20 -10
  92. package/src/sap/fe/core/converters/controls/Common/Form.ts +24 -4
  93. package/src/sap/fe/core/converters/controls/Common/KPI.js +69 -4
  94. package/src/sap/fe/core/converters/controls/Common/KPI.ts +72 -0
  95. package/src/sap/fe/core/converters/controls/Common/Table.js +390 -398
  96. package/src/sap/fe/core/converters/controls/Common/Table.ts +497 -484
  97. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +527 -0
  98. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +655 -0
  99. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +489 -37
  100. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +506 -58
  101. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +2 -2
  102. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +1 -1
  103. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +17 -9
  104. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +24 -9
  105. package/src/sap/fe/core/converters/helpers/Aggregation.js +18 -3
  106. package/src/sap/fe/core/converters/helpers/Aggregation.ts +28 -5
  107. package/src/sap/fe/core/converters/helpers/IssueManager.js +7 -1
  108. package/src/sap/fe/core/converters/helpers/IssueManager.ts +6 -0
  109. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +4 -4
  110. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +3 -3
  111. package/src/sap/fe/core/converters/templates/ListReportConverter.js +13 -6
  112. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +26 -15
  113. package/src/sap/fe/core/designtime/AppComponent.designtime.js +11 -2
  114. package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
  115. package/src/sap/fe/core/formatters/CriticalityFormatter.ts +1 -1
  116. package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
  117. package/src/sap/fe/core/formatters/FPMFormatter.ts +4 -10
  118. package/src/sap/fe/core/formatters/KPIFormatter.js +1 -1
  119. package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -1
  120. package/src/sap/fe/core/formatters/TableFormatter.js +39 -28
  121. package/src/sap/fe/core/formatters/TableFormatter.ts +43 -28
  122. package/src/sap/fe/core/formatters/ValueFormatter.js +30 -5
  123. package/src/sap/fe/core/formatters/ValueFormatter.ts +30 -7
  124. package/src/sap/fe/core/fpm/Component.js +3 -2
  125. package/src/sap/fe/core/helpers/AppStartupHelper.js +359 -0
  126. package/src/sap/fe/core/helpers/AppStartupHelper.ts +391 -0
  127. package/src/sap/fe/core/helpers/BindingExpression.js +484 -437
  128. package/src/sap/fe/core/helpers/BindingExpression.ts +480 -463
  129. package/src/sap/fe/core/helpers/ClassSupport.js +27 -15
  130. package/src/sap/fe/core/helpers/ClassSupport.ts +31 -20
  131. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +63 -59
  132. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +56 -0
  133. package/src/sap/fe/core/helpers/EditState.js +81 -84
  134. package/src/sap/fe/core/helpers/EditState.ts +81 -0
  135. package/src/sap/fe/core/helpers/ExcelFormatHelper.js +62 -48
  136. package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +49 -0
  137. package/src/sap/fe/core/helpers/FPMHelper.js +52 -56
  138. package/src/sap/fe/core/helpers/FPMHelper.ts +62 -0
  139. package/src/sap/fe/core/helpers/KeepAliveHelper.js +4 -5
  140. package/src/sap/fe/core/helpers/KeepAliveHelper.ts +10 -10
  141. package/src/sap/fe/core/helpers/MassEditHelper.js +687 -0
  142. package/src/sap/fe/core/helpers/ModelHelper.js +229 -225
  143. package/src/sap/fe/core/helpers/ModelHelper.ts +227 -0
  144. package/src/sap/fe/core/helpers/PasteHelper.js +210 -132
  145. package/src/sap/fe/core/helpers/PasteHelper.ts +196 -0
  146. package/src/sap/fe/core/helpers/SemanticDateOperators.js +332 -313
  147. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +330 -0
  148. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +66 -67
  149. package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +73 -0
  150. package/src/sap/fe/core/helpers/StableIdHelper.js +4 -7
  151. package/src/sap/fe/core/helpers/StableIdHelper.ts +2 -6
  152. package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
  153. package/src/sap/fe/core/jsx-runtime/jsx.ts +1 -1
  154. package/src/sap/fe/core/library.js +30 -3
  155. package/src/sap/fe/core/library.support.js +12 -5
  156. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +62 -0
  157. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +66 -0
  158. package/src/sap/fe/core/messagebundle.properties +61 -13
  159. package/src/sap/fe/core/messagebundle_ar.properties +33 -2
  160. package/src/sap/fe/core/messagebundle_bg.properties +33 -2
  161. package/src/sap/fe/core/messagebundle_ca.properties +33 -2
  162. package/src/sap/fe/core/messagebundle_cs.properties +34 -3
  163. package/src/sap/fe/core/messagebundle_cy.properties +33 -2
  164. package/src/sap/fe/core/messagebundle_da.properties +33 -2
  165. package/src/sap/fe/core/messagebundle_de.properties +33 -2
  166. package/src/sap/fe/core/messagebundle_el.properties +33 -2
  167. package/src/sap/fe/core/messagebundle_en.properties +32 -1
  168. package/src/sap/fe/core/messagebundle_en_GB.properties +32 -1
  169. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +36 -1
  170. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +33 -2
  171. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +33 -2
  172. package/src/sap/fe/core/messagebundle_es.properties +33 -2
  173. package/src/sap/fe/core/messagebundle_es_MX.properties +33 -2
  174. package/src/sap/fe/core/messagebundle_et.properties +33 -2
  175. package/src/sap/fe/core/messagebundle_fi.properties +34 -3
  176. package/src/sap/fe/core/messagebundle_fr.properties +38 -7
  177. package/src/sap/fe/core/messagebundle_fr_CA.properties +33 -2
  178. package/src/sap/fe/core/messagebundle_hi.properties +33 -2
  179. package/src/sap/fe/core/messagebundle_hr.properties +33 -2
  180. package/src/sap/fe/core/messagebundle_hu.properties +34 -3
  181. package/src/sap/fe/core/messagebundle_id.properties +36 -5
  182. package/src/sap/fe/core/messagebundle_it.properties +33 -2
  183. package/src/sap/fe/core/messagebundle_iw.properties +33 -2
  184. package/src/sap/fe/core/messagebundle_ja.properties +33 -2
  185. package/src/sap/fe/core/messagebundle_kk.properties +33 -2
  186. package/src/sap/fe/core/messagebundle_ko.properties +33 -2
  187. package/src/sap/fe/core/messagebundle_lt.properties +33 -2
  188. package/src/sap/fe/core/messagebundle_lv.properties +33 -2
  189. package/src/sap/fe/core/messagebundle_ms.properties +33 -2
  190. package/src/sap/fe/core/messagebundle_nl.properties +33 -2
  191. package/src/sap/fe/core/messagebundle_no.properties +33 -2
  192. package/src/sap/fe/core/messagebundle_pl.properties +33 -2
  193. package/src/sap/fe/core/messagebundle_pt.properties +34 -3
  194. package/src/sap/fe/core/messagebundle_pt_PT.properties +33 -2
  195. package/src/sap/fe/core/messagebundle_ro.properties +33 -2
  196. package/src/sap/fe/core/messagebundle_ru.properties +33 -2
  197. package/src/sap/fe/core/messagebundle_sh.properties +33 -2
  198. package/src/sap/fe/core/messagebundle_sk.properties +33 -2
  199. package/src/sap/fe/core/messagebundle_sl.properties +33 -2
  200. package/src/sap/fe/core/messagebundle_sv.properties +34 -3
  201. package/src/sap/fe/core/messagebundle_th.properties +33 -2
  202. package/src/sap/fe/core/messagebundle_tr.properties +33 -2
  203. package/src/sap/fe/core/messagebundle_uk.properties +33 -2
  204. package/src/sap/fe/core/messagebundle_vi.properties +33 -2
  205. package/src/sap/fe/core/messagebundle_zh_CN.properties +33 -2
  206. package/src/sap/fe/core/messagebundle_zh_TW.properties +33 -2
  207. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
  208. package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
  209. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +269 -202
  210. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +212 -0
  211. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +4 -3
  212. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +9 -5
  213. package/src/sap/fe/core/services/NavigationServiceFactory.js +406 -300
  214. package/src/sap/fe/core/services/NavigationServiceFactory.ts +316 -0
  215. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +149 -81
  216. package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +80 -0
  217. package/src/sap/fe/core/services/RoutingServiceFactory.js +987 -1152
  218. package/src/sap/fe/core/services/RoutingServiceFactory.ts +898 -0
  219. package/src/sap/fe/core/services/ShellServicesFactory.js +31 -2
  220. package/src/sap/fe/core/services/ShellServicesFactory.ts +45 -11
  221. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +42 -85
  222. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +57 -100
  223. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +461 -478
  224. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +453 -0
  225. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +10 -8
  226. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +8 -0
  227. package/src/sap/fe/core/support/AnnotationIssue.support.js +15 -3
  228. package/src/sap/fe/core/support/AnnotationIssue.support.ts +16 -2
  229. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -2
  230. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.ts +1 -1
  231. package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.js +38 -0
  232. package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.ts +18 -0
  233. package/src/sap/fe/core/templating/DataModelPathHelper.js +10 -48
  234. package/src/sap/fe/core/templating/DataModelPathHelper.ts +14 -46
  235. package/src/sap/fe/core/templating/DisplayModeFormatter.js +114 -0
  236. package/src/sap/fe/core/templating/DisplayModeFormatter.ts +86 -0
  237. package/src/sap/fe/core/templating/FieldControlHelper.js +8 -8
  238. package/src/sap/fe/core/templating/FieldControlHelper.ts +25 -7
  239. package/src/sap/fe/core/templating/FilterHelper.js +139 -70
  240. package/src/sap/fe/core/templating/FilterHelper.ts +140 -70
  241. package/src/sap/fe/core/templating/PropertyHelper.js +2 -2
  242. package/src/sap/fe/core/templating/PropertyHelper.ts +1 -1
  243. package/src/sap/fe/core/templating/UIFormatters.js +45 -110
  244. package/src/sap/fe/core/templating/UIFormatters.ts +39 -75
  245. package/src/sap/fe/core/type/Email.js +1 -1
  246. package/src/sap/fe/core/type/Email.ts +4 -6
  247. package/ui5.yaml +0 -3
  248. package/src/sap/fe/core/controls/filterbar.d.js +0 -8
  249. package/src/sap/fe/core/controls/filterbar.d.ts +0 -0
@@ -1,15 +1,19 @@
1
- import { ServiceFactory, Service, ServiceContext } from "sap/ui/core/service";
2
- import { ConverterOutput, EntityType, NavigationProperty, Property } from "@sap-ux/annotation-converter";
3
- import { Context, ODataMetaModel } from "sap/ui/model/odata/v4";
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";
4
+ import { ComplexType, ConverterOutput, EntityType, NavigationProperty, Property } from "@sap-ux/annotation-converter";
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
  }
@@ -259,6 +263,7 @@ class SideEffectsService extends Service<SideEffectsSettings> {
259
263
  public requestSideEffectsForNavigationProperty(sNavigationProperty: string, oContext: Context): Promise<any> {
260
264
  const sBaseEntityType = this.getEntityTypeFromContext(oContext);
261
265
  if (sBaseEntityType) {
266
+ const sNavigationPath = sNavigationProperty + "/";
262
267
  const aSideEffects = this.getODataEntitySideEffects(sBaseEntityType);
263
268
  let aTargets: SideEffectsTarget[] = [];
264
269
  Object.keys(aSideEffects)
@@ -267,9 +272,13 @@ class SideEffectsService extends Service<SideEffectsSettings> {
267
272
  sAnnotationName => {
268
273
  const oSideEffects: ODataSideEffectsType = aSideEffects[sAnnotationName];
269
274
  return (
270
- (oSideEffects.SourceProperties || []).some(
271
- oPropertyPath => oPropertyPath.value.indexOf(sNavigationProperty) > -1
272
- ) ||
275
+ (oSideEffects.SourceProperties || []).some(oPropertyPath => {
276
+ const sPropertyPath = oPropertyPath.value;
277
+ return (
278
+ sPropertyPath.startsWith(sNavigationPath) &&
279
+ sPropertyPath.replace(sNavigationPath, "").indexOf("/") === -1
280
+ );
281
+ }) ||
273
282
  (oSideEffects.SourceEntities || []).some(
274
283
  oNavigationPropertyPath => oNavigationPropertyPath.value === sNavigationProperty
275
284
  )
@@ -279,7 +288,7 @@ class SideEffectsService extends Service<SideEffectsSettings> {
279
288
  .forEach(sAnnotationName => {
280
289
  const oSideEffects: ODataSideEffectsType = aSideEffects[sAnnotationName];
281
290
  if (oSideEffects.TriggerAction) {
282
- this.executeAction(oSideEffects.TriggerAction, oContext);
291
+ this.executeAction(oSideEffects.TriggerAction as string, oContext);
283
292
  }
284
293
  ((oSideEffects.TargetEntities as any[]) || [])
285
294
  .concat((oSideEffects.TargetProperties as any[]) || [])
@@ -310,7 +319,7 @@ class SideEffectsService extends Service<SideEffectsSettings> {
310
319
 
311
320
  /**
312
321
  * Adds the text properties required for SideEffects
313
- * 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.
314
323
  *
315
324
  * @private
316
325
  * @ui5-restricted
@@ -319,7 +328,7 @@ class SideEffectsService extends Service<SideEffectsSettings> {
319
328
  * @returns {object} SideEffects definition with added text properties
320
329
  */
321
330
  private _addRequiredTextProperties(oSideEffect: BaseSideEffectsType, mEntityType: EntityType): BaseSideEffectsType {
322
- const aInitialProperties: string[] = (oSideEffect.TargetProperties || []) as string[],
331
+ const aInitialProperties: string[] = oSideEffect.TargetProperties || [],
323
332
  aEntitiesRequested: string[] = (oSideEffect.TargetEntities || []).map(navigation => navigation.$NavigationPropertyPath);
324
333
  let aDerivedProperties: ExtractorPropertyInfo[] = [];
325
334
 
@@ -333,22 +342,20 @@ class SideEffectsService extends Service<SideEffectsSettings> {
333
342
  // mTarget can be an entity type, navigationProperty or or a complexType
334
343
  const aTargetEntityProperties: Property[] =
335
344
  (mTarget as EntityType).entityProperties ||
336
- (mTarget as Property).targetType?.properties ||
345
+ ((mTarget as Property).targetType as ComplexType)?.properties ||
337
346
  (mTarget as NavigationProperty).targetType.entityProperties;
338
347
  if (aTargetEntityProperties) {
339
348
  if (bIsStarProperty) {
340
- if (aTargetEntityProperties) {
341
- // Add all required properties behind the *
342
- aEntitiesRequested.push(sNavigationPropertyPath);
343
- aDerivedProperties = aDerivedProperties.concat(
344
- aTargetEntityProperties.map(mProperty => {
345
- return {
346
- navigationPath: sRelativePath,
347
- property: mProperty
348
- };
349
- })
350
- );
351
- }
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
+ );
352
359
  } else {
353
360
  aDerivedProperties.push({
354
361
  property: aTargetEntityProperties.find(
@@ -368,7 +375,8 @@ class SideEffectsService extends Service<SideEffectsSettings> {
368
375
  aDerivedProperties.forEach(mPropertyInfo => {
369
376
  if (mPropertyInfo.property) {
370
377
  const sTargetTextPath = (mPropertyInfo.property.annotations?.Common?.Text as any)?.path,
371
- sTextPathFromInitialEntity = mPropertyInfo.navigationPath + sTargetTextPath;
378
+ sTextPathFromInitialEntity = mPropertyInfo.navigationPath + sTargetTextPath,
379
+ sTargetCollectionPath = sTextPathFromInitialEntity.substring(0, sTextPathFromInitialEntity.lastIndexOf("/"));
372
380
  /**
373
381
  * The property Text must be added only if the property is
374
382
  * - not part of a star property (.i.e '*' or 'navigation/*') or a targeted Entity
@@ -378,11 +386,20 @@ class SideEffectsService extends Service<SideEffectsSettings> {
378
386
 
379
387
  if (
380
388
  sTargetTextPath &&
381
- aEntitiesRequested.indexOf(sTextPathFromInitialEntity.substring(0, sTextPathFromInitialEntity.lastIndexOf("/"))) ===
382
- -1 &&
389
+ aEntitiesRequested.indexOf(sTargetCollectionPath) === -1 &&
383
390
  aInitialProperties.indexOf(sTextPathFromInitialEntity) === -1
384
391
  ) {
385
- 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
+ }
386
403
  }
387
404
  }
388
405
  });
@@ -399,22 +416,17 @@ class SideEffectsService extends Service<SideEffectsSettings> {
399
416
  * @private
400
417
  * @ui5-restricted
401
418
  * @param {object} oSideEffects SideEffects definition
402
- * @param {string} sEntityType Name of the entity type
419
+ * @param {object} mEntityType Entity type
403
420
  * @param {string} sBindingParameter Name of the binding parameter
404
421
  * @returns {object} SideEffects definition
405
422
  */
406
423
  private _convertSideEffects(
407
424
  oSideEffects: BaseSideEffectsType | BaseAnnotationSideEffectsType,
408
- sEntityType: string | undefined,
425
+ mEntityType: EntityType,
409
426
  sBindingParameter?: string
410
427
  ): ODataSideEffectsType {
411
- const mEntityType = (this.getConvertedMetaModel() as ConverterOutput).entityTypes.find(oEntityType => {
412
- return oEntityType.fullyQualifiedName === sEntityType;
413
- });
414
428
  const oTempSideEffects = this._removeBindingParameter(this._convertTargetsFormat(oSideEffects), sBindingParameter);
415
- return mEntityType
416
- ? this._replaceReferencedProperties(this._addRequiredTextProperties(oTempSideEffects, mEntityType), mEntityType)
417
- : oTempSideEffects;
429
+ return this._addRequiredTextProperties(oTempSideEffects, mEntityType);
418
430
  }
419
431
 
420
432
  /**
@@ -466,15 +478,13 @@ class SideEffectsService extends Service<SideEffectsSettings> {
466
478
  if (mEntityType) {
467
479
  const mCommonAnnotation: any = oSource.annotations?.Common || {};
468
480
  const mBindingParameter = ((oSource as Action).parameters || []).find(
469
- mParameter => mParameter.type === (mEntityType || oSource).fullyQualifiedName
481
+ mParameter => mParameter.type === mEntityType.fullyQualifiedName
470
482
  );
471
483
  const sBindingParameter = mBindingParameter ? mBindingParameter.fullyQualifiedName.split("/")[1] : "";
472
484
  Object.keys(mCommonAnnotation)
473
485
  .filter(sAnnotationName => mCommonAnnotation[sAnnotationName].$Type === CommonAnnotationTypes.SideEffectsType)
474
486
  .forEach(sAnnotationName => {
475
- aSideEffects.push(
476
- this._convertSideEffects(mCommonAnnotation[sAnnotationName], mEntityType.fullyQualifiedName, sBindingParameter)
477
- );
487
+ aSideEffects.push(this._convertSideEffects(mCommonAnnotation[sAnnotationName], mEntityType, sBindingParameter));
478
488
  });
479
489
  }
480
490
  }
@@ -514,7 +524,7 @@ class SideEffectsService extends Service<SideEffectsSettings> {
514
524
  mTarget = mTarget.map((mProperty: any) => {
515
525
  const bNavigationPropertyPath = mProperty.$NavigationPropertyPath !== undefined; // Need to test with undefined since mProperty.$NavigationPropertyPath could be "" (empty string)
516
526
  const sValue = (bNavigationPropertyPath ? mProperty.$NavigationPropertyPath : mProperty).replace(
517
- new RegExp("^" + sBindingParameterName + "?."),
527
+ new RegExp("^" + sBindingParameterName + "/?"),
518
528
  ""
519
529
  );
520
530
  return bNavigationPropertyPath ? { $NavigationPropertyPath: sValue } : sValue;
@@ -546,59 +556,6 @@ class SideEffectsService extends Service<SideEffectsSettings> {
546
556
  );
547
557
  }
548
558
 
549
- /**
550
- * Replaces TargetProperties having reference to Source Properties for a SideEffects
551
- * If a SideEffects Source Property is an navigation entity reference, the SideEffects Target Properties cannot be a property of this navigation entity.
552
- * 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.
553
- * 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.
554
- * For the first version, we remove all navigation properties and replace them by targetEntities. This change could be improved in next version.
555
- *
556
- * @private
557
- * @ui5-restricted
558
- * @param {object} oSideEffect SideEffects definition
559
- * @param {object} mEntityType Entity type
560
- * @returns {object} SideEffects definition without referenced target properties
561
- */
562
- private _replaceReferencedProperties(oSideEffect: BaseSideEffectsType, mEntityType: EntityType): BaseSideEffectsType {
563
- let bSideEffectsChanged: boolean = false;
564
- const aEntities: string[] =
565
- (oSideEffect.TargetEntities || []).map(mNavigation => {
566
- return mNavigation.$NavigationPropertyPath;
567
- }) || [],
568
- aProperties: string[] = [];
569
-
570
- oSideEffect.TargetProperties.forEach(sPropertyPath => {
571
- let bTargetChanged = false;
572
- const iLastPathSeparatorIndex = sPropertyPath.lastIndexOf("/");
573
- if (iLastPathSeparatorIndex !== -1) {
574
- const sNavigationPath = sPropertyPath.substring(0, iLastPathSeparatorIndex);
575
- const oTarget = mEntityType.resolvePath(sNavigationPath);
576
- if (oTarget && oTarget._type === "NavigationProperty") {
577
- //Test if it's not a property bound on complexType (_ComplexType/MyProperty)
578
- bSideEffectsChanged = true;
579
- bTargetChanged = true;
580
- if (!aEntities.includes(sNavigationPath)) {
581
- aEntities.push(sNavigationPath);
582
- }
583
- }
584
- }
585
- if (!bTargetChanged) {
586
- aProperties.push(sPropertyPath);
587
- }
588
- });
589
-
590
- if (bSideEffectsChanged) {
591
- oSideEffect.TargetProperties = aProperties;
592
- oSideEffect.TargetEntities = aEntities.map(sNavigationPath => {
593
- return {
594
- $NavigationPropertyPath: sNavigationPath
595
- };
596
- });
597
- }
598
-
599
- return oSideEffect;
600
- }
601
-
602
559
  /**
603
560
  * Gets SideEffects action type that come from an OData Service
604
561
  * Internal routine to get, from converted oData metaModel, SideEffects on actions
@@ -616,15 +573,15 @@ class SideEffectsService extends Service<SideEffectsSettings> {
616
573
  if (aActions) {
617
574
  Object.keys(aActions).forEach(sActionName => {
618
575
  const oAction = mEntityType.actions[sActionName];
619
- const triggerActions: String[] = [];
576
+ const triggerActions: string[] = [];
620
577
  let pathExpressions: SideEffectsTarget[] = [];
621
578
  let aTargets: SideEffectsTarget[] = [];
622
579
 
623
580
  this._getSideEffectsFromSource(oAction).forEach(oSideEffect => {
624
581
  const sTriggerAction = oSideEffect.TriggerAction;
625
582
  aTargets = aTargets.concat(oSideEffect.TargetEntities || []).concat((oSideEffect.TargetProperties as any[]) || []);
626
- if (sTriggerAction && triggerActions.indexOf(sTriggerAction) === -1) {
627
- triggerActions.push(sTriggerAction);
583
+ if (sTriggerAction && triggerActions.indexOf(sTriggerAction as string) === -1) {
584
+ triggerActions.push(sTriggerAction as string);
628
585
  }
629
586
  });
630
587
  pathExpressions = this._removeDuplicateTargets(aTargets);
@@ -659,7 +616,7 @@ class SideEffectsService extends Service<SideEffectsSettings> {
659
616
  }
660
617
 
661
618
  class SideEffectsServiceFactory extends ServiceFactory<SideEffectsSettings> {
662
- createInstance(oServiceContext: ServiceContext<SideEffectsSettings>) {
619
+ createInstance(oServiceContext: ServiceContext<SideEffectsSettings>): Promise<any> {
663
620
  const SideEffectsServiceService = new SideEffectsService(oServiceContext);
664
621
  return SideEffectsServiceService.initPromise;
665
622
  }