@sapui5/sap.ushell_abap 1.152.1 → 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 (121) 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 +53 -63
  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 +62 -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 +8 -8
  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/UserInfoAdapter.js +11 -11
  20. package/src/main/js/sap/ushell_abap/adapters/abap/VisualizationInstantiationAdapter.js +76 -0
  21. package/src/main/js/sap/ushell_abap/adapters/hana/ContainerAdapter.js +1 -1
  22. package/src/main/js/sap/ushell_abap/adapters/local/ClientSideTargetResolutionAdapter.js +123 -0
  23. package/src/main/js/sap/ushell_abap/adapters/local/FlpLaunchPageAdapter.js +115 -0
  24. package/src/main/js/sap/ushell_abap/adapters/local/MenuAdapter.js +92 -0
  25. package/src/main/js/sap/ushell_abap/adapters/local/PageBuildingAdapter.js +242 -0
  26. package/src/main/js/sap/ushell_abap/adapters/local/PagePersistenceAdapter.js +308 -0
  27. package/src/main/js/sap/ushell_abap/api/S4MyHome.js +58 -0
  28. package/src/main/js/sap/ushell_abap/bootstrap/DirectAppStart.js +28 -15
  29. package/src/main/js/sap/ushell_abap/bootstrap/LoadLaunchpad/CreateRenderer.js +4 -2
  30. package/src/main/js/sap/ushell_abap/bootstrap/LoadLaunchpad/RequestPages.js +2 -6
  31. package/src/main/js/sap/ushell_abap/bootstrap/PlatformConfig.js +5 -5
  32. package/src/main/js/sap/ushell_abap/bootstrap/XhrLogonEventHandler.js +6 -7
  33. package/src/main/js/sap/ushell_abap/bootstrap/abapConstants.js +30 -0
  34. package/src/main/js/sap/ushell_abap/components/SideNavigation/modules/Favorites.js +549 -0
  35. package/src/main/js/sap/ushell_abap/components/SideNavigation/modules/GenericNavigationListProvider.js +241 -0
  36. package/src/main/js/sap/ushell_abap/components/cards/Card.controller.js +117 -0
  37. package/src/main/js/sap/ushell_abap/components/cards/Card.view.xml +11 -0
  38. package/src/main/js/sap/ushell_abap/components/cards/Configuration.controller.js +280 -0
  39. package/src/main/js/sap/ushell_abap/components/cards/Configuration.view.xml +27 -0
  40. package/src/main/js/sap/ushell_abap/components/cards/ManifestPropertyHelper.js +298 -0
  41. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/Component.js +90 -0
  42. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/TransactionCode.controller.js +110 -0
  43. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/TransactionCode.view.xml +16 -0
  44. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n.properties +17 -0
  45. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_ar.properties +10 -0
  46. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_bg.properties +10 -0
  47. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_ca.properties +10 -0
  48. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_cnr.properties +10 -0
  49. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_cs.properties +10 -0
  50. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_cy.properties +10 -0
  51. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_da.properties +10 -0
  52. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_de.properties +10 -0
  53. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_el.properties +10 -0
  54. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_en.properties +10 -0
  55. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_en_GB.properties +10 -0
  56. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_en_US_sappsd.properties +10 -0
  57. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_en_US_saprigi.properties +10 -0
  58. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_en_US_saptrc.properties +10 -0
  59. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_es.properties +10 -0
  60. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_es_MX.properties +10 -0
  61. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_et.properties +10 -0
  62. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_fi.properties +10 -0
  63. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_fr.properties +10 -0
  64. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_fr_CA.properties +10 -0
  65. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_hi.properties +10 -0
  66. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_hr.properties +10 -0
  67. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_hu.properties +10 -0
  68. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_id.properties +10 -0
  69. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_it.properties +10 -0
  70. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_iw.properties +10 -0
  71. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_ja.properties +10 -0
  72. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_kk.properties +10 -0
  73. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_ko.properties +10 -0
  74. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_lt.properties +10 -0
  75. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_lv.properties +10 -0
  76. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_mk.properties +10 -0
  77. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_ms.properties +10 -0
  78. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_nl.properties +10 -0
  79. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_no.properties +10 -0
  80. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_pl.properties +10 -0
  81. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_pt.properties +10 -0
  82. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_pt_PT.properties +10 -0
  83. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_ro.properties +10 -0
  84. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_ru.properties +10 -0
  85. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_sh.properties +10 -0
  86. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_sk.properties +10 -0
  87. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_sl.properties +10 -0
  88. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_sr.properties +10 -0
  89. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_sv.properties +10 -0
  90. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_th.properties +10 -0
  91. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_tr.properties +10 -0
  92. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_uk.properties +10 -0
  93. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_vi.properties +10 -0
  94. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_zh_CN.properties +10 -0
  95. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_zh_TW.properties +10 -0
  96. package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/manifest.json +96 -0
  97. package/src/main/js/sap/ushell_abap/components/tiles/action/ActionTile.controller.js +189 -0
  98. package/src/main/js/sap/ushell_abap/components/tiles/action/ActionTile.view.xml +13 -0
  99. package/src/main/js/sap/ushell_abap/components/tiles/action/Configuration.controller.js +193 -0
  100. package/src/main/js/sap/ushell_abap/components/tiles/action/Configuration.view.xml +333 -0
  101. package/src/main/js/sap/ushell_abap/components/tiles/applauncher/Component.js +41 -0
  102. package/src/main/js/sap/ushell_abap/components/tiles/applauncher/Configuration.controller.js +114 -0
  103. package/src/main/js/sap/ushell_abap/components/tiles/applauncher/Configuration.view.xml +208 -0
  104. package/src/main/js/sap/ushell_abap/components/tiles/applauncher/StaticTile.controller.js +497 -0
  105. package/src/main/js/sap/ushell_abap/components/tiles/applauncher/StaticTile.view.js +61 -0
  106. package/src/main/js/sap/ushell_abap/components/tiles/applauncherdynamic/Component.js +45 -0
  107. package/src/main/js/sap/ushell_abap/components/tiles/applauncherdynamic/Configuration.controller.js +113 -0
  108. package/src/main/js/sap/ushell_abap/components/tiles/applauncherdynamic/Configuration.view.xml +231 -0
  109. package/src/main/js/sap/ushell_abap/components/tiles/applauncherdynamic/DynamicTile.controller.js +729 -0
  110. package/src/main/js/sap/ushell_abap/components/tiles/applauncherdynamic/DynamicTile.view.js +106 -0
  111. package/src/main/js/sap/ushell_abap/library.js +12 -1
  112. package/src/main/js/sap/ushell_abap/messagebundle.properties +6 -2
  113. package/src/main/js/sap/ushell_abap/pbServices/ui2/Chip.js +7 -3
  114. package/src/main/js/sap/ushell_abap/pbServices/ui2/ODataWrapper.js +3 -5
  115. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/configuration.js +54 -4
  116. package/src/main/js/sap/ushell_abap/services/NavigationDataProvider.js +4 -4
  117. package/src/main/js/sap/ushell_abap/ui/VisualizationInstantiation/ChipInstanceWrapper.js +248 -0
  118. package/src/main/js/sap/ushell_abap/ui/VisualizationInstantiation/VizInstanceAbap.js +134 -0
  119. package/src/main/js/sap/ushell_abap/ui/VisualizationInstantiation/VizInstanceAbapLink.js +145 -0
  120. package/src/main/js/sap/ushell_abap/utils/UserPersonalization.js +127 -0
  121. package/ui5.yaml +21 -3
