@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.
- 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 +53 -63
- 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 +62 -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 +8 -8
- 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/UserInfoAdapter.js +11 -11
- 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 +28 -15
- package/src/main/js/sap/ushell_abap/bootstrap/LoadLaunchpad/CreateRenderer.js +4 -2
- package/src/main/js/sap/ushell_abap/bootstrap/LoadLaunchpad/RequestPages.js +2 -6
- package/src/main/js/sap/ushell_abap/bootstrap/PlatformConfig.js +5 -5
- package/src/main/js/sap/ushell_abap/bootstrap/XhrLogonEventHandler.js +6 -7
- package/src/main/js/sap/ushell_abap/bootstrap/abapConstants.js +30 -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 +90 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/TransactionCode.controller.js +110 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/TransactionCode.view.xml +16 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n.properties +17 -0
- 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 +96 -0
- 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 +6 -2
- package/src/main/js/sap/ushell_abap/pbServices/ui2/Chip.js +7 -3
- package/src/main/js/sap/ushell_abap/pbServices/ui2/ODataWrapper.js +3 -5
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/configuration.js +54 -4
- package/src/main/js/sap/ushell_abap/services/NavigationDataProvider.js +4 -4
- 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 +127 -0
- package/ui5.yaml +21 -3
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
// Copyright (c) 2009-2026 SAP SE, All Rights Reserved
|
|
2
|
+
|
|
3
|
+
sap.ui.define([
|
|
4
|
+
"sap/ui/core/mvc/Controller",
|
|
5
|
+
"sap/ushell/components/tiles/utils",
|
|
6
|
+
"sap/ui/model/json/JSONModel",
|
|
7
|
+
"sap/base/Log",
|
|
8
|
+
"sap/ushell/utils/LaunchpadError"
|
|
9
|
+
], (Controller, tileUtils, JSONModel, Log, LaunchpadError) => {
|
|
10
|
+
"use strict";
|
|
11
|
+
|
|
12
|
+
return Controller.extend("sap.ushell_abap.components.tiles.action.ActionTile", {
|
|
13
|
+
onInit: function () {
|
|
14
|
+
const oView = this.getView();
|
|
15
|
+
const oViewData = oView.getViewData();
|
|
16
|
+
const oResourceModel = tileUtils.getResourceBundleModel();
|
|
17
|
+
const oTileApi = oViewData.chip; // instance
|
|
18
|
+
const oConfig = tileUtils.getActionConfiguration(oTileApi);
|
|
19
|
+
const that = this;
|
|
20
|
+
|
|
21
|
+
function formatDisplayText (sSemanticObject, sSemanticAction) {
|
|
22
|
+
const oBundle = tileUtils.getResourceBundle();
|
|
23
|
+
const sResult = `${oBundle.getText("configuration.semantic_object")}:\n${sSemanticObject}\n\n${
|
|
24
|
+
oBundle.getText("configuration.semantic_action")}:\n${sSemanticAction}`;
|
|
25
|
+
return sResult;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
oView.setModel(oResourceModel, "i18n");
|
|
29
|
+
const oModel = new JSONModel({
|
|
30
|
+
config: oConfig,
|
|
31
|
+
displayText: formatDisplayText(oConfig.semantic_object, oConfig.semantic_action)
|
|
32
|
+
});
|
|
33
|
+
oView.setModel(oModel);
|
|
34
|
+
|
|
35
|
+
// implement configurationUi contract: setup configuration UI
|
|
36
|
+
if (oTileApi.configurationUi.isEnabled()) {
|
|
37
|
+
// attach configuration UI provider, which is essentially a components.tiles.action.Configuration
|
|
38
|
+
oTileApi.configurationUi.setAsyncUiProvider(() => {
|
|
39
|
+
return tileUtils.getConfigurationUi(
|
|
40
|
+
that.getView(),
|
|
41
|
+
"sap.ushell_abap.components.tiles.action.Configuration"
|
|
42
|
+
).then((oConfigurationUi) => {
|
|
43
|
+
oTileApi.configurationUi.attachCancel(that.onCancelConfiguration.bind(null, oConfigurationUi));
|
|
44
|
+
oTileApi.configurationUi.attachSave(that.onSaveConfiguration.bind(null, oConfigurationUi, formatDisplayText));
|
|
45
|
+
return oConfigurationUi;
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
oView.byId("actionTile").setTooltip(tileUtils.getResourceBundle().getText("edit_configuration.tooltip"));
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
onPress: function (oEvent) {
|
|
53
|
+
// trigger to show the configuration UI if the tile is pressed in Admin mode
|
|
54
|
+
const oTileApi = this.getView().getViewData().chip;
|
|
55
|
+
if (oTileApi.configurationUi.isEnabled()) {
|
|
56
|
+
oTileApi.configurationUi.display();
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
// configuration save handler
|
|
61
|
+
// The target mapping tile is enhanced with mapping_signature and supported form_factors properties.
|
|
62
|
+
onSaveConfiguration: async function (oConfigurationView, fnFormatDisplayText) {
|
|
63
|
+
let oModel = oConfigurationView.getModel();
|
|
64
|
+
// tile model placed into configuration model by getConfigurationUi
|
|
65
|
+
const oTileModel = oModel.getProperty("/tileModel");
|
|
66
|
+
const oTileApi = oConfigurationView.getViewData().chip;
|
|
67
|
+
|
|
68
|
+
// If the input fields icon, semantic object and action are failing the input validations, then through an error message requesting the
|
|
69
|
+
// user to enter/correct those fields
|
|
70
|
+
const bReject = tileUtils.checkTMInputOnSaveConfig(oConfigurationView);
|
|
71
|
+
if (bReject) {
|
|
72
|
+
throw new Error("mandatory_fields_missing");
|
|
73
|
+
}
|
|
74
|
+
// Before saving the model data, check if Mapping signature table contains duplicate parameter names
|
|
75
|
+
// in this case the save will fail and all the data will be lost as this is the designer behavior.
|
|
76
|
+
const oBundle = tileUtils.getResourceBundle();
|
|
77
|
+
if (tileUtils.tableHasDuplicateParameterNames(oModel.getProperty("/config/rows"))) {
|
|
78
|
+
throw new Error(oBundle.getText("configuration.signature.uniqueParamMessage.text"));
|
|
79
|
+
} else if (!tileUtils.tableHasInvalidSapPrelaunchOperationValue(oModel.getProperty("/config/rows"))) {
|
|
80
|
+
const sSapPrelaunchOperationsTemplate = JSON.stringify([{
|
|
81
|
+
type: "split",
|
|
82
|
+
source: "p1",
|
|
83
|
+
target: ["p2", "p3"]
|
|
84
|
+
}, {
|
|
85
|
+
type: "merge",
|
|
86
|
+
source: ["p4", "p5"],
|
|
87
|
+
target: "p6"
|
|
88
|
+
}]);
|
|
89
|
+
throw new Error(oBundle.getText("configuration.signature.invalidSapPrelaunchOperationsMessage.text", [sSapPrelaunchOperationsTemplate]));
|
|
90
|
+
}
|
|
91
|
+
// only if the data is valid proceed with the save operation
|
|
92
|
+
const oSaveDeferred = Promise.withResolvers();
|
|
93
|
+
// Decide according to special flag if the setting in form factor are default
|
|
94
|
+
// if so , the configuration should not be saved - this is crucial for the backend checks
|
|
95
|
+
const oFormFactor = oModel.getProperty("/config/formFactorConfigDefault") ? undefined : tileUtils.buildFormFactorsObject(oModel);
|
|
96
|
+
const sMappingSignature = tileUtils.getMappingSignatureString(oModel.getProperty("/config/rows"), oModel.getProperty("/config/isUnknownAllowed"));
|
|
97
|
+
const oMappingSignature = tileUtils.getMappingSignature(oModel.getProperty("/config/rows"), oModel.getProperty("/config/isUnknownAllowed"));
|
|
98
|
+
// get the configuration to save from the model
|
|
99
|
+
const configToSave = {
|
|
100
|
+
semantic_object: (oModel.getProperty("/config/semantic_object") || "").trim(),
|
|
101
|
+
semantic_action: (oModel.getProperty("/config/semantic_action") || "").trim(),
|
|
102
|
+
display_title_text: (oModel.getProperty("/config/display_title_text") || "").trim(),
|
|
103
|
+
url: (oModel.getProperty("/config/url") || "").trim(),
|
|
104
|
+
ui5_component: (oModel.getProperty("/config/ui5_component") || "").trim(),
|
|
105
|
+
navigation_provider: (oModel.getProperty("/config/navigation_provider") || "").trim(),
|
|
106
|
+
navigation_provider_role: (oModel.getProperty("/config/navigation_provider_role") || "").trim(),
|
|
107
|
+
navigation_provider_instance: (oModel.getProperty("/config/navigation_provider_instance") || "").trim(),
|
|
108
|
+
target_application_id: (oModel.getProperty("/config/target_application_id") || "").trim(),
|
|
109
|
+
target_application_alias: (oModel.getProperty("/config/target_application_alias") || "").trim(),
|
|
110
|
+
transaction: {
|
|
111
|
+
code: (oModel.getProperty("/config/transaction/code") || "").trim()
|
|
112
|
+
},
|
|
113
|
+
web_dynpro: {
|
|
114
|
+
application: (oModel.getProperty("/config/web_dynpro/application") || "").trim(),
|
|
115
|
+
configuration: (oModel.getProperty("/config/web_dynpro/configuration") || "").trim()
|
|
116
|
+
},
|
|
117
|
+
target_system_alias: (oModel.getProperty("/config/target_system_alias") || "").trim(),
|
|
118
|
+
display_info_text: (oModel.getProperty("/config/display_info_text") || "").trim(),
|
|
119
|
+
form_factors: oFormFactor, // retrieve a structure describing form factor's mode (from application or admin selection) + form
|
|
120
|
+
// factors values.
|
|
121
|
+
mapping_signature: sMappingSignature,
|
|
122
|
+
signature: oMappingSignature
|
|
123
|
+
};
|
|
124
|
+
// use bag in order to store translatable properties
|
|
125
|
+
const tilePropertiesBag = oTileApi.bag.getBag("tileProperties");
|
|
126
|
+
tilePropertiesBag.setText("display_title_text", configToSave.display_title_text);
|
|
127
|
+
|
|
128
|
+
// use configuration contract to write parameter values
|
|
129
|
+
oTileApi.writeConfiguration.setParameterValues({
|
|
130
|
+
tileConfiguration: JSON.stringify(configToSave)
|
|
131
|
+
},
|
|
132
|
+
// success handler
|
|
133
|
+
() => {
|
|
134
|
+
const oConfigurationConfig = tileUtils.getActionConfiguration(oTileApi, false);
|
|
135
|
+
const oTileConfig = tileUtils.getActionConfiguration(oTileApi, true);
|
|
136
|
+
// switching the model under the tile -> keep the tile model
|
|
137
|
+
oModel = new JSONModel({
|
|
138
|
+
config: oConfigurationConfig,
|
|
139
|
+
tileModel: oTileModel
|
|
140
|
+
});
|
|
141
|
+
oConfigurationView.setModel(oModel);
|
|
142
|
+
// update model (no merge)
|
|
143
|
+
oTileModel.setData({
|
|
144
|
+
config: oTileConfig,
|
|
145
|
+
displayText: fnFormatDisplayText(oTileConfig.semantic_object, oTileConfig.semantic_action)
|
|
146
|
+
}, false);
|
|
147
|
+
// Added for new LPD_CUST implementation
|
|
148
|
+
tilePropertiesBag.save(
|
|
149
|
+
// success handler
|
|
150
|
+
() => {
|
|
151
|
+
Log.debug("property bag 'tileProperties' saved successfully");
|
|
152
|
+
oSaveDeferred.resolve();
|
|
153
|
+
// fnFailure
|
|
154
|
+
}, (mErrorMessages, mErrorInfo) => {
|
|
155
|
+
const sFirstFailedBag = Object.keys(mErrorMessages)[0];
|
|
156
|
+
|
|
157
|
+
const oError = new LaunchpadError(`Bag save failed: ${mErrorMessages[sFirstFailedBag]}`, {
|
|
158
|
+
info: mErrorInfo[sFirstFailedBag],
|
|
159
|
+
otherMessages: mErrorMessages,
|
|
160
|
+
otherInfo: mErrorInfo
|
|
161
|
+
});
|
|
162
|
+
Log.error("property bag 'tileProperties' save failed", oError, "sap.ushell_abap.components.tiles.action.ActionTile.controller");
|
|
163
|
+
oSaveDeferred.reject(oError);
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
}, (sErrorMessage) => { // error handler
|
|
167
|
+
Log.error(`property bag 'tileProperties' save failed: ${sErrorMessage}`, null, "sap.ushell_abap.components.tiles.action.ActionTile.controller");
|
|
168
|
+
oSaveDeferred.reject(new Error(sErrorMessage));
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
return oSaveDeferred.promise;
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
// configuration cancel handler
|
|
175
|
+
onCancelConfiguration: function (oConfigurationView) {
|
|
176
|
+
// reload old configuration and display
|
|
177
|
+
const oViewData = oConfigurationView.getViewData();
|
|
178
|
+
const oModel = oConfigurationView.getModel();
|
|
179
|
+
// tile model placed into configuration model by getConfigurationUi
|
|
180
|
+
const oTileModel = oModel.getProperty("/tileModel");
|
|
181
|
+
const oTileApi = oViewData.chip;
|
|
182
|
+
const oCurrentConfig = tileUtils.getActionConfiguration(oTileApi, false);
|
|
183
|
+
oConfigurationView.getModel().setData({
|
|
184
|
+
config: oCurrentConfig,
|
|
185
|
+
tileModel: oTileModel
|
|
186
|
+
}, false);
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<View
|
|
2
|
+
xmlns="sap.ui.core.mvc"
|
|
3
|
+
xmlns:ushell="sap.ushell.ui.tile"
|
|
4
|
+
controllerName="sap.ushell_abap.components.tiles.action.ActionTile"
|
|
5
|
+
height="100%"
|
|
6
|
+
width="100%">
|
|
7
|
+
<ushell:TileBase
|
|
8
|
+
id="actionTile"
|
|
9
|
+
title="{i18n>tile.display.action_chip}"
|
|
10
|
+
subtitle="{/displayText}"
|
|
11
|
+
icon="sap-icon://action"
|
|
12
|
+
press="onPress" />
|
|
13
|
+
</View>
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
// Copyright (c) 2009-2026 SAP SE, All Rights Reserved
|
|
2
|
+
|
|
3
|
+
sap.ui.define([
|
|
4
|
+
"sap/ui/core/Element",
|
|
5
|
+
"sap/ui/core/mvc/Controller",
|
|
6
|
+
"sap/ushell/components/tiles/utils",
|
|
7
|
+
"sap/ui/core/library",
|
|
8
|
+
"sap/m/MessageBox"
|
|
9
|
+
], (Element, Controller, tileUtils, coreLibrary, MessageBox) => {
|
|
10
|
+
"use strict";
|
|
11
|
+
|
|
12
|
+
// shortcut for sap.ui.core.ValueState
|
|
13
|
+
const ValueState = coreLibrary.ValueState;
|
|
14
|
+
|
|
15
|
+
return Controller.extend("sap.ushell_abap.components.tiles.action.Configuration", {
|
|
16
|
+
sEnterValuePlaceHolder: "",
|
|
17
|
+
sDuplicateErrorMsg: "",
|
|
18
|
+
sDuplicateErrorTitle: "",
|
|
19
|
+
sInvalidParmMsg: "",
|
|
20
|
+
|
|
21
|
+
aDefaultObjects: [
|
|
22
|
+
{
|
|
23
|
+
obj: "",
|
|
24
|
+
name: ""
|
|
25
|
+
}, {
|
|
26
|
+
obj: "*",
|
|
27
|
+
name: "*"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
|
|
31
|
+
onConfigurationInputChange: function (oControlEvent) {
|
|
32
|
+
tileUtils.checkTMInput(this.getView(), oControlEvent);
|
|
33
|
+
},
|
|
34
|
+
onInit: function () {
|
|
35
|
+
const oView = this.getView();
|
|
36
|
+
const oSemanticObjectSelector = oView.byId("semantic_objectInput");
|
|
37
|
+
const oRoleSelector = oView.byId("navigation_provider_roleInput");
|
|
38
|
+
const oInstanceSelector = oView.byId("navigation_provider_instanceInput");
|
|
39
|
+
const oAliasSelector = oView.byId("target_application_aliasInput");
|
|
40
|
+
const oActionSelector = oView.byId("semantic_actionInput");
|
|
41
|
+
const oTargetTypeSelector = oView.byId("targetTypeInput");
|
|
42
|
+
const oResourceModel = tileUtils.getResourceBundleModel();
|
|
43
|
+
|
|
44
|
+
oView.setModel(oResourceModel, "i18n");
|
|
45
|
+
oView.setViewName("sap.ushell.components.tiles.action.Configuration");
|
|
46
|
+
// initialize semantic object input field
|
|
47
|
+
tileUtils.createSemanticObjectModel(this, oSemanticObjectSelector, this.aDefaultObjects);
|
|
48
|
+
tileUtils.createRoleModel(this, oRoleSelector, oInstanceSelector);
|
|
49
|
+
tileUtils.createAliasModel(this, oAliasSelector);
|
|
50
|
+
tileUtils.createActionModel(this, oActionSelector);
|
|
51
|
+
tileUtils.createNavigationProviderModel(this, oTargetTypeSelector);
|
|
52
|
+
// make sure that the chose object is written back to the configuration
|
|
53
|
+
oSemanticObjectSelector.attachChange((oControlEvent) => {
|
|
54
|
+
const sValue = oControlEvent.getSource().getValue();
|
|
55
|
+
oView.getModel().setProperty("/config/semantic_object", sValue);
|
|
56
|
+
});
|
|
57
|
+
oRoleSelector.attachChange((oControlEvent) => {
|
|
58
|
+
const sValue = oControlEvent.getSource().getValue();
|
|
59
|
+
oView.getModel().setProperty("/config/navigation_provider_role", sValue);
|
|
60
|
+
tileUtils.updateAliasModel(oView, oAliasSelector);
|
|
61
|
+
});
|
|
62
|
+
oInstanceSelector.attachChange((oControlEvent) => {
|
|
63
|
+
const sValue = oControlEvent.getSource().getValue();
|
|
64
|
+
oView.getModel().setProperty("/config/navigation_provider_instance", sValue);
|
|
65
|
+
});
|
|
66
|
+
oAliasSelector.attachChange((oControlEvent) => {
|
|
67
|
+
const sValue = oControlEvent.getSource().getValue();
|
|
68
|
+
oView.getModel().setProperty("/config/target_application_alias", sValue);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const oBundle = tileUtils.getResourceBundle();
|
|
72
|
+
this.sEnterValuePlaceHolder = oBundle.getText("configuration.signature.table.valueFieldLbl");
|
|
73
|
+
this.sDuplicateErrorMsg = oBundle.getText("configuration.signature.uniqueParamMessage.text");
|
|
74
|
+
this.sDuplicateErrorTitle = oBundle.getText("configuration.signature.uniqueParamMessage.title");
|
|
75
|
+
this.sInvalidParmMsg = oBundle.getText("configuration.signature.invalidParamMessage.text");
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
// This function applies table logic for the mapping signature structure according to the Mandatory check-box:
|
|
79
|
+
// if mandatory is unselected: Value and isRegularExpression fields should be disabled and vice versa...
|
|
80
|
+
handleMandatoryChange: function (oMandatoryCheckBox) {
|
|
81
|
+
const sId = oMandatoryCheckBox.getParameter("id");
|
|
82
|
+
const aParentCells = Element.getElementById(sId).getParent().getCells();
|
|
83
|
+
|
|
84
|
+
const bIsMandatory = oMandatoryCheckBox.getParameter("selected");
|
|
85
|
+
|
|
86
|
+
if (bIsMandatory) {
|
|
87
|
+
aParentCells[2].setEnabled(true); // Value field
|
|
88
|
+
aParentCells[2].setPlaceholder(this.sEnterValuePlaceHolder);
|
|
89
|
+
aParentCells[4].setEnabled(false); // DefaultValue field
|
|
90
|
+
aParentCells[4].setValue("");
|
|
91
|
+
aParentCells[4].setPlaceholder("");
|
|
92
|
+
aParentCells[3].setEnabled(true); // IsRegularExpression check-box field
|
|
93
|
+
} else {
|
|
94
|
+
aParentCells[2].setEnabled(false); // Value field
|
|
95
|
+
aParentCells[2].setValue("");
|
|
96
|
+
aParentCells[2].setPlaceholder(""); // Were requested that a disabled text field will not show the Enter Value
|
|
97
|
+
aParentCells[4].setEnabled(true); // DefaultValue field
|
|
98
|
+
aParentCells[4].setPlaceholder(this.sEnterValuePlaceHolder);
|
|
99
|
+
aParentCells[3].setEnabled(false); // IsRegularExpression check-box field
|
|
100
|
+
aParentCells[3].setSelected(false);
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
addRow: function () {
|
|
105
|
+
const oView = this.getView();
|
|
106
|
+
const oModel = oView.getModel();
|
|
107
|
+
const rows = oModel.getProperty("/config/rows");
|
|
108
|
+
|
|
109
|
+
// Init a row template for adding new empty row to the params table (mapping signature)
|
|
110
|
+
const newParamRow = tileUtils.getEmptyRowObj();
|
|
111
|
+
rows.push(newParamRow);
|
|
112
|
+
oModel.setProperty("/config/rows", rows);
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
deleteRow: function () {
|
|
116
|
+
const oView = this.getView();
|
|
117
|
+
const oModel = oView.getModel();
|
|
118
|
+
const rows = oModel.getProperty("/config/rows");
|
|
119
|
+
|
|
120
|
+
const table = oView.byId("mappingSignatureTable");
|
|
121
|
+
const aSelectedItemsIndexes = table.getSelectedIndices();
|
|
122
|
+
const aSortedDescending = aSelectedItemsIndexes.sort((a, b) => {
|
|
123
|
+
return b - a;
|
|
124
|
+
}).slice();
|
|
125
|
+
|
|
126
|
+
for (let i = 0; i < aSortedDescending.length; i++) {
|
|
127
|
+
table.removeSelectionInterval(aSortedDescending[i], aSortedDescending[i]);// Make sure to turn off the selection or it will pass to
|
|
128
|
+
// the next row.
|
|
129
|
+
rows.splice(aSortedDescending[i], 1); // There is a major assumption here that the index in the model is identical to the index in
|
|
130
|
+
// the table !!!
|
|
131
|
+
}
|
|
132
|
+
oModel.setProperty("/config/rows", rows);
|
|
133
|
+
},
|
|
134
|
+
// Will be called on change event of the name column in Parameters table.
|
|
135
|
+
// 2 parameters cannot have the same name. (in case the user decide to ignore the error message, there is a second validation on the save)
|
|
136
|
+
checkDuplicateNames: function (changeEvent) {
|
|
137
|
+
const oModel = this.getView().getModel();
|
|
138
|
+
const rows = oModel.getProperty("/config/rows");
|
|
139
|
+
const nameCol = Element.getElementById(changeEvent.getParameter("id"));
|
|
140
|
+
const sNewValue = changeEvent.getParameter("newValue");
|
|
141
|
+
|
|
142
|
+
if (sNewValue !== "" && !(/^[\w-/]+$/.test(sNewValue))) {
|
|
143
|
+
nameCol.setValueState(ValueState.Error); MessageBox.alert(this.sInvalidParmMsg, this.focusNameField.bind(nameCol), this.sDuplicateErrorTitle);
|
|
144
|
+
}
|
|
145
|
+
if (tileUtils.tableHasDuplicateParameterNames(rows)) {
|
|
146
|
+
nameCol.setValueState(ValueState.Error); MessageBox.alert(this.sDuplicateErrorMsg, this.focusNameField.bind(nameCol), this.sDuplicateErrorTitle);
|
|
147
|
+
} else {
|
|
148
|
+
nameCol.setValueState(ValueState.None);
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
// a callback function for the duplicate error MessageBox
|
|
152
|
+
focusNameField: function () {
|
|
153
|
+
this.focus();
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
// forward value helper request to utils
|
|
157
|
+
onValueHelpRequest: function (oEvent) {
|
|
158
|
+
// Third parameter is to differentiate whether it's Tile Actions icon field or general icon field. If it's true, then it's tile actions
|
|
159
|
+
// icon field, else general icon field.
|
|
160
|
+
tileUtils.objectSelectOnValueHelpRequest(this, oEvent, false);
|
|
161
|
+
},
|
|
162
|
+
onActionValueHelpRequest: function (oEvent) {
|
|
163
|
+
tileUtils.actionSelectOnValueHelpRequest(this, oEvent);
|
|
164
|
+
},
|
|
165
|
+
onRoleValueHelpRequest: function (oEvent) {
|
|
166
|
+
tileUtils.roleSelectOnValueHelpRequest(this, oEvent);
|
|
167
|
+
},
|
|
168
|
+
onInstanceValueHelpRequest: function (oEvent) {
|
|
169
|
+
tileUtils.instanceSelectOnValueHelpRequest(this, oEvent);
|
|
170
|
+
},
|
|
171
|
+
instanceSuggest: function (oEvent) {
|
|
172
|
+
tileUtils.instanceSuggest(this, oEvent);
|
|
173
|
+
},
|
|
174
|
+
aliasSuggest: function (oEvent) {
|
|
175
|
+
tileUtils.aliasSuggest(this, oEvent);
|
|
176
|
+
},
|
|
177
|
+
onAliasValueHelpRequest: function (oEvent) {
|
|
178
|
+
tileUtils.applicationAliasSelectOnValueHelpRequest(this, oEvent);
|
|
179
|
+
},
|
|
180
|
+
onFormFactorChange: function () {
|
|
181
|
+
const oModel = this.getView().getModel();
|
|
182
|
+
oModel.setProperty("/config/formFactorConfigDefault", false);
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
// Will be called on change event of the application type radio buttons.
|
|
186
|
+
onApplicationTypeChange: function (oEvent) {
|
|
187
|
+
const oParameter = oEvent.getParameters();
|
|
188
|
+
if (oParameter.selectedItem) {
|
|
189
|
+
tileUtils.displayApplicationTypeFields(oParameter.selectedItem.getKey(), this.getView());
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
});
|