@sapui5/sap.fe.core 1.98.0 → 1.99.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/package.json +3 -2
  2. package/src/sap/fe/core/.library +1 -1
  3. package/src/sap/fe/core/AnnotationHelper.js +377 -405
  4. package/src/sap/fe/core/AnnotationHelper.ts +385 -0
  5. package/src/sap/fe/core/AppComponent.js +3 -2
  6. package/src/sap/fe/core/AppStateHandler.js +229 -181
  7. package/src/sap/fe/core/AppStateHandler.ts +171 -0
  8. package/src/sap/fe/core/BaseController.js +3 -2
  9. package/src/sap/fe/core/BusyLocker.js +105 -121
  10. package/src/sap/fe/core/BusyLocker.ts +98 -0
  11. package/src/sap/fe/core/CommonUtils.js +2073 -2399
  12. package/src/sap/fe/core/CommonUtils.ts +2078 -0
  13. package/src/sap/fe/core/ExtensionAPI.js +3 -2
  14. package/src/sap/fe/core/PageController.js +84 -125
  15. package/src/sap/fe/core/PageController.ts +101 -0
  16. package/src/sap/fe/core/RouterProxy.js +986 -823
  17. package/src/sap/fe/core/RouterProxy.ts +838 -0
  18. package/src/sap/fe/core/Synchronization.js +51 -35
  19. package/src/sap/fe/core/Synchronization.ts +29 -0
  20. package/src/sap/fe/core/TemplateComponent.js +173 -164
  21. package/src/sap/fe/core/TemplateComponent.ts +166 -0
  22. package/src/sap/fe/core/TemplateModel.js +97 -54
  23. package/src/sap/fe/core/TemplateModel.ts +63 -0
  24. package/src/sap/fe/core/TransactionHelper.js +1576 -1664
  25. package/src/sap/fe/core/TransactionHelper.ts +1706 -0
  26. package/src/sap/fe/core/actions/draft.js +559 -608
  27. package/src/sap/fe/core/actions/draft.ts +593 -0
  28. package/src/sap/fe/core/actions/messageHandling.js +545 -514
  29. package/src/sap/fe/core/actions/messageHandling.ts +532 -0
  30. package/src/sap/fe/core/actions/nonDraft.js +17 -19
  31. package/src/sap/fe/core/actions/nonDraft.ts +12 -0
  32. package/src/sap/fe/core/actions/operations.js +1074 -1215
  33. package/src/sap/fe/core/actions/operations.ts +1162 -0
  34. package/src/sap/fe/core/actions/sticky.js +102 -105
  35. package/src/sap/fe/core/actions/sticky.ts +102 -0
  36. package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +3 -2
  37. package/src/sap/fe/core/controllerextensions/EditFlow.js +54 -211
  38. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +3 -2
  39. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +279 -11
  40. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +8 -6
  41. package/src/sap/fe/core/controllerextensions/InternalRouting.js +47 -45
  42. package/src/sap/fe/core/controllerextensions/KPIManagement.js +2 -3
  43. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +29 -26
  44. package/src/sap/fe/core/controllerextensions/MassEdit.js +101 -8
  45. package/src/sap/fe/core/controllerextensions/MessageHandler.js +17 -8
  46. package/src/sap/fe/core/controllerextensions/PageReady.js +2 -2
  47. package/src/sap/fe/core/controllerextensions/PageReady.ts +12 -8
  48. package/src/sap/fe/core/controllerextensions/Paginator.js +3 -2
  49. package/src/sap/fe/core/controllerextensions/Placeholder.js +3 -2
  50. package/src/sap/fe/core/controllerextensions/Routing.js +9 -4
  51. package/src/sap/fe/core/controllerextensions/RoutingListener.js +3 -2
  52. package/src/sap/fe/core/controllerextensions/Share.js +3 -2
  53. package/src/sap/fe/core/controllerextensions/SideEffects.js +3 -3
  54. package/src/sap/fe/core/controllerextensions/SideEffects.ts +18 -18
  55. package/src/sap/fe/core/controllerextensions/ViewState.js +3 -2
  56. package/src/sap/fe/core/controls/CommandExecution.js +3 -2
  57. package/src/sap/fe/core/controls/ConditionalWrapper.js +3 -2
  58. package/src/sap/fe/core/controls/CustomQuickViewPage.js +3 -2
  59. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +3 -2
  60. package/src/sap/fe/core/controls/FieldWrapper.js +11 -22
  61. package/src/sap/fe/core/controls/FilterBar.js +3 -2
  62. package/src/sap/fe/core/controls/FormElementWrapper.js +3 -2
  63. package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +3 -2
  64. package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +1 -0
  65. package/src/sap/fe/core/controls/filterbar/FilterContainer.js +3 -2
  66. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +5 -4
  67. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -2
  68. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +3 -2
  69. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +3 -2
  70. package/src/sap/fe/core/converters/ConverterContext.js +2 -2
  71. package/src/sap/fe/core/converters/ConverterContext.ts +4 -3
  72. package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
  73. package/src/sap/fe/core/converters/ManifestSettings.ts +1 -0
  74. package/src/sap/fe/core/converters/ManifestWrapper.js +39 -26
  75. package/src/sap/fe/core/converters/ManifestWrapper.ts +9 -0
  76. package/src/sap/fe/core/converters/MetaModelConverter.js +11 -8
  77. package/src/sap/fe/core/converters/MetaModelConverter.ts +16 -16
  78. package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
  79. package/src/sap/fe/core/converters/TemplateConverter.ts +2 -2
  80. package/src/sap/fe/core/converters/common/AnnotationConverter.js +17 -13
  81. package/src/sap/fe/core/converters/controls/Common/Action.js +2 -2
  82. package/src/sap/fe/core/converters/controls/Common/Action.ts +2 -2
  83. package/src/sap/fe/core/converters/controls/Common/Chart.js +5 -3
  84. package/src/sap/fe/core/converters/controls/Common/Chart.ts +11 -3
  85. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +3 -3
  86. package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +2 -2
  87. package/src/sap/fe/core/converters/controls/Common/Form.js +4 -2
  88. package/src/sap/fe/core/converters/controls/Common/Form.ts +16 -2
  89. package/src/sap/fe/core/converters/controls/Common/Table.js +250 -146
  90. package/src/sap/fe/core/converters/controls/Common/Table.ts +300 -167
  91. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +115 -56
  92. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +120 -74
  93. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +467 -32
  94. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +483 -54
  95. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +6 -6
  96. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +9 -15
  97. package/src/sap/fe/core/converters/helpers/Aggregation.js +13 -5
  98. package/src/sap/fe/core/converters/helpers/Aggregation.ts +20 -5
  99. package/src/sap/fe/core/converters/helpers/IssueManager.js +4 -1
  100. package/src/sap/fe/core/converters/helpers/IssueManager.ts +3 -0
  101. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +4 -4
  102. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +3 -3
  103. package/src/sap/fe/core/converters/templates/ListReportConverter.js +13 -6
  104. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +26 -15
  105. package/src/sap/fe/core/designtime/AppComponent.designtime.js +3 -2
  106. package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
  107. package/src/sap/fe/core/formatters/CriticalityFormatter.ts +1 -1
  108. package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
  109. package/src/sap/fe/core/formatters/FPMFormatter.ts +4 -10
  110. package/src/sap/fe/core/formatters/KPIFormatter.js +1 -1
  111. package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -1
  112. package/src/sap/fe/core/formatters/TableFormatter.js +39 -28
  113. package/src/sap/fe/core/formatters/TableFormatter.ts +43 -28
  114. package/src/sap/fe/core/formatters/ValueFormatter.js +1 -1
  115. package/src/sap/fe/core/formatters/ValueFormatter.ts +7 -6
  116. package/src/sap/fe/core/fpm/Component.js +3 -2
  117. package/src/sap/fe/core/helpers/AppStartupHelper.js +2 -2
  118. package/src/sap/fe/core/helpers/AppStartupHelper.ts +7 -4
  119. package/src/sap/fe/core/helpers/BindingExpression.js +314 -355
  120. package/src/sap/fe/core/helpers/BindingExpression.ts +317 -391
  121. package/src/sap/fe/core/helpers/ClassSupport.js +27 -15
  122. package/src/sap/fe/core/helpers/ClassSupport.ts +31 -20
  123. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +63 -59
  124. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +56 -0
  125. package/src/sap/fe/core/helpers/EditState.js +81 -84
  126. package/src/sap/fe/core/helpers/EditState.ts +81 -0
  127. package/src/sap/fe/core/helpers/ExcelFormatHelper.js +62 -48
  128. package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +49 -0
  129. package/src/sap/fe/core/helpers/FPMHelper.js +52 -56
  130. package/src/sap/fe/core/helpers/FPMHelper.ts +62 -0
  131. package/src/sap/fe/core/helpers/KeepAliveHelper.js +3 -4
  132. package/src/sap/fe/core/helpers/KeepAliveHelper.ts +9 -9
  133. package/src/sap/fe/core/helpers/MassEditHelper.js +27 -18
  134. package/src/sap/fe/core/helpers/ModelHelper.js +229 -225
  135. package/src/sap/fe/core/helpers/ModelHelper.ts +227 -0
  136. package/src/sap/fe/core/helpers/PasteHelper.js +210 -132
  137. package/src/sap/fe/core/helpers/PasteHelper.ts +196 -0
  138. package/src/sap/fe/core/helpers/SemanticDateOperators.js +332 -313
  139. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +330 -0
  140. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +66 -67
  141. package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +73 -0
  142. package/src/sap/fe/core/helpers/StableIdHelper.js +4 -7
  143. package/src/sap/fe/core/helpers/StableIdHelper.ts +2 -6
  144. package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
  145. package/src/sap/fe/core/jsx-runtime/jsx.ts +1 -1
  146. package/src/sap/fe/core/library.js +4 -3
  147. package/src/sap/fe/core/library.support.js +3 -2
  148. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +1 -1
  149. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +1 -1
  150. package/src/sap/fe/core/messagebundle.properties +23 -10
  151. package/src/sap/fe/core/messagebundle_ar.properties +9 -0
  152. package/src/sap/fe/core/messagebundle_bg.properties +9 -0
  153. package/src/sap/fe/core/messagebundle_ca.properties +9 -0
  154. package/src/sap/fe/core/messagebundle_cs.properties +10 -1
  155. package/src/sap/fe/core/messagebundle_cy.properties +9 -0
  156. package/src/sap/fe/core/messagebundle_da.properties +9 -0
  157. package/src/sap/fe/core/messagebundle_de.properties +9 -0
  158. package/src/sap/fe/core/messagebundle_el.properties +9 -0
  159. package/src/sap/fe/core/messagebundle_en.properties +9 -0
  160. package/src/sap/fe/core/messagebundle_en_GB.properties +9 -0
  161. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +9 -0
  162. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +9 -0
  163. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +9 -0
  164. package/src/sap/fe/core/messagebundle_es.properties +9 -0
  165. package/src/sap/fe/core/messagebundle_es_MX.properties +9 -0
  166. package/src/sap/fe/core/messagebundle_et.properties +9 -0
  167. package/src/sap/fe/core/messagebundle_fi.properties +9 -0
  168. package/src/sap/fe/core/messagebundle_fr.properties +13 -4
  169. package/src/sap/fe/core/messagebundle_fr_CA.properties +15 -6
  170. package/src/sap/fe/core/messagebundle_hi.properties +15 -6
  171. package/src/sap/fe/core/messagebundle_hr.properties +15 -6
  172. package/src/sap/fe/core/messagebundle_hu.properties +9 -0
  173. package/src/sap/fe/core/messagebundle_id.properties +10 -1
  174. package/src/sap/fe/core/messagebundle_it.properties +9 -0
  175. package/src/sap/fe/core/messagebundle_iw.properties +9 -0
  176. package/src/sap/fe/core/messagebundle_ja.properties +9 -0
  177. package/src/sap/fe/core/messagebundle_kk.properties +15 -6
  178. package/src/sap/fe/core/messagebundle_ko.properties +9 -0
  179. package/src/sap/fe/core/messagebundle_lt.properties +9 -0
  180. package/src/sap/fe/core/messagebundle_lv.properties +15 -6
  181. package/src/sap/fe/core/messagebundle_ms.properties +14 -5
  182. package/src/sap/fe/core/messagebundle_nl.properties +9 -0
  183. package/src/sap/fe/core/messagebundle_no.properties +9 -0
  184. package/src/sap/fe/core/messagebundle_pl.properties +9 -0
  185. package/src/sap/fe/core/messagebundle_pt.properties +9 -0
  186. package/src/sap/fe/core/messagebundle_pt_PT.properties +9 -0
  187. package/src/sap/fe/core/messagebundle_ro.properties +9 -0
  188. package/src/sap/fe/core/messagebundle_ru.properties +9 -0
  189. package/src/sap/fe/core/messagebundle_sh.properties +11 -2
  190. package/src/sap/fe/core/messagebundle_sk.properties +9 -0
  191. package/src/sap/fe/core/messagebundle_sl.properties +15 -6
  192. package/src/sap/fe/core/messagebundle_sv.properties +9 -0
  193. package/src/sap/fe/core/messagebundle_th.properties +9 -0
  194. package/src/sap/fe/core/messagebundle_tr.properties +9 -0
  195. package/src/sap/fe/core/messagebundle_uk.properties +9 -0
  196. package/src/sap/fe/core/messagebundle_vi.properties +9 -0
  197. package/src/sap/fe/core/messagebundle_zh_CN.properties +9 -0
  198. package/src/sap/fe/core/messagebundle_zh_TW.properties +15 -6
  199. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +1 -1
  200. package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
  201. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +269 -202
  202. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +212 -0
  203. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +1 -1
  204. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +7 -6
  205. package/src/sap/fe/core/services/NavigationServiceFactory.js +406 -300
  206. package/src/sap/fe/core/services/NavigationServiceFactory.ts +316 -0
  207. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +149 -81
  208. package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +80 -0
  209. package/src/sap/fe/core/services/RoutingServiceFactory.js +987 -899
  210. package/src/sap/fe/core/services/RoutingServiceFactory.ts +898 -0
  211. package/src/sap/fe/core/services/ShellServicesFactory.js +1 -1
  212. package/src/sap/fe/core/services/ShellServicesFactory.ts +15 -10
  213. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +35 -81
  214. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +46 -94
  215. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +461 -487
  216. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +453 -0
  217. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +10 -8
  218. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +8 -0
  219. package/src/sap/fe/core/support/AnnotationIssue.support.js +15 -3
  220. package/src/sap/fe/core/support/AnnotationIssue.support.ts +16 -2
  221. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -2
  222. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.ts +1 -1
  223. package/src/sap/fe/core/templating/FieldControlHelper.js +8 -8
  224. package/src/sap/fe/core/templating/FieldControlHelper.ts +25 -7
  225. package/src/sap/fe/core/templating/FilterHelper.js +138 -72
  226. package/src/sap/fe/core/templating/FilterHelper.ts +139 -71
  227. package/src/sap/fe/core/templating/UIFormatters.js +31 -1
  228. package/src/sap/fe/core/templating/UIFormatters.ts +33 -2
  229. package/src/sap/fe/core/type/Email.js +1 -1
  230. package/src/sap/fe/core/type/Email.ts +4 -6
  231. package/ui5.yaml +0 -3
