@sapui5/sap.suite.ui.generic.template 1.131.1 → 1.132.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 (218) hide show
  1. package/package.json +1 -1
  2. package/src/sap/suite/ui/generic/template/.library +1 -1
  3. package/src/sap/suite/ui/generic/template/AnalyticalListPage/control/SmartFilterBarExt.js +3 -1
  4. package/src/sap/suite/ui/generic/template/AnalyticalListPage/control/SmartKpiTag.js +37 -11
  5. package/src/sap/suite/ui/generic/template/AnalyticalListPage/control/visualfilterbar/FilterItem.js +3 -1
  6. package/src/sap/suite/ui/generic/template/AnalyticalListPage/control/visualfilterbar/FilterItemMicroChart.js +19 -4
  7. package/src/sap/suite/ui/generic/template/AnalyticalListPage/control/visualfilterbar/SmartVisualFilterBar.js +46 -15
  8. package/src/sap/suite/ui/generic/template/AnalyticalListPage/controller/DropDownController.js +42 -17
  9. package/src/sap/suite/ui/generic/template/AnalyticalListPage/controller/KpiTagController.js +13 -3
  10. package/src/sap/suite/ui/generic/template/AnalyticalListPage/extensionAPI/ExtensionAPI.js +2 -2
  11. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_en_US_saptrc.properties +105 -105
  12. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_sk.properties +1 -1
  13. package/src/sap/suite/ui/generic/template/AnalyticalListPage/manifest.json +1 -1
  14. package/src/sap/suite/ui/generic/template/AnalyticalListPage/util/FilterUtil.js +17 -6
  15. package/src/sap/suite/ui/generic/template/Canvas/manifest.json +1 -1
  16. package/src/sap/suite/ui/generic/template/ListReport/controller/ControllerImplementation.js +44 -22
  17. package/src/sap/suite/ui/generic/template/ListReport/controller/IappStateHandler.js +18 -2
  18. package/src/sap/suite/ui/generic/template/ListReport/extensionAPI/ExtensionAPI.js +2 -2
  19. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n.properties +1 -4
  20. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ar.properties +1 -3
  21. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_bg.properties +1 -3
  22. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ca.properties +1 -3
  23. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_cnr.properties +1 -3
  24. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_cs.properties +1 -3
  25. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_cy.properties +1 -3
  26. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_da.properties +1 -3
  27. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_de.properties +1 -3
  28. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_el.properties +1 -3
  29. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_en.properties +1 -3
  30. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_en_GB.properties +1 -3
  31. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_en_US_saprigi.properties +1 -3
  32. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_en_US_saptrc.properties +58 -58
  33. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_es.properties +1 -3
  34. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_es_MX.properties +1 -3
  35. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_et.properties +1 -3
  36. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_fi.properties +1 -3
  37. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_fr.properties +1 -3
  38. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_fr_CA.properties +1 -3
  39. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_hi.properties +1 -3
  40. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_hr.properties +1 -3
  41. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_hu.properties +1 -3
  42. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_id.properties +1 -3
  43. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_it.properties +1 -3
  44. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_iw.properties +1 -3
  45. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ja.properties +1 -3
  46. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_kk.properties +1 -3
  47. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ko.properties +1 -3
  48. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_lt.properties +1 -3
  49. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_lv.properties +1 -3
  50. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_mk.properties +1 -3
  51. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ms.properties +1 -3
  52. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_nl.properties +1 -3
  53. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_no.properties +1 -3
  54. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_pl.properties +2 -4
  55. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_pt.properties +1 -3
  56. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_pt_PT.properties +1 -3
  57. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ro.properties +1 -3
  58. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ru.properties +1 -3
  59. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_sh.properties +1 -3
  60. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_sk.properties +1 -3
  61. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_sl.properties +1 -3
  62. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_sr.properties +1 -3
  63. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_sv.properties +1 -3
  64. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_th.properties +1 -3
  65. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_tr.properties +1 -3
  66. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_uk.properties +1 -3
  67. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_vi.properties +1 -3
  68. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_zh_CN.properties +1 -3
  69. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_zh_TW.properties +1 -3
  70. package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
  71. package/src/sap/suite/ui/generic/template/ListReport/view/fragments/BreakoutActionButtons.fragment.xml +3 -2
  72. package/src/sap/suite/ui/generic/template/ListReport/view/fragments/FullscreenPage.fragment.xml +1 -1
  73. package/src/sap/suite/ui/generic/template/ListReport/view/fragments/SmartList.fragment.xml +3 -3
  74. package/src/sap/suite/ui/generic/template/ListReport/view/fragments/SmartTable.fragment.xml +1 -0
  75. package/src/sap/suite/ui/generic/template/ObjectPage/controller/ControllerImplementation.js +107 -23
  76. package/src/sap/suite/ui/generic/template/ObjectPage/controller/SectionTitleHandler.js +34 -1
  77. package/src/sap/suite/ui/generic/template/ObjectPage/controller/inlineCreationRows/InlineCreationRowsHelper.js +46 -4
  78. package/src/sap/suite/ui/generic/template/ObjectPage/controllerFrameworkExtensions.js +21 -4
  79. package/src/sap/suite/ui/generic/template/ObjectPage/extensionAPI/ExtensionAPI.js +29 -5
  80. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_en_US_saptrc.properties +95 -95
  81. package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
  82. package/src/sap/suite/ui/generic/template/ObjectPage/view/Details.view.xml +2 -2
  83. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/CRUDActionButtons.fragment.xml +2 -2
  84. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/Footer.fragment.xml +3 -3
  85. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/HeaderContainer.fragment.xml +4 -4
  86. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/HeaderImage.fragment.xml +4 -4
  87. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/SmartChart.fragment.xml +1 -1
  88. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/SmartTable.fragment.xml +2 -1
  89. package/src/sap/suite/ui/generic/template/QuickCreate/i18n/i18n_en_US_saptrc.properties +14 -14
  90. package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
  91. package/src/sap/suite/ui/generic/template/QuickView/i18n/i18n_en_US_saptrc.properties +2 -2
  92. package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
  93. package/src/sap/suite/ui/generic/template/designtime/controls/DynamicPage.designtime.js +142 -194
  94. package/src/sap/suite/ui/generic/template/designtime/controls/ObjectPageLayout.designtime.js +204 -0
  95. package/src/sap/suite/ui/generic/template/designtime/controls/SmartFilterBar.designtime.js +236 -0
  96. package/src/sap/suite/ui/generic/template/designtime/utils/designtimeHelper.js +36 -9
  97. package/src/sap/suite/ui/generic/template/designtime/utils/designtimeUtils.js +67 -23
  98. package/src/sap/suite/ui/generic/template/detailTemplates/i18n/i18n_en_US_saptrc.properties +6 -6
  99. package/src/sap/suite/ui/generic/template/fragments/BreakoutActions.fragment.xml +2 -2
  100. package/src/sap/suite/ui/generic/template/fragments/DeterminingActions.fragment.xml +3 -2
  101. package/src/sap/suite/ui/generic/template/fragments/EasyFilter.fragment.xml +0 -6
  102. package/src/sap/suite/ui/generic/template/fragments/GlobalActions.fragment.xml +3 -2
  103. package/src/sap/suite/ui/generic/template/fragments/GridTableCells.fragment.xml +3 -2
  104. package/src/sap/suite/ui/generic/template/fragments/HeaderAddress.fragment.xml +2 -1
  105. package/src/sap/suite/ui/generic/template/fragments/HeaderContactWithDetailsPopover.fragment.xml +2 -1
  106. package/src/sap/suite/ui/generic/template/fragments/HeaderDataPointContent.fragment.xml +1 -1
  107. package/src/sap/suite/ui/generic/template/fragments/HeaderForm.fragment.xml +1 -1
  108. package/src/sap/suite/ui/generic/template/fragments/HeaderFormDataField.fragment.xml +12 -5
  109. package/src/sap/suite/ui/generic/template/fragments/HeaderPlainText.fragment.xml +1 -1
  110. package/src/sap/suite/ui/generic/template/fragments/HeaderRatingIndicator.fragment.xml +5 -7
  111. package/src/sap/suite/ui/generic/template/fragments/ProgressIndicator.fragment.xml +2 -2
  112. package/src/sap/suite/ui/generic/template/fragments/QuickViewSmartForm.fragment.xml +2 -2
  113. package/src/sap/suite/ui/generic/template/fragments/RatingIndicatorFacet.fragment.xml +2 -2
  114. package/src/sap/suite/ui/generic/template/fragments/SmartFormDataField.fragment.xml +4 -3
  115. package/src/sap/suite/ui/generic/template/fragments/SmartMicroChart.fragment.xml +1 -1
  116. package/src/sap/suite/ui/generic/template/fragments/SmartTableUiTableCommons.fragment.xml +2 -5
  117. package/src/sap/suite/ui/generic/template/fragments/TableCell.fragment.xml +7 -5
  118. package/src/sap/suite/ui/generic/template/fragments/TableColumnListItem.fragment.xml +2 -5
  119. package/src/sap/suite/ui/generic/template/fragments/ToolbarButton.fragment.xml +2 -2
  120. package/src/sap/suite/ui/generic/template/fragments/TreeTableColumns.fragment.xml +3 -2
  121. package/src/sap/suite/ui/generic/template/genericUtilities/controlHelper.js +10 -9
  122. package/src/sap/suite/ui/generic/template/genericUtilities/filterHelper.js +70 -2
  123. package/src/sap/suite/ui/generic/template/genericUtilities/polyFill.js +14 -0
  124. package/src/sap/suite/ui/generic/template/js/AnnotationHelper.js +53 -12
  125. package/src/sap/suite/ui/generic/template/js/QuickTemplates/QuickTemplateComponentFactory.js +25 -13
  126. package/src/sap/suite/ui/generic/template/lib/AppComponent.js +16 -225
  127. package/src/sap/suite/ui/generic/template/lib/CRUDHelper.js +5 -3
  128. package/src/sap/suite/ui/generic/template/lib/CommonEventHandlers.js +11 -4
  129. package/src/sap/suite/ui/generic/template/lib/CommonUtils.js +37 -12
  130. package/src/sap/suite/ui/generic/template/lib/ComponentUtils.js +3 -3
  131. package/src/sap/suite/ui/generic/template/lib/ContextBookkeeping.js +39 -23
  132. package/src/sap/suite/ui/generic/template/lib/FlexibleColumnLayoutHandler.js +13 -5
  133. package/src/sap/suite/ui/generic/template/lib/FlexibleColumnLayoutHelper.js +168 -0
  134. package/src/sap/suite/ui/generic/template/lib/MessageStripHelper.js +1 -1
  135. package/src/sap/suite/ui/generic/template/lib/ShellPersonalizationService.js +137 -0
  136. package/src/sap/suite/ui/generic/template/lib/SideEffectUtil.js +56 -1
  137. package/src/sap/suite/ui/generic/template/lib/TemplateComponent.js +24 -4
  138. package/src/sap/suite/ui/generic/template/lib/ai/EasyFilterBarHandler.js +91 -36
  139. package/src/sap/suite/ui/generic/template/lib/ai/FioriAIHandler.js +30 -35
  140. package/src/sap/suite/ui/generic/template/lib/deletionHelper.js +10 -2
  141. package/src/sap/suite/ui/generic/template/lib/filterHelper.js +7 -3
  142. package/src/sap/suite/ui/generic/template/lib/i18n/i18n.properties +6 -15
  143. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ar.properties +1 -9
  144. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_bg.properties +1 -9
  145. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ca.properties +1 -9
  146. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cnr.properties +1 -9
  147. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cs.properties +1 -9
  148. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cy.properties +1 -9
  149. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_da.properties +1 -9
  150. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_de.properties +2 -10
  151. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_el.properties +1 -9
  152. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en.properties +1 -9
  153. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_GB.properties +1 -9
  154. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_US_sappsd.properties +0 -11
  155. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_US_saprigi.properties +1 -9
  156. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_US_saptrc.properties +174 -149
  157. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_es.properties +3 -11
  158. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_es_MX.properties +1 -9
  159. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_et.properties +1 -9
  160. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fi.properties +1 -9
  161. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fr.properties +1 -9
  162. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fr_CA.properties +1 -9
  163. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hi.properties +1 -9
  164. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hr.properties +1 -9
  165. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hu.properties +1 -9
  166. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_id.properties +1 -9
  167. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_it.properties +1 -9
  168. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_iw.properties +1 -9
  169. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ja.properties +1 -9
  170. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_kk.properties +1 -9
  171. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ko.properties +1 -9
  172. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_lt.properties +1 -9
  173. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_lv.properties +1 -9
  174. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_mk.properties +1 -9
  175. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ms.properties +1 -9
  176. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_nl.properties +1 -9
  177. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_no.properties +1 -9
  178. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pl.properties +1 -9
  179. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pt.properties +1 -9
  180. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pt_PT.properties +1 -9
  181. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ro.properties +1 -9
  182. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ru.properties +1 -9
  183. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sh.properties +1 -9
  184. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sk.properties +1 -9
  185. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sl.properties +1 -9
  186. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sr.properties +1 -9
  187. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sv.properties +1 -9
  188. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_th.properties +1 -9
  189. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_tr.properties +1 -9
  190. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_uk.properties +1 -9
  191. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_vi.properties +3 -11
  192. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_zh_CN.properties +1 -9
  193. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_zh_TW.properties +1 -9
  194. package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +59 -38
  195. package/src/sap/suite/ui/generic/template/library.js +7 -3
  196. package/src/sap/suite/ui/generic/template/listTemplates/fragments/ChartActions.fragment.xml +4 -3
  197. package/src/sap/suite/ui/generic/template/listTemplates/fragments/DetailSmartTable.fragment.xml +4 -3
  198. package/src/sap/suite/ui/generic/template/listTemplates/i18n/i18n_en_US_saptrc.properties +1 -1
  199. package/src/sap/suite/ui/generic/template/manifestMerger/ChangePageConfiguration.js +1 -1
  200. package/src/sap/suite/ui/generic/template/support/DiagnosticsTool/DiagnosticsTool.js +15 -3
  201. package/src/sap/suite/ui/generic/template/support/DiagnosticsTool/view/DiagnosticsTool.view.xml +0 -24
  202. package/src/sap/suite/ui/generic/template/support/lib/CommonChecks.js +11 -19
  203. package/src/sap/suite/ui/generic/template/themes/base/ObjectPage.less +0 -4
  204. package/src/sap/suite/ui/generic/template/themes/sap_belize_base/ObjectPage.less +0 -4
  205. package/src/sap/suite/ui/generic/template/themes/sap_bluecrystal_base/ObjectPage.less +0 -4
  206. package/src/sap/suite/ui/generic/template/themes/sap_fiori_3_hcb/AnalyticalListPage.less +0 -1
  207. package/src/sap/suite/ui/generic/template/themes/sap_fiori_3_hcw/AnalyticalListPage.less +0 -1
  208. package/src/sap/suite/ui/generic/template/themes/sap_hcb/base_ObjectPage.less +0 -4
  209. package/src/sap/suite/ui/generic/template/themes/sap_horizon_hcb/AnalyticalListPage.less +0 -1
  210. package/src/sap/suite/ui/generic/template/themes/sap_horizon_hcw/AnalyticalListPage.less +0 -1
  211. package/src/sap/suite/ui/generic/template/fragments/ContactDetailsQuickViewGroup.fragment.xml +0 -36
  212. package/src/sap/suite/ui/generic/template/js/formatters/formatDisplayValueForProgressIndicator.js +0 -28
  213. package/src/sap/suite/ui/generic/template/js/formatters/formatImageUrl.js +0 -21
  214. package/src/sap/suite/ui/generic/template/js/formatters/formatRatingIndicatorAggregateCount.js +0 -21
  215. package/src/sap/suite/ui/generic/template/js/formatters/formatRatingIndicatorFooterText.js +0 -21
  216. package/src/sap/suite/ui/generic/template/js/formatters/formatRatingIndicatorSubTitle.js +0 -21
  217. package/src/sap/suite/ui/generic/template/js/formatters/setInfoHighlight.js +0 -21
  218. package/src/sap/suite/ui/generic/template/js/formatters/setRowNavigated.js +0 -26
