@openui5/sap.ui.fl 1.129.0 → 1.130.1
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/THIRDPARTY.txt +1 -1
- package/package.json +3 -3
- package/src/sap/ui/fl/.library +1 -1
- package/src/sap/ui/fl/ChangePersistence.js +26 -38
- package/src/sap/ui/fl/ChangePersistenceFactory.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 +1 -1
- package/src/sap/ui/fl/FlexControllerFactory.js +1 -1
- package/src/sap/ui/fl/LayerUtils.js +1 -1
- package/src/sap/ui/fl/Utils.js +8 -8
- package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +1 -1
- package/src/sap/ui/fl/apply/_internal/appVariant/DescriptorChangeTypes.js +2 -1
- package/src/sap/ui/fl/apply/_internal/changes/Applier.js +152 -197
- package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +23 -17
- package/src/sap/ui/fl/apply/_internal/changes/Reverter.js +27 -37
- package/src/sap/ui/fl/apply/_internal/changes/Utils.js +26 -31
- 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 +2 -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 +78 -0
- 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/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 +7 -3
- package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/FlexObjectState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +34 -13
- package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/changes/UIChangesState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantManagementState.js +108 -0
- 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 +57 -9
- package/src/sap/ui/fl/apply/_internal/preprocessors/ComponentLifecycleHooks.js +2 -2
- package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +1 -1
- package/src/sap/ui/fl/apply/_internal/preprocessors/RegistrationDelegator.js +6 -6
- package/src/sap/ui/fl/apply/_internal/preprocessors/XmlPreprocessor.js +1 -1
- package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +25 -10
- package/src/sap/ui/fl/apply/api/SmartVariantManagementApplyAPI.js +18 -45
- 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/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/initial/_internal/FlexConfiguration.js +1 -1
- package/src/sap/ui/fl/initial/_internal/Storage.js +37 -1
- package/src/sap/ui/fl/initial/_internal/StorageFeaturesMerger.js +1 -1
- package/src/sap/ui/fl/initial/_internal/StorageUtils.js +1 -1
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration.js +3 -2
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +1 -1
- package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +1 -1
- package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +1 -1
- package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +15 -1
- package/src/sap/ui/fl/interfaces/Delegate.js +1 -1
- package/src/sap/ui/fl/library.js +43 -43
- 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/DescriptorChangeCheck.js +35 -16
- 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/VariantModel.js +33 -11
- package/src/sap/ui/fl/write/_internal/Storage.js +1 -1
- package/src/sap/ui/fl/write/_internal/Versions.js +7 -3
- 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 +34 -1
- package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +163 -176
- package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +62 -61
- package/src/sap/ui/fl/write/_internal/condenser/Utils.js +17 -19
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Create.js +13 -13
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Destroy.js +17 -19
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Move.js +32 -35
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Update.js +2 -10
- 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 +56 -4
- 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/controlVariants/ControlVariantWriteUtils.js +59 -0
- package/src/sap/ui/fl/write/_internal/delegates/ODataV2ReadDelegate.js +1 -2
- 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 +33 -2
- package/src/sap/ui/fl/write/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/changes/UIChangeManager.js +26 -3
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +20 -12
- package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +1 -1
- package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -1
- package/src/sap/ui/fl/write/api/ChangesWriteAPI.js +73 -3
- package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
- package/src/sap/ui/fl/write/api/LocalResetAPI.js +17 -27
- package/src/sap/ui/fl/write/api/VersionsAPI.js +26 -4
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
|
|
2
|
+
/*!
|
|
3
|
+
* OpenUI5
|
|
4
|
+
* (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
sap.ui.define([
|
|
9
|
+
"sap/ui/fl/util/changePropertyValueByPath",
|
|
10
|
+
"sap/ui/fl/util/DescriptorChangeCheck"
|
|
11
|
+
], function(
|
|
12
|
+
changePropertyValueByPath,
|
|
13
|
+
DescriptorChangeCheck
|
|
14
|
+
) {
|
|
15
|
+
"use strict";
|
|
16
|
+
|
|
17
|
+
const SUPPORTED_OPERATIONS = ["UPDATE", "UPSERT", "DELETE", "INSERT"];
|
|
18
|
+
const SUPPORTED_PROPERTIES = ["settings/*"];
|
|
19
|
+
|
|
20
|
+
const SUPPORTED_TYPES = {
|
|
21
|
+
settings: typeof {}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const RESOURCE_MODEL = "sap.ui.model.resource.ResourceModel";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Descriptor change merger for change type <code>appdescr_ui5_changeModel</code>.
|
|
28
|
+
* Changes the settings object of the model by changing the manifest value <code>sap.ui5/models/modelId</code>.
|
|
29
|
+
*
|
|
30
|
+
* Available for both runtime and build {@link sap.ui.fl.apply._internal.changes.descriptor.RegistrationBuild}.
|
|
31
|
+
*
|
|
32
|
+
* @namespace
|
|
33
|
+
* @alias sap.ui.fl.apply._internal.changes.descriptor.app.ChangeModel
|
|
34
|
+
* @version 1.130.1
|
|
35
|
+
* @private
|
|
36
|
+
* @ui5-restricted sap.ui.fl.apply._internal
|
|
37
|
+
*/
|
|
38
|
+
const ChangeModel = /** @lends sap.ui.fl.apply._internal.changes.descriptor.app.ChangeModel */ {
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Applies the <code>appdescr_ui5_changeModel</code> change to the manifest.
|
|
42
|
+
*
|
|
43
|
+
* @param {object} oManifest - Original manifest
|
|
44
|
+
* @param {sap.ui.fl.apply._internal.flexObjects.AppDescriptorChange} oChange - Change with type <code>appdescr_ui5_changeModel</code>
|
|
45
|
+
* @param {object} oChange.content - Details of the change
|
|
46
|
+
* @param {string} oChange.content.modelId - ID of <code>sap.ui5/models/modelId</code> that is being changed
|
|
47
|
+
* @param {object|array} oChange.content.entityPropertyChange - Entity property change or an array of multiple entity property changes
|
|
48
|
+
* @param {string} oChange.content.entityPropertyChange.propertyPath - Path to the property which should be changed. Supported properties: <code>settings</code>
|
|
49
|
+
* @param {string} oChange.content.entityPropertyChange.operation - Operation that is performed on the property defined under propertyPath. Possible values: <code>UPDATE</code> and <code>UPSERT</code>
|
|
50
|
+
* @param {string} oChange.content.entityPropertyChange.propertyValue - New value of the <code>model</code> property defined under propertyPath
|
|
51
|
+
* @returns {object} Updated manifest with changed <code>sap.ui5/models/model</code>
|
|
52
|
+
*
|
|
53
|
+
* @private
|
|
54
|
+
* @ui5-restricted sap.ui.fl.apply._internal
|
|
55
|
+
*/
|
|
56
|
+
applyChange(oManifest, oChange) {
|
|
57
|
+
const oModels = oManifest["sap.ui5"].models;
|
|
58
|
+
const oChangeContent = oChange.getContent();
|
|
59
|
+
DescriptorChangeCheck.checkEntityPropertyChange(oChangeContent, SUPPORTED_PROPERTIES, SUPPORTED_OPERATIONS, null, null, SUPPORTED_TYPES);
|
|
60
|
+
if (oModels) {
|
|
61
|
+
const oModel = oModels[oChangeContent.modelId];
|
|
62
|
+
if (oModel) {
|
|
63
|
+
if (oModel.type === RESOURCE_MODEL) {
|
|
64
|
+
throw new Error(`Model '${oChangeContent.modelId}' is of type '${RESOURCE_MODEL}'. Changing models of type '${RESOURCE_MODEL}' are not supported.`);
|
|
65
|
+
}
|
|
66
|
+
changePropertyValueByPath(oChangeContent.entityPropertyChange, oModel);
|
|
67
|
+
} else {
|
|
68
|
+
throw new Error(`Nothing to update. Model with ID "${oChangeContent.modelId}" does not exist in the manifest.json.`);
|
|
69
|
+
}
|
|
70
|
+
} else {
|
|
71
|
+
throw new Error("sap.ui5/models section have not been found in manifest.json.");
|
|
72
|
+
}
|
|
73
|
+
return oManifest;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
return ChangeModel;
|
|
78
|
+
});
|
|
@@ -32,7 +32,7 @@ sap.ui.define([
|
|
|
32
32
|
* @extends sap.ui.fl.apply._internal.flexObjects.Variant
|
|
33
33
|
* @alias sap.ui.fl.apply._internal.flexObjects.CompVariant
|
|
34
34
|
* @since 1.103
|
|
35
|
-
* @version 1.
|
|
35
|
+
* @version 1.130.1
|
|
36
36
|
* @private
|
|
37
37
|
* @ui5-restricted sap.ui.fl, sap.ui.comp
|
|
38
38
|
*/
|
|
@@ -20,7 +20,7 @@ sap.ui.define([
|
|
|
20
20
|
* @extends sap.ui.fl.apply._internal.flexObjects.FlexObject
|
|
21
21
|
* @alias sap.ui.fl.apply._internal.flexObjects.ControllerExtensionChange
|
|
22
22
|
* @since 1.105
|
|
23
|
-
* @version 1.
|
|
23
|
+
* @version 1.130.1
|
|
24
24
|
* @private
|
|
25
25
|
* @ui5-restricted sap.ui.fl
|
|
26
26
|
*/
|
|
@@ -15,6 +15,7 @@ sap.ui.define([
|
|
|
15
15
|
"sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor",
|
|
16
16
|
"sap/ui/fl/apply/_internal/flexObjects/States",
|
|
17
17
|
"sap/ui/fl/apply/_internal/flexObjects/UIChange",
|
|
18
|
+
"sap/ui/fl/apply/_internal/flexObjects/UpdatableChange",
|
|
18
19
|
"sap/ui/fl/registry/Settings",
|
|
19
20
|
"sap/ui/fl/Layer",
|
|
20
21
|
"sap/ui/fl/LayerUtils",
|
|
@@ -31,6 +32,7 @@ sap.ui.define([
|
|
|
31
32
|
getVariantAuthor,
|
|
32
33
|
States,
|
|
33
34
|
UIChange,
|
|
35
|
+
UpdatableChange,
|
|
34
36
|
Settings,
|
|
35
37
|
Layer,
|
|
36
38
|
LayerUtils,
|
|
@@ -39,13 +41,13 @@ sap.ui.define([
|
|
|
39
41
|
"use strict";
|
|
40
42
|
|
|
41
43
|
const FLEX_OBJECT_TYPES = {
|
|
42
|
-
BASE_FLEX_OBJECT: FlexObject,
|
|
43
44
|
COMP_VARIANT_OBJECT: CompVariant,
|
|
44
45
|
FL_VARIANT_OBJECT: FlVariant,
|
|
45
46
|
CONTROLLER_EXTENSION: ControllerExtensionChange,
|
|
46
47
|
APP_DESCRIPTOR_CHANGE: AppDescriptorChange,
|
|
47
48
|
ANNOTATION_CHANGE: AnnotationChange,
|
|
48
|
-
UI_CHANGE: UIChange
|
|
49
|
+
UI_CHANGE: UIChange,
|
|
50
|
+
UPDATABLE_CHANGE: UpdatableChange
|
|
49
51
|
};
|
|
50
52
|
|
|
51
53
|
function getFlexObjectClass(oNewFileContent) {
|
|
@@ -59,6 +61,8 @@ sap.ui.define([
|
|
|
59
61
|
return FLEX_OBJECT_TYPES.APP_DESCRIPTOR_CHANGE;
|
|
60
62
|
} else if (oNewFileContent.fileType === "annotation_change") {
|
|
61
63
|
return FLEX_OBJECT_TYPES.ANNOTATION_CHANGE;
|
|
64
|
+
} else if (oNewFileContent.fileType === "change" && oNewFileContent.changeType === "defaultVariant") {
|
|
65
|
+
return FLEX_OBJECT_TYPES.UPDATABLE_CHANGE;
|
|
62
66
|
}
|
|
63
67
|
return FLEX_OBJECT_TYPES.UI_CHANGE;
|
|
64
68
|
}
|
|
@@ -102,7 +106,7 @@ sap.ui.define([
|
|
|
102
106
|
*
|
|
103
107
|
* @namespace sap.ui.fl.apply._internal.flexObjects.FlexObjectFactory
|
|
104
108
|
* @since 1.100
|
|
105
|
-
* @version 1.
|
|
109
|
+
* @version 1.130.1
|
|
106
110
|
* @private
|
|
107
111
|
* @ui5-restricted sap.ui.fl
|
|
108
112
|
*/
|
|
@@ -89,7 +89,7 @@ sap.ui.define([
|
|
|
89
89
|
*
|
|
90
90
|
* @namespace sap.ui.fl.apply._internal.flexState.FlexState
|
|
91
91
|
* @since 1.73
|
|
92
|
-
* @version 1.
|
|
92
|
+
* @version 1.130.1
|
|
93
93
|
* @private
|
|
94
94
|
* @ui5-restricted sap.ui.fl.apply._internal
|
|
95
95
|
*/
|
|
@@ -264,10 +264,6 @@ sap.ui.define([
|
|
|
264
264
|
oFlexObjectsDataSelector.checkUpdate({ reference: sReference });
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
-
function getCompVariantsMap(sReference) {
|
|
268
|
-
return getInstanceEntryOrThrowError(sReference, "compVariants");
|
|
269
|
-
}
|
|
270
|
-
|
|
271
267
|
function buildRuntimePersistence(oFlexStateInstance, aExternalFlexObjects) {
|
|
272
268
|
const oStorageResponse = oFlexStateInstance.storageResponse;
|
|
273
269
|
var oRuntimePersistence = {
|
|
@@ -345,7 +341,6 @@ sap.ui.define([
|
|
|
345
341
|
}
|
|
346
342
|
if (!_mInstances[sReference].storageResponse) {
|
|
347
343
|
_mInstances[sReference].storageResponse = filterByMaxLayer(sReference, _mInstances[sReference].unfilteredStorageResponse);
|
|
348
|
-
_mInstances[sReference].maxLayer = FlexInfoSession.getByReference(sReference).maxLayer;
|
|
349
344
|
// Flex objects need to be recreated
|
|
350
345
|
delete _mInstances[sReference].runtimePersistence;
|
|
351
346
|
bDataUpdated = true;
|
|
@@ -370,9 +365,10 @@ sap.ui.define([
|
|
|
370
365
|
|
|
371
366
|
function filterByMaxLayer(sReference, mResponse) {
|
|
372
367
|
const mFilteredReturn = merge({}, mResponse);
|
|
368
|
+
mFilteredReturn.changes = { ...StorageUtils.getEmptyFlexDataResponse(), ...mFilteredReturn.changes };
|
|
373
369
|
const mFlexObjects = mFilteredReturn.changes;
|
|
370
|
+
const oFlexInfoSession = FlexInfoSession.getByReference(sReference);
|
|
374
371
|
if (LayerUtils.isLayerFilteringRequired(sReference)) {
|
|
375
|
-
const oFlexInfoSession = FlexInfoSession.getByReference(sReference);
|
|
376
372
|
each(_mFlexObjectInfo, function(iIndex, mFlexObjectInfo) {
|
|
377
373
|
mFlexObjectInfo.pathInResponse.forEach(function(sPath) {
|
|
378
374
|
const aFilterByMaxLayer = ObjectPath.get(sPath, mFlexObjects).filter(function(oChangeDefinition) {
|
|
@@ -382,6 +378,7 @@ sap.ui.define([
|
|
|
382
378
|
});
|
|
383
379
|
});
|
|
384
380
|
}
|
|
381
|
+
_mInstances[sReference].maxLayer = oFlexInfoSession.maxLayer;
|
|
385
382
|
return mFilteredReturn;
|
|
386
383
|
}
|
|
387
384
|
|
|
@@ -549,6 +546,32 @@ sap.ui.define([
|
|
|
549
546
|
return !!_mInstances[sReference];
|
|
550
547
|
};
|
|
551
548
|
|
|
549
|
+
/**
|
|
550
|
+
* Updates the saved backend response and the runtime persistence with new data.
|
|
551
|
+
* The new data must not be already available in the storageResponse or runtimePersistence.
|
|
552
|
+
* As of now this does not work with nested structures (comp related objects) or ui2personalization.
|
|
553
|
+
*
|
|
554
|
+
* @param {object} mPropertyBag - Contains additional data needed for reading and storing changes
|
|
555
|
+
* @param {string} mPropertyBag.reference - Flex reference of the app
|
|
556
|
+
* @param {object} mPropertyBag.newData - New Data to be added. Needs to have the structure of the storageResponse.changes object
|
|
557
|
+
*/
|
|
558
|
+
FlexState.updateWithDataProvided = function(mPropertyBag) {
|
|
559
|
+
if (!_mInstances[mPropertyBag.reference]) {
|
|
560
|
+
initializeEmptyState(mPropertyBag.reference);
|
|
561
|
+
}
|
|
562
|
+
const oInstance = _mInstances[mPropertyBag.reference];
|
|
563
|
+
Object.entries(mPropertyBag.newData).forEach(([sKey, vValue]) => {
|
|
564
|
+
oInstance.unfilteredStorageResponse.changes[sKey].push(...vValue);
|
|
565
|
+
});
|
|
566
|
+
oInstance.storageResponse = filterByMaxLayer(mPropertyBag.reference, oInstance.unfilteredStorageResponse);
|
|
567
|
+
oInstance.runtimePersistence.flexObjects =
|
|
568
|
+
[
|
|
569
|
+
...oInstance.runtimePersistence.flexObjects,
|
|
570
|
+
...createFlexObjects(filterByMaxLayer(mPropertyBag.reference, { changes: mPropertyBag.newData }))
|
|
571
|
+
];
|
|
572
|
+
oFlexObjectsDataSelector.checkUpdate({ reference: mPropertyBag.reference });
|
|
573
|
+
};
|
|
574
|
+
|
|
552
575
|
/**
|
|
553
576
|
* Triggers a call to the backend to fetch new data and update the runtime persistence
|
|
554
577
|
*
|
|
@@ -563,8 +586,8 @@ sap.ui.define([
|
|
|
563
586
|
*/
|
|
564
587
|
FlexState.update = async function(mPropertyBag) {
|
|
565
588
|
enhancePropertyBag(mPropertyBag);
|
|
566
|
-
|
|
567
|
-
|
|
589
|
+
const sReference = mPropertyBag.reference;
|
|
590
|
+
const oCurrentRuntimePersistence = _mInstances[sReference].runtimePersistence;
|
|
568
591
|
|
|
569
592
|
const oOldInitPromise = _mInitPromises[sReference].promise;
|
|
570
593
|
const oNewInitPromise = new Deferred();
|
|
@@ -572,8 +595,7 @@ sap.ui.define([
|
|
|
572
595
|
await oOldInitPromise;
|
|
573
596
|
await loadFlexData(mPropertyBag);
|
|
574
597
|
_mInstances[sReference].storageResponse = filterByMaxLayer(sReference, _mInstances[sReference].unfilteredStorageResponse);
|
|
575
|
-
|
|
576
|
-
var bUpdated = updateRuntimePersistence(
|
|
598
|
+
const bUpdated = updateRuntimePersistence(
|
|
577
599
|
sReference,
|
|
578
600
|
_mInstances[sReference].storageResponse,
|
|
579
601
|
oCurrentRuntimePersistence
|
|
@@ -743,7 +765,6 @@ sap.ui.define([
|
|
|
743
765
|
if (_mInstances[sReference]) {
|
|
744
766
|
_mInstances[sReference].preparedMaps = {};
|
|
745
767
|
_mInstances[sReference].storageResponse = filterByMaxLayer(sReference, _mInstances[sReference].unfilteredStorageResponse);
|
|
746
|
-
_mInstances[sReference].maxLayer = FlexInfoSession.getByReference(sReference).maxLayer;
|
|
747
768
|
// Storage response has changed, recreate the flex objects
|
|
748
769
|
_mInstances[sReference].runtimePersistence = buildRuntimePersistence(
|
|
749
770
|
_mInstances[sReference],
|
|
@@ -834,7 +855,7 @@ sap.ui.define([
|
|
|
834
855
|
};
|
|
835
856
|
|
|
836
857
|
FlexState.getCompVariantsMap = function(sReference) {
|
|
837
|
-
return
|
|
858
|
+
return getInstanceEntryOrThrowError(sReference, "compVariants");
|
|
838
859
|
};
|
|
839
860
|
|
|
840
861
|
FlexState.callPrepareFunction = function(sMapName, mPropertyBag) {
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
sap.ui.define([
|
|
8
|
+
"sap/ui/fl/apply/_internal/flexState/FlexState",
|
|
9
|
+
"sap/ui/fl/apply/_internal/flexState/DataSelector",
|
|
10
|
+
"sap/ui/fl/apply/_internal/flexObjects/CompVariant"
|
|
11
|
+
], function(
|
|
12
|
+
FlexState,
|
|
13
|
+
DataSelector,
|
|
14
|
+
CompVariant
|
|
15
|
+
) {
|
|
16
|
+
"use strict";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Handler class provide data of smart control variant changes and its map.
|
|
20
|
+
*
|
|
21
|
+
* @namespace sap.ui.fl.apply._internal.flexState.compVariants.CompVariantManagementState
|
|
22
|
+
* @since 1.129
|
|
23
|
+
* @version 1.130.1
|
|
24
|
+
* @private
|
|
25
|
+
* @ui5-restricted
|
|
26
|
+
*/
|
|
27
|
+
const CompVariantManagementState = {};
|
|
28
|
+
|
|
29
|
+
const sUpdatableChangeNameSpace = "sap.ui.fl.apply._internal.flexObjects.UpdatableChange";
|
|
30
|
+
|
|
31
|
+
const isSetDefaultChange = (oFlexObject) => {
|
|
32
|
+
return oFlexObject?.isA(sUpdatableChangeNameSpace)
|
|
33
|
+
&& oFlexObject.getFileType() === "change"
|
|
34
|
+
&& oFlexObject.getChangeType() === "defaultVariant";
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const oSetDefaultDataSelector = new DataSelector({
|
|
38
|
+
id: "compSetDefault",
|
|
39
|
+
parameterKey: "persistencyKey",
|
|
40
|
+
parentDataSelector: FlexState.getFlexObjectsDataSelector(),
|
|
41
|
+
executeFunction(aFlexObjects, mPropertyBag) {
|
|
42
|
+
return aFlexObjects.filter((oFlexObject) =>
|
|
43
|
+
isSetDefaultChange(oFlexObject)
|
|
44
|
+
&& String(oFlexObject.getSelector()?.persistencyKey) === mPropertyBag.persistencyKey
|
|
45
|
+
);
|
|
46
|
+
},
|
|
47
|
+
checkInvalidation(mParameters, oUpdateInfo) {
|
|
48
|
+
const bRelevantType = ["addFlexObject", "removeFlexObject"].includes(oUpdateInfo.type);
|
|
49
|
+
return bRelevantType && isSetDefaultChange(oUpdateInfo.updatedObject);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Access to the variant management set default selector.
|
|
55
|
+
*
|
|
56
|
+
* @returns {object} The data selector for the variant set default changes
|
|
57
|
+
*
|
|
58
|
+
* @private
|
|
59
|
+
* @ui5-restricted sap.ui.fl.qunit
|
|
60
|
+
*/
|
|
61
|
+
CompVariantManagementState.getSetDefaultDataSelector = function() {
|
|
62
|
+
return oSetDefaultDataSelector;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Returns the default variant ID for a given variant management
|
|
67
|
+
*
|
|
68
|
+
* @param {object} mPropertyBag Object with the necessary properties
|
|
69
|
+
* @param {string} mPropertyBag.persistencyKey - Persistency key of the variant management
|
|
70
|
+
* @param {string} mPropertyBag.reference - Component reference
|
|
71
|
+
* @param {sap.ui.fl.apply._internal.flexObjects.CompVariant[]} mPropertyBag.variants - Array of variants which exist for the given variant management
|
|
72
|
+
*
|
|
73
|
+
* @returns {string | undefined} ID of the default variant
|
|
74
|
+
*
|
|
75
|
+
* @private
|
|
76
|
+
* @ui5-restricted sap.ui.fl
|
|
77
|
+
*/
|
|
78
|
+
CompVariantManagementState.getDefaultVariantId = (mPropertyBag) => {
|
|
79
|
+
const aVariants = mPropertyBag.variants;
|
|
80
|
+
const aVariantIds = aVariants.map((oVariant) => oVariant.getVariantId());
|
|
81
|
+
aVariantIds.push(CompVariant.STANDARD_VARIANT_ID);
|
|
82
|
+
|
|
83
|
+
mPropertyBag.persistencyKey = String(mPropertyBag.persistencyKey);
|
|
84
|
+
const aDefaultChanges = [...oSetDefaultDataSelector.get(mPropertyBag)].reverse();
|
|
85
|
+
const aDefaultVariantIds = aDefaultChanges.map((oChange) => oChange.getContent().defaultVariantName);
|
|
86
|
+
|
|
87
|
+
return aDefaultVariantIds.find((sDefaultVariantId) => aVariantIds.includes(sDefaultVariantId)) || "";
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Returns the 'defaultVariant' changes for a given variant management
|
|
92
|
+
*
|
|
93
|
+
* @param {object} mPropertyBag Object with the necessary properties
|
|
94
|
+
* @param {string} mPropertyBag.persistencyKey - Persistency key of the variant management
|
|
95
|
+
* @param {string} mPropertyBag.reference - Component reference
|
|
96
|
+
*
|
|
97
|
+
* @returns {sap.ui.fl.apply._internal.flexObjects.UpdatableChange[]} 'defaultVariant' changes of the variant management
|
|
98
|
+
*
|
|
99
|
+
* @private
|
|
100
|
+
* @ui5-restricted sap.ui.fl
|
|
101
|
+
*/
|
|
102
|
+
CompVariantManagementState.getDefaultChanges = (mPropertyBag) => {
|
|
103
|
+
mPropertyBag.persistencyKey = String(mPropertyBag.persistencyKey);
|
|
104
|
+
return oSetDefaultDataSelector.get(mPropertyBag);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
return CompVariantManagementState;
|
|
108
|
+
});
|
|
@@ -125,7 +125,7 @@ sap.ui.define([
|
|
|
125
125
|
*
|
|
126
126
|
* @namespace sap.ui.fl.apply._internal.flexState.compVariants.CompVariantMerger
|
|
127
127
|
* @since 1.86
|
|
128
|
-
* @version 1.
|
|
128
|
+
* @version 1.130.1
|
|
129
129
|
* @private
|
|
130
130
|
* @ui5-restricted sap.ui.fl
|
|
131
131
|
*/
|
|
@@ -215,7 +215,7 @@ sap.ui.define([
|
|
|
215
215
|
*
|
|
216
216
|
* @function
|
|
217
217
|
* @since 1.89
|
|
218
|
-
* @version 1.
|
|
218
|
+
* @version 1.130.1
|
|
219
219
|
* @private
|
|
220
220
|
* @ui5-restricted sap.ui.fl
|
|
221
221
|
*
|