@sapui5/sap.ushell_abap 1.94.1 → 1.97.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/ui2/srvc/ODataWrapper.js +1 -1
- package/src/main/js/sap/ushell_abap/.library +4 -9
- package/src/main/js/sap/ushell_abap/adapters/abap/AdapterContainer.js +12 -5
- package/src/main/js/sap/ushell_abap/adapters/abap/AppStateAdapter.js +11 -7
- package/src/main/js/sap/ushell_abap/adapters/abap/ClientSideTargetResolutionAdapter.js +47 -32
- package/src/main/js/sap/ushell_abap/adapters/abap/ConfigurationDefaultsAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/ContainerAdapter.js +46 -38
- package/src/main/js/sap/ushell_abap/adapters/abap/LaunchPageAdapter.js +574 -454
- package/src/main/js/sap/ushell_abap/adapters/abap/NavTargetResolutionAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/PageBuildingAdapter.js +25 -15
- package/src/main/js/sap/ushell_abap/adapters/abap/PagePersistenceAdapter.js +3 -2
- package/src/main/js/sap/ushell_abap/adapters/abap/PersonalizationAdapter.js +16 -7
- package/src/main/js/sap/ushell_abap/adapters/abap/SearchAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/SupportTicketAdapter.js +8 -8
- 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 -4
- package/src/main/js/sap/ushell_abap/adapters/hana/ContainerAdapter.js +9 -3
- package/src/main/js/sap/ushell_abap/bootstrap/evo/XhrLogonEventHandler.js +13 -11
- package/src/main/js/sap/ushell_abap/bootstrap/evo/abap-def-dev.js +1 -1
- package/src/main/js/sap/ushell_abap/bootstrap/evo/abap-def.js +1 -1
- package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.bootstrap.utils.js +8 -4
- package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.configure.ushell.js +1 -1
- package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.constants.js +9 -0
- package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.get.server.config.Urls.js +12 -5
- package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.load.launchpad.js +21 -22
- package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.request.pageset.js +8 -2
- package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.request.server.config.js +6 -3
- package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.request.startup.js +10 -5
- package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.ui5.boot.handler.js +7 -4
- package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.xhr.handler.js +10 -3
- package/src/main/js/sap/ushell_abap/bootstrap/evo/boottask.js +21 -16
- package/src/main/js/sap/ushell_abap/library.js +2 -2
- package/src/main/js/sap/ushell_abap/pbServices/ui2/AllCatalogs.js +186 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/Bag.js +718 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/Catalog.js +930 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/Chip.js +1027 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/ChipDefinition.js +216 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/ChipInstance.js +951 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/Error.js +45 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/Factory.js +647 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/ODataService.js +251 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/ODataWrapper.js +1262 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/Page.js +920 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/PageBuildingService.js +1498 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/PageSet.js +466 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/RemoteCatalogService.js +52 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/Utils.js +767 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/chipdefinition.xsd +139 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/actions.js +244 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/bag.js +150 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/configuration.js +165 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/configurationUi.js +330 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/fullscreen.js +70 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/navigation.js +50 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/preview.js +289 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/refresh.js +43 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/search.js +115 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/types.js +9 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/url.js +105 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/visible.js +128 -0
- package/ui5.yaml +31 -0
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/Component.js +0 -426
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/css/style.css +0 -1
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n.properties +0 -56
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_ar.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_bg.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_ca.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_cs.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_cy.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_da.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_de.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_el.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_en.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_en_GB.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_en_US_sappsd.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_en_US_saprigi.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_en_US_saptrc.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_es.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_es_MX.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_et.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_fi.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_fr.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_fr_CA.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_hi.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_hr.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_hu.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_id.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_it.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_iw.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_ja.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_kk.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_ko.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_lt.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_lv.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_ms.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_nl.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_no.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_pl.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_pt.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_pt_PT.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_ro.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_ru.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_sh.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_sk.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_sl.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_sv.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_th.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_tr.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_uk.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_vi.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_zh_CN.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/i18n/i18n_zh_TW.properties +0 -36
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/manifest.json +0 -153
- package/src/main/js/sap/ushell_abap/plugins/fcc-transport-ui/model/models.js +0 -14
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
// Copyright (c) 2009-2021 SAP SE. All rights reserved.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @fileOverview The <code>configuration</code> contract.
|
|
5
|
+
*/
|
|
6
|
+
sap.ui.define([
|
|
7
|
+
"sap/ushell_abap/pbServices/ui2/Chip",
|
|
8
|
+
"sap/ushell_abap/pbServices/ui2/Error",
|
|
9
|
+
"sap/ushell_abap/pbServices/ui2/Utils"
|
|
10
|
+
], function (
|
|
11
|
+
Chip,
|
|
12
|
+
SrvcError,
|
|
13
|
+
Utils
|
|
14
|
+
) {
|
|
15
|
+
"use strict";
|
|
16
|
+
|
|
17
|
+
if (typeof jQuery === "function" && jQuery.sap) {
|
|
18
|
+
jQuery.sap.declare("sap.ui2.srvc.contracts.configuration");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @namespace The namespace for the CHIP API's <code>configuration</code> contract, which allows
|
|
23
|
+
* you to read configuration parameters.
|
|
24
|
+
* @name chip.configuration
|
|
25
|
+
* @since 1.2.0
|
|
26
|
+
*/
|
|
27
|
+
Chip.addContract("configuration", function (oChipInstance) {
|
|
28
|
+
var fnUpdatedHandler;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Returns the value of the configuration parameter with the given name as a
|
|
32
|
+
* string.
|
|
33
|
+
*
|
|
34
|
+
* Note: Use <code>JSON.parse(sParameterValue)</code> for values which represent
|
|
35
|
+
* objects or arrays, use <code>parseInt(sParameterValue, 10)<code> for values
|
|
36
|
+
* which represent integers, etc.
|
|
37
|
+
*
|
|
38
|
+
* @name chip.configuration.getParameterValueAsString
|
|
39
|
+
* @function
|
|
40
|
+
* @since 1.2.0
|
|
41
|
+
* @param {string} sParameterName
|
|
42
|
+
* the parameter's name
|
|
43
|
+
* @returns {string}
|
|
44
|
+
* the parameter's value
|
|
45
|
+
*/
|
|
46
|
+
this.getParameterValueAsString = function (sParameterName) {
|
|
47
|
+
return oChipInstance.getConfigurationParameter(sParameterName);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Usually the Page Builder does not know about the internals of a CHIP, but there are special
|
|
52
|
+
* CHIPs (e.g. SAP Fiori Launchpad app launcher tiles, also serving as bookmark tiles) the
|
|
53
|
+
* Page Builder knows about the internals. In certain cases the Page Builder changes the configuration
|
|
54
|
+
* data of the CHIP and is able to notify the CHIP Instance what configuration properties have been updated,
|
|
55
|
+
* so the CHIP instance can update based on the new data.
|
|
56
|
+
*
|
|
57
|
+
* Note: The event must be explicitly triggered by the Page Builder. There is no automatic mechanism.
|
|
58
|
+
*
|
|
59
|
+
* @name chip.configuration.attachConfigurationUpdated
|
|
60
|
+
* @function
|
|
61
|
+
* @param {function(string[])} fnHandler
|
|
62
|
+
* Handler which is called if the Page Builder updates one or multiple configuration properties on
|
|
63
|
+
* the CHIP instance. fnHandler receives as first parameter an array containing keys of all first level
|
|
64
|
+
* configuration properties which have been updated.
|
|
65
|
+
* @since 1.46.0
|
|
66
|
+
* @private
|
|
67
|
+
* @see contract.configuration.fireConfigurationUpdated
|
|
68
|
+
*/
|
|
69
|
+
this.attachConfigurationUpdated = function (fnHandler) {
|
|
70
|
+
// Back channel for FLP bookmark tiles, as they are managed by the FLP Bookmark Service.
|
|
71
|
+
// The FLP directly changes the configuration data of the bookmark tile and can notify the bookmark
|
|
72
|
+
// tiles afterwards about the changes, so the bookmark tiles can update themselves with the new data.
|
|
73
|
+
if (typeof fnHandler !== "function") {
|
|
74
|
+
throw new SrvcError("The given handler is not a function",
|
|
75
|
+
"chip.configuration");
|
|
76
|
+
}
|
|
77
|
+
fnUpdatedHandler = fnHandler;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @namespace The namespace for the contract interface (to be used by a page builder) for
|
|
82
|
+
* the <code>configuration</code> contract.
|
|
83
|
+
* @name contract.configuration
|
|
84
|
+
* @private
|
|
85
|
+
*/
|
|
86
|
+
return { // contract - private as only used by Fiori Launchpad
|
|
87
|
+
/**
|
|
88
|
+
* Allows the page builder to inform the CHIP about changes of certain configuration properties.
|
|
89
|
+
* Note: Usually the page builder should not care about the content of the CHIP's configuration; however,
|
|
90
|
+
* for bookmark tiles in SAP Fiori Launchpad this is required as the SAP Fiori Launchpad manages them.
|
|
91
|
+
*
|
|
92
|
+
* @name contract.configuration.fireConfigurationUpdated
|
|
93
|
+
* @function
|
|
94
|
+
* @param {string[]} aUpdatedConfigKeys
|
|
95
|
+
* array of first-level configuration property keys which have been updated by the page builder
|
|
96
|
+
* @since 1.46.0
|
|
97
|
+
* @private
|
|
98
|
+
* @see chip.configuration.attachBagsUpdated
|
|
99
|
+
*/
|
|
100
|
+
fireConfigurationUpdated: function (aUpdatedConfigKeys) {
|
|
101
|
+
if (!Utils.isArray(aUpdatedConfigKeys) || aUpdatedConfigKeys.length < 1) {
|
|
102
|
+
throw new SrvcError("At least one configuration property key must be given",
|
|
103
|
+
"contract.configuration");
|
|
104
|
+
}
|
|
105
|
+
if (fnUpdatedHandler) {
|
|
106
|
+
fnUpdatedHandler(aUpdatedConfigKeys);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* @namespace The namespace for the CHIP API's <code>writeConfiguration</code> contract which
|
|
114
|
+
* allows you to write configuration parameters.
|
|
115
|
+
* @name chip.writeConfiguration
|
|
116
|
+
* @since 1.7.0
|
|
117
|
+
*/
|
|
118
|
+
Chip.addContract("writeConfiguration", function (oChipInstance) {
|
|
119
|
+
/**
|
|
120
|
+
* Sets the values of the given configuration parameters and persists the updated chip
|
|
121
|
+
* instance. All parameters that actually were defined in the CHIP definition XML are accepted.
|
|
122
|
+
* All others will raise a warning to the log.
|
|
123
|
+
* <p>
|
|
124
|
+
* The configuration is maintained as JSON string in a single property. This has the following
|
|
125
|
+
* consequences regarding the scopes:
|
|
126
|
+
* <ul>
|
|
127
|
+
* <li>If the CHIP instance has never been persisted in the current scope, the configuration is
|
|
128
|
+
* inherited from lower scopes. If there are no changes either, the properties have their
|
|
129
|
+
* default values from the CHIP definition.
|
|
130
|
+
* <li>When persisting the CHIP instance in a given scope for the first time (may it be due to
|
|
131
|
+
* configuration changes or title changes...), the configuration changes are merged with
|
|
132
|
+
* inherited changes from lower scopes and persisted in the current scope. Subsequent changes
|
|
133
|
+
* in lower scopes will then remain invisible.
|
|
134
|
+
* <li>A property for which never an update was supplied has the default value from the CHIP
|
|
135
|
+
* definition. This also applies if you delete the update again by setting it to
|
|
136
|
+
* <code>undefined</code>.
|
|
137
|
+
* </ul>
|
|
138
|
+
* <b>Example:</b><br>
|
|
139
|
+
* The CHIP has two properties: <code>a</code> with default value "foo" and <code>b</code> with
|
|
140
|
+
* default value "bar". The administrator changes <code>a</code> to "baz" in scope CUST. Later
|
|
141
|
+
* a user changes <code>b</code> in PERS. Then the administrator decides to change
|
|
142
|
+
* <code>a</code> back to "foo", but our user will never see this again, because the system
|
|
143
|
+
* persisted both <code>a</code> and <code>b</code> in PERS.
|
|
144
|
+
*
|
|
145
|
+
* @name chip.writeConfiguration.setParameterValues
|
|
146
|
+
* @function
|
|
147
|
+
* @since 1.7.0
|
|
148
|
+
* @param {map<String,String>} mConfigurationUpdates
|
|
149
|
+
* The configuration updates. The values must be strings. You can however set a value to
|
|
150
|
+
* <code>undefined</code>. This removes it from the list of updated properties and effectively
|
|
151
|
+
* resets it to the default value.
|
|
152
|
+
* @param {function ()} [fnSuccess]
|
|
153
|
+
* no-args success handler
|
|
154
|
+
* @param {function (string, object=)} [fnFailure]
|
|
155
|
+
* error handler taking an error message and, since version 1.28.6, an
|
|
156
|
+
* optional object containing the complete error information as delivered
|
|
157
|
+
* by the ODataService. See fnFailure parameter of {@link sap.ushell_abap.pbServices.ui2.ODataWrapper#onError}
|
|
158
|
+
* for more details.
|
|
159
|
+
* The default error handler is provided by the page builder
|
|
160
|
+
*/
|
|
161
|
+
this.setParameterValues = function (mConfigurationUpdates, fnSuccess, fnFailure) {
|
|
162
|
+
oChipInstance.updateConfiguration(mConfigurationUpdates, fnSuccess, fnFailure);
|
|
163
|
+
};
|
|
164
|
+
});
|
|
165
|
+
});
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
// Copyright (c) 2009-2021 SAP SE. All rights reserved.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @fileOverview The <code>configurationUi</code> contract.
|
|
5
|
+
*/
|
|
6
|
+
sap.ui.define([
|
|
7
|
+
"sap/ushell_abap/pbServices/ui2/Chip",
|
|
8
|
+
"sap/ushell_abap/pbServices/ui2/Error"
|
|
9
|
+
], function (
|
|
10
|
+
Chip,
|
|
11
|
+
SrvcError
|
|
12
|
+
) {
|
|
13
|
+
"use strict";
|
|
14
|
+
|
|
15
|
+
if (typeof jQuery === "function" && jQuery.sap) {
|
|
16
|
+
jQuery.sap.declare("sap.ui2.srvc.contracts.configurationUi");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @namespace The namespace for the CHIP API's <code>configurationUi</code> contract, which
|
|
21
|
+
* allows you to provide a CHIP-specific configuration UI with all related functionality.
|
|
22
|
+
* @name chip.configurationUi
|
|
23
|
+
* @since 1.11.0
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
Chip.addContract("configurationUi", function (oChipInstance) {
|
|
27
|
+
var fnCancelHandler,
|
|
28
|
+
fnDisplayHandler,
|
|
29
|
+
fnDirtyProvider,
|
|
30
|
+
bEnabled = false,
|
|
31
|
+
fnSaveHandler,
|
|
32
|
+
fnUiProvider;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Attaches the given event handler to the "cancel" event which is fired whenever the user
|
|
36
|
+
* chooses to cancel configuration. You can inform the user about unsaved changes by
|
|
37
|
+
* setting a "dirty" provider.
|
|
38
|
+
*
|
|
39
|
+
* Use <code>Function.prototype.bind()</code> to determine the event handler's
|
|
40
|
+
* <code>this</code> or some of its arguments.
|
|
41
|
+
*
|
|
42
|
+
* Note: Without such an event handler, it will not be possible to cancel the configuration UI
|
|
43
|
+
* for this CHIP.
|
|
44
|
+
*
|
|
45
|
+
* @name chip.configurationUi.attachCancel
|
|
46
|
+
* @function
|
|
47
|
+
* @since 1.11.0
|
|
48
|
+
* @param {function} fnEventHandler
|
|
49
|
+
* event handler for canceling configuration
|
|
50
|
+
*
|
|
51
|
+
* @see chip.configurationUi.attachSave
|
|
52
|
+
* @see chip.configurationUi.setDirtyProvider
|
|
53
|
+
*/
|
|
54
|
+
this.attachCancel = function (fnEventHandler) {
|
|
55
|
+
if (typeof fnEventHandler !== "function") {
|
|
56
|
+
throw new SrvcError("Cancel event handler is not a function",
|
|
57
|
+
"chip.configurationUi");
|
|
58
|
+
}
|
|
59
|
+
fnCancelHandler = fnEventHandler;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Attaches the given event handler to the "save" event which is fired whenever the user
|
|
64
|
+
* chooses to save the current configuration. The event handler should return a
|
|
65
|
+
* <code>jQuery.Deferred</code> object's promise to inform the caller whether the save
|
|
66
|
+
* operation has been successful or not. In the latter case an error message is provided.
|
|
67
|
+
*
|
|
68
|
+
* Use <code>Function.prototype.bind()</code> to determine the event handler's
|
|
69
|
+
* <code>this</code> or some of its arguments.
|
|
70
|
+
*
|
|
71
|
+
* Note: Without such an event handler, it will not be possible to save configurations for this
|
|
72
|
+
* CHIP.
|
|
73
|
+
*
|
|
74
|
+
* @name chip.configurationUi.attachSave
|
|
75
|
+
* @function
|
|
76
|
+
* @since 1.11.0
|
|
77
|
+
* @param {function} fnEventHandler
|
|
78
|
+
* event handler for saving the current configuration; returns a <code>jQuery.Deferred</code>
|
|
79
|
+
* object's promise
|
|
80
|
+
*
|
|
81
|
+
* @see chip.configurationUi.attachCancel
|
|
82
|
+
*/
|
|
83
|
+
this.attachSave = function (fnEventHandler) {
|
|
84
|
+
if (typeof fnEventHandler !== "function") {
|
|
85
|
+
throw new SrvcError("Save event handler is not a function",
|
|
86
|
+
"chip.configurationUi");
|
|
87
|
+
}
|
|
88
|
+
fnSaveHandler = fnEventHandler;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Inform the embedding application that the user has triggered configuration of this CHIP.
|
|
93
|
+
* The embedding application will get this CHIP's configuration UI from the callback determined
|
|
94
|
+
* via <code>chip.configurationUi.setUiProvider()</code> and display it with
|
|
95
|
+
* additional "save" and "cancel" buttons. If these are pressed, the CHIP instance is informed
|
|
96
|
+
* via the corresponding "save" and "cancel" events.
|
|
97
|
+
*
|
|
98
|
+
* @name chip.configurationUi.display
|
|
99
|
+
* @function
|
|
100
|
+
* @since 1.11.0
|
|
101
|
+
*
|
|
102
|
+
* @see chip.configurationUi.attachCancel
|
|
103
|
+
* @see chip.configurationUi.attachSave
|
|
104
|
+
* @see chip.configurationUi.setUiProvider
|
|
105
|
+
*/
|
|
106
|
+
this.display = function () {
|
|
107
|
+
if (fnDisplayHandler) {
|
|
108
|
+
fnDisplayHandler();
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Tells whether configuration of CHIPs is enabled. Note that this value is constant throughout
|
|
114
|
+
* a CHIP's lifetime. If configuration is enabled, CHIPs should provide a way for the user to
|
|
115
|
+
* trigger configuration and should not display live data (as administrators will not have the
|
|
116
|
+
* corresponding permissions). This trigger should then inform the embedding application to
|
|
117
|
+
* display the configuration UI.
|
|
118
|
+
*
|
|
119
|
+
* @name chip.configurationUi.isEnabled
|
|
120
|
+
* @function
|
|
121
|
+
* @since 1.11.0
|
|
122
|
+
* @returns {boolean}
|
|
123
|
+
* whether configuration is enabled
|
|
124
|
+
*
|
|
125
|
+
* @see chip.configurationUi.display
|
|
126
|
+
*/
|
|
127
|
+
this.isEnabled = function () {
|
|
128
|
+
return bEnabled;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Tells whether this CHIP is readOnly.
|
|
133
|
+
* Before calling this method please ensure that it is available.
|
|
134
|
+
* (Extension of an already existing contract)
|
|
135
|
+
*
|
|
136
|
+
* @name chip.configurationUi.isReadOnly
|
|
137
|
+
* @function
|
|
138
|
+
* @returns {boolean}
|
|
139
|
+
* whether this CHIP instance is readOnly
|
|
140
|
+
* @since 1.32.0
|
|
141
|
+
*/
|
|
142
|
+
this.isReadOnly = function () {
|
|
143
|
+
return oChipInstance.isReadOnly();
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Determines the callback function which provides the configuration UI's "dirty" state for
|
|
148
|
+
* this CHIP. The callback has to return a <code>boolean</code> value telling whether this
|
|
149
|
+
* CHIP's configuration UI is currently in a "dirty" state, i.e. contains unsaved changes.
|
|
150
|
+
*
|
|
151
|
+
* An embedding application calls this function each time the user wants to cancel the CHIP's
|
|
152
|
+
* configuration UI. A confirmation dialog will be presented to the user in case the UI is
|
|
153
|
+
* "dirty".
|
|
154
|
+
*
|
|
155
|
+
* Use <code>Function.prototype.bind()</code> to determine the callback's <code>this</code> or
|
|
156
|
+
* some of its arguments.
|
|
157
|
+
*
|
|
158
|
+
* Note: Without such a callback, it will not be possible to inform the user about unsaved
|
|
159
|
+
* changes.
|
|
160
|
+
*
|
|
161
|
+
* @name chip.configurationUi.setDirtyProvider
|
|
162
|
+
* @function
|
|
163
|
+
* @since 1.11.0
|
|
164
|
+
* @param {function} fnProvider
|
|
165
|
+
* a callback which returns a <code>boolean</code> value telling whether this CHIP's
|
|
166
|
+
* configuration UI is currently in a "dirty" state
|
|
167
|
+
*
|
|
168
|
+
* @see chip.configurationUi.attachCancel
|
|
169
|
+
*/
|
|
170
|
+
this.setDirtyProvider = function (fnProvider) {
|
|
171
|
+
fnDirtyProvider = fnProvider;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
/* eslint-disable valid-jsdoc*/ // < > are confusing eslint
|
|
175
|
+
/**
|
|
176
|
+
* Determines the callback function which provides the configuration UI for this CHIP. The
|
|
177
|
+
* callback has to return an SAPUI5 control (<code>sap.ui.core.Control</code>), which, for
|
|
178
|
+
* example, can be a view or a component wrapped into a
|
|
179
|
+
* <code>sap.ui.core.ComponentContainer</code>.
|
|
180
|
+
*
|
|
181
|
+
* An embedding application calls this function each time it wants to display the CHIP's
|
|
182
|
+
* configuration UI. Once the user chooses to save or cancel the configuration, the UI will be
|
|
183
|
+
* removed from the embedding application's UI, but not destroyed! Use the event handlers for
|
|
184
|
+
* the corresponding "save" and "cancel" events to clean up the UI as necessary (e.g. destroy
|
|
185
|
+
* it).
|
|
186
|
+
*
|
|
187
|
+
* Use <code>Function.prototype.bind()</code> to determine the callback's <code>this</code> or
|
|
188
|
+
* some of its arguments.
|
|
189
|
+
*
|
|
190
|
+
* Note: Without such a callback, it will not be possible to configure this CHIP.
|
|
191
|
+
*
|
|
192
|
+
* @name chip.configurationUi.setUiProvider
|
|
193
|
+
* @function
|
|
194
|
+
* @since 1.11.0
|
|
195
|
+
* @param {function (Object<string,string>)} fnProvider
|
|
196
|
+
* a callback which returns an SAPUI5 control (<code>sap.ui.core.Control</code>)
|
|
197
|
+
* representing this CHIP's configuration UI.
|
|
198
|
+
* Since 1.21.0 an optional parameter map can be passed to the UI provider. This map can be
|
|
199
|
+
* used for example to pass default configuration values to the UI.
|
|
200
|
+
*
|
|
201
|
+
* @see chip.configurationUi.attachCancel
|
|
202
|
+
* @see chip.configurationUi.attachSave
|
|
203
|
+
*/
|
|
204
|
+
this.setUiProvider = function (fnProvider) {
|
|
205
|
+
fnUiProvider = fnProvider;
|
|
206
|
+
};
|
|
207
|
+
/* eslint-enable valid-jsdoc*/
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* @namespace The namespace for the contract interface (to be used by a page builder) for
|
|
211
|
+
* the <code>configurationUi</code> contract, which allows you to use a CHIP-specific
|
|
212
|
+
* configuration UI with all related functionality.
|
|
213
|
+
* @name contract.configurationUi
|
|
214
|
+
* @since 1.11.0
|
|
215
|
+
*/
|
|
216
|
+
return {
|
|
217
|
+
/**
|
|
218
|
+
* Attaches the given event handler to the "display" event which is fired by the
|
|
219
|
+
* CHIP instance whenever the user has triggered configuration of this CHIP.
|
|
220
|
+
*
|
|
221
|
+
* @param {function} fnEventHandler
|
|
222
|
+
* the event handler for the "display" event
|
|
223
|
+
*
|
|
224
|
+
* @name contract.configurationUi.attachDisplay
|
|
225
|
+
* @function
|
|
226
|
+
* @since 1.11.0
|
|
227
|
+
*
|
|
228
|
+
* @see chip.configurationUi.display
|
|
229
|
+
*/
|
|
230
|
+
attachDisplay: function (fnEventHandler) {
|
|
231
|
+
if (typeof fnEventHandler !== "function") {
|
|
232
|
+
throw new SrvcError("Display event handler is not a function",
|
|
233
|
+
"ChipInstance");
|
|
234
|
+
}
|
|
235
|
+
fnDisplayHandler = fnEventHandler;
|
|
236
|
+
},
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Fires the "cancel" event on this CHIP instance's configuration UI.
|
|
240
|
+
*
|
|
241
|
+
* @name contract.configurationUi.fireCancel
|
|
242
|
+
* @function
|
|
243
|
+
* @since 1.11.0
|
|
244
|
+
*
|
|
245
|
+
* @see chip.configurationUi.attachCancel
|
|
246
|
+
*/
|
|
247
|
+
fireCancel: function () {
|
|
248
|
+
if (fnCancelHandler) {
|
|
249
|
+
fnCancelHandler();
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Fires the "save" event on this CHIP instance's configuration UI.
|
|
255
|
+
*
|
|
256
|
+
* @returns {object}
|
|
257
|
+
* a <code>jQuery.Deferred</code> object's promise as returned by the "save" event handler
|
|
258
|
+
*
|
|
259
|
+
* @name contract.configurationUi.fireSave
|
|
260
|
+
* @function
|
|
261
|
+
* @since 1.11.0
|
|
262
|
+
*
|
|
263
|
+
* @see chip.configurationUi.attachSave
|
|
264
|
+
*/
|
|
265
|
+
fireSave: function () {
|
|
266
|
+
return fnSaveHandler ? fnSaveHandler() : undefined;
|
|
267
|
+
},
|
|
268
|
+
|
|
269
|
+
/* eslint-disable valid-jsdoc*/ // < > are confusing eslint
|
|
270
|
+
/**
|
|
271
|
+
* Returns this CHIP's configuration UI, if available.
|
|
272
|
+
*
|
|
273
|
+
* @param {Object<string,string>} [mParameters]
|
|
274
|
+
* Since 1.21.0 an optional parameter map can be passed to the UI provider. This map can be
|
|
275
|
+
* used for example to pass default configuration values to the UI.
|
|
276
|
+
*
|
|
277
|
+
* @returns {sap.ui.core.Control}
|
|
278
|
+
* this CHIP's configuration UI or <code>undefined</code>
|
|
279
|
+
*
|
|
280
|
+
* @name contract.configurationUi.getUi
|
|
281
|
+
* @function
|
|
282
|
+
* @since 1.11.0
|
|
283
|
+
*
|
|
284
|
+
* @see chip.configurationUi.setUiProvider
|
|
285
|
+
*/
|
|
286
|
+
getUi: function (mParameters) {
|
|
287
|
+
return fnUiProvider ? fnUiProvider(mParameters) : undefined;
|
|
288
|
+
},
|
|
289
|
+
/* eslint-enable valid-jsdoc*/
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Tells whether this CHIP's configuration UI is currently in a "dirty" state (contains
|
|
293
|
+
* unsaved changes).
|
|
294
|
+
*
|
|
295
|
+
* @returns {boolean}
|
|
296
|
+
* whether this CHIP's configuration UI is currently in a "dirty" state; returns
|
|
297
|
+
* <code>undefined</code> in case the CHIP instance has not set a corresponding provider
|
|
298
|
+
* function
|
|
299
|
+
*
|
|
300
|
+
* @name contract.configurationUi.isDirty
|
|
301
|
+
* @function
|
|
302
|
+
* @since 1.11.0
|
|
303
|
+
*
|
|
304
|
+
* @see chip.configurationUi.setDirtyProvider
|
|
305
|
+
*/
|
|
306
|
+
isDirty: function () {
|
|
307
|
+
return fnDirtyProvider ? fnDirtyProvider() : undefined;
|
|
308
|
+
},
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Determines whether this CHIP instance's configuration UI is enabled by the page builder.
|
|
312
|
+
* <b>Note:</b> Changing this setting after <code>getImplementationAsSapui5()</code> has been
|
|
313
|
+
* called violates the contract of <code>chip.configurationUi.isEnabled()</code>!
|
|
314
|
+
*
|
|
315
|
+
* @param {boolean} bNewEnabled
|
|
316
|
+
* whether this CHIP instance's configuration UI is enabled by the page builder
|
|
317
|
+
*
|
|
318
|
+
* @name contract.configurationUi.setEnabled
|
|
319
|
+
* @function
|
|
320
|
+
* @since 1.11.0
|
|
321
|
+
*
|
|
322
|
+
* @see sap.ushell_abap.pbServices.ui2.ChipInstance#getImplementationAsSapui5()
|
|
323
|
+
* @see chip.configurationUi.isEnabled
|
|
324
|
+
*/
|
|
325
|
+
setEnabled: function (bNewEnabled) {
|
|
326
|
+
bEnabled = bNewEnabled;
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
});
|
|
330
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// Copyright (c) 2009-2021 SAP SE. All rights reserved.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @fileOverview The <code>fullscreen</code> contract.
|
|
5
|
+
*/
|
|
6
|
+
sap.ui.define([
|
|
7
|
+
"sap/ushell_abap/pbServices/ui2/Chip"
|
|
8
|
+
], function (
|
|
9
|
+
Chip
|
|
10
|
+
) {
|
|
11
|
+
"use strict";
|
|
12
|
+
|
|
13
|
+
if (typeof jQuery === "function" && jQuery.sap) {
|
|
14
|
+
jQuery.sap.declare("sap.ui2.srvc.contracts.fullscreen");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @namespace The namespace for the CHIP API's <code>fullscreen</code> contract, which allows you
|
|
19
|
+
* to deal with toggling of fullscreen mode.
|
|
20
|
+
* @name chip.fullscreen
|
|
21
|
+
* @since 1.2.0
|
|
22
|
+
*/
|
|
23
|
+
Chip.addContract("fullscreen", function (oChipInstance) {
|
|
24
|
+
/**
|
|
25
|
+
* Tells whether fullscreen mode is currently turned on.
|
|
26
|
+
*
|
|
27
|
+
* @name chip.fullscreen.getFullscreen
|
|
28
|
+
* @function
|
|
29
|
+
* @since 1.2.0
|
|
30
|
+
* @returns {boolean}
|
|
31
|
+
* whether fullscreen mode is turned on
|
|
32
|
+
*/
|
|
33
|
+
this.getFullscreen = function () {
|
|
34
|
+
return oChipInstance.getFullscreen();
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Turns fullscreen mode on as specified.
|
|
39
|
+
*
|
|
40
|
+
* @name chip.fullscreen.setFullscreen
|
|
41
|
+
* @function
|
|
42
|
+
* @since 1.2.0
|
|
43
|
+
* @param {boolean} bOn
|
|
44
|
+
* whether fullscreen mode is turned on
|
|
45
|
+
*/
|
|
46
|
+
this.setFullscreen = function (bOn) {
|
|
47
|
+
oChipInstance.setFullscreen(bOn);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Attaches the given event handler to the "fullscreen" event which is fired
|
|
52
|
+
* whenever fullscreen mode is toggled.
|
|
53
|
+
*
|
|
54
|
+
* Use <code>Function.prototype.bind()</code> to determine the event handler's
|
|
55
|
+
* <code>this</code> or some of its arguments.
|
|
56
|
+
*
|
|
57
|
+
* Note: Without such an event handler, the CHIP will simply continue to display the
|
|
58
|
+
* same content, no matter whether fullscreen mode is on or off.
|
|
59
|
+
*
|
|
60
|
+
* @name chip.fullscreen.attachFullscreen
|
|
61
|
+
* @function
|
|
62
|
+
* @since 1.2.0
|
|
63
|
+
* @param {function} fnEventHandler
|
|
64
|
+
* the event handler for the "fullscreen" event
|
|
65
|
+
*/
|
|
66
|
+
this.attachFullscreen = function (fnEventHandler) {
|
|
67
|
+
oChipInstance.attachFullscreen(fnEventHandler);
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Copyright (c) 2009-2021 SAP SE. All rights reserved.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @fileOverview The <code>navigation</code> contract.
|
|
5
|
+
*/
|
|
6
|
+
sap.ui.require([
|
|
7
|
+
"sap/ushell_abap/pbServices/ui2/Chip"
|
|
8
|
+
], function (
|
|
9
|
+
Chip
|
|
10
|
+
) {
|
|
11
|
+
"use strict";
|
|
12
|
+
|
|
13
|
+
if (typeof jQuery === "function" && jQuery.sap) {
|
|
14
|
+
jQuery.sap.declare("sap.ui2.srvc.contracts.navigation");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
var oNavigationHandle;
|
|
18
|
+
if (typeof sap.ui2.shell === "object"
|
|
19
|
+
&& typeof sap.ui2.shell.getNavigationHandle === "function") {
|
|
20
|
+
oNavigationHandle = sap.ui2.shell.getNavigationHandle();
|
|
21
|
+
if (typeof oNavigationHandle === "object"
|
|
22
|
+
&& typeof oNavigationHandle.navigateToUrl === "function") {
|
|
23
|
+
/**
|
|
24
|
+
* @namespace The namespace for the CHIP API's <code>navigation</code> contract, which allows
|
|
25
|
+
* you to navigate to a launchpad URL in a surrounding shell.
|
|
26
|
+
* @name chip.navigation
|
|
27
|
+
* @since 1.2.0
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
Chip.addContract("navigation", function (oChipInstance) {
|
|
31
|
+
/**
|
|
32
|
+
* Navigates to the given URL using the optional settings.
|
|
33
|
+
*
|
|
34
|
+
* @name chip.navigation.navigateToUrl
|
|
35
|
+
* @function
|
|
36
|
+
* @since 1.2.0
|
|
37
|
+
* @param {string} sUrl
|
|
38
|
+
* the URL to navigate to
|
|
39
|
+
* @param {object} [oSettings]
|
|
40
|
+
* the settings
|
|
41
|
+
*
|
|
42
|
+
* @see <code>sap.ui2.shell.getNavigationHandle().navigateToUrl()<code>
|
|
43
|
+
*/
|
|
44
|
+
this.navigateToUrl = function (sUrl, oSettings) {
|
|
45
|
+
oNavigationHandle.navigateToUrl.apply(oNavigationHandle, arguments);
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|