@@ -0,0 +1,168 @@
1
+ sap.ui.define([
2
+ "sap/ui/base/Object",
3
+ "sap/base/util/extend",
4
+ "sap/f/FlexibleColumnLayout",
5
+ "sap/f/FlexibleColumnLayoutData",
6
+ "sap/f/FlexibleColumnLayoutDataForDesktop",
7
+ "sap/f/FlexibleColumnLayoutDataForTablet"
8
+ ], function (
9
+ BaseObject,
10
+ extend,
11
+ FlexibleColumnLayout,
12
+ FlexibleColumnLayoutData,
13
+ FlexibleColumnLayoutDataForDesktop,
14
+ FlexibleColumnLayoutDataForTablet
15
+ ) {
16
+ "use strict";
17
+
18
+ var appComponent;
19
+ var shellPersonalizationService;
20
+
21
+ function getMethods({ oAppComponent, oShellPersonalizationService }) {
22
+
23
+ appComponent = oAppComponent;
24
+ shellPersonalizationService = oShellPersonalizationService;
25
+
26
+ /**
27
+ * Retieves the FCL state from the personalization service.
28
+ * @returns The FCL state
29
+ */
30
+ async function getFCLPersonalizationData() {
31
+ var oEmptyFCLState = {
32
+ defaultLayouts: {},
33
+ columnsDistribution: {
34
+ desktop: {},
35
+ tablet: {}
36
+ }
37
+ };
38
+ return ((await shellPersonalizationService.getApplicationPersonalizationData("FCL-Personalization")) ?? oEmptyFCLState);
39
+ }
40
+
41
+ /**
42
+ * Sets the FCL state in the personalization service.
43
+ * @param fclState The FCL state
44
+ */
45
+ function setFCLPersonalizationData(fclState) {
46
+ shellPersonalizationService.setApplicationPersonalizationData("FCL-Personalization", fclState);
47
+ }
48
+
49
+ /**
50
+ * Requests the FCL state from the personalization service and sets the model accordingly.
51
+ */
52
+ async function setColumnDistributionModel() {
53
+ if (!shellPersonalizationService.hasInitialized()) {
54
+ return;
55
+ }
56
+ var oColumnsDistribution = (await getFCLPersonalizationData()).columnsDistribution;
57
+ if (oColumnsDistribution) {
58
+ var oTemplatePrivateGlobalModel = appComponent.getModel("_templPrivGlobal");
59
+ oTemplatePrivateGlobalModel.setProperty("/generic/FCL/FCLColumnsDistribution", oColumnsDistribution);
60
+ }
61
+ }
62
+
63
+ /**
64
+ * Gets the number of columns displayed in the FCL based on the layout.
65
+ * @param {LayoutTypeType} layout The layout
66
+ * @returns {1 | 2 | 3 | null} The number of columns displayed
67
+ */
68
+ function getNumberOfColumnsFromLayout(layout) {
69
+ var iColumnsDisplayed = /^(One|Two|Three)Column/.exec(layout)?.[1];
70
+ switch (iColumnsDisplayed) {
71
+ case "One":
72
+ return 1;
73
+ case "Two":
74
+ return 2;
75
+ case "Three":
76
+ return 3;
77
+ default:
78
+ return null;
79
+ }
80
+ }
81
+
82
+ /**
83
+ * Gets the layout stored in the personalization service based on the proposed layout.
84
+ * @param {LayoutTypeType | undefined } proposedLayout
85
+ * @returns The FCL layout stored in the personalization service
86
+ */
87
+ async function getStoredLayout(oProposedLayout) {
88
+ if (shellPersonalizationService.hasInitialized()) {
89
+ var iColumnsDisplayed = getNumberOfColumnsFromLayout(oProposedLayout);
90
+ if (iColumnsDisplayed) {
91
+ var defaultLayouts = (await getFCLPersonalizationData()).defaultLayouts;
92
+ return defaultLayouts?.[iColumnsDisplayed] ?? oProposedLayout;
93
+ }
94
+ }
95
+ return oProposedLayout;
96
+ }
97
+
98
+ /**
99
+ * Is called when the user changes the FCL columns distribution.
100
+ * Updates the FCL state in the personalization service.
101
+ * @param {Event<{ media: "tablet" | "desktop"; layout: LayoutTypeType; columnsSizes: string }>} event
102
+ */
103
+ async function onColumnsDistributionChange(event) {
104
+ if (!shellPersonalizationService.hasInitialized()) {
105
+ return;
106
+ }
107
+
108
+ var { media, layout, columnsSizes } = event.getParameters();
109
+
110
+ var oTemplatePrivateGlobalModel = appComponent.getModel("_templPrivGlobal");
111
+ oTemplatePrivateGlobalModel.setProperty(`/generic/FCL/FCLColumnsDistribution/${media}/${layout}`, columnsSizes);
112
+
113
+ var oFclState = await getFCLPersonalizationData();
114
+ var iColumnsDisplayed = getNumberOfColumnsFromLayout(layout);
115
+ if (iColumnsDisplayed) {
116
+ oFclState.defaultLayouts[iColumnsDisplayed] = layout;
117
+ oFclState.columnsDistribution[media][layout] = columnsSizes;
118
+ setFCLPersonalizationData(oFclState);
119
+ }
120
+ }
121
+
122
+ function initFlexibleColumnLayout() {
123
+ var oFCL = new FlexibleColumnLayout();
124
+
125
+ var oLayoutData = new FlexibleColumnLayoutData();
126
+ var oDesktopLayoutData = new FlexibleColumnLayoutDataForDesktop();
127
+ var oTabletLayoutData = new FlexibleColumnLayoutDataForTablet();
128
+
129
+ var sFCLColumnsDistributionPath = "_templPrivGlobal>/generic/FCL/FCLColumnsDistribution";
130
+ var sDesktopFCLColumnsDistributionPath = `${sFCLColumnsDistributionPath}/desktop`;
131
+ var sTabletFCLColumnsDistributionPath = `${sFCLColumnsDistributionPath}/tablet`;
132
+
133
+ oDesktopLayoutData.bindProperty("twoColumnsBeginExpanded", `${sDesktopFCLColumnsDistributionPath}/TwoColumnsBeginExpanded`);
134
+ oDesktopLayoutData.bindProperty("twoColumnsMidExpanded", `${sDesktopFCLColumnsDistributionPath}/TwoColumnsMidExpanded`);
135
+ oDesktopLayoutData.bindProperty("threeColumnsBeginExpandedEndHidden", `${sDesktopFCLColumnsDistributionPath}/ThreeColumnsBeginExpandedEndHidden`);
136
+ oDesktopLayoutData.bindProperty("threeColumnsEndExpanded", `${sDesktopFCLColumnsDistributionPath}/ThreeColumnsEndExpanded`);
137
+ oDesktopLayoutData.bindProperty("threeColumnsMidExpanded", `${sDesktopFCLColumnsDistributionPath}/ThreeColumnsMidExpanded`);
138
+ oDesktopLayoutData.bindProperty("threeColumnsMidExpandedEndHidden", `${sDesktopFCLColumnsDistributionPath}/ThreeColumnsMidExpandedEndHidden`);
139
+
140
+ oTabletLayoutData.bindProperty("twoColumnsBeginExpanded", `${sTabletFCLColumnsDistributionPath}/TwoColumnsBeginExpanded`);
141
+ oTabletLayoutData.bindProperty("twoColumnsMidExpanded", `${sTabletFCLColumnsDistributionPath}/TwoColumnsMidExpanded`);
142
+ oTabletLayoutData.bindProperty("threeColumnsBeginExpandedEndHidden", `${sTabletFCLColumnsDistributionPath}/ThreeColumnsBeginExpandedEndHidden`);
143
+ oTabletLayoutData.bindProperty("threeColumnsEndExpanded", `${sTabletFCLColumnsDistributionPath}/ThreeColumnsEndExpanded`);
144
+ oTabletLayoutData.bindProperty("threeColumnsMidExpanded", `${sTabletFCLColumnsDistributionPath}/ThreeColumnsMidExpanded`);
145
+ oTabletLayoutData.bindProperty("threeColumnsMidExpandedEndHidden", `${sTabletFCLColumnsDistributionPath}/ThreeColumnsMidExpandedEndHidden`);
146
+
147
+ oLayoutData.setDesktopLayoutData(oDesktopLayoutData);
148
+ oLayoutData.setTabletLayoutData(oTabletLayoutData);
149
+ oFCL.setAggregation("layoutData", oLayoutData);
150
+
151
+ oFCL.attachColumnsDistributionChange(onColumnsDistributionChange);
152
+
153
+ return oFCL;
154
+ }
155
+
156
+ return {
157
+ initFlexibleColumnLayout: initFlexibleColumnLayout,
158
+ getStoredLayout: getStoredLayout,
159
+ setColumnDistributionModel: setColumnDistributionModel
160
+ };
161
+ }
162
+
163
+ return BaseObject.extend("sap.suite.ui.generic.template.lib.FlexibleColumnLayoutHelper", {
164
+ constructor: function (oTemplateContract) {
165
+ extend(this, getMethods(oTemplateContract));
166
+ }
167
+ });
168
+ });
@@ -79,7 +79,7 @@ sap.ui.define([
79
79
 
80
80
  // This is the public method that can be used to set or remove the message which is currently displayed for a tab or a collection of tabs.
81
81
  // oMessage: The object which represents the message that should currently be displayed. If it is faulty no message should be shown for the specified tabs.
82
- // Otherwise it should be an object containing properties message (text of the message) and type (instance of sap.ui.core.MessageType).
82
+ // Otherwise it should be an object containing properties message (text of the message) and type (instance of sap.ui.core.message.MessageType).
83
83
  // vTab: Specifies the affected tabs: faulty -> all tabs affected, string -> identifies the affected tab, array -> lists the affected tabs
84
84
  // If more than one tab is specified in this way these tabs will be considered to belong together for the close feature of the message strip.
85
85
  // This means, that the message will be removed for all these tabs when the user closes the message strip.
@@ -0,0 +1,137 @@
1
+ sap.ui.define([
2
+ "sap/ui/base/Object",
3
+ "sap/base/util/extend",
4
+ "sap/suite/ui/generic/template/genericUtilities/testableHelper",
5
+ "sap/suite/ui/generic/template/genericUtilities/FeLogger"
6
+ ], function (
7
+ BaseObject,
8
+ extend,
9
+ testableHelper,
10
+ FeLogger
11
+ ) {
12
+ "use strict";
13
+
14
+ function getMethods({ oAppComponent }) {
15
+
16
+ var shellPersonalizationService;
17
+ var applicationPersonalizers = {};
18
+
19
+ var sClassName = "lib.ShellPersonalizationService";
20
+ var oLogger = new FeLogger(sClassName).getLogger();
21
+
22
+ /**
23
+ * Gets the personalizer from the shell service.
24
+ * We set some defaults for the scope object.
25
+ * @param persId Personalization object
26
+ * @param scope Scope object
27
+ * @param component
28
+ * @returns {Promise<PersonalizerType> | undefined} Personalizer object which handles personalization
29
+ */
30
+ async function getPersonalizer(persId, scope, component) {
31
+ if (!hasInitialized()) {
32
+ oLogger.error("Personalization service is not initialized");
33
+ return;
34
+ }
35
+ scope = {
36
+ // merge some defaults
37
+ keyCategory: shellPersonalizationService.constants.keyCategory.FIXED_KEY,
38
+ writeFrequency: shellPersonalizationService.constants.writeFrequency.LOW,
39
+ clientStorageAllowed: false,
40
+ validity: Infinity,
41
+ ...scope
42
+ };
43
+ return shellPersonalizationService.getPersonalizer(persId, scope, component);
44
+ }
45
+
46
+ /**
47
+ * Prepares the container name for personalizer.
48
+ * @returns Container name
49
+ */
50
+ function getContainerName() {
51
+ // personalizer logs error if name longer than 40 symbols
52
+ var sContainer = `App#${(oAppComponent).getManifest()["sap.app"].id}`;
53
+ return sContainer;
54
+ }
55
+
56
+ /**
57
+ * Initializes the personalizer to access the Application data stored in the shell Personalization.
58
+ * @param {string} itemName The name of the item for which the personalizer is created.
59
+ * @returns {Promise<PersonalizerType>} A personalizer
60
+ */
61
+ async function getApplicationPersonalizer(itemName) {
62
+ if (!applicationPersonalizers[itemName]) {
63
+ applicationPersonalizers[itemName] = getPersonalizer(
64
+ {
65
+ container: getContainerName(),
66
+ item: itemName
67
+ },
68
+ {},
69
+ oAppComponent
70
+ );
71
+ }
72
+ return applicationPersonalizers[itemName];
73
+ }
74
+
75
+ /**
76
+ * Returns data from the personalization service.
77
+ * @param {string} itemName
78
+ * @returns {Promise<object | undefined>} Data
79
+ */
80
+ async function getApplicationPersonalizationData(itemName) {
81
+ var oAppPersonalizer = await getApplicationPersonalizer(itemName);
82
+ var oPersData = await oAppPersonalizer?.getPersData();
83
+ return oPersData;
84
+ }
85
+
86
+ /**
87
+ * Stores an object in the personalization service.
88
+ * @param {string} itemName
89
+ * @param {object} data
90
+ * @returns {Promise<void>} A promise
91
+ */
92
+ async function setApplicationPersonalizationData(itemName, data) {
93
+ var oAppPersonalizer = await getApplicationPersonalizer(itemName);
94
+ oAppPersonalizer.setPersData(data);
95
+ }
96
+
97
+ /**
98
+ * Checks whether the shell personalization service has been initialized
99
+ * @returns True or false
100
+ */
101
+ function hasInitialized() {
102
+ return !!shellPersonalizationService;
103
+ }
104
+
105
+ /**
106
+ * Initializes the shell personalization service
107
+ */
108
+ function init() {
109
+ var UShellContainer = sap.ui.require("sap/ushell/Container");
110
+ if (hasInitialized() || !UShellContainer) {
111
+ return Promise.resolve();
112
+ }
113
+ return UShellContainer.getServiceAsync("PersonalizationV2").then((oShellPersonalizationService) => {
114
+ setShellPersonalizationService(oShellPersonalizationService);
115
+ });
116
+ }
117
+
118
+ function setShellPersonalizationService(service) {
119
+ shellPersonalizationService = service;
120
+ }
121
+
122
+ var setShellPersonalizationService = testableHelper.testable(setShellPersonalizationService, "setShellPersonalizationService");
123
+
124
+ return {
125
+ init: init,
126
+ hasInitialized: hasInitialized,
127
+ getApplicationPersonalizationData: getApplicationPersonalizationData,
128
+ setApplicationPersonalizationData: setApplicationPersonalizationData
129
+ };
130
+ }
131
+
132
+ return BaseObject.extend("sap.suite.ui.generic.template.lib.ShellPersonalizationService", {
133
+ constructor: function (oTemplateContract) {
134
+ extend(this, getMethods(oTemplateContract));
135
+ }
136
+ });
137
+ });
@@ -207,10 +207,65 @@ sap.ui.define(["sap/suite/ui/generic/template/js/AnnotationHelper",
207
207
  }
208
208
  }
209
209
 
210
+ /**
211
+ * Configures a side effect for custom field.
212
+ * @param {Object} oView - The view instance of the object page.
213
+ * @param {Object} oControl - The control object for the custom field.
214
+ * @param {String} sProperty - The name of the property associated with the custom field.
215
+ * @param {String} sEntitySet - The entity set to which the custom field belongs.
216
+ * @param {String} oController - Object page controller.
217
+ */
218
+ function registerCustomFieldForSideEffect(oControl, sProperty, sEntitySet, oController) {
219
+ var oMetaModel = oController.getView().getModel().getMetaModel();
220
+ var oEntitySet = oMetaModel.getODataEntitySet(sEntitySet);
221
+ var oEntityType = oMetaModel.getODataEntityType(oEntitySet.entityType);
222
+ var oProperty = oMetaModel.getODataProperty(oEntityType, sProperty);
223
+ //The method SharedUtil.applyFieldGroupIDs takes in the control and its metadata, reads the Side Effect annotations configured for it
224
+ //and assigns the fieldGroupID accordingly.
225
+ oController.extensionAPI.attachPageDataLoaded(() => {
226
+ SharedUtil.applyFieldGroupIDs(oControl, {
227
+ entitySet: oEntitySet,
228
+ entityType: oEntityType,
229
+ path: sProperty,
230
+ property: {
231
+ property: oProperty
232
+ }
233
+ });
234
+ });
235
+ }
236
+
237
+ /**
238
+ * Register field group Change.
239
+ * @param {object} oComponent
240
+ * @param {Object} oTemplateUtils
241
+ * @param {String} sFieldName - The name of the property associated with the custom field.
242
+ * @param {string} sEntitySet - EntitySet where side effect is defined.
243
+ */
244
+ function fieldGroupChangeRegister(oComponent, oTemplateUtils, sFieldName, sEntitySet) {
245
+ var oEntitySet = oComponent.getModel().getMetaModel().getODataEntitySet(sEntitySet);
246
+ var oEntityType = oComponent.getModel().getMetaModel().getODataEntityType(oEntitySet.entityType);
247
+ for (var sProperty in oEntityType) {
248
+ if (sProperty.includes("com.sap.vocabularies.Common.v1.SideEffects")) {
249
+ var aSource = oEntityType[sProperty].SourceProperties;
250
+ if (!aSource) {
251
+ continue;
252
+ }
253
+ for (var i = 0; i < aSource.length; i++) {
254
+ if (aSource[i].PropertyPath === sFieldName) {
255
+ var sQualifier = sProperty.split("#")[1];
256
+ oTemplateUtils.oServices.oApplicationController.registerGroupChange(sQualifier);
257
+ }
258
+ }
259
+ }
260
+ }
261
+ }
262
+
210
263
  return {
211
264
  handleSideEffectForField : fnHandleSideEffectForField,
212
265
  assignFieldGroupIds: fnAssignFieldGroupIds,
213
266
  getPropsForLinkFields: fnGetPropsForLinkFields,
214
- assignFieldGroupIdsToLinkField: fnAssignFieldGroupIdsToLinkField
267
+ assignFieldGroupIdsToLinkField: fnAssignFieldGroupIdsToLinkField,
268
+ registerCustomFieldForSideEffect: registerCustomFieldForSideEffect,
269
+ fieldGroupChangeRegister: fieldGroupChangeRegister
215
270
  };
216
271
  });
