@openui5/sap.ui.fl 1.93.3 → 1.96.2
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 +6 -11
- package/THIRDPARTY.txt +10 -16
- 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 +92 -82
- package/src/sap/ui/fl/ChangePersistenceFactory.js +1 -1
- package/src/sap/ui/fl/ControlPersonalizationAPI.js +3 -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 +9 -2
- 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 +54 -34
- package/src/sap/ui/fl/Variant.js +2 -11
- package/src/sap/ui/fl/XmlPreprocessorImpl.js +1 -1
- 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 +69 -45
- package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -29
- package/src/sap/ui/fl/apply/_internal/changes/Utils.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 +40 -29
- 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 +133 -30
- package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +52 -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/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 +5 -5
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +13 -28
- package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +1 -1
- package/src/sap/ui/fl/apply/api/FlexRuntimeInfoAPI.js +25 -5
- 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 +10 -8
- 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 +6 -3
- 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 +8 -5
- package/src/sap/ui/fl/codeExt/CodeExtManager.js +1 -1
- 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/StorageResultMerger.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 -1
- 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 +39 -2
- package/src/sap/ui/fl/messagebundle_ar.properties +31 -6
- package/src/sap/ui/fl/messagebundle_bg.properties +31 -6
- package/src/sap/ui/fl/messagebundle_ca.properties +32 -7
- package/src/sap/ui/fl/messagebundle_cs.properties +31 -6
- package/src/sap/ui/fl/messagebundle_cy.properties +31 -6
- package/src/sap/ui/fl/messagebundle_da.properties +31 -6
- package/src/sap/ui/fl/messagebundle_de.properties +31 -6
- package/src/sap/ui/fl/messagebundle_el.properties +31 -6
- package/src/sap/ui/fl/messagebundle_en.properties +27 -2
- package/src/sap/ui/fl/messagebundle_en_GB.properties +28 -3
- package/src/sap/ui/fl/messagebundle_en_US_sappsd.properties +8 -0
- package/src/sap/ui/fl/messagebundle_en_US_saprigi.properties +35 -2
- package/src/sap/ui/fl/messagebundle_en_US_saptrc.properties +8 -0
- package/src/sap/ui/fl/messagebundle_es.properties +32 -7
- package/src/sap/ui/fl/messagebundle_es_MX.properties +31 -6
- package/src/sap/ui/fl/messagebundle_et.properties +31 -6
- package/src/sap/ui/fl/messagebundle_fi.properties +31 -6
- package/src/sap/ui/fl/messagebundle_fr.properties +31 -6
- package/src/sap/ui/fl/messagebundle_fr_CA.properties +31 -6
- package/src/sap/ui/fl/messagebundle_hi.properties +31 -6
- package/src/sap/ui/fl/messagebundle_hr.properties +31 -6
- package/src/sap/ui/fl/messagebundle_hu.properties +31 -6
- package/src/sap/ui/fl/messagebundle_id.properties +31 -6
- package/src/sap/ui/fl/messagebundle_it.properties +32 -7
- package/src/sap/ui/fl/messagebundle_iw.properties +31 -6
- package/src/sap/ui/fl/messagebundle_ja.properties +31 -6
- package/src/sap/ui/fl/messagebundle_kk.properties +31 -6
- package/src/sap/ui/fl/messagebundle_ko.properties +32 -7
- package/src/sap/ui/fl/messagebundle_lt.properties +31 -6
- package/src/sap/ui/fl/messagebundle_lv.properties +31 -6
- package/src/sap/ui/fl/messagebundle_ms.properties +31 -6
- package/src/sap/ui/fl/messagebundle_nl.properties +31 -6
- package/src/sap/ui/fl/messagebundle_no.properties +31 -6
- package/src/sap/ui/fl/messagebundle_pl.properties +31 -6
- package/src/sap/ui/fl/messagebundle_pt.properties +31 -6
- package/src/sap/ui/fl/messagebundle_pt_PT.properties +31 -6
- package/src/sap/ui/fl/messagebundle_ro.properties +31 -6
- package/src/sap/ui/fl/messagebundle_ru.properties +31 -6
- package/src/sap/ui/fl/messagebundle_sh.properties +33 -8
- package/src/sap/ui/fl/messagebundle_sk.properties +31 -6
- package/src/sap/ui/fl/messagebundle_sl.properties +31 -6
- package/src/sap/ui/fl/messagebundle_sv.properties +31 -6
- package/src/sap/ui/fl/messagebundle_th.properties +29 -4
- package/src/sap/ui/fl/messagebundle_tr.properties +31 -6
- package/src/sap/ui/fl/messagebundle_uk.properties +33 -8
- package/src/sap/ui/fl/messagebundle_vi.properties +31 -6
- package/src/sap/ui/fl/messagebundle_zh_CN.properties +31 -6
- package/src/sap/ui/fl/messagebundle_zh_TW.properties +31 -6
- package/src/sap/ui/fl/registry/Settings.js +57 -23
- package/src/sap/ui/fl/support/Flexibility.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +1 -1
- package/src/sap/ui/fl/support/diagnostics/Flexibility.controller.js +1 -1
- package/src/sap/ui/fl/themes/base/VariantManagement.less +4 -0
- package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
- 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 +326 -37
- package/src/sap/ui/fl/variants/VariantModel.js +191 -75
- package/src/sap/ui/fl/write/_internal/Storage.js +6 -4
- 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 +35 -4
- package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +1 -1
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Move.js +7 -1
- package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +1 -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 +47 -18
- 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 +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +10 -10
- package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +1 -1
- package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -1
- package/src/sap/ui/fl/write/api/ChangesWriteAPI.js +1 -2
- package/src/sap/ui/fl/write/api/FieldExtensibility.js +22 -7
- package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +20 -16
- package/ui5.yaml +4 -1
- 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.
|
|
@@ -58,6 +62,7 @@ sap.ui.define([
|
|
|
58
62
|
* @param {object} mPropertyBag - Object with properties
|
|
59
63
|
* @param {string} mPropertyBag.vmReference - Variant management reference
|
|
60
64
|
* @param {sap.ui.fl.variants.VariantModel} mPropertyBag.model - Variant model instance
|
|
65
|
+
* @returns {Promise<undefined>} Resolves with undefined
|
|
61
66
|
*
|
|
62
67
|
* @private
|
|
63
68
|
*/
|
|
@@ -172,6 +177,7 @@ sap.ui.define([
|
|
|
172
177
|
*
|
|
173
178
|
* @param {function():Promise} fnCallback - Callback function returning a promise
|
|
174
179
|
* @param {sap.ui.fl.variants.VariantModel} oModel - Variant model
|
|
180
|
+
* @param {string} sVMReference - Variant Management reference
|
|
175
181
|
* @returns {Promise} Resolves when the variant model is not busy anymore
|
|
176
182
|
* @private
|
|
177
183
|
*/
|
|
@@ -191,6 +197,16 @@ sap.ui.define([
|
|
|
191
197
|
return oModel._oVariantSwitchPromise;
|
|
192
198
|
}
|
|
193
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
|
+
|
|
194
210
|
function revertVariantAndClearData(mPropertyBag) {
|
|
195
211
|
return Switcher.switchVariant(mPropertyBag)
|
|
196
212
|
.then(function() {
|
|
@@ -259,11 +275,11 @@ sap.ui.define([
|
|
|
259
275
|
* @class Variant model implementation for JSON format.
|
|
260
276
|
* @extends sap.ui.model.json.JSONModel
|
|
261
277
|
* @author SAP SE
|
|
262
|
-
* @version 1.
|
|
278
|
+
* @version 1.96.2
|
|
263
279
|
* @param {object} oData - Either the URL where to load the JSON from or a JS object
|
|
264
|
-
* @param {
|
|
265
|
-
* @param {sap.ui.
|
|
266
|
-
* @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
|
|
267
283
|
* @constructor
|
|
268
284
|
* @private
|
|
269
285
|
* @ui5-restricted
|
|
@@ -273,20 +289,24 @@ sap.ui.define([
|
|
|
273
289
|
*/
|
|
274
290
|
|
|
275
291
|
var VariantModel = JSONModel.extend("sap.ui.fl.variants.VariantModel", /** @lends sap.ui.fl.variants.VariantModel.prototype */ {
|
|
276
|
-
constructor: function(oData,
|
|
292
|
+
constructor: function(oData, mPropertyBag) {
|
|
277
293
|
// JSON model internal properties
|
|
278
294
|
this.pSequentialImportCompleted = Promise.resolve();
|
|
279
|
-
JSONModel.apply(this,
|
|
280
|
-
|
|
295
|
+
JSONModel.apply(this, [oData]);
|
|
296
|
+
|
|
297
|
+
this.sharing = {
|
|
298
|
+
PRIVATE: "private",
|
|
299
|
+
PUBLIC: "public"
|
|
300
|
+
};
|
|
281
301
|
|
|
282
302
|
// FlexControllerFactory creates a FlexController instance for an application component,
|
|
283
303
|
// which creates a ChangePersistence instance.
|
|
284
304
|
// After retrieving changes for the created ChangePersistence instance,
|
|
285
305
|
// FlexControllerFactory creates a VariantModel instance for this application component.
|
|
286
|
-
this.oFlexController =
|
|
306
|
+
this.oFlexController = mPropertyBag.flexController;
|
|
287
307
|
this.oChangePersistence = this.oFlexController._oChangePersistence;
|
|
288
308
|
this.sFlexReference = this.oChangePersistence.getComponentName();
|
|
289
|
-
this.oAppComponent =
|
|
309
|
+
this.oAppComponent = mPropertyBag.appComponent;
|
|
290
310
|
this._oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.fl");
|
|
291
311
|
this._oVariantSwitchPromise = Promise.resolve();
|
|
292
312
|
this._oVariantAppliedListeners = {};
|
|
@@ -316,6 +336,7 @@ sap.ui.define([
|
|
|
316
336
|
oVariant.originalFavorite = oVariant.favorite;
|
|
317
337
|
oVariant.originalExecuteOnSelect = oVariant.executeOnSelect;
|
|
318
338
|
oVariant.originalVisible = oVariant.visible;
|
|
339
|
+
oVariant.originalContexts = oVariant.contexts;
|
|
319
340
|
});
|
|
320
341
|
oData[sKey].originalCurrentVariant = oData[sKey].currentVariant;
|
|
321
342
|
oData[sKey].originalDefaultVariant = oData[sKey].defaultVariant;
|
|
@@ -323,12 +344,43 @@ sap.ui.define([
|
|
|
323
344
|
|
|
324
345
|
this.setData(oData);
|
|
325
346
|
}
|
|
326
|
-
|
|
327
|
-
//initialize hash data - variants map & model should exist at this point
|
|
328
|
-
URLHandler.initialize({model: this});
|
|
329
347
|
}
|
|
330
348
|
});
|
|
331
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
|
+
|
|
332
384
|
/**
|
|
333
385
|
* Updates the storage of the current variant for a given variant management control.
|
|
334
386
|
* @param {object} mPropertyBag - Object with parameters as properties
|
|
@@ -600,6 +652,7 @@ sap.ui.define([
|
|
|
600
652
|
}
|
|
601
653
|
}.bind(this));
|
|
602
654
|
oDuplicateVariant.content.layer = mPropertyBag.layer;
|
|
655
|
+
oDuplicateVariant.content.contexts = mPropertyBag.contexts;
|
|
603
656
|
|
|
604
657
|
aVariantChanges = oDuplicateVariant.controlChanges.slice();
|
|
605
658
|
|
|
@@ -637,6 +690,7 @@ sap.ui.define([
|
|
|
637
690
|
* @param {String} mPropertyBag.newVariantReference - <code>variantReference</code> for the new variant
|
|
638
691
|
* @param {String} mPropertyBag.sourceVariantReference - <code>variantReference</code> of the source variant
|
|
639
692
|
* @param {String} mPropertyBag.generator - Information about who created the change
|
|
693
|
+
* @param {object} mPropertyBag.contexts - Context structure containing roles and countries
|
|
640
694
|
* @returns {Promise} Promise resolving to dirty changes created during variant copy
|
|
641
695
|
* @private
|
|
642
696
|
*/
|
|
@@ -656,7 +710,10 @@ sap.ui.define([
|
|
|
656
710
|
change: true,
|
|
657
711
|
remove: true,
|
|
658
712
|
visible: true,
|
|
659
|
-
originalVisible: true
|
|
713
|
+
originalVisible: true,
|
|
714
|
+
sharing: mPropertyBag.layer === Layer.USER ? this.sharing.PRIVATE : this.sharing.PUBLIC,
|
|
715
|
+
contexts: oDuplicateVariantData.content.contexts,
|
|
716
|
+
originalContexts: oDuplicateVariantData.originalContexts
|
|
660
717
|
};
|
|
661
718
|
|
|
662
719
|
var oVariant = VariantUtil.createVariant({
|
|
@@ -775,6 +832,16 @@ sap.ui.define([
|
|
|
775
832
|
};
|
|
776
833
|
aChanges.push(mPropertyBag);
|
|
777
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
|
+
}
|
|
778
845
|
});
|
|
779
846
|
if (oData.originalDefaultVariant !== oData.defaultVariant) {
|
|
780
847
|
mPropertyBag = {
|
|
@@ -797,10 +864,11 @@ sap.ui.define([
|
|
|
797
864
|
* @param {String} sVariantManagementReference - Variant management reference
|
|
798
865
|
* @param {String} sLayer - Current layer
|
|
799
866
|
* @param {String} sClass - Style class assigned to the management dialog
|
|
867
|
+
* @param {Promise<sap.ui.core.ComponentContainer>} oContextSharingComponentPromise - Promise resolving with the ComponentContainer
|
|
800
868
|
* @returns {Promise} Promise which resolves when "manage" event is fired from the variant management control
|
|
801
869
|
* @public
|
|
802
870
|
*/
|
|
803
|
-
VariantModel.prototype.manageVariants = function(oVariantManagementControl, sVariantManagementReference, sLayer, sClass) {
|
|
871
|
+
VariantModel.prototype.manageVariants = function(oVariantManagementControl, sVariantManagementReference, sLayer, sClass, oContextSharingComponentPromise) {
|
|
804
872
|
// called from the ControlVariant plugin in Adaptation mode
|
|
805
873
|
return new Promise(function(resolve) {
|
|
806
874
|
oVariantManagementControl.attachEventOnce("manage", {
|
|
@@ -808,13 +876,78 @@ sap.ui.define([
|
|
|
808
876
|
variantManagementReference: sVariantManagementReference,
|
|
809
877
|
layer: sLayer
|
|
810
878
|
}, this.fnManageClickRta, this);
|
|
811
|
-
oVariantManagementControl.openManagementDialog(true, sClass);
|
|
879
|
+
oVariantManagementControl.openManagementDialog(true, sClass, oContextSharingComponentPromise);
|
|
812
880
|
}.bind(this));
|
|
813
881
|
};
|
|
814
882
|
|
|
815
883
|
/**
|
|
816
|
-
* Sets the
|
|
817
|
-
*
|
|
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
|
|
818
951
|
* @param {sap.ui.fl.variants.VariantManagement} sVariantManagementReference - Variant management reference
|
|
819
952
|
* @param {Object} mPropertyBag - Map of properties
|
|
820
953
|
* @param {String} mPropertyBag.variantReference - Variant reference for which properties should be set
|
|
@@ -823,26 +956,24 @@ sap.ui.define([
|
|
|
823
956
|
* @param {String} mPropertyBag.appComponent - App component instance
|
|
824
957
|
* @param {String} [mPropertyBag.title] - New app title value for <code>setTitle</code> change type
|
|
825
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
|
|
826
960
|
* @param {boolean} [mPropertyBag.favorite] - New favorite value for <code>setFavorite</code> change type
|
|
827
961
|
* @param {boolean} [mPropertyBag.executeOnSelect] - New executeOnSelect value for <code>setExecuteOnSelect</code> change type
|
|
828
962
|
* @param {String} [mPropertyBag.defaultVariant] - New default variant for <code>setDefault</code> change type
|
|
829
|
-
* @param {
|
|
830
|
-
* @
|
|
831
|
-
* @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
|
|
832
965
|
* @public
|
|
833
966
|
*/
|
|
834
|
-
VariantModel.prototype.setVariantProperties = function(sVariantManagementReference, mPropertyBag,
|
|
967
|
+
VariantModel.prototype.setVariantProperties = function(sVariantManagementReference, mPropertyBag, bUpdateCurrentVariant) {
|
|
835
968
|
// TODO: this function needs refactoring
|
|
836
969
|
var iVariantIndex = -1;
|
|
837
970
|
var oVariant;
|
|
838
|
-
var oChange = null;
|
|
839
971
|
var oData = this.getData();
|
|
840
972
|
|
|
841
973
|
if (mPropertyBag.variantReference) {
|
|
842
974
|
iVariantIndex = this.getVariantManagementReference(mPropertyBag.variantReference).variantIndex;
|
|
843
975
|
oVariant = oData[sVariantManagementReference].variants[iVariantIndex];
|
|
844
976
|
}
|
|
845
|
-
var mNewChangeData = {};
|
|
846
977
|
var mAdditionalChangeContent = {};
|
|
847
978
|
|
|
848
979
|
switch (mPropertyBag.changeType) {
|
|
@@ -873,6 +1004,12 @@ sap.ui.define([
|
|
|
873
1004
|
oVariant.visible = mPropertyBag.visible;
|
|
874
1005
|
oVariant.originalVisible = oVariant.visible;
|
|
875
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;
|
|
876
1013
|
case "setDefault":
|
|
877
1014
|
mAdditionalChangeContent.defaultVariant = mPropertyBag.defaultVariant;
|
|
878
1015
|
//Update Variant Model
|
|
@@ -907,7 +1044,7 @@ sap.ui.define([
|
|
|
907
1044
|
}
|
|
908
1045
|
}
|
|
909
1046
|
|
|
910
|
-
if (
|
|
1047
|
+
if (bUpdateCurrentVariant && oData[sVariantManagementReference].currentVariant !== mPropertyBag.defaultVariant) {
|
|
911
1048
|
this.updateCurrentVariant({
|
|
912
1049
|
variantManagementReference: sVariantManagementReference,
|
|
913
1050
|
newVariantReference: mPropertyBag.defaultVariant,
|
|
@@ -936,49 +1073,11 @@ sap.ui.define([
|
|
|
936
1073
|
oVariantContent[sVariantManagementReference].defaultVariant = mPropertyBag.defaultVariant;
|
|
937
1074
|
}
|
|
938
1075
|
|
|
939
|
-
var mUpdateVariantsStateParams = {
|
|
940
|
-
vmReference: sVariantManagementReference,
|
|
941
|
-
add: bAddChange,
|
|
942
|
-
reference: this.sFlexReference
|
|
943
|
-
};
|
|
944
|
-
|
|
945
|
-
// add change
|
|
946
|
-
if (bAddChange === true) {
|
|
947
|
-
//create new change object
|
|
948
|
-
mNewChangeData.changeType = mPropertyBag.changeType;
|
|
949
|
-
mNewChangeData.layer = mPropertyBag.layer;
|
|
950
|
-
mNewChangeData.generator = mPropertyBag.generator;
|
|
951
|
-
|
|
952
|
-
if (mPropertyBag.changeType === "setDefault") {
|
|
953
|
-
mNewChangeData.fileType = "ctrl_variant_management_change";
|
|
954
|
-
mNewChangeData.selector = JsControlTreeModifier.getSelector(sVariantManagementReference, mPropertyBag.appComponent);
|
|
955
|
-
} else {
|
|
956
|
-
if (mPropertyBag.changeType === "setTitle") {
|
|
957
|
-
BaseChangeHandler.setTextInChange(mNewChangeData, "title", mPropertyBag.title, "XFLD");
|
|
958
|
-
}
|
|
959
|
-
mNewChangeData.fileType = "ctrl_variant_change";
|
|
960
|
-
mNewChangeData.selector = JsControlTreeModifier.getSelector(mPropertyBag.variantReference, mPropertyBag.appComponent);
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
oChange = this.oFlexController.createBaseChange(mNewChangeData, mPropertyBag.appComponent);
|
|
964
|
-
//update change with additional content
|
|
965
|
-
oChange.setContent(mAdditionalChangeContent);
|
|
966
|
-
|
|
967
|
-
mUpdateVariantsStateParams.changeContent = oChange.getDefinition();
|
|
968
|
-
//update variants state and write change to ChangePersistence
|
|
969
|
-
VariantManagementState.updateChangesForVariantManagementInMap(mUpdateVariantsStateParams);
|
|
970
|
-
this.oChangePersistence.addDirtyChange(oChange);
|
|
971
|
-
} else if (mPropertyBag.change) { // delete change
|
|
972
|
-
mUpdateVariantsStateParams.changeContent = mPropertyBag.change.getDefinition();
|
|
973
|
-
//update variants state and write change to ChangePersistence
|
|
974
|
-
VariantManagementState.updateChangesForVariantManagementInMap(mUpdateVariantsStateParams);
|
|
975
|
-
this.oChangePersistence.deleteChange(mPropertyBag.change);
|
|
976
|
-
}
|
|
977
1076
|
// set data to variant model
|
|
978
1077
|
this.setData(oData);
|
|
979
1078
|
this.checkUpdate(true);
|
|
980
1079
|
|
|
981
|
-
return
|
|
1080
|
+
return mAdditionalChangeContent;
|
|
982
1081
|
};
|
|
983
1082
|
|
|
984
1083
|
VariantModel.prototype._ensureStandardVariantExists = function(sVariantManagementReference) {
|
|
@@ -1006,6 +1105,8 @@ sap.ui.define([
|
|
|
1006
1105
|
originalExecuteOnSelect: false,
|
|
1007
1106
|
visible: true,
|
|
1008
1107
|
originalVisible: true,
|
|
1108
|
+
contexts: {},
|
|
1109
|
+
originalContexts: {},
|
|
1009
1110
|
author: VariantUtil.DEFAULT_AUTHOR
|
|
1010
1111
|
}
|
|
1011
1112
|
]
|
|
@@ -1032,7 +1133,8 @@ sap.ui.define([
|
|
|
1032
1133
|
favorite: true,
|
|
1033
1134
|
visible: true,
|
|
1034
1135
|
executeOnSelect: false
|
|
1035
|
-
}
|
|
1136
|
+
},
|
|
1137
|
+
contexts: {}
|
|
1036
1138
|
},
|
|
1037
1139
|
controlChanges: [],
|
|
1038
1140
|
variantChanges: {}
|
|
@@ -1043,7 +1145,7 @@ sap.ui.define([
|
|
|
1043
1145
|
// TODO: To be removed in a separate change
|
|
1044
1146
|
// try-catch added to prevent FlexState initialize checks, since many tests use fake components / fake responses
|
|
1045
1147
|
try {
|
|
1046
|
-
VariantManagementState.addFakeStandardVariant(this.sFlexReference, oStandardVariant);
|
|
1148
|
+
VariantManagementState.addFakeStandardVariant(this.sFlexReference, this.oAppComponent.getId(), oStandardVariant);
|
|
1047
1149
|
} catch (oError) {
|
|
1048
1150
|
Log.error("Variants Map was not found: " + oError.message);
|
|
1049
1151
|
}
|
|
@@ -1085,8 +1187,9 @@ sap.ui.define([
|
|
|
1085
1187
|
this.oData[sVariantManagementReference].variants.forEach(function(oVariant) {
|
|
1086
1188
|
oVariant.rename = true;
|
|
1087
1189
|
oVariant.change = true;
|
|
1190
|
+
oVariant.sharing = this.sharing.PUBLIC;
|
|
1088
1191
|
oVariant.remove = isVariantValidForRemove(oVariant, sVariantManagementReference, bDesignTimeModeToBeSet);
|
|
1089
|
-
});
|
|
1192
|
+
}.bind(this));
|
|
1090
1193
|
} else if (this.oData[sVariantManagementReference]._isEditable) { // Personalization settings
|
|
1091
1194
|
oControl.attachManage({
|
|
1092
1195
|
variantManagementReference: sVariantManagementReference
|
|
@@ -1102,21 +1205,23 @@ sap.ui.define([
|
|
|
1102
1205
|
case Layer.USER:
|
|
1103
1206
|
oVariant.rename = true;
|
|
1104
1207
|
oVariant.change = true;
|
|
1208
|
+
oVariant.sharing = this.sharing.PRIVATE;
|
|
1105
1209
|
updatePersonalVariantPropertiesWithFlpSettings(oVariant);
|
|
1106
1210
|
break;
|
|
1107
1211
|
case Layer.PUBLIC:
|
|
1108
|
-
var
|
|
1109
|
-
var oUser = oUShellContainer && oUShellContainer.getUser();
|
|
1212
|
+
var oUser = this._oUserInfoService && this._oUserInfoService.getUser();
|
|
1110
1213
|
var bUserIsAuthorized = !oUser || oUser.getId().toUpperCase() === oVariant.author.toUpperCase() || Settings.getInstanceOrUndef().isKeyUser();
|
|
1111
1214
|
oVariant.remove = bUserIsAuthorized;
|
|
1112
1215
|
oVariant.rename = bUserIsAuthorized;
|
|
1113
1216
|
oVariant.change = bUserIsAuthorized;
|
|
1217
|
+
oVariant.sharing = this.sharing.PUBLIC;
|
|
1114
1218
|
break;
|
|
1115
1219
|
default:
|
|
1116
1220
|
oVariant.rename = false;
|
|
1117
1221
|
oVariant.change = false;
|
|
1222
|
+
oVariant.sharing = this.sharing.PUBLIC;
|
|
1118
1223
|
}
|
|
1119
|
-
});
|
|
1224
|
+
}.bind(this));
|
|
1120
1225
|
} else {
|
|
1121
1226
|
this.oData[sVariantManagementReference].variantsEditable = false;
|
|
1122
1227
|
this.oData[sVariantManagementReference].variants.forEach(function(oVariant) {
|
|
@@ -1141,7 +1246,7 @@ sap.ui.define([
|
|
|
1141
1246
|
var aChanges = [];
|
|
1142
1247
|
aConfigurationChangesContent.forEach(function(oChangeProperties) {
|
|
1143
1248
|
oChangeProperties.appComponent = this.oAppComponent;
|
|
1144
|
-
aChanges.push(this.
|
|
1249
|
+
aChanges.push(this.addVariantChange(oData.variantManagementReference, oChangeProperties));
|
|
1145
1250
|
}.bind(this));
|
|
1146
1251
|
this.oChangePersistence.saveDirtyChanges(this.oAppComponent, false, aChanges);
|
|
1147
1252
|
};
|
|
@@ -1204,6 +1309,7 @@ sap.ui.define([
|
|
|
1204
1309
|
appComponent: oAppComponent,
|
|
1205
1310
|
layer: sLayer,
|
|
1206
1311
|
title: mParameters.name,
|
|
1312
|
+
contexts: mParameters.contexts,
|
|
1207
1313
|
sourceVariantReference: sSourceVariantReference,
|
|
1208
1314
|
newVariantReference: sNewVariantReference,
|
|
1209
1315
|
generator: mParameters.generator
|
|
@@ -1220,7 +1326,7 @@ sap.ui.define([
|
|
|
1220
1326
|
layer: sLayer,
|
|
1221
1327
|
variantManagementReference: sVariantManagementReference
|
|
1222
1328
|
};
|
|
1223
|
-
var oSetDefaultChange = this.
|
|
1329
|
+
var oSetDefaultChange = this.addVariantChange(sVariantManagementReference, mPropertyBagSetDefault);
|
|
1224
1330
|
aCopiedVariantDirtyChanges.push(oSetDefaultChange);
|
|
1225
1331
|
}
|
|
1226
1332
|
if (bSetExecuteOnSelect) {
|
|
@@ -1232,7 +1338,7 @@ sap.ui.define([
|
|
|
1232
1338
|
layer: sLayer,
|
|
1233
1339
|
variantManagementReference: sVariantManagementReference
|
|
1234
1340
|
};
|
|
1235
|
-
var oSetExecuteChange = this.
|
|
1341
|
+
var oSetExecuteChange = this.addVariantChange(sVariantManagementReference, mPropertyBagSetExecute);
|
|
1236
1342
|
aCopiedVariantDirtyChanges.push(oSetExecuteChange);
|
|
1237
1343
|
}
|
|
1238
1344
|
aNewVariantDirtyChanges = aCopiedVariantDirtyChanges;
|
|
@@ -1439,11 +1545,11 @@ sap.ui.define([
|
|
|
1439
1545
|
}.bind(this));
|
|
1440
1546
|
return this._oVariantSwitchPromise
|
|
1441
1547
|
.then(function() {
|
|
1442
|
-
VariantManagementState.clearFakedStandardVariants(this.sFlexReference);
|
|
1443
|
-
VariantManagementState.resetContent(this.sFlexReference);
|
|
1548
|
+
VariantManagementState.clearFakedStandardVariants(this.sFlexReference, this.oAppComponent.getId());
|
|
1549
|
+
VariantManagementState.resetContent(this.sFlexReference, this.oAppComponent.getId());
|
|
1444
1550
|
//re-initialize hash data and remove existing parameters
|
|
1445
1551
|
if (!bSkipURLHandling) {
|
|
1446
|
-
URLHandler.initialize({model: this});
|
|
1552
|
+
URLHandler.initialize({ model: this });
|
|
1447
1553
|
URLHandler.update({
|
|
1448
1554
|
parameters: [],
|
|
1449
1555
|
updateHashEntry: true,
|
|
@@ -1453,5 +1559,15 @@ sap.ui.define([
|
|
|
1453
1559
|
}.bind(this));
|
|
1454
1560
|
};
|
|
1455
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
|
+
|
|
1456
1572
|
return VariantModel;
|
|
1457
1573
|
});
|
|
@@ -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.96.2
|
|
24
26
|
* @private
|
|
25
27
|
* @ui5-restricted sap.ui.fl
|
|
26
28
|
*/
|
|
@@ -142,7 +144,7 @@ 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++;
|
|
@@ -156,7 +158,7 @@ sap.ui.define([
|
|
|
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
|
}
|