@sapui5/sap.fe.core 1.99.0 → 1.100.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 (246) hide show
  1. package/package.json +4 -2
  2. package/src/sap/fe/core/.library +1 -1
  3. package/src/sap/fe/core/AnnotationHelper.js +1 -69
  4. package/src/sap/fe/core/AnnotationHelper.ts +0 -70
  5. package/src/sap/fe/core/AppComponent.js +388 -399
  6. package/src/sap/fe/core/AppComponent.ts +403 -0
  7. package/src/sap/fe/core/AppStateHandler.js +127 -158
  8. package/src/sap/fe/core/BaseController.js +82 -58
  9. package/src/sap/fe/core/BaseController.ts +68 -0
  10. package/src/sap/fe/core/CommonUtils.js +111 -20
  11. package/src/sap/fe/core/CommonUtils.ts +131 -32
  12. package/src/sap/fe/core/ExtensionAPI.js +278 -274
  13. package/src/sap/fe/core/ExtensionAPI.ts +250 -0
  14. package/src/sap/fe/core/PageController.js +157 -29
  15. package/src/sap/fe/core/PageController.ts +60 -32
  16. package/src/sap/fe/core/RouterProxy.js +694 -756
  17. package/src/sap/fe/core/RouterProxy.ts +11 -9
  18. package/src/sap/fe/core/Synchronization.js +21 -31
  19. package/src/sap/fe/core/TemplateComponent.js +1 -1
  20. package/src/sap/fe/core/TemplateComponent.ts +10 -3
  21. package/src/sap/fe/core/TemplateModel.js +20 -38
  22. package/src/sap/fe/core/TemplateModel.ts +1 -1
  23. package/src/sap/fe/core/TransactionHelper.js +1354 -1370
  24. package/src/sap/fe/core/TransactionHelper.ts +33 -22
  25. package/src/sap/fe/core/actions/collaboration/ActivitySync.js +392 -0
  26. package/src/sap/fe/core/actions/collaboration/ActivitySync.ts +355 -0
  27. package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +136 -0
  28. package/src/sap/fe/core/actions/collaboration/CollaborationCommon.ts +119 -0
  29. package/src/sap/fe/core/actions/collaboration/Manage.js +262 -0
  30. package/src/sap/fe/core/actions/collaboration/Manage.ts +244 -0
  31. package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +103 -0
  32. package/src/sap/fe/core/actions/collaboration/UserDetails.fragment.xml +13 -0
  33. package/src/sap/fe/core/actions/draft.js +30 -68
  34. package/src/sap/fe/core/actions/draft.ts +44 -71
  35. package/src/sap/fe/core/actions/messageHandling.js +55 -36
  36. package/src/sap/fe/core/actions/messageHandling.ts +66 -46
  37. package/src/sap/fe/core/actions/operations.js +34 -15
  38. package/src/sap/fe/core/actions/operations.ts +48 -18
  39. package/src/sap/fe/core/actions/sticky.js +17 -4
  40. package/src/sap/fe/core/actions/sticky.ts +21 -4
  41. package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +69 -66
  42. package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.ts +65 -0
  43. package/src/sap/fe/core/controllerextensions/EditFlow.js +1593 -1669
  44. package/src/sap/fe/core/controllerextensions/EditFlow.ts +1672 -0
  45. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +79 -54
  46. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +61 -0
  47. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +718 -779
  48. package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +783 -0
  49. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +796 -816
  50. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +803 -0
  51. package/src/sap/fe/core/controllerextensions/InternalRouting.js +1004 -1005
  52. package/src/sap/fe/core/controllerextensions/InternalRouting.ts +978 -0
  53. package/src/sap/fe/core/controllerextensions/KPIManagement.js +487 -521
  54. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +2 -2
  55. package/src/sap/fe/core/controllerextensions/MassEdit.js +141 -169
  56. package/src/sap/fe/core/controllerextensions/MassEdit.ts +156 -0
  57. package/src/sap/fe/core/controllerextensions/MessageHandler.js +233 -244
  58. package/src/sap/fe/core/controllerextensions/MessageHandler.ts +225 -0
  59. package/src/sap/fe/core/controllerextensions/PageReady.js +301 -336
  60. package/src/sap/fe/core/controllerextensions/PageReady.ts +12 -10
  61. package/src/sap/fe/core/controllerextensions/Paginator.js +188 -175
  62. package/src/sap/fe/core/controllerextensions/Paginator.ts +163 -0
  63. package/src/sap/fe/core/controllerextensions/Placeholder.js +157 -149
  64. package/src/sap/fe/core/controllerextensions/Placeholder.ts +151 -0
  65. package/src/sap/fe/core/controllerextensions/Routing.js +144 -125
  66. package/src/sap/fe/core/controllerextensions/Routing.ts +132 -0
  67. package/src/sap/fe/core/controllerextensions/RoutingListener.js +7 -6
  68. package/src/sap/fe/core/controllerextensions/RoutingListener.ts +3 -0
  69. package/src/sap/fe/core/controllerextensions/Share.js +230 -268
  70. package/src/sap/fe/core/controllerextensions/Share.ts +231 -0
  71. package/src/sap/fe/core/controllerextensions/SideEffects.js +592 -633
  72. package/src/sap/fe/core/controllerextensions/SideEffects.ts +8 -7
  73. package/src/sap/fe/core/controllerextensions/ViewState.js +788 -806
  74. package/src/sap/fe/core/controllerextensions/ViewState.ts +805 -0
  75. package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +2 -2
  76. package/src/sap/fe/core/controls/ActionPartial.fragment.xml +2 -2
  77. package/src/sap/fe/core/controls/CommandExecution.js +67 -66
  78. package/src/sap/fe/core/controls/CommandExecution.ts +72 -0
  79. package/src/sap/fe/core/controls/ConditionalWrapper.js +90 -75
  80. package/src/sap/fe/core/controls/ConditionalWrapper.ts +83 -0
  81. package/src/sap/fe/core/controls/CustomQuickViewPage.js +130 -125
  82. package/src/sap/fe/core/controls/CustomQuickViewPage.ts +126 -0
  83. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +103 -112
  84. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +101 -0
  85. package/src/sap/fe/core/controls/FieldWrapper.js +122 -135
  86. package/src/sap/fe/core/controls/FieldWrapper.ts +115 -0
  87. package/src/sap/fe/core/controls/FilterBar.js +162 -159
  88. package/src/sap/fe/core/controls/FilterBar.ts +143 -0
  89. package/src/sap/fe/core/controls/FormElementWrapper.js +45 -39
  90. package/src/sap/fe/core/controls/FormElementWrapper.ts +40 -0
  91. package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +37 -42
  92. package/src/sap/fe/core/controls/MultiValueParameterDelegate.ts +31 -0
  93. package/src/sap/fe/core/controls/filterbar/FilterContainer.js +126 -116
  94. package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +98 -0
  95. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +241 -255
  96. package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +245 -0
  97. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +150 -141
  98. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +125 -0
  99. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +335 -322
  100. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +337 -0
  101. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +74 -74
  102. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +70 -0
  103. package/src/sap/fe/core/converters/ConverterContext.js +348 -379
  104. package/src/sap/fe/core/converters/ConverterContext.ts +19 -16
  105. package/src/sap/fe/core/converters/ManifestSettings.js +12 -1
  106. package/src/sap/fe/core/converters/ManifestSettings.ts +12 -1
  107. package/src/sap/fe/core/converters/ManifestWrapper.js +354 -378
  108. package/src/sap/fe/core/converters/ManifestWrapper.ts +10 -0
  109. package/src/sap/fe/core/converters/MetaModelConverter.js +6 -4
  110. package/src/sap/fe/core/converters/MetaModelConverter.ts +5 -2
  111. package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
  112. package/src/sap/fe/core/converters/TemplateConverter.ts +2 -1
  113. package/src/sap/fe/core/converters/annotations/DataField.js +26 -12
  114. package/src/sap/fe/core/converters/annotations/DataField.ts +37 -13
  115. package/src/sap/fe/core/converters/controls/Common/Form.js +2 -2
  116. package/src/sap/fe/core/converters/controls/Common/Form.ts +4 -2
  117. package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
  118. package/src/sap/fe/core/converters/controls/Common/KPI.ts +3 -2
  119. package/src/sap/fe/core/converters/controls/Common/Table.js +130 -23
  120. package/src/sap/fe/core/converters/controls/Common/Table.ts +134 -29
  121. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +118 -53
  122. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +156 -93
  123. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +161 -207
  124. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +148 -206
  125. package/src/sap/fe/core/converters/helpers/Aggregation.js +115 -133
  126. package/src/sap/fe/core/converters/helpers/BindingHelper.js +20 -6
  127. package/src/sap/fe/core/converters/helpers/BindingHelper.ts +16 -4
  128. package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +12 -1
  129. package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +11 -0
  130. package/src/sap/fe/core/converters/helpers/Key.js +42 -57
  131. package/src/sap/fe/core/converters/helpers/Key.ts +1 -1
  132. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +25 -4
  133. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +20 -3
  134. package/src/sap/fe/core/converters/templates/ListReportConverter.js +10 -4
  135. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +15 -4
  136. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +7 -5
  137. package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +5 -1
  138. package/src/sap/fe/core/designtime/AppComponent.designtime.js +92 -98
  139. package/src/sap/fe/core/designtime/AppComponent.designtime.ts +91 -0
  140. package/src/sap/fe/core/formatters/CollaborationFormatter.js +104 -0
  141. package/src/sap/fe/core/formatters/CollaborationFormatter.ts +60 -0
  142. package/src/sap/fe/core/formatters/TableFormatter.js +53 -2
  143. package/src/sap/fe/core/formatters/TableFormatter.ts +51 -0
  144. package/src/sap/fe/core/fpm/Component.js +50 -54
  145. package/src/sap/fe/core/fpm/Component.ts +48 -0
  146. package/src/sap/fe/core/helpers/AppStartupHelper.js +323 -309
  147. package/src/sap/fe/core/helpers/AppStartupHelper.ts +363 -337
  148. package/src/sap/fe/core/helpers/BindingExpression.js +7 -7
  149. package/src/sap/fe/core/helpers/BindingExpression.ts +7 -7
  150. package/src/sap/fe/core/helpers/ClassSupport.js +186 -62
  151. package/src/sap/fe/core/helpers/ClassSupport.ts +168 -52
  152. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +5 -4
  153. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +1 -5
  154. package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
  155. package/src/sap/fe/core/helpers/FPMHelper.ts +1 -1
  156. package/src/sap/fe/core/helpers/MassEditHelper.js +601 -684
  157. package/src/sap/fe/core/helpers/MassEditHelper.ts +699 -0
  158. package/src/sap/fe/core/helpers/ModelHelper.js +25 -1
  159. package/src/sap/fe/core/helpers/ModelHelper.ts +23 -0
  160. package/src/sap/fe/core/helpers/SemanticDateOperators.js +5 -1
  161. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +4 -0
  162. package/src/sap/fe/core/library.js +426 -451
  163. package/src/sap/fe/core/library.support.js +22 -33
  164. package/src/sap/fe/core/library.support.ts +23 -0
  165. package/src/sap/fe/core/library.ts +420 -0
  166. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +5 -3
  167. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +4 -1
  168. package/src/sap/fe/core/messagebundle.properties +22 -5
  169. package/src/sap/fe/core/messagebundle_ar.properties +27 -7
  170. package/src/sap/fe/core/messagebundle_bg.properties +27 -7
  171. package/src/sap/fe/core/messagebundle_ca.properties +27 -7
  172. package/src/sap/fe/core/messagebundle_cs.properties +27 -7
  173. package/src/sap/fe/core/messagebundle_cy.properties +27 -7
  174. package/src/sap/fe/core/messagebundle_da.properties +27 -7
  175. package/src/sap/fe/core/messagebundle_de.properties +27 -7
  176. package/src/sap/fe/core/messagebundle_el.properties +27 -7
  177. package/src/sap/fe/core/messagebundle_en.properties +27 -7
  178. package/src/sap/fe/core/messagebundle_en_GB.properties +27 -7
  179. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +27 -7
  180. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +27 -7
  181. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +27 -7
  182. package/src/sap/fe/core/messagebundle_es.properties +27 -7
  183. package/src/sap/fe/core/messagebundle_es_MX.properties +27 -7
  184. package/src/sap/fe/core/messagebundle_et.properties +27 -7
  185. package/src/sap/fe/core/messagebundle_fi.properties +28 -8
  186. package/src/sap/fe/core/messagebundle_fr.properties +28 -8
  187. package/src/sap/fe/core/messagebundle_fr_CA.properties +29 -9
  188. package/src/sap/fe/core/messagebundle_hi.properties +27 -7
  189. package/src/sap/fe/core/messagebundle_hr.properties +27 -7
  190. package/src/sap/fe/core/messagebundle_hu.properties +27 -7
  191. package/src/sap/fe/core/messagebundle_id.properties +27 -7
  192. package/src/sap/fe/core/messagebundle_it.properties +27 -7
  193. package/src/sap/fe/core/messagebundle_iw.properties +27 -7
  194. package/src/sap/fe/core/messagebundle_ja.properties +26 -6
  195. package/src/sap/fe/core/messagebundle_kk.properties +27 -7
  196. package/src/sap/fe/core/messagebundle_ko.properties +27 -7
  197. package/src/sap/fe/core/messagebundle_lt.properties +27 -7
  198. package/src/sap/fe/core/messagebundle_lv.properties +28 -8
  199. package/src/sap/fe/core/messagebundle_ms.properties +27 -7
  200. package/src/sap/fe/core/messagebundle_nl.properties +27 -7
  201. package/src/sap/fe/core/messagebundle_no.properties +27 -7
  202. package/src/sap/fe/core/messagebundle_pl.properties +27 -7
  203. package/src/sap/fe/core/messagebundle_pt.properties +28 -8
  204. package/src/sap/fe/core/messagebundle_pt_PT.properties +27 -7
  205. package/src/sap/fe/core/messagebundle_ro.properties +27 -7
  206. package/src/sap/fe/core/messagebundle_ru.properties +27 -7
  207. package/src/sap/fe/core/messagebundle_sh.properties +27 -7
  208. package/src/sap/fe/core/messagebundle_sk.properties +27 -7
  209. package/src/sap/fe/core/messagebundle_sl.properties +27 -7
  210. package/src/sap/fe/core/messagebundle_sv.properties +27 -7
  211. package/src/sap/fe/core/messagebundle_th.properties +26 -6
  212. package/src/sap/fe/core/messagebundle_tr.properties +30 -10
  213. package/src/sap/fe/core/messagebundle_uk.properties +27 -7
  214. package/src/sap/fe/core/messagebundle_vi.properties +27 -7
  215. package/src/sap/fe/core/messagebundle_zh_CN.properties +27 -7
  216. package/src/sap/fe/core/messagebundle_zh_TW.properties +27 -7
  217. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +45 -71
  218. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +154 -192
  219. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +4 -4
  220. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +66 -92
  221. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +1 -1
  222. package/src/sap/fe/core/services/NavigationServiceFactory.js +284 -339
  223. package/src/sap/fe/core/services/NavigationServiceFactory.ts +10 -13
  224. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +67 -102
  225. package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +5 -2
  226. package/src/sap/fe/core/services/RoutingServiceFactory.js +754 -814
  227. package/src/sap/fe/core/services/RoutingServiceFactory.ts +13 -13
  228. package/src/sap/fe/core/services/ShellServicesFactory.js +649 -736
  229. package/src/sap/fe/core/services/ShellServicesFactory.ts +7 -4
  230. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +567 -592
  231. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +22 -3
  232. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +354 -386
  233. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +21 -14
  234. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +1 -1
  235. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +1 -1
  236. package/src/sap/fe/core/support/CommonHelper.js +1 -1
  237. package/src/sap/fe/core/support/CommonHelper.ts +1 -1
  238. package/src/sap/fe/core/support/Diagnostics.js +36 -48
  239. package/src/sap/fe/core/templating/DataModelPathHelper.js +93 -85
  240. package/src/sap/fe/core/templating/DataModelPathHelper.ts +104 -95
  241. package/src/sap/fe/core/templating/FilterHelper.js +25 -32
  242. package/src/sap/fe/core/templating/FilterHelper.ts +36 -35
  243. package/src/sap/fe/core/templating/PropertyHelper.js +2 -2
  244. package/src/sap/fe/core/templating/PropertyHelper.ts +1 -1
  245. package/src/sap/fe/core/templating/UIFormatters.js +32 -26
  246. package/src/sap/fe/core/templating/UIFormatters.ts +37 -24
