@openui5/sap.ui.fl 1.94.0 → 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/.reuse/dep5 +12 -12
- package/THIRDPARTY.txt +21 -17
- package/package.json +3 -3
- package/src/sap/ui/fl/.library +1 -1
- package/src/sap/ui/fl/Cache.js +1 -1
- package/src/sap/ui/fl/Change.js +18 -14
- package/src/sap/ui/fl/ChangePersistence.js +98 -86
- package/src/sap/ui/fl/ChangePersistenceFactory.js +1 -1
- package/src/sap/ui/fl/EventHistory.js +1 -1
- package/src/sap/ui/fl/FakeLrepConnectorLocalStorage.js +1 -1
- package/src/sap/ui/fl/FakeLrepConnectorSessionStorage.js +1 -1
- package/src/sap/ui/fl/FakeLrepLocalStorage.js +1 -1
- package/src/sap/ui/fl/FlexController.js +28 -22
- package/src/sap/ui/fl/FlexControllerFactory.js +17 -6
- package/src/sap/ui/fl/LayerUtils.js +34 -22
- package/src/sap/ui/fl/PreprocessorImpl.js +1 -1
- package/src/sap/ui/fl/RegistrationDelegator.js +1 -1
- package/src/sap/ui/fl/Utils.js +61 -41
- package/src/sap/ui/fl/Variant.js +2 -11
- package/src/sap/ui/fl/XmlPreprocessorImpl.js +10 -11
- package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +1 -1
- package/src/sap/ui/fl/apply/_internal/appVariant/DescriptorChangeTypes.js +2 -1
- package/src/sap/ui/fl/apply/_internal/changes/Applier.js +33 -11
- package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/Utils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Applier.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +3 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddAnnotationsToOData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeDataSource.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetTitle.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetAbstract.js +52 -0
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/AddNewCard.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/ChangeCard.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddLibrary.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetFlexExtensionPointEnabled.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetMinUI5Version.js +1 -1
- package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageUtils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/controlVariants/URLHandler.js +299 -288
- package/src/sap/ui/fl/apply/_internal/controlVariants/Utils.js +39 -9
- package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +10 -8
- package/src/sap/ui/fl/apply/_internal/flexObjects/States.js +14 -0
- package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +103 -33
- package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +45 -4
- package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +5 -1
- package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/appDescriptorChanges/prepareAppDescriptorMap.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/prepareCompVariantsMap.js +7 -7
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +2 -4
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +25 -38
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/prepareVariantsMap.js +1 -1
- package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +86 -6
- package/src/sap/ui/fl/apply/api/FlexRuntimeInfoAPI.js +83 -14
- package/src/sap/ui/fl/changeHandler/AddIFrame.js +1 -1
- package/src/sap/ui/fl/changeHandler/AddXML.js +1 -1
- package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +1 -1
- package/src/sap/ui/fl/changeHandler/Base.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseAddXml.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseRename.js +1 -1
- package/src/sap/ui/fl/changeHandler/HideControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/MoveControls.js +1 -1
- package/src/sap/ui/fl/changeHandler/MoveElements.js +1 -1
- package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +1 -1
- package/src/sap/ui/fl/changeHandler/PropertyChange.js +1 -1
- package/src/sap/ui/fl/changeHandler/StashControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UnhideControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UnstashControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +6 -2
- package/src/sap/ui/fl/codeExt/CodeExtManager.js +16 -10
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +4 -4
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js +18 -1
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorVariantFactory.js +1 -1
- package/src/sap/ui/fl/designtime/util/IFrame.designtime.js +12 -8
- package/src/sap/ui/fl/designtime/variants/VariantManagement.designtime.js +10 -4
- package/src/sap/ui/fl/initial/_internal/Storage.js +1 -1
- package/src/sap/ui/fl/initial/_internal/StorageUtils.js +1 -1
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeRegistryItem.js +1 -1
- package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +1 -3
- package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +1 -1
- package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +1 -1
- package/src/sap/ui/fl/interfaces/Delegate.js +1 -1
- package/src/sap/ui/fl/library.js +9 -9
- package/src/sap/ui/fl/library.support.js +56 -46
- package/src/sap/ui/fl/messagebundle.properties +30 -2
- package/src/sap/ui/fl/messagebundle_ar.properties +21 -2
- package/src/sap/ui/fl/messagebundle_bg.properties +21 -2
- package/src/sap/ui/fl/messagebundle_ca.properties +21 -2
- package/src/sap/ui/fl/messagebundle_cs.properties +21 -2
- package/src/sap/ui/fl/messagebundle_cy.properties +21 -2
- package/src/sap/ui/fl/messagebundle_da.properties +21 -2
- package/src/sap/ui/fl/messagebundle_de.properties +21 -2
- package/src/sap/ui/fl/messagebundle_el.properties +21 -2
- package/src/sap/ui/fl/messagebundle_en.properties +21 -2
- package/src/sap/ui/fl/messagebundle_en_GB.properties +21 -2
- package/src/sap/ui/fl/messagebundle_en_US_sappsd.properties +21 -2
- package/src/sap/ui/fl/messagebundle_en_US_saptrc.properties +21 -2
- package/src/sap/ui/fl/messagebundle_es.properties +21 -2
- package/src/sap/ui/fl/messagebundle_es_MX.properties +21 -2
- package/src/sap/ui/fl/messagebundle_et.properties +21 -2
- package/src/sap/ui/fl/messagebundle_fi.properties +21 -2
- package/src/sap/ui/fl/messagebundle_fr.properties +21 -2
- package/src/sap/ui/fl/messagebundle_fr_CA.properties +21 -2
- package/src/sap/ui/fl/messagebundle_hi.properties +21 -2
- package/src/sap/ui/fl/messagebundle_hr.properties +21 -2
- package/src/sap/ui/fl/messagebundle_hu.properties +21 -2
- package/src/sap/ui/fl/messagebundle_id.properties +21 -2
- package/src/sap/ui/fl/messagebundle_it.properties +22 -3
- package/src/sap/ui/fl/messagebundle_iw.properties +21 -2
- package/src/sap/ui/fl/messagebundle_ja.properties +21 -2
- package/src/sap/ui/fl/messagebundle_kk.properties +21 -2
- package/src/sap/ui/fl/messagebundle_ko.properties +21 -2
- package/src/sap/ui/fl/messagebundle_lt.properties +21 -2
- package/src/sap/ui/fl/messagebundle_lv.properties +21 -2
- package/src/sap/ui/fl/messagebundle_ms.properties +21 -2
- package/src/sap/ui/fl/messagebundle_nl.properties +21 -2
- package/src/sap/ui/fl/messagebundle_no.properties +21 -2
- package/src/sap/ui/fl/messagebundle_pl.properties +21 -2
- package/src/sap/ui/fl/messagebundle_pt.properties +21 -2
- package/src/sap/ui/fl/messagebundle_pt_PT.properties +21 -2
- package/src/sap/ui/fl/messagebundle_ro.properties +21 -2
- package/src/sap/ui/fl/messagebundle_ru.properties +21 -2
- package/src/sap/ui/fl/messagebundle_sh.properties +21 -2
- package/src/sap/ui/fl/messagebundle_sk.properties +21 -2
- package/src/sap/ui/fl/messagebundle_sl.properties +21 -2
- package/src/sap/ui/fl/messagebundle_sv.properties +21 -2
- package/src/sap/ui/fl/messagebundle_th.properties +19 -0
- package/src/sap/ui/fl/messagebundle_tr.properties +21 -2
- package/src/sap/ui/fl/messagebundle_uk.properties +21 -2
- package/src/sap/ui/fl/messagebundle_vi.properties +21 -2
- package/src/sap/ui/fl/messagebundle_zh_CN.properties +21 -2
- package/src/sap/ui/fl/messagebundle_zh_TW.properties +21 -2
- package/src/sap/ui/fl/registry/Settings.js +71 -38
- package/src/sap/ui/fl/support/Flexibility.js +83 -72
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +12 -12
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +8 -8
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +9 -9
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +3 -3
- package/src/sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector.js +51 -52
- package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +129 -125
- package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +1 -1
- package/src/sap/ui/fl/support/apps/uiFlexibilityDiagnostics/controller/Root.controller.js +0 -2
- package/src/sap/ui/fl/support/diagnostics/Flexibility.controller.js +1 -1
- package/src/sap/ui/fl/themes/base/VariantManagement.less +9 -37
- package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
- package/src/sap/ui/fl/util/DescriptorChangeCheck.js +2 -4
- package/src/sap/ui/fl/util/IFrame.js +10 -3
- package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
- package/src/sap/ui/fl/util/getContainerUserInfo.js +32 -28
- package/src/sap/ui/fl/util/resolveBinding.js +1 -1
- package/src/sap/ui/fl/variants/VariantManagement.js +279 -30
- package/src/sap/ui/fl/variants/VariantModel.js +178 -73
- package/src/sap/ui/fl/variants/context/controller/ContextVisibility.controller.js +12 -2
- package/src/sap/ui/fl/write/_internal/Storage.js +7 -5
- package/src/sap/ui/fl/write/_internal/StorageFeaturesMerger.js +1 -1
- package/src/sap/ui/fl/write/_internal/Versions.js +61 -54
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +1 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +1 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChange.js +1 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory.js +20 -1
- package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +25 -3
- package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +2 -2
- package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +23 -23
- package/src/sap/ui/fl/write/_internal/connectors/LocalStorageConnector.js +2 -1
- package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +3 -3
- package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/Utils.js +1 -1
- package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +1 -1
- package/src/sap/ui/fl/write/_internal/extensionPoint/Registry.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPAccess.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariant.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariantFactory.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/MultiTenantABAPExtensibilityVariant.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ServiceValidation.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/SingleTenantABAPExtensibilityVariant.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/UriParser.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/Utils.js +5 -17
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/CAPAccess.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.fragment.xml +1 -0
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.js +48 -19
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/getEditorConfig.js +60 -22
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.fragment.xml +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +15 -22
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/validators/IsRequired.js +20 -0
- package/src/sap/ui/fl/write/_internal/flexState/FlexObjectState.js +15 -11
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +14 -13
- package/src/sap/ui/fl/write/_internal/transport/TransportDialog.js +5 -7
- package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +6 -5
- package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -2
- package/src/sap/ui/fl/write/api/ControlPersonalizationWriteAPI.js +117 -13
- package/src/sap/ui/fl/write/api/FeaturesAPI.js +1 -0
- package/src/sap/ui/fl/write/api/FieldExtensibility.js +28 -9
- package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +2 -1
- package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +20 -16
- package/src/sap/ui/fl/write/api/SmartVariantManagementWriteAPI.js +2 -0
- package/ui5.yaml +135 -1
- package/src/sap/ui/fl/ControlPersonalizationAPI.js +0 -477
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/annotationsEditor/AnnotationsEditor.js +0 -49
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/dateEditor/DateEditor.js +0 -43
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/dateTimeEditor/DateTimeEditor.js +0 -38
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/base/util/restricted/_omit",
|
|
9
|
+
"sap/base/util/restricted/_isEqual",
|
|
9
10
|
"sap/base/util/each",
|
|
10
11
|
"sap/base/util/includes",
|
|
11
12
|
"sap/base/util/isEmptyObject",
|
|
@@ -28,6 +29,7 @@ sap.ui.define([
|
|
|
28
29
|
"sap/ui/model/json/JSONModel"
|
|
29
30
|
], function(
|
|
30
31
|
_omit,
|
|
32
|
+
_isEqual,
|
|
31
33
|
each,
|
|
32
34
|
includes,
|
|
33
35
|
isEmptyObject,
|
|
@@ -51,6 +53,8 @@ sap.ui.define([
|
|
|
51
53
|
) {
|
|
52
54
|
"use strict";
|
|
53
55
|
|
|
56
|
+
var _mUShellServices = {};
|
|
57
|
+
|
|
54
58
|
/**
|
|
55
59
|
* Handler for "select" event fired from a variant management control.
|
|
56
60
|
* Adds to the variant switch promise chain, resolving when new variant (if applicable) has been switched and all source variant dirty changes have been removed.
|
|
@@ -173,6 +177,7 @@ sap.ui.define([
|
|
|
173
177
|
*
|
|
174
178
|
* @param {function():Promise} fnCallback - Callback function returning a promise
|
|
175
179
|
* @param {sap.ui.fl.variants.VariantModel} oModel - Variant model
|
|
180
|
+
* @param {string} sVMReference - Variant Management reference
|
|
176
181
|
* @returns {Promise} Resolves when the variant model is not busy anymore
|
|
177
182
|
* @private
|
|
178
183
|
*/
|
|
@@ -192,6 +197,16 @@ sap.ui.define([
|
|
|
192
197
|
return oModel._oVariantSwitchPromise;
|
|
193
198
|
}
|
|
194
199
|
|
|
200
|
+
/**
|
|
201
|
+
* Saves the specified Unified Shell service on the model
|
|
202
|
+
*
|
|
203
|
+
* @param {string} sServiceName Name of the ushell service (e.g. "URLParsing")
|
|
204
|
+
* @param {sap.ui.core.service.Service} oService The service object
|
|
205
|
+
*/
|
|
206
|
+
function setUShellService(sServiceName, oService) {
|
|
207
|
+
_mUShellServices[sServiceName] = oService;
|
|
208
|
+
}
|
|
209
|
+
|
|
195
210
|
function revertVariantAndClearData(mPropertyBag) {
|
|
196
211
|
return Switcher.switchVariant(mPropertyBag)
|
|
197
212
|
.then(function() {
|
|
@@ -260,11 +275,11 @@ sap.ui.define([
|
|
|
260
275
|
* @class Variant model implementation for JSON format.
|
|
261
276
|
* @extends sap.ui.model.json.JSONModel
|
|
262
277
|
* @author SAP SE
|
|
263
|
-
* @version 1.
|
|
278
|
+
* @version 1.97.0
|
|
264
279
|
* @param {object} oData - Either the URL where to load the JSON from or a JS object
|
|
265
|
-
* @param {
|
|
266
|
-
* @param {sap.ui.
|
|
267
|
-
* @param {
|
|
280
|
+
* @param {object} mPropertyBag - Map of properties required for the constructor
|
|
281
|
+
* @param {sap.ui.fl.FlexController} mPropertyBag.flexController - <code>FlexController</code> instance for the component which uses the variant model
|
|
282
|
+
* @param {sap.ui.core.Component} mPropertyBag.appComponent - Application component instance that is currently loading
|
|
268
283
|
* @constructor
|
|
269
284
|
* @private
|
|
270
285
|
* @ui5-restricted
|
|
@@ -274,11 +289,10 @@ sap.ui.define([
|
|
|
274
289
|
*/
|
|
275
290
|
|
|
276
291
|
var VariantModel = JSONModel.extend("sap.ui.fl.variants.VariantModel", /** @lends sap.ui.fl.variants.VariantModel.prototype */ {
|
|
277
|
-
constructor: function(oData,
|
|
292
|
+
constructor: function(oData, mPropertyBag) {
|
|
278
293
|
// JSON model internal properties
|
|
279
294
|
this.pSequentialImportCompleted = Promise.resolve();
|
|
280
|
-
JSONModel.apply(this,
|
|
281
|
-
this.bObserve = bObserve;
|
|
295
|
+
JSONModel.apply(this, [oData]);
|
|
282
296
|
|
|
283
297
|
this.sharing = {
|
|
284
298
|
PRIVATE: "private",
|
|
@@ -289,10 +303,10 @@ sap.ui.define([
|
|
|
289
303
|
// which creates a ChangePersistence instance.
|
|
290
304
|
// After retrieving changes for the created ChangePersistence instance,
|
|
291
305
|
// FlexControllerFactory creates a VariantModel instance for this application component.
|
|
292
|
-
this.oFlexController =
|
|
306
|
+
this.oFlexController = mPropertyBag.flexController;
|
|
293
307
|
this.oChangePersistence = this.oFlexController._oChangePersistence;
|
|
294
308
|
this.sFlexReference = this.oChangePersistence.getComponentName();
|
|
295
|
-
this.oAppComponent =
|
|
309
|
+
this.oAppComponent = mPropertyBag.appComponent;
|
|
296
310
|
this._oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.fl");
|
|
297
311
|
this._oVariantSwitchPromise = Promise.resolve();
|
|
298
312
|
this._oVariantAppliedListeners = {};
|
|
@@ -322,6 +336,7 @@ sap.ui.define([
|
|
|
322
336
|
oVariant.originalFavorite = oVariant.favorite;
|
|
323
337
|
oVariant.originalExecuteOnSelect = oVariant.executeOnSelect;
|
|
324
338
|
oVariant.originalVisible = oVariant.visible;
|
|
339
|
+
oVariant.originalContexts = oVariant.contexts;
|
|
325
340
|
});
|
|
326
341
|
oData[sKey].originalCurrentVariant = oData[sKey].currentVariant;
|
|
327
342
|
oData[sKey].originalDefaultVariant = oData[sKey].defaultVariant;
|
|
@@ -329,12 +344,43 @@ sap.ui.define([
|
|
|
329
344
|
|
|
330
345
|
this.setData(oData);
|
|
331
346
|
}
|
|
332
|
-
|
|
333
|
-
//initialize hash data - variants map & model should exist at this point
|
|
334
|
-
URLHandler.initialize({model: this});
|
|
335
347
|
}
|
|
336
348
|
});
|
|
337
349
|
|
|
350
|
+
/**
|
|
351
|
+
* Gets the necessary UShell Services and initializes the URL Handler
|
|
352
|
+
* @returns {Promise} Promise resolving when the VariantModel is initialized
|
|
353
|
+
*/
|
|
354
|
+
VariantModel.prototype.initialize = function() {
|
|
355
|
+
return Promise.resolve()
|
|
356
|
+
.then(function() {
|
|
357
|
+
var oUShellContainer = Utils.getUshellContainer();
|
|
358
|
+
if (oUShellContainer) {
|
|
359
|
+
var aServicePromises = [
|
|
360
|
+
Utils.getUShellService("UserInfo"),
|
|
361
|
+
Utils.getUShellService("URLParsing"),
|
|
362
|
+
Utils.getUShellService("CrossApplicationNavigation"),
|
|
363
|
+
Utils.getUShellService("ShellNavigation")
|
|
364
|
+
];
|
|
365
|
+
return Promise.all(aServicePromises)
|
|
366
|
+
.then(function(aServices) {
|
|
367
|
+
setUShellService("UserInfo", aServices[0]);
|
|
368
|
+
setUShellService("URLParsing", aServices[1]);
|
|
369
|
+
setUShellService("CrossApplicationNavigation", aServices[2]);
|
|
370
|
+
setUShellService("ShellNavigation", aServices[3]);
|
|
371
|
+
})
|
|
372
|
+
.catch(function(vError) {
|
|
373
|
+
throw new Error("Error getting service from Unified Shell: " + vError);
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
return undefined;
|
|
377
|
+
})
|
|
378
|
+
.then(function() {
|
|
379
|
+
//initialize hash data - variants map & model should exist at this point (set on constructor)
|
|
380
|
+
URLHandler.initialize({ model: this });
|
|
381
|
+
}.bind(this));
|
|
382
|
+
};
|
|
383
|
+
|
|
338
384
|
/**
|
|
339
385
|
* Updates the storage of the current variant for a given variant management control.
|
|
340
386
|
* @param {object} mPropertyBag - Object with parameters as properties
|
|
@@ -606,6 +652,7 @@ sap.ui.define([
|
|
|
606
652
|
}
|
|
607
653
|
}.bind(this));
|
|
608
654
|
oDuplicateVariant.content.layer = mPropertyBag.layer;
|
|
655
|
+
oDuplicateVariant.content.contexts = mPropertyBag.contexts;
|
|
609
656
|
|
|
610
657
|
aVariantChanges = oDuplicateVariant.controlChanges.slice();
|
|
611
658
|
|
|
@@ -643,6 +690,7 @@ sap.ui.define([
|
|
|
643
690
|
* @param {String} mPropertyBag.newVariantReference - <code>variantReference</code> for the new variant
|
|
644
691
|
* @param {String} mPropertyBag.sourceVariantReference - <code>variantReference</code> of the source variant
|
|
645
692
|
* @param {String} mPropertyBag.generator - Information about who created the change
|
|
693
|
+
* @param {object} mPropertyBag.contexts - Context structure containing roles and countries
|
|
646
694
|
* @returns {Promise} Promise resolving to dirty changes created during variant copy
|
|
647
695
|
* @private
|
|
648
696
|
*/
|
|
@@ -663,7 +711,9 @@ sap.ui.define([
|
|
|
663
711
|
remove: true,
|
|
664
712
|
visible: true,
|
|
665
713
|
originalVisible: true,
|
|
666
|
-
sharing: mPropertyBag.layer === Layer.USER ? this.sharing.PRIVATE : this.sharing.PUBLIC
|
|
714
|
+
sharing: mPropertyBag.layer === Layer.USER ? this.sharing.PRIVATE : this.sharing.PUBLIC,
|
|
715
|
+
contexts: oDuplicateVariantData.content.contexts,
|
|
716
|
+
originalContexts: oDuplicateVariantData.originalContexts
|
|
667
717
|
};
|
|
668
718
|
|
|
669
719
|
var oVariant = VariantUtil.createVariant({
|
|
@@ -782,6 +832,16 @@ sap.ui.define([
|
|
|
782
832
|
};
|
|
783
833
|
aChanges.push(mPropertyBag);
|
|
784
834
|
}
|
|
835
|
+
if (!_isEqual(oVariant.originalContexts, oVariant.contexts)) {
|
|
836
|
+
mPropertyBag = {
|
|
837
|
+
variantReference: oVariant.key,
|
|
838
|
+
changeType: "setContexts",
|
|
839
|
+
layer: sLayer,
|
|
840
|
+
contexts: oVariant.contexts,
|
|
841
|
+
originalContexts: oVariant.originalContexts
|
|
842
|
+
};
|
|
843
|
+
aChanges.push(mPropertyBag);
|
|
844
|
+
}
|
|
785
845
|
});
|
|
786
846
|
if (oData.originalDefaultVariant !== oData.defaultVariant) {
|
|
787
847
|
mPropertyBag = {
|
|
@@ -804,10 +864,11 @@ sap.ui.define([
|
|
|
804
864
|
* @param {String} sVariantManagementReference - Variant management reference
|
|
805
865
|
* @param {String} sLayer - Current layer
|
|
806
866
|
* @param {String} sClass - Style class assigned to the management dialog
|
|
867
|
+
* @param {Promise<sap.ui.core.ComponentContainer>} oContextSharingComponentPromise - Promise resolving with the ComponentContainer
|
|
807
868
|
* @returns {Promise} Promise which resolves when "manage" event is fired from the variant management control
|
|
808
869
|
* @public
|
|
809
870
|
*/
|
|
810
|
-
VariantModel.prototype.manageVariants = function(oVariantManagementControl, sVariantManagementReference, sLayer, sClass) {
|
|
871
|
+
VariantModel.prototype.manageVariants = function(oVariantManagementControl, sVariantManagementReference, sLayer, sClass, oContextSharingComponentPromise) {
|
|
811
872
|
// called from the ControlVariant plugin in Adaptation mode
|
|
812
873
|
return new Promise(function(resolve) {
|
|
813
874
|
oVariantManagementControl.attachEventOnce("manage", {
|
|
@@ -815,13 +876,78 @@ sap.ui.define([
|
|
|
815
876
|
variantManagementReference: sVariantManagementReference,
|
|
816
877
|
layer: sLayer
|
|
817
878
|
}, this.fnManageClickRta, this);
|
|
818
|
-
oVariantManagementControl.openManagementDialog(true, sClass);
|
|
879
|
+
oVariantManagementControl.openManagementDialog(true, sClass, oContextSharingComponentPromise);
|
|
819
880
|
}.bind(this));
|
|
820
881
|
};
|
|
821
882
|
|
|
822
883
|
/**
|
|
823
|
-
* Sets the
|
|
824
|
-
*
|
|
884
|
+
* Sets the variant properties and adds a variant change
|
|
885
|
+
* @param {string} sVariantManagementReference - Variant management reference
|
|
886
|
+
* @param {object} mPropertyBag - Map of properties
|
|
887
|
+
* @returns {sap.fl.Change} Created Change object
|
|
888
|
+
*/
|
|
889
|
+
VariantModel.prototype.addVariantChange = function(sVariantManagementReference, mPropertyBag) {
|
|
890
|
+
var mAdditionalChangeContent = this.setVariantProperties(sVariantManagementReference, mPropertyBag);
|
|
891
|
+
|
|
892
|
+
var mNewChangeData = {};
|
|
893
|
+
var mUpdateVariantsStateParams = {
|
|
894
|
+
vmReference: sVariantManagementReference,
|
|
895
|
+
add: true,
|
|
896
|
+
reference: this.sFlexReference
|
|
897
|
+
};
|
|
898
|
+
|
|
899
|
+
//create new change object
|
|
900
|
+
mNewChangeData.changeType = mPropertyBag.changeType;
|
|
901
|
+
mNewChangeData.layer = mPropertyBag.layer;
|
|
902
|
+
mNewChangeData.generator = mPropertyBag.generator;
|
|
903
|
+
|
|
904
|
+
if (mPropertyBag.changeType === "setDefault") {
|
|
905
|
+
mNewChangeData.fileType = "ctrl_variant_management_change";
|
|
906
|
+
mNewChangeData.selector = JsControlTreeModifier.getSelector(sVariantManagementReference, mPropertyBag.appComponent);
|
|
907
|
+
} else {
|
|
908
|
+
if (mPropertyBag.changeType === "setTitle") {
|
|
909
|
+
BaseChangeHandler.setTextInChange(mNewChangeData, "title", mPropertyBag.title, "XFLD");
|
|
910
|
+
}
|
|
911
|
+
mNewChangeData.fileType = "ctrl_variant_change";
|
|
912
|
+
mNewChangeData.selector = JsControlTreeModifier.getSelector(mPropertyBag.variantReference, mPropertyBag.appComponent);
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
var oChange = this.oFlexController.createBaseChange(mNewChangeData, mPropertyBag.appComponent);
|
|
916
|
+
//update change with additional content
|
|
917
|
+
oChange.setContent(mAdditionalChangeContent);
|
|
918
|
+
|
|
919
|
+
mUpdateVariantsStateParams.changeContent = oChange.getDefinition();
|
|
920
|
+
//update variants state and write change to ChangePersistence
|
|
921
|
+
VariantManagementState.updateChangesForVariantManagementInMap(mUpdateVariantsStateParams);
|
|
922
|
+
this.oChangePersistence.addDirtyChange(oChange);
|
|
923
|
+
|
|
924
|
+
return oChange;
|
|
925
|
+
};
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* Sets the variant properties and deletes a variant change
|
|
929
|
+
* @param {string} sVariantManagementReference - Variant management reference
|
|
930
|
+
* @param {object} mPropertyBag - Property bag
|
|
931
|
+
* @param {sap.fl.Change} oChange - Variant change to be deleted
|
|
932
|
+
*/
|
|
933
|
+
VariantModel.prototype.deleteVariantChange = function(sVariantManagementReference, mPropertyBag, oChange) {
|
|
934
|
+
var mUpdateVariantsStateParams = {
|
|
935
|
+
vmReference: sVariantManagementReference,
|
|
936
|
+
add: false,
|
|
937
|
+
reference: this.sFlexReference,
|
|
938
|
+
changeContent: undefined
|
|
939
|
+
};
|
|
940
|
+
|
|
941
|
+
this.setVariantProperties(sVariantManagementReference, mPropertyBag, true);
|
|
942
|
+
mUpdateVariantsStateParams.changeContent = oChange.getDefinition();
|
|
943
|
+
//update variants state and write change to ChangePersistence
|
|
944
|
+
VariantManagementState.updateChangesForVariantManagementInMap(mUpdateVariantsStateParams);
|
|
945
|
+
this.oChangePersistence.deleteChange(oChange);
|
|
946
|
+
};
|
|
947
|
+
|
|
948
|
+
/**
|
|
949
|
+
* Sets the passed properties on a variant for the passed variant management reference and
|
|
950
|
+
* returns the content for change creation
|
|
825
951
|
* @param {sap.ui.fl.variants.VariantManagement} sVariantManagementReference - Variant management reference
|
|
826
952
|
* @param {Object} mPropertyBag - Map of properties
|
|
827
953
|
* @param {String} mPropertyBag.variantReference - Variant reference for which properties should be set
|
|
@@ -830,26 +956,24 @@ sap.ui.define([
|
|
|
830
956
|
* @param {String} mPropertyBag.appComponent - App component instance
|
|
831
957
|
* @param {String} [mPropertyBag.title] - New app title value for <code>setTitle</code> change type
|
|
832
958
|
* @param {boolean} [mPropertyBag.visible] - New visible value for <code>setVisible</code> change type
|
|
959
|
+
* @param {object} [mPropertyBag.contexts] - New contexts object (e.g. roles) for <code>setContexts</code> change type
|
|
833
960
|
* @param {boolean} [mPropertyBag.favorite] - New favorite value for <code>setFavorite</code> change type
|
|
834
961
|
* @param {boolean} [mPropertyBag.executeOnSelect] - New executeOnSelect value for <code>setExecuteOnSelect</code> change type
|
|
835
962
|
* @param {String} [mPropertyBag.defaultVariant] - New default variant for <code>setDefault</code> change type
|
|
836
|
-
* @param {
|
|
837
|
-
* @
|
|
838
|
-
* @returns {sap.ui.fl.Change | null} Created change object or <code>null</code> if no change is created
|
|
963
|
+
* @param {boolean} [bUpdateCurrentVariant] - Update current variant
|
|
964
|
+
* @returns {object} Additional content for change creation
|
|
839
965
|
* @public
|
|
840
966
|
*/
|
|
841
|
-
VariantModel.prototype.setVariantProperties = function(sVariantManagementReference, mPropertyBag,
|
|
967
|
+
VariantModel.prototype.setVariantProperties = function(sVariantManagementReference, mPropertyBag, bUpdateCurrentVariant) {
|
|
842
968
|
// TODO: this function needs refactoring
|
|
843
969
|
var iVariantIndex = -1;
|
|
844
970
|
var oVariant;
|
|
845
|
-
var oChange = null;
|
|
846
971
|
var oData = this.getData();
|
|
847
972
|
|
|
848
973
|
if (mPropertyBag.variantReference) {
|
|
849
974
|
iVariantIndex = this.getVariantManagementReference(mPropertyBag.variantReference).variantIndex;
|
|
850
975
|
oVariant = oData[sVariantManagementReference].variants[iVariantIndex];
|
|
851
976
|
}
|
|
852
|
-
var mNewChangeData = {};
|
|
853
977
|
var mAdditionalChangeContent = {};
|
|
854
978
|
|
|
855
979
|
switch (mPropertyBag.changeType) {
|
|
@@ -880,6 +1004,12 @@ sap.ui.define([
|
|
|
880
1004
|
oVariant.visible = mPropertyBag.visible;
|
|
881
1005
|
oVariant.originalVisible = oVariant.visible;
|
|
882
1006
|
break;
|
|
1007
|
+
case "setContexts":
|
|
1008
|
+
mAdditionalChangeContent.contexts = mPropertyBag.contexts;
|
|
1009
|
+
//Update Variant Model
|
|
1010
|
+
oVariant.contexts = mPropertyBag.contexts;
|
|
1011
|
+
oVariant.originalContexts = mPropertyBag.contexts;
|
|
1012
|
+
break;
|
|
883
1013
|
case "setDefault":
|
|
884
1014
|
mAdditionalChangeContent.defaultVariant = mPropertyBag.defaultVariant;
|
|
885
1015
|
//Update Variant Model
|
|
@@ -914,7 +1044,7 @@ sap.ui.define([
|
|
|
914
1044
|
}
|
|
915
1045
|
}
|
|
916
1046
|
|
|
917
|
-
if (
|
|
1047
|
+
if (bUpdateCurrentVariant && oData[sVariantManagementReference].currentVariant !== mPropertyBag.defaultVariant) {
|
|
918
1048
|
this.updateCurrentVariant({
|
|
919
1049
|
variantManagementReference: sVariantManagementReference,
|
|
920
1050
|
newVariantReference: mPropertyBag.defaultVariant,
|
|
@@ -943,49 +1073,11 @@ sap.ui.define([
|
|
|
943
1073
|
oVariantContent[sVariantManagementReference].defaultVariant = mPropertyBag.defaultVariant;
|
|
944
1074
|
}
|
|
945
1075
|
|
|
946
|
-
var mUpdateVariantsStateParams = {
|
|
947
|
-
vmReference: sVariantManagementReference,
|
|
948
|
-
add: bAddChange,
|
|
949
|
-
reference: this.sFlexReference
|
|
950
|
-
};
|
|
951
|
-
|
|
952
|
-
// add change
|
|
953
|
-
if (bAddChange === true) {
|
|
954
|
-
//create new change object
|
|
955
|
-
mNewChangeData.changeType = mPropertyBag.changeType;
|
|
956
|
-
mNewChangeData.layer = mPropertyBag.layer;
|
|
957
|
-
mNewChangeData.generator = mPropertyBag.generator;
|
|
958
|
-
|
|
959
|
-
if (mPropertyBag.changeType === "setDefault") {
|
|
960
|
-
mNewChangeData.fileType = "ctrl_variant_management_change";
|
|
961
|
-
mNewChangeData.selector = JsControlTreeModifier.getSelector(sVariantManagementReference, mPropertyBag.appComponent);
|
|
962
|
-
} else {
|
|
963
|
-
if (mPropertyBag.changeType === "setTitle") {
|
|
964
|
-
BaseChangeHandler.setTextInChange(mNewChangeData, "title", mPropertyBag.title, "XFLD");
|
|
965
|
-
}
|
|
966
|
-
mNewChangeData.fileType = "ctrl_variant_change";
|
|
967
|
-
mNewChangeData.selector = JsControlTreeModifier.getSelector(mPropertyBag.variantReference, mPropertyBag.appComponent);
|
|
968
|
-
}
|
|
969
|
-
|
|
970
|
-
oChange = this.oFlexController.createBaseChange(mNewChangeData, mPropertyBag.appComponent);
|
|
971
|
-
//update change with additional content
|
|
972
|
-
oChange.setContent(mAdditionalChangeContent);
|
|
973
|
-
|
|
974
|
-
mUpdateVariantsStateParams.changeContent = oChange.getDefinition();
|
|
975
|
-
//update variants state and write change to ChangePersistence
|
|
976
|
-
VariantManagementState.updateChangesForVariantManagementInMap(mUpdateVariantsStateParams);
|
|
977
|
-
this.oChangePersistence.addDirtyChange(oChange);
|
|
978
|
-
} else if (mPropertyBag.change) { // delete change
|
|
979
|
-
mUpdateVariantsStateParams.changeContent = mPropertyBag.change.getDefinition();
|
|
980
|
-
//update variants state and write change to ChangePersistence
|
|
981
|
-
VariantManagementState.updateChangesForVariantManagementInMap(mUpdateVariantsStateParams);
|
|
982
|
-
this.oChangePersistence.deleteChange(mPropertyBag.change);
|
|
983
|
-
}
|
|
984
1076
|
// set data to variant model
|
|
985
1077
|
this.setData(oData);
|
|
986
1078
|
this.checkUpdate(true);
|
|
987
1079
|
|
|
988
|
-
return
|
|
1080
|
+
return mAdditionalChangeContent;
|
|
989
1081
|
};
|
|
990
1082
|
|
|
991
1083
|
VariantModel.prototype._ensureStandardVariantExists = function(sVariantManagementReference) {
|
|
@@ -1013,6 +1105,8 @@ sap.ui.define([
|
|
|
1013
1105
|
originalExecuteOnSelect: false,
|
|
1014
1106
|
visible: true,
|
|
1015
1107
|
originalVisible: true,
|
|
1108
|
+
contexts: {},
|
|
1109
|
+
originalContexts: {},
|
|
1016
1110
|
author: VariantUtil.DEFAULT_AUTHOR
|
|
1017
1111
|
}
|
|
1018
1112
|
]
|
|
@@ -1039,7 +1133,8 @@ sap.ui.define([
|
|
|
1039
1133
|
favorite: true,
|
|
1040
1134
|
visible: true,
|
|
1041
1135
|
executeOnSelect: false
|
|
1042
|
-
}
|
|
1136
|
+
},
|
|
1137
|
+
contexts: {}
|
|
1043
1138
|
},
|
|
1044
1139
|
controlChanges: [],
|
|
1045
1140
|
variantChanges: {}
|
|
@@ -1050,7 +1145,7 @@ sap.ui.define([
|
|
|
1050
1145
|
// TODO: To be removed in a separate change
|
|
1051
1146
|
// try-catch added to prevent FlexState initialize checks, since many tests use fake components / fake responses
|
|
1052
1147
|
try {
|
|
1053
|
-
VariantManagementState.addFakeStandardVariant(this.sFlexReference, oStandardVariant);
|
|
1148
|
+
VariantManagementState.addFakeStandardVariant(this.sFlexReference, this.oAppComponent.getId(), oStandardVariant);
|
|
1054
1149
|
} catch (oError) {
|
|
1055
1150
|
Log.error("Variants Map was not found: " + oError.message);
|
|
1056
1151
|
}
|
|
@@ -1114,8 +1209,7 @@ sap.ui.define([
|
|
|
1114
1209
|
updatePersonalVariantPropertiesWithFlpSettings(oVariant);
|
|
1115
1210
|
break;
|
|
1116
1211
|
case Layer.PUBLIC:
|
|
1117
|
-
var
|
|
1118
|
-
var oUser = oUShellContainer && oUShellContainer.getUser();
|
|
1212
|
+
var oUser = this._oUserInfoService && this._oUserInfoService.getUser();
|
|
1119
1213
|
var bUserIsAuthorized = !oUser || oUser.getId().toUpperCase() === oVariant.author.toUpperCase() || Settings.getInstanceOrUndef().isKeyUser();
|
|
1120
1214
|
oVariant.remove = bUserIsAuthorized;
|
|
1121
1215
|
oVariant.rename = bUserIsAuthorized;
|
|
@@ -1152,7 +1246,7 @@ sap.ui.define([
|
|
|
1152
1246
|
var aChanges = [];
|
|
1153
1247
|
aConfigurationChangesContent.forEach(function(oChangeProperties) {
|
|
1154
1248
|
oChangeProperties.appComponent = this.oAppComponent;
|
|
1155
|
-
aChanges.push(this.
|
|
1249
|
+
aChanges.push(this.addVariantChange(oData.variantManagementReference, oChangeProperties));
|
|
1156
1250
|
}.bind(this));
|
|
1157
1251
|
this.oChangePersistence.saveDirtyChanges(this.oAppComponent, false, aChanges);
|
|
1158
1252
|
};
|
|
@@ -1215,6 +1309,7 @@ sap.ui.define([
|
|
|
1215
1309
|
appComponent: oAppComponent,
|
|
1216
1310
|
layer: sLayer,
|
|
1217
1311
|
title: mParameters.name,
|
|
1312
|
+
contexts: mParameters.contexts,
|
|
1218
1313
|
sourceVariantReference: sSourceVariantReference,
|
|
1219
1314
|
newVariantReference: sNewVariantReference,
|
|
1220
1315
|
generator: mParameters.generator
|
|
@@ -1231,7 +1326,7 @@ sap.ui.define([
|
|
|
1231
1326
|
layer: sLayer,
|
|
1232
1327
|
variantManagementReference: sVariantManagementReference
|
|
1233
1328
|
};
|
|
1234
|
-
var oSetDefaultChange = this.
|
|
1329
|
+
var oSetDefaultChange = this.addVariantChange(sVariantManagementReference, mPropertyBagSetDefault);
|
|
1235
1330
|
aCopiedVariantDirtyChanges.push(oSetDefaultChange);
|
|
1236
1331
|
}
|
|
1237
1332
|
if (bSetExecuteOnSelect) {
|
|
@@ -1243,7 +1338,7 @@ sap.ui.define([
|
|
|
1243
1338
|
layer: sLayer,
|
|
1244
1339
|
variantManagementReference: sVariantManagementReference
|
|
1245
1340
|
};
|
|
1246
|
-
var oSetExecuteChange = this.
|
|
1341
|
+
var oSetExecuteChange = this.addVariantChange(sVariantManagementReference, mPropertyBagSetExecute);
|
|
1247
1342
|
aCopiedVariantDirtyChanges.push(oSetExecuteChange);
|
|
1248
1343
|
}
|
|
1249
1344
|
aNewVariantDirtyChanges = aCopiedVariantDirtyChanges;
|
|
@@ -1450,11 +1545,11 @@ sap.ui.define([
|
|
|
1450
1545
|
}.bind(this));
|
|
1451
1546
|
return this._oVariantSwitchPromise
|
|
1452
1547
|
.then(function() {
|
|
1453
|
-
VariantManagementState.clearFakedStandardVariants(this.sFlexReference);
|
|
1454
|
-
VariantManagementState.resetContent(this.sFlexReference);
|
|
1548
|
+
VariantManagementState.clearFakedStandardVariants(this.sFlexReference, this.oAppComponent.getId());
|
|
1549
|
+
VariantManagementState.resetContent(this.sFlexReference, this.oAppComponent.getId());
|
|
1455
1550
|
//re-initialize hash data and remove existing parameters
|
|
1456
1551
|
if (!bSkipURLHandling) {
|
|
1457
|
-
URLHandler.initialize({model: this});
|
|
1552
|
+
URLHandler.initialize({ model: this });
|
|
1458
1553
|
URLHandler.update({
|
|
1459
1554
|
parameters: [],
|
|
1460
1555
|
updateHashEntry: true,
|
|
@@ -1464,5 +1559,15 @@ sap.ui.define([
|
|
|
1464
1559
|
}.bind(this));
|
|
1465
1560
|
};
|
|
1466
1561
|
|
|
1562
|
+
/**
|
|
1563
|
+
* Returns the Unified Shell service saved on the model, if available
|
|
1564
|
+
*
|
|
1565
|
+
* @param {string} sServiceName Name of the ushell service (e.g. "UserInfo")
|
|
1566
|
+
* @returns {sap.ui.core.service.Service} The service object
|
|
1567
|
+
*/
|
|
1568
|
+
VariantModel.prototype.getUShellService = function(sServiceName) {
|
|
1569
|
+
return Utils.getUshellContainer() && _mUShellServices[sServiceName];
|
|
1570
|
+
};
|
|
1571
|
+
|
|
1467
1572
|
return VariantModel;
|
|
1468
1573
|
});
|
|
@@ -11,8 +11,7 @@ sap.ui.define([
|
|
|
11
11
|
"sap/m/MessageStrip",
|
|
12
12
|
"sap/ui/core/MessageType",
|
|
13
13
|
"sap/base/util/restricted/_isEqual"
|
|
14
|
-
],
|
|
15
|
-
function (
|
|
14
|
+
], function (
|
|
16
15
|
Controller,
|
|
17
16
|
Fragment,
|
|
18
17
|
WriteStorage,
|
|
@@ -114,6 +113,7 @@ function (
|
|
|
114
113
|
|
|
115
114
|
/**
|
|
116
115
|
* If restricted radio button is selected, then it reveals the hidden selected contexts list.
|
|
116
|
+
* @param {sap.ui.base.Event} oEvent - Event object
|
|
117
117
|
*/
|
|
118
118
|
onSelectRestrictedRadioButton: function(oEvent) {
|
|
119
119
|
oEvent.getSource().setSelected(true);
|
|
@@ -129,6 +129,7 @@ function (
|
|
|
129
129
|
/**
|
|
130
130
|
* Checks if all data is loaded from back end.
|
|
131
131
|
* If not, it retrieves the next chunk from the back end and then updates the model.
|
|
132
|
+
* @returns {Promise} Resolves with additional data
|
|
132
133
|
*/
|
|
133
134
|
_appendDataFromBackend: function() {
|
|
134
135
|
var oRoles = this.oContextsModel.getProperty("/values");
|
|
@@ -143,6 +144,8 @@ function (
|
|
|
143
144
|
* Proxy handler that is called if <code>updateStarted</code> events are fired.
|
|
144
145
|
* Delegates to <code>_appendDataFromBackend</code> in case of a <code>Growing</code> event.
|
|
145
146
|
* <code>Growing</code> events are triggered if the user clicks on <code>More</code> or scrolls down in the <code>Select Contexts</code> list.
|
|
147
|
+
* @param {sap.ui.base.Event} oEvent - Event object
|
|
148
|
+
* @returns {Promise} Resolves with additional data
|
|
146
149
|
*/
|
|
147
150
|
_updateStartedHandler: function(oEvent) {
|
|
148
151
|
if (oEvent.getParameter && oEvent.getParameter("reason") === "Growing") {
|
|
@@ -153,6 +156,8 @@ function (
|
|
|
153
156
|
|
|
154
157
|
/**
|
|
155
158
|
* Retrieves contexts from the back end, then opens a new <code>Select Contexts</code> dialog.
|
|
159
|
+
* @param {object} oDialog - The Select Contexts dialog
|
|
160
|
+
* @returns {Promise} Resolves as soon as the dialog is opened
|
|
156
161
|
*/
|
|
157
162
|
_addContexts: function(oDialog) {
|
|
158
163
|
oDialog.clearSelection();
|
|
@@ -164,6 +169,7 @@ function (
|
|
|
164
169
|
|
|
165
170
|
/**
|
|
166
171
|
* Proxy handler method that calls <code>_addContext</code> if the <code>Select Contexts</code> dialog is not yet opened.
|
|
172
|
+
* @returns {Promise} Resolves as soon as the dialog is opened
|
|
167
173
|
*/
|
|
168
174
|
onAddContextsHandler: function() {
|
|
169
175
|
if (!this._oDialog) {
|
|
@@ -176,6 +182,8 @@ function (
|
|
|
176
182
|
|
|
177
183
|
/**
|
|
178
184
|
* Retrieves filtered data from the back end, then updates the model.
|
|
185
|
+
* @param {sap.ui.base.Event} oEvent - Event object
|
|
186
|
+
* @returns {Promise<object>} The data
|
|
179
187
|
*/
|
|
180
188
|
onSearch: function(oEvent) {
|
|
181
189
|
oEvent.getSource().clearSelection();
|
|
@@ -195,6 +203,7 @@ function (
|
|
|
195
203
|
|
|
196
204
|
/**
|
|
197
205
|
* Removes a single selected context.
|
|
206
|
+
* @param {sap.ui.base.Event} oEvent - Event object
|
|
198
207
|
*/
|
|
199
208
|
onDeleteContext: function(oEvent) {
|
|
200
209
|
var aItems = this.oSelectedContextsModel.getProperty("/selected");
|
|
@@ -217,6 +226,7 @@ function (
|
|
|
217
226
|
|
|
218
227
|
/**
|
|
219
228
|
* Shows or removes error message depending on the input.
|
|
229
|
+
* @param {boolean} bShowError - Whether the error should be shown on the UI
|
|
220
230
|
*/
|
|
221
231
|
showErrorMessage: function(bShowError) {
|
|
222
232
|
var sErrorMessageId = this.getView().getId() + "--noSelectedRolesError";
|
|
@@ -7,10 +7,12 @@
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/ui/fl/initial/_internal/StorageUtils",
|
|
9
9
|
"sap/ui/fl/write/_internal/StorageFeaturesMerger",
|
|
10
|
+
"sap/ui/fl/apply/_internal/flexObjects/States",
|
|
10
11
|
"sap/base/util/ObjectPath"
|
|
11
12
|
], function(
|
|
12
13
|
StorageUtils,
|
|
13
14
|
StorageFeaturesMerger,
|
|
15
|
+
States,
|
|
14
16
|
ObjectPath
|
|
15
17
|
) {
|
|
16
18
|
"use strict";
|
|
@@ -20,7 +22,7 @@ sap.ui.define([
|
|
|
20
22
|
*
|
|
21
23
|
* @namespace sap.ui.fl.write._internal.Storage
|
|
22
24
|
* @since 1.67
|
|
23
|
-
* @version 1.
|
|
25
|
+
* @version 1.97.0
|
|
24
26
|
* @private
|
|
25
27
|
* @ui5-restricted sap.ui.fl
|
|
26
28
|
*/
|
|
@@ -142,21 +144,21 @@ sap.ui.define([
|
|
|
142
144
|
if (oChange.condenserState) {
|
|
143
145
|
var bDifferentOrder = false;
|
|
144
146
|
if (oChange.condenserState === "delete") {
|
|
145
|
-
if (oChange.getState() ===
|
|
147
|
+
if (oChange.getState() === States.PERSISTED) {
|
|
146
148
|
mCondense.delete.change.push(oChange.getFileName());
|
|
147
149
|
}
|
|
148
150
|
iOffset++;
|
|
149
151
|
} else if (mPropertyBag.condensedChanges.length) {
|
|
150
152
|
bDifferentOrder = mPropertyBag.allChanges[index].getFileName() !== mPropertyBag.condensedChanges[index - iOffset].getFileName();
|
|
151
153
|
}
|
|
152
|
-
if (oChange.condenserState === "select" && bDifferentOrder && !bAlreadyReordered) {
|
|
154
|
+
if ((oChange.condenserState === "select" || oChange.condenserState === "update") && bDifferentOrder && !bAlreadyReordered) {
|
|
153
155
|
var aReorderedChanges = mPropertyBag.condensedChanges.slice(index - iOffset).map(function(oChange) {
|
|
154
156
|
return oChange.getFileName();
|
|
155
157
|
});
|
|
156
158
|
mCondense.reorder.change = aReorderedChanges;
|
|
157
159
|
bAlreadyReordered = true;
|
|
158
160
|
}
|
|
159
|
-
if (oChange.condenserState === "select" && oChange.
|
|
161
|
+
if (oChange.condenserState === "select" && oChange.getState() === States.NEW) {
|
|
160
162
|
mCondense.create.change[iChangeCreateIndex] = {};
|
|
161
163
|
mCondense.create.change[iChangeCreateIndex][oChange.getFileName()] = oChange.getDefinition();
|
|
162
164
|
} else if (oChange.condenserState === "update") {
|
|
@@ -168,7 +170,7 @@ sap.ui.define([
|
|
|
168
170
|
}
|
|
169
171
|
|
|
170
172
|
delete oChange.condenserState;
|
|
171
|
-
} else if (oChange.
|
|
173
|
+
} else if (oChange.getState() === States.NEW) {
|
|
172
174
|
mCondense.create[oChange.getFileType()][iChangeCreateIndex] = {};
|
|
173
175
|
mCondense.create[oChange.getFileType()][iChangeCreateIndex][oChange.getId()] = oChange.getDefinition();
|
|
174
176
|
}
|