@@ -15,9 +15,29 @@ sap.ui.define(["sap/ui/core/library",
15
15
  "sap/suite/ui/generic/template/genericUtilities/CacheHelper",
16
16
  "sap/suite/ui/generic/template/genericUtilities/FeError",
17
17
  "sap/ui/core/mvc/XMLView",
18
- "sap/m/IllustratedMessageType"
19
- ], function(coreLibrary, Component, UIComponent, JSONModel, ResourceModel, Device,
20
- reuseComponentHelper, CustomData, StableIdDefinition, StableIdHelper, FeLogger, AnnotationHelper, extend, deepExtend, CacheHelper, FeError, XMLView, IllustratedMessageType) {
18
+ "sap/m/IllustratedMessageType",
19
+ "sap/ui/core/Element"
20
+ ], function (
21
+ coreLibrary,
22
+ Component,
23
+ UIComponent,
24
+ JSONModel,
25
+ ResourceModel,
26
+ Device,
27
+ reuseComponentHelper,
28
+ CustomData,
29
+ StableIdDefinition,
30
+ StableIdHelper,
31
+ FeLogger,
32
+ AnnotationHelper,
33
+ extend,
34
+ deepExtend,
35
+ CacheHelper,
36
+ FeError,
37
+ XMLView,
38
+ IllustratedMessageType,
39
+ Element
40
+ ) {
21
41
  "use strict";
22
42
  var sClassName = "lib.TemplateComponent";
23
43
  var oLogger = new FeLogger(sClassName).getLogger();
@@ -242,7 +262,7 @@ sap.ui.define(["sap/ui/core/library",
242
262
 
243
263
  var sViewId = fnDetermineViewId(oComponentRegistryEntry);
244
264
 
245
- var oView = sap.ui.getCore().byId(sViewId);
265
+ var oView = Element.getElementById(sViewId);
246
266
  if (oView){
247
267
  oLogger.warning("View with ID: " + sViewId + " already exists - old view is getting destroyed now!");
248
268
  try {
@@ -2,8 +2,9 @@ sap.ui.define([
2
2
  "sap/ui/base/Object",
3
3
  "sap/base/util/extend",
4
4
  "sap/suite/ui/generic/template/lib/filterHelper",
5
- "sap/suite/ui/generic/template/genericUtilities/FeLogger"
6
- ], function(BaseObject, extend, filterHelper, FeLogger) {
5
+ "sap/suite/ui/generic/template/genericUtilities/FeLogger",
6
+ "sap/ui/model/FilterOperator"
7
+ ], function(BaseObject, extend, filterHelper, FeLogger, FilterOperator) {
7
8
  'use strict';
8
9
 
9
10
  /*
@@ -13,11 +14,11 @@ sap.ui.define([
13
14
  * Event handlers for the easy filter bar are also defined here
14
15
  *
15
16
  */
16
- var oEasyFilterMetadata;
17
17
  var oLogger = new FeLogger("lib.ai.EasyFilterBarHandler").getLogger();
18
18
 
19
19
  function getMethods(oState, oController, oTemplateUtils) {
20
20
  var mCodeList = {};
21
+ var oEasyFilterMetadata;
21
22
  // used for busyHandling between query triggered and query resolved.
22
23
  var oQueryPromise, oQueryPromiseResolve;
23
24
  var fnValueHelpPromiseResolve;
@@ -28,25 +29,13 @@ sap.ui.define([
28
29
  * @returns A promise which returns the prepared metadata
29
30
  */
30
31
  function fnGetEasyFilterSearchMetadata() {
31
- if (oEasyFilterMetadata) {
32
- return Promise.resolve(oEasyFilterMetadata);
33
- } else {
34
- return new Promise(function(fnResolve) {
35
- // In case the smart filter bar is already initialized then do not use "attachInitialized" as this event will never get triggered again
36
- if (oState.oSmartFilterbar.isInitialised()) {
37
- fnPrepareSearchMetadata().then(function(oMetadata){
38
- fnResolve(oMetadata);
39
- }
40
- );
41
- } else {
42
- oState.oSmartFilterbar.attachInitialized(function() {
43
- fnPrepareSearchMetadata().then(function(oMetadata) {
44
- fnResolve(oMetadata);
45
- });
46
- },this);
47
- }
32
+ return new Promise(function(fnResolve) {
33
+ oState.oIappStateHandler.onFEStartupInitialized().then(function() {
34
+ fnPrepareSearchMetadata().then(function(oMetadata){
35
+ fnResolve(oMetadata);
36
+ });
48
37
  });
49
- }
38
+ });
50
39
  }
51
40
  /**
52
41
  * This method prepares the metadata for each filterable field from the smart filter bar
@@ -56,34 +45,48 @@ sap.ui.define([
56
45
  function fnPrepareSearchMetadata() {
57
46
 
58
47
  var aPromise = [];
48
+ var oEditStateFilterItem;
49
+ var oDefaultValuesForEasyFilter = {};
59
50
  var oOwnerFilterControl = oState.oSmartFilterbar;
60
51
  var oSFBModel = oOwnerFilterControl.getModel();
61
52
  var oSFBMetaModel = oSFBModel.getMetaModel();
62
- var oEditStateFilterItem;
53
+
63
54
  var sEntitySet = oController.getOwnerComponent().getEntitySet();
64
- var sTokenType = "ValueHelp"; // Other values are "Calendar" | "Time" | "MenuWithCheckBox"
65
55
 
66
56
  var mFilterProperties = {}; // todo : Add the properties from navigation entites
67
57
  var oEntityType = oTemplateUtils.oCommonUtils.getMetaModelEntityType(sEntitySet);
68
58
  oEntityType.property.map(function (oProperty) {
59
+ var sTokenType = "ValueHelp"; // Other values are "Calendar" | "Time" | "MenuWithCheckBox" | "MenuWithSingleSelect"
69
60
  if (filterHelper.isPropertyFilterable(oProperty)) {
70
- var bIsCodeListRequired = "";
61
+
62
+ var bIsCodeListRequired;
71
63
  oProperty.extensions && oProperty.extensions.forEach(function(oExtension) {
72
64
  if (oExtension.name === "value-list" && oExtension.value === "fixed-values") {
73
65
  sTokenType = "MenuWithCheckBox";
74
66
  bIsCodeListRequired = true;
75
67
  }
76
68
  });
69
+
70
+ // Calculate the token type based on the property type and display format
71
+ // It will be better if this is done at the control level
72
+ if ((oProperty.type === "Edm.DateTime" && oProperty["sap:display-format"] === "Date") ||
73
+ (oProperty.type === "Edm.String" && oProperty["com.sap.vocabularies.Common.v1.IsCalendarDate"] && oProperty["com.sap.vocabularies.Common.v1.IsCalendarDate"].Bool === "true")) {
74
+ sTokenType = "Calendar";
75
+ } else if (oProperty.type === "Edm.DateTimeOffset") {
76
+ sTokenType = "Time";
77
+ }
78
+
77
79
  mFilterProperties[oProperty.name] = {
78
80
  name: oProperty.name,
79
81
  //label: oProperty.label, Name is added from the filter item control
80
82
  dataType: oProperty.type,
83
+ defaultValue : [], // Fill values from FLP user defaults , SV or other sources
81
84
  filterable: true,
82
85
  sortable: false,
83
86
  codeList : bIsCodeListRequired,
84
87
  type: sTokenType,
85
88
  unit: oProperty["sap:unit"] || "",
86
- required: oProperty["sap:required-in-filter"] ? true : false
89
+ required: oProperty["sap:required-in-filter"] === "true" ? true : false
87
90
  };
88
91
  }
89
92
  });
@@ -93,12 +96,54 @@ sap.ui.define([
93
96
  entitySet: sEntitySet,
94
97
  fields : []
95
98
  };
96
-
99
+ oDefaultValuesForEasyFilter = oOwnerFilterControl.getFilterData() || {};
97
100
  oOwnerFilterControl.getAllFilterItems().forEach(function (oFilterItem) {
98
101
  //check if the filter item from the filter control is a property of the entity type , if then push it to the easy filter metadata
99
102
  // todo : Add the properties from navigation entites
100
103
  var oFilterItemForQuery = mFilterProperties[oFilterItem.getName()];
101
104
  if (oFilterItemForQuery) {
105
+ var oDefaultFilterValue = oDefaultValuesForEasyFilter[oFilterItem.getName()];
106
+ if (oDefaultFilterValue) {
107
+ var aValues = [];
108
+ // oDefaultFilterValue can have ranges or items or low or single value directly
109
+ if (oDefaultFilterValue.ranges && oDefaultFilterValue.ranges.length > 0) {
110
+ aValues = oDefaultFilterValue.ranges.map(function(oRange) {
111
+ if (oRange.exclude === false) {
112
+ if (oRange.operation === "BT") {
113
+ return {
114
+ operator: FilterOperator.BT,
115
+ selectedValues: [{ value1: oRange.value1, value2: oRange.value2 }]
116
+ };
117
+ } else {
118
+ return {
119
+ operator: oRange.operation,
120
+ selectedValues: [oRange.value1]
121
+ };
122
+ }
123
+ } else {
124
+ return {
125
+ operator: FilterOperator.NE,
126
+ selectedValues: [oRange.value1]
127
+ };
128
+ }
129
+ });
130
+ } else if (oDefaultFilterValue.items && oDefaultFilterValue.items.length > 0) { // unrestricted/multi-value
131
+ oDefaultFilterValue.items.forEach(function(oItem) {
132
+ aValues.push({
133
+ operator: FilterOperator.EQ,
134
+ selectedValues: [oItem.key]
135
+ });
136
+ });
137
+ } else if (oDefaultFilterValue) { // In cases where the default value is coming from the FLP user defaults and does not have ranges and the value is a single value
138
+ aValues = [
139
+ {
140
+ operator: FilterOperator.EQ,
141
+ selectedValues: [oDefaultFilterValue]
142
+ }
143
+ ];
144
+ }
145
+ oFilterItemForQuery.defaultValue = aValues;
146
+ }
102
147
  oFilterItemForQuery.label = oFilterItem.getLabel();
103
148
  // codeList is set to true for fixed value list and codelist is fetched
104
149
  if (oFilterItemForQuery.codeList) {
@@ -128,7 +173,6 @@ sap.ui.define([
128
173
  if (oTemplateUtils.oComponentUtils.isDraftEnabled()) {
129
174
  var oEditStateControl = oController.byId("editStateFilter");
130
175
  if (oEditStateControl) {
131
- sTokenType = "MenuWithCheckBox";
132
176
  var oEditingStatusCodeList = oEditStateControl.getItems().map(function(oItem) {
133
177
  return {
134
178
  value : oItem.getKey(),
@@ -142,7 +186,7 @@ sap.ui.define([
142
186
  filterable: true,
143
187
  required: false,
144
188
  sortable: false,
145
- type: sTokenType,
189
+ type: "MenuWithSingleSelect",
146
190
  codeList : oEditingStatusCodeList
147
191
  };
148
192
  oEasyFilterMetadata.fields.push(oEditStateFilterMetadata);
@@ -308,17 +352,12 @@ sap.ui.define([
308
352
  var sEntitySet = oController.getOwnerComponent().getEntitySet();
309
353
  oEasyFilterMetadataPromise.then((oEasyFilterMetadata) => {
310
354
  oEasyFilter.setContextPath(sEntitySet);
311
- oEasyFilter.setAppId(oController.getOwnerComponent().getAppComponent().getManifestEntry("sap.app")).id;
355
+ oEasyFilter.setAppId(oController.getOwnerComponent().getAppComponent().getManifestEntry("sap.app").id);
312
356
  oEasyFilter.setFilterBarMetadata(oEasyFilterMetadata.fields);
313
357
  oEasyFilter.easyfilter = oTemplateUtils.oServices.oFioriAIHandler.fioriaiLib.EasyFilter;
314
358
  });
315
359
  }
316
360
 
317
- function fnExecuteSearch(oEvent) {
318
- var oSmartFilterbar = oState.oSmartFilterbar;
319
- oSmartFilterbar.search();
320
- }
321
-
322
361
  function fnClearFilters(oEvent) {
323
362
  var oSmartFilterbar = oState.oSmartFilterbar;
324
363
  oSmartFilterbar.search();
@@ -430,19 +469,35 @@ sap.ui.define([
430
469
  }
431
470
  }
432
471
 
472
+ /**
473
+ *
474
+ * This method is called when the variant is loaded in SFB
475
+ * Always set the filterMode to classic when the variant is loaded as the variant filters are not supported in the EasyFilter
476
+ * */
477
+ function fnHandleVariantLoad(oEvent) {
478
+ var oTempModel = oTemplateUtils.oComponentUtils.getTemplatePrivateModel();
479
+ // 'context' is undefined or null when the user switches variant , in this case switch to classic mode
480
+ // other values are "CANCEL" , "RESET" , "SET_VM_ID" , "DATA_SUITE" , "INIT" , "KEY_USER" etc : Do not switch filter mode in these cases
481
+ if (!oEvent.getParameter("context") && oTempModel.getProperty("/listReport/filterMode") !== "classic") {
482
+ var oSmartFilterbar = oState.oSmartFilterbar;
483
+ oTempModel.setProperty("/listReport/filterMode", "classic");
484
+ oSmartFilterbar.setVisible(true);
485
+ }
486
+ }
487
+
433
488
  return {
434
489
  getEasyFilterBar : fnGetEasyFilterBar,
435
490
  initialiseEasyFilterBar : fnInitialiseEasyFilterBar,
436
491
  getSFBVariantData : fnGetSFBVariantData,
437
492
  getEasyFilterSearchMetadata : fnGetEasyFilterSearchMetadata,
438
- onExecuteSearch: fnExecuteSearch,
439
493
  onClearFilters: fnClearFilters,
440
494
  onAfterQueryProcessing: fnAfterQueryProcessing,
441
495
  onBeforeQueryProcessing: fnBeforeQueryProcessing,
442
496
  onQueryChanged : fnQueryChanged,
443
497
  onTokensChanged: fnTokensChanged,
444
498
  onShowValueHelp: fnShowValueHelp,
445
- onFilterChange : fnOnFilterChange
499
+ onFilterChange : fnOnFilterChange,
500
+ handleVariantLoad : fnHandleVariantLoad
446
501
  };
447
502
  }
448
503