@openui5/sap.ui.fl 1.140.0 → 1.141.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/.eslint-rules/import-check.js +71 -0
- package/THIRDPARTY.txt +2 -2
- package/package.json +3 -3
- package/src/sap/ui/fl/.library +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/LayerUtils.js +1 -1
- package/src/sap/ui/fl/Utils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +13 -3
- package/src/sap/ui/fl/apply/_internal/changes/Applier.js +3 -2
- package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/Reverter.js +4 -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 +1 -1
- 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/AddNewDataSource.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewInbound.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewOutbound.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddTechnicalAttributes.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/ChangeOutbound.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/RemoveAllInboundsExceptOne.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetAch.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetDescription.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/SetCloudDevAdaptationStatus.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/ChangeModel.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 +1 -1
- package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/extensionPoint/Registry.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/AnnotationChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/AppDescriptorChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/ControllerExtensionChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlVariant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +2 -8
- package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexObjects/VariantChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/VariantManagementChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor.js +6 -3
- package/src/sap/ui/fl/apply/_internal/flexState/DataSelector.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexState/FlexObjectState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +53 -161
- package/src/sap/ui/fl/apply/_internal/flexState/InitialPrepareFunctions.js +0 -8
- 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/changes/UIChangesState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantManagementState.js +2 -5
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +22 -5
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +54 -12
- package/src/sap/ui/fl/apply/_internal/init.js +47 -0
- package/src/sap/ui/fl/apply/_internal/preprocessors/ComponentLifecycleHooks.js +14 -5
- package/src/sap/ui/fl/apply/api/AnnotationChangeHandlerAPI.js +2 -1
- package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +190 -53
- package/src/sap/ui/fl/apply/api/DelegateMediatorAPI.js +17 -1
- package/src/sap/ui/fl/apply/api/ExtensionPointRegistryAPI.js +2 -1
- package/src/sap/ui/fl/apply/api/FlexRuntimeInfoAPI.js +2 -1
- package/src/sap/ui/fl/apply/api/SmartVariantManagementApplyAPI.js +2 -1
- package/src/sap/ui/fl/apply/api/UI2PersonalizationApplyAPI.js +2 -1
- package/src/sap/ui/fl/changeHandler/AddIFrame.js +1 -1
- package/src/sap/ui/fl/changeHandler/AddXML.js +2 -2
- package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +4 -4
- package/src/sap/ui/fl/changeHandler/Base.js +3 -2
- package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseAddXml.js +21 -9
- package/src/sap/ui/fl/changeHandler/BaseRename.js +1 -1
- package/src/sap/ui/fl/changeHandler/ChangeAnnotation.js +7 -2
- 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/changeHandler/common/createIFrame.js +1 -4
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorChange.js +3 -3
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +3 -3
- 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 +14 -12
- package/src/sap/ui/fl/initial/_internal/FlexConfiguration.js +1 -1
- package/src/sap/ui/fl/initial/_internal/Loader.js +243 -79
- package/src/sap/ui/fl/initial/_internal/ManifestUtils.js +1 -1
- package/src/sap/ui/fl/initial/_internal/Settings.js +1 -1
- package/src/sap/ui/fl/initial/_internal/Storage.js +1 -1
- package/src/sap/ui/fl/initial/_internal/StorageFeaturesMerger.js +1 -1
- package/src/sap/ui/fl/initial/_internal/StorageUtils.js +67 -9
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration.js +1 -1
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +12 -5
- package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +1 -1
- package/src/sap/ui/fl/{apply → initial}/_internal/preprocessors/ControllerExtension.js +15 -4
- package/src/sap/ui/fl/{apply → initial}/_internal/preprocessors/RegistrationDelegator.js +7 -38
- package/src/sap/ui/fl/{apply → initial}/_internal/preprocessors/XmlPreprocessor.js +28 -20
- package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +1 -1
- package/src/sap/ui/fl/initial/api/InitialFlexAPI.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 +44 -44
- package/src/sap/ui/fl/support/_internal/getAllUIChanges.js +1 -1
- package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +1 -1
- package/src/sap/ui/fl/support/_internal/getFlexObjectInfos.js +1 -1
- package/src/sap/ui/fl/support/_internal/getFlexSettings.js +1 -1
- package/src/sap/ui/fl/support/api/SupportAPI.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/transport/TransportSelection.js +1 -1
- package/src/sap/ui/fl/util/IFrame.js +3 -2
- package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
- package/src/sap/ui/fl/variants/VariantManagement.js +49 -36
- package/src/sap/ui/fl/variants/VariantManager.js +75 -15
- package/src/sap/ui/fl/variants/VariantModel.js +7 -165
- package/src/sap/ui/fl/write/_internal/Storage.js +1 -1
- package/src/sap/ui/fl/write/_internal/Versions.js +9 -5
- 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 +1 -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 +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/BtpServiceConnector.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 +1 -1
- 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/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 +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/FlexObjectManager.js +30 -21
- package/src/sap/ui/fl/write/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +3 -3
- package/src/sap/ui/fl/write/_internal/flexState/changes/UIChangeManager.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantManager.js +2 -19
- package/src/sap/ui/fl/write/_internal/init.js +27 -0
- 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/Adaptations.js +1 -1
- package/src/sap/ui/fl/write/api/AppVariantWriteAPI.js +2 -1
- package/src/sap/ui/fl/write/api/BusinessNetworkAPI.js +9 -8
- package/src/sap/ui/fl/write/api/ChangesWriteAPI.js +2 -1
- package/src/sap/ui/fl/write/api/ContextBasedAdaptationsAPI.js +2 -3
- package/src/sap/ui/fl/write/api/ContextSharingAPI.js +2 -1
- package/src/sap/ui/fl/write/api/ControlPersonalizationWriteAPI.js +2 -1
- package/src/sap/ui/fl/write/api/FeaturesAPI.js +2 -1
- package/src/sap/ui/fl/write/api/FieldExtensibility.js +3 -2
- package/src/sap/ui/fl/write/api/LocalResetAPI.js +2 -1
- package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +10 -3
- package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +5 -2
- package/src/sap/ui/fl/write/api/SACIntegrationUpdateVariant.js +2 -1
- package/src/sap/ui/fl/write/api/SmartBusinessWriteAPI.js +2 -1
- package/src/sap/ui/fl/write/api/SmartVariantManagementWriteAPI.js +2 -1
- package/src/sap/ui/fl/write/api/TranslationAPI.js +2 -1
- package/src/sap/ui/fl/write/api/UI2PersonalizationWriteAPI.js +2 -1
- package/src/sap/ui/fl/write/api/VersionsAPI.js +2 -1
- package/src/sap/ui/fl/write/api/connectors/FileListBaseConnector.js +2 -1
- package/src/sap/ui/fl/write/api/connectors/ObjectStorageConnector.js +2 -1
|
@@ -13,7 +13,6 @@ sap.ui.define([
|
|
|
13
13
|
"sap/ui/fl/apply/_internal/flexObjects/ControllerExtensionChange",
|
|
14
14
|
"sap/ui/fl/apply/_internal/flexObjects/FlexObject",
|
|
15
15
|
"sap/ui/fl/apply/_internal/flexObjects/FlVariant",
|
|
16
|
-
"sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor",
|
|
17
16
|
"sap/ui/fl/apply/_internal/flexObjects/States",
|
|
18
17
|
"sap/ui/fl/apply/_internal/flexObjects/UIChange",
|
|
19
18
|
"sap/ui/fl/apply/_internal/flexObjects/UpdatableChange",
|
|
@@ -33,7 +32,6 @@ sap.ui.define([
|
|
|
33
32
|
ControllerExtensionChange,
|
|
34
33
|
FlexObject,
|
|
35
34
|
FlVariant,
|
|
36
|
-
getVariantAuthor,
|
|
37
35
|
States,
|
|
38
36
|
UIChange,
|
|
39
37
|
UpdatableChange,
|
|
@@ -137,7 +135,7 @@ sap.ui.define([
|
|
|
137
135
|
*
|
|
138
136
|
* @namespace sap.ui.fl.apply._internal.flexObjects.FlexObjectFactory
|
|
139
137
|
* @since 1.100
|
|
140
|
-
* @version 1.
|
|
138
|
+
* @version 1.141.0
|
|
141
139
|
* @private
|
|
142
140
|
* @ui5-restricted sap.ui.fl
|
|
143
141
|
*/
|
|
@@ -262,7 +260,6 @@ sap.ui.define([
|
|
|
262
260
|
* @param {object} [mPropertyBag.layer] - See {@link sap.ui.fl.apply._internal.flexObjects.FlexObject}
|
|
263
261
|
* @param {string} [mPropertyBag.reference] - See {@link sap.ui.fl.apply._internal.flexObjects.FlexObject.FlexObjectMetadata}
|
|
264
262
|
* @param {string} [mPropertyBag.generator] - See {@link sap.ui.fl.apply._internal.flexObjects.FlexObject.SupportInformation}
|
|
265
|
-
* @param {object} [mPropertyBag.authors] - Map of user IDs to full names
|
|
266
263
|
* @param {boolean} [mPropertyBag.executeOnSelection] - Apply automatically the content of the variant
|
|
267
264
|
* @returns {sap.ui.fl.apply._internal.flexObjects.FlVariant} Variant instance
|
|
268
265
|
*/
|
|
@@ -280,7 +277,6 @@ sap.ui.define([
|
|
|
280
277
|
type: "XFLD"
|
|
281
278
|
}
|
|
282
279
|
};
|
|
283
|
-
mProperties.author = getVariantAuthor(mProperties.supportInformation.user, mProperties.layer, mPropertyBagClone.authors);
|
|
284
280
|
return new FlVariant(mProperties);
|
|
285
281
|
};
|
|
286
282
|
|
|
@@ -312,10 +308,9 @@ sap.ui.define([
|
|
|
312
308
|
* @param {object} [oFileContent.executeOnSelection] - see above
|
|
313
309
|
*
|
|
314
310
|
* @param {string} [oFileContent.persistencyKey] - see <code>sap.ui.fl.apply._internal.flexObjects.CompVariant</code>
|
|
315
|
-
* @param {object} [mAuthors] - Map of user IDs and users' names which is used to determine author of the variant
|
|
316
311
|
* @returns {sap.ui.fl.apply._internal.flexObjects.CompVariant} Created comp variant object
|
|
317
312
|
*/
|
|
318
|
-
FlexObjectFactory.createCompVariant = function(oFileContent
|
|
313
|
+
FlexObjectFactory.createCompVariant = function(oFileContent) {
|
|
319
314
|
const oFileContentClone = cloneIfObject(oFileContent);
|
|
320
315
|
oFileContentClone.generator ||= "FlexObjectFactory.createCompVariant";
|
|
321
316
|
oFileContentClone.user = ObjectPath.get("support.user", oFileContentClone);
|
|
@@ -340,7 +335,6 @@ sap.ui.define([
|
|
|
340
335
|
mCompVariantContent.content.executeOnSelection
|
|
341
336
|
);
|
|
342
337
|
}
|
|
343
|
-
mCompVariantContent.author = getVariantAuthor(mCompVariantContent.supportInformation.user, mCompVariantContent.layer, mAuthors);
|
|
344
338
|
return new CompVariant(mCompVariantContent);
|
|
345
339
|
};
|
|
346
340
|
|
|
@@ -19,7 +19,7 @@ sap.ui.define([
|
|
|
19
19
|
* @extends sap.ui.fl.apply._internal.flexObjects.FlexObject
|
|
20
20
|
* @alias sap.ui.fl.apply._internal.flexObjects.Variant
|
|
21
21
|
* @since 1.103
|
|
22
|
-
* @version 1.
|
|
22
|
+
* @version 1.141.0
|
|
23
23
|
* @private
|
|
24
24
|
* @ui5-restricted sap.ui.fl
|
|
25
25
|
*/
|
|
@@ -83,7 +83,7 @@ sap.ui.define([
|
|
|
83
83
|
this.setVariantId(this.getId());
|
|
84
84
|
}
|
|
85
85
|
if (!this.getAuthor()) {
|
|
86
|
-
this.setAuthor(getVariantAuthor(this.getSupportInformation().user, this.getLayer(),
|
|
86
|
+
this.setAuthor(getVariantAuthor(this.getSupportInformation().user, this.getLayer(), this.getFlexObjectMetadata().reference));
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
});
|
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/ui/core/Lib",
|
|
9
|
+
"sap/ui/fl/initial/_internal/Loader",
|
|
9
10
|
"sap/ui/fl/initial/_internal/Settings",
|
|
10
11
|
"sap/ui/fl/Layer"
|
|
11
12
|
], function(
|
|
12
13
|
Lib,
|
|
14
|
+
Loader,
|
|
13
15
|
Settings,
|
|
14
16
|
Layer
|
|
15
17
|
) {
|
|
@@ -21,19 +23,20 @@ sap.ui.define([
|
|
|
21
23
|
*
|
|
22
24
|
* @function
|
|
23
25
|
* @since 1.121
|
|
24
|
-
* @version 1.
|
|
26
|
+
* @version 1.141.0
|
|
25
27
|
* @private
|
|
26
28
|
* @ui5-restricted sap.ui.fl
|
|
27
29
|
* @alias module:sap/ui/fl/apply/_internal/flexState/compVariants/getVariantAuthor
|
|
28
30
|
*
|
|
29
31
|
* @param {string} sUserId - UserId of variant author
|
|
30
32
|
* @param {sap.ui.fl.Layer} sLayer - Layer in which the variant should be stored
|
|
31
|
-
* @param {
|
|
33
|
+
* @param {string} sReference - Reference of the application
|
|
32
34
|
* @returns {string} The resolved author of variant
|
|
33
35
|
*/
|
|
34
|
-
return (sUserId, sLayer,
|
|
36
|
+
return (sUserId, sLayer, sReference) => {
|
|
35
37
|
const sAuthor = sUserId || "";
|
|
36
38
|
const oSettings = Settings.getInstanceOrUndef();
|
|
39
|
+
const mMapIdsNames = Loader.getCachedFlexData(sReference).authors || {};
|
|
37
40
|
|
|
38
41
|
if (sLayer === Layer.USER || sAuthor === oSettings?.getUserId()) {
|
|
39
42
|
return Lib.getResourceBundleFor("sap.ui.fl").getText("VARIANT_SELF_OWNER_NAME");
|
|
@@ -122,7 +122,7 @@ sap.ui.define([
|
|
|
122
122
|
const sParameterValue = getParameterValue(oCurrentDataSelector);
|
|
123
123
|
// If no parameter value is provided for the last child selector in the chain
|
|
124
124
|
// skip it, start with its parent and thus return the whole cache entry
|
|
125
|
-
if (sParameterValue || oCurrentDataSelector !== oLowestDataSelector) {
|
|
125
|
+
if (sParameterValue !== undefined || oCurrentDataSelector !== oLowestDataSelector) {
|
|
126
126
|
if (sParameterValue === undefined) {
|
|
127
127
|
throw new Error(`Parameter '${oCurrentDataSelector.getParameterKey()}' is missing`);
|
|
128
128
|
}
|
|
@@ -243,7 +243,7 @@ sap.ui.define([
|
|
|
243
243
|
*/
|
|
244
244
|
DataSelector.prototype.get = function(mParameters) {
|
|
245
245
|
var sParameterKey = this.getParameterKey();
|
|
246
|
-
if (sParameterKey &&
|
|
246
|
+
if (sParameterKey && mParameters?.[sParameterKey] === undefined) {
|
|
247
247
|
throw new Error(`Parameter '${sParameterKey}' is missing`);
|
|
248
248
|
}
|
|
249
249
|
var vResult = this._getParameterizedCachedResult(mParameters);
|
|
@@ -20,7 +20,8 @@ sap.ui.define([
|
|
|
20
20
|
"sap/ui/fl/initial/_internal/ManifestUtils",
|
|
21
21
|
"sap/ui/fl/initial/_internal/FlexInfoSession",
|
|
22
22
|
"sap/ui/fl/initial/_internal/StorageUtils",
|
|
23
|
-
"sap/ui/fl/LayerUtils"
|
|
23
|
+
"sap/ui/fl/LayerUtils",
|
|
24
|
+
"sap/ui/fl/apply/_internal/init"
|
|
24
25
|
], function(
|
|
25
26
|
_omit,
|
|
26
27
|
Deferred,
|
|
@@ -83,14 +84,13 @@ sap.ui.define([
|
|
|
83
84
|
*
|
|
84
85
|
* @namespace sap.ui.fl.apply._internal.flexState.FlexState
|
|
85
86
|
* @since 1.73
|
|
86
|
-
* @version 1.
|
|
87
|
+
* @version 1.141.0
|
|
87
88
|
* @private
|
|
88
89
|
* @ui5-restricted sap.ui.fl.apply._internal
|
|
89
90
|
*/
|
|
90
91
|
const FlexState = {};
|
|
91
92
|
|
|
92
93
|
const _mInstances = {};
|
|
93
|
-
const _mCachedFlexData = {};
|
|
94
94
|
const _mInitPromises = {};
|
|
95
95
|
const _mFlexObjectInfo = {
|
|
96
96
|
appDescriptorChanges: {
|
|
@@ -157,10 +157,6 @@ sap.ui.define([
|
|
|
157
157
|
mPropertyBag.componentData ||= (oComponent && oComponent.getComponentData()) || {};
|
|
158
158
|
mPropertyBag.manifest ||= mPropertyBag.rawManifest || (oComponent && oComponent.getManifestObject()) || {};
|
|
159
159
|
mPropertyBag.reference ||= ManifestUtils.getFlexReference(mPropertyBag);
|
|
160
|
-
const oFlexInfoSession = FlexInfoSession.getByReference(mPropertyBag.reference);
|
|
161
|
-
mPropertyBag.version ||= oFlexInfoSession.version;
|
|
162
|
-
mPropertyBag.adaptationId ||= oFlexInfoSession.displayedAdaptationId;
|
|
163
|
-
mPropertyBag.allContextsProvided ||= oFlexInfoSession.allContextsProvided;
|
|
164
160
|
}
|
|
165
161
|
|
|
166
162
|
function createFlexObjects(oStorageResponse) {
|
|
@@ -309,7 +305,7 @@ sap.ui.define([
|
|
|
309
305
|
return bUpdate;
|
|
310
306
|
}
|
|
311
307
|
|
|
312
|
-
function initializeNewInstance(mPropertyBag) {
|
|
308
|
+
function initializeNewInstance(mPropertyBag, oFlexData) {
|
|
313
309
|
var sReference = mPropertyBag.reference;
|
|
314
310
|
var bDataUpdated = false;
|
|
315
311
|
if (!_mInstances[sReference].componentData && mPropertyBag.componentId) {
|
|
@@ -318,7 +314,7 @@ sap.ui.define([
|
|
|
318
314
|
bDataUpdated = true;
|
|
319
315
|
}
|
|
320
316
|
if (!_mInstances[sReference].storageResponse) {
|
|
321
|
-
_mInstances[sReference].storageResponse = filterByMaxLayer(sReference,
|
|
317
|
+
_mInstances[sReference].storageResponse = filterByMaxLayer(sReference, oFlexData);
|
|
322
318
|
// Flex objects need to be recreated
|
|
323
319
|
delete _mInstances[sReference].runtimePersistence;
|
|
324
320
|
bDataUpdated = true;
|
|
@@ -360,45 +356,13 @@ sap.ui.define([
|
|
|
360
356
|
return mFilteredReturn;
|
|
361
357
|
}
|
|
362
358
|
|
|
363
|
-
async function loadAndCacheFlexData(mPropertyBag) {
|
|
364
|
-
const mResponse = await Loader.loadFlexData(mPropertyBag);
|
|
365
|
-
if (!mPropertyBag.skipLoadBundle) {
|
|
366
|
-
mResponse.authors = await Loader.loadVariantsAuthors(mPropertyBag.reference);
|
|
367
|
-
}
|
|
368
|
-
_mCachedFlexData[mPropertyBag.reference] = merge({}, mResponse);
|
|
369
|
-
storeInfoInSession(mPropertyBag.reference, mResponse);
|
|
370
|
-
}
|
|
371
|
-
|
|
372
359
|
function prepareNewInstance(mPropertyBag) {
|
|
373
360
|
// The following line is used by the Flex Support Tool to set breakpoints - please adjust the tool if you change it!
|
|
374
361
|
_mInstances[mPropertyBag.reference] = merge({}, {
|
|
375
362
|
componentId: mPropertyBag.componentId,
|
|
376
363
|
componentData: mPropertyBag.componentData,
|
|
377
|
-
skipLoadBundle: mPropertyBag.skipLoadBundle
|
|
378
|
-
version: mPropertyBag.version,
|
|
379
|
-
allContextsProvided: mPropertyBag.allContextsProvided
|
|
364
|
+
skipLoadBundle: mPropertyBag.skipLoadBundle
|
|
380
365
|
});
|
|
381
|
-
|
|
382
|
-
// no further changes to storageResponse properties allowed
|
|
383
|
-
Object.freeze(_mInstances[mPropertyBag.reference].storageResponse);
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
function storeInfoInSession(sReference, mResponse) {
|
|
387
|
-
var oResponse = mResponse && mResponse.changes || {};
|
|
388
|
-
var oFlexInfoSession = FlexInfoSession.getByReference(sReference);
|
|
389
|
-
if (oResponse.info !== undefined) {
|
|
390
|
-
oFlexInfoSession = { ...oFlexInfoSession, ...oResponse.info };
|
|
391
|
-
}
|
|
392
|
-
FlexInfoSession.setByReference(oFlexInfoSession, sReference);
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
function checkPartialFlexState(mInitProperties) {
|
|
396
|
-
var oFlexInstance = _mInstances[mInitProperties.reference];
|
|
397
|
-
if (oFlexInstance.skipLoadBundle === true && mInitProperties.skipLoadBundle !== true) {
|
|
398
|
-
oFlexInstance.skipLoadBundle = false;
|
|
399
|
-
mInitProperties.partialFlexData = merge({}, _mCachedFlexData[mInitProperties.reference].changes);
|
|
400
|
-
mInitProperties.reInitialize = true;
|
|
401
|
-
}
|
|
402
366
|
}
|
|
403
367
|
|
|
404
368
|
function checkComponentIdChanged(mInitProperties) {
|
|
@@ -407,36 +371,24 @@ sap.ui.define([
|
|
|
407
371
|
return sFlexInstanceComponentId !== mInitProperties.componentId;
|
|
408
372
|
}
|
|
409
373
|
|
|
410
|
-
function
|
|
411
|
-
var sFlexInstanceVersion = _mInstances[mInitProperties.reference].version;
|
|
412
|
-
if (!mInitProperties.reInitialize && sFlexInstanceVersion !== mInitProperties.version) {
|
|
413
|
-
mInitProperties.reInitialize = true;
|
|
414
|
-
}
|
|
415
|
-
const bFlexInstanceAllContexts = _mInstances[mInitProperties.reference].allContextsProvided;
|
|
416
|
-
if (!mInitProperties.reInitialize && bFlexInstanceAllContexts !== mInitProperties.allContextsProvided) {
|
|
417
|
-
mInitProperties.reInitialize = true;
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
function rebuildResponseIfMaxLayerChanged(sReference) {
|
|
374
|
+
function rebuildResponseIfMaxLayerChanged(sReference, oFlexData) {
|
|
422
375
|
if (_mInstances[sReference]?.maxLayer !== FlexInfoSession.getByReference(sReference).maxLayer) {
|
|
423
|
-
FlexState.rebuildFilteredResponse(sReference);
|
|
376
|
+
FlexState.rebuildFilteredResponse(sReference, oFlexData);
|
|
424
377
|
}
|
|
425
378
|
}
|
|
426
379
|
|
|
427
380
|
function initializeEmptyState(sReference) {
|
|
428
381
|
_mInstances[sReference] = {
|
|
429
|
-
storageResponse: { changes: StorageUtils.getEmptyFlexDataResponse() },
|
|
430
382
|
emptyState: true,
|
|
431
383
|
// this makes sure that a proper initialize will still work as expected
|
|
432
384
|
reInitialize: true,
|
|
433
385
|
componentId: ""
|
|
434
386
|
};
|
|
435
|
-
_mCachedFlexData[sReference] = { changes: StorageUtils.getEmptyFlexDataResponse() };
|
|
436
387
|
const oNewInitPromise = new Deferred();
|
|
437
388
|
_mInitPromises[sReference] = oNewInitPromise;
|
|
438
389
|
oNewInitPromise.resolve();
|
|
439
|
-
|
|
390
|
+
const oEmptyResponse = Loader.initializeEmptyCache(sReference);
|
|
391
|
+
initializeNewInstance({ reference: sReference }, oEmptyResponse);
|
|
440
392
|
}
|
|
441
393
|
|
|
442
394
|
FlexState.getRuntimeOnlyData = function(sReference) {
|
|
@@ -457,8 +409,6 @@ sap.ui.define([
|
|
|
457
409
|
* @param {object} [mPropertyBag.rawManifest] - Raw JSON manifest that belongs to current component
|
|
458
410
|
* @param {string} [mPropertyBag.componentData] - Component data of the current component
|
|
459
411
|
* @param {object} [mPropertyBag.asyncHints] - Async hints passed from the app index to the component processing
|
|
460
|
-
* @param {string} [mPropertyBag.version] - Number of the version in which the state should be initialized
|
|
461
|
-
* @param {string} [mPropertyBag.adaptationId] - Context-based adaptation for which the state should be initialized
|
|
462
412
|
* @param {boolean} [mPropertyBag.skipLoadBundle=false] - if true state is initialized partially and does not include flex bundles
|
|
463
413
|
* @returns {Promise<undefined>} Resolves a promise as soon as FlexState is initialized
|
|
464
414
|
*/
|
|
@@ -467,29 +417,27 @@ sap.ui.define([
|
|
|
467
417
|
enhancePropertyBag(mProperties);
|
|
468
418
|
const sFlexReference = mProperties.reference;
|
|
469
419
|
|
|
420
|
+
// TODO: Probably obsolete, as the init call is awaited in the Loader
|
|
470
421
|
const oOldInitPromise = _mInitPromises[sFlexReference];
|
|
471
422
|
const oNewInitPromise = new Deferred();
|
|
472
423
|
_mInitPromises[sFlexReference] = oNewInitPromise;
|
|
473
424
|
|
|
474
425
|
if (oOldInitPromise) {
|
|
475
426
|
await oOldInitPromise.promise;
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
} else {
|
|
485
|
-
rebuildResponseIfMaxLayerChanged(mPropertyBag.reference);
|
|
486
|
-
}
|
|
487
|
-
} else {
|
|
488
|
-
await loadAndCacheFlexData(mProperties);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
const oFlexData = await Loader.getFlexData(mProperties);
|
|
430
|
+
if (
|
|
431
|
+
!_mInstances[mProperties.reference]?.storageResponse
|
|
432
|
+
|| oFlexData.cacheInvalidated
|
|
433
|
+
|| checkComponentIdChanged(mProperties)
|
|
434
|
+
) {
|
|
489
435
|
prepareNewInstance(mProperties);
|
|
436
|
+
} else {
|
|
437
|
+
rebuildResponseIfMaxLayerChanged(mProperties.reference, oFlexData.data);
|
|
490
438
|
}
|
|
491
439
|
|
|
492
|
-
initializeNewInstance(mProperties);
|
|
440
|
+
initializeNewInstance(mProperties, oFlexData.data);
|
|
493
441
|
oNewInitPromise.resolve();
|
|
494
442
|
};
|
|
495
443
|
|
|
@@ -524,27 +472,23 @@ sap.ui.define([
|
|
|
524
472
|
};
|
|
525
473
|
|
|
526
474
|
/**
|
|
527
|
-
*
|
|
528
|
-
* The new data must not be already available in the storageResponse or runtimePersistence.
|
|
529
|
-
* As of now this does not work with nested structures (comp related objects) or ui2personalization.
|
|
475
|
+
* Lazy loads the flex variant for a specific reference and adds it to the runtime persistence
|
|
530
476
|
*
|
|
531
477
|
* @param {object} mPropertyBag - Contains additional data needed for reading and storing changes
|
|
532
478
|
* @param {string} mPropertyBag.reference - Flex reference of the app
|
|
533
|
-
* @param {
|
|
479
|
+
* @param {string} mPropertyBag.variantReference - The reference of the variant to load.
|
|
534
480
|
*/
|
|
535
|
-
FlexState.
|
|
481
|
+
FlexState.lazyLoadFlVariant = async function(mPropertyBag) {
|
|
536
482
|
if (!_mInstances[mPropertyBag.reference]) {
|
|
537
483
|
initializeEmptyState(mPropertyBag.reference);
|
|
538
484
|
}
|
|
485
|
+
const oResult = await Loader.loadFlVariant(mPropertyBag);
|
|
539
486
|
const oInstance = _mInstances[mPropertyBag.reference];
|
|
540
|
-
|
|
541
|
-
_mCachedFlexData[mPropertyBag.reference].changes[sKey].push(...vValue);
|
|
542
|
-
});
|
|
543
|
-
oInstance.storageResponse = filterByMaxLayer(mPropertyBag.reference, _mCachedFlexData[mPropertyBag.reference]);
|
|
487
|
+
oInstance.storageResponse = filterByMaxLayer(mPropertyBag.reference, oResult.completeData);
|
|
544
488
|
oInstance.runtimePersistence.flexObjects =
|
|
545
489
|
[
|
|
546
490
|
...oInstance.runtimePersistence.flexObjects,
|
|
547
|
-
...createFlexObjects(filterByMaxLayer(mPropertyBag.reference, { changes:
|
|
491
|
+
...createFlexObjects(filterByMaxLayer(mPropertyBag.reference, { changes: oResult.newData }))
|
|
548
492
|
];
|
|
549
493
|
oFlexObjectsDataSelector.checkUpdate({ reference: mPropertyBag.reference });
|
|
550
494
|
};
|
|
@@ -557,11 +501,9 @@ sap.ui.define([
|
|
|
557
501
|
* @param {string} [mPropertyBag.reference] - Flex reference of the app
|
|
558
502
|
* @param {object} [mPropertyBag.manifest] - Manifest that belongs to actual component
|
|
559
503
|
* @param {string} [mPropertyBag.componentData] - Component data of the current component
|
|
560
|
-
* @param {string} [mPropertyBag.version] - Number of the version in which the state should be updated
|
|
561
|
-
* @param {string} [mPropertyBag.adaptationId] - Context-based adaptation for which the state should be updated
|
|
562
504
|
* @returns {Promise<undefined>} Resolves when the data is loaded and the runtime persistence is updated
|
|
563
505
|
*/
|
|
564
|
-
FlexState.
|
|
506
|
+
FlexState.reinitialize = async function(mPropertyBag) {
|
|
565
507
|
enhancePropertyBag(mPropertyBag);
|
|
566
508
|
const sReference = mPropertyBag.reference;
|
|
567
509
|
const oCurrentRuntimePersistence = _mInstances[sReference].runtimePersistence;
|
|
@@ -570,9 +512,10 @@ sap.ui.define([
|
|
|
570
512
|
const oNewInitPromise = new Deferred();
|
|
571
513
|
_mInitPromises[sReference] = oNewInitPromise;
|
|
572
514
|
await oOldInitPromise;
|
|
573
|
-
|
|
515
|
+
mPropertyBag.reInitialize = true;
|
|
516
|
+
const oResponse = await Loader.getFlexData(mPropertyBag);
|
|
574
517
|
prepareNewInstance(mPropertyBag);
|
|
575
|
-
_mInstances[sReference].storageResponse = filterByMaxLayer(sReference,
|
|
518
|
+
_mInstances[sReference].storageResponse = filterByMaxLayer(sReference, oResponse.data);
|
|
576
519
|
const bUpdated = updateRuntimePersistence(
|
|
577
520
|
sReference,
|
|
578
521
|
_mInstances[sReference].storageResponse,
|
|
@@ -584,31 +527,6 @@ sap.ui.define([
|
|
|
584
527
|
oNewInitPromise.resolve();
|
|
585
528
|
};
|
|
586
529
|
|
|
587
|
-
function getChangeCategory(oChangeDefinition) {
|
|
588
|
-
switch (oChangeDefinition.fileType) {
|
|
589
|
-
case "change":
|
|
590
|
-
if (oChangeDefinition.selector && oChangeDefinition.selector.persistencyKey) {
|
|
591
|
-
return ["comp", "changes"];
|
|
592
|
-
}
|
|
593
|
-
if (oChangeDefinition.variantReference) {
|
|
594
|
-
return "variantDependentControlChanges";
|
|
595
|
-
}
|
|
596
|
-
return "changes";
|
|
597
|
-
case "ctrl_variant":
|
|
598
|
-
return "variants";
|
|
599
|
-
case "ctrl_variant_change":
|
|
600
|
-
return "variantChanges";
|
|
601
|
-
case "ctrl_variant_management_change":
|
|
602
|
-
return "variantManagementChanges";
|
|
603
|
-
case "variant":
|
|
604
|
-
return ["comp", "variants"];
|
|
605
|
-
case "annotation_change":
|
|
606
|
-
return "annotationChanges";
|
|
607
|
-
default:
|
|
608
|
-
return "";
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
|
|
612
530
|
/**
|
|
613
531
|
* Some save operations don't require a complete new data request, so the storage response gets a live update.
|
|
614
532
|
* This will also update the runtime persistence.
|
|
@@ -616,43 +534,30 @@ sap.ui.define([
|
|
|
616
534
|
* @param {string} sReference - Flex reference of the app
|
|
617
535
|
* @param {object[]} aUpdates - All new FlexObjects in JSON format
|
|
618
536
|
*/
|
|
619
|
-
FlexState.
|
|
537
|
+
FlexState.update = function(sReference, aUpdates) {
|
|
620
538
|
const aFlexObjectUpdates = [];
|
|
539
|
+
StorageUtils.updateStorageResponse(_mInstances[sReference].storageResponse, aUpdates);
|
|
540
|
+
Loader.updateCachedResponse(sReference, aUpdates);
|
|
621
541
|
aUpdates.forEach((oUpdate) => {
|
|
622
|
-
if (oUpdate.type
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
const sFileName = oUpdate.flexObject.fileName;
|
|
627
|
-
const aUnfiltered = ObjectPath.get(vPath, _mCachedFlexData[sReference].changes);
|
|
628
|
-
const aFiltered = ObjectPath.get(vPath, _mInstances[sReference].storageResponse.changes);
|
|
629
|
-
const iExistingFlexObjectIdx = _mInstances[sReference].runtimePersistence.flexObjects.findIndex(
|
|
630
|
-
(oFlexObject) => oFlexObject.getId() === sFileName
|
|
542
|
+
if (oUpdate.type !== "ui2") {
|
|
543
|
+
// In some scenarios the runtime persistence is already updated
|
|
544
|
+
const iExistingFlexObjectIndex = _mInstances[sReference].runtimePersistence.flexObjects.findIndex(
|
|
545
|
+
(oFlexObject) => oFlexObject.getId() === oUpdate.flexObject.fileName
|
|
631
546
|
);
|
|
632
|
-
const oExistingFlexObject = _mInstances[sReference].runtimePersistence.flexObjects[
|
|
547
|
+
const oExistingFlexObject = _mInstances[sReference].runtimePersistence.flexObjects[iExistingFlexObjectIndex];
|
|
633
548
|
switch (oUpdate.type) {
|
|
634
549
|
case "add":
|
|
635
|
-
|
|
636
|
-
aFiltered.push(oUpdate.flexObject);
|
|
637
|
-
if (iExistingFlexObjectIdx < 0) {
|
|
550
|
+
if (iExistingFlexObjectIndex < 0) {
|
|
638
551
|
throw new Error("Flex response includes unknown flex object");
|
|
639
552
|
}
|
|
640
553
|
break;
|
|
641
554
|
case "delete":
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
if (iExistingFlexObjectIdx >= 0) {
|
|
645
|
-
_mInstances[sReference].runtimePersistence.flexObjects.splice(iExistingFlexObjectIdx, 1);
|
|
555
|
+
if (iExistingFlexObjectIndex >= 0) {
|
|
556
|
+
_mInstances[sReference].runtimePersistence.flexObjects.splice(iExistingFlexObjectIndex, 1);
|
|
646
557
|
aFlexObjectUpdates.push({ type: "removeFlexObject", updatedObject: oExistingFlexObject });
|
|
647
558
|
}
|
|
648
559
|
break;
|
|
649
560
|
case "update":
|
|
650
|
-
aFiltered.splice(aFiltered.findIndex((oFlexObject) => oFlexObject.fileName === sFileName), 1, oUpdate.flexObject);
|
|
651
|
-
aUnfiltered.splice(
|
|
652
|
-
aUnfiltered.findIndex((oFlexObject) => oFlexObject.fileName === sFileName),
|
|
653
|
-
1,
|
|
654
|
-
oUpdate.flexObject
|
|
655
|
-
);
|
|
656
561
|
if (oExistingFlexObject && oExistingFlexObject.getState() !== States.LifecycleState.PERSISTED) {
|
|
657
562
|
oExistingFlexObject.setResponse(oUpdate.flexObject);
|
|
658
563
|
aFlexObjectUpdates.push({ type: "updateFlexObject", updatedObject: oExistingFlexObject });
|
|
@@ -662,12 +567,13 @@ sap.ui.define([
|
|
|
662
567
|
}
|
|
663
568
|
}
|
|
664
569
|
});
|
|
665
|
-
if (aFlexObjectUpdates.length
|
|
570
|
+
if (aFlexObjectUpdates.length) {
|
|
666
571
|
oFlexObjectsDataSelector.checkUpdate({ reference: sReference }, aFlexObjectUpdates);
|
|
667
572
|
}
|
|
668
573
|
};
|
|
669
574
|
|
|
670
575
|
FlexState.clearState = function(sReference) {
|
|
576
|
+
Loader.clearCache(sReference);
|
|
671
577
|
if (sReference) {
|
|
672
578
|
delete _mInstances[sReference];
|
|
673
579
|
delete _mInitPromises[sReference];
|
|
@@ -722,10 +628,11 @@ sap.ui.define([
|
|
|
722
628
|
* and removes the internal maps for the given reference.
|
|
723
629
|
*
|
|
724
630
|
* @param {string} sReference - Flex reference of the app
|
|
631
|
+
* @param {object} oFlexData - Flex data to be used for rebuilding the response
|
|
725
632
|
*/
|
|
726
|
-
FlexState.rebuildFilteredResponse = function(sReference) {
|
|
633
|
+
FlexState.rebuildFilteredResponse = function(sReference, oFlexData) {
|
|
727
634
|
if (_mInstances[sReference]) {
|
|
728
|
-
_mInstances[sReference].storageResponse = filterByMaxLayer(sReference,
|
|
635
|
+
_mInstances[sReference].storageResponse = filterByMaxLayer(sReference, oFlexData);
|
|
729
636
|
// Storage response has changed, recreate the flex objects
|
|
730
637
|
_mInstances[sReference].runtimePersistence = buildRuntimePersistence(
|
|
731
638
|
_mInstances[sReference],
|
|
@@ -808,7 +715,7 @@ sap.ui.define([
|
|
|
808
715
|
};
|
|
809
716
|
|
|
810
717
|
FlexState.getUI2Personalization = function(sReference) {
|
|
811
|
-
return merge({},
|
|
718
|
+
return merge({}, _mInstances[sReference].storageResponse.changes.ui2personalization);
|
|
812
719
|
};
|
|
813
720
|
|
|
814
721
|
FlexState.callPrepareFunction = function(sMapName, mPropertyBag) {
|
|
@@ -816,13 +723,12 @@ sap.ui.define([
|
|
|
816
723
|
};
|
|
817
724
|
|
|
818
725
|
// TODO: used by the CompVariantState to mutate the storage response, this has to be changed
|
|
819
|
-
FlexState.getStorageResponse = function(sReference) {
|
|
726
|
+
FlexState.getStorageResponse = async function(sReference) {
|
|
820
727
|
if (_mInitPromises[sReference]) {
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
});
|
|
728
|
+
await _mInitPromises[sReference].promise;
|
|
729
|
+
return Loader.getCachedFlexData(sReference);
|
|
824
730
|
}
|
|
825
|
-
return
|
|
731
|
+
return undefined;
|
|
826
732
|
};
|
|
827
733
|
|
|
828
734
|
FlexState.getComponentData = function(sReference) {
|
|
@@ -838,19 +744,5 @@ sap.ui.define([
|
|
|
838
744
|
return _mExternalData.smartVariantManagementControls[sReference] || [];
|
|
839
745
|
};
|
|
840
746
|
|
|
841
|
-
/**
|
|
842
|
-
* This function is temporary and will be removed once the allContextsProvided property is part of the flex/data requests in ABAP
|
|
843
|
-
* The allContextsProvided property is not part of the initial flex/data request and needs to be set later to prevent
|
|
844
|
-
* FlexState from being reinitialized
|
|
845
|
-
*
|
|
846
|
-
* @param {string} sReference - Flexibility reference of the app
|
|
847
|
-
* @param {boolean} bAllContextsProvided - Flag to indicate if all contexts are provided
|
|
848
|
-
*/
|
|
849
|
-
FlexState.setAllContextsProvided = function(sReference, bAllContextsProvided) {
|
|
850
|
-
if (_mInstances[sReference] && _mInstances[sReference].allContextsProvided === undefined) {
|
|
851
|
-
_mInstances[sReference].allContextsProvided = bAllContextsProvided;
|
|
852
|
-
}
|
|
853
|
-
};
|
|
854
|
-
|
|
855
747
|
return FlexState;
|
|
856
748
|
});
|
|
@@ -7,7 +7,6 @@ sap.ui.define([
|
|
|
7
7
|
"sap/ui/core/Lib",
|
|
8
8
|
"sap/ui/fl/apply/_internal/controlVariants/Utils",
|
|
9
9
|
"sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory",
|
|
10
|
-
"sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor",
|
|
11
10
|
"sap/ui/fl/apply/_internal/flexObjects/States",
|
|
12
11
|
"sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler",
|
|
13
12
|
"sap/ui/fl/Layer"
|
|
@@ -15,7 +14,6 @@ sap.ui.define([
|
|
|
15
14
|
Lib,
|
|
16
15
|
ControlVariantUtils,
|
|
17
16
|
FlexObjectFactory,
|
|
18
|
-
getVariantAuthor,
|
|
19
17
|
States,
|
|
20
18
|
DependencyHandler,
|
|
21
19
|
Layer
|
|
@@ -33,12 +31,6 @@ sap.ui.define([
|
|
|
33
31
|
const InitialPrepareFunctions = {};
|
|
34
32
|
|
|
35
33
|
InitialPrepareFunctions.variants = function(mPropertyBag) {
|
|
36
|
-
// Exchange author of fl variant from userID to user's name
|
|
37
|
-
mPropertyBag.flexObjects.forEach((oFlexObject) => {
|
|
38
|
-
if (oFlexObject.getFileType() === "ctrl_variant") {
|
|
39
|
-
oFlexObject.setAuthor(getVariantAuthor(oFlexObject.getSupportInformation().user, oFlexObject.getLayer(), mPropertyBag.storageResponse.authors));
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
34
|
const aVariantIds = (mPropertyBag.storageResponse.changes.variants || [])
|
|
43
35
|
.map(function(oVariantDef) {
|
|
44
36
|
return oVariantDef.fileName;
|