@openui5/sap.ui.fl 1.139.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 +2 -2
- 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 +14 -12
- package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +2 -2
- 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 +13 -10
- 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 +2 -2
- 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 +5 -5
- package/src/sap/ui/fl/apply/_internal/flexState/FlexObjectState.js +12 -26
- package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +68 -229
- 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 +3 -3
- package/src/sap/ui/fl/apply/_internal/flexState/changes/UIChangesState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/communication/FLPAboutInfo.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantManagementState.js +287 -10
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/applyChangesOnVariant.js +61 -0
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +22 -5
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +72 -19
- package/src/sap/ui/fl/apply/_internal/init.js +47 -0
- package/src/sap/ui/fl/apply/_internal/preprocessors/ComponentLifecycleHooks.js +17 -7
- 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 +6 -5
- package/src/sap/ui/fl/apply/api/SmartVariantManagementApplyAPI.js +45 -45
- 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 +372 -0
- package/src/sap/ui/fl/{apply/_internal/flexState → 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 +16 -5
- package/src/sap/ui/fl/{apply → initial}/_internal/preprocessors/RegistrationDelegator.js +9 -40
- package/src/sap/ui/fl/{apply → initial}/_internal/preprocessors/XmlPreprocessor.js +29 -21
- 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/messagebundle_vi.properties +1 -1
- package/src/sap/ui/fl/support/_internal/extractChangeDependencies.js +1 -1
- package/src/sap/ui/fl/support/_internal/getAllUIChanges.js +2 -2
- package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +1 -1
- package/src/sap/ui/fl/support/_internal/getFlexObjectInfos.js +2 -2
- 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 +5 -4
- package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
- package/src/sap/ui/fl/variants/VariantManagement.js +88 -36
- package/src/sap/ui/fl/variants/VariantManager.js +81 -21
- package/src/sap/ui/fl/variants/VariantModel.js +38 -189
- package/src/sap/ui/fl/write/_internal/SaveAs.js +1 -1
- package/src/sap/ui/fl/write/_internal/Storage.js +14 -1
- package/src/sap/ui/fl/write/_internal/Versions.js +9 -5
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +10 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +6 -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 +27 -2
- package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +4 -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 +40 -71
- 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/{CompVariantState.js → CompVariantManager.js} +176 -309
- package/src/sap/ui/fl/write/_internal/init.js +27 -0
- package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +2 -2
- 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 +4 -2
- package/src/sap/ui/fl/write/api/BusinessNetworkAPI.js +60 -26
- package/src/sap/ui/fl/write/api/ChangesWriteAPI.js +4 -3
- package/src/sap/ui/fl/write/api/ContextBasedAdaptationsAPI.js +19 -23
- package/src/sap/ui/fl/write/api/ContextSharingAPI.js +3 -2
- 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 +3 -2
- package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +23 -20
- package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +10 -7
- package/src/sap/ui/fl/write/api/SACIntegrationUpdateVariant.js +8 -7
- package/src/sap/ui/fl/write/api/SmartBusinessWriteAPI.js +3 -2
- package/src/sap/ui/fl/write/api/SmartVariantManagementWriteAPI.js +26 -22
- package/src/sap/ui/fl/write/api/TranslationAPI.js +3 -2
- package/src/sap/ui/fl/write/api/UI2PersonalizationWriteAPI.js +4 -3
- package/src/sap/ui/fl/write/api/VersionsAPI.js +4 -3
- package/src/sap/ui/fl/write/api/connectors/FileListBaseConnector.js +3 -2
- package/src/sap/ui/fl/write/api/connectors/ObjectStorageConnector.js +4 -2
- package/src/sap/ui/fl/write/connectors/BaseConnector.js +13 -0
- package/ui5.yaml +0 -1
- package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +0 -208
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +0 -233
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/prepareCompVariantsMap.js +0 -118
- package/src/sap/ui/fl/util/resolveBinding.js +0 -79
|
@@ -14,14 +14,14 @@ sap.ui.define([
|
|
|
14
14
|
"sap/ui/core/Component",
|
|
15
15
|
"sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory",
|
|
16
16
|
"sap/ui/fl/apply/_internal/flexObjects/States",
|
|
17
|
-
"sap/ui/fl/apply/_internal/flexState/compVariants/prepareCompVariantsMap",
|
|
18
17
|
"sap/ui/fl/apply/_internal/flexState/DataSelector",
|
|
19
18
|
"sap/ui/fl/apply/_internal/flexState/InitialPrepareFunctions",
|
|
20
|
-
"sap/ui/fl/
|
|
21
|
-
"sap/ui/fl/
|
|
19
|
+
"sap/ui/fl/initial/_internal/Loader",
|
|
20
|
+
"sap/ui/fl/initial/_internal/ManifestUtils",
|
|
22
21
|
"sap/ui/fl/initial/_internal/FlexInfoSession",
|
|
23
22
|
"sap/ui/fl/initial/_internal/StorageUtils",
|
|
24
|
-
"sap/ui/fl/LayerUtils"
|
|
23
|
+
"sap/ui/fl/LayerUtils",
|
|
24
|
+
"sap/ui/fl/apply/_internal/init"
|
|
25
25
|
], function(
|
|
26
26
|
_omit,
|
|
27
27
|
Deferred,
|
|
@@ -32,7 +32,6 @@ sap.ui.define([
|
|
|
32
32
|
Component,
|
|
33
33
|
FlexObjectFactory,
|
|
34
34
|
States,
|
|
35
|
-
prepareCompVariantsMap,
|
|
36
35
|
DataSelector,
|
|
37
36
|
InitialPrepareFunctions,
|
|
38
37
|
Loader,
|
|
@@ -51,9 +50,6 @@ sap.ui.define([
|
|
|
51
50
|
* The persistence happens inside an object mapped to the component reference, with the following properties:
|
|
52
51
|
*
|
|
53
52
|
* {
|
|
54
|
-
* preparedMaps: {
|
|
55
|
-
* compVariantsMap: {},
|
|
56
|
-
* },
|
|
57
53
|
* storageResponse: {
|
|
58
54
|
* changes: {
|
|
59
55
|
* annotationChanges: [...],
|
|
@@ -88,14 +84,13 @@ sap.ui.define([
|
|
|
88
84
|
*
|
|
89
85
|
* @namespace sap.ui.fl.apply._internal.flexState.FlexState
|
|
90
86
|
* @since 1.73
|
|
91
|
-
* @version 1.
|
|
87
|
+
* @version 1.141.0
|
|
92
88
|
* @private
|
|
93
89
|
* @ui5-restricted sap.ui.fl.apply._internal
|
|
94
90
|
*/
|
|
95
91
|
const FlexState = {};
|
|
96
92
|
|
|
97
93
|
const _mInstances = {};
|
|
98
|
-
const _mCachedFlexData = {};
|
|
99
94
|
const _mInitPromises = {};
|
|
100
95
|
const _mFlexObjectInfo = {
|
|
101
96
|
appDescriptorChanges: {
|
|
@@ -112,17 +107,17 @@ sap.ui.define([
|
|
|
112
107
|
initialPreparationFunctionName: "variants",
|
|
113
108
|
pathInResponse: ["variants", "variantChanges", "variantDependentControlChanges", "variantManagementChanges"]
|
|
114
109
|
},
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
pathInResponse: ["comp.variants", "comp.standardVariants", "comp.defaultVariants", "comp.changes"]
|
|
110
|
+
comp: {
|
|
111
|
+
pathInResponse: ["comp.changes", "comp.defaultVariants", "comp.standardVariants", "comp.variants"]
|
|
118
112
|
}
|
|
119
113
|
};
|
|
114
|
+
|
|
120
115
|
// some runtime data is only fetched once (e.g. during control init) and has to survive an invalidation of the FlexState
|
|
121
116
|
// TODO: Move to runtime persistence as soon as flex objects are no longer deleted during cache invalidation
|
|
122
117
|
// but instead updated with the new data from the flex response
|
|
123
118
|
const _mExternalData = {
|
|
124
|
-
|
|
125
|
-
|
|
119
|
+
flexObjects: {},
|
|
120
|
+
smartVariantManagementControls: {}
|
|
126
121
|
};
|
|
127
122
|
|
|
128
123
|
function prepareChangeDefinitions(sStorageResponseKey, vStorageResponsePart) {
|
|
@@ -162,10 +157,6 @@ sap.ui.define([
|
|
|
162
157
|
mPropertyBag.componentData ||= (oComponent && oComponent.getComponentData()) || {};
|
|
163
158
|
mPropertyBag.manifest ||= mPropertyBag.rawManifest || (oComponent && oComponent.getManifestObject()) || {};
|
|
164
159
|
mPropertyBag.reference ||= ManifestUtils.getFlexReference(mPropertyBag);
|
|
165
|
-
const oFlexInfoSession = FlexInfoSession.getByReference(mPropertyBag.reference);
|
|
166
|
-
mPropertyBag.version ||= oFlexInfoSession.version;
|
|
167
|
-
mPropertyBag.adaptationId ||= oFlexInfoSession.displayedAdaptationId;
|
|
168
|
-
mPropertyBag.allContextsProvided ||= oFlexInfoSession.allContextsProvided;
|
|
169
160
|
}
|
|
170
161
|
|
|
171
162
|
function createFlexObjects(oStorageResponse) {
|
|
@@ -187,14 +178,6 @@ sap.ui.define([
|
|
|
187
178
|
return undefined;
|
|
188
179
|
}
|
|
189
180
|
|
|
190
|
-
function initializeState(sMapName, mPropertyBag, sReference) {
|
|
191
|
-
mPropertyBag.reference = sReference;
|
|
192
|
-
var oUpdate = runInitialPreparation(sMapName, mPropertyBag);
|
|
193
|
-
if (oUpdate) {
|
|
194
|
-
updateInstance(sReference, oUpdate);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
181
|
var oFlexObjectsDataSelector = new DataSelector({
|
|
199
182
|
id: "flexObjects",
|
|
200
183
|
parameterKey: "reference",
|
|
@@ -238,32 +221,6 @@ sap.ui.define([
|
|
|
238
221
|
}
|
|
239
222
|
});
|
|
240
223
|
|
|
241
|
-
function getInstanceEntryOrThrowError(sReference, sMapName) {
|
|
242
|
-
if (!_mInstances[sReference]) {
|
|
243
|
-
initializeEmptyState(sReference);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
if (!_mInstances[sReference].preparedMaps[sMapName]) {
|
|
247
|
-
var mPropertyBag = {
|
|
248
|
-
unfilteredStorageResponse: _mCachedFlexData[sReference],
|
|
249
|
-
storageResponse: _mInstances[sReference].storageResponse,
|
|
250
|
-
componentId: _mInstances[sReference].componentId,
|
|
251
|
-
componentData: _mInstances[sReference].componentData,
|
|
252
|
-
reference: sReference,
|
|
253
|
-
runtimePersistence: _mInstances[sReference].runtimePersistence
|
|
254
|
-
};
|
|
255
|
-
_mInstances[sReference].preparedMaps[sMapName] = FlexState.callPrepareFunction(sMapName, mPropertyBag);
|
|
256
|
-
initializeState(sMapName, mPropertyBag, sReference);
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
return _mInstances[sReference].preparedMaps[sMapName];
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
function updateInstance(sReference, oUpdate) {
|
|
263
|
-
_mInstances[sReference] = merge(_mInstances[sReference], oUpdate);
|
|
264
|
-
oFlexObjectsDataSelector.checkUpdate({ reference: sReference });
|
|
265
|
-
}
|
|
266
|
-
|
|
267
224
|
function buildRuntimePersistence(oFlexStateInstance, aExternalFlexObjects) {
|
|
268
225
|
const oStorageResponse = oFlexStateInstance.storageResponse;
|
|
269
226
|
var oRuntimePersistence = {
|
|
@@ -348,7 +305,7 @@ sap.ui.define([
|
|
|
348
305
|
return bUpdate;
|
|
349
306
|
}
|
|
350
307
|
|
|
351
|
-
function initializeNewInstance(mPropertyBag) {
|
|
308
|
+
function initializeNewInstance(mPropertyBag, oFlexData) {
|
|
352
309
|
var sReference = mPropertyBag.reference;
|
|
353
310
|
var bDataUpdated = false;
|
|
354
311
|
if (!_mInstances[sReference].componentData && mPropertyBag.componentId) {
|
|
@@ -357,7 +314,7 @@ sap.ui.define([
|
|
|
357
314
|
bDataUpdated = true;
|
|
358
315
|
}
|
|
359
316
|
if (!_mInstances[sReference].storageResponse) {
|
|
360
|
-
_mInstances[sReference].storageResponse = filterByMaxLayer(sReference,
|
|
317
|
+
_mInstances[sReference].storageResponse = filterByMaxLayer(sReference, oFlexData);
|
|
361
318
|
// Flex objects need to be recreated
|
|
362
319
|
delete _mInstances[sReference].runtimePersistence;
|
|
363
320
|
bDataUpdated = true;
|
|
@@ -376,7 +333,7 @@ sap.ui.define([
|
|
|
376
333
|
}
|
|
377
334
|
|
|
378
335
|
if (bDataUpdated) {
|
|
379
|
-
oFlexObjectsDataSelector.checkUpdate({ reference: sReference
|
|
336
|
+
oFlexObjectsDataSelector.checkUpdate({ reference: sReference});
|
|
380
337
|
}
|
|
381
338
|
}
|
|
382
339
|
|
|
@@ -399,46 +356,13 @@ sap.ui.define([
|
|
|
399
356
|
return mFilteredReturn;
|
|
400
357
|
}
|
|
401
358
|
|
|
402
|
-
async function loadAndCacheFlexData(mPropertyBag) {
|
|
403
|
-
const mResponse = await Loader.loadFlexData(mPropertyBag);
|
|
404
|
-
if (!mPropertyBag.skipLoadBundle) {
|
|
405
|
-
mResponse.authors = await Loader.loadVariantsAuthors(mPropertyBag.reference);
|
|
406
|
-
}
|
|
407
|
-
_mCachedFlexData[mPropertyBag.reference] = merge({}, mResponse);
|
|
408
|
-
storeInfoInSession(mPropertyBag.reference, mResponse);
|
|
409
|
-
}
|
|
410
|
-
|
|
411
359
|
function prepareNewInstance(mPropertyBag) {
|
|
412
360
|
// The following line is used by the Flex Support Tool to set breakpoints - please adjust the tool if you change it!
|
|
413
361
|
_mInstances[mPropertyBag.reference] = merge({}, {
|
|
414
|
-
preparedMaps: {},
|
|
415
362
|
componentId: mPropertyBag.componentId,
|
|
416
363
|
componentData: mPropertyBag.componentData,
|
|
417
|
-
skipLoadBundle: mPropertyBag.skipLoadBundle
|
|
418
|
-
version: mPropertyBag.version,
|
|
419
|
-
allContextsProvided: mPropertyBag.allContextsProvided
|
|
364
|
+
skipLoadBundle: mPropertyBag.skipLoadBundle
|
|
420
365
|
});
|
|
421
|
-
|
|
422
|
-
// no further changes to storageResponse properties allowed
|
|
423
|
-
Object.freeze(_mInstances[mPropertyBag.reference].storageResponse);
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
function storeInfoInSession(sReference, mResponse) {
|
|
427
|
-
var oResponse = mResponse && mResponse.changes || {};
|
|
428
|
-
var oFlexInfoSession = FlexInfoSession.getByReference(sReference);
|
|
429
|
-
if (oResponse.info !== undefined) {
|
|
430
|
-
oFlexInfoSession = { ...oFlexInfoSession, ...oResponse.info };
|
|
431
|
-
}
|
|
432
|
-
FlexInfoSession.setByReference(oFlexInfoSession, sReference);
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
function checkPartialFlexState(mInitProperties) {
|
|
436
|
-
var oFlexInstance = _mInstances[mInitProperties.reference];
|
|
437
|
-
if (oFlexInstance.skipLoadBundle === true && mInitProperties.skipLoadBundle !== true) {
|
|
438
|
-
oFlexInstance.skipLoadBundle = false;
|
|
439
|
-
mInitProperties.partialFlexData = merge({}, _mCachedFlexData[mInitProperties.reference].changes);
|
|
440
|
-
mInitProperties.reInitialize = true;
|
|
441
|
-
}
|
|
442
366
|
}
|
|
443
367
|
|
|
444
368
|
function checkComponentIdChanged(mInitProperties) {
|
|
@@ -447,37 +371,24 @@ sap.ui.define([
|
|
|
447
371
|
return sFlexInstanceComponentId !== mInitProperties.componentId;
|
|
448
372
|
}
|
|
449
373
|
|
|
450
|
-
function
|
|
451
|
-
var sFlexInstanceVersion = _mInstances[mInitProperties.reference].version;
|
|
452
|
-
if (!mInitProperties.reInitialize && sFlexInstanceVersion !== mInitProperties.version) {
|
|
453
|
-
mInitProperties.reInitialize = true;
|
|
454
|
-
}
|
|
455
|
-
const bFlexInstanceAllContexts = _mInstances[mInitProperties.reference].allContextsProvided;
|
|
456
|
-
if (!mInitProperties.reInitialize && bFlexInstanceAllContexts !== mInitProperties.allContextsProvided) {
|
|
457
|
-
mInitProperties.reInitialize = true;
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
function rebuildResponseIfMaxLayerChanged(sReference) {
|
|
374
|
+
function rebuildResponseIfMaxLayerChanged(sReference, oFlexData) {
|
|
462
375
|
if (_mInstances[sReference]?.maxLayer !== FlexInfoSession.getByReference(sReference).maxLayer) {
|
|
463
|
-
FlexState.rebuildFilteredResponse(sReference);
|
|
376
|
+
FlexState.rebuildFilteredResponse(sReference, oFlexData);
|
|
464
377
|
}
|
|
465
378
|
}
|
|
466
379
|
|
|
467
380
|
function initializeEmptyState(sReference) {
|
|
468
381
|
_mInstances[sReference] = {
|
|
469
|
-
storageResponse: { changes: StorageUtils.getEmptyFlexDataResponse() },
|
|
470
|
-
preparedMaps: {},
|
|
471
382
|
emptyState: true,
|
|
472
383
|
// this makes sure that a proper initialize will still work as expected
|
|
473
384
|
reInitialize: true,
|
|
474
385
|
componentId: ""
|
|
475
386
|
};
|
|
476
|
-
_mCachedFlexData[sReference] = { changes: StorageUtils.getEmptyFlexDataResponse() };
|
|
477
387
|
const oNewInitPromise = new Deferred();
|
|
478
388
|
_mInitPromises[sReference] = oNewInitPromise;
|
|
479
389
|
oNewInitPromise.resolve();
|
|
480
|
-
|
|
390
|
+
const oEmptyResponse = Loader.initializeEmptyCache(sReference);
|
|
391
|
+
initializeNewInstance({ reference: sReference }, oEmptyResponse);
|
|
481
392
|
}
|
|
482
393
|
|
|
483
394
|
FlexState.getRuntimeOnlyData = function(sReference) {
|
|
@@ -498,8 +409,6 @@ sap.ui.define([
|
|
|
498
409
|
* @param {object} [mPropertyBag.rawManifest] - Raw JSON manifest that belongs to current component
|
|
499
410
|
* @param {string} [mPropertyBag.componentData] - Component data of the current component
|
|
500
411
|
* @param {object} [mPropertyBag.asyncHints] - Async hints passed from the app index to the component processing
|
|
501
|
-
* @param {string} [mPropertyBag.version] - Number of the version in which the state should be initialized
|
|
502
|
-
* @param {string} [mPropertyBag.adaptationId] - Context-based adaptation for which the state should be initialized
|
|
503
412
|
* @param {boolean} [mPropertyBag.skipLoadBundle=false] - if true state is initialized partially and does not include flex bundles
|
|
504
413
|
* @returns {Promise<undefined>} Resolves a promise as soon as FlexState is initialized
|
|
505
414
|
*/
|
|
@@ -508,29 +417,27 @@ sap.ui.define([
|
|
|
508
417
|
enhancePropertyBag(mProperties);
|
|
509
418
|
const sFlexReference = mProperties.reference;
|
|
510
419
|
|
|
420
|
+
// TODO: Probably obsolete, as the init call is awaited in the Loader
|
|
511
421
|
const oOldInitPromise = _mInitPromises[sFlexReference];
|
|
512
422
|
const oNewInitPromise = new Deferred();
|
|
513
423
|
_mInitPromises[sFlexReference] = oNewInitPromise;
|
|
514
424
|
|
|
515
425
|
if (oOldInitPromise) {
|
|
516
426
|
await oOldInitPromise.promise;
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
} else {
|
|
526
|
-
rebuildResponseIfMaxLayerChanged(mPropertyBag.reference);
|
|
527
|
-
}
|
|
528
|
-
} else {
|
|
529
|
-
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
|
+
) {
|
|
530
435
|
prepareNewInstance(mProperties);
|
|
436
|
+
} else {
|
|
437
|
+
rebuildResponseIfMaxLayerChanged(mProperties.reference, oFlexData.data);
|
|
531
438
|
}
|
|
532
439
|
|
|
533
|
-
initializeNewInstance(mProperties);
|
|
440
|
+
initializeNewInstance(mProperties, oFlexData.data);
|
|
534
441
|
oNewInitPromise.resolve();
|
|
535
442
|
};
|
|
536
443
|
|
|
@@ -565,27 +472,23 @@ sap.ui.define([
|
|
|
565
472
|
};
|
|
566
473
|
|
|
567
474
|
/**
|
|
568
|
-
*
|
|
569
|
-
* The new data must not be already available in the storageResponse or runtimePersistence.
|
|
570
|
-
* 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
|
|
571
476
|
*
|
|
572
477
|
* @param {object} mPropertyBag - Contains additional data needed for reading and storing changes
|
|
573
478
|
* @param {string} mPropertyBag.reference - Flex reference of the app
|
|
574
|
-
* @param {
|
|
479
|
+
* @param {string} mPropertyBag.variantReference - The reference of the variant to load.
|
|
575
480
|
*/
|
|
576
|
-
FlexState.
|
|
481
|
+
FlexState.lazyLoadFlVariant = async function(mPropertyBag) {
|
|
577
482
|
if (!_mInstances[mPropertyBag.reference]) {
|
|
578
483
|
initializeEmptyState(mPropertyBag.reference);
|
|
579
484
|
}
|
|
485
|
+
const oResult = await Loader.loadFlVariant(mPropertyBag);
|
|
580
486
|
const oInstance = _mInstances[mPropertyBag.reference];
|
|
581
|
-
|
|
582
|
-
_mCachedFlexData[mPropertyBag.reference].changes[sKey].push(...vValue);
|
|
583
|
-
});
|
|
584
|
-
oInstance.storageResponse = filterByMaxLayer(mPropertyBag.reference, _mCachedFlexData[mPropertyBag.reference]);
|
|
487
|
+
oInstance.storageResponse = filterByMaxLayer(mPropertyBag.reference, oResult.completeData);
|
|
585
488
|
oInstance.runtimePersistence.flexObjects =
|
|
586
489
|
[
|
|
587
490
|
...oInstance.runtimePersistence.flexObjects,
|
|
588
|
-
...createFlexObjects(filterByMaxLayer(mPropertyBag.reference, { changes:
|
|
491
|
+
...createFlexObjects(filterByMaxLayer(mPropertyBag.reference, { changes: oResult.newData }))
|
|
589
492
|
];
|
|
590
493
|
oFlexObjectsDataSelector.checkUpdate({ reference: mPropertyBag.reference });
|
|
591
494
|
};
|
|
@@ -598,11 +501,9 @@ sap.ui.define([
|
|
|
598
501
|
* @param {string} [mPropertyBag.reference] - Flex reference of the app
|
|
599
502
|
* @param {object} [mPropertyBag.manifest] - Manifest that belongs to actual component
|
|
600
503
|
* @param {string} [mPropertyBag.componentData] - Component data of the current component
|
|
601
|
-
* @param {string} [mPropertyBag.version] - Number of the version in which the state should be updated
|
|
602
|
-
* @param {string} [mPropertyBag.adaptationId] - Context-based adaptation for which the state should be updated
|
|
603
504
|
* @returns {Promise<undefined>} Resolves when the data is loaded and the runtime persistence is updated
|
|
604
505
|
*/
|
|
605
|
-
FlexState.
|
|
506
|
+
FlexState.reinitialize = async function(mPropertyBag) {
|
|
606
507
|
enhancePropertyBag(mPropertyBag);
|
|
607
508
|
const sReference = mPropertyBag.reference;
|
|
608
509
|
const oCurrentRuntimePersistence = _mInstances[sReference].runtimePersistence;
|
|
@@ -611,9 +512,10 @@ sap.ui.define([
|
|
|
611
512
|
const oNewInitPromise = new Deferred();
|
|
612
513
|
_mInitPromises[sReference] = oNewInitPromise;
|
|
613
514
|
await oOldInitPromise;
|
|
614
|
-
|
|
515
|
+
mPropertyBag.reInitialize = true;
|
|
516
|
+
const oResponse = await Loader.getFlexData(mPropertyBag);
|
|
615
517
|
prepareNewInstance(mPropertyBag);
|
|
616
|
-
_mInstances[sReference].storageResponse = filterByMaxLayer(sReference,
|
|
518
|
+
_mInstances[sReference].storageResponse = filterByMaxLayer(sReference, oResponse.data);
|
|
617
519
|
const bUpdated = updateRuntimePersistence(
|
|
618
520
|
sReference,
|
|
619
521
|
_mInstances[sReference].storageResponse,
|
|
@@ -625,31 +527,6 @@ sap.ui.define([
|
|
|
625
527
|
oNewInitPromise.resolve();
|
|
626
528
|
};
|
|
627
529
|
|
|
628
|
-
function getChangeCategory(oChangeDefinition) {
|
|
629
|
-
switch (oChangeDefinition.fileType) {
|
|
630
|
-
case "change":
|
|
631
|
-
if (oChangeDefinition.selector && oChangeDefinition.selector.persistencyKey) {
|
|
632
|
-
return ["comp", "changes"];
|
|
633
|
-
}
|
|
634
|
-
if (oChangeDefinition.variantReference) {
|
|
635
|
-
return "variantDependentControlChanges";
|
|
636
|
-
}
|
|
637
|
-
return "changes";
|
|
638
|
-
case "ctrl_variant":
|
|
639
|
-
return "variants";
|
|
640
|
-
case "ctrl_variant_change":
|
|
641
|
-
return "variantChanges";
|
|
642
|
-
case "ctrl_variant_management_change":
|
|
643
|
-
return "variantManagementChanges";
|
|
644
|
-
case "variant":
|
|
645
|
-
return ["comp", "variants"];
|
|
646
|
-
case "annotation_change":
|
|
647
|
-
return "annotationChanges";
|
|
648
|
-
default:
|
|
649
|
-
return "";
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
|
|
653
530
|
/**
|
|
654
531
|
* Some save operations don't require a complete new data request, so the storage response gets a live update.
|
|
655
532
|
* This will also update the runtime persistence.
|
|
@@ -657,43 +534,30 @@ sap.ui.define([
|
|
|
657
534
|
* @param {string} sReference - Flex reference of the app
|
|
658
535
|
* @param {object[]} aUpdates - All new FlexObjects in JSON format
|
|
659
536
|
*/
|
|
660
|
-
FlexState.
|
|
537
|
+
FlexState.update = function(sReference, aUpdates) {
|
|
661
538
|
const aFlexObjectUpdates = [];
|
|
539
|
+
StorageUtils.updateStorageResponse(_mInstances[sReference].storageResponse, aUpdates);
|
|
540
|
+
Loader.updateCachedResponse(sReference, aUpdates);
|
|
662
541
|
aUpdates.forEach((oUpdate) => {
|
|
663
|
-
if (oUpdate.type
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
const sFileName = oUpdate.flexObject.fileName;
|
|
668
|
-
const aUnfiltered = ObjectPath.get(vPath, _mCachedFlexData[sReference].changes);
|
|
669
|
-
const aFiltered = ObjectPath.get(vPath, _mInstances[sReference].storageResponse.changes);
|
|
670
|
-
const iExistingFlexObjectIdx = _mInstances[sReference].runtimePersistence.flexObjects.findIndex(
|
|
671
|
-
(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
|
|
672
546
|
);
|
|
673
|
-
const oExistingFlexObject = _mInstances[sReference].runtimePersistence.flexObjects[
|
|
547
|
+
const oExistingFlexObject = _mInstances[sReference].runtimePersistence.flexObjects[iExistingFlexObjectIndex];
|
|
674
548
|
switch (oUpdate.type) {
|
|
675
549
|
case "add":
|
|
676
|
-
|
|
677
|
-
aFiltered.push(oUpdate.flexObject);
|
|
678
|
-
if (iExistingFlexObjectIdx < 0) {
|
|
550
|
+
if (iExistingFlexObjectIndex < 0) {
|
|
679
551
|
throw new Error("Flex response includes unknown flex object");
|
|
680
552
|
}
|
|
681
553
|
break;
|
|
682
554
|
case "delete":
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
if (iExistingFlexObjectIdx >= 0) {
|
|
686
|
-
_mInstances[sReference].runtimePersistence.flexObjects.splice(iExistingFlexObjectIdx, 1);
|
|
555
|
+
if (iExistingFlexObjectIndex >= 0) {
|
|
556
|
+
_mInstances[sReference].runtimePersistence.flexObjects.splice(iExistingFlexObjectIndex, 1);
|
|
687
557
|
aFlexObjectUpdates.push({ type: "removeFlexObject", updatedObject: oExistingFlexObject });
|
|
688
558
|
}
|
|
689
559
|
break;
|
|
690
560
|
case "update":
|
|
691
|
-
aFiltered.splice(aFiltered.findIndex((oFlexObject) => oFlexObject.fileName === sFileName), 1, oUpdate.flexObject);
|
|
692
|
-
aUnfiltered.splice(
|
|
693
|
-
aUnfiltered.findIndex((oFlexObject) => oFlexObject.fileName === sFileName),
|
|
694
|
-
1,
|
|
695
|
-
oUpdate.flexObject
|
|
696
|
-
);
|
|
697
561
|
if (oExistingFlexObject && oExistingFlexObject.getState() !== States.LifecycleState.PERSISTED) {
|
|
698
562
|
oExistingFlexObject.setResponse(oUpdate.flexObject);
|
|
699
563
|
aFlexObjectUpdates.push({ type: "updateFlexObject", updatedObject: oExistingFlexObject });
|
|
@@ -703,12 +567,13 @@ sap.ui.define([
|
|
|
703
567
|
}
|
|
704
568
|
}
|
|
705
569
|
});
|
|
706
|
-
if (aFlexObjectUpdates.length
|
|
570
|
+
if (aFlexObjectUpdates.length) {
|
|
707
571
|
oFlexObjectsDataSelector.checkUpdate({ reference: sReference }, aFlexObjectUpdates);
|
|
708
572
|
}
|
|
709
573
|
};
|
|
710
574
|
|
|
711
575
|
FlexState.clearState = function(sReference) {
|
|
576
|
+
Loader.clearCache(sReference);
|
|
712
577
|
if (sReference) {
|
|
713
578
|
delete _mInstances[sReference];
|
|
714
579
|
delete _mInitPromises[sReference];
|
|
@@ -720,22 +585,6 @@ sap.ui.define([
|
|
|
720
585
|
}
|
|
721
586
|
};
|
|
722
587
|
|
|
723
|
-
FlexState.setInitialNonFlCompVariantData = function(sReference, sPersistencyKey, oStandardVariant, aVariants, sSVMControlId) {
|
|
724
|
-
_mExternalData.compVariants[sReference] ||= {};
|
|
725
|
-
_mExternalData.compVariants[sReference][sPersistencyKey] = {};
|
|
726
|
-
_mExternalData.compVariants[sReference][sPersistencyKey].standardVariant = oStandardVariant;
|
|
727
|
-
_mExternalData.compVariants[sReference][sPersistencyKey].variants = aVariants;
|
|
728
|
-
_mExternalData.compVariants[sReference][sPersistencyKey].controlId = sSVMControlId;
|
|
729
|
-
};
|
|
730
|
-
|
|
731
|
-
FlexState.getInitialNonFlCompVariantData = function(sReference) {
|
|
732
|
-
return _mExternalData.compVariants[sReference];
|
|
733
|
-
};
|
|
734
|
-
|
|
735
|
-
FlexState.resetInitialNonFlCompVariantData = function(sReference) {
|
|
736
|
-
delete _mExternalData.compVariants[sReference];
|
|
737
|
-
};
|
|
738
|
-
|
|
739
588
|
/**
|
|
740
589
|
* Adds a runtime-steady object to the external data map which survives when the FlexState is cleared.
|
|
741
590
|
* For example: a fake standard variant.
|
|
@@ -779,11 +628,11 @@ sap.ui.define([
|
|
|
779
628
|
* and removes the internal maps for the given reference.
|
|
780
629
|
*
|
|
781
630
|
* @param {string} sReference - Flex reference of the app
|
|
631
|
+
* @param {object} oFlexData - Flex data to be used for rebuilding the response
|
|
782
632
|
*/
|
|
783
|
-
FlexState.rebuildFilteredResponse = function(sReference) {
|
|
633
|
+
FlexState.rebuildFilteredResponse = function(sReference, oFlexData) {
|
|
784
634
|
if (_mInstances[sReference]) {
|
|
785
|
-
_mInstances[sReference].
|
|
786
|
-
_mInstances[sReference].storageResponse = filterByMaxLayer(sReference, _mCachedFlexData[sReference]);
|
|
635
|
+
_mInstances[sReference].storageResponse = filterByMaxLayer(sReference, oFlexData);
|
|
787
636
|
// Storage response has changed, recreate the flex objects
|
|
788
637
|
_mInstances[sReference].runtimePersistence = buildRuntimePersistence(
|
|
789
638
|
_mInstances[sReference],
|
|
@@ -866,11 +715,7 @@ sap.ui.define([
|
|
|
866
715
|
};
|
|
867
716
|
|
|
868
717
|
FlexState.getUI2Personalization = function(sReference) {
|
|
869
|
-
return merge({},
|
|
870
|
-
};
|
|
871
|
-
|
|
872
|
-
FlexState.getCompVariantsMap = function(sReference) {
|
|
873
|
-
return getInstanceEntryOrThrowError(sReference, "compVariants");
|
|
718
|
+
return merge({}, _mInstances[sReference].storageResponse.changes.ui2personalization);
|
|
874
719
|
};
|
|
875
720
|
|
|
876
721
|
FlexState.callPrepareFunction = function(sMapName, mPropertyBag) {
|
|
@@ -878,31 +723,25 @@ sap.ui.define([
|
|
|
878
723
|
};
|
|
879
724
|
|
|
880
725
|
// TODO: used by the CompVariantState to mutate the storage response, this has to be changed
|
|
881
|
-
FlexState.getStorageResponse = function(sReference) {
|
|
726
|
+
FlexState.getStorageResponse = async function(sReference) {
|
|
882
727
|
if (_mInitPromises[sReference]) {
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
});
|
|
728
|
+
await _mInitPromises[sReference].promise;
|
|
729
|
+
return Loader.getCachedFlexData(sReference);
|
|
886
730
|
}
|
|
887
|
-
return
|
|
731
|
+
return undefined;
|
|
888
732
|
};
|
|
889
733
|
|
|
890
734
|
FlexState.getComponentData = function(sReference) {
|
|
891
735
|
return _mInstances[sReference] && _mInstances[sReference].componentData;
|
|
892
736
|
};
|
|
893
737
|
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
*/
|
|
902
|
-
FlexState.setAllContextsProvided = function(sReference, bAllContextsProvided) {
|
|
903
|
-
if (_mInstances[sReference] && _mInstances[sReference].allContextsProvided === undefined) {
|
|
904
|
-
_mInstances[sReference].allContextsProvided = bAllContextsProvided;
|
|
905
|
-
}
|
|
738
|
+
FlexState.addSVMControl = function(sReference, oControl) {
|
|
739
|
+
_mExternalData.smartVariantManagementControls[sReference] ||= [];
|
|
740
|
+
_mExternalData.smartVariantManagementControls[sReference].push(oControl);
|
|
741
|
+
};
|
|
742
|
+
|
|
743
|
+
FlexState.getSVMControls = function(sReference) {
|
|
744
|
+
return _mExternalData.smartVariantManagementControls[sReference] || [];
|
|
906
745
|
};
|
|
907
746
|
|
|
908
747
|
return FlexState;
|
|
@@ -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;
|
|
@@ -15,8 +15,8 @@ sap.ui.define([
|
|
|
15
15
|
"sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler",
|
|
16
16
|
"sap/ui/fl/apply/_internal/flexState/FlexObjectState",
|
|
17
17
|
"sap/ui/fl/apply/_internal/flexState/FlexState",
|
|
18
|
-
"sap/ui/fl/apply/_internal/flexState/ManifestUtils",
|
|
19
18
|
"sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage",
|
|
19
|
+
"sap/ui/fl/initial/_internal/ManifestUtils",
|
|
20
20
|
"sap/ui/fl/Utils"
|
|
21
21
|
], (
|
|
22
22
|
_omit,
|
|
@@ -29,8 +29,8 @@ sap.ui.define([
|
|
|
29
29
|
DependencyHandler,
|
|
30
30
|
FlexObjectState,
|
|
31
31
|
FlexState,
|
|
32
|
-
ManifestUtils,
|
|
33
32
|
ChangeHandlerStorage,
|
|
33
|
+
ManifestUtils,
|
|
34
34
|
Utils
|
|
35
35
|
) => {
|
|
36
36
|
"use strict";
|
|
@@ -41,7 +41,7 @@ sap.ui.define([
|
|
|
41
41
|
*
|
|
42
42
|
* @namespace sap.ui.fl.apply._internal.flexState.changes.ExtensionPointState
|
|
43
43
|
* @since 1.79
|
|
44
|
-
* @version 1.
|
|
44
|
+
* @version 1.141.0
|
|
45
45
|
* @private
|
|
46
46
|
* @ui5-restricted
|
|
47
47
|
*/
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/ui/core/Lib",
|
|
9
9
|
"sap/ui/fl/apply/_internal/flexState/FlexState",
|
|
10
|
-
"sap/ui/fl/apply/_internal/flexState/ManifestUtils",
|
|
11
10
|
"sap/ui/fl/apply/api/FlexRuntimeInfoAPI",
|
|
11
|
+
"sap/ui/fl/initial/_internal/ManifestUtils",
|
|
12
12
|
"sap/ui/fl/Utils"
|
|
13
13
|
], function(
|
|
14
14
|
Lib,
|
|
15
15
|
FlexState,
|
|
16
|
-
ManifestUtils,
|
|
17
16
|
FlexRuntimeInfoAPI,
|
|
17
|
+
ManifestUtils,
|
|
18
18
|
FlexUtils
|
|
19
19
|
) {
|
|
20
20
|
"use strict";
|