@sapui5/sap.fe.templates 1.149.0 → 1.150.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 (23) hide show
  1. package/package.json +1 -1
  2. package/src/sap/fe/templates/.library +1 -1
  3. package/src/sap/fe/templates/AnalyticalListPage/manifest.json +1 -1
  4. package/src/sap/fe/templates/ListReport/ListReportController.controller.js +82 -3
  5. package/src/sap/fe/templates/ListReport/ListReportController.controller.ts +74 -2
  6. package/src/sap/fe/templates/ListReport/manifest.json +1 -1
  7. package/src/sap/fe/templates/ListReport/view/fragments/Table.fragment.xml +1 -0
  8. package/src/sap/fe/templates/ListReport/view/fragments/VariantManagement.fragment.xml +1 -0
  9. package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +4 -2
  10. package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +102 -73
  11. package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.ts +102 -91
  12. package/src/sap/fe/templates/ObjectPage/components/CollaborationDraft.js +19 -1
  13. package/src/sap/fe/templates/ObjectPage/components/CollaborationDraft.tsx +17 -0
  14. package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.js +3 -2
  15. package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.ts +4 -1
  16. package/src/sap/fe/templates/ObjectPage/manifest.json +1 -1
  17. package/src/sap/fe/templates/ObjectPage/view/fragments/EditableHeaderFacet.fragment.xml +2 -2
  18. package/src/sap/fe/templates/ObjectPage/view/fragments/ExpandedHeading.fragment.xml +1 -1
  19. package/src/sap/fe/templates/ObjectPage/view/fragments/Heading.fragment.xml +7 -3
  20. package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderForm.fragment.xml +1 -0
  21. package/src/sap/fe/templates/ObjectPage/view/fragments/Section.fragment.xml +4 -4
  22. package/src/sap/fe/templates/ObjectPage/view/fragments/Table.fragment.xml +1 -0
  23. package/src/sap/fe/templates/library.js +1 -1
@@ -22,12 +22,14 @@ import { getResourceModel } from "sap/fe/core/helpers/ResourceModelHelper";
22
22
  import * as StableIdHelper from "sap/fe/core/helpers/StableIdHelper";
23
23
  import CoreLibrary from "sap/fe/core/library";
24
24
  import type { TitleInformation } from "sap/fe/core/rootView/RootViewBaseController";
25
+ import type { TelemetryVariantEvent } from "sap/fe/core/services/TelemetryServiceFactory";
25
26
  import type Breadcrumbs from "sap/fe/macros/Breadcrumbs";
26
27
  import type ChartType from "sap/fe/macros/Chart";
27
28
  import type FilterBarAPI from "sap/fe/macros/FilterBar";
28
29
  import type MacroAPI from "sap/fe/macros/MacroAPI";
29
30
  import type MessageButton from "sap/fe/macros/MessageButton";
30
31
  import type TableAPI from "sap/fe/macros/Table";
32
+ import VariantManagementBB from "sap/fe/macros/VariantManagement";
31
33
  import type ChartDelegate from "sap/fe/macros/chart/ChartDelegate";
32
34
  import ChartUtils from "sap/fe/macros/chart/ChartUtils";
33
35
  import type ContentSwitcher from "sap/fe/macros/contentSwitcher/ContentSwitcher";
@@ -65,7 +67,7 @@ import IntentBasedNavigationOverride from "./overrides/IntentBasedNavigation";
65
67
  import MessageHandlerOverride from "./overrides/MessageHandler";
66
68
  import ShareOverrides from "./overrides/Share";
67
69
  import ViewStateOverrides from "./overrides/ViewState";
68
-
70
+ const { VariantType } = VariantManagementBB;
69
71
  const TemplateContentView = CoreLibrary.TemplateContentView,
70
72
  InitialLoadMode = CoreLibrary.InitialLoadMode;
71
73
 
@@ -925,11 +927,15 @@ class ListReportController extends PageController {
925
927
  }
926
928
  }, 0);
927
929
  },
