@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.
- package/package.json +1 -1
- package/src/main/js/sap/ushell_abap/.library +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/AppStateAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/ClientSideTargetResolutionAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/CommonDataModelAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/ConfigurationDefaultsAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/ContainerAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/FlpLaunchPageAdapter.js +53 -4
- package/src/main/js/sap/ushell_abap/adapters/abap/LaunchPageAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/NavTargetResolutionAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/NavTargetResolutionInternalAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/PageBuildingAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/PagePersistenceAdapter.js +5 -5
- package/src/main/js/sap/ushell_abap/adapters/abap/PersonalizationAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/PersonalizationV2Adapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/SearchAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/SupportTicketAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/Ui5ComponentLoaderAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/VisualizationInstantiationAdapter.js +76 -0
- package/src/main/js/sap/ushell_abap/adapters/hana/ContainerAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/local/ClientSideTargetResolutionAdapter.js +123 -0
- package/src/main/js/sap/ushell_abap/adapters/local/FlpLaunchPageAdapter.js +115 -0
- package/src/main/js/sap/ushell_abap/adapters/local/MenuAdapter.js +92 -0
- package/src/main/js/sap/ushell_abap/adapters/local/PageBuildingAdapter.js +242 -0
- package/src/main/js/sap/ushell_abap/adapters/local/PagePersistenceAdapter.js +308 -0
- package/src/main/js/sap/ushell_abap/api/S4MyHome.js +58 -0
- package/src/main/js/sap/ushell_abap/bootstrap/DirectAppStart.js +25 -13
- package/src/main/js/sap/ushell_abap/bootstrap/PlatformConfig.js +5 -5
- package/src/main/js/sap/ushell_abap/bootstrap/abapConstants.js +11 -0
- package/src/main/js/sap/ushell_abap/components/SideNavigation/modules/Favorites.js +549 -0
- package/src/main/js/sap/ushell_abap/components/SideNavigation/modules/GenericNavigationListProvider.js +241 -0
- package/src/main/js/sap/ushell_abap/components/cards/Card.controller.js +117 -0
- package/src/main/js/sap/ushell_abap/components/cards/Card.view.xml +11 -0
- package/src/main/js/sap/ushell_abap/components/cards/Configuration.controller.js +280 -0
- package/src/main/js/sap/ushell_abap/components/cards/Configuration.view.xml +27 -0
- package/src/main/js/sap/ushell_abap/components/cards/ManifestPropertyHelper.js +298 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/Component.js +6 -6
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/TransactionCode.controller.js +9 -8
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n.properties +10 -10
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_ar.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_bg.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_ca.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_cnr.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_cs.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_cy.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_da.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_de.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_el.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_en.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_en_GB.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_en_US_sappsd.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_en_US_saprigi.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_en_US_saptrc.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_es.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_es_MX.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_et.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_fi.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_fr.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_fr_CA.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_hi.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_hr.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_hu.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_id.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_it.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_iw.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_ja.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_kk.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_ko.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_lt.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_lv.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_mk.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_ms.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_nl.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_no.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_pl.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_pt.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_pt_PT.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_ro.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_ru.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_sh.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_sk.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_sl.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_sr.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_sv.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_th.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_tr.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_uk.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_vi.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_zh_CN.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n_zh_TW.properties +10 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/manifest.json +1 -1
- package/src/main/js/sap/ushell_abap/components/tiles/action/ActionTile.controller.js +189 -0
- package/src/main/js/sap/ushell_abap/components/tiles/action/ActionTile.view.xml +13 -0
- package/src/main/js/sap/ushell_abap/components/tiles/action/Configuration.controller.js +193 -0
- package/src/main/js/sap/ushell_abap/components/tiles/action/Configuration.view.xml +333 -0
- package/src/main/js/sap/ushell_abap/components/tiles/applauncher/Component.js +41 -0
- package/src/main/js/sap/ushell_abap/components/tiles/applauncher/Configuration.controller.js +114 -0
- package/src/main/js/sap/ushell_abap/components/tiles/applauncher/Configuration.view.xml +208 -0
- package/src/main/js/sap/ushell_abap/components/tiles/applauncher/StaticTile.controller.js +497 -0
- package/src/main/js/sap/ushell_abap/components/tiles/applauncher/StaticTile.view.js +61 -0
- package/src/main/js/sap/ushell_abap/components/tiles/applauncherdynamic/Component.js +45 -0
- package/src/main/js/sap/ushell_abap/components/tiles/applauncherdynamic/Configuration.controller.js +113 -0
- package/src/main/js/sap/ushell_abap/components/tiles/applauncherdynamic/Configuration.view.xml +231 -0
- package/src/main/js/sap/ushell_abap/components/tiles/applauncherdynamic/DynamicTile.controller.js +729 -0
- package/src/main/js/sap/ushell_abap/components/tiles/applauncherdynamic/DynamicTile.view.js +106 -0
- package/src/main/js/sap/ushell_abap/library.js +12 -1
- package/src/main/js/sap/ushell_abap/messagebundle.properties +5 -3
- package/src/main/js/sap/ushell_abap/pbServices/ui2/Chip.js +7 -3
- package/src/main/js/sap/ushell_abap/pbServices/ui2/ODataWrapper.js +1 -1
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/configuration.js +6 -2
- package/src/main/js/sap/ushell_abap/services/NavigationDataProvider.js +1 -1
- package/src/main/js/sap/ushell_abap/ui/VisualizationInstantiation/ChipInstanceWrapper.js +248 -0
- package/src/main/js/sap/ushell_abap/ui/VisualizationInstantiation/VizInstanceAbap.js +134 -0
- package/src/main/js/sap/ushell_abap/ui/VisualizationInstantiation/VizInstanceAbapLink.js +145 -0
- package/src/main/js/sap/ushell_abap/utils/UserPersonalization.js +51 -4
- package/ui5.yaml +20 -2
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// Copyright (c) 2009-2026 SAP SE, All Rights Reserved
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This copy of the DynamicTile.view is needed for compatibility reasons until the changes to applauncher_dynamic.chip.xml have been delivered.
|
|
5
|
+
* Afterwards this file can be used in all scenarios and DynamicTile.view.js can be replaced by it.
|
|
6
|
+
*/
|
|
7
|
+
sap.ui.define([
|
|
8
|
+
"sap/ui/core/mvc/View",
|
|
9
|
+
"sap/m/GenericTile",
|
|
10
|
+
"sap/m/TileContent",
|
|
11
|
+
"sap/m/library",
|
|
12
|
+
"sap/m/NumericContent",
|
|
13
|
+
"sap/ushell_abap/components/tiles/applauncherdynamic/DynamicTile.controller" // Controller needs to be loaded
|
|
14
|
+
], (
|
|
15
|
+
View,
|
|
16
|
+
GenericTile,
|
|
17
|
+
TileContent,
|
|
18
|
+
mobileLibrary,
|
|
19
|
+
NumericContent
|
|
20
|
+
) => {
|
|
21
|
+
"use strict";
|
|
22
|
+
|
|
23
|
+
// shortcut for sap.m.ValueColor
|
|
24
|
+
const ValueColor = mobileLibrary.ValueColor;
|
|
25
|
+
|
|
26
|
+
return View.extend("sap.ushell_abap.components.tiles.applauncherdynamic.DynamicTile", {
|
|
27
|
+
getControllerName: function () {
|
|
28
|
+
return "sap.ushell_abap.components.tiles.applauncherdynamic.DynamicTile";
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
createContent: function () {
|
|
32
|
+
this.setHeight("100%");
|
|
33
|
+
this.setWidth("100%");
|
|
34
|
+
|
|
35
|
+
return this.getTileControl();
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
getTileControl: function () {
|
|
39
|
+
const oController = this.getController();
|
|
40
|
+
|
|
41
|
+
// Return the GenericTile if it already exists instead of creating a new one
|
|
42
|
+
if (this.getContent().length === 1) {
|
|
43
|
+
return this.getContent()[0];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return new GenericTile({
|
|
47
|
+
mode: "{/mode}",
|
|
48
|
+
frameType: "{/frameType}",
|
|
49
|
+
header: "{/data/display_title_text}",
|
|
50
|
+
subheader: "{/data/display_subtitle_text}",
|
|
51
|
+
sizeBehavior: "{/sizeBehavior}",
|
|
52
|
+
wrappingType: "{/wrappingType}",
|
|
53
|
+
appShortcut: "{/config/display_transaction_code_effective}",
|
|
54
|
+
url: {
|
|
55
|
+
parts: ["/targetURL", "/nav/navigation_target_url"],
|
|
56
|
+
formatter: oController.formatters.leanURL
|
|
57
|
+
},
|
|
58
|
+
tileContent: [new TileContent({
|
|
59
|
+
footer: "{/data/display_info_text}",
|
|
60
|
+
footerColor: {
|
|
61
|
+
path: "/data/display_info_state",
|
|
62
|
+
formatter: function (sFooterColor) {
|
|
63
|
+
if (sFooterColor === "Positive") {
|
|
64
|
+
sFooterColor = ValueColor.Good;
|
|
65
|
+
}
|
|
66
|
+
if (sFooterColor === "Negative") {
|
|
67
|
+
sFooterColor = ValueColor.Error;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (!ValueColor[sFooterColor]) {
|
|
71
|
+
sFooterColor = ValueColor.Neutral;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return sFooterColor;
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
unit: "{/data/display_number_unit}",
|
|
78
|
+
// We'll utilize NumericContent for the "Dynamic" content.
|
|
79
|
+
content: [new NumericContent({
|
|
80
|
+
scale: "{/data/display_number_factor}",
|
|
81
|
+
value: "{/data/display_number_value}",
|
|
82
|
+
truncateValueTo: 5, // Otherwise, The default value is 4.
|
|
83
|
+
indicator: "{/data/display_state_arrow}",
|
|
84
|
+
valueColor: {
|
|
85
|
+
path: "/data/display_number_state",
|
|
86
|
+
formatter: function (sState) {
|
|
87
|
+
if (!sState || sState === "Neutral" || !ValueColor[sState]) {
|
|
88
|
+
return ValueColor.None;
|
|
89
|
+
}
|
|
90
|
+
return sState;
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
icon: "{/data/display_icon_url}",
|
|
94
|
+
width: "100%",
|
|
95
|
+
withMargin: false
|
|
96
|
+
})]
|
|
97
|
+
})],
|
|
98
|
+
press: [oController.onPress, oController]
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
getMode: function () {
|
|
103
|
+
return this.getModel().getProperty("/mode");
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
});
|
|
@@ -13,6 +13,13 @@ sap.ui.define([
|
|
|
13
13
|
) => {
|
|
14
14
|
"use strict";
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* @namespace sap.ushell_abap.api
|
|
18
|
+
* @since 1.154.0
|
|
19
|
+
* @private
|
|
20
|
+
* @ui5-restricted
|
|
21
|
+
*/
|
|
22
|
+
|
|
16
23
|
/**
|
|
17
24
|
* @namespace sap.ushell_abap.components
|
|
18
25
|
* @since 1.121.0
|
|
@@ -32,11 +39,15 @@ sap.ui.define([
|
|
|
32
39
|
const ushellAbapLib = Library.init({
|
|
33
40
|
name: "sap.ushell_abap",
|
|
34
41
|
apiVersion: 2,
|
|
35
|
-
version: "1.
|
|
42
|
+
version: "1.154.0",
|
|
36
43
|
dependencies: [
|
|
37
44
|
"sap.ui.core",
|
|
38
45
|
"sap.m",
|
|
39
46
|
"sap.ushell"
|
|
47
|
+
],
|
|
48
|
+
controls: [
|
|
49
|
+
"sap.ushell_abap.ui.VisualizationInstantiation.VizInstanceAbap",
|
|
50
|
+
"sap.ushell_abap.ui.VisualizationInstantiation.VizInstanceAbapLink"
|
|
40
51
|
]
|
|
41
52
|
});
|
|
42
53
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
#
|
|
2
|
-
#__ldi.translation.uuid=865e4af1-8cca-465c-8b85-97f19b98ef6a
|
|
1
|
+
# Resource bundle for the "sap.ushell_abap" library
|
|
2
|
+
# __ldi.translation.uuid=865e4af1-8cca-465c-8b85-97f19b98ef6a
|
|
3
3
|
|
|
4
4
|
#XBUT: Close button for the SAML authentication dialog
|
|
5
5
|
samlCloseBtn=Close
|
|
6
|
+
|
|
6
7
|
#XTIT: Title of the SAML authentication dialog
|
|
7
8
|
samlDialogTitle=Authentication Information
|
|
8
|
-
|
|
9
|
+
|
|
10
|
+
#XTXT: Fallback text shown on tiles without transaction code
|
|
9
11
|
tileTransactionCodeNotMaintained=No Transaction
|
|
@@ -544,9 +544,13 @@ sap.ui.define([
|
|
|
544
544
|
};
|
|
545
545
|
const oImplementation = oDefinition.implementation.sapui5;
|
|
546
546
|
|
|
547
|
-
|
|
548
|
-
const
|
|
549
|
-
|
|
547
|
+
const sBaseChipId = this.getBaseChipId() || this.getId(); // base chip id might be empty fallback to actual id
|
|
548
|
+
const bIsStandardChip = [
|
|
549
|
+
"X-SAP-UI2-CHIP:/UI2/STATIC_APPLAUNCHER",
|
|
550
|
+
"X-SAP-UI2-CHIP:/UI2/DYNAMIC_APPLAUNCHER"
|
|
551
|
+
].includes(sBaseChipId);
|
|
552
|
+
|
|
553
|
+
if (!bIsStandardChip) {
|
|
550
554
|
if (oImplementation.$VirtualNamespace) {
|
|
551
555
|
oImplementation.$absolutePath = this.toAbsoluteUrl(oImplementation.basePath);
|
|
552
556
|
sap.ui.loader.config({ paths: JSON.parse(`{"${oImplementation.$Namespace.replace(/\./g, "/")}":"${oImplementation.$absolutePath}"}`) });
|
|
@@ -758,7 +758,7 @@ sap.ui.define([
|
|
|
758
758
|
* cannot be parsed or is not returned in the OData error response.<br />
|
|
759
759
|
*
|
|
760
760
|
* <b>NOTE:</b> the second parameter is returned since version 1.28.6.
|
|
761
|
-
* @param {
|
|
761
|
+
* @param {PromiseWithResolvers<any>} [oDeferred] Deferred object from Promise.withResolvers
|
|
762
762
|
* @param {object} oError
|
|
763
763
|
* error object provided by datajs, should contain the response
|
|
764
764
|
*
|
|
@@ -91,10 +91,14 @@ sap.ui.define([
|
|
|
91
91
|
// The FLP directly changes the configuration data of the bookmark tile and can notify the bookmark
|
|
92
92
|
// tiles afterwards about the changes, so the bookmark tiles can update themselves with the new data.
|
|
93
93
|
if (typeof fnHandler !== "function") {
|
|
94
|
-
throw new SrvcError("The given handler is not a function",
|
|
95
|
-
"chip.configuration");
|
|
94
|
+
throw new SrvcError("The given handler is not a function", "chip.configuration");
|
|
96
95
|
}
|
|
97
96
|
fnUpdatedHandler = fnHandler;
|
|
97
|
+
|
|
98
|
+
// additionally attach to changes on the display transaction code setting
|
|
99
|
+
UserPersonalization.attachDisplayTransactionCodeChanged(() => {
|
|
100
|
+
fnHandler(["tileConfiguration"]);
|
|
101
|
+
});
|
|
98
102
|
};
|
|
99
103
|
|
|
100
104
|
/**
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
// Copyright (c) 2009-2026 SAP SE, All Rights Reserved
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @fileOverview Helper class wrapping a CHIP instance for use inside a VizInstance.
|
|
5
|
+
* @version 1.154.0
|
|
6
|
+
*/
|
|
7
|
+
sap.ui.define([
|
|
8
|
+
"sap/base/Log",
|
|
9
|
+
"sap/m/library",
|
|
10
|
+
"sap/ushell/Container",
|
|
11
|
+
"sap/ushell/library",
|
|
12
|
+
"sap/ushell/utils/chipsUtils"
|
|
13
|
+
], (
|
|
14
|
+
Log,
|
|
15
|
+
mobileLibrary,
|
|
16
|
+
Container,
|
|
17
|
+
ushellLibrary,
|
|
18
|
+
chipsUtils
|
|
19
|
+
) => {
|
|
20
|
+
"use strict";
|
|
21
|
+
|
|
22
|
+
// shortcut for sap.m.LoadState
|
|
23
|
+
const LoadState = mobileLibrary.LoadState;
|
|
24
|
+
|
|
25
|
+
// shortcut for sap.ushell.DisplayFormat
|
|
26
|
+
const DisplayFormat = ushellLibrary.DisplayFormat;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @alias sap.ushell_abap.ui.VisualizationInstantiation.ChipInstanceWrapper
|
|
30
|
+
* @class
|
|
31
|
+
* @classdesc Helper class to manage the lifecycle of a CHIP instance inside a VizInstance.
|
|
32
|
+
* Coordinates chip creation, loading, visibility, and type detection.
|
|
33
|
+
*
|
|
34
|
+
* @since 1.154.0
|
|
35
|
+
* @private
|
|
36
|
+
*/
|
|
37
|
+
class ChipInstanceWrapper {
|
|
38
|
+
#oLoadDeferred = Promise.withResolvers();
|
|
39
|
+
#oChipInstanceDeferred = Promise.withResolvers();
|
|
40
|
+
#oChipInstance;
|
|
41
|
+
#oInstantiationData;
|
|
42
|
+
#oTargetControl;
|
|
43
|
+
#bInitialized = false;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @param {sap.ushell.ui.launchpad.VizInstanceBase} oTargetControl The VizInstance that owns this wrapper.
|
|
47
|
+
*/
|
|
48
|
+
constructor (oTargetControl) {
|
|
49
|
+
this.#oTargetControl = oTargetControl;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Initializes the CHIP instance from the provided instantiation data.
|
|
54
|
+
* No-op if called more than once.
|
|
55
|
+
*
|
|
56
|
+
* @param {object} oInstantiationData The instantiation data from the visualization.
|
|
57
|
+
* @returns {Promise<undefined>} Resolves when the CHIP instance is created.
|
|
58
|
+
* @since 1.154.0
|
|
59
|
+
* @private
|
|
60
|
+
*/
|
|
61
|
+
async init (oInstantiationData) {
|
|
62
|
+
if (this.#bInitialized) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
this.#oInstantiationData = oInstantiationData;
|
|
67
|
+
this.#bInitialized = true;
|
|
68
|
+
|
|
69
|
+
const PageBuilding = await Container.getServiceAsync("PageBuilding");
|
|
70
|
+
const oFactory = PageBuilding.getFactory();
|
|
71
|
+
|
|
72
|
+
let oRawChipInstanceData;
|
|
73
|
+
let oBags;
|
|
74
|
+
|
|
75
|
+
if (!this.#oInstantiationData.simplifiedChipFormat) {
|
|
76
|
+
oRawChipInstanceData = {
|
|
77
|
+
chipId: this.#oInstantiationData?.chip?.id,
|
|
78
|
+
chip: this.#oInstantiationData?.chip
|
|
79
|
+
};
|
|
80
|
+
} else {
|
|
81
|
+
const oSimplifiedChip = this.#oInstantiationData?.chip || {};
|
|
82
|
+
oBags = oSimplifiedChip?.bags;
|
|
83
|
+
oRawChipInstanceData = {
|
|
84
|
+
chipId: oSimplifiedChip?.chipId,
|
|
85
|
+
// string is expected
|
|
86
|
+
configuration: oSimplifiedChip?.configuration ? JSON.stringify(oSimplifiedChip?.configuration) : "{}"
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const oChipInstance = oFactory.createChipInstance(oRawChipInstanceData);
|
|
91
|
+
|
|
92
|
+
chipsUtils.addBagDataToChipInstance(oChipInstance, oBags);
|
|
93
|
+
this.#oChipInstanceDeferred.resolve(oChipInstance);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* A function which sets the content of the VizInstance to a UI5 view.
|
|
98
|
+
* @returns {Promise<undefined>} Resolves when the chip instance is loaded.
|
|
99
|
+
*
|
|
100
|
+
* @since 1.154.0
|
|
101
|
+
* @private
|
|
102
|
+
*/
|
|
103
|
+
async load () {
|
|
104
|
+
try {
|
|
105
|
+
this.#oChipInstance = await this.#oChipInstanceDeferred.promise;
|
|
106
|
+
await new Promise(this.#oChipInstance.load);
|
|
107
|
+
|
|
108
|
+
if (this.#oTargetControl.getPreview()) {
|
|
109
|
+
const oPreviewContract = this.#oChipInstance.getContract("preview");
|
|
110
|
+
// the preview contract doesn't have to be implemented as it might just not be needed
|
|
111
|
+
// e.g. for tiles that don't display any dynamic data anyway
|
|
112
|
+
if (oPreviewContract) {
|
|
113
|
+
oPreviewContract.setEnabled(true);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// apply current visibility, default for chips is visible
|
|
117
|
+
// this might lead to instant requests when tileView is fetched
|
|
118
|
+
this.setVisible(this.#oTargetControl.getActive());
|
|
119
|
+
|
|
120
|
+
const oChipControl = await this.#oChipInstance.getImplementationAsSapui5Async();
|
|
121
|
+
|
|
122
|
+
this.#setChipInstanceType();
|
|
123
|
+
this.#oTargetControl.setContent?.(oChipControl);
|
|
124
|
+
// Fix parent relation for the component instance to make GridContainer DnD work
|
|
125
|
+
// BCP: 2170186464
|
|
126
|
+
if (oChipControl.getComponentInstance?.()) {
|
|
127
|
+
oChipControl.getComponentInstance().setParent(this.#oTargetControl);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
this.#oLoadDeferred.resolve();
|
|
131
|
+
} catch (oError) {
|
|
132
|
+
this.#oTargetControl.setState(LoadState.Failed);
|
|
133
|
+
|
|
134
|
+
this.#oLoadDeferred.reject(oError);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return this.loaded();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* @returns {Promise<undefined>} Resolves when the chip instance has finished loading.
|
|
142
|
+
* @since 1.154.0
|
|
143
|
+
* @private
|
|
144
|
+
*/
|
|
145
|
+
loaded () {
|
|
146
|
+
return this.#oLoadDeferred.promise;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Returns the transaction code from the inner CHIP instance
|
|
151
|
+
* Requires {@link #load} to be called first.
|
|
152
|
+
*
|
|
153
|
+
* @returns {Promise<string>} Resolves the transaction code to display.
|
|
154
|
+
*
|
|
155
|
+
* @since 1.154.0
|
|
156
|
+
* @private
|
|
157
|
+
*/
|
|
158
|
+
async getTransactionCode () {
|
|
159
|
+
await this.#oLoadDeferred.promise;
|
|
160
|
+
|
|
161
|
+
return chipsUtils.getCatalogTileTransactionCode(this.#oChipInstance);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Sets the display format of the CHIP instance via the instance's types contract
|
|
166
|
+
*
|
|
167
|
+
* @since 1.154.0
|
|
168
|
+
*/
|
|
169
|
+
#setChipInstanceType () {
|
|
170
|
+
const oTypesContract = this.#oChipInstance.getContract("types");
|
|
171
|
+
if (oTypesContract) {
|
|
172
|
+
oTypesContract.setType(this.#mapDisplayFormatToChip(this.#oTargetControl.getDisplayFormat()));
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Maps the display format to the CHIP type
|
|
178
|
+
*
|
|
179
|
+
* @param {DisplayFormat} sDisplayFormat The display format to be mapped
|
|
180
|
+
* @returns {string} The appropriate type
|
|
181
|
+
* @since 1.154.0
|
|
182
|
+
*/
|
|
183
|
+
#mapDisplayFormatToChip (sDisplayFormat) {
|
|
184
|
+
const oDisplayFormatMapping = {};
|
|
185
|
+
|
|
186
|
+
oDisplayFormatMapping[DisplayFormat.Standard] = "tile";
|
|
187
|
+
oDisplayFormatMapping[DisplayFormat.StandardWide] = "tile";
|
|
188
|
+
const oTypesContract = this.#oChipInstance && !this.#oChipInstance.isStub() && this.#oChipInstance.getContract("types");
|
|
189
|
+
if (oTypesContract && oTypesContract.getAvailableTypes().includes("tilewide")) {
|
|
190
|
+
oDisplayFormatMapping[DisplayFormat.StandardWide] = "tilewide";
|
|
191
|
+
}
|
|
192
|
+
oDisplayFormatMapping[DisplayFormat.Compact] = "link";
|
|
193
|
+
oDisplayFormatMapping[DisplayFormat.Flat] = "flat";
|
|
194
|
+
oDisplayFormatMapping[DisplayFormat.FlatWide] = "flatwide";
|
|
195
|
+
|
|
196
|
+
return oDisplayFormatMapping[sDisplayFormat];
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Updates the chip instance's visibility if the contract is active.
|
|
201
|
+
*
|
|
202
|
+
* @param {boolean} visible The visibility state to be set
|
|
203
|
+
* @since 1.154.0
|
|
204
|
+
*/
|
|
205
|
+
setVisible (visible) {
|
|
206
|
+
const oVisibleContract = this.#oChipInstance && !this.#oChipInstance.isStub() && this.#oChipInstance.getContract("visible");
|
|
207
|
+
|
|
208
|
+
if (oVisibleContract) {
|
|
209
|
+
oVisibleContract.setVisible(visible);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Refreshes the chip instance's data
|
|
215
|
+
*
|
|
216
|
+
* @since 1.154.0
|
|
217
|
+
*/
|
|
218
|
+
refresh () {
|
|
219
|
+
// The CHIP instance is only available after the VizInstance was loaded
|
|
220
|
+
if (this.#oChipInstance) {
|
|
221
|
+
// The refresh handler is provided directly on the CHIP instance and not as contract
|
|
222
|
+
this.#oChipInstance.refresh();
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Returns whether the VizInstance is a standard tile type.
|
|
228
|
+
* @returns {boolean} Whether the VizInstance is standard.
|
|
229
|
+
*
|
|
230
|
+
* @since 1.154.0
|
|
231
|
+
* @private
|
|
232
|
+
*/
|
|
233
|
+
isStandardType () {
|
|
234
|
+
// check whether the chip instance is a standard tile or a custom tile based on the base chip ID.
|
|
235
|
+
// simplified format -> chip.chipId, non-simplified (raw) format -> chip.baseChipId
|
|
236
|
+
if (!this.#oInstantiationData?.chip) {
|
|
237
|
+
Log.warning("VizInstanceAbap: No instantiation data available to determine whether the VizInstance is a standard tile or a custom tile.");
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
const sBaseChipId = this.#oInstantiationData.simplifiedChipFormat
|
|
241
|
+
? this.#oInstantiationData.chip.chipId
|
|
242
|
+
: this.#oInstantiationData.chip.baseChipId;
|
|
243
|
+
return chipsUtils.isStandardTile(sBaseChipId);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return ChipInstanceWrapper;
|
|
248
|
+
});
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// Copyright (c) 2009-2026 SAP SE, All Rights Reserved
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @fileOverview VizInstance implementation for the ABAP platform, backed by a CHIP instance.
|
|
5
|
+
* @version 1.154.0
|
|
6
|
+
*/
|
|
7
|
+
sap.ui.define([
|
|
8
|
+
"sap/ushell/ui/launchpad/VizInstance",
|
|
9
|
+
"sap/ushell_abap/ui/VisualizationInstantiation/ChipInstanceWrapper"
|
|
10
|
+
], (
|
|
11
|
+
VizInstance,
|
|
12
|
+
ChipInstanceWrapper
|
|
13
|
+
) => {
|
|
14
|
+
"use strict";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @alias sap.ushell_abap.ui.VisualizationInstantiation.VizInstanceAbap
|
|
18
|
+
* @class
|
|
19
|
+
* @classdesc VizInstance for visualizations sourced from the ABAP platform.
|
|
20
|
+
* Delegates rendering and data loading to a {@link sap.ushell_abap.ui.VisualizationInstantiation.ChipInstanceWrapper}.
|
|
21
|
+
*
|
|
22
|
+
* @extends sap.ushell.ui.launchpad.VizInstance
|
|
23
|
+
*
|
|
24
|
+
* @since 1.77
|
|
25
|
+
* @private
|
|
26
|
+
*/
|
|
27
|
+
const VizInstanceAbap = VizInstance.extend("sap.ushell_abap.ui.VisualizationInstantiation.VizInstanceAbap", /** @lends sap.ushell_abap.ui.VisualizationInstantiation.VizInstanceAbap.prototype */ {
|
|
28
|
+
metadata: {
|
|
29
|
+
library: "sap.ushell_abap"
|
|
30
|
+
},
|
|
31
|
+
renderer: VizInstance.getMetadata().getRenderer()
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @override
|
|
36
|
+
* @since 1.77
|
|
37
|
+
* @private
|
|
38
|
+
*/
|
|
39
|
+
VizInstanceAbap.prototype.init = function () {
|
|
40
|
+
VizInstance.prototype.init.apply(this, arguments);
|
|
41
|
+
|
|
42
|
+
this._oChipInstanceWrapper = new ChipInstanceWrapper(this);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Initializes the underlying CHIP instance with the provided instantiation data.
|
|
47
|
+
*
|
|
48
|
+
* @param {object} oInstantiationData The instantiation data for the CHIP.
|
|
49
|
+
* @returns {sap.ushell_abap.ui.VisualizationInstantiation.VizInstanceAbap} This instance, for chaining.
|
|
50
|
+
* @override
|
|
51
|
+
* @since 1.77
|
|
52
|
+
* @private
|
|
53
|
+
*/
|
|
54
|
+
VizInstanceAbap.prototype.setInstantiationData = function (oInstantiationData) {
|
|
55
|
+
this._oChipInstanceWrapper.init(oInstantiationData);
|
|
56
|
+
this.setProperty("instantiationData", oInstantiationData);
|
|
57
|
+
return this;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* A function which sets the content of the VizInstance to a UI5 view.
|
|
62
|
+
* @param {boolean} [isCustom] Whether this VizInstance is a standard tile or custom.
|
|
63
|
+
* @returns {Promise<undefined>} Resolves when the chip instance is loaded.
|
|
64
|
+
* @override
|
|
65
|
+
* @since 1.77
|
|
66
|
+
*/
|
|
67
|
+
VizInstanceAbap.prototype.load = function (isCustom) {
|
|
68
|
+
return this._oChipInstanceWrapper.load();
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @returns {Promise<undefined>} Resolves when the chip instance has finished loading.
|
|
73
|
+
* @override
|
|
74
|
+
* @since 1.77
|
|
75
|
+
* @private
|
|
76
|
+
*/
|
|
77
|
+
VizInstanceAbap.prototype.loaded = function () {
|
|
78
|
+
return this._oChipInstanceWrapper.loaded();
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Returns the transaction code from the inner CHIP instance
|
|
83
|
+
* Requires {@link #load} to be called first.
|
|
84
|
+
*
|
|
85
|
+
* @returns {Promise<string>} Resolves the transaction code to display.
|
|
86
|
+
*
|
|
87
|
+
* @since 1.154.0
|
|
88
|
+
* @private
|
|
89
|
+
*/
|
|
90
|
+
VizInstanceAbap.prototype.getTransactionCode = async function () {
|
|
91
|
+
return this._oChipInstanceWrapper.getTransactionCode();
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Refreshes the chip instance's data
|
|
96
|
+
*
|
|
97
|
+
* @since 1.78
|
|
98
|
+
*/
|
|
99
|
+
VizInstanceAbap.prototype.refresh = function () {
|
|
100
|
+
this._oChipInstanceWrapper.refresh();
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Updates the visualization's active state.
|
|
105
|
+
* E.g. inactive dynamic tiles do not send requests
|
|
106
|
+
*
|
|
107
|
+
* @param {boolean} active The visualization's active state
|
|
108
|
+
* @param {boolean} refresh Refresh the visualization immediately
|
|
109
|
+
* @returns {object} The VizInstance
|
|
110
|
+
* @since 1.78
|
|
111
|
+
*/
|
|
112
|
+
VizInstanceAbap.prototype.setActive = function (active, refresh) {
|
|
113
|
+
this._oChipInstanceWrapper.setVisible(active);
|
|
114
|
+
|
|
115
|
+
if (refresh) {
|
|
116
|
+
this.refresh();
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return this.setProperty("active", active, false);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Returns whether the VizInstance is a standard tile type.
|
|
124
|
+
* @returns {boolean} Whether the VizInstance is standard.
|
|
125
|
+
* @override
|
|
126
|
+
* @since 1.153
|
|
127
|
+
* @private
|
|
128
|
+
*/
|
|
129
|
+
VizInstanceAbap.prototype.isStandardType = function () {
|
|
130
|
+
return this._oChipInstanceWrapper.isStandardType();
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
return VizInstanceAbap;
|
|
134
|
+
});
|