@sapui5/sap.ushell_abap 1.153.0 → 1.154.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 (116) hide show
  1. package/package.json +1 -1
  2. package/src/main/js/sap/ushell_abap/.library +1 -1
  3. package/src/main/js/sap/ushell_abap/adapters/abap/AppStateAdapter.js +1 -1
  4. package/src/main/js/sap/ushell_abap/adapters/abap/ClientSideTargetResolutionAdapter.js +1 -1
  5. package/src/main/js/sap/ushell_abap/adapters/abap/CommonDataModelAdapter.js +1 -1
  6. package/src/main/js/sap/ushell_abap/adapters/abap/ConfigurationDefaultsAdapter.js +1 -1
  7. package/src/main/js/sap/ushell_abap/adapters/abap/ContainerAdapter.js +1 -1
  8. package/src/main/js/sap/ushell_abap/adapters/abap/FlpLaunchPageAdapter.js +53 -4
  9. package/src/main/js/sap/ushell_abap/adapters/abap/LaunchPageAdapter.js +1 -1
  10. package/src/main/js/sap/ushell_abap/adapters/abap/NavTargetResolutionAdapter.js +1 -1
  11. package/src/main/js/sap/ushell_abap/adapters/abap/NavTargetResolutionInternalAdapter.js +1 -1
  12. package/src/main/js/sap/ushell_abap/adapters/abap/PageBuildingAdapter.js +1 -1
  13. package/src/main/js/sap/ushell_abap/adapters/abap/PagePersistenceAdapter.js +5 -5
  14. package/src/main/js/sap/ushell_abap/adapters/abap/PersonalizationAdapter.js +1 -1
  15. package/src/main/js/sap/ushell_abap/adapters/abap/PersonalizationV2Adapter.js +1 -1
  16. package/src/main/js/sap/ushell_abap/adapters/abap/SearchAdapter.js +1 -1
  17. package/src/main/js/sap/ushell_abap/adapters/abap/SupportTicketAdapter.js +1 -1
  18. package/src/main/js/sap/ushell_abap/adapters/abap/Ui5ComponentLoaderAdapter.js +1 -1
  19. package/src/main/js/sap/ushell_abap/adapters/abap/VisualizationInstantiationAdapter.js +76 -0
  20. package/src/main/js/sap/ushell_abap/adapters/hana/ContainerAdapter.js +1 -1
  21. package/src/main/js/sap/ushell_abap/adapters/local/ClientSideTargetResolutionAdapter.js +123 -0
  22. package/src/main/js/sap/ushell_abap/adapters/local/FlpLaunchPageAdapter.js +115 -0
  23. package/src/main/js/sap/ushell_abap/adapters/local/MenuAdapter.js +92 -0
  24. package/src/main/js/sap/ushell_abap/adapters/local/PageBuildingAdapter.js +242 -0
  25. package/src/main/js/sap/ushell_abap/adapters/local/PagePersistenceAdapter.js +308 -0
  26. package/src/main/js/sap/ushell_abap/api/S4MyHome.js +58 -0
  27. package/src/main/js/sap/ushell_abap/bootstrap/DirectAppStart.js +25 -13
  28. package/src/main/js/sap/ushell_abap/bootstrap/PlatformConfig.js +5 -5
  29. package/src/main/js/sap/ushell_abap/bootstrap/abapConstants.js +11 -0
  30. package/src/main/js/sap/ushell_abap/components/SideNavigation/modules/Favorites.js +549 -0
  31. package/src/main/js/sap/ushell_abap/components/SideNavigation/modules/GenericNavigationListProvider.js +241 -0
  32. package/src/main/js/sap/ushell_abap/components/cards/Card.controller.js +117 -0
  33. package/src/main/js/sap/ushell_abap/components/cards/Card.view.xml +11 -0
  34. package/src/main/js/sap/ushell_abap/components/cards/Configuration.controller.js +280 -0
  35. package/src/main/js/sap/ushell_abap/components/cards/Configuration.view.xml +27 -0
  36. package/src/main/js/sap/ushell_abap/components/cards/ManifestPropertyHelper.js +298 -0
  37. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/Component.js +6 -6
  38. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/TransactionCode.controller.js +9 -8
  39. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n.properties +10 -10
  40. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_ar.properties +10 -0
  41. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_bg.properties +10 -0
  42. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_ca.properties +10 -0
  43. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_cnr.properties +10 -0
  44. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_cs.properties +10 -0
  45. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_cy.properties +10 -0
  46. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_da.properties +10 -0
  47. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_de.properties +10 -0
  48. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_el.properties +10 -0
  49. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_en.properties +10 -0
  50. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_en_GB.properties +10 -0
  51. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_en_US_sappsd.properties +10 -0
  52. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_en_US_saprigi.properties +10 -0
  53. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_en_US_saptrc.properties +10 -0
  54. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_es.properties +10 -0
  55. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_es_MX.properties +10 -0
  56. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_et.properties +10 -0
  57. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_fi.properties +10 -0
  58. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_fr.properties +10 -0
  59. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_fr_CA.properties +10 -0
  60. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_hi.properties +10 -0
  61. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_hr.properties +10 -0
  62. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_hu.properties +10 -0
  63. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_id.properties +10 -0
  64. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_it.properties +10 -0
  65. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_iw.properties +10 -0
  66. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_ja.properties +10 -0
  67. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_kk.properties +10 -0
  68. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_ko.properties +10 -0
  69. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_lt.properties +10 -0
  70. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_lv.properties +10 -0
  71. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_mk.properties +10 -0
  72. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_ms.properties +10 -0
  73. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_nl.properties +10 -0
  74. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_no.properties +10 -0
  75. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_pl.properties +10 -0
  76. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_pt.properties +10 -0
  77. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_pt_PT.properties +10 -0
  78. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_ro.properties +10 -0
  79. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_ru.properties +10 -0
  80. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_sh.properties +10 -0
  81. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_sk.properties +10 -0
  82. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_sl.properties +10 -0
  83. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_sr.properties +10 -0
  84. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_sv.properties +10 -0
  85. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_th.properties +10 -0
  86. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_tr.properties +10 -0
  87. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_uk.properties +10 -0
  88. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_vi.properties +10 -0
  89. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_zh_CN.properties +10 -0
  90. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_zh_TW.properties +10 -0
  91. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/manifest.json +1 -1
  92. package/src/main/js/sap/ushell_abap/components/tiles/action/ActionTile.controller.js +189 -0
  93. package/src/main/js/sap/ushell_abap/components/tiles/action/ActionTile.view.xml +13 -0
  94. package/src/main/js/sap/ushell_abap/components/tiles/action/Configuration.controller.js +193 -0
  95. package/src/main/js/sap/ushell_abap/components/tiles/action/Configuration.view.xml +333 -0
  96. package/src/main/js/sap/ushell_abap/components/tiles/applauncher/Component.js +41 -0
  97. package/src/main/js/sap/ushell_abap/components/tiles/applauncher/Configuration.controller.js +114 -0
  98. package/src/main/js/sap/ushell_abap/components/tiles/applauncher/Configuration.view.xml +208 -0
  99. package/src/main/js/sap/ushell_abap/components/tiles/applauncher/StaticTile.controller.js +497 -0
  100. package/src/main/js/sap/ushell_abap/components/tiles/applauncher/StaticTile.view.js +61 -0
  101. package/src/main/js/sap/ushell_abap/components/tiles/applauncherdynamic/Component.js +45 -0
  102. package/src/main/js/sap/ushell_abap/components/tiles/applauncherdynamic/Configuration.controller.js +113 -0
  103. package/src/main/js/sap/ushell_abap/components/tiles/applauncherdynamic/Configuration.view.xml +231 -0
  104. package/src/main/js/sap/ushell_abap/components/tiles/applauncherdynamic/DynamicTile.controller.js +729 -0
  105. package/src/main/js/sap/ushell_abap/components/tiles/applauncherdynamic/DynamicTile.view.js +106 -0
  106. package/src/main/js/sap/ushell_abap/library.js +12 -1
  107. package/src/main/js/sap/ushell_abap/messagebundle.properties +5 -3
  108. package/src/main/js/sap/ushell_abap/pbServices/ui2/Chip.js +7 -3
  109. package/src/main/js/sap/ushell_abap/pbServices/ui2/ODataWrapper.js +1 -1
  110. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/configuration.js +6 -2
  111. package/src/main/js/sap/ushell_abap/services/NavigationDataProvider.js +1 -1
  112. package/src/main/js/sap/ushell_abap/ui/VisualizationInstantiation/ChipInstanceWrapper.js +248 -0
  113. package/src/main/js/sap/ushell_abap/ui/VisualizationInstantiation/VizInstanceAbap.js +134 -0
  114. package/src/main/js/sap/ushell_abap/ui/VisualizationInstantiation/VizInstanceAbapLink.js +145 -0
  115. package/src/main/js/sap/ushell_abap/utils/UserPersonalization.js +51 -4
  116. package/ui5.yaml +20 -2
