@openui5/sap.ui.fl 1.97.1 → 1.98.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 +25 -30
- package/THIRDPARTY.txt +13 -20
- 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 +4 -218
- package/src/sap/ui/fl/ChangePersistence.js +22 -24
- package/src/sap/ui/fl/ChangePersistenceFactory.js +4 -2
- 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 +36 -18
- package/src/sap/ui/fl/FlexControllerFactory.js +5 -3
- package/src/sap/ui/fl/LayerUtils.js +1 -1
- package/src/sap/ui/fl/PreprocessorImpl.js +6 -4
- package/src/sap/ui/fl/RegistrationDelegator.js +1 -1
- package/src/sap/ui/fl/Utils.js +27 -301
- package/src/sap/ui/fl/Variant.js +1 -115
- package/src/sap/ui/fl/XmlPreprocessorImpl.js +5 -3
- package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +2 -2
- 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/Preprocessor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +3 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +1 -1
- 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 +1 -1
- 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 +6 -4
- package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +15 -10
- package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariantRevertData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/RevertData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +34 -4
- package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +9 -3
- package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +21 -22
- 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/controlVariants/Switcher.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +10 -14
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/prepareVariantsMap.js +6 -0
- package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +1 -1
- package/src/sap/ui/fl/apply/api/DelegateMediatorAPI.js +1 -1
- package/src/sap/ui/fl/apply/api/FlexRuntimeInfoAPI.js +13 -0
- package/src/sap/ui/fl/apply/api/SmartVariantManagementApplyAPI.js +12 -1
- 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 +1 -1
- 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 +1 -1
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorVariantFactory.js +1 -1
- package/src/sap/ui/fl/designtime/variants/VariantManagement.designtime.js +9 -2
- 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/BackendConnector.js +1 -1
- package/src/sap/ui/fl/initial/_internal/connectors/LrepConnector.js +16 -6
- package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +4 -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 +11 -11
- package/src/sap/ui/fl/messagebundle_ro.properties +1 -1
- package/src/sap/ui/fl/registry/Settings.js +10 -0
- package/src/sap/ui/fl/support/Flexibility.js +1 -1
- package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +59 -0
- package/src/sap/ui/fl/support/api/SupportAPI.js +28 -0
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +2 -2
- 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/apps/uiFlexibilityDiagnostics/helper/Extractor.js +3 -14
- package/src/sap/ui/fl/support/diagnostics/Flexibility.controller.js +1 -1
- package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
- package/src/sap/ui/fl/util/IFrame.js +1 -1
- package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
- package/src/sap/ui/fl/util/resolveBinding.js +1 -1
- package/src/sap/ui/fl/variants/VariantManagement.js +2 -1
- package/src/sap/ui/fl/variants/VariantModel.js +5 -45
- package/src/sap/ui/fl/write/_internal/Storage.js +33 -1
- package/src/sap/ui/fl/write/_internal/StorageFeaturesMerger.js +1 -1
- package/src/sap/ui/fl/write/_internal/Versions.js +17 -18
- 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 +24 -1
- package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +1 -1
- package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +3 -3
- package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +28 -4
- package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +59 -2
- 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 +4 -4
- 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 +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/CAPAccess.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.js +1 -1
- 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.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/FlexObjectState.js +18 -4
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +1 -1
- 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/ControlPersonalizationWriteAPI.js +14 -7
- package/src/sap/ui/fl/write/api/FeaturesAPI.js +4 -1
- package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
- package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +40 -2
- package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +4 -4
- package/src/sap/ui/fl/write/api/TranslationAPI.js +102 -0
- package/src/sap/ui/fl/write/api/VersionsAPI.js +1 -1
- package/src/sap/ui/fl/write/api/connectors/ObjectStorageConnector.js +2 -1
- package/src/sap/ui/fl/write/connectors/BaseConnector.js +30 -0
|
@@ -139,7 +139,7 @@ sap.ui.define([
|
|
|
139
139
|
* @namespace sap.ui.fl.apply._internal.changes.descriptor.app.AddAnnotationsToOData
|
|
140
140
|
* @experimental
|
|
141
141
|
* @since 1.87
|
|
142
|
-
* @version 1.
|
|
142
|
+
* @version 1.98.0
|
|
143
143
|
* @private
|
|
144
144
|
* @ui5-restricted sap.ui.fl.apply._internal
|
|
145
145
|
*/
|
|
@@ -47,7 +47,7 @@ sap.ui.define([
|
|
|
47
47
|
* Checks if the parsed shell hash contains outdated variant parameters.
|
|
48
48
|
*
|
|
49
49
|
* @param {array} aNewHashParameters - Variant URL Parameters
|
|
50
|
-
* @param {sap.ui.fl.
|
|
50
|
+
* @param {sap.ui.fl.variants.VariantModel} oModel - Variant model
|
|
51
51
|
*
|
|
52
52
|
* @returns {object} oIfUpdateIsRequiredWithCurrentVariants
|
|
53
53
|
* @returns {boolean} oIfUpdateIsRequiredWithCurrentVariants.updateRequired - If update is required
|
|
@@ -176,7 +176,10 @@ sap.ui.define([
|
|
|
176
176
|
var oParsedHash = oURLParsingService && oURLParsingService.parseShellHash(hasher.getHash());
|
|
177
177
|
|
|
178
178
|
if (oParsedHash && oParsedHash.params) {
|
|
179
|
-
var mTechnicalParameters =
|
|
179
|
+
var mTechnicalParameters = oModel.oAppComponent
|
|
180
|
+
&& oModel.oAppComponent.getComponentData
|
|
181
|
+
&& oModel.oAppComponent.getComponentData()
|
|
182
|
+
&& oModel.oAppComponent.getComponentData().technicalParameters;
|
|
180
183
|
// if mTechnicalParameters are not available we write a warning and continue updating the hash
|
|
181
184
|
if (!mTechnicalParameters) {
|
|
182
185
|
Log.warning("Component instance not provided, so technical parameters in component data and browser history remain unchanged");
|
|
@@ -382,8 +385,7 @@ sap.ui.define([
|
|
|
382
385
|
// this promise is not returned since the component is getting destroyed,
|
|
383
386
|
// which will also destroy the variant model anyway,
|
|
384
387
|
// but this is just to ensure the model is in sync with the variants state (which is persisted)
|
|
385
|
-
mPropertyBag.model.
|
|
386
|
-
.then(mPropertyBag.model.destroy.bind(mPropertyBag.model));
|
|
388
|
+
mPropertyBag.model.destroy();
|
|
387
389
|
mPropertyBag.model.oComponentDestroyObserver.unobserve(mPropertyBag.model.oAppComponent, {destroy: true});
|
|
388
390
|
mPropertyBag.model.oComponentDestroyObserver.destroy();
|
|
389
391
|
});
|
|
@@ -34,14 +34,13 @@ sap.ui.define([
|
|
|
34
34
|
* @param {sap.ui.fl.Layer} sLayer - Layer of the variant
|
|
35
35
|
* @param {sap.ui.fl.Layer} [sActiveLayer] - Layer in which the operation may take place
|
|
36
36
|
* @param {string} sUserId - ID of the variants creator
|
|
37
|
-
* @param {boolean} bAllowedForAnyLayer - Flag if the operation is also allowed on objects from any layers
|
|
38
37
|
* @returns {boolean} <code>true</code> if the variant is read only
|
|
39
38
|
*
|
|
40
39
|
* @private
|
|
41
40
|
*/
|
|
42
|
-
function checkLayerAndUserAuthorization(sLayer, sActiveLayer, sUserId
|
|
41
|
+
function checkLayerAndUserAuthorization(sLayer, sActiveLayer, sUserId) {
|
|
43
42
|
if (sActiveLayer) {
|
|
44
|
-
return
|
|
43
|
+
return sLayer === sActiveLayer;
|
|
45
44
|
} else if (sLayer === Layer.USER) {
|
|
46
45
|
return true;
|
|
47
46
|
}
|
|
@@ -181,14 +180,14 @@ sap.ui.define([
|
|
|
181
180
|
/**
|
|
182
181
|
* Checks whenever the variant can be renamed updating the entity or crating an <code>updateChange</code>.
|
|
183
182
|
*
|
|
184
|
-
* @param {sap.ui.fl.Layer} sLayer - Layer in which the edition may take place
|
|
183
|
+
* @param {sap.ui.fl.Layer} [sLayer] - Layer in which the edition may take place
|
|
185
184
|
*
|
|
186
185
|
* @returns {boolean} <code>true</code> if the variant can be updated
|
|
187
186
|
*
|
|
188
187
|
* @public
|
|
189
188
|
*/
|
|
190
189
|
CompVariant.prototype.isRenameEnabled = function (sLayer) {
|
|
191
|
-
return this.
|
|
190
|
+
return !this.getStandardVariant() && this.isEditEnabled(sLayer) && isRenameEnableDueToOriginalLanguage(this._oDefinition.content.originalLanguage);
|
|
192
191
|
};
|
|
193
192
|
|
|
194
193
|
/**
|
|
@@ -201,22 +200,23 @@ sap.ui.define([
|
|
|
201
200
|
* @public
|
|
202
201
|
*/
|
|
203
202
|
CompVariant.prototype.isEditEnabled = function (sActiveLayer) {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
203
|
+
var bDeveloperLayer = sActiveLayer && LayerUtils.isDeveloperLayer(sActiveLayer);
|
|
204
|
+
var bOriginSystem = isOriginSystem(this._oDefinition.sourceSystem, this._oDefinition.sourceClient);
|
|
205
|
+
var bUserAuthorized = checkLayerAndUserAuthorization(this.getLayer(), sActiveLayer, this.getOwnerId());
|
|
206
|
+
return bDeveloperLayer || bOriginSystem && bUserAuthorized;
|
|
207
207
|
};
|
|
208
208
|
|
|
209
209
|
/**
|
|
210
210
|
* Checks whenever the variant can be deleted.
|
|
211
211
|
*
|
|
212
|
-
* @param {sap.ui.fl.Layer} sLayer - Layer in which the deletion may take place
|
|
212
|
+
* @param {sap.ui.fl.Layer} [sLayer] - Layer in which the deletion may take place
|
|
213
213
|
*
|
|
214
214
|
* @returns {boolean} <code>true</code> if the variant file can be deleted
|
|
215
215
|
*
|
|
216
216
|
* @public
|
|
217
217
|
*/
|
|
218
218
|
CompVariant.prototype.isDeleteEnabled = function (sLayer) {
|
|
219
|
-
return isOriginSystem(this.
|
|
219
|
+
return isOriginSystem(this._oDefinition.sourceSystem, this._oDefinition.sourceClient)
|
|
220
220
|
&& checkLayerAndUserAuthorization(this.getLayer(), sLayer, this.getOwnerId())
|
|
221
221
|
&& !this.getStandardVariant();
|
|
222
222
|
};
|
|
@@ -266,6 +266,11 @@ sap.ui.define([
|
|
|
266
266
|
return this.getProperty("content");
|
|
267
267
|
};
|
|
268
268
|
|
|
269
|
+
|
|
270
|
+
CompVariant.prototype.getOwnerId = function() {
|
|
271
|
+
return this._oDefinition.support ? this._oDefinition.support.user : "";
|
|
272
|
+
};
|
|
273
|
+
|
|
269
274
|
/**
|
|
270
275
|
* Sets the content of the runtime instance as well as the persistent representation.
|
|
271
276
|
* This results in setting the definition as well as flagging the entity as 'dirty'.
|
|
@@ -16,7 +16,7 @@ sap.ui.define([
|
|
|
16
16
|
* @extends sap.ui.fl.apply._internal.flexObjects.RevertData
|
|
17
17
|
* @private
|
|
18
18
|
* @ui5-restricted
|
|
19
|
-
* @since
|
|
19
|
+
* @since 1.87.0
|
|
20
20
|
*/
|
|
21
21
|
return RevertData.extend("sap.ui.fl.apply._internal.flexObjects.CompVariantRevertData", {
|
|
22
22
|
metadata: {
|
|
@@ -72,7 +72,7 @@ sap.ui.define([
|
|
|
72
72
|
* @namespace sap.ui.fl.apply._internal.flexState.FlexState
|
|
73
73
|
* @experimental
|
|
74
74
|
* @since 1.73
|
|
75
|
-
* @version 1.
|
|
75
|
+
* @version 1.98.0
|
|
76
76
|
* @private
|
|
77
77
|
* @ui5-restricted sap.ui.fl.apply._internal
|
|
78
78
|
*/
|
|
@@ -83,6 +83,8 @@ sap.ui.define([
|
|
|
83
83
|
var _mInitPromises = {};
|
|
84
84
|
var _oShellNavigationService;
|
|
85
85
|
var _oURLParsingService;
|
|
86
|
+
var _oChangePersistenceFactory;
|
|
87
|
+
var _oFlexControllerFactory;
|
|
86
88
|
var _mFlexObjectInfo = {
|
|
87
89
|
appDescriptorChanges: {
|
|
88
90
|
prepareFunction: prepareAppDescriptorMap,
|
|
@@ -294,6 +296,22 @@ sap.ui.define([
|
|
|
294
296
|
return undefined;
|
|
295
297
|
}
|
|
296
298
|
|
|
299
|
+
// TODO: get rid of the following module dependencies as far as the change state
|
|
300
|
+
// is migrated from changePersistenceFactory to the FlexState
|
|
301
|
+
function lazyLoadModules() {
|
|
302
|
+
return Promise.all([
|
|
303
|
+
Utils.requireAsync("sap/ui/fl/ChangePersistenceFactory"),
|
|
304
|
+
Utils.requireAsync("sap/ui/fl/FlexControllerFactory")
|
|
305
|
+
])
|
|
306
|
+
.then(function(aModules) {
|
|
307
|
+
_oChangePersistenceFactory = aModules[0];
|
|
308
|
+
_oFlexControllerFactory = aModules[1];
|
|
309
|
+
})
|
|
310
|
+
.catch(function(oError) {
|
|
311
|
+
Log.error("Error loading modules: " + oError.message);
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
|
|
297
315
|
/**
|
|
298
316
|
* Initializes the FlexState for a given reference. A request for the flex data is sent to the Loader and the response is saved.
|
|
299
317
|
* The FlexState can only be initialized once, every subsequent init call will just resolve as soon as it is initialized.
|
|
@@ -305,12 +323,15 @@ sap.ui.define([
|
|
|
305
323
|
* @param {object} [mPropertyBag.rawManifest] - Raw JSON manifest that belongs to current component
|
|
306
324
|
* @param {string} [mPropertyBag.componentData] - Component data of the current component
|
|
307
325
|
* @param {object} [mPropertyBag.asyncHints] - Async hints passed from the app index to the component processing
|
|
308
|
-
* @param {
|
|
326
|
+
* @param {string} [mPropertyBag.version] - Number of the version in which the state should be initialized
|
|
309
327
|
* @param {boolean} [mPropertyBag.partialFlexState=false] - if true state is initialized partially and does not include flex bundles
|
|
310
328
|
* @returns {promise<undefined>} Resolves a promise as soon as FlexState is initialized
|
|
311
329
|
*/
|
|
312
330
|
FlexState.initialize = function(mPropertyBag) {
|
|
313
|
-
return
|
|
331
|
+
return Promise.all([
|
|
332
|
+
loadUShellServices(),
|
|
333
|
+
lazyLoadModules()
|
|
334
|
+
])
|
|
314
335
|
.then(function() {
|
|
315
336
|
enhancePropertyBag(mPropertyBag);
|
|
316
337
|
var sFlexReference = mPropertyBag.reference;
|
|
@@ -345,7 +366,7 @@ sap.ui.define([
|
|
|
345
366
|
* @param {string} [mPropertyBag.reference] - Flex reference of the app
|
|
346
367
|
* @param {object} [mPropertyBag.manifest] - Manifest that belongs to actual component
|
|
347
368
|
* @param {string} [mPropertyBag.componentData] - Component data of the current component
|
|
348
|
-
* @param {
|
|
369
|
+
* @param {string} [mPropertyBag.version] - Number of the version in which the state should be initialized
|
|
349
370
|
* @returns {promise<undefined>} Resolves a promise as soon as FlexState is initialized again
|
|
350
371
|
*/
|
|
351
372
|
FlexState.clearAndInitialize = function(mPropertyBag) {
|
|
@@ -362,6 +383,14 @@ sap.ui.define([
|
|
|
362
383
|
deRegisterMaxLayerHandler(sReference);
|
|
363
384
|
delete _mInstances[sReference];
|
|
364
385
|
delete _mInitPromises[sReference];
|
|
386
|
+
// TODO: get rid of the following deletes as far as the change state
|
|
387
|
+
// is migrated from changePersistenceFactory to the FlexState
|
|
388
|
+
if (_oChangePersistenceFactory && _oChangePersistenceFactory._instanceCache) {
|
|
389
|
+
delete _oChangePersistenceFactory._instanceCache[sReference];
|
|
390
|
+
}
|
|
391
|
+
if (_oFlexControllerFactory && _oFlexControllerFactory._instanceCache) {
|
|
392
|
+
delete _oFlexControllerFactory._instanceCache[sReference];
|
|
393
|
+
}
|
|
365
394
|
} else {
|
|
366
395
|
Object.keys(_mInstances).forEach(function(sReference) {
|
|
367
396
|
deRegisterMaxLayerHandler(sReference);
|
|
@@ -461,6 +490,7 @@ sap.ui.define([
|
|
|
461
490
|
return _mInstances[sReference].unfilteredStorageResponse;
|
|
462
491
|
});
|
|
463
492
|
}
|
|
493
|
+
return undefined;
|
|
464
494
|
};
|
|
465
495
|
// temporary function until the maps are ready
|
|
466
496
|
FlexState.getFlexObjectsFromStorageResponse = function(sReference) {
|
|
@@ -40,8 +40,13 @@ sap.ui.define([
|
|
|
40
40
|
|
|
41
41
|
if (oFlexItem.dependentSelector) {
|
|
42
42
|
Object.keys(oFlexItem.dependentSelector).forEach(function (sCategory) {
|
|
43
|
-
oFlexItem.dependentSelector[sCategory]
|
|
44
|
-
|
|
43
|
+
if (Array.isArray(oFlexItem.dependentSelector[sCategory])) {
|
|
44
|
+
oFlexItem.dependentSelector[sCategory] =
|
|
45
|
+
oFlexItem.dependentSelector[sCategory].map(getIdIsLocalTrueObject);
|
|
46
|
+
} else {
|
|
47
|
+
oFlexItem.dependentSelector[sCategory] =
|
|
48
|
+
getIdIsLocalTrueObject(oFlexItem.dependentSelector[sCategory]);
|
|
49
|
+
}
|
|
45
50
|
});
|
|
46
51
|
}
|
|
47
52
|
}
|
|
@@ -70,7 +75,7 @@ sap.ui.define([
|
|
|
70
75
|
* @namespace sap.ui.fl.apply._internal.flexState.Loader
|
|
71
76
|
* @experimental
|
|
72
77
|
* @since 1.74
|
|
73
|
-
* @version 1.
|
|
78
|
+
* @version 1.98.0
|
|
74
79
|
* @private
|
|
75
80
|
* @ui5-restricted sap.ui.fl.apply._internal.flexState
|
|
76
81
|
*/
|
|
@@ -108,6 +113,7 @@ sap.ui.define([
|
|
|
108
113
|
var sCacheKey = mPropertyBag.reInitialize ? undefined : ManifestUtils.getCacheKeyFromAsyncHints(mPropertyBag.reference, mPropertyBag.asyncHints);
|
|
109
114
|
|
|
110
115
|
return ApplyStorage.loadFlexData({
|
|
116
|
+
preview: ManifestUtils.getPreviewSectionFromAsyncHints(mPropertyBag.asyncHints),
|
|
111
117
|
reference: mPropertyBag.reference,
|
|
112
118
|
componentName: sComponentName,
|
|
113
119
|
cacheKey: sCacheKey,
|
|
@@ -20,15 +20,11 @@ function(
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
function getFlAsyncHint(oAsyncHints) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
return oFlAsyncHint;
|
|
23
|
+
if (oAsyncHints && oAsyncHints.requests && Array.isArray(oAsyncHints.requests)) {
|
|
24
|
+
return oAsyncHints.requests.find(function(oAsyncHint) {
|
|
25
|
+
return oAsyncHint.name === "sap.ui.fl.changes";
|
|
26
|
+
});
|
|
27
|
+
}
|
|
32
28
|
}
|
|
33
29
|
|
|
34
30
|
/**
|
|
@@ -37,7 +33,7 @@ function(
|
|
|
37
33
|
* @namespace sap.ui.fl.apply._internal.flexState.ManifestUtils
|
|
38
34
|
* @experimental
|
|
39
35
|
* @since 1.74
|
|
40
|
-
* @version 1.
|
|
36
|
+
* @version 1.98.0
|
|
41
37
|
* @private
|
|
42
38
|
*/
|
|
43
39
|
var ManifestUtils = {
|
|
@@ -49,8 +45,8 @@ function(
|
|
|
49
45
|
*/
|
|
50
46
|
getFlexReferenceForControl: function (oControl) {
|
|
51
47
|
var oAppComponent = Utils.getAppComponentForControl(oControl);
|
|
52
|
-
return ManifestUtils.getFlexReference({
|
|
53
|
-
manifest: oAppComponent.
|
|
48
|
+
return oAppComponent && ManifestUtils.getFlexReference({
|
|
49
|
+
manifest: oAppComponent.getManifestObject(),
|
|
54
50
|
componentData: oAppComponent.getComponentData()
|
|
55
51
|
});
|
|
56
52
|
},
|
|
@@ -85,21 +81,24 @@ function(
|
|
|
85
81
|
},
|
|
86
82
|
|
|
87
83
|
getCacheKeyFromAsyncHints: function(sReference, oAsyncHints) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
84
|
+
var oFlAsyncHint = getFlAsyncHint(oAsyncHints);
|
|
85
|
+
if (oFlAsyncHint && oFlAsyncHint.reference === sReference) {
|
|
86
|
+
return oFlAsyncHint.cachebusterToken || "<NO CHANGES>";
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
getPreviewSectionFromAsyncHints: function(oAsyncHints) {
|
|
91
|
+
var oFlAsyncHint = getFlAsyncHint(oAsyncHints);
|
|
92
|
+
if (oFlAsyncHint) {
|
|
93
|
+
return oFlAsyncHint.preview;
|
|
93
94
|
}
|
|
94
95
|
},
|
|
95
96
|
|
|
96
97
|
getChangeManifestFromAsyncHints: function(oAsyncHints) {
|
|
97
98
|
// whenever there is a back end providing a fl async hint it is also not necessary to merge on client side
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
return false;
|
|
102
|
-
}
|
|
99
|
+
var oFlAsyncHint = getFlAsyncHint(oAsyncHints);
|
|
100
|
+
if (oFlAsyncHint) {
|
|
101
|
+
return false;
|
|
103
102
|
}
|
|
104
103
|
|
|
105
104
|
return true;
|
|
@@ -114,7 +114,7 @@ sap.ui.define([
|
|
|
114
114
|
*
|
|
115
115
|
* @namespace sap.ui.fl.apply._internal.flexState.compVariants.CompVariantMerger
|
|
116
116
|
* @since 1.86
|
|
117
|
-
* @version 1.
|
|
117
|
+
* @version 1.98.0
|
|
118
118
|
* @private
|
|
119
119
|
* @ui5-restricted sap.ui.fl
|
|
120
120
|
*/
|
|
@@ -179,7 +179,7 @@ sap.ui.define([
|
|
|
179
179
|
*
|
|
180
180
|
* @function
|
|
181
181
|
* @since 1.89
|
|
182
|
-
* @version 1.
|
|
182
|
+
* @version 1.98.0
|
|
183
183
|
* @private
|
|
184
184
|
* @ui5-restricted sap.ui.fl
|
|
185
185
|
*
|
|
@@ -43,7 +43,7 @@ sap.ui.define([
|
|
|
43
43
|
* @namespace sap.ui.fl.apply._internal.flexState.controlVariants.VariantManagementState
|
|
44
44
|
* @experimental Since 1.74
|
|
45
45
|
* @since 1.74
|
|
46
|
-
* @version 1.
|
|
46
|
+
* @version 1.98.0
|
|
47
47
|
* @private
|
|
48
48
|
* @ui5-restricted
|
|
49
49
|
*/
|
|
@@ -482,7 +482,8 @@ sap.ui.define([
|
|
|
482
482
|
favorite: oVariant.content.content.favorite,
|
|
483
483
|
executeOnSelect: oVariant.content.content.executeOnSelect,
|
|
484
484
|
visible: oVariant.content.content.visible,
|
|
485
|
-
author: ObjectPath.get("content.support.user", oVariant)
|
|
485
|
+
author: ObjectPath.get("content.support.user", oVariant),
|
|
486
|
+
contexts: oVariant.content.contexts
|
|
486
487
|
})
|
|
487
488
|
);
|
|
488
489
|
});
|
|
@@ -587,21 +588,16 @@ sap.ui.define([
|
|
|
587
588
|
reference: mPropertyBag.reference,
|
|
588
589
|
changeInstance: true
|
|
589
590
|
});
|
|
590
|
-
var
|
|
591
|
-
|
|
592
|
-
aCurrentSelectors.push(oChange.getSelector());
|
|
593
|
-
}
|
|
594
|
-
return aCurrentSelectors;
|
|
595
|
-
}, []);
|
|
596
|
-
var aControls = [];
|
|
597
|
-
aSelectors.map(function(oSelector) {
|
|
591
|
+
var aControls = aCurrentVariantChanges.reduce(function(aCurrentControls, oChange) {
|
|
592
|
+
var oSelector = oChange.getSelector();
|
|
598
593
|
var oControl = JsControlTreeModifier.bySelector(oSelector, mPropertyBag.appComponent);
|
|
599
|
-
if (oControl) {
|
|
600
|
-
|
|
594
|
+
if (oControl && Utils.indexOfObject(aCurrentControls, {selector: oControl}) === -1) {
|
|
595
|
+
aCurrentControls.push({selector: oControl});
|
|
601
596
|
}
|
|
602
|
-
|
|
597
|
+
return aCurrentControls;
|
|
598
|
+
}, []);
|
|
603
599
|
|
|
604
|
-
return mPropertyBag.flexController.waitForChangesToBeApplied(aControls);
|
|
600
|
+
return aControls.length ? mPropertyBag.flexController.waitForChangesToBeApplied(aControls) : Promise.resolve();
|
|
605
601
|
};
|
|
606
602
|
|
|
607
603
|
return VariantManagementState;
|
|
@@ -285,6 +285,12 @@ sap.ui.define([
|
|
|
285
285
|
oVariantClone.content.content.visible = oActiveChange.getContent().visible;
|
|
286
286
|
}
|
|
287
287
|
break;
|
|
288
|
+
case "setContexts":
|
|
289
|
+
oActiveChange = getActiveChange(aChanges);
|
|
290
|
+
if (oActiveChange) {
|
|
291
|
+
oVariantClone.content.contexts = oActiveChange.getContent().contexts;
|
|
292
|
+
}
|
|
293
|
+
break;
|
|
288
294
|
default:
|
|
289
295
|
Log.error("No valid changes on variant " + oVariantClone.content.content.title + " available");
|
|
290
296
|
}
|
|
@@ -29,7 +29,7 @@ sap.ui.define([
|
|
|
29
29
|
* @namespace sap.ui.fl.apply.api.ControlVariantApplyAPI
|
|
30
30
|
* @experimental Since 1.67
|
|
31
31
|
* @since 1.67
|
|
32
|
-
* @version 1.
|
|
32
|
+
* @version 1.98.0
|
|
33
33
|
* @public
|
|
34
34
|
*/
|
|
35
35
|
var ControlVariantApplyAPI = /** @lends sap.ui.fl.apply.api.ControlVariantApplyAPI */{
|