@@ -18,7 +18,7 @@ import { getSelectionVariant } from "../Common/DataVisualization";
18
18
  import { KeyHelper } from "sap/fe/core/converters/helpers/Key";
19
19
  import { IssueType, IssueSeverity, IssueCategory } from "sap/fe/core/converters/helpers/IssueManager";
20
20
  import { PropertyPath } from "@sap-ux/vocabularies-types/dist/Edm";
21
- import { hasValueHelp } from "sap/fe/core/templating/PropertyHelper";
21
+ //import { hasValueHelp } from "sap/fe/core/templating/PropertyHelper";
22
22
 
23
23
  export type FilterField = ConfigurableObject & {
24
24
  type?: string;
@@ -45,6 +45,9 @@ enum filterFieldType {
45
45
  Slot = "Slot"
46
46
  }
47
47
 
48
+ const sEdmString = "Edm.String";
49
+ const sStringDataType = "sap.ui.model.odata.type.String";
50
+
48
51
  export type CustomElementFilterField = CustomElement<FilterField>;
49
52
 
50
53
  /**
@@ -513,7 +516,7 @@ const getSearchFilterPropertyInfo = function() {
513
516
  return {
514
517
  name: "$search",
515
518
  path: "$search",
516
- dataType: "Edm.String",
519
+ dataType: sStringDataType,
517
520
  maxConditions: 1
518
521
  };
519
522
  };
@@ -524,8 +527,7 @@ const getEditStateFilterPropertyInfo = function() {
524
527
  path: "$editState",
525
528
  groupLabel: "",
526
529
  group: "",
527
- dataType: "Edm.String",
528
- tooltip: null,
530
+ dataType: sStringDataType,
529
531
  hiddenFilter: false
530
532
  };
531
533
  };
@@ -556,20 +558,16 @@ const _fetchBasicPropertyInfo = function(oFilterFieldInfo: any) {
556
558
  annotationPath: oFilterFieldInfo.annotationPath,
557
559
  conditionPath: oFilterFieldInfo.conditionPath,
558
560
  name: oFilterFieldInfo.conditionPath,
559
- path: oFilterFieldInfo.conditionPath,
560
- groupLabel: oFilterFieldInfo.groupLabel,
561
- group: oFilterFieldInfo.group,
562
561
  label: oFilterFieldInfo.label,
563
- tooltip: null,
564
562
  hiddenFilter: oFilterFieldInfo.availability === "Hidden",
565
- removeFromAppState: false,
566
- hasValueHelp: false,
567
563
  display: "Value",
568
564
  isParameter: oFilterFieldInfo.isParameter,
569
565
  caseSensitive: oFilterFieldInfo.caseSensitive,
570
566
  availability: oFilterFieldInfo.availability,
571
567
  position: oFilterFieldInfo.position,
572
- type: oFilterFieldInfo.type
568
+ type: oFilterFieldInfo.type,
569
+ template: oFilterFieldInfo.template,
570
+ menu: oFilterFieldInfo.menu
573
571
  };
574
572
  };
575
573
 
@@ -616,42 +614,16 @@ const _fetchPropertyInfo = function(converterContext: ConverterContext, oFilterF
616
614
  return oPropertyInfo;
617
615
  }
618
616
  const targetPropertyObject = converterContext.getConverterContextFor(sAnnotationPath).getDataModelObjectPath().targetObject;
619
- const oProperty = {
620
- $MaxLength: targetPropertyObject.maxLength,
621
- $Type: targetPropertyObject.type,
622
- $kind: targetPropertyObject._type
623
- };
617
+
624
618
  const oPropertyAnnotations = targetPropertyObject?.annotations;
625
619
  const oCollectionAnnotations = converterContext?.getDataModelObjectPath().targetObject?.annotations;
626
620
 
627
- let oFilterDefaultValue;
628
621
  const oFormatOptions = oTypeConfig.formatOptions;
629
622
  const oConstraints = oTypeConfig.constraints;
630
- const bRemoveFromAppState =
631
- oPropertyAnnotations?.PersonalData?.IsPotentiallySensitive ||
632
- oPropertyAnnotations?.ExcludeFromNavigationContext ||
633
- oPropertyAnnotations?.Analytics?.Measure;
634
-
635
- const oFilterDefaultValueAnnotation = oPropertyAnnotations?.Common?.FilterDefaultValue;
636
- if (oFilterDefaultValueAnnotation) {
637
- oFilterDefaultValue = oFilterDefaultValueAnnotation["$" + getModelType(oProperty.$Type)];
638
- }
639
623
  oPropertyInfo = Object.assign(oPropertyInfo, {
640
- tooltip: oPropertyAnnotations?.Common?.QuickInfo?.valueOf() || undefined,
641
- removeFromAppState: bRemoveFromAppState,
642
- hasValueHelp: hasValueHelp(targetPropertyObject),
643
624
  formatOptions: oFormatOptions,
644
625
  constraints: oConstraints,
645
- display: displayMode(oPropertyAnnotations, oCollectionAnnotations),
646
- defaultFilterConditions: oFilterDefaultValue
647
- ? [
648
- {
649
- fieldPath: oFilterFieldInfo.conditionPath,
650
- operator: "EQ",
651
- values: [oFilterDefaultValue]
652
- }
653
- ]
654
- : undefined
626
+ display: displayMode(oPropertyAnnotations, oCollectionAnnotations)
655
627
  });
656
628
  return oPropertyInfo;
657
629
  };
@@ -725,11 +697,115 @@ const getAnnotatedSelectionFieldData = function(
725
697
  propertyInfoFields: propertyInfoFields
726
698
  };
727
699
  };
700
+ export const processSelectionFields = function(propertyInfoFields: any, converterContext: ConverterContext) {
701
+ //get TypeConfig function
702
+ const aTypeConfig: any = [];
703
+ const selectionFieldTypes: any = [];
704
+ const _fnTypeConfig = function(property: Property) {
705
+ const oTypeConfig = getTypeConfig(property, undefined);
706
+ selectionFieldTypes.push(property?.type);
707
+ if (property?.type === sEdmString && (!oTypeConfig.constraints.nullable || oTypeConfig.constraints.nullable === true)) {
708
+ oTypeConfig.formatOptions.parseKeepsEmptyString = false;
709
+ }
710
+ aTypeConfig.push(oTypeConfig);
711
+ };
712
+
713
+ //add typeConfig
714
+ propertyInfoFields.forEach(function(parameterField: any) {
715
+ if (parameterField.annotationPath) {
716
+ const propertyConvertyContext = converterContext.getConverterContextFor(parameterField.annotationPath);
717
+ const propertyTargetObject = propertyConvertyContext.getDataModelObjectPath().targetObject;
718
+ _fnTypeConfig(propertyTargetObject);
719
+ } else {
720
+ selectionFieldTypes.push(sEdmString);
721
+ aTypeConfig.push({ type: sStringDataType });
722
+ }
723
+ });
724
+
725
+ // filterRestrictions
726
+ const oFilterRestrictions = converterContext.getEntitySet()?.annotations?.Capabilities?.FilterRestrictions;
727
+ const oRet = {} as any;
728
+ oRet["RequiredProperties"] = getFilterRestrictions(oFilterRestrictions, "RequiredProperties") || [];
729
+ oRet["NonFilterableProperties"] = getFilterRestrictions(oFilterRestrictions, "NonFilterableProperties") || [];
730
+ oRet["FilterAllowedExpressions"] = getFilterRestrictions(oFilterRestrictions, "FilterAllowedExpressions") || {};
731
+
732
+ const sEntitySetPath = converterContext.getContextPath();
733
+ const aPathParts = sEntitySetPath.split("/");
734
+ if (aPathParts.length > 2) {
735
+ const sNavigationPath = aPathParts[aPathParts.length - 1];
736
+ aPathParts.splice(-1, 1);
737
+ const oNavigationRestrictions = getNavigationRestrictions(converterContext, sNavigationPath);
738
+ const oNavigationFilterRestrictions = oNavigationRestrictions && oNavigationRestrictions.FilterRestrictions;
739
+ oRet.RequiredProperties.concat(getFilterRestrictions(oNavigationFilterRestrictions, "RequiredProperties") || []);
740
+ oRet.NonFilterableProperties.concat(getFilterRestrictions(oNavigationFilterRestrictions, "NonFilterableProperties") || []);
741
+ oRet.FilterAllowedExpressions = {
742
+ ...(getFilterRestrictions(oNavigationFilterRestrictions, "FilterAllowedExpressions") || {}),
743
+ ...oRet.FilterAllowedExpressions
744
+ };
745
+ }
746
+ const isCaseSensitive = isFilteringCaseSensitive(converterContext);
747
+ const aRequiredProps = oRet.RequiredProperties;
748
+ const aNonFilterableProps = oRet.NonFilterableProperties;
749
+ let oPropertyInfo;
750
+ const aFetchedProperties: any = [];
751
+
752
+ // process the fields to add necessary properties
753
+ Object.keys(propertyInfoFields).forEach(function(sFilterFieldKey: string) {
754
+ const oConvertedProperty = propertyInfoFields[sFilterFieldKey];
755
+ let sPropertyPath;
756
+ if (oConvertedProperty.conditionPath) {
757
+ sPropertyPath = oConvertedProperty.conditionPath.replace(/\+|\*/g, "");
758
+ }
759
+ if (aNonFilterableProps.indexOf(sPropertyPath) === -1) {
760
+ oPropertyInfo = _fetchPropertyInfo(converterContext, oConvertedProperty, aTypeConfig[sFilterFieldKey]);
761
+ if (oPropertyInfo) {
762
+ oPropertyInfo = Object.assign(oPropertyInfo, {
763
+ maxConditions: !oPropertyInfo.isParameter && isMultiValue(oPropertyInfo) ? -1 : 1,
764
+ required: oPropertyInfo.isParameter || aRequiredProps.indexOf(sPropertyPath) >= 0,
765
+ caseSensitive: isCaseSensitive,
766
+ dataType: selectionFieldTypes[sFilterFieldKey]
767
+ });
768
+
769
+ aFetchedProperties.push(oPropertyInfo);
770
+ }
771
+ }
772
+ });
773
+
774
+ //add edit
775
+ if (converterContext.getDataModelObjectPath().targetObject?.annotations?.Common?.DraftRoot) {
776
+ aFetchedProperties.push(getEditStateFilterPropertyInfo());
777
+ }
778
+ // add search
779
+ const searchRestrictions = getSearchRestrictions(converterContext);
780
+ const hideBasicSearch = Boolean(searchRestrictions && !searchRestrictions.Searchable);
781
+ if (sEntitySetPath && hideBasicSearch !== true) {
782
+ if (!searchRestrictions || searchRestrictions?.Searchable) {
783
+ aFetchedProperties.push(getSearchFilterPropertyInfo());
784
+ }
785
+ }
786
+
787
+ return aFetchedProperties;
788
+ };
789
+
790
+ export const insertCustomManifestElements = function(
791
+ filterFields: FilterField[],
792
+ entityType: EntityType,
793
+ converterContext: ConverterContext
794
+ ) {
795
+ return insertCustomElements(filterFields, getManifestFilterFields(entityType, converterContext), {
796
+ "availability": "overwrite",
797
+ label: "overwrite",
798
+ type: "overwrite",
799
+ position: "overwrite",
800
+ template: "overwrite",
801
+ settings: "overwrite",
802
+ visualFilter: "overwrite"
803
+ });
804
+ };
728
805
 