@@ -0,0 +1,241 @@
1
+ // Copyright (c) 2009-2026 SAP SE, All Rights Reserved
2
+
3
+ sap.ui.define([
4
+ "sap/base/Log",
5
+ "sap/tnt/NavigationList",
6
+ "sap/ushell/base/requireAsync",
7
+ "sap/ushell/Config",
8
+ "sap/ushell/modules/NavigationMenu/ListProvider"
9
+ ], (
10
+ Log,
11
+ NavigationList,
12
+ requireAsync,
13
+ Config,
14
+ ListProvider
15
+ ) => {
16
+ "use strict";
17
+ /**
18
+ * The NavigationList for the item aggregation of the SideNavigation.
19
+ *
20
+ * This module depends on the following ushell configuration:
21
+ *
22
+ * <code>
23
+ * /core/menu/personalization/enabled
24
+ * /core/spaces/myHome/enabled
25
+ * /core/spaces/myHome/myHomeSpaceId
26
+ * /core/spaces/myHome/myHomeSpaceId
27
+ * </code>
28
+ *
29
+ * Module specific configuration can contain the following properties as a stringified JSON object:
30
+ * <code>
31
+ * /core/sideNavigation/navigationListProvider/configuration
32
+ * {
33
+ * recentActivity: {
34
+ * enabled: true,
35
+ * maxItems: 10
36
+ * },
37
+ * favorites: {
38
+ * enabled: true
39
+ * },
40
+ * spaces: {
41
+ * enabled: true,
42
+ * defaultIcon: ""
43
+ * }
44
+ * }
45
+ * </code>
46
+ *
47
+ * @augments sap.ushell.modules.NavigationMenu.ListProvider
48
+ *
49
+ * @since 1.154.0
50
+ * @private
51
+ */
52
+ class GenericNavigationListProvider extends ListProvider {
53
+ /**
54
+ * The side navigation API object passed to the constructor.
55
+ * @type {sap.ushell.modules.NavigationMenu.ListProviderAPI}
56
+ */
57
+ #oSideNavAPI;
58
+
59
+ /**
60
+ * The root navigation list.
61
+ * @type {sap.tnt.NavigationList}
62
+ */
63
+ #oRootItem;
64
+
65
+ /**
66
+ * Instance of the MyHome module.
67
+ * @type {object}
68
+ */
69
+ #oMyHome;
70
+
71
+ /**
72
+ * Instance of the RecentActivity module.
73
+ * @type {object}
74
+ */
75
+ #oRecentActivity;
76
+
77
+ /**
78
+ * Instance of the Favorites module.
79
+ * @type {object}
80
+ */
81
+ #oFavorites;
82
+
83
+ /**
84
+ * Instance of the Spaces module.
85
+ * @type {object}
86
+ */
87
+ #oSpaces;
88
+
89
+ #oInitDeferred = Promise.withResolvers();
90
+
91
+ /**
92
+ * Creates a NavigationList for the item aggregation of the SideNavigation.
93
+ *
94
+ * @param {sap.ushell.modules.NavigationMenu.ListProviderAPI} oSideNavAPI The side navigation API object.
95
+ *
96
+ * @since 1.154.0
97
+ * @private
98
+ */
99
+ constructor (oSideNavAPI) {
100
+ super(oSideNavAPI);
101
+
102
+ this.#oSideNavAPI = oSideNavAPI;
103
+ this.#oRootItem = new NavigationList();
104
+
105
+ this.#buildSideNavigation().finally(this.#oInitDeferred.resolve);
106
+ }
107
+
108
+ /**
109
+ * @returns {Promise} Resolves once the init is done.
110
+ */
111
+ #initialized () {
112
+ return this.#oInitDeferred.promise;
113
+ }
114
+
115
+ /**
116
+ * Asynchronously retrieves the root navigation item.
117
+ *
118
+ * @async
119
+ * @returns {Promise<sap.tnt.NavigationList>} A promise that resolves to NavigationList with the configuration menu items.
120
+ * @since 1.154.0
121
+ */
122
+ async getRootItem () {
123
+ await this.#initialized();
124
+
125
+ return this.#oRootItem;
126
+ }
127
+
128
+ /**
129
+ * Asynchronously retrieves the selected item key from the spaces.
130
+ * @returns {Promise<string>} A promise that resolves to the selected item key.
131
+ * @since 1.154.0
132
+ */
133
+ async findSelectedKey () {
134
+ await this.#initialized();
135
+
136
+ let sSelectedKey = await this.#oMyHome?.findSelectedKey();
137
+ if (!sSelectedKey) {
138
+ sSelectedKey = await this.#oSpaces?.findSelectedKey();
139
+ }
140
+ return sSelectedKey;
141
+ }
142
+
143
+ /**
144
+ * Builds the side navigation structure by dynamically loading and configuring navigation modules.
145
+ * This method initializes child navigation items based on the configuration settings provided.
146
+ *
147
+ * @private
148
+ * @since 1.154.0
149
+ */
150
+ async #buildSideNavigation () {
151
+ this.oChildItems = {};
152
+
153
+ if (Config.last("/core/spaces/myHome/userEnabled")
154
+ && Config.last("/core/spaces/myHome/enabled")) {
155
+ try {
156
+ const [MyHome] = await requireAsync(["sap/ushell/components/shell/SideNavigation/modules/MyHome"]);
157
+
158
+ this.#oMyHome = new MyHome(this.#oSideNavAPI);
159
+ const oRootItem = await this.#oMyHome.getRootItem();
160
+ this.oChildItems.myHome = oRootItem;
161
+ this.#addItemsToAggregation();
162
+ } catch (oError) {
163
+ Log.error("Error loading MyHome module:", oError, "SideNavigation");
164
+ }
165
+ }
166
+
167
+ if (this.#oSideNavAPI.getConfigValue("recentActivity.enabled")) {
168
+ try {
169
+ const [RecentActivity] = await requireAsync(["sap/ushell/components/shell/SideNavigation/modules/RecentActivity"]);
170
+
171
+ this.#oRecentActivity = new RecentActivity(this.#oSideNavAPI);
172
+ const oRootItem = await this.#oRecentActivity.getRootItem();
173
+ this.oChildItems.recentActivity = oRootItem;
174
+ this.#addItemsToAggregation();
175
+ } catch (oError) {
176
+ Log.error("Error loading RecentActivity module:", oError, "SideNavigation");
177
+ }
178
+ }
179
+
180
+ if (this.#oSideNavAPI.getConfigValue("favorites.enabled")
181
+ && Config.last("/core/spaces/myHome/userEnabled")
182
+ && Config.last("/core/spaces/myHome/enabled")) {
183
+ try {
184
+ const [Favorites] = await requireAsync(["sap/ushell_abap/components/SideNavigation/modules/Favorites"]);
185
+
186
+ this.#oFavorites = new Favorites(this.#oSideNavAPI);
187
+ const oRootItem = await this.#oFavorites.getRootItem();
188
+ this.oChildItems.favorites = oRootItem;
189
+ this.#addItemsToAggregation();
190
+ } catch (oError) {
191
+ Log.error("Error loading Favorites module:", oError, "SideNavigation");
192
+ }
193
+ }
194
+
195
+ if (this.#oSideNavAPI.getConfigValue("spaces.enabled")) {
196
+ try {
197
+ const [Spaces] = await requireAsync(["sap/ushell/components/shell/SideNavigation/modules/Spaces"]);
198
+
199
+ this.#oSpaces = new Spaces(this.#oSideNavAPI);
200
+ const oRootItem = await this.#oSpaces.getRootItem();
201
+ this.oChildItems.spaces = oRootItem;
202
+ this.#addItemsToAggregation();
203
+ } catch (oError) {
204
+ Log.error("Error loading Spaces module:", oError, "SideNavigation");
205
+ }
206
+ }
207
+ }
208
+
209
+ /**
210
+ * Adds the child items to the root item's aggregation.
211
+ *
212
+ * @since 1.154.0
213
+ * @private
214
+ */
215
+ #addItemsToAggregation () {
216
+ this.#oRootItem.addAggregation("items", this.oChildItems.myHome);
217
+ this.#oRootItem.addAggregation("items", this.oChildItems.recentActivity);
218
+ this.#oRootItem.addAggregation("items", this.oChildItems.favorites);
219
+ this.#oRootItem.addAggregation("items", this.oChildItems.spaces);
220
+ }
221
+
222
+ /**
223
+ * Cleans up the component instance.
224
+ *
225
+ * @since 1.154.0
226
+ * @private
227
+ */
228
+ async exit () {
229
+ await this.#initialized();
230
+
231
+ this.#oMyHome?.destroy();
232
+ this.#oRecentActivity?.destroy();
233
+ this.#oFavorites?.destroy();
234
+ this.#oSpaces?.destroy();
235
+
236
+ this.#oRootItem.destroy();
237
+ }
238
+ }
239
+
240
+ return GenericNavigationListProvider;
241
+ });
@@ -0,0 +1,117 @@
1
+ // Copyright (c) 2009-2026 SAP SE, All Rights Reserved
2
+
3
+ sap.ui.define([
4
+ "sap/ushell/components/tiles/utils",
5
+ "sap/ushell_abap/components/cards/ManifestPropertyHelper",
6
+ "sap/ushell/library",
7
+ "sap/ui/core/mvc/Controller",
8
+ "sap/ui/model/json/JSONModel",
9
+ "sap/ui/core/mvc/XMLView",
10
+ "sap/ushell/Container"
11
+ ], (
12
+ tileUtils,
13
+ manifestPropertyHelper,
14
+ ushellLibrary,
15
+ Controller,
16
+ JSONModel,
17
+ XMLView,
18
+ Container
19
+ ) => {
20
+ "use strict";
21
+
22
+ return Controller.extend("sap.ushell_abap.components.cards.Card", {
23
+ onInit: function () {
24
+ const oView = this.getView();
25
+ const oChipInstance = this.getView().getViewData().chip;
26
+ const oTilePropertiesBag = oChipInstance.bag.getBag("tileProperties");
27
+
28
+ const oCardData = manifestPropertyHelper.getTranslatablePropertiesFromBag(oTilePropertiesBag);
29
+
30
+ const oModel = new JSONModel({
31
+ data: oCardData
32
+ });
33
+ oView.setModel(oModel);
34
+ oView.setModel(ushellLibrary.getResourceModel(), "i18n");
35
+
36
+ this._implementConfigurationUiContract(oChipInstance, oView);
37
+ this._implementPreviewContract(oChipInstance, oCardData);
38
+ },
39
+
40
+ // trigger to show the configuration UI if the tile is pressed in Admin mode
41
+ onPress: function () {
42
+ const oView = this.getView();
43
+ const oChipInstance = oView.getViewData().chip;
44
+ const sCardTileConfiguration = oChipInstance.configuration.getParameterValueAsString("tileConfiguration");
45
+ let oCardTileConfiguration;
46
+
47
+ if (oChipInstance.configurationUi.isEnabled()) {
48
+ oChipInstance.configurationUi.display();
49
+ } else if (sCardTileConfiguration) {
50
+ oCardTileConfiguration = JSON.parse(sCardTileConfiguration);
51
+
52
+ Container.getServiceAsync("Navigation").then((oNavigation) => {
53
+ oNavigation.navigate({
54
+ target: {
55
+ semanticObject: oCardTileConfiguration.navigation_semantic_object,
56
+ action: oCardTileConfiguration.navigation_semantic_action
57
+ },
58
+ params: oCardTileConfiguration.navigation_semantic_parameters_as_object
59
+ });
60
+ });
61
+ }
62
+ },
63
+
64
+ /**
65
+ * @param {object} chipInstance The card's chip instance
66
+ * @param {object} cardData The card's translatable properties. Only title and subtitle are needed.
67
+ *
68
+ * @private
69
+ */
70
+ _implementPreviewContract: function (chipInstance, cardData) {
71
+ if (chipInstance.preview) {
72
+ chipInstance.preview.setPreviewTitle(cardData.display_title_text);
73
+ if (chipInstance.preview.setPreviewSubtitle && typeof chipInstance.preview.setPreviewSubtitle === "function") {
74
+ chipInstance.preview.setPreviewSubtitle(cardData.display_subtitle_text);
75
+ }
76
+ }
77
+ },
78
+
79
+ /**
80
+ * Adds the configuration view to the configuration contract and binds the tilemodel to it.
81
+ *
82
+ * @param {object} chipInstance The card's chip instance
83
+ * @param {object} view The card's view
84
+ *
85
+ * @private
86
+ */
87
+ _implementConfigurationUiContract: function (chipInstance, view) {
88
+ if (chipInstance.configurationUi && chipInstance.configurationUi.isEnabled()) {
89
+ chipInstance.configurationUi.setUiProvider(() => {
90
+ const oConfigurationUi = this._getConfigurationUi(chipInstance);
91
+ oConfigurationUi.setModel(view.getModel(), "tileModel");
92
+ return oConfigurationUi;
93
+ });
94
+
95
+ view.getContent()[0].setTooltip(
96
+ tileUtils.getResourceBundle().getText("edit_configuration.tooltip")
97
+ );
98
+ }
99
+ },
100
+
101
+ /**
102
+ * Builds a configuration UI for the card.
103
+ *
104
+ * @param {object} chipInstance The card's chip instance
105
+ * @returns {object} The card's configuration view
106
+ * @private
107
+ */
108
+ _getConfigurationUi: function (chipInstance) {
109
+ const oConfigurationView = new XMLView({
110
+ viewName: "sap.ushell_abap.components.cards.Configuration",
111
+ viewData: { chipInstance: chipInstance }
112
+ });
113
+
114
+ return oConfigurationView;
115
+ }
116
+ });
117
+ });
@@ -0,0 +1,11 @@
1
+ <mvc:View
2
+ xmlns="sap.m"
3
+ xmlns:mvc="sap.ui.core.mvc"
4
+ controllerName="sap.ushell_abap.components.cards.Card">
5
+ <GenericTile
6
+ header="{/data/display_title_text}"
7
+ subheader="{/data/display_subtitle_text}"
8
+ press=".onPress">
9
+ <TileContent footer="{i18n>cardTileCaption}" />
10
+ </GenericTile>
11
+ </mvc:View>
@@ -0,0 +1,280 @@
1
+ // Copyright (c) 2009-2026 SAP SE, All Rights Reserved
2
+ sap.ui.define([
3
+ "sap/base/i18n/Localization",
4
+ "sap/ui/core/Locale",
5
+ "sap/ui/core/Lib",
6
+ "sap/ushell_abap/components/cards/ManifestPropertyHelper",
7
+ "sap/ushell/library",
8
+ "sap/ui/core/mvc/Controller",
9
+ "sap/base/strings/formatMessage",
10
+ "sap/ui/model/json/JSONModel",
11
+ "sap/base/Log",
12
+ "sap/ushell/utils/LaunchpadError"
13
+ ], (Localization, Locale, Lib, manifestPropertyHelper, ushellLibrary, Controller, formatter, JSONModel, Log, LaunchpadError) => {
14
+ "use strict";
15
+
16
+ return Controller.extend("sap.ushell_abap.components.cards.Configuration", {
17
+ formatter: formatter,
18
+ onInit: function () {
19
+ const oView = this.getView();
20
+ const oViewData = oView.getViewData();
21
+ const oChipInstance = oViewData.chipInstance;
22
+ const sManifest = oChipInstance.configuration.getParameterValueAsString("cardManifest");
23
+ let oManifest;
24
+
25
+ if (sManifest) {
26
+ oManifest = this._prepareManifest(sManifest, oChipInstance);
27
+ }
28
+
29
+ const oModel = new JSONModel({
30
+ data: {
31
+ editorValue: JSON.stringify(oManifest, null, 4) || ""
32
+ },
33
+ config: {
34
+ originalLanguage: "",
35
+ sapLogonLanguage: "",
36
+ displayOriginalLanguageWarning: false,
37
+ manifestEditorEditable: true
38
+ }
39
+ });
40
+ oView.setModel(oModel);
41
+ oView.setModel(ushellLibrary.getResourceModel(), "i18n");
42
+
43
+ oView.setViewName("sap.ushell_abap.components.cards.Configuration");
44
+
45
+ oChipInstance.configurationUi.attachSave(this.onSaveConfiguration.bind(this));
46
+
47
+ this._checkOriginalLanguage();
48
+ },
49
+
50
+ onSaveConfiguration: async function () {
51
+ const oModel = this.getView().getModel();
52
+ const sManifest = oModel.getProperty("/data/editorValue");
53
+ let oManifest;
54
+
55
+ try {
56
+ oManifest = JSON.parse(sManifest);
57
+ } catch (oError) {
58
+ Log.error(Lib.getResourceBundleFor("sap.ushell").getText("configuration.invalidJSONProvided"), oError, "card.Configuration.controller");
59
+ throw oError;
60
+ }
61
+
62
+ const oExtractedCardData = manifestPropertyHelper.extractCardData(oManifest);
63
+
64
+ try {
65
+ await this._saveManifestAndTileConfig(oExtractedCardData.manifest, oExtractedCardData.tileConfiguration);
66
+ await this._saveTilePropertiesBag(oExtractedCardData);
67
+ await this._saveTitle(oExtractedCardData.bagProperties.display_title_text);
68
+ this._updateTileModel(oExtractedCardData);
69
+ } catch (oError) {
70
+ Log.error("save failed", oError, "card.Configuration.controller");
71
+ throw oError;
72
+ }
73
+ },
74
+
75
+ /**
76
+ * Saves the card's manifest and configuration via the CHIP API
77
+ *
78
+ * @param {object} manifest The card's manifest
79
+ * @param {object} tileConfiguration The card's configuration
80
+ * @returns {Promise} A promise that resolves when the data has been saved successfully
81
+ * @private
82
+ */
83
+ _saveManifestAndTileConfig: function (manifest, tileConfiguration) {
84
+ const oChipInstance = this.getView().getViewData().chipInstance;
85
+
86
+ const oPromise = new Promise((resolve, reject) => {
87
+ // use configuration contract to write parameter values
88
+ oChipInstance.writeConfiguration.setParameterValues(
89
+ {
90
+ cardManifest: JSON.stringify(manifest),
91
+ // this has to be called tileConfiguration also for cards as the FLP expects
92
+ // to find the configuration under this name
93
+ tileConfiguration: tileConfiguration
94
+ },
95
+ resolve,
96
+ (sErrorMessage, oErrorInfo) => {
97
+ const oError = new LaunchpadError(
98
+ sErrorMessage,
99
+ {
100
+ error: sErrorMessage,
101
+ errorInfo: oErrorInfo
102
+ }
103
+ );
104
+ reject(oError);
105
+ }
106
+ );
107
+ });
108
+
109
+ return oPromise;
110
+ },
111
+
112
+ /**
113
+ * Saves the card's translatable properies in a property bag via the CHIP API
114
+ *
115
+ * @param {object} cardData The card's data
116
+ * @returns {Promise} A promise that resolves when the data has been saved successfully
117
+ * @private
118
+ */
119
+ _saveTilePropertiesBag: function (cardData) {
120
+ const oChipInstance = this.getView().getViewData().chipInstance;
121
+ const oTilePropertiesBag = oChipInstance.bag.getBag("tileProperties");
122
+ this._fillCardBag(cardData, oTilePropertiesBag);
123
+
124
+ const oPromise = new Promise((resolve, reject) => {
125
+ oTilePropertiesBag.save(
126
+ resolve,
127
+ (mErrorMessages, mErrorInfo) => {
128
+ const sFirstFailedBag = Object.keys(mErrorMessages)[0];
129
+
130
+ reject(new LaunchpadError(`Bag save failed: ${mErrorMessages[sFirstFailedBag]}`, {
131
+ info: mErrorInfo[sFirstFailedBag],
132
+ otherMessages: mErrorMessages,
133
+ otherInfo: mErrorInfo
134
+ }));
135
+ }
136
+ );
137
+ });
138
+
139
+ return oPromise;
140
+ },
141
+
142
+ /**
143
+ * Saves the card's title via the CHIP API
144
+ *
145
+ * @param {string} title The card's title
146
+ * @returns {Promise} A promise that resolves when the data has been saved successfully
147
+ * @private
148
+ */
149
+ _saveTitle: function (title) {
150
+ const oChipInstance = this.getView().getViewData().chipInstance;
151
+
152
+ const oPromise = new Promise((resolve, reject) => {
153
+ // the chip has a separate title property that is kept in sync with the title in the bags here
154
+ if (oChipInstance.title) {
155
+ oChipInstance.title.setTitle(
156
+ title,
157
+ resolve,
158
+ (sErrorMessage, oErrorInfo) => {
159
+ const oEnhancedError = new LaunchpadError(
160
+ sErrorMessage,
161
+ {
162
+ error: sErrorMessage,
163
+ errorInfo: oErrorInfo
164
+ }
165
+ );
166
+ reject(oEnhancedError);
167
+ }
168
+ );
169
+ } else {
170
+ resolve();
171
+ }
172
+ });
173
+
174
+ return oPromise;
175
+ },
176
+
177
+ /**
178
+ * Update the title and subtitle of the card tile' model
179
+ *
180
+ * @param {string} cardData The card data
181
+ * @private
182
+ */
183
+ _updateTileModel: function (cardData) {
184
+ const oTileModel = this.getView().getModel("tileModel");
185
+
186
+ // update the tile model in order to show the current information on the previewed tile outside the configuration UI
187
+ oTileModel.setProperty("/data/display_title_text", cardData.bagProperties.display_title_text);
188
+ oTileModel.setProperty("/data/display_subtitle_text", cardData.bagProperties.display_subtitle_text);
189
+ },
190
+
191
+ /**
192
+ * Fill the card's CHIP bag with texts extracted from the card's manifest
193
+ *
194
+ * @param {object} extractedData The card data extraced from the manifest
195
+ * @param {object} tilePropertiesBag The card's properties bag
196
+ *
197
+ * @private
198
+ */
199
+ _fillCardBag: function (extractedData, tilePropertiesBag) {
200
+ Object.keys(extractedData.bagProperties).forEach((sProperty) => {
201
+ if (extractedData.bagProperties[sProperty]) {
202
+ tilePropertiesBag.setText(sProperty, extractedData.bagProperties[sProperty]);
203
+ } else {
204
+ tilePropertiesBag.resetProperty(sProperty);
205
+ }
206
+ });
207
+ },
208
+
209
+ /**
210
+ * Merges the card's bag properties into the card's manifest
211
+ *
212
+ * @param {string} manifest The card's raw manifest
213
+ * @param {*} chipInstance The card's chip instance
214
+ *
215
+ * @returns {object} The merged data
216
+ *
217
+ * @private
218
+ */
219
+ _prepareManifest: function (manifest, chipInstance) {
220
+ const oManifest = JSON.parse(manifest);
221
+ const oCardData = manifestPropertyHelper.getCardData(chipInstance);
222
+
223
+ return manifestPropertyHelper.mergeCardData(oManifest, oCardData);
224
+ },
225
+
226
+ /**
227
+ * Checks wether the user is logged in in the original language of the card.
228
+ * Displays a warning message and sets the manifest editor to read only if not.
229
+ *
230
+ * @private
231
+ */
232
+ _checkOriginalLanguage: function () {
233
+ let oModel;
234
+ let oLanguages;
235
+
236
+ if (!this._isOriginalLanguage()) {
237
+ oModel = this.getView().getModel();
238
+ oLanguages = this._getLanguages();
239
+
240
+ oModel.setProperty("/config/originalLanguage", oLanguages.originalLanguage.toUpperCase());
241
+ oModel.setProperty("/config/sapLogonLanguage", oLanguages.logonLanguage.toUpperCase());
242
+ oModel.setProperty("/config/displayOriginalLanguageWarning", true);
243
+ oModel.setProperty("/config/manifestEditorEditable", false);
244
+ }
245
+ },
246
+
247
+ /**
248
+ * Checks wether the user is logged in in the original language of the card.
249
+ *
250
+ * @returns {boolean} Is it the original language?
251
+ *
252
+ * @private
253
+ */
254
+ _isOriginalLanguage: function () {
255
+ const oLanguages = this._getLanguages();
256
+ const sOriginalLanguage = oLanguages.originalLanguage.toLowerCase();
257
+ const sSAPLogonLanguage = oLanguages.logonLanguage.toLowerCase();
258
+ const sLanguage = oLanguages.ui5CoreLanguage.toLowerCase();
259
+
260
+ return sOriginalLanguage === "" || sOriginalLanguage === sSAPLogonLanguage || sOriginalLanguage === sLanguage;
261
+ },
262
+
263
+ /**
264
+ * Retrieves the original language of the card chip instance and the user's logon language
265
+ *
266
+ * @returns {object} Original and logon language
267
+ *
268
+ * @private
269
+ */
270
+ _getLanguages: function () {
271
+ const chipInstance = this.oView.getViewData().chipInstance;
272
+
273
+ return {
274
+ originalLanguage: chipInstance.bag.getOriginalLanguage(),
275
+ logonLanguage: new Locale(Localization.getLanguageTag()).getSAPLogonLanguage(),
276
+ ui5CoreLanguage: Localization.getLanguage()
277
+ };
278
+ }
279
+ });
280
+ });
@@ -0,0 +1,27 @@
1
+ <mvc:View
2
+ xmlns="sap.m"
3
+ xmlns:mvc="sap.ui.core.mvc"
4
+ xmlns:codeeditor="sap.ui.codeeditor"
5
+ controllerName="sap.ushell_abap.components.cards.Configuration"
6
+ height="100%">
7
+ <VBox fitContainer="true" justifyContent="SpaceBetween">
8
+ <MessageStrip
9
+ id="messageStrip"
10
+ showIcon="true"
11
+ showCloseButton="false"
12
+ type="Warning"
13
+ visible="{/config/displayOriginalLanguageWarning}"
14
+ text="{
15
+ parts: [
16
+ 'i18n>edit_configuration.original_locale_not_fit_message',
17
+ '/config/originalLanguage',
18
+ '/config/sapLogonLanguage'
19
+ ],
20
+ 'formatter': '.formatter'
21
+ }" />
22
+ <Title text="{i18n>configuration.category.card_manifest}" class="sapUiTinyMargin" />
23
+ <codeeditor:CodeEditor id="manifestEditor" value="{/data/editorValue}" editable="{/config/manifestEditorEditable}" type="json">
24
+ <codeeditor:layoutData><FlexItemData growFactor="1" /></codeeditor:layoutData>
25
+ </codeeditor:CodeEditor>
26
+ </VBox>
27
+ </mvc:View>