@sapui5/sap.fe.core 1.100.0 → 1.101.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 (250) hide show
  1. package/package.json +4 -4
  2. package/src/sap/fe/core/.library +2 -3
  3. package/src/sap/fe/core/AnnotationHelper.js +43 -24
  4. package/src/sap/fe/core/AnnotationHelper.ts +43 -37
  5. package/src/sap/fe/core/AppComponent.js +20 -27
  6. package/src/sap/fe/core/AppComponent.ts +19 -25
  7. package/src/sap/fe/core/AppStateHandler.js +5 -5
  8. package/src/sap/fe/core/AppStateHandler.ts +2 -2
  9. package/src/sap/fe/core/BaseController.js +9 -9
  10. package/src/sap/fe/core/BaseController.ts +3 -4
  11. package/src/sap/fe/core/CommonUtils.js +74 -17
  12. package/src/sap/fe/core/CommonUtils.ts +181 -110
  13. package/src/sap/fe/core/ExtensionAPI.js +11 -10
  14. package/src/sap/fe/core/ExtensionAPI.ts +22 -30
  15. package/src/sap/fe/core/PageController.js +12 -11
  16. package/src/sap/fe/core/PageController.ts +34 -34
  17. package/src/sap/fe/core/RouterProxy.js +36 -24
  18. package/src/sap/fe/core/RouterProxy.ts +36 -22
  19. package/src/sap/fe/core/TemplateComponent.js +193 -118
  20. package/src/sap/fe/core/TemplateComponent.ts +105 -117
  21. package/src/sap/fe/core/TemplateModel.js +6 -8
  22. package/src/sap/fe/core/TemplateModel.ts +2 -2
  23. package/src/sap/fe/core/TransactionHelper.js +33 -18
  24. package/src/sap/fe/core/TransactionHelper.ts +172 -153
  25. package/src/sap/fe/core/actions/collaboration/ActivitySync.js +31 -17
  26. package/src/sap/fe/core/actions/collaboration/ActivitySync.ts +52 -45
  27. package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +16 -6
  28. package/src/sap/fe/core/actions/collaboration/CollaborationCommon.ts +13 -3
  29. package/src/sap/fe/core/actions/collaboration/Manage.js +9 -7
  30. package/src/sap/fe/core/actions/collaboration/Manage.ts +33 -31
  31. package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +53 -56
  32. package/src/sap/fe/core/actions/draft.js +308 -166
  33. package/src/sap/fe/core/actions/draft.ts +177 -74
  34. package/src/sap/fe/core/actions/messageHandling.js +25 -13
  35. package/src/sap/fe/core/actions/messageHandling.ts +49 -39
  36. package/src/sap/fe/core/actions/operations.js +4 -4
  37. package/src/sap/fe/core/actions/operations.ts +3 -2
  38. package/src/sap/fe/core/buildingBlocks/AttributeModel.js +60 -0
  39. package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +37 -0
  40. package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +165 -0
  41. package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +178 -0
  42. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +707 -0
  43. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +628 -0
  44. package/src/sap/fe/core/buildingBlocks/TraceInfo.js +436 -0
  45. package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +431 -0
  46. package/src/sap/fe/core/controllerextensions/EditFlow.js +506 -245
  47. package/src/sap/fe/core/controllerextensions/EditFlow.ts +395 -275
  48. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +11 -11
  49. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +6 -7
  50. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +15 -17
  51. package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +98 -96
  52. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +15 -15
  53. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +60 -53
  54. package/src/sap/fe/core/controllerextensions/InternalRouting.js +94 -42
  55. package/src/sap/fe/core/controllerextensions/InternalRouting.ts +114 -91
  56. package/src/sap/fe/core/controllerextensions/KPIManagement.js +14 -14
  57. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +12 -11
  58. package/src/sap/fe/core/controllerextensions/MassEdit.js +12 -12
  59. package/src/sap/fe/core/controllerextensions/MassEdit.ts +8 -9
  60. package/src/sap/fe/core/controllerextensions/MessageHandler.js +13 -25
  61. package/src/sap/fe/core/controllerextensions/MessageHandler.ts +18 -28
  62. package/src/sap/fe/core/controllerextensions/PageReady.js +25 -23
  63. package/src/sap/fe/core/controllerextensions/PageReady.ts +49 -47
  64. package/src/sap/fe/core/controllerextensions/Paginator.js +13 -13
  65. package/src/sap/fe/core/controllerextensions/Paginator.ts +24 -18
  66. package/src/sap/fe/core/controllerextensions/Placeholder.js +10 -10
  67. package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
  68. package/src/sap/fe/core/controllerextensions/Routing.js +11 -11
  69. package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
  70. package/src/sap/fe/core/controllerextensions/Share.js +16 -16
  71. package/src/sap/fe/core/controllerextensions/Share.ts +32 -32
  72. package/src/sap/fe/core/controllerextensions/SideEffects.js +14 -14
  73. package/src/sap/fe/core/controllerextensions/SideEffects.ts +62 -63
  74. package/src/sap/fe/core/controllerextensions/ViewState.js +17 -31
  75. package/src/sap/fe/core/controllerextensions/ViewState.ts +93 -102
  76. package/src/sap/fe/core/controls/Any.js +28 -0
  77. package/src/sap/fe/core/controls/Any.ts +30 -0
  78. package/src/sap/fe/core/controls/CommandExecution.js +38 -15
  79. package/src/sap/fe/core/controls/CommandExecution.ts +20 -20
  80. package/src/sap/fe/core/controls/ConditionalWrapper.js +136 -65
  81. package/src/sap/fe/core/controls/ConditionalWrapper.ts +49 -58
  82. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +366 -0
  83. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +278 -0
  84. package/src/sap/fe/core/controls/CustomQuickViewPage.js +73 -36
  85. package/src/sap/fe/core/controls/CustomQuickViewPage.ts +22 -32
  86. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossDraft.fragment.xml +44 -5
  87. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +116 -66
  88. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +121 -67
  89. package/src/sap/fe/core/controls/FieldWrapper.js +171 -87
  90. package/src/sap/fe/core/controls/FieldWrapper.ts +69 -80
  91. package/src/sap/fe/core/controls/FileWrapper.js +313 -0
  92. package/src/sap/fe/core/controls/FileWrapper.ts +169 -0
  93. package/src/sap/fe/core/controls/FilterBar.js +154 -119
  94. package/src/sap/fe/core/controls/FilterBar.ts +128 -123
  95. package/src/sap/fe/core/controls/FormElementWrapper.js +92 -37
  96. package/src/sap/fe/core/controls/FormElementWrapper.ts +32 -35
  97. package/src/sap/fe/core/controls/filterbar/FilterContainer.js +111 -89
  98. package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +86 -82
  99. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +242 -193
  100. package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +211 -204
  101. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +152 -116
  102. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +105 -105
  103. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +1 -1
  104. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +2 -2
  105. package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +37 -42
  106. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +7 -6
  107. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +15 -14
  108. package/src/sap/fe/core/converters/ManifestSettings.js +2 -1
  109. package/src/sap/fe/core/converters/ManifestSettings.ts +5 -1
  110. package/src/sap/fe/core/converters/annotations/DataField.js +1 -2
  111. package/src/sap/fe/core/converters/annotations/DataField.ts +3 -4
  112. package/src/sap/fe/core/converters/controls/Common/Action.js +10 -10
  113. package/src/sap/fe/core/converters/controls/Common/Action.ts +20 -19
  114. package/src/sap/fe/core/converters/controls/Common/Chart.js +8 -8
  115. package/src/sap/fe/core/converters/controls/Common/Chart.ts +12 -11
  116. package/src/sap/fe/core/converters/controls/Common/Form.js +5 -5
  117. package/src/sap/fe/core/converters/controls/Common/Form.ts +3 -1
  118. package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
  119. package/src/sap/fe/core/converters/controls/Common/KPI.ts +2 -3
  120. package/src/sap/fe/core/converters/controls/Common/Table.js +245 -112
  121. package/src/sap/fe/core/converters/controls/Common/Table.ts +305 -193
  122. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +5 -5
  123. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +4 -7
  124. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +72 -43
  125. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +134 -100
  126. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +6 -6
  127. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +20 -18
  128. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +5 -2
  129. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +4 -1
  130. package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +1 -1
  131. package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +0 -4
  132. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +27 -24
  133. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +49 -40
  134. package/src/sap/fe/core/converters/templates/ListReportConverter.js +33 -22
  135. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +77 -62
  136. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +5 -5
  137. package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +3 -7
  138. package/src/sap/fe/core/formatters/KPIFormatter.js +3 -12
  139. package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -2
  140. package/src/sap/fe/core/formatters/TableFormatter.js +2 -2
  141. package/src/sap/fe/core/formatters/TableFormatter.ts +1 -1
  142. package/src/sap/fe/core/formatters/ValueFormatter.js +4 -4
  143. package/src/sap/fe/core/formatters/ValueFormatter.ts +4 -7
  144. package/src/sap/fe/core/fpm/Component.js +46 -17
  145. package/src/sap/fe/core/fpm/Component.ts +11 -16
  146. package/src/sap/fe/core/helpers/AppStartupHelper.js +4 -4
  147. package/src/sap/fe/core/helpers/AppStartupHelper.ts +3 -3
  148. package/src/sap/fe/core/helpers/ClassSupport.js +273 -256
  149. package/src/sap/fe/core/helpers/ClassSupport.ts +314 -237
  150. package/src/sap/fe/core/helpers/MassEditHelper.js +173 -39
  151. package/src/sap/fe/core/helpers/MassEditHelper.ts +236 -132
  152. package/src/sap/fe/core/helpers/ModelHelper.js +29 -1
  153. package/src/sap/fe/core/helpers/ModelHelper.ts +23 -0
  154. package/src/sap/fe/core/helpers/PasteHelper.js +4 -4
  155. package/src/sap/fe/core/helpers/PasteHelper.ts +4 -3
  156. package/src/sap/fe/core/helpers/SemanticDateOperators.js +3 -3
  157. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +3 -1
  158. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +1 -1
  159. package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +1 -1
  160. package/src/sap/fe/core/helpers/StableIdHelper.js +1 -7
  161. package/src/sap/fe/core/helpers/StableIdHelper.ts +0 -4
  162. package/src/sap/fe/core/jsx-runtime/jsx.js +35 -5
  163. package/src/sap/fe/core/jsx-runtime/jsx.ts +22 -8
  164. package/src/sap/fe/core/library.js +4 -5
  165. package/src/sap/fe/core/library.ts +17 -17
  166. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +1 -1
  167. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +0 -3
  168. package/src/sap/fe/core/messagebundle.properties +23 -8
  169. package/src/sap/fe/core/messagebundle_ar.properties +2 -0
  170. package/src/sap/fe/core/messagebundle_bg.properties +2 -0
  171. package/src/sap/fe/core/messagebundle_ca.properties +2 -0
  172. package/src/sap/fe/core/messagebundle_cs.properties +2 -0
  173. package/src/sap/fe/core/messagebundle_cy.properties +5 -3
  174. package/src/sap/fe/core/messagebundle_da.properties +2 -0
  175. package/src/sap/fe/core/messagebundle_de.properties +2 -0
  176. package/src/sap/fe/core/messagebundle_el.properties +2 -0
  177. package/src/sap/fe/core/messagebundle_en.properties +2 -0
  178. package/src/sap/fe/core/messagebundle_en_GB.properties +2 -0
  179. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +2 -0
  180. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +2 -0
  181. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +2 -0
  182. package/src/sap/fe/core/messagebundle_es.properties +2 -0
  183. package/src/sap/fe/core/messagebundle_es_MX.properties +2 -0
  184. package/src/sap/fe/core/messagebundle_et.properties +2 -0
  185. package/src/sap/fe/core/messagebundle_fi.properties +2 -0
  186. package/src/sap/fe/core/messagebundle_fr.properties +4 -2
  187. package/src/sap/fe/core/messagebundle_fr_CA.properties +5 -3
  188. package/src/sap/fe/core/messagebundle_hi.properties +2 -0
  189. package/src/sap/fe/core/messagebundle_hr.properties +5 -3
  190. package/src/sap/fe/core/messagebundle_hu.properties +2 -0
  191. package/src/sap/fe/core/messagebundle_id.properties +2 -0
  192. package/src/sap/fe/core/messagebundle_it.properties +2 -0
  193. package/src/sap/fe/core/messagebundle_iw.properties +2 -0
  194. package/src/sap/fe/core/messagebundle_ja.properties +2 -0
  195. package/src/sap/fe/core/messagebundle_kk.properties +2 -0
  196. package/src/sap/fe/core/messagebundle_ko.properties +2 -0
  197. package/src/sap/fe/core/messagebundle_lt.properties +2 -0
  198. package/src/sap/fe/core/messagebundle_lv.properties +5 -3
  199. package/src/sap/fe/core/messagebundle_ms.properties +2 -0
  200. package/src/sap/fe/core/messagebundle_nl.properties +2 -0
  201. package/src/sap/fe/core/messagebundle_no.properties +2 -0
  202. package/src/sap/fe/core/messagebundle_pl.properties +5 -3
  203. package/src/sap/fe/core/messagebundle_pt.properties +2 -0
  204. package/src/sap/fe/core/messagebundle_pt_PT.properties +2 -0
  205. package/src/sap/fe/core/messagebundle_ro.properties +5 -3
  206. package/src/sap/fe/core/messagebundle_ru.properties +5 -3
  207. package/src/sap/fe/core/messagebundle_sh.properties +2 -0
  208. package/src/sap/fe/core/messagebundle_sk.properties +2 -0
  209. package/src/sap/fe/core/messagebundle_sl.properties +2 -0
  210. package/src/sap/fe/core/messagebundle_sv.properties +3 -1
  211. package/src/sap/fe/core/messagebundle_th.properties +2 -0
  212. package/src/sap/fe/core/messagebundle_tr.properties +2 -0
  213. package/src/sap/fe/core/messagebundle_uk.properties +2 -0
  214. package/src/sap/fe/core/messagebundle_vi.properties +2 -0
  215. package/src/sap/fe/core/messagebundle_zh_CN.properties +5 -3
  216. package/src/sap/fe/core/messagebundle_zh_TW.properties +5 -3
  217. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +4 -4
  218. package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +1 -1
  219. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +5 -5
  220. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +1 -2
  221. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +7 -7
  222. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +6 -5
  223. package/src/sap/fe/core/services/NavigationServiceFactory.js +4 -4
  224. package/src/sap/fe/core/services/NavigationServiceFactory.ts +1 -1
  225. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +4 -4
  226. package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +1 -1
  227. package/src/sap/fe/core/services/RoutingServiceFactory.js +98 -62
  228. package/src/sap/fe/core/services/RoutingServiceFactory.ts +51 -42
  229. package/src/sap/fe/core/services/ShellServicesFactory.js +69 -29
  230. package/src/sap/fe/core/services/ShellServicesFactory.ts +26 -29
  231. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +4 -4
  232. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +1 -1
  233. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +8 -8
  234. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +6 -17
  235. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +43 -5
  236. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +6 -3
  237. package/src/sap/fe/core/support/CommonHelper.js +1 -1
  238. package/src/sap/fe/core/support/CommonHelper.ts +0 -3
  239. package/src/sap/fe/core/templating/DataModelPathHelper.js +2 -9
  240. package/src/sap/fe/core/templating/DataModelPathHelper.ts +32 -38
  241. package/src/sap/fe/core/templating/DisplayModeFormatter.js +23 -3
  242. package/src/sap/fe/core/templating/DisplayModeFormatter.ts +26 -5
  243. package/src/sap/fe/core/templating/PropertyHelper.js +15 -1
  244. package/src/sap/fe/core/templating/PropertyHelper.ts +30 -23
  245. package/src/sap/fe/core/templating/UIFormatters.js +121 -21
  246. package/src/sap/fe/core/templating/UIFormatters.ts +134 -49
  247. package/src/sap/fe/core/type/Email.js +26 -8
  248. package/src/sap/fe/core/type/Email.ts +8 -7
  249. package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +0 -78
  250. package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.ts +0 -65