729
806
  /**
730
807
  * Retrieve the configuration for the selection fields that will be used within the filter bar
731
808
  * This configuration takes into account annotation and the selection variants.
732
- *
733
809
  * @param {ConverterContext} converterContext
734
810
  * @param {TableVisualization[]} lrTables
735
811
  * @param {string} annotationPath
@@ -739,13 +815,39 @@ export const getSelectionFields = function(
739
815
  converterContext: ConverterContext,
740
816
  lrTables: TableVisualization[] = [],
741
817
  annotationPath: string = ""
742
- ): FilterField[] {
818
+ ): any {
743
819
  const oAnnotatedSelectionFieldData = getAnnotatedSelectionFieldData(converterContext, lrTables, annotationPath);
820
+ const parameterFields = _getParameterFields(converterContext);
821
+ let propertyInfoFields: FilterField[] = JSON.parse(JSON.stringify(oAnnotatedSelectionFieldData.propertyInfoFields));
822
+ const entityType = oAnnotatedSelectionFieldData.entityType;
823
+
824
+ propertyInfoFields = parameterFields.concat(propertyInfoFields);
744
825
 
826
+ propertyInfoFields = insertCustomManifestElements(propertyInfoFields, entityType, converterContext);
827
+
828
+ const aFetchedProperties = processSelectionFields(propertyInfoFields, converterContext);
829
+ aFetchedProperties.sort(function(a: any, b: any) {
830
+ if (a.groupLabel === undefined || a.groupLabel === null) {
831
+ return -1;
832
+ }
833
+ if (b.groupLabel === undefined || b.groupLabel === null) {
834
+ return 1;
835
+ }
836
+ return a.groupLabel.localeCompare(b.groupLabel);
837
+ });
838
+
839
+ let sFetchProperties = JSON.stringify(aFetchedProperties);
840
+ sFetchProperties = sFetchProperties.replace(/\{/g, "\\{");
841
+ sFetchProperties = sFetchProperties.replace(/\}/g, "\\}");
842
+ const sPropertyInfo = sFetchProperties;
843
+ // end of propertyFields processing
844
+
845
+ // to populate selection fields
846
+ let propSelectionFields: FilterField[] = JSON.parse(JSON.stringify(oAnnotatedSelectionFieldData.propertyInfoFields));
847
+ propSelectionFields = parameterFields.concat(propSelectionFields);
745
848
  // create a map of properties to be used in selection variants
746
849
  const excludedFilterProperties: Record<string, boolean> = oAnnotatedSelectionFieldData.excludedFilterProperties;
747
- const entityType = oAnnotatedSelectionFieldData.entityType;
748
- const filterFacets = entityType.annotations.UI?.FilterFacets;
850
+ const filterFacets = entityType?.annotations?.UI?.FilterFacets;
749
851
  let filterFacetMap: Record<string, FilterGroup> = {};
750
852
 
751
853
  const aFieldGroups = converterContext.getAnnotationsByTerm("UI", UIAnnotationTerms.FieldGroup);
@@ -788,24 +890,9 @@ export const getSelectionFields = function(
788
890
  excludedFilterProperties,
789
891
  annotatedSelectionFields
790
892
  );
791
- const parameterFields = _getParameterFields(converterContext);
792
- const propertyInfoFields: any =
793
- annotatedSelectionFields?.reduce((selectionFields: FilterField[], selectionField) => {
794
- const propertyPath = selectionField.value;
795
- if (!(propertyPath in excludedFilterProperties)) {
796
- const filterField: FilterField | undefined = _getFilterField(filterFields, propertyPath, converterContext, entityType);
797
- if (filterField) {
798
- filterField.group = "";
799
- filterField.groupLabel = "";
800
- selectionFields.push(filterField);
801
- }
802
- }
803
- return selectionFields;
804
- }, []) || [];
805
893
 
806
894
  // finally create final list of filter fields by adding the SelectionFields first (order matters)...
807
- let allFilters = parameterFields
808
- .concat(propertyInfoFields)
895
+ let allFilters = propSelectionFields
809
896
  // To add the FilterField which is not part of the Selection Fields but the property is mentioned in the Selection Variant
810
897
  .concat(defaultFilters || [])
811
898
  // ...and adding remaining filter fields, that are not used in a SelectionVariant (order doesn't matter)
@@ -832,15 +919,7 @@ export const getSelectionFields = function(
832
919
  }
833
920
  }
834
921
 
835
- const selectionFields = insertCustomElements(allFilters, getManifestFilterFields(entityType, converterContext), {
836
- "availability": "overwrite",
837
- label: "overwrite",
838
- type: "overwrite",
839
- position: "overwrite",
840
- template: "overwrite",
841
- settings: "overwrite",
842
- visualFilter: "overwrite"
843
- });
922
+ const selectionFields = insertCustomManifestElements(allFilters, entityType, converterContext);
844
923
 
845
924
  // Add caseSensitive property to all selection fields.
846
925
  const isCaseSensitive = isFilteringCaseSensitive(converterContext);
@@ -848,142 +927,5 @@ export const getSelectionFields = function(
848
927
  filterField.caseSensitive = isCaseSensitive;
849
928
  });
850
929
 
851
- return selectionFields;
852
- };
853
-
854
- export const getPropertyInfoFields = function(
855
- converterContext: ConverterContext,
856
- lrTables: TableVisualization[] = [],
857
- lrCharts: ChartVisualization[] = [],
858
- annotationPath: string = ""
859
- ) {
860
- const oAnnotatedSelectionFieldData = getAnnotatedSelectionFieldData(converterContext, lrTables, annotationPath);
861
- //const annotatedSelectionFields: any = oAnnotatedSelectionFieldData.annotatedSelectionFields;
862
- const selectionFieldTypes: any = [];
863
- const isCaseSensitive = isFilteringCaseSensitive(converterContext);
864
- const aTypeConfig: any = [];
865
- const _fnTypeConfig = function(property: Property) {
866
- const oTypeConfig = getTypeConfig(property, undefined);
867
- selectionFieldTypes.push(property?.type);
868
- if (property?.type === "Edm.String" && (!oTypeConfig.constraints.nullable || oTypeConfig.constraints.nullable === true)) {
869
- oTypeConfig.formatOptions.parseKeepsEmptyString = false;
870
- }
871
- aTypeConfig.push(oTypeConfig);
872
- };
873
-
874
- let propertyInfoFields: any = oAnnotatedSelectionFieldData.propertyInfoFields;
875
- const parameterFields = _getParameterFields(converterContext);
876
- propertyInfoFields = propertyInfoFields.concat(parameterFields);
877
-
878
- propertyInfoFields = insertCustomElements(
879
- propertyInfoFields,
880
- getManifestFilterFields(converterContext.getEntityType(), converterContext),
881
- {
882
- "availability": "overwrite",
883
- label: "overwrite",
884
- type: "overwrite",
885
- position: "overwrite",
886
- template: "overwrite",
887
- settings: "overwrite",
888
- visualFilter: "overwrite"
889
- }
890
- );
891
-
892
- propertyInfoFields.forEach(function(parameterField: any) {
893
- if (parameterField.annotationPath) {
894
- const propertyConvertyContext = converterContext.getConverterContextFor(parameterField.annotationPath);
895
- const propertyTargetObject = propertyConvertyContext.getDataModelObjectPath().targetObject;
896
- _fnTypeConfig(propertyTargetObject);
897
- } else {
898
- selectionFieldTypes.push("Edm.String");
899
- aTypeConfig.push({});
900
- }
901
- });
902
-
903
- const oFilterRestrictions = converterContext.getEntitySet()?.annotations?.Capabilities?.FilterRestrictions;
904
- const oRet = {} as any;
905
- oRet["RequiredProperties"] = getFilterRestrictions(oFilterRestrictions, "RequiredProperties") || [];
906
- oRet["NonFilterableProperties"] = getFilterRestrictions(oFilterRestrictions, "NonFilterableProperties") || [];
907
- oRet["FilterAllowedExpressions"] = getFilterRestrictions(oFilterRestrictions, "FilterAllowedExpressions") || {};
908
-
909
- const sEntitySetPath = converterContext.getContextPath();
910
- const aPathParts = sEntitySetPath.split("/");
911
- if (aPathParts.length > 2) {
912
- const sNavigationPath = aPathParts[aPathParts.length - 1];
913
- aPathParts.splice(-1, 1);
914
- const oNavigationRestrictions = getNavigationRestrictions(converterContext, sNavigationPath);
915
- const oNavigationFilterRestrictions = oNavigationRestrictions && oNavigationRestrictions.FilterRestrictions;
916
- oRet.RequiredProperties.concat(getFilterRestrictions(oNavigationFilterRestrictions, "RequiredProperties") || []);
917
- oRet.NonFilterableProperties.concat(getFilterRestrictions(oNavigationFilterRestrictions, "NonFilterableProperties") || []);
918
- oRet.FilterAllowedExpressions = {
919
- ...(getFilterRestrictions(oNavigationFilterRestrictions, "FilterAllowedExpressions") || {}),
920
- ...oRet.FilterAllowedExpressions
921
- };
922
- }
923
-
924
- const aRequiredProps = oRet.RequiredProperties;
925
- const aNonFilterableProps = oRet.NonFilterableProperties;
926
- const mAllowedExpressions = oRet.FilterAllowedExpressions;
927
- let oPropertyInfo;
928
- const aFetchedProperties: any = [],
929
- aParameterFields = [];
930
- Object.keys(propertyInfoFields).forEach(function(sFilterFieldKey: string) {
931
- const oConvertedProperty = propertyInfoFields[sFilterFieldKey];
932
- const sPropertyPath = oConvertedProperty.conditionPath.replace(/\+|\*/g, "");
933
-
934
- if (aNonFilterableProps.indexOf(sPropertyPath) === -1) {
935
- oPropertyInfo = _fetchPropertyInfo(converterContext, oConvertedProperty, aTypeConfig[sFilterFieldKey]);
936
- if (oPropertyInfo) {
937
- if (mAllowedExpressions[sPropertyPath] && mAllowedExpressions[sPropertyPath].length > 0) {
938
- oPropertyInfo = Object.assign(oPropertyInfo, {
939
- filterExpression: getSpecificAllowedExpression(mAllowedExpressions[sPropertyPath])
940
- });
941
- } else {
942
- oPropertyInfo = Object.assign(oPropertyInfo, {
943
- filterExpression: "auto"
944
- });
945
- }
946
- oPropertyInfo = Object.assign(oPropertyInfo, {
947
- maxConditions: !oPropertyInfo.isParameter && isMultiValue(oPropertyInfo) ? -1 : 1,
948
- required: oPropertyInfo.isParameter || aRequiredProps.indexOf(sPropertyPath) >= 0,
949
- caseSensitive: isCaseSensitive,
950
- visible: oConvertedProperty.availability === "Default",
951
- dataType: selectionFieldTypes[sFilterFieldKey]
952
- //label: getLocalizedText(oConvertedProperty.label)
953
- });
954
-
955
- aFetchedProperties.push(oPropertyInfo);
956
- if (oPropertyInfo.isParameter) {
957
- aParameterFields.push(sPropertyPath);
958
- }
959
- }
960
- }
961
- });
962
-
963
- if (converterContext.getDataModelObjectPath().targetObject?.annotations?.Common?.DraftRoot) {
964
- aFetchedProperties.push(getEditStateFilterPropertyInfo());
965
- }
966
-
967
- if (sEntitySetPath && getFilterBarhideBasicSearch(lrTables, lrCharts, converterContext) !== true) {
968
- const searchRestrictions = getSearchRestrictions(converterContext);
969
- if (!searchRestrictions || searchRestrictions?.Searchable) {
970
- aFetchedProperties.push(getSearchFilterPropertyInfo());
971
- }
972
- }
973
-
974
- aFetchedProperties.sort(function(a: any, b: any) {
975
- if (a.groupLabel === undefined || a.groupLabel === null) {
976
- return -1;
977
- }
978
- if (b.groupLabel === undefined || b.groupLabel === null) {
979
- return 1;
980
- }
981
- return a.groupLabel.localeCompare(b.groupLabel);
982
- });
983
-
984
- let sFetchProperties = JSON.stringify(aFetchedProperties);
985
- sFetchProperties = sFetchProperties.replace(/\{/g, "\\{");
986
- sFetchProperties = sFetchProperties.replace(/\}/g, "\\}");
987
-
988
- return sFetchProperties;
930
+ return { selectionFields, sPropertyInfo };
989
931
  };