@@ -29,6 +29,7 @@ import {
29
29
  SelectionMode,
30
30
  TableColumnSettings,
31
31
  TableManifestConfiguration,
32
+ TableManifestSettingsConfiguration,
32
33
  TemplateType,
33
34
  VariantManagementType,
34
35
  ViewPathConfiguration,
@@ -73,7 +74,7 @@ import {
73
74
  or,
74
75
  resolveBindingString
75
76
  } from "sap/fe/core/helpers/BindingExpression";
76
- import { Draft, bindingContextPathVisitor, UI } from "sap/fe/core/converters/helpers/BindingHelper";
77
+ import { Entity, bindingContextPathVisitor, UI } from "sap/fe/core/converters/helpers/BindingHelper";
77
78
  import { KeyHelper } from "sap/fe/core/converters/helpers/Key";
78
79
  import tableFormatters from "sap/fe/core/formatters/TableFormatter";
79
80
  import { MessageType } from "sap/fe/core/formatters/TableFormatterTypes";
@@ -111,7 +112,11 @@ import {
111
112
  getStandardActionPaste,
112
113
  getStandardActionMassEdit,
113
114
  isDraftOrStickySupported,
114
- getInsertUpdateActionsTemplating
115
+ getInsertUpdateActionsTemplating,
116
+ getCreateVisibility,
117
+ isInDisplayMode,
118
+ getMassEditVisibility,
119
+ getRestrictions
115
120
  } from "./table/StandardActions";
116
121
 
117
122
  export type TableAnnotationConfiguration = {
@@ -132,6 +137,7 @@ export type TableAnnotationConfiguration = {
132
137
  standardActions: {
133
138
  actions: Record<string, StandardActionConfigType>;
134
139
  isInsertUpdateTemplated: boolean;
140
+ updatablePropertyPath: string;
135
141
  };
136
142
  displayMode?: boolean;
137
143
  threshold: number;
@@ -204,6 +210,7 @@ export type TableControlConfiguration = {
204
210
  showRowCount: boolean;
205
211
  enableMassEdit: boolean | undefined;
206
212
  enableAutoColumnWidth: boolean;
213
+ dataStateIndicatorFilter: string | undefined;
207
214
  };
208
215
 
209
216
  export type TableType = "GridTable" | "ResponsiveTable" | "AnalyticalTable";
@@ -247,6 +254,7 @@ export type AnnotationTableColumn = BaseTableColumn & {
247
254
  showDataFieldsLabel?: boolean;
248
255
  isKey?: boolean;
249
256
  unit?: string;
257
+ unitText?: string;
250
258
  exportSettings?: {
251
259
  template?: string;
252
260
  label?: string;
@@ -306,7 +314,6 @@ export type TableVisualization = {
306
314
  aggregates?: Record<string, AggregateData>;
307
315
  enableAnalytics?: boolean;
308
316
  enableAnalyticsSearch?: boolean;
309
- enableDataStateFilter: boolean;
310
317
  operationAvailableMap: string;
311
318
  operationAvailableProperties: string;
312
319
  };
@@ -557,13 +564,17 @@ export function updateLinkedProperties(entityType: EntityType, tableColumns: Tab
557
564
  tableColumns.forEach(oColumn => {
558
565
  const oTableColumn = oColumn as AnnotationTableColumn;
559
566
  if (oTableColumn.propertyInfos === undefined && oTableColumn.relativePath) {
560
- const oProperty = entityType.entityProperties.find(oProp => oProp.name === oTableColumn.relativePath);
567
+ const oProperty = entityType.entityProperties.find((oProp: Property) => oProp.name === oTableColumn.relativePath);
561
568
  if (oProperty) {
562
- const sUnit = getAssociatedCurrencyProperty(oProperty)?.name || getAssociatedUnitProperty(oProperty)?.name;
563
- if (sUnit) {
564
- const oUnitColumn = findColumnByPath(sUnit);
565
-
569
+ const oUnit = getAssociatedCurrencyProperty(oProperty) || getAssociatedUnitProperty(oProperty);
570
+ if (oUnit) {
571
+ const oUnitColumn = findColumnByPath(oUnit.name);
566
572
  oTableColumn.unit = oUnitColumn?.name;
573
+ } else {
574
+ const sUnit = oProperty?.annotations?.Measures?.ISOCurrency || oProperty?.annotations?.Measures?.Unit;
575
+ if (sUnit) {
576
+ oTableColumn.unitText = `${sUnit}`;
577
+ }
567
578
  }
568
579
 
569
580
  const displayMode = getDisplayMode(oProperty),
@@ -616,7 +627,6 @@ export function createTableVisualization(
616
627
  control: tableManifestConfig,
617
628
  actions: removeDuplicateActions(getTableActions(lineItemAnnotation, visualizationPath, converterContext, navigationSettings)),
618
629
  columns: columns,
619
- enableDataStateFilter: converterContext.getTemplateType() === "ObjectPage",
620
630
  operationAvailableMap: JSON.stringify(operationAvailableMap),
621
631
  operationAvailableProperties: getOperationAvailableProperties(operationAvailableMap, converterContext)
622
632
  };
@@ -642,7 +652,6 @@ export function createDefaultTableVisualization(converterContext: ConverterConte
642
652
  control: tableManifestConfig,
643
653
  actions: [],
644
654
  columns: columns,
645
- enableDataStateFilter: converterContext.getTemplateType() === "ObjectPage",
646
655
  operationAvailableMap: JSON.stringify(operationAvailableMap),
647
656
  operationAvailableProperties: getOperationAvailableProperties(operationAvailableMap, converterContext)
648
657
  };
@@ -700,6 +709,22 @@ function getOperationAvailableMap(lineItemAnnotation: LineItem | undefined, conv
700
709
  return operationAvailableMap;
701
710
  }
702
711
 
712
+ /**
713
+ * Gets updatable propertyPath for the current entityset if valid.
714
+ *
715
+ * @param converterContext The instance of the converter context
716
+ * @returns {string} The updatable property for the rows
717
+ */
718
+ function getCurrentEntitySetUpdatablePath(converterContext: ConverterContext): string {
719
+ const restrictions = getRestrictions(converterContext);
720
+ const entitySet = converterContext.getEntitySet();
721
+ const updatable = restrictions.isUpdatable;
722
+ const isOnlyDynamicOnCurrentEntity: any = updatable.isOnlyCurrentEntityExpression && !isConstant(updatable.expression);
723
+ const updatablePropertyPath = (entitySet?.annotations.Capabilities?.UpdateRestrictions?.Updatable as any)?.path;
724
+
725
+ return isOnlyDynamicOnCurrentEntity ? (updatablePropertyPath as string) : "";
726
+ }
727
+
703
728
  /**
704
729
  * Method to retrieve all property paths assigned to the Core.OperationAvailable annotation.
705
730
  *
@@ -922,7 +947,8 @@ export function getSelectionMode(
922
947
  converterContext: ConverterContext,
923
948
  isEntitySet: boolean,
924
949
  targetCapabilities: TableCapabilityRestriction,
925
- isDeleteButtonVisible?: Expression<boolean>
950
+ deleteButtonVisibilityExpression?: Expression<boolean>,
951
+ massEditVisibilityExpression: Expression<boolean> = constant(false)
926
952
  ): string | undefined {
927
953
  if (!lineItemAnnotation) {
928
954
  return SelectionMode.None;
@@ -943,12 +969,31 @@ export function getSelectionMode(
943
969
  isParentDeletable = isPathDeletable(converterContext.getDataModelObjectPath(), undefined);
944
970
  parentEntitySetDeletable = isParentDeletable ? compileBinding(isParentDeletable, true) : isParentDeletable;
945
971
  }
946
- if (selectionMode && selectionMode === SelectionMode.None && isDeleteButtonVisible) {
947
- return compileBinding(ifElse(isDeleteButtonVisible, constant("Multi"), constant("None")));
972
+
973
+ const bMassEditEnabled: boolean = !isConstant(massEditVisibilityExpression) || massEditVisibilityExpression.value !== false;
974
+ if (selectionMode && selectionMode === SelectionMode.None && deleteButtonVisibilityExpression) {
975
+ if (converterContext.getTemplateType() === TemplateType.ObjectPage && bMassEditEnabled) {
976
+ // Mass Edit in OP is enabled only in edit mode.
977
+ return compileBinding(
978
+ ifElse(
979
+ and(equal(bindingExpression("/editMode", "ui"), "Editable"), massEditVisibilityExpression),
980
+ constant("Multi"),
981
+ ifElse(deleteButtonVisibilityExpression, constant("Multi"), constant("None"))
982
+ )
983
+ );
984
+ } else if (bMassEditEnabled) {
985
+ return SelectionMode.Multi;
986
+ }
987
+
988
+ return compileBinding(ifElse(deleteButtonVisibilityExpression, constant("Multi"), constant("None")));
948
989
  }
949
990
  if (!selectionMode || selectionMode === SelectionMode.Auto) {
950
991
  selectionMode = SelectionMode.Multi;
951
992
  }
993
+ if (bMassEditEnabled) {
994
+ // Override default selection mode when mass edit is visible
995
+ selectionMode = selectionMode === SelectionMode.Single ? SelectionMode.Single : SelectionMode.Multi;
996
+ }
952
997
 
953
998
  if (
954
999
  hasBoundActionsAlwaysVisibleInToolBar(lineItemAnnotation, converterContext.getEntityType()) ||
@@ -965,12 +1010,22 @@ export function getSelectionMode(
965
1010
  aVisibleBindingExpressions = getVisibleExpForCustomActionsRequiringContext(manifestActions);
966
1011
 
967
1012
  // No action requiring a context:
968
- if (aHiddenBindingExpressions.length === 0 && aVisibleBindingExpressions.length === 0 && isDeleteButtonVisible) {
1013
+ if (
1014
+ aHiddenBindingExpressions.length === 0 &&
1015
+ aVisibleBindingExpressions.length === 0 &&
1016
+ (deleteButtonVisibilityExpression || bMassEditEnabled)
1017
+ ) {
969
1018
  if (!isEntitySet) {
970
- if (targetCapabilities.isDeletable || parentEntitySetDeletable !== "false") {
1019
+ // Example: OP case
1020
+ if (targetCapabilities.isDeletable || parentEntitySetDeletable !== "false" || bMassEditEnabled) {
1021
+ // Building expression for delete and mass edit
1022
+ const buttonVisibilityExpression = or(
1023
+ deleteButtonVisibilityExpression || true, // default delete visibility as true
1024
+ massEditVisibilityExpression
1025
+ );
971
1026
  return compileBinding(
972
1027
  ifElse(
973
- and(equal(bindingExpression("/editMode", "ui"), "Editable"), isDeleteButtonVisible),
1028
+ and(equal(bindingExpression("/editMode", "ui"), "Editable"), buttonVisibilityExpression),
974
1029
  constant(selectionMode),
975
1030
  constant(SelectionMode.None)
976
1031
  )
@@ -979,18 +1034,28 @@ export function getSelectionMode(
979
1034
  return SelectionMode.None;
980
1035
  }
981
1036
  // EntitySet deletable:
982
- } else if (targetCapabilities.isDeletable && isDeleteButtonVisible) {
983
- return compileBinding(ifElse(isDeleteButtonVisible, constant(selectionMode), constant("None")));
1037
+ } else if (bMassEditEnabled) {
1038
+ // example: LR scenario
1039
+ return selectionMode;
1040
+ } else if (targetCapabilities.isDeletable && deleteButtonVisibilityExpression) {
1041
+ return compileBinding(ifElse(deleteButtonVisibilityExpression, constant(selectionMode), constant("None")));
984
1042
  // EntitySet not deletable:
985
1043
  } else {
986
1044
  return SelectionMode.None;
987
1045
  }
988
1046
  // There are actions requiring a context:
989
1047
  } else if (!isEntitySet) {
990
- if (targetCapabilities.isDeletable || parentEntitySetDeletable !== "false") {
1048
+ // Example: OP case
1049
+ if (targetCapabilities.isDeletable || parentEntitySetDeletable !== "false" || bMassEditEnabled) {
1050
+ // Use selectionMode in edit mode if delete is enabled or mass edit is visible
1051
+ const editModebuttonVisibilityExpression = ifElse(
1052
+ bMassEditEnabled && !targetCapabilities.isDeletable,
1053
+ massEditVisibilityExpression,
1054
+ constant(true)
1055
+ );
991
1056
  return compileBinding(
992
1057
  ifElse(
993
- equal(bindingExpression("/editMode", "ui"), "Editable"),
1058
+ and(equal(bindingExpression("/editMode", "ui"), "Editable"), editModebuttonVisibilityExpression),
994
1059
  constant(selectionMode),
995
1060
  ifElse(
996
1061
  or(...aHiddenBindingExpressions.concat(aVisibleBindingExpressions)),
@@ -1009,13 +1074,14 @@ export function getSelectionMode(
1009
1074
  );
1010
1075
  }
1011
1076
  //EntitySet deletable:
1012
- } else if (targetCapabilities.isDeletable) {
1013
- return SelectionMode.Multi;
1077
+ } else if (targetCapabilities.isDeletable || bMassEditEnabled) {
1078
+ // Example: LR scenario
1079
+ return selectionMode;
1014
1080
  //EntitySet not deletable:
1015
1081
  } else {
1016
1082
  return compileBinding(
1017
1083
  ifElse(
1018
- or(...aHiddenBindingExpressions.concat(aVisibleBindingExpressions)),
1084
+ or(...aHiddenBindingExpressions.concat(aVisibleBindingExpressions), massEditVisibilityExpression),
1019
1085
  constant(selectionMode),
1020
1086
  constant(SelectionMode.None)
1021
1087
  )
@@ -1121,14 +1187,25 @@ function getHighlightRowBinding(
1121
1187
  defaultHighlightRowDefinition = getMessageTypeFromCriticalityType(criticalityAnnotation);
1122
1188
  }
1123
1189
  }
1124
- return ifElse(
1125
- isDraftRoot && Draft.IsNewObject,
1126
- MessageType.Information as MessageType,
1127
- formatResult(
1128
- [defaultHighlightRowDefinition, bindingExpression(`filteredMessages`, "internal")],
1129
- tableFormatters.rowHighlighting,
1130
- targetEntityType
1131
- )
1190
+
1191
+ const aMissingKeys: any[] = [];
1192
+ targetEntityType?.keys.forEach((key: any) => {
1193
+ if (key.name !== "IsActiveEntity") {
1194
+ aMissingKeys.push(bindingExpression(key.name, undefined));
1195
+ }
1196
+ });
1197
+
1198
+ return formatResult(
1199
+ [
1200
+ defaultHighlightRowDefinition,
1201
+ bindingExpression(`filteredMessages`, "internal"),
1202
+ isDraftRoot && Entity.HasActive,
1203
+ isDraftRoot && Entity.IsActive,
1204
+ `${isDraftRoot}`,
1205
+ ...aMissingKeys
1206
+ ],
1207
+ tableFormatters.rowHighlighting,
1208
+ targetEntityType
1132
1209
  );
1133
1210
  }
1134
1211
 
@@ -1445,7 +1522,7 @@ const _isValidColumn = function(dataField: DataFieldAbstractTypes) {
1445
1522
  export const _getVisibleExpression = function(
1446
1523
  dataFieldModelPath: DataModelObjectPath,
1447
1524
  formatOptions?: any,
1448
- returnExpression?: Boolean
1525
+ returnExpression: boolean = false
1449
1526
  ): BindingExpression<string> {
1450
1527
  const targetObject: DataFieldAbstractTypes | DataPointTypeTypes = dataFieldModelPath.targetObject;
1451
1528
  let propertyValue;
@@ -1498,7 +1575,7 @@ export const _getVisibleExpression = function(
1498
1575
  const _getFieldGroupHiddenExpressions = function(
1499
1576
  dataFieldGroup: DataFieldAbstractTypes,
1500
1577
  fieldFormatOptions: any
1501
- ): BindingExpression<string> {
1578
+ ): BindingExpression<string> | undefined {
1502
1579
  const aFieldGroupHiddenExpressions: BindingExpression<string>[] = [];
1503
1580
  if (
1504
1581
  dataFieldGroup.$Type === UIAnnotationTypes.DataFieldForAnnotation &&
@@ -1512,6 +1589,8 @@ const _getFieldGroupHiddenExpressions = function(
1512
1589
  return compileBinding(
1513
1590
  ifElse(or(...(aFieldGroupHiddenExpressions as ExpressionOrPrimitive<boolean>[])), constant(true), constant(false))
1514
1591
  );
1592
+ } else {
1593
+ return undefined;
1515
1594
  }
1516
1595
  };
1517
1596
 
@@ -1907,7 +1986,8 @@ const getColumnsFromAnnotations = function(
1907
1986
  }
1908
1987
 
1909
1988
  // TODO: For situation POC - increase width of the column with the situations indicator - works for the situations demo app only!
1910
- // Might be a good idea to move the complete column width determination to the converter, that would allow us to widen the columns as needed. This workaround only deals with Date columns.
1989
+ // Might be a good idea to move the complete column width determination to the converter, that would allow us to widen
1990
+ // the columns as needed. This workaround only deals with Date columns.
1911
1991
  const { hasDraftIndicator } = getDefaultDraftIndicatorForColumn(name, semanticKeys);
1912
1992
  const widthOverride =
1913
1993
  (converterContext.getEntityType().annotations as any).FE?.Situations &&
@@ -2163,9 +2243,10 @@ export function getP13nMode(
2163
2243
  // No personalization configured in manifest.
2164
2244
  aPersonalization.push("Sort");
2165
2245
  aPersonalization.push("Column");
2166
- if (variantManagement === VariantManagementType.Control) {
2246
+ if (variantManagement === VariantManagementType.Control || _isFilterBarHidden(manifestWrapper, converterContext)) {
2167
2247
  // Feature parity with V2.
2168
2248
  // Enable table filtering by default only in case of Control level variant management.
2249
+ // Or when the LR filter bar is hidden via manifest setting
2169
2250
  aPersonalization.push("Filter");
2170
2251
  }
2171
2252
  if (bAnalyticalTable) {
@@ -2177,6 +2258,24 @@ export function getP13nMode(
2177
2258
  return undefined;
2178
2259
  }
2179
2260
 
2261
+ /**
2262
+ * Returns a boolean suggesting if a filter bar is being used on the page.
2263
+ *
2264
+ * Chart has a dependency to filter bar (issue with loading data). Once resolved, the check for chart should be removed here.
2265
+ * Until then, hiding filter bar is now allowed if a chart is being used on LR.
2266
+ *
2267
+ * @param {ManifestWrapper} manifestWrapper Manifest settings getter for the page
2268
+ * @param {ConverterContext} converterContext The instance of the converter context
2269
+ * @returns {boolean} Boolean suggesting if a filter bar is being used on the page.
2270
+ */
2271
+ function _isFilterBarHidden(manifestWrapper: ManifestWrapper, converterContext: ConverterContext): boolean {
2272
+ return (
2273
+ manifestWrapper.isFilterBarHidden() &&
2274
+ !converterContext.getManifestWrapper().hasMultipleVisualizations() &&
2275
+ converterContext.getTemplateType() !== TemplateType.AnalyticalListPage
2276
+ );
2277
+ }
2278
+
2180
2279
  /**
2181
2280
  * Returns a JSON string containing the sort conditions for the presentation variant.
2182
2281
  *
@@ -2314,14 +2413,24 @@ export function getTableAnnotationConfiguration(
2314
2413
  tableManifestConfiguration,
2315
2414
  viewConfiguration
2316
2415
  );
2317
- const isDeleteButtonVisible = getDeleteVisibility(converterContext, standardActionsContext);
2416
+
2417
+ const deleteButtonVisibilityExpression = getDeleteVisibility(converterContext, standardActionsContext);
2418
+ const createButtonVisibilityExpression = getCreateVisibility(converterContext, standardActionsContext);
2419
+ const massEditButtonVisibilityExpression = getMassEditVisibility(converterContext, standardActionsContext);
2420
+ const isInsertUpdateTemplated = getInsertUpdateActionsTemplating(
2421
+ standardActionsContext,
2422
+ isDraftOrStickySupported(converterContext),
2423
+ compileBinding(createButtonVisibilityExpression) === "false"
2424
+ );
2425
+
2318
2426
  const selectionMode = getSelectionMode(
2319
2427
  lineItemAnnotation,
2320
2428
  visualizationPath,
2321
2429
  converterContext,
2322
2430
  hasAbsolutePath,
2323
2431
  targetCapabilities,
2324
- isDeleteButtonVisible
2432
+ deleteButtonVisibilityExpression,
2433
+ massEditButtonVisibilityExpression
2325
2434
  );
2326
2435
  let threshold = navigationPropertyPath ? 10 : 30;
2327
2436
  if (presentationVariantAnnotation?.MaxItems) {
@@ -2331,17 +2440,12 @@ export function getTableAnnotationConfiguration(
2331
2440
  const creationBehaviour = _getCreationBehaviour(lineItemAnnotation, tableManifestConfiguration, converterContext, navigationSettings);
2332
2441
  const variantManagement: VariantManagementType = pageManifestSettings.getVariantManagement();
2333
2442
  const isSearchable = isPathSearchable(converterContext.getDataModelObjectPath());
2334
- const tableActions = {
2443
+ const standardActions = {
2335
2444
  create: getStandardActionCreate(converterContext, standardActionsContext),
2336
2445
  "delete": getStandardActionDelete(converterContext, standardActionsContext),
2337
- paste: getStandardActionPaste(converterContext, standardActionsContext),
2338
- massEdit: getStandardActionMassEdit(converterContext, standardActionsContext, selectionMode)
2446
+ paste: getStandardActionPaste(converterContext, standardActionsContext, isInsertUpdateTemplated),
2447
+ massEdit: getStandardActionMassEdit(converterContext, standardActionsContext)
2339
2448
  };
2340
- const isInsertUpdateTemplated = getInsertUpdateActionsTemplating(
2341
- standardActionsContext,
2342
- isDraftOrStickySupported(converterContext),
2343
- tableActions.create.visible === "false"
2344
- );
2345
2449
 
2346
2450
  return {
2347
2451
  id: id,
@@ -2357,16 +2461,18 @@ export function getTableAnnotationConfiguration(
2357
2461
  ),
2358
2462
  p13nMode: p13nMode,
2359
2463
  standardActions: {
2360
- actions: tableActions,
2361
- isInsertUpdateTemplated: isInsertUpdateTemplated
2464
+ actions: standardActions,
2465
+ isInsertUpdateTemplated: isInsertUpdateTemplated,
2466
+ updatablePropertyPath: getCurrentEntitySetUpdatablePath(converterContext)
2362
2467
  },
2363
2468
  displayMode: isInDisplayMode(converterContext, viewConfiguration),
2364
2469
  create: creationBehaviour,
2365
2470
  selectionMode: selectionMode,
2366
2471
  autoBindOnInit:
2367
- converterContext.getTemplateType() !== TemplateType.ListReport &&
2368
- converterContext.getTemplateType() !== TemplateType.AnalyticalListPage &&
2369
- !(viewConfiguration && converterContext.getManifestWrapper().hasMultipleVisualizations(viewConfiguration)),
2472
+ _isFilterBarHidden(pageManifestSettings, converterContext) ||
2473
+ (converterContext.getTemplateType() !== TemplateType.ListReport &&
2474
+ converterContext.getTemplateType() !== TemplateType.AnalyticalListPage &&
2475
+ !(viewConfiguration && pageManifestSettings.hasMultipleVisualizations(viewConfiguration))),
2370
2476
  variantManagement: variantManagement === "Control" && !p13nMode ? VariantManagementType.None : variantManagement,
2371
2477
  threshold: threshold,
2372
2478
  sortConditions: getSortConditions(converterContext, presentationVariantAnnotation, columns),
@@ -2408,19 +2514,6 @@ function _getExportDataType(dataType: string, isComplexProperty: boolean = false
2408
2514
  return exportDataType;
2409
2515
  }
2410
2516
 
2411
- function isInDisplayMode(converterContext: ConverterContext, viewConfiguration?: ViewPathConfiguration): boolean {
2412
- const templateType = converterContext.getTemplateType();
2413
- if (
2414
- templateType === TemplateType.ListReport ||
2415
- templateType === TemplateType.AnalyticalListPage ||
2416
- (viewConfiguration && converterContext.getManifestWrapper().hasMultipleVisualizations(viewConfiguration))
2417
- ) {
2418
- return true;
2419
- }
2420
- // updatable will be handled at the property level
2421
- return false;
2422
- }
2423
-
2424
2517
  /**
2425
2518
  * Split the visualization path into the navigation property path and annotation.
2426
2519
  *
@@ -2461,126 +2554,166 @@ export function getSelectionVariantConfiguration(
2461
2554
  return undefined;
2462
2555
  }
2463
2556
 
2557
+ function _getFullScreenBasedOnDevice(
2558
+ tableSettings: TableManifestSettingsConfiguration,
2559
+ converterContext: ConverterContext,
2560
+ isIphone: boolean
2561
+ ): boolean {
2562
+ // If enableFullScreen is not set, use as default true on phone and false otherwise
2563
+ let enableFullScreen = tableSettings.enableFullScreen ?? isIphone;
2564
+ // Make sure that enableFullScreen is not set on ListReport for desktop or tablet
2565
+ if (!isIphone && enableFullScreen && converterContext.getTemplateType() === TemplateType.ListReport) {
2566
+ enableFullScreen = false;
2567
+ converterContext.getDiagnostics().addIssue(IssueCategory.Manifest, IssueSeverity.Low, IssueType.FULLSCREENMODE_NOT_ON_LISTREPORT);
2568
+ }
2569
+ return enableFullScreen;
2570
+ }
2571
+
2572
+ function _getMultiSelectMode(
2573
+ tableSettings: TableManifestSettingsConfiguration,
2574
+ tableType: TableType,
2575
+ converterContext: ConverterContext
2576
+ ): string | undefined {
2577
+ let multiSelectMode: string | undefined;
2578
+ if (tableType !== "ResponsiveTable") {
2579
+ return undefined;
2580
+ }
2581
+ switch (converterContext.getTemplateType()) {
2582
+ case TemplateType.ListReport:
2583
+ case TemplateType.AnalyticalListPage:
2584
+ multiSelectMode = !tableSettings.selectAll ? "ClearAll" : "Default";
2585
+ break;
2586
+ case TemplateType.ObjectPage:
2587
+ multiSelectMode = tableSettings.selectAll === false ? "ClearAll" : "Default";
2588
+ if (converterContext.getManifestWrapper().useIconTabBar()) {
2589
+ multiSelectMode = !tableSettings.selectAll ? "ClearAll" : "Default";
2590
+ }
2591
+ break;
2592
+ default:
2593
+ }
2594
+
2595
+ return multiSelectMode;
2596
+ }
2597
+
2598
+ function _getTableType(
2599
+ tableSettings: TableManifestSettingsConfiguration,
2600
+ aggregationHelper: AggregationHelper,
2601
+ converterContext: ConverterContext
2602
+ ): TableType {
2603
+ let tableType = tableSettings?.type || "ResponsiveTable";
2604
+ if (converterContext.getTemplateType() !== "ObjectPage") {
2605
+ if (tableSettings?.type === "AnalyticalTable" && !aggregationHelper.isAnalyticsSupported()) {
2606
+ tableType = "GridTable";
2607
+ }
2608
+ if (!tableSettings?.type) {
2609
+ if (converterContext.getManifestWrapper().isDesktop() && aggregationHelper.isAnalyticsSupported()) {
2610
+ tableType = "AnalyticalTable";
2611
+ } else {
2612
+ tableType = "ResponsiveTable";
2613
+ }
2614
+ }
2615
+ }
2616
+ return tableType;
2617
+ }
2618
+ function _getFilters(
2619
+ tableSettings: TableManifestSettingsConfiguration,
2620
+ quickFilterPaths: { annotationPath: string }[],
2621
+ quickSelectionVariant: any,
2622
+ path: { annotationPath: string },
2623
+ converterContext: ConverterContext
2624
+ ): any {
2625
+ if (quickSelectionVariant) {
2626
+ quickFilterPaths.push({ annotationPath: path.annotationPath });
2627
+ }
2628
+ return {
2629
+ quickFilters: {
2630
+ enabled:
2631
+ converterContext.getTemplateType() === TemplateType.ListReport ? "{= ${pageInternal>hasPendingFilters} !== true}" : true,
2632
+ showCounts: tableSettings?.quickVariantSelection?.showCounts,
2633
+ paths: quickFilterPaths
2634
+ }
2635
+ };
2636
+ }
2637
+
2638
+ function _getEnableExport(
2639
+ tableSettings: TableManifestSettingsConfiguration,
2640
+ converterContext: ConverterContext,
2641
+ enablePaste: boolean
2642
+ ): boolean {
2643
+ return tableSettings.enableExport !== undefined
2644
+ ? tableSettings.enableExport
2645
+ : converterContext.getTemplateType() !== "ObjectPage" || enablePaste;
2646
+ }
2647
+
2648
+ function _getFilterConfiguration(
2649
+ tableSettings: TableManifestSettingsConfiguration,
2650
+ lineItemAnnotation: LineItem | undefined,
2651
+ converterContext: ConverterContext
2652
+ ): any {
2653
+ if (!lineItemAnnotation) {
2654
+ return {};
2655
+ }
2656
+ const quickFilterPaths: { annotationPath: string }[] = [];
2657
+ const targetEntityType = converterContext.getAnnotationEntityType(lineItemAnnotation);
2658
+ let quickSelectionVariant: any;
2659
+ let filters;
2660
+ tableSettings?.quickVariantSelection?.paths?.forEach((path: { annotationPath: string }) => {
2661
+ quickSelectionVariant = targetEntityType.resolvePath("@" + path.annotationPath);
2662
+ filters = _getFilters(tableSettings, quickFilterPaths, quickSelectionVariant, path, converterContext);
2663
+ });
2664
+
2665
+ let hideTableTitle = false;
2666
+ hideTableTitle = !!tableSettings.quickVariantSelection?.hideTableTitle;
2667
+ return {
2668
+ filters: filters,
2669
+ headerVisible: !(quickSelectionVariant && hideTableTitle)
2670
+ };
2671
+ }
2672
+
2464
2673
  export function getTableManifestConfiguration(
2465
2674
  lineItemAnnotation: LineItem | undefined,
2466
2675
  visualizationPath: string,
2467
2676
  converterContext: ConverterContext,
2468
- checkCondensedLayout: boolean = false
2677
+ checkCondensedLayout = false
2469
2678
  ): TableControlConfiguration {
2470
2679
  const tableManifestSettings: TableManifestConfiguration = converterContext.getManifestControlConfiguration(visualizationPath);
2471
2680
  const tableSettings = (tableManifestSettings && tableManifestSettings.tableSettings) || {};
2472
- let quickSelectionVariant: any;
2473
- const quickFilterPaths: { annotationPath: string }[] = [];
2474
- let enableExport = true;
2475
- let creationMode = CreationMode.NewPage;
2476
- let filters;
2477
- let createAtEnd = true;
2478
- let disableAddRowButtonForEmptyData = false;
2479
- let customValidationFunction;
2480
- let condensedTableLayout = false;
2481
- let hideTableTitle = false;
2482
- let tableType: TableType = "ResponsiveTable";
2483
- let enableFullScreen = false;
2484
- let selectionLimit = 200;
2485
- let multiSelectMode;
2681
+ const creationMode = CreationMode.NewPage;
2486
2682
  const enableAutoColumnWidth = !converterContext.getManifestWrapper().isPhone();
2487
2683
  const enablePaste =
2488
2684
  tableSettings.enablePaste !== undefined ? tableSettings.enablePaste : converterContext.getTemplateType() === "ObjectPage"; // Paste is disabled by default excepted for OP
2685
+ const dataStateIndicatorFilter =
2686
+ converterContext.getTemplateType() === TemplateType.ListReport ? "API.dataStateIndicatorFilter" : undefined;
2489
2687
  const isCondensedTableLayoutCompliant = checkCondensedLayout && converterContext.getManifestWrapper().isCondensedLayoutCompliant();
2688
+ const oFilterConfiguration = _getFilterConfiguration(tableSettings, lineItemAnnotation, converterContext);
2689
+ const customValidationFunction = tableSettings.creationMode?.customValidationFunction;
2690
+ const condensedTableLayout = tableSettings.condensedTableLayout !== undefined ? tableSettings.condensedTableLayout : false;
2490
2691
  const entityType = converterContext.getEntityType();
2491
2692
  const aggregationHelper = new AggregationHelper(entityType, converterContext);
2492
- if (lineItemAnnotation) {
2493
- const targetEntityType = converterContext.getAnnotationEntityType(lineItemAnnotation);
2494
- tableSettings?.quickVariantSelection?.paths?.forEach((path: { annotationPath: string }) => {
2495
- quickSelectionVariant = targetEntityType.resolvePath("@" + path.annotationPath);
2496
- // quickSelectionVariant = converterContext.getEntityTypeAnnotation(path.annotationPath);
2497
- if (quickSelectionVariant) {
2498
- quickFilterPaths.push({ annotationPath: path.annotationPath });
2499
- }
2500
- filters = {
2501
- quickFilters: {
2502
- enabled:
2503
- converterContext.getTemplateType() === TemplateType.ListReport
2504
- ? "{= ${pageInternal>hasPendingFilters} !== true}"
2505
- : true,
2506
- showCounts: tableSettings?.quickVariantSelection?.showCounts,
2507
- paths: quickFilterPaths
2508
- }
2509
- };
2510
- });
2511
- creationMode = tableSettings.creationMode?.name || creationMode;
2512
- createAtEnd = tableSettings.creationMode?.createAtEnd !== undefined ? tableSettings.creationMode?.createAtEnd : true;
2513
- customValidationFunction = tableSettings.creationMode?.customValidationFunction;
2514
- // if a custom validation function is provided, disableAddRowButtonForEmptyData should not be considered, i.e. set to false
2515
- disableAddRowButtonForEmptyData = !customValidationFunction ? !!tableSettings.creationMode?.disableAddRowButtonForEmptyData : false;
2516
- condensedTableLayout = tableSettings.condensedTableLayout !== undefined ? tableSettings.condensedTableLayout : false;
2517
- hideTableTitle = !!tableSettings.quickVariantSelection?.hideTableTitle;
2518
- tableType = tableSettings?.type || "ResponsiveTable";
2519
- if (converterContext.getTemplateType() !== "ObjectPage") {
2520
- if (tableSettings?.type === "AnalyticalTable" && !aggregationHelper.isAnalyticsSupported()) {
2521
- tableType = "GridTable";
2522
- }
2523
- if (!tableSettings?.type) {
2524
- if (converterContext.getManifestWrapper().isDesktop() && aggregationHelper.isAnalyticsSupported()) {
2525
- tableType = "AnalyticalTable";
2526
- } else {
2527
- tableType = "ResponsiveTable";
2528
- }
2529
- }
2530
- }
2531
- // If enableFullScreen is not set, use as default true on phone and false otherwise
2532
- enableFullScreen = tableSettings.enableFullScreen ?? converterContext.getManifestWrapper().isPhone();
2533
- // Make sure that enableFullScreen is not set on ListReport for desktop or tablet
2534
- if (
2535
- !converterContext.getManifestWrapper().isPhone() &&
2536
- enableFullScreen &&
2537
- converterContext.getTemplateType() === TemplateType.ListReport
2538
- ) {
2539
- enableFullScreen = false;
2540
- converterContext
2541
- .getDiagnostics()
2542
- .addIssue(IssueCategory.Manifest, IssueSeverity.Low, IssueType.FULLSCREENMODE_NOT_ON_LISTREPORT);
2543
- }
2544
- selectionLimit = tableSettings.selectAll === true || tableSettings.selectionLimit === 0 ? 0 : tableSettings.selectionLimit || 200;
2545
- if (tableType === "ResponsiveTable") {
2546
- if (
2547
- converterContext.getTemplateType() === TemplateType.ListReport ||
2548
- converterContext.getTemplateType() === TemplateType.AnalyticalListPage
2549
- ) {
2550
- multiSelectMode = !!tableSettings.selectAll ? "Default" : "ClearAll";
2551
- }
2552
- if (converterContext.getTemplateType() === TemplateType.ObjectPage) {
2553
- if (converterContext.getManifestWrapper().useIconTabBar()) {
2554
- multiSelectMode = !!tableSettings.selectAll ? "Default" : "ClearAll";
2555
- } else {
2556
- multiSelectMode = tableSettings.selectAll === false ? "ClearAll" : "Default";
2557
- }
2558
- }
2559
- }
2560
- enableExport =
2561
- tableSettings.enableExport !== undefined
2562
- ? tableSettings.enableExport
2563
- : converterContext.getTemplateType() !== "ObjectPage" || enablePaste;
2564
- }
2565
- return {
2566
- filters: filters,
2567
- type: tableType,
2568
- enableFullScreen: enableFullScreen,
2569
- headerVisible: !(quickSelectionVariant && hideTableTitle),
2570
- enableExport: enableExport,
2571
- creationMode: creationMode,
2572
- createAtEnd: createAtEnd,
2573
- disableAddRowButtonForEmptyData: disableAddRowButtonForEmptyData,
2693
+ const tableType: TableType = _getTableType(tableSettings, aggregationHelper, converterContext);
2694
+ const oConfiguration = {
2695
+ createAtEnd: tableSettings.creationMode?.createAtEnd !== undefined ? tableSettings.creationMode?.createAtEnd : true,
2696
+ creationMode: tableSettings.creationMode?.name || creationMode,
2574
2697
  customValidationFunction: customValidationFunction,
2575
- useCondensedTableLayout: condensedTableLayout && isCondensedTableLayoutCompliant,
2576
- selectionLimit: selectionLimit,
2577
- multiSelectMode: multiSelectMode,
2698
+ dataStateIndicatorFilter: dataStateIndicatorFilter,
2699
+ // if a custom validation function is provided, disableAddRowButtonForEmptyData should not be considered, i.e. set to false
2700
+ disableAddRowButtonForEmptyData: !customValidationFunction ? !!tableSettings.creationMode?.disableAddRowButtonForEmptyData : false,
2701
+ enableAutoColumnWidth: enableAutoColumnWidth,
2702
+ enableExport: _getEnableExport(tableSettings, converterContext, enablePaste),
2703
+ enableFullScreen: _getFullScreenBasedOnDevice(tableSettings, converterContext, converterContext.getManifestWrapper().isPhone()),
2704
+ enableMassEdit: tableSettings?.enableMassEdit,
2578
2705
  enablePaste: enablePaste,
2706
+ headerVisible: true,
2707
+ multiSelectMode: _getMultiSelectMode(tableSettings, tableType, converterContext),
2708
+ selectionLimit: tableSettings.selectAll === true || tableSettings.selectionLimit === 0 ? 0 : tableSettings.selectionLimit || 200,
2709
+
2579
2710
  showRowCount:
2580
2711
  !tableSettings?.quickVariantSelection?.showCounts && !converterContext.getManifestWrapper().getViewConfiguration()?.showCounts,
2581
- enableMassEdit: tableSettings?.enableMassEdit,
2582
- enableAutoColumnWidth: enableAutoColumnWidth
2712
+ type: tableType,
2713
+ useCondensedTableLayout: condensedTableLayout && isCondensedTableLayoutCompliant
2583
2714
  };
2715
+
2716
+ return { ...oConfiguration, ...oFilterConfiguration };
2584
2717
  }
2585
2718
 
2586
2719
  export type configTypeConstraints = {
@@ -2607,11 +2740,11 @@ export type configType = {
2607
2740
 
2608
2741
  export function getTypeConfig(oProperty: Property | DataFieldAbstractTypes, dataType: string | undefined): any {
2609
2742
  let oTargetMapping = EDM_TYPE_MAPPING[(oProperty as Property)?.type] || (dataType ? EDM_TYPE_MAPPING[dataType] : undefined);
2610
- if (!oTargetMapping && (oProperty as Property).targetType && (oProperty as Property).targetType?._type === "TypeDefinition") {
2743
+ if (!oTargetMapping && (oProperty as Property)?.targetType && (oProperty as Property).targetType?._type === "TypeDefinition") {
2611
2744
  oTargetMapping = EDM_TYPE_MAPPING[((oProperty as Property).targetType as TypeDefinition).underlyingType];
2612
2745
  }
2613
2746
  const propertyTypeConfig: configType = {
2614
- type: oTargetMapping.type,
2747
+ type: oTargetMapping?.type,
2615
2748
  constraints: {},
2616
2749
  formatOptions: {}
2617
2750
  };