928
- onVariantSaved(this: ListReportController): void {
930
+ onVariantSaved(this: ListReportController, event: UI5Event<Record<string, unknown>>): void {
929
931
  //TODO: Should remove this setTimeOut once Variant Management provides an api to fetch the current variant key on save!!!
930
932
  setTimeout(() => {
931
933
  this.getExtensionAPI().updateAppState();
932
934
  }, 1000);
935
+ this.trackVariantSavedTelemetry(event);
936
+ },
937
+ onVariantManaged(this: ListReportController, event: UI5Event<Record<string, unknown>>): void {
938
+ this.trackVariantManagedTelemetry(event);
933
939
  },
934
940
  onSearch(this: ListReportController): void {
935
941
  const oFilterBar = this._getFilterBarControl() as FilterBar; // onsearch is called only if the filterbar exists
@@ -1116,6 +1122,72 @@ class ListReportController extends PageController {
1116
1122
  this.setShowFooter(event.getParameter("visible"));
1117
1123
  }
1118
1124
  }
1125
+
1126
+ /**
1127
+ * Tracks telemetry when a new variant is saved.
1128
+ * @param event The save event.
1129
+ */
1130
+ private async trackVariantSavedTelemetry(event: UI5Event<Record<string, unknown>>): Promise<void> {
1131
+ if (event.getParameter("overwrite")) {
1132
+ return;
1133
+ }
1134
+ if (!(await this.getAppComponent()?.getTelemetryService()?.isEnabled())) {
1135
+ return;
1136
+ }
1137
+ const vmMode = this.getView().getViewData().variantManagement;
1138
+ if (vmMode === "Page") {
1139
+ const variantManagement = this.getView().byId("fe::PageVariantManagement") as VariantManagement | undefined;
1140
+ if (variantManagement) {
1141
+ this.fireTelemetry(variantManagement.getVariants().length, VariantType.PAGE);
1142
+ }
1143
+ } else {
1144
+ const source = event.getSource();
1145
+ const filterBarVM = this._getFilterBarVariantControl();
1146
+ if (source === filterBarVM) {
1147
+ this.fireTelemetry(filterBarVM?.getVariants().length ?? 0, VariantType.FILTER);
1148
+ } else if (source.isA("sap.fe.macros.Table")) {
1149
+ const tableAPI = source as unknown as TableAPI;
1150
+ this.fireTelemetry(tableAPI?.getContent?.()?.getVariant?.()?.getVariants?.()?.length ?? 0, VariantType.TABLE);
1151
+ }
1152
+ }
1153
+ }
1154
+
1155
+ /**
1156
+ * Tracks telemetry when variants are managed (e.g. deleted).
1157
+ * @param event The manage event.
1158
+ */
1159
+ private async trackVariantManagedTelemetry(event: UI5Event<Record<string, unknown>>): Promise<void> {
1160
+ const deletedCount: number = ((event.getParameter("deleted") as string[] | undefined) ?? []).length;
1161
+ // The manage dialog can be closed without deleting any variants (e.g. rename or reorder only)
1162
+ if (deletedCount === 0) {
1163
+ return;
1164
+ }
1165
+ if (!(await this.getAppComponent()?.getTelemetryService()?.isEnabled())) {
1166
+ return;
1167
+ }
1168
+ const vmMode = this.getView().getViewData().variantManagement;
1169
+ if (vmMode === "Page") {
1170
+ this.fireTelemetry(deletedCount, VariantType.PAGE);
1171
+ } else {
1172
+ const source = event.getSource();
1173
+ const filterBarVM = this._getFilterBarVariantControl();
1174
+ if (source === filterBarVM) {
1175
+ this.fireTelemetry(deletedCount, VariantType.FILTER);
1176
+ } else if (source.isA("sap.fe.macros.Table")) {
1177
+ this.fireTelemetry(deletedCount, VariantType.TABLE);
1178
+ }
1179
+ }
1180
+ }
1181
+
1182
+ /**
1183
+ * Stores a FE.Variant telemetry event.
1184
+ * @param countVariants Number of variants affected by the action.
1185
+ * @param variantType The variant type discriminator.
1186
+ */
1187
+ private fireTelemetry(countVariants: number, variantType: TelemetryVariantEvent["parameters"]["variantType"]): void {
1188
+ const telemetryEvent: TelemetryVariantEvent = { type: "FE.Variant", parameters: { countVariants, variantType } };
1189
+ this.getAppComponent()?.getTelemetryService()?.storeAction(telemetryEvent);
1190
+ }
1119
1191
  }
1120
1192
 
1121
1193
  export default ListReportController;
@@ -5,7 +5,7 @@
5
5
  "type": "component",
6
6
  "i18n": "../messagebundle.properties",
7
7
  "applicationVersion": {
8
- "version": "1.149.0"
8
+ "version": "1.150.0"
9
9
  },
10
10
  "title": "List Report",
11
11
  "tags": {
@@ -20,6 +20,7 @@
20
20
  busy="{ui>/busy}"
21
21
  variantSelected=".handlers.onVariantSelected"
22
22
  variantSaved=".handlers.onVariantSaved"
23
+ variantManaged=".handlers.onVariantManaged"
23
24
  isAlp="{converterContext>hasMultiVisualizations}"
24
25
  segmentedButtonPress="{= ${converterContext>hasMultiVisualizations} ? '.handlers.onSegmentedButtonPressed' : undefined }"
25
26
  displaySegmentedButton="{converterContext>hasMultiVisualizations}"
@@ -18,6 +18,7 @@
18
18
  showSetAsDefault="true"
19
19
  select=".handlers.onVariantSelected"
20
20
  save=".handlers.onVariantSaved"
21
+ manage=".handlers.onVariantManaged"
21
22
  headerLevel="H2"
22
23
  displayTextForExecuteOnSelectionForStandardVariant="{= ${viewData>/initialLoad} === 'Auto' ? ${sap.fe.i18n>T_LR_VARIANT_APPLY_AUTOMATICALLY_WHEN_FILTER_SET} : undefined }"
23
24
  executeOnSelectionForStandardDefault="{= ${viewData>/initialLoad} === 'Enabled' || ${viewData>/initialLoad} === 'Auto'}"
@@ -52,8 +52,10 @@
52
52
  >
53
53
  <uxap:landmarkInfo>
54
54
  <uxap:ObjectPageAccessibleLandmarkInfo
55
- headerRole="{= ${internal>/hasUShell} ? 'None' : 'Banner'}"
56
- headerLabel="{sap.fe.i18n>T_COMMON_OBJECT_PAGE_HEADER}"
55
+ rootRole="{= ${internal>/hasUShell} ? 'Region' : 'Main'}"
56
+ rootLabel="{= OP.getExpressionForTitle(${fullContextPath>@@UI.getDataModelObjectPath}, ${viewData>}, ${headerInfo>@@UI.getConverterContext})}"
57
+ headerRole="Banner"
58
+ headerLabel="{= OP.getExpressionForTitle(${fullContextPath>@@UI.getDataModelObjectPath}, ${viewData>}, ${headerInfo>@@UI.getConverterContext})}"
57
59
  footerLabel="{sap.fe.i18n>T_COMMON_OBJECT_PAGE_FOOTER}"
58
60
  />
59
61
  </uxap:landmarkInfo>