@@ -0,0 +1,92 @@
1
+ // Copyright (c) 2009-2026 SAP SE, All Rights Reserved
2
+
3
+ /**
4
+ * @fileOverview MenuAdapter for the local (abap) platform.
5
+ *
6
+ * Intended for OPA and standalone test scenarios.
7
+ *
8
+ * A thin subclass of the ABAP MenuAdapter that adds the metatag
9
+ * before calling the original adapter
10
+ *
11
+ * @version 1.154.0
12
+ */
13
+ sap.ui.define([
14
+ "sap/base/util/LoaderExtensions",
15
+ "sap/ushell_abap/adapters/abap/MenuAdapter"
16
+ ], (
17
+ LoaderExtensions,
18
+ AbapMenuAdapter
19
+ ) => {
20
+ "use strict";
21
+
22
+ /**
23
+ * Constructs a new local instance of the MenuAdapter for the ABAP platform.
24
+ *
25
+ * @param {object} oSystem The system served by the adapter
26
+ * @param {string} sParameter Parameter string, not in use
27
+ * @param {object} oAdapterConfiguration Adapter configuration.
28
+ *
29
+ * @class
30
+ * @since 1.154.0
31
+ * @private
32
+ */
33
+ function MenuAdapter (oSystem, sParameter, oAdapterConfiguration) {
34
+ const oConfig = oAdapterConfiguration?.config || {};
35
+
36
+ const aData = this._fetchData(oConfig);
37
+ const oMetatag = document.createElement("meta");
38
+ oMetatag.content = JSON.stringify(aData);
39
+ oMetatag.setAttribute("name", "sap.ushell.assignedSpaces");
40
+ document.head.appendChild(oMetatag);
41
+
42
+ AbapMenuAdapter.call(this, oSystem, sParameter, {});
43
+ }
44
+
45
+ MenuAdapter.prototype = Object.create(AbapMenuAdapter.prototype);
46
+ MenuAdapter.prototype.constructor = MenuAdapter;
47
+
48
+ /**
49
+ * Loads spaces and pages from the configured JSON resources and assembles
50
+ * the space list structure expected by the base ABAP MenuAdapter.
51
+ *
52
+ * @param {object} oConfig Adapter config with <code>spacesPath</code> and <code>pagesPath</code>.
53
+ * @returns {object[]} Space entries including embedded page references.
54
+ *
55
+ * @since 1.154.0
56
+ * @private
57
+ */
58
+ MenuAdapter.prototype._fetchData = function (oConfig) {
59
+ const aSpacesData = oConfig.spaces || LoaderExtensions.loadResource(oConfig.spacesPath);
60
+ const aPagesData = oConfig.pages || LoaderExtensions.loadResource(oConfig.pagesPath);
61
+
62
+ return aSpacesData.map((oSpaceData) => {
63
+ return {
64
+ id: oSpaceData.id || "",
65
+ title: oSpaceData.title || "",
66
+ description: oSpaceData.description || "",
67
+ hasWorkarea: oSpaceData.hasWorkarea || false,
68
+ visibility: {
69
+ desktop: true,
70
+ phone: true,
71
+ tablet: true
72
+ },
73
+ pages: oSpaceData.pages.map((oPageReference) => {
74
+ const oPageData = aPagesData.find((oPage) => oPage.id === oPageReference.id);
75
+ return {
76
+ type: oPageData ? "page" : "IBN",
77
+ id: oPageReference.id,
78
+ title: oPageData?.title || "",
79
+ description: oPageData?.description || "",
80
+ visibility: {
81
+ desktop: true,
82
+ phone: true,
83
+ tablet: true
84
+ }
85
+ };
86
+ })
87
+ };
88
+ });
89
+ };
90
+
91
+ return MenuAdapter;
92
+ });
@@ -0,0 +1,242 @@
1
+ // Copyright (c) 2009-2026 SAP SE, All Rights Reserved
2
+
3
+ /**
4
+ * @fileOverview PageBuildingAdapter for the local (abap) platform.
5
+ *
6
+ * Intended for OPA and standalone test scenarios with no backend.
7
+ *
8
+ * @version 1.154.0
9
+ */
10
+ sap.ui.define([
11
+ "sap/base/util/LoaderExtensions",
12
+ "sap/ui/core/util/MockServer",
13
+ "sap/ushell_abap/pbServices/ui2/Factory",
14
+ // Contracts need to be loaded first
15
+ "sap/ushell_abap/pbServices/ui2/contracts/bag",
16
+ "sap/ushell_abap/pbServices/ui2/contracts/configuration",
17
+ "sap/ushell_abap/pbServices/ui2/contracts/configurationUi",
18
+ "sap/ushell_abap/pbServices/ui2/contracts/fullscreen",
19
+ "sap/ushell_abap/pbServices/ui2/contracts/preview",
20
+ "sap/ushell_abap/pbServices/ui2/contracts/visible",
21
+ "sap/ushell_abap/pbServices/ui2/contracts/refresh",
22
+ "sap/ushell_abap/pbServices/ui2/contracts/search",
23
+ "sap/ushell_abap/pbServices/ui2/contracts/url",
24
+ "sap/ushell_abap/pbServices/ui2/contracts/actions",
25
+ "sap/ushell_abap/pbServices/ui2/contracts/types"
26
+ ], (
27
+ LoaderExtensions,
28
+ MockServer,
29
+ Factory
30
+ ) => {
31
+ "use strict";
32
+
33
+ /**
34
+ * Constructs a new local instance of the PageBuildingAdapter for the ABAP platform.
35
+ *
36
+ * @param {object} oSystem The system served by the adapter
37
+ * @param {string} sParameter Parameter string, not in use
38
+ * @param {object} [oAdapterConfiguration] The configuration.
39
+ *
40
+ * @since 1.154.0
41
+ * @private
42
+ */
43
+ function PageBuildingAdapter (oSystem, sParameter, oAdapterConfiguration) {
44
+ // fetch sync to avoid race conditions
45
+ this._aBaseChips = oAdapterConfiguration.config.baseChips || LoaderExtensions.loadResource(oAdapterConfiguration.config.baseChipsPath);
46
+ this._aBaseChips.forEach((oBaseChip) => {
47
+ oBaseChip.chipPathAbsolute = new URL(sap.ui.require.toUrl(oBaseChip.chipPath), document.baseURI).toString();
48
+ });
49
+
50
+ this._aCatalogsData = oAdapterConfiguration.config.catalogs || LoaderExtensions.loadResource(oAdapterConfiguration.config.catalogsPath);
51
+ // patch service url to absolute
52
+ this._aCatalogsData.forEach((oCatalog) => {
53
+ oCatalog.chips.forEach((oChip) => {
54
+ const oTileConfiguration = oChip.configuration?.tileConfiguration;
55
+ if (oTileConfiguration?.service_url) {
56
+ const aUrlParts = oTileConfiguration.service_url.split("?"); // query might contain non parsable UserDefault references
57
+ const sAbsoluteUrl = new URL(sap.ui.require.toUrl(aUrlParts[0]), document.baseURI).toString();
58
+ const sQuery = aUrlParts[1] ? `?${aUrlParts[1]}` : "";
59
+ oTileConfiguration.service_url = `${sAbsoluteUrl}${sQuery}`;
60
+ }
61
+ });
62
+ });
63
+
64
+ const oServer = new MockServer({
65
+ rootUri: "/local/PageBuilding"
66
+ });
67
+ MockServer.config({
68
+ autoRespond: true,
69
+ autoRespondAfter: 0
70
+ });
71
+
72
+ oServer.setRequests([
73
+ ...this._getBaseChipRequests(),
74
+ ...this._getAllCatalogsRequests()
75
+ ]);
76
+ oServer.start();
77
+
78
+ this._oFactory = Factory.createFactory(
79
+ "/local/PageBuilding",
80
+ undefined,
81
+ "PERS",
82
+ undefined
83
+ );
84
+ }
85
+
86
+ /**
87
+ * Returns the UI2 page building factory.
88
+ *
89
+ * @returns {sap.ushell_abap.pbServices.ui2.Factory} The page building factory.
90
+ *
91
+ * @since 1.154.0
92
+ * @private
93
+ */
94
+ PageBuildingAdapter.prototype.getFactory = function () {
95
+ return this._oFactory;
96
+ };
97
+
98
+ /**
99
+ * Builds MockServer request handlers that serve individual chip descriptors
100
+ * from the in-memory base chip data.
101
+ *
102
+ * @returns {object[]} MockServer request configuration objects for base chip GET requests.
103
+ *
104
+ * @since 1.154.0
105
+ * @private
106
+ */
107
+ PageBuildingAdapter.prototype._getBaseChipRequests = function () {
108
+ return this._aBaseChips.map((oBaseChip) => {
109
+ return {
110
+ method: "GET",
111
+ path: new RegExp(`/Chips\\('${encodeURIComponent(`X-SAP-UI2-CHIP:${oBaseChip.id}`)}'\\).*`),
112
+ response: (oXhr) => {
113
+ oXhr.respondJSON(200, {} /* Headers */, {
114
+ d: {
115
+ id: `X-SAP-UI2-CHIP:${oBaseChip.id}`,
116
+ title: "",
117
+ description: "",
118
+ configuration: "",
119
+ url: oBaseChip.chipPathAbsolute,
120
+ baseChipId: `X-SAP-UI2-CHIP:${oBaseChip.id}`,
121
+ catalogId: "/UI2/CATALOG_ALL",
122
+ catalogPageChipInstanceId: "",
123
+ referenceChipId: "",
124
+ isReadOnly: "",
125
+ Catalog: {},
126
+ ReferenceChip: {},
127
+ ChipBags: {
128
+ results: []
129
+ },
130
+ CatalogPageChipInstance: {}
131
+ }
132
+ });
133
+ }
134
+ };
135
+ });
136
+ };
137
+
138
+ /**
139
+ * Builds a MockServer request handler that serves the <code>allCatalogs</code> OData response
140
+ * from the in-memory catalog data.
141
+ *
142
+ * @returns {object[]} MockServer request configuration object for the allCatalogs endpoint.
143
+ *
144
+ * @since 1.154.0
145
+ * @private
146
+ */
147
+ PageBuildingAdapter.prototype._getAllCatalogsRequests = function () {
148
+ return [{
149
+ method: "GET",
150
+ path: new RegExp("/Pages\\('.*'\\)/allCatalogs.*"),
151
+ response: (oXhr) => {
152
+ oXhr.respondJSON(200, {} /* Headers */, {
153
+ d: {
154
+ results: this._aCatalogsData.map((oCatalog) => {
155
+ return {
156
+ __metadata: {},
157
+ id: `X-SAP-UI2-CATALOGPAGE:${oCatalog.id}`,
158
+ type: "CATALOG_PAGE",
159
+ domainId: oCatalog.id,
160
+ remoteType: "",
161
+ title: oCatalog.title,
162
+ systemAlias: "",
163
+ remoteId: "",
164
+ isReadOnly: "",
165
+ originalLanguage: "en",
166
+ scope: "CUSTOMIZING",
167
+ baseUrl: "",
168
+ chipCount: oCatalog.chips.length.toString().padStart(4, "0"),
169
+ outdated: "",
170
+ CatalogPage: {},
171
+ Chips: {
172
+ results: oCatalog.chips.map((oCatalogTile) => {
173
+ const oBaseChip = this._aBaseChips.find((oBaseChip) => oBaseChip.id === oCatalogTile.baseChipId);
174
+ if (!oBaseChip) {
175
+ throw new Error(`Missing Base Chip 'X-SAP-UI2-CHIP:${oCatalogTile.baseChipId}'`);
176
+ }
177
+
178
+ return {
179
+ __metadata: {},
180
+ id: `X-SAP-UI2-PAGE:X-SAP-UI2-CATALOGPAGE:${oCatalog.id}:${oCatalogTile.id}`,
181
+ catalogId: `X-SAP-UI2-CATALOGPAGE:${oCatalog.id}`,
182
+ catalogPageChipInstanceId: oCatalogTile.id,
183
+ baseChipId: `X-SAP-UI2-CHIP:${oCatalogTile.baseChipId}`,
184
+ url: oBaseChip.chipPathAbsolute,
185
+ referenceChipId: "",
186
+ isReadOnly: "",
187
+ title: "<non translatable title>",
188
+ description: "",
189
+ Catalog: {},
190
+ ReferenceChip: {},
191
+ configuration: JSON.stringify(Object.keys(oCatalogTile.configuration).reduce((oConfiguration, sConfigurationKey) => {
192
+ oConfiguration[sConfigurationKey] = JSON.stringify(oCatalogTile.configuration[sConfigurationKey]);
193
+ return oConfiguration;
194
+ }, {})),
195
+ ChipBags: {
196
+ results: Object.keys(oCatalogTile.bags).map((sBagId) => {
197
+ const oBag = oCatalogTile.bags[sBagId];
198
+ return {
199
+ __metadata: {},
200
+ chipId: `X-SAP-UI2-PAGE:X-SAP-UI2-CATALOGPAGE:${oCatalog.id}:${oCatalogTile.id}`,
201
+ id: sBagId,
202
+ ChipProperties: {
203
+ results: [
204
+ ...Object.keys(oBag.texts || {}).map((sBagTextKey) => {
205
+ return {
206
+ __metadata: {},
207
+ chipId: `X-SAP-UI2-PAGE:X-SAP-UI2-CATALOGPAGE:${oCatalog.id}:${oCatalogTile.id}`,
208
+ bagId: sBagId,
209
+ name: sBagTextKey,
210
+ value: oBag.texts[sBagTextKey],
211
+ translatable: "X"
212
+ };
213
+ }),
214
+ ...Object.keys(oBag.properties || {}).map((sBagPropertyKey) => {
215
+ return {
216
+ __metadata: {},
217
+ chipId: `X-SAP-UI2-PAGE:X-SAP-UI2-CATALOGPAGE:${oCatalog.id}:${oCatalogTile.id}`,
218
+ bagId: sBagId,
219
+ name: sBagPropertyKey,
220
+ value: oBag.properties[sBagPropertyKey],
221
+ translatable: ""
222
+ };
223
+ })
224
+ ]
225
+ }
226
+ };
227
+ })
228
+ },
229
+ CatalogPageChipInstance: {}
230
+ };
231
+ })
232
+ }
233
+ };
234
+ })
235
+ }
236
+ });
237
+ }
238
+ }];
239
+ };
240
+
241
+ return PageBuildingAdapter;
242
+ });
@@ -0,0 +1,308 @@
1
+ // Copyright (c) 2009-2026 SAP SE, All Rights Reserved
2
+
3
+ /**
4
+ * @fileOverview PagePersistenceAdapter for the local (abap) platform.
5
+ *
6
+ * Intended for OPA and standalone test scenarios with no backend.
7
+ *
8
+ * A thin subclass of the ABAP PagePersistenceAdapter that overwrites the fetch from the backend.
9
+ *
10
+ * @version 1.154.0
11
+ */
12
+ sap.ui.define([
13
+ "sap/base/util/LoaderExtensions",
14
+ "sap/ushell/library",
15
+ "sap/ushell_abap/adapters/abap/PagePersistenceAdapter"
16
+ ], (
17
+ LoaderExtensions,
18
+ ushellLibrary,
19
+ AbapPagePersistenceAdapter
20
+ ) => {
21
+ "use strict";
22
+
23
+ // shortcut for sap.ushell.DisplayFormat
24
+ const DisplayFormat = ushellLibrary.DisplayFormat;
25
+
26
+ /**
27
+ * Constructs a new local instance of the PagePersistenceAdapter for the ABAP platform.
28
+ *
29
+ * @param {object} oSystem The system information. This is not used in a local environment.
30
+ * @param {string} sParameter The Adapter parameter.
31
+ * @param {object} oAdapterConfiguration The Adapter configuration.
32
+ *
33
+ * @since 1.154.0
34
+ * @class
35
+ * @private
36
+ */
37
+ function PagePersistenceAdapter (oSystem, sParameter, oAdapterConfiguration) {
38
+ AbapPagePersistenceAdapter.call(this, oSystem, sParameter, {});
39
+
40
+ this._bEnableValidationErrors = !oAdapterConfiguration.config.ignoreValidationErrors;
41
+ this._pData = this._fetchData(oAdapterConfiguration.config);
42
+ }
43
+
44
+ PagePersistenceAdapter.prototype = Object.create(AbapPagePersistenceAdapter.prototype);
45
+ PagePersistenceAdapter.prototype.constructor = PagePersistenceAdapter;
46
+
47
+ /**
48
+ * Loads pages, catalogs, and base chip data from the configured JSON resources
49
+ * and transforms them into the OData-shaped structure the base adapter expects.
50
+ *
51
+ * @param {object} oConfig Adapter config with <code>pagesPath</code>, <code>catalogsPath</code>, and <code>baseChipsPath</code>.
52
+ * @returns {Promise<Object<string, object>>} Page data keyed by page ID.
53
+ *
54
+ * @since 1.154.0
55
+ * @private
56
+ */
57
+ PagePersistenceAdapter.prototype._fetchData = async function (oConfig) {
58
+ const [
59
+ aPagesData,
60
+ aCatalogsData,
61
+ aBaseChipData
62
+ ]
63
+ = await Promise.all([
64
+ oConfig.pages || LoaderExtensions.loadResource(oConfig.pagesPath, { async: true }),
65
+ oConfig.catalogs || LoaderExtensions.loadResource(oConfig.catalogsPath, { async: true }),
66
+ Promise.resolve(oConfig.baseChips || LoaderExtensions.loadResource(oConfig.baseChipsPath, { async: true })).then((aBaseChipData) => {
67
+ return Promise.all(aBaseChipData.map(async (oBaseChip) => {
68
+ const oXml = await LoaderExtensions.loadResource(oBaseChip.chipPath, { async: true });
69
+
70
+ const sDefaultType = oXml.querySelector("chip contracts consume[id=types] parameter[name=defaultType]")?.textContent;
71
+ const sSupportedTypes = oXml.querySelector("chip contracts consume[id=types] parameter[name=supportedTypes]")?.textContent;
72
+ const sCol = oXml.querySelector("chip contracts consume[id=configuration] parameter[name=col]")?.textContent;
73
+
74
+ return {
75
+ ...oBaseChip,
76
+ defaultType: this._mapDisplayFormat(sDefaultType, sCol),
77
+ supportedTypes: sSupportedTypes.split(",").map((sType) => {
78
+ return this._mapDisplayFormat(sType, sCol);
79
+ })
80
+ };
81
+ }));
82
+ })
83
+ ]);
84
+
85
+ // patch service url to absolute
86
+ aCatalogsData.forEach((oCatalog) => {
87
+ oCatalog.chips.forEach((oChip) => {
88
+ const oTileConfiguration = oChip.configuration?.tileConfiguration;
89
+ if (oTileConfiguration?.service_url) {
90
+ const aUrlParts = oTileConfiguration.service_url.split("?"); // query might contain non parsable UserDefault references
91
+ const sAbsoluteUrl = new URL(sap.ui.require.toUrl(aUrlParts[0]), document.baseURI).toString();
92
+ const sQuery = aUrlParts[1] ? `?${aUrlParts[1]}` : "";
93
+ oTileConfiguration.service_url = `${sAbsoluteUrl}${sQuery}`;
94
+ }
95
+ });
96
+ });
97
+
98
+ return aPagesData.reduce((oPages, oPageToAdd) => {
99
+ if (this._bEnableValidationErrors && oPages[oPageToAdd.id]) {
100
+ throw new Error(`Conflicting page ids '${oPageToAdd.id}'`);
101
+ }
102
+
103
+ const aUsedCatalogTileIds = new Set();
104
+ const aUsedBaseChipIds = new Set();
105
+
106
+ oPages[oPageToAdd.id] = {
107
+ __metadata: {},
108
+ id: oPageToAdd.id,
109
+ title: oPageToAdd.title,
110
+ description: oPageToAdd.description,
111
+ sections: {
112
+ results: oPageToAdd.sections.map((oSection, iSectionIndex) => {
113
+ return {
114
+ __metadata: {},
115
+ id: oSection.id || `${oPageToAdd.id}-section_${iSectionIndex}`, // stable id for personalization
116
+ title: oSection.title,
117
+ sectionIndex: iSectionIndex + 1,
118
+ viz: {
119
+ results: oSection.viz.map((oVizRef, iVizRefIndex) => {
120
+ aUsedCatalogTileIds.add(oVizRef.catalogTileId);
121
+
122
+ return {
123
+ __metadata: {},
124
+ id: oVizRef.id || `${oPageToAdd.id}-section_${iSectionIndex}-viz_${iVizRefIndex}`, // stable id for personalization
125
+ catalogTileId: `X-SAP-UI2-PAGE:X-SAP-UI2-CATALOGPAGE:${oVizRef.catalogTileId}`,
126
+ catalogTileIdStable: `X-SAP-UI2-PAGE:X-SAP-UI2-CATALOGPAGE:${oVizRef.catalogTileId}`,
127
+ targetMappingId: "",
128
+ targetMappingIdStable: "",
129
+ displayFormatHint: oVizRef.displayFormatHint,
130
+ itemIndex: iVizRefIndex + 1,
131
+ vizReference: {}
132
+ };
133
+ })
134
+ }
135
+ };
136
+ })
137
+ },
138
+ vizReferences: { // actually means visualizations/ catalogTiles
139
+ results: Array.from(aUsedCatalogTileIds).map((sCatalogTileId) => {
140
+ const [sCatalogId, sChipId] = sCatalogTileId.split(":");
141
+ const oCatalogTile = aCatalogsData.find((oCatalog) => oCatalog.id === sCatalogId)?.chips.find((oChip) => oChip.id === sChipId);
142
+
143
+ if (!oCatalogTile) {
144
+ if (this._bEnableValidationErrors) {
145
+ throw new Error(`Missing Catalog Tile 'X-SAP-UI2-PAGE:X-SAP-UI2-CATALOGPAGE:${sCatalogTileId}'`);
146
+ }
147
+ return;
148
+ }
149
+
150
+ aUsedBaseChipIds.add(oCatalogTile.baseChipId);
151
+
152
+ return {
153
+ __metadata: {},
154
+ id: `X-SAP-UI2-PAGE:X-SAP-UI2-CATALOGPAGE:${sCatalogTileId}`,
155
+ catalogDisplayId: `X-SAP-UI2-CATALOGPAGE:${sCatalogId}`,
156
+ catalogTileId: `X-SAP-UI2-PAGE:X-SAP-UI2-CATALOGPAGE:${sCatalogTileId}`,
157
+ catalogTileIdStable: `X-SAP-UI2-PAGE:X-SAP-UI2-CATALOGPAGE:${sCatalogTileId}`,
158
+ targetMappingId: "",
159
+ targetMappingIdStable: "",
160
+ title: oCatalogTile.bags?.tileProperties?.texts?.display_title_text,
161
+ subTitle: oCatalogTile.bags?.tileProperties?.texts?.display_subtitle_text,
162
+ iconUrl: oCatalogTile.configuration?.tileConfiguration?.display_icon_url,
163
+ semanticObject: "",
164
+ semanticAction: "",
165
+ deviceDesktop: true,
166
+ deviceTablet: true,
167
+ devicePhone: true,
168
+ tileType: `X-SAP-UI2-CHIP:${oCatalogTile.baseChipId}`,
169
+ fromPersonalization: false,
170
+ parameters: "",
171
+ configuration: JSON.stringify(Object.keys(oCatalogTile.configuration || {}).reduce((oConfiguration, sConfigurationKey) => {
172
+ oConfiguration[sConfigurationKey] = JSON.stringify(oCatalogTile.configuration[sConfigurationKey]);
173
+ return oConfiguration;
174
+ }, {})),
175
+ chipBags: {
176
+ results: Object.keys(oCatalogTile.bags || {}).map((sBagId) => {
177
+ const oBag = oCatalogTile.bags[sBagId];
178
+ return {
179
+ __metadata: {},
180
+ id: sBagId,
181
+ properties: {
182
+ results: [
183
+ ...Object.keys(oBag.texts || {}).map((sBagTextKey) => {
184
+ return {
185
+ __metadata: {},
186
+ id: sBagTextKey,
187
+ value: oBag.texts[sBagTextKey],
188
+ translatable: true
189
+ };
190
+ }),
191
+ ...Object.keys(oBag.properties || {}).map((sBagPropertyKey) => {
192
+ return {
193
+ __metadata: {},
194
+ id: sBagPropertyKey,
195
+ value: oBag.properties[sBagPropertyKey],
196
+ translatable: false
197
+ };
198
+ })
199
+ ]
200
+ }
201
+ };
202
+ })
203
+ }
204
+ };
205
+ }).filter((oVizReference) => !!oVizReference)
206
+ },
207
+ tileTypes: {
208
+ results: Array.from(aUsedBaseChipIds).map((sBaseChipId) => {
209
+ const oBaseChip = aBaseChipData.find((oChip) => oChip.id === sBaseChipId);
210
+ if (!oBaseChip) {
211
+ if (this._bEnableValidationErrors) {
212
+ throw new Error(`Missing Base Chip 'X-SAP-UI2-CHIP:${sBaseChipId}'`);
213
+ }
214
+ return;
215
+ }
216
+
217
+ return {
218
+ __metadata: {},
219
+ id: `X-SAP-UI2-CHIP:${sBaseChipId}`,
220
+ url: "",
221
+ vizOptions: {
222
+ __metadata: {},
223
+ id: `X-SAP-UI2-CHIP:${sBaseChipId}`,
224
+ displayFormats: {
225
+ __metadata: {},
226
+ preferred: oBaseChip.defaultType,
227
+ id: `X-SAP-UI2-CHIP:${sBaseChipId}`,
228
+ supported: {
229
+ results: oBaseChip.supportedTypes.map((sType) => {
230
+ return {
231
+ __metadata: {},
232
+ id: sType
233
+ };
234
+ })
235
+ }
236
+ }
237
+ }
238
+ };
239
+ }).filter((oTileType) => !!oTileType)
240
+ }
241
+ };
242
+
243
+ return oPages;
244
+ }, {});
245
+ };
246
+
247
+ /**
248
+ * Maps a chip-XML type string to the corresponding {@link sap.ushell.DisplayFormat} enum value,
249
+ * taking the column count into account.
250
+ *
251
+ * @param {string} sType Tile type from the chip XML (e.g. <code>"tile"</code>, <code>"link"</code>).
252
+ * @param {string} sCol Column count from the chip XML (<code>"1"</code> or <code>"2"</code>).
253
+ * @returns {sap.ushell.DisplayFormat} The mapped display format.
254
+ *
255
+ * @since 1.154.0
256
+ * @private
257
+ */
258
+ PagePersistenceAdapter.prototype._mapDisplayFormat = function (sType, sCol) {
259
+ const oDisplayFormatMap = {
260
+ tile: DisplayFormat.Standard,
261
+ link: DisplayFormat.Compact,
262
+ flat: DisplayFormat.Flat,
263
+ flatwide: DisplayFormat.FlatWide,
264
+ tilewide: DisplayFormat.StandardWide
265
+ };
266
+
267
+ let sDisplayFormat = oDisplayFormatMap[sType.toLowerCase()];
268
+
269
+ if (sCol === "2" && sDisplayFormat === DisplayFormat.Standard) {
270
+ sDisplayFormat = DisplayFormat.StandardWide;
271
+ }
272
+
273
+ return sDisplayFormat;
274
+ };
275
+
276
+ /**
277
+ * Returns the OData-shaped page object for the given page ID.
278
+ *
279
+ * @param {string} sPageId The page ID to retrieve.
280
+ * @returns {Promise<object>} The page data object.
281
+ *
282
+ * @since 1.154.0
283
+ * @private
284
+ */
285
+ PagePersistenceAdapter.prototype.readPage = async function (sPageId) {
286
+ const oData = await this._pData;
287
+ return oData[sPageId];
288
+ };
289
+
290
+ /**
291
+ * Returns OData-shaped page objects for the given page IDs.
292
+ *
293
+ * @param {string[]} aPageIds The page IDs to retrieve.
294
+ * @returns {Promise<{results: object[]}>} Object with a results array of page data objects.
295
+ *
296
+ * @since 1.154.0
297
+ * @private
298
+ */
299
+ PagePersistenceAdapter.prototype.readPages = async function (aPageIds) {
300
+ return {
301
+ results: await Promise.all(aPageIds.map(async (sPageId) => {
302
+ return this.readPage(sPageId);
303
+ }))
304
+ };
305
+ };
306
+
307
+ return PagePersistenceAdapter;
308
+ });