@@ -1,32 +1,34 @@
1
+ import ResourceBundle from "sap/base/i18n/ResourceBundle";
2
+ import Log from "sap/base/Log";
1
3
  import draft from "sap/fe/core/actions/draft";
2
- import sticky from "sap/fe/core/actions/sticky";
4
+ import messageHandling from "sap/fe/core/actions/messageHandling";
3
5
  import operations from "sap/fe/core/actions/operations";
4
- import JSONModel from "sap/ui/model/json/JSONModel";
5
- import Popover from "sap/m/Popover";
6
- import VBox from "sap/m/VBox";
7
- import CheckBox from "sap/m/CheckBox";
8
- import Text from "sap/m/Text";
9
- import Button from "sap/m/Button";
10
- import MessageToast from "sap/m/MessageToast";
11
- import Dialog from "sap/m/Dialog";
12
- import Log from "sap/base/Log";
13
- import CommonUtils from "sap/fe/core/CommonUtils";
6
+ import sticky from "sap/fe/core/actions/sticky";
7
+ import AppComponent from "sap/fe/core/AppComponent";
14
8
  import BusyLocker from "sap/fe/core/BusyLocker";
15
- import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
16
- import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
17
- import Fragment from "sap/ui/core/Fragment";
18
- import MessageBox from "sap/m/MessageBox";
9
+ import CommonUtils from "sap/fe/core/CommonUtils";
10
+ import FPMHelper from "sap/fe/core/helpers/FPMHelper";
19
11
  import ModelHelper, { InternalModelContext } from "sap/fe/core/helpers/ModelHelper";
20
12
  import FELibrary from "sap/fe/core/library";
13
+ import Button from "sap/m/Button";
14
+ import CheckBox from "sap/m/CheckBox";
15
+ import Dialog from "sap/m/Dialog";
16
+ import MessageBox from "sap/m/MessageBox";
17
+ import MessageToast from "sap/m/MessageToast";
18
+ import Popover from "sap/m/Popover";
19
+ import Text from "sap/m/Text";
20
+ import VBox from "sap/m/VBox";
21
+ import Core from "sap/ui/core/Core";
22
+ import Fragment from "sap/ui/core/Fragment";
21
23
  import coreLibrary from "sap/ui/core/library";
22
- import messageHandling from "sap/fe/core/actions/messageHandling";
23
- import AppComponent from "sap/fe/core/AppComponent";
24
- import ResourceBundle from "sap/base/i18n/ResourceBundle";
25
- import ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
26
24
  import View from "sap/ui/core/mvc/View";
27
- import FPMHelper from "sap/fe/core/helpers/FPMHelper";
28
-
25
+ import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
26
+ import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
29
27
  import Context from "sap/ui/model/Context";
28
+ import JSONModel from "sap/ui/model/json/JSONModel";
29
+ import ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
30
+ import { CoreEx } from "types/extension_types";
31
+
30
32
  const CreationMode = FELibrary.CreationMode;
31
33
  const ProgrammingModel = FELibrary.ProgrammingModel;
32
34
  const ValueState = coreLibrary.ValueState;
@@ -50,7 +52,7 @@ class TransactionHelper {
50
52
  this._oAppComponent = oAppComponent;
51
53
  this.oLockObject = oLockObject;
52
54
  }
53
- getProgrammingModel(oContext: any): typeof ProgrammingModel {
55
+ getProgrammingModel(oContext?: any): typeof ProgrammingModel {
54
56
  if (!this.sProgrammingModel && oContext) {
55
57
  let sPath;
56
58
  if (oContext.isA("sap.ui.model.odata.v4.Context")) {
@@ -131,9 +133,7 @@ class TransactionHelper {
131
133
  oModel = oMainListBinding.getModel(),
132
134
  oMetaModel = oModel.getMetaModel(),
133
135
  sMetaPath = oMetaModel.getMetaPath(oMainListBinding.getHeaderContext().getPath()),
134
- sCreateHash = this._getAppComponent()
135
- .getRouterProxy()
136
- .getHash(),
136
+ sCreateHash = this._getAppComponent().getRouterProxy().getHash(),
137
137
  oComponentData = this._getAppComponent().getComponentData(),
138
138
  oStartupParameters = (oComponentData && oComponentData.startupParameters) || {},
139
139
  sNewAction = !oMainListBinding.isRelative()
@@ -178,7 +178,7 @@ class TransactionHelper {
178
178
  }
179
179
  mParameters.beforeCreateCallBack = bFromCopyPaste ? null : mParameters.beforeCreateCallBack;
180
180
  BusyLocker.lock(this.oLockObject, sBusyPath);
181
- const oResourceBundleCore = sap.ui.getCore().getLibraryResourceBundle("sap.fe.core");
181
+ const oResourceBundleCore = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core");
182
182
  if (sNewAction) {
183
183
  oCreationPromise = this.callAction(
184
184
  sNewAction,
@@ -228,18 +228,18 @@ class TransactionHelper {
228
228
  }
229
229
 
230
230
  oCreationPromise = oCreationPromise
231
- .then(function(oContext: any) {
231
+ .then(function (oContext: any) {
232
232
  if (oContext) {
233
233
  return oContext.getObject();
234
234
  } else {
235
235
  return undefined;
236
236
  }
237
237
  })
238
- .catch(function(oError: any) {
238
+ .catch(function (oError: any) {
239
239
  Log.error("Error while executing the function " + sFunctionName, oError);
240
240
  throw oError;
241
241
  })
242
- .then(function(oData: any) {
242
+ .then(function (oData: any) {
243
243
  mParameters.data = oData ? Object.assign({}, oData, mParameters.data) : mParameters.data;
244
244
  if (mParameters.data) {
245
245
  delete mParameters.data["@odata.context"];
@@ -248,7 +248,7 @@ class TransactionHelper {
248
248
  const oTransientListBinding = oModel.bindList(oMainListBinding.getPath(), oMainListBinding.getContext(), [], [], {
249
249
  $$updateGroupId: "submitLater"
250
250
  });
251
- oTransientListBinding.refreshInternal = function() {
251
+ oTransientListBinding.refreshInternal = function () {
252
252
  /* */
253
253
  };
254
254
  oNewDocumentContext = oTransientListBinding.create(mParameters.data, true);
@@ -270,19 +270,19 @@ class TransactionHelper {
270
270
  } else {
271
271
  onBeforeCreatePromise = Promise.resolve();
272
272
  }
273
- return onBeforeCreatePromise.then(function() {
273
+ return onBeforeCreatePromise.then(function () {
274
274
  oNewDocumentContext = oMainListBinding.create(mParameters.data, true, mParameters.createAtEnd);
275
275
  return that.onAfterCreateCompletion(oMainListBinding, oNewDocumentContext, mParameters);
276
276
  });
277
277
  }
278
278
  })
279
- .catch(function(oError: any) {
279
+ .catch(function (oError: any) {
280
280
  Log.error("Error while creating the new document", oError);
281
281
  throw oError;
282
282
  });
283
283
  }
284
284
  return oCreationPromise
285
- .then(function(oResult: any) {
285
+ .then(function (oResult: any) {
286
286
  if (!oMainListBinding.isRelative()) {
287
287
  // the create mode shall currently only be set on creating a root document
288
288
  that._bCreateMode = true;
@@ -292,12 +292,12 @@ class TransactionHelper {
292
292
  if (oResult && oResult.bConsiderDocumentModified) {
293
293
  that.handleDocumentModifications();
294
294
  }
295
- return messageHandler.showMessageDialog().then(function() {
295
+ return messageHandler.showMessageDialog().then(function () {
296
296
  return oNewDocumentContext;
297
297
  });
298
298
  })
299
- .catch(function(oError: any) {
300
- return messageHandler.showMessageDialog().then(function() {
299
+ .catch(function (oError: any) {
300
+ return messageHandler.showMessageDialog().then(function () {
301
301
  // for instance, on cancel of create dialog, the promise is rejected
302
302
  // a return here would restore the promise chain and result in errors while routing
303
303
  // solution - reject here as well
@@ -310,7 +310,7 @@ class TransactionHelper {
310
310
  return Promise.reject(oError);
311
311
  });
312
312
  })
313
- .finally(function() {
313
+ .finally(function () {
314
314
  BusyLocker.unlock(that.oLockObject, sBusyPath);
315
315
  });
316
316
  }
@@ -327,7 +327,7 @@ class TransactionHelper {
327
327
  if (!bFindActiveContexts) {
328
328
  return Promise.resolve();
329
329
  }
330
- const activeContexts = aContexts.reduce(function(aResult: any, oContext: any) {
330
+ const activeContexts = aContexts.reduce(function (aResult: any, oContext: any) {
331
331
  const oMetaModel = oContext.getModel().getMetaModel();
332
332
  const sMetaPath = oMetaModel.getMetaPath(oContext.getPath());
333
333
  if (oMetaModel.getObject(sMetaPath + "@com.sap.vocabularies.Common.v1.DraftRoot")) {
@@ -344,12 +344,12 @@ class TransactionHelper {
344
344
  return aResult;
345
345
  }, []);
346
346
  return Promise.all(
347
- activeContexts.map(function(oContext: any) {
347
+ activeContexts.map(function (oContext: any) {
348
348
  return oContext.requestCanonicalPath().then(
349
- function() {
349
+ function () {
350
350
  return oContext;
351
351
  },
352
- function() {
352
+ function () {
353
353
  return;
354
354
  }
355
355
  );
@@ -363,7 +363,7 @@ class TransactionHelper {
363
363
  //if unsaved objects are not deleted then we need to set the enabled to true and update the model data for next deletion
364
364
  oInternalModelContext.setProperty("deleteEnabled", true);
365
365
  const obj = Object.assign(oInternalModelContext.getObject(), {});
366
- obj.selectedContexts = obj.selectedContexts.filter(function(element: any) {
366
+ obj.selectedContexts = obj.selectedContexts.filter(function (element: any) {
367
367
  return obj.deletableContexts.indexOf(element) === -1;
368
368
  });
369
369
  obj.deletableContexts = [];
@@ -422,7 +422,7 @@ class TransactionHelper {
422
422
  bDialogConfirmed = false;
423
423
  // eslint-disable-next-line @typescript-eslint/no-this-alias
424
424
  const that = this,
425
- oResourceBundleCore = sap.ui.getCore().getLibraryResourceBundle("sap.fe.core") as ResourceBundle;
425
+ oResourceBundleCore = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core") as ResourceBundle;
426
426
  let aParams;
427
427
  let oDeleteMessage: any = {
428
428
  title: oResourceBundleCore.getText("C_COMMON_OBJECT_PAGE_DELETE")
@@ -432,7 +432,7 @@ class TransactionHelper {
432
432
  vContexts = [vContexts];
433
433
  }
434
434
  Promise.resolve(this.getProgrammingModel(vContexts[0]))
435
- .then(function(sProgrammingModel: any) {
435
+ .then(function (sProgrammingModel: any) {
436
436
  if (mParameters) {
437
437
  if (!mParameters.numberOfSelectedContexts) {
438
438
  if (sProgrammingModel === ProgrammingModel.Draft) {
@@ -658,7 +658,7 @@ class TransactionHelper {
658
658
  new CheckBox({
659
659
  text: oDeleteMessage.checkBoxText,
660
660
  selected: true,
661
- select: function(oEvent: any) {
661
+ select: function (oEvent: any) {
662
662
  const selected = oEvent.getSource().getSelected();
663
663
  if (selected) {
664
664
  aDeletableContexts = vContexts.concat(mParameters.unSavedContexts);
@@ -673,7 +673,7 @@ class TransactionHelper {
673
673
  ]
674
674
  });
675
675
  const sTitle = oResourceBundleCore.getText("C_COMMON_OBJECT_PAGE_DELETE");
676
- const fnConfirm = function() {
676
+ const fnConfirm = function () {
677
677
  bDialogConfirmed = true;
678
678
  BusyLocker.lock(that.oLockObject);
679
679
  const aContexts = aDeletableContexts;
@@ -685,31 +685,31 @@ class TransactionHelper {
685
685
  }
686
686
  return onBeforeDeletePromise
687
687
  .then(that.findActiveDraftRootContexts.bind(that, aContexts, mParameters.bFindActiveContexts))
688
- .then(function(activeContexts: any) {
688
+ .then(function (activeContexts: any) {
689
689
  //make sure to fetch the active contexts before deleting the drafts
690
690
  return Promise.all(
691
- aContexts.map(function(oContext: any) {
691
+ aContexts.map(function (oContext: any) {
692
692
  //delete the draft
693
693
  return draft.deleteDraft(oContext);
694
694
  })
695
695
  )
696
- .catch(function(oError: any) {
697
- return messageHandler.showMessages().then(function() {
696
+ .catch(function (oError: any) {
697
+ return messageHandler.showMessages().then(function () {
698
698
  // re-throw error to enforce rejecting the general promise
699
699
  throw oError;
700
700
  });
701
701
  })
702
- .then(function() {
702
+ .then(function () {
703
703
  const checkBox = {
704
704
  "isCheckBoxVisible": isCheckBoxVisible,
705
705
  "isCheckBoxSelected": isCheckBoxSelected
706
706
  };
707
707
  if (activeContexts && activeContexts.length) {
708
708
  return Promise.all(
709
- activeContexts.map(function(oContext: any) {
709
+ activeContexts.map(function (oContext: any) {
710
710
  return oContext.delete();
711
711
  })
712
- ).then(function() {
712
+ ).then(function () {
713
713
  that.afterDeleteProcess(mParameters, checkBox, aContexts, oResourceBundle);
714
714
  return messageHandler.showMessageDialog().then(fnResolve);
715
715
  });
@@ -719,10 +719,10 @@ class TransactionHelper {
719
719
  }
720
720
  });
721
721
  })
722
- .catch(function() {
722
+ .catch(function () {
723
723
  fnReject();
724
724
  })
725
- .finally(function() {
725
+ .finally(function () {
726
726
  BusyLocker.unlock(that.oLockObject);
727
727
  });
728
728
  };
@@ -736,18 +736,18 @@ class TransactionHelper {
736
736
  beginButton: new Button({
737
737
  text: oResourceBundleCore.getText("C_COMMON_OBJECT_PAGE_DELETE"),
738
738
  type: "Emphasized",
739
- press: function() {
739
+ press: function () {
740
740
  oDialog.close();
741
741
  return fnConfirm();
742
742
  }
743
743
  }),
744
744
  endButton: new Button({
745
745
  text: CommonUtils.getTranslatedText("C_COMMON_OBJECT_PAGE_CANCEL", oResourceBundle),
746
- press: function() {
746
+ press: function () {
747
747
  oDialog.close();
748
748
  }
749
749
  }),
750
- afterClose: function() {
750
+ afterClose: function () {
751
751
  oDialog.destroy();
752
752
  // if dialog is closed unconfirmed (e.g. via "Cancel" or Escape button), ensure to reject promise
753
753
  if (!bDialogConfirmed) {
@@ -762,14 +762,14 @@ class TransactionHelper {
762
762
  oDialog.open();
763
763
  }
764
764
  })
765
- .finally(function() {
765
+ .finally(function () {
766
766
  BusyLocker.unlock(that.oLockObject);
767
767
  })
768
- .catch(function() {
768
+ .catch(function () {
769
769
  Log.warning("Couldn't get Programming model");
770
770
  fnReject();
771
771
  });
772
- return new Promise(function(resolve: (value: any) => void, reject: (reason?: any) => void) {
772
+ return new Promise(function (resolve: (value: any) => void, reject: (reason?: any) => void) {
773
773
  fnReject = reject;
774
774
  fnResolve = resolve;
775
775
  });
@@ -810,18 +810,18 @@ class TransactionHelper {
810
810
  return Promise.reject(new Error("Edit is only allowed for draft or sticky session supported services"));
811
811
  }
812
812
  return oEditPromise
813
- .then(function(oNewContext: any) {
813
+ .then(function (oNewContext: any) {
814
814
  that._bCreateMode = false;
815
- return messageHandler.showMessageDialog().then(function() {
815
+ return messageHandler.showMessageDialog().then(function () {
816
816
  return oNewContext;
817
817
  });
818
818
  })
819
- .catch(function(err: any) {
820
- return messageHandler.showMessages().then(function() {
819
+ .catch(function (err: any) {
820
+ return messageHandler.showMessages().then(function () {
821
821
  return Promise.reject(err);
822
822
  });
823
823
  })
824
- .finally(function() {
824
+ .finally(function () {
825
825
  BusyLocker.unlock(that.oLockObject);
826
826
  });
827
827
  }
@@ -860,12 +860,12 @@ class TransactionHelper {
860
860
  oModel = oParamsContext.getModel();
861
861
  let onBeforeCancelPromise, sCanonicalPath: string;
862
862
  return Promise.resolve(this.getProgrammingModel(oContext))
863
- .then(function(sPModel: any) {
863
+ .then(function (sPModel: any) {
864
864
  sProgrammingModel = sPModel;
865
865
  if (sPModel === ProgrammingModel.Draft) {
866
866
  const draftDataContext = oModel.bindContext(oParamsContext.getPath() + "/DraftAdministrativeData").getBoundContext();
867
867
  if (!that._bIsModified) {
868
- return draftDataContext.requestObject().then(function(draftAdminData: any) {
868
+ return draftDataContext.requestObject().then(function (draftAdminData: any) {
869
869
  if (draftAdminData) {
870
870
  that._bIsModified = !(draftAdminData.CreationDateTime === draftAdminData.LastChangeDateTime);
871
871
  }
@@ -873,14 +873,14 @@ class TransactionHelper {
873
873
  }
874
874
  }
875
875
  })
876
- .then(function() {
876
+ .then(function () {
877
877
  if (!mParameters.skipDiscardPopover) {
878
878
  return that._showDiscardPopover(oCancelButton, that._bIsModified, oResourceBundle);
879
879
  } else {
880
880
  return Promise.resolve();
881
881
  }
882
882
  })
883
- .then(function() {
883
+ .then(function () {
884
884
  if (mParameters.beforeCancelCallBack) {
885
885
  onBeforeCancelPromise = mParameters.beforeCancelCallBack({ context: oContext });
886
886
  } else {
@@ -888,11 +888,11 @@ class TransactionHelper {
888
888
  }
889
889
  return onBeforeCancelPromise;
890
890
  })
891
- .then(function() {
891
+ .then(function () {
892
892
  // eslint-disable-next-line default-case
893
893
  switch (sProgrammingModel) {
894
894
  case ProgrammingModel.Draft:
895
- return oParamsContext.requestObject("HasActiveEntity").then(function(bHasActiveEntity: any) {
895
+ return oParamsContext.requestObject("HasActiveEntity").then(function (bHasActiveEntity: any) {
896
896
  let oDeletePromise;
897
897
  if (!bHasActiveEntity) {
898
898
  if (oParamsContext && oParamsContext.hasPendingChanges()) {
@@ -905,7 +905,7 @@ class TransactionHelper {
905
905
  return oActiveContext
906
906
  .requestCanonicalPath()
907
907
  .then(
908
- function(sPath: any) {
908
+ function (sPath: any) {
909
909
  sCanonicalPath = sPath;
910
910
  if (oParamsContext && oParamsContext.hasPendingChanges()) {
911
911
  oParamsContext.getBinding().resetChanges();
@@ -913,12 +913,12 @@ class TransactionHelper {
913
913
  oDeletePromise = draft.deleteDraft(oParamsContext);
914
914
  return oDeletePromise;
915
915
  },
916
- function() {
916
+ function () {
917
917
  draft.deleteDraft(oParamsContext);
918
918
  return;
919
919
  }
920
920
  )
921
- .then(function() {
921
+ .then(function () {
922
922
  //oParamsContext.delete() in the previous promise doesnt return anything upon success.
923
923
  if (!sCanonicalPath) {
924
924
  return;
@@ -933,7 +933,7 @@ class TransactionHelper {
933
933
  }
934
934
  });
935
935
  case ProgrammingModel.Sticky:
936
- return sticky.discardDocument(oContext).then(function(oContext: any) {
936
+ return sticky.discardDocument(oContext).then(function (oContext: any) {
937
937
  if (oContext) {
938
938
  if (oContext.hasPendingChanges()) {
939
939
  oContext.getBinding().resetChanges();
@@ -949,21 +949,21 @@ class TransactionHelper {
949
949
  return Promise.reject("Cancel document only allowed for draft or sticky session supported services");
950
950
  }
951
951
  })
952
- .then(function(context: any) {
952
+ .then(function (context: any) {
953
953
  that._bIsModified = false;
954
954
  // remove existing bound transition messages
955
955
  messageHandler.removeTransitionMessages();
956
956
  // show unbound messages
957
- return messageHandler.showMessages().then(function() {
957
+ return messageHandler.showMessages().then(function () {
958
958
  return context;
959
959
  });
960
960
  })
961
- .catch(function(err: any) {
962
- return messageHandler.showMessages().then(function() {
961
+ .catch(function (err: any) {
962
+ return messageHandler.showMessages().then(function () {
963
963
  return Promise.reject(err);
964
964
  });
965
965
  })
966
- .finally(function() {
966
+ .finally(function () {
967
967
  BusyLocker.unlock(that.oLockObject);
968
968
  });
969
969
  }
@@ -1002,7 +1002,7 @@ class TransactionHelper {
1002
1002
  return Promise.reject(new Error("Save is only allowed for draft or sticky session supported services"));
1003
1003
  }
1004
1004
  return oSavePromise
1005
- .then(function(oActiveDocument: any) {
1005
+ .then(function (oActiveDocument: any) {
1006
1006
  const bNewObject =
1007
1007
  that.sProgrammingModel === ProgrammingModel.Sticky ? that._bCreateMode : !oContext.getObject().HasActiveEntity;
1008
1008
  MessageToast.show(
@@ -1011,25 +1011,25 @@ class TransactionHelper {
1011
1011
  : CommonUtils.getTranslatedText("C_TRANSACTION_HELPER_OBJECT_SAVED", oResourceBundle)
1012
1012
  );
1013
1013
  that._bIsModified = false;
1014
- return messageHandler.showMessageDialog().then(function() {
1014
+ return messageHandler.showMessageDialog().then(function () {
1015
1015
  return oActiveDocument;
1016
1016
  });
1017
1017
  })
1018
- .catch(function(err: any) {
1018
+ .catch(function (err: any) {
1019
1019
  if (aBindings && aBindings.length > 0) {
1020
1020
  /* The sideEffects are executed only for table items in transient state */
1021
- aBindings.forEach(function(oListBinding: any) {
1021
+ aBindings.forEach(function (oListBinding: any) {
1022
1022
  if (!CommonUtils.hasTransientContext(oListBinding) && bExecuteSideEffectsOnError) {
1023
1023
  const oAppComponent = that._getAppComponent();
1024
1024
  oAppComponent.getSideEffectsService().requestSideEffectsForNavigationProperty(oListBinding.getPath(), oContext);
1025
1025
  }
1026
1026
  });
1027
1027
  }
1028
- return messageHandler.showMessages().then(function() {
1028
+ return messageHandler.showMessages().then(function () {
1029
1029
  return Promise.reject(err);
1030
1030
  });
1031
1031
  })
1032
- .finally(function() {
1032
+ .finally(function () {
1033
1033
  BusyLocker.unlock(that.oLockObject);
1034
1034
  });
1035
1035
  }
@@ -1084,21 +1084,21 @@ class TransactionHelper {
1084
1084
  const oAppComponent = that._getAppComponent();
1085
1085
  const mSideEffectsParameters = oAppComponent.getSideEffectsService().getODataActionSideEffects(sActionName, oContext) || {};
1086
1086
  if (oContext && oModel) {
1087
- oPromise = new Promise<void>(function(resolve, reject) {
1087
+ oPromise = new Promise<void>(function (resolve, reject) {
1088
1088
  let oApplicableContextDialog: Dialog;
1089
1089
  const oController = {
1090
- onClose: function() {
1090
+ onClose: function () {
1091
1091
  // User cancels action
1092
1092
  oApplicableContextDialog.close();
1093
1093
  resolve();
1094
1094
  },
1095
- onContinue: function() {
1095
+ onContinue: function () {
1096
1096
  // Users continues the action with the bound contexts
1097
1097
  oApplicableContextDialog.close();
1098
1098
  resolve(mParameters.applicableContext);
1099
1099
  }
1100
1100
  };
1101
- const fnOpenAndFillDialog = function() {
1101
+ const fnOpenAndFillDialog = function () {
1102
1102
  let oDialogContent;
1103
1103
  const nNotApplicable = mParameters.notApplicableContext.length,
1104
1104
  aNotApplicableItems = [];
@@ -1139,10 +1139,10 @@ class TransactionHelper {
1139
1139
  }
1140
1140
  )
1141
1141
  )
1142
- .then(function(oFragment: any) {
1142
+ .then(function (oFragment: any) {
1143
1143
  return Fragment.load({ definition: oFragment, controller: oController });
1144
1144
  })
1145
- .then(function(oPopover: any) {
1145
+ .then(function (oPopover: any) {
1146
1146
  oApplicableContextDialog = oPopover;
1147
1147
  mParameters.parentControl.addDependent(oPopover);
1148
1148
  fnOpenAndFillDialog();
@@ -1151,7 +1151,7 @@ class TransactionHelper {
1151
1151
  } else {
1152
1152
  resolve(mParameters.contexts);
1153
1153
  }
1154
- }).then(function(contextToProcess: any) {
1154
+ }).then(function (contextToProcess: any) {
1155
1155
  if (contextToProcess) {
1156
1156
  return operations.callBoundAction(sActionName, contextToProcess, oModel, oAppComponent, {
1157
1157
  invocationGrouping: mParameters.invocationGrouping,
@@ -1160,11 +1160,11 @@ class TransactionHelper {
1160
1160
  mBindingParameters: mBindingParameters,
1161
1161
  entitySetName: mParameters.entitySetName,
1162
1162
  additionalSideEffect: mSideEffectsParameters,
1163
- onSubmitted: function() {
1163
+ onSubmitted: function () {
1164
1164
  messageHandler.removeTransitionMessages();
1165
1165
  BusyLocker.lock(that.oLockObject);
1166
1166
  },
1167
- onResponse: function() {
1167
+ onResponse: function () {
1168
1168
  BusyLocker.unlock(that.oLockObject);
1169
1169
  },
1170
1170
  parentControl: mParameters.parentControl,
@@ -1187,10 +1187,10 @@ class TransactionHelper {
1187
1187
  showActionParameterDialog: true,
1188
1188
  bindingParameters: mBindingParameters,
1189
1189
  entitySetName: mParameters.entitySetName,
1190
- onSubmitted: function() {
1190
+ onSubmitted: function () {
1191
1191
  BusyLocker.lock(that.oLockObject);
1192
1192
  },
1193
- onResponse: function() {
1193
+ onResponse: function () {
1194
1194
  BusyLocker.unlock(that.oLockObject);
1195
1195
  },
1196
1196
  parentControl: mParameters.parentControl,
@@ -1201,14 +1201,14 @@ class TransactionHelper {
1201
1201
  });
1202
1202
  }
1203
1203
  return oPromise
1204
- .then(function(oResult: any) {
1204
+ .then(function (oResult: any) {
1205
1205
  // Succeeded
1206
- return that._handleActionResponse(messageHandler, mParameters, sActionName).then(function() {
1206
+ return that._handleActionResponse(messageHandler, mParameters, sActionName).then(function () {
1207
1207
  return oResult;
1208
1208
  });
1209
1209
  })
1210
- .catch(function(err: any) {
1211
- return that._handleActionResponse(messageHandler, mParameters, sActionName).then(function() {
1210
+ .catch(function (err: any) {
1211
+ return that._handleActionResponse(messageHandler, mParameters, sActionName).then(function () {
1212
1212
  return Promise.reject(err);
1213
1213
  });
1214
1214
  });
@@ -1244,11 +1244,11 @@ class TransactionHelper {
1244
1244
  * @final
1245
1245
  */
1246
1246
  handleValidationError() {
1247
- const oMessageManager = (sap.ui.getCore() as any).getMessageManager(),
1247
+ const oMessageManager = Core.getMessageManager(),
1248
1248
  errorToRemove = oMessageManager
1249
1249
  .getMessageModel()
1250
1250
  .getData()
1251
- .filter(function(error: any) {
1251
+ .filter(function (error: any) {
1252
1252
  // only needs to handle validation messages, technical and persistent errors needs not to be checked here.
1253
1253
  if (error.validation) {
1254
1254
  return error;
@@ -1276,13 +1276,13 @@ class TransactionHelper {
1276
1276
  const that = this;
1277
1277
  that._bContinueDiscard = false;
1278
1278
  // to be implemented
1279
- return new Promise<void>(function(resolve, reject) {
1279
+ return new Promise<void>(function (resolve, reject) {
1280
1280
  if (!oCancelButton) {
1281
1281
  reject("Cancel button not found");
1282
1282
  }
1283
1283
  //Show popover only when data is changed.
1284
1284
  if (bIsModified) {
1285
- const fnOnAfterDiscard = function() {
1285
+ const fnOnAfterDiscard = function () {
1286
1286
  oCancelButton.setEnabled(true);
1287
1287
  if (that._bContinueDiscard) {
1288
1288
  resolve();
@@ -1300,7 +1300,7 @@ class TransactionHelper {
1300
1300
  oButton = new Button({
1301
1301
  text: CommonUtils.getTranslatedText("C_TRANSACTION_HELPER_DRAFT_DISCARD_BUTTON", oResourceBundle),
1302
1302
  width: "100%",
1303
- press: function() {
1303
+ press: function () {
1304
1304
  that.handleValidationError();
1305
1305
  that._bContinueDiscard = true;
1306
1306
  that._oPopover.close();
@@ -1315,7 +1315,7 @@ class TransactionHelper {
1315
1315
  items: [oText, oButton]
1316
1316
  })
1317
1317
  ],
1318
- beforeOpen: function() {
1318
+ beforeOpen: function () {
1319
1319
  // make sure to NOT trigger multiple cancel flows
1320
1320
  oCancelButton.setEnabled(false);
1321
1321
  that._oPopover.setInitialFocus(oButton);
@@ -1359,6 +1359,32 @@ class TransactionHelper {
1359
1359
  _getAppComponent() {
1360
1360
  return this._oAppComponent;
1361
1361
  }
1362
+
1363
+ _onFieldChange(oEvent: any, oCreateButton: any, messageHandler: any, fnValidateRequiredProperties: Function) {
1364
+ messageHandler.removeTransitionMessages();
1365
+ const oField = oEvent.getSource();
1366
+ const oFieldPromise = oEvent.getParameter("promise");
1367
+ if (oFieldPromise) {
1368
+ return oFieldPromise
1369
+ .then(function (value: any) {
1370
+ // Setting value of field as '' in case of value help and validating other fields
1371
+ oField.setValue(value);
1372
+ fnValidateRequiredProperties();
1373
+ return oField.getValue();
1374
+ })
1375
+ .catch(function (value: any) {
1376
+ if (value !== "") {
1377
+ //disabling the continue button in case of invalid value in field
1378
+ oCreateButton.setEnabled(false);
1379
+ } else {
1380
+ // validating all the fields in case of empty value in field
1381
+ oField.setValue(value);
1382
+ fnValidateRequiredProperties();
1383
+ }
1384
+ });
1385
+ }
1386
+ }
1387
+
1362
1388
  _launchDialogWithKeyFields(
1363
1389
  oListBinding: any,
1364
1390
  oTransientListBinding: any,
@@ -1373,7 +1399,7 @@ class TransactionHelper {
1373
1399
  let oDialog: Dialog;
1374
1400
  const oParentControl = mParameters.parentControl,
1375
1401
  bSuccess = false;
1376
- return new Promise(function(resolve: (value: any) => void, reject: (reason?: any) => void) {
1402
+ return new Promise(function (resolve: (value: any) => void, reject: (reason?: any) => void) {
1377
1403
  const sFragmentName = "sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog";
1378
1404
  const oFragment = XMLTemplateProcessor.loadTemplate(sFragmentName, "fragment"),
1379
1405
  oResourceBundle = oParentControl.getController().oResourceBundle,
@@ -1404,42 +1430,43 @@ class TransactionHelper {
1404
1430
  }
1405
1431
  }
1406
1432
  )
1407
- ).then(function(oFragment: any) {
1433
+ ).then(function (oFragment: any) {
1408
1434
  let aFormElements: any[] = [];
1409
1435
  const mFieldValueMap: any = {};
1410
1436
  let oCreateButton: Button;
1411
- const validateRequiredProperties = function() {
1437
+ const validateRequiredProperties = function () {
1412
1438
  return Promise.all(
1413
1439
  aFormElements
1414
- .map(function(oFormElement: any) {
1440
+ .map(function (oFormElement: any) {
1415
1441
  return oFormElement.getFields()[0];
1416
1442
  })
1417
- .filter(function(oField: any) {
1418
- return oField.getRequired();
1443
+ .filter(function (oField: any) {
1444
+ // The continue button should remain disabled in case of error in any field of the create dialog
1445
+ return oField.getRequired() || (oField.getValueState() === ValueState.Error && oField.getValue() !== "");
1419
1446
  })
1420
- .map(function(oField: any) {
1447
+ .map(function (oField: any) {
1421
1448
  const sFieldId = oField.getId();
1422
1449
  if (sFieldId in mFieldValueMap) {
1423
1450
  return Promise.resolve(mFieldValueMap[sFieldId])
1424
- .then(function(vValue: any) {
1425
- return vValue;
1451
+ .then(function (vValue: any) {
1452
+ return oField.getValueState() === ValueState.Error ? undefined : vValue;
1426
1453
  })
1427
- .catch(function() {
1454
+ .catch(function () {
1428
1455
  return undefined;
1429
1456
  });
1430
1457
  }
1431
1458
  return oField.getValueState() === ValueState.Error ? undefined : oField.getValue();
1432
1459
  })
1433
1460
  )
1434
- .then(function(aResults: any[]) {
1435
- return aResults.every(function(vValue: any) {
1461
+ .then(function (aResults: any[]) {
1462
+ return aResults.every(function (vValue: any) {
1436
1463
  return vValue !== undefined && vValue !== null && vValue !== "";
1437
1464
  });
1438
1465
  })
1439
- .catch(function() {
1466
+ .catch(function () {
1440
1467
  return false;
1441
1468
  })
1442
- .then(function(bEnabled: boolean) {
1469
+ .then(function (bEnabled: boolean) {
1443
1470
  oCreateButton.setEnabled(bEnabled);
1444
1471
  });
1445
1472
  };
@@ -1450,24 +1477,16 @@ class TransactionHelper {
1450
1477
  liveChange is not fired when value is added from valuehelp.
1451
1478
  value validation is not done for create button enablement.
1452
1479
  */
1453
- handleChange: function(oEvent: any) {
1454
- messageHandler.removeTransitionMessages();
1455
- const oField = oEvent.getSource();
1480
+ handleChange: function (oEvent: any) {
1456
1481
  const sFieldId = oEvent.getParameter("id");
1457
- const oFieldPromise = oEvent.getParameter("promise");
1458
- if (oFieldPromise) {
1459
- mFieldValueMap[sFieldId] = oFieldPromise.then(function() {
1460
- return oField.getValue();
1461
- });
1462
- }
1463
- validateRequiredProperties();
1482
+ mFieldValueMap[sFieldId] = that._onFieldChange(oEvent, oCreateButton, messageHandler, validateRequiredProperties);
1464
1483
  },
1465
1484
  /*
1466
1485
  fired on key press. the create button is enabled when a value is added.
1467
1486
  liveChange is not fired when value is added from valuehelp.
1468
1487
  value validation is not done for create button enablement.
1469
1488
  */
1470
- handleLiveChange: function(oEvent: any) {
1489
+ handleLiveChange: function (oEvent: any) {
1471
1490
  const sFieldId = oEvent.getParameter("id");
1472
1491
  const vValue = oEvent.getParameter("value");
1473
1492
  mFieldValueMap[sFieldId] = vValue;
@@ -1477,28 +1496,28 @@ class TransactionHelper {
1477
1496
  return Fragment.load({
1478
1497
  definition: oFragment,
1479
1498
  controller: oController
1480
- }).then(function(oDialogContent: any) {
1499
+ }).then(function (oDialogContent: any) {
1481
1500
  oDialog = new Dialog({
1482
1501
  title: CommonUtils.getTranslatedText("C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE", oResourceBundle),
1483
1502
  content: [oDialogContent],
1484
1503
  beginButton: {
1485
1504
  text: CommonUtils.getTranslatedText("C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE_BUTTON", oResourceBundle),
1486
1505
  type: "Emphasized",
1487
- press: function(oEvent: any) {
1506
+ press: function (oEvent: any) {
1488
1507
  const oCreateButton = oEvent.getSource();
1489
1508
  oCreateButton.setEnabled(false);
1490
1509
  BusyLocker.lock(oDialog);
1491
1510
  mParameters.bIsCreateDialog = true;
1492
1511
  return Promise.all(
1493
- Object.keys(mFieldValueMap).map(function(sKey: string) {
1494
- return mFieldValueMap[sKey].then(function(oValue: any) {
1512
+ Object.keys(mFieldValueMap).map(function (sKey: string) {
1513
+ return mFieldValueMap[sKey].then(function (oValue: any) {
1495
1514
  const oDialogValue: any = {};
1496
1515
  oDialogValue[sKey] = oValue;
1497
1516
  return oDialogValue;
1498
1517
  });
1499
1518
  })
1500
1519
  )
1501
- .then(function(aValues: any[]) {
1520
+ .then(function (aValues: any[]) {
1502
1521
  let onBeforeCreatePromise;
1503
1522
  if (mParameters.beforeCreateCallBack) {
1504
1523
  onBeforeCreatePromise = mParameters.beforeCreateCallBack({
@@ -1510,7 +1529,7 @@ class TransactionHelper {
1510
1529
  }
1511
1530
  return onBeforeCreatePromise;
1512
1531
  })
1513
- .then(function() {
1532
+ .then(function () {
1514
1533
  const oPromise = that.onAfterCreateCompletion(
1515
1534
  oTransientListBinding,
1516
1535
  oTransientContext,
@@ -1519,17 +1538,17 @@ class TransactionHelper {
1519
1538
  oModel.submitBatch("submitLater");
1520
1539
  return oPromise;
1521
1540
  })
1522
- .then(function(oResponse: any) {
1541
+ .then(function (oResponse: any) {
1523
1542
  if (!oResponse || (oResponse && oResponse.bKeepDialogOpen !== true)) {
1524
1543
  oDialog.setBindingContext(null as any);
1525
1544
  oDialog.close();
1526
1545
  resolve(oResponse);
1527
1546
  }
1528
1547
  })
1529
- .catch(function(oError: any) {
1548
+ .catch(function (oError: any) {
1530
1549
  reject(oError);
1531
1550
  })
1532
- .finally(function() {
1551
+ .finally(function () {
1533
1552
  BusyLocker.unlock(oDialog);
1534
1553
  oCreateButton.setEnabled(true);
1535
1554
  return messageHandler.showMessages();
@@ -1538,11 +1557,11 @@ class TransactionHelper {
1538
1557
  },
1539
1558
  endButton: {
1540
1559
  text: CommonUtils.getTranslatedText("C_COMMON_ACTION_PARAMETER_DIALOG_CANCEL", oResourceBundle),
1541
- press: function() {
1560
+ press: function () {
1542
1561
  oDialog.close();
1543
1562
  }
1544
1563
  },
1545
- afterClose: function() {
1564
+ afterClose: function () {
1546
1565
  // show footer as per UX guidelines when dialog is not open
1547
1566
  (oDialog.getBindingContext("internal") as InternalModelContext)?.setProperty("isCreateDialogOpen", false);
1548
1567
  oDialog.destroy();
@@ -1572,14 +1591,14 @@ class TransactionHelper {
1572
1591
  mParameters.createAction,
1573
1592
  mParameters.data
1574
1593
  )
1575
- .then(function() {
1594
+ .then(function () {
1576
1595
  validateRequiredProperties();
1577
1596
  // footer must not be visible when the dialog is open as per UX guidelines
1578
1597
  (oDialog.getBindingContext("internal") as InternalModelContext).setProperty("isCreateDialogOpen", true);
1579
1598
  oDialog.open();
1580
1599
  })
1581
- .catch(function(oError: any) {
1582
- return messageHandler.showMessages().then(function() {
1600
+ .catch(function (oError: any) {
1601
+ return messageHandler.showMessages().then(function () {
1583
1602
  return Promise.reject(oError);
1584
1603
  });
1585
1604
  });
@@ -1589,14 +1608,14 @@ class TransactionHelper {
1589
1608
  }
1590
1609
  onAfterCreateCompletion(oListBinding: any, oNewDocumentContext: any, mParameters: any) {
1591
1610
  let fnResolve: Function, fnReject: Function;
1592
- const oPromise = new Promise(function(resolve, reject) {
1611
+ const oPromise = new Promise(function (resolve, reject) {
1593
1612
  fnResolve = resolve;
1594
1613
  fnReject = reject;
1595
1614
  });
1596
1615
  // eslint-disable-next-line @typescript-eslint/no-this-alias
1597
1616
  const that = this;
1598
1617
  // Workaround suggested by OData model v4 colleagues
1599
- const fnCreateCompleted = function(oEvent: any) {
1618
+ const fnCreateCompleted = function (oEvent: any) {
1600
1619
  const oContext = oEvent.getParameter("context"),
1601
1620
  bSuccess = oEvent.getParameter("success");
1602
1621
  if (oContext === oNewDocumentContext) {
@@ -1609,10 +1628,10 @@ class TransactionHelper {
1609
1628
  // this is needed to avoid console errors TO be checked with model colleagues
1610
1629
  oContext
1611
1630
  .created()
1612
- .then(undefined, function() {
1631
+ .then(undefined, function () {
1613
1632
  Log.trace("transient creation context deleted");
1614
1633
  })
1615
- .catch(function(oError: any) {
1634
+ .catch(function (oError: any) {
1616
1635
  Log.trace("transient creation context deletion error", oError);
1617
1636
  });
1618
1637
  if (!mParameters.bIsCreateDialog) {
@@ -1690,11 +1709,11 @@ class TransactionHelper {
1690
1709
  sNewAction: string,
1691
1710
  oResourceBundleCore: ResourceBundle
1692
1711
  ) {
1693
- const fnGetLabelFromLineItemAnnotation = function() {
1712
+ const fnGetLabelFromLineItemAnnotation = function () {
1694
1713
  if (oMetaModel && oMetaModel.getObject(sMetaPath + "/@com.sap.vocabularies.UI.v1.LineItem")) {
1695
1714
  const iLineItemIndex = oMetaModel
1696
1715
  .getObject(sMetaPath + "/@com.sap.vocabularies.UI.v1.LineItem")
1697
- .findIndex(function(oLineItem: any) {
1716
+ .findIndex(function (oLineItem: any) {
1698
1717
  const aLineItemAction = oLineItem.Action ? oLineItem.Action.split("(") : undefined;
1699
1718
  return aLineItemAction ? aLineItemAction[0] === sNewAction : false;
1700
1719
  });