@openui5/sap.ui.fl 1.102.2 → 1.104.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.reuse/dep5 +17 -0
- package/LICENSES/LicenseRef-tzdata-PublicDomain.txt +5 -0
- package/THIRDPARTY.txt +35 -2
- package/package.json +3 -3
- package/src/sap/ui/fl/.library +1 -1
- package/src/sap/ui/fl/Cache.js +1 -1
- package/src/sap/ui/fl/Change.js +1 -1
- package/src/sap/ui/fl/ChangePersistence.js +1 -1
- 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 +2 -6
- package/src/sap/ui/fl/Variant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/Applier.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/Utils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +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/ChangeDataSource.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetTitle.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetAbstract.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/AddNewCard.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/ChangeCard.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddLibrary.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetFlexExtensionPointEnabled.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetMinUI5Version.js +1 -1
- package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageUtils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +133 -206
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +38 -14
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +109 -10
- package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +123 -0
- package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +3 -2
- 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/compVariants/CompVariantMerger.js +16 -13
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/prepareCompVariantsMap.js +13 -6
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +1 -1
- package/src/sap/ui/fl/apply/_internal/preprocessors/EventHistory.js +1 -1
- package/src/sap/ui/fl/apply/_internal/preprocessors/RegistrationDelegator.js +1 -1
- package/src/sap/ui/fl/apply/_internal/preprocessors/XmlPreprocessor.js +1 -1
- package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +1 -1
- package/src/sap/ui/fl/changeHandler/AddIFrame.js +1 -1
- package/src/sap/ui/fl/changeHandler/AddXML.js +1 -1
- package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +1 -1
- package/src/sap/ui/fl/changeHandler/Base.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseAddXml.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseRename.js +1 -1
- package/src/sap/ui/fl/changeHandler/HideControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/MoveControls.js +1 -1
- package/src/sap/ui/fl/changeHandler/MoveElements.js +1 -1
- package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +1 -1
- package/src/sap/ui/fl/changeHandler/PropertyChange.js +1 -1
- package/src/sap/ui/fl/changeHandler/StashControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UnhideControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UnstashControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +1 -1
- package/src/sap/ui/fl/codeExt/CodeExtManager.js +1 -1
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +4 -4
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js +1 -1
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorVariantFactory.js +1 -1
- package/src/sap/ui/fl/designtime/variants/VariantManagement.designtime.js +3 -0
- package/src/sap/ui/fl/initial/_internal/Storage.js +1 -1
- package/src/sap/ui/fl/initial/_internal/StorageUtils.js +8 -39
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeRegistryItem.js +1 -1
- package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +1 -1
- package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +1 -1
- package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +1 -1
- package/src/sap/ui/fl/interfaces/Delegate.js +1 -1
- package/src/sap/ui/fl/library.js +9 -9
- package/src/sap/ui/fl/support/Flexibility.js +1 -1
- package/src/sap/ui/fl/support/_internal/getChangeDependencies.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/support/diagnostics/Flexibility.controller.js +1 -1
- package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
- package/src/sap/ui/fl/util/IFrame.js +4 -4
- package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
- package/src/sap/ui/fl/util/resolveBinding.js +1 -1
- package/src/sap/ui/fl/variants/VariantManagement.js +577 -2098
- package/src/sap/ui/fl/variants/VariantModel.js +1 -1
- package/src/sap/ui/fl/write/_internal/Storage.js +1 -1
- package/src/sap/ui/fl/write/_internal/StorageFeaturesMerger.js +1 -1
- package/src/sap/ui/fl/write/_internal/Versions.js +14 -8
- 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/KeyUserConnector.js +11 -3
- package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +9 -2
- package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/Utils.js +1 -1
- package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +1 -1
- package/src/sap/ui/fl/write/_internal/extensionPoint/Registry.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPAccess.js +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/FlexObjectState.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +120 -134
- package/src/sap/ui/fl/write/_internal/transport/TransportDialog.js +4 -4
- 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/FieldExtensibility.js +1 -1
- package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +101 -69
- package/src/sap/ui/fl/write/api/Version.js +6 -1
- package/src/sap/ui/fl/write/api/connectors/ObjectStorageConnector.js +14 -1
|
@@ -4,11 +4,21 @@
|
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
7
|
+
"sap/base/util/restricted/_pick",
|
|
7
8
|
"sap/base/util/ObjectPath",
|
|
8
|
-
"sap/ui/
|
|
9
|
+
"sap/ui/core/Core",
|
|
10
|
+
"sap/ui/fl/apply/_internal/flexObjects/CompVariant",
|
|
11
|
+
"sap/ui/fl/apply/_internal/flexObjects/FlexObject",
|
|
12
|
+
"sap/ui/fl/Layer",
|
|
13
|
+
"sap/ui/fl/Utils"
|
|
9
14
|
], function(
|
|
15
|
+
_pick,
|
|
10
16
|
ObjectPath,
|
|
11
|
-
|
|
17
|
+
Core,
|
|
18
|
+
CompVariant,
|
|
19
|
+
FlexObject,
|
|
20
|
+
Layer,
|
|
21
|
+
flUtils
|
|
12
22
|
) {
|
|
13
23
|
"use strict";
|
|
14
24
|
|
|
@@ -20,10 +30,14 @@ sap.ui.define([
|
|
|
20
30
|
* @private
|
|
21
31
|
*/
|
|
22
32
|
var FLEX_OBJECT_TYPES = {
|
|
23
|
-
BASE_FLEX_OBJECT: FlexObject
|
|
33
|
+
BASE_FLEX_OBJECT: FlexObject,
|
|
34
|
+
COMP_VARIANT_OBJECT: CompVariant
|
|
24
35
|
};
|
|
25
36
|
|
|
26
|
-
function getFlexObjectClass
|
|
37
|
+
function getFlexObjectClass(oNewFileContent) {
|
|
38
|
+
if (oNewFileContent.fileType === "variant") {
|
|
39
|
+
return FLEX_OBJECT_TYPES.COMP_VARIANT_OBJECT;
|
|
40
|
+
}
|
|
27
41
|
return FLEX_OBJECT_TYPES.BASE_FLEX_OBJECT;
|
|
28
42
|
}
|
|
29
43
|
|
|
@@ -32,7 +46,7 @@ sap.ui.define([
|
|
|
32
46
|
*
|
|
33
47
|
* @namespace sap.ui.fl.apply._internal.flexObjects.FlexObjectFactory
|
|
34
48
|
* @since 1.100
|
|
35
|
-
* @version 1.
|
|
49
|
+
* @version 1.104.0
|
|
36
50
|
* @private
|
|
37
51
|
* @ui5-restricted sap.ui.fl
|
|
38
52
|
*/
|
|
@@ -42,20 +56,24 @@ sap.ui.define([
|
|
|
42
56
|
* Creates a new flex object.
|
|
43
57
|
*
|
|
44
58
|
* @param {object} oFileContent - File content
|
|
45
|
-
* @
|
|
59
|
+
* @param {class} [ObjectClass] - Object class to be instantiated
|
|
60
|
+
* @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject} Created flex object
|
|
46
61
|
*/
|
|
47
|
-
FlexObjectFactory.createFromFileContent = function (oFileContent) {
|
|
62
|
+
FlexObjectFactory.createFromFileContent = function (oFileContent, ObjectClass) {
|
|
48
63
|
var oNewFileContent = Object.assign({}, oFileContent);
|
|
49
|
-
var FlexObjectClass = getFlexObjectClass(oNewFileContent);
|
|
64
|
+
var FlexObjectClass = ObjectClass || getFlexObjectClass(oNewFileContent);
|
|
50
65
|
if (!FlexObjectClass) {
|
|
51
66
|
throw new Error("Unknown file type");
|
|
52
67
|
}
|
|
53
68
|
oNewFileContent.support = Object.assign(
|
|
54
|
-
{
|
|
69
|
+
{
|
|
70
|
+
generator: "FlexObjectFactory.createFromFileContent",
|
|
71
|
+
sapui5Version: Core.getConfiguration().getVersion().toString()
|
|
72
|
+
},
|
|
55
73
|
oNewFileContent.support || {}
|
|
56
74
|
);
|
|
57
75
|
var oMappingInfo = FlexObjectClass.getMappingInfo();
|
|
58
|
-
var mCreationInfo =
|
|
76
|
+
var mCreationInfo = FlexObject.mapFileContent(oNewFileContent, oMappingInfo);
|
|
59
77
|
var mProperties = Object.entries(mCreationInfo).reduce(function (mPropertyMap, aProperty) {
|
|
60
78
|
ObjectPath.set(aProperty[0].split('.'), aProperty[1], mPropertyMap);
|
|
61
79
|
return mPropertyMap;
|
|
@@ -64,5 +82,86 @@ sap.ui.define([
|
|
|
64
82
|
return oFlexObject;
|
|
65
83
|
};
|
|
66
84
|
|
|
85
|
+
/**
|
|
86
|
+
* Creates a new flex object of type <code>CompVariant</code>.
|
|
87
|
+
*
|
|
88
|
+
* @param {object} oFileContent - File content
|
|
89
|
+
* @param {string} oFileContent.type - Defines the flex object type - should be variant for CompVariants
|
|
90
|
+
* @param {string} [oFileContent.fileName] - Acts as the unique identifier on the storage
|
|
91
|
+
* @param {string} [oFileContent.id] - Unique identifier at runtime
|
|
92
|
+
*
|
|
93
|
+
* For the properties below, refer to <code>sap.ui.fl.apply._internal.flexObjects.FlexObject</code>
|
|
94
|
+
* @param {object} [oFileContent.content] - see above
|
|
95
|
+
* @param {object} [oFileContent.layer] - see above
|
|
96
|
+
* @param {object} [oFileContent.texts] - see above
|
|
97
|
+
* @param {string} [oFileContent.reference] - see <code>sap.ui.fl.apply._internal.flexObjects.FlexObject.FlexObjectMetadata</code>
|
|
98
|
+
* @param {string} [oFileContent.packageName] - see <code>sap.ui.fl.apply._internal.flexObjects.FlexObject.FlexObjectMetadata</code>
|
|
99
|
+
* @param {string} [oFileContent.creation] - see <code>sap.ui.fl.apply._internal.flexObjects.FlexObject.FlexObjectMetadata</code>
|
|
100
|
+
* @param {string} [oFileContent.originalLanguage] - see <code>sap.ui.fl.apply._internal.flexObjects.FlexObject.SupportInformation</code>
|
|
101
|
+
* @param {string} [oFileContent.sourceSystem] - see <code>sap.ui.fl.apply._internal.flexObjects.FlexObject.SupportInformation</code>
|
|
102
|
+
* @param {string} [oFileContent.sourceClient] - see <code>sap.ui.fl.apply._internal.flexObjects.FlexObject.SupportInformation</code>
|
|
103
|
+
* @param {string} [oFileContent.command] - see <code>sap.ui.fl.apply._internal.flexObjects.FlexObject.SupportInformation</code>
|
|
104
|
+
* @param {string} [oFileContent.generator] - see <code>sap.ui.fl.apply._internal.flexObjects.FlexObject.SupportInformation</code>
|
|
105
|
+
*
|
|
106
|
+
* For the properties below, refer to <code>sap.ui.fl.apply._internal.flexObjects.Variant</code>
|
|
107
|
+
* @param {string} [oFileContent.variantId] - see above
|
|
108
|
+
* @param {object} [oFileContent.favorite] - see above
|
|
109
|
+
* @param {object} [oFileContent.contexts] - see above
|
|
110
|
+
* @param {object} [oFileContent.executeOnSelection] - see above
|
|
111
|
+
*
|
|
112
|
+
* @param {string} [oFileContent.persistencyKey] - see <code>sap.ui.fl.apply._internal.flexObjects.CompVariant</code>
|
|
113
|
+
*
|
|
114
|
+
* @returns {sap.ui.fl.apply._internal.flexObjects.CompVariant} Created comp variant object
|
|
115
|
+
*/
|
|
116
|
+
FlexObjectFactory.createCompVariant = function (oFileContent) {
|
|
117
|
+
var sFileName = oFileContent.fileName
|
|
118
|
+
|| oFileContent.id
|
|
119
|
+
|| flUtils.createDefaultFileName(oFileContent.fileType);
|
|
120
|
+
|
|
121
|
+
var mCompVariantContent = {
|
|
122
|
+
id: sFileName,
|
|
123
|
+
variantId: oFileContent.variantId || sFileName,
|
|
124
|
+
content: oFileContent.content || {},
|
|
125
|
+
contexts: oFileContent.contexts || {},
|
|
126
|
+
layer: oFileContent.layer,
|
|
127
|
+
favorite: oFileContent.favorite,
|
|
128
|
+
texts: oFileContent.texts,
|
|
129
|
+
persistencyKey: oFileContent.persistencyKey
|
|
130
|
+
|| ObjectPath.get("selector.persistencyKey", oFileContent),
|
|
131
|
+
persisted: oFileContent.persisted,
|
|
132
|
+
supportInformation: {
|
|
133
|
+
service: oFileContent.ODataService,
|
|
134
|
+
command: oFileContent.command,
|
|
135
|
+
generator: oFileContent.generator || "FlexObjectFactory.createCompVariant",
|
|
136
|
+
user: ObjectPath.get("support.user", oFileContent),
|
|
137
|
+
sapui5Version: Core.getConfiguration().getVersion().toString(),
|
|
138
|
+
sourceSystem: oFileContent.sourceSystem,
|
|
139
|
+
sourceClient: oFileContent.sourceClient,
|
|
140
|
+
originalLanguage: oFileContent.originalLanguage
|
|
141
|
+
},
|
|
142
|
+
flexObjectMetadata: {
|
|
143
|
+
changeType: oFileContent.type,
|
|
144
|
+
reference: oFileContent.reference,
|
|
145
|
+
packageName: oFileContent.packageName,
|
|
146
|
+
creation: oFileContent.creation
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
if (oFileContent.layer === Layer.VENDOR || oFileContent.layer === Layer.CUSTOMER_BASE) {
|
|
151
|
+
mCompVariantContent.favorite = true;
|
|
152
|
+
}
|
|
153
|
+
if (oFileContent.executeOnSelection !== undefined) {
|
|
154
|
+
mCompVariantContent.executeOnSelection = oFileContent.executeOnSelection;
|
|
155
|
+
} else {
|
|
156
|
+
// Legacy changes contains 'executeOnSelect' information inside content structure
|
|
157
|
+
mCompVariantContent.executeOnSelection = mCompVariantContent.content && (
|
|
158
|
+
mCompVariantContent.content.executeOnSelect ||
|
|
159
|
+
mCompVariantContent.content.executeOnSelection
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return new CompVariant(mCompVariantContent);
|
|
164
|
+
};
|
|
165
|
+
|
|
67
166
|
return FlexObjectFactory;
|
|
68
167
|
});
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
sap.ui.define([
|
|
7
|
+
"sap/ui/fl/apply/_internal/flexObjects/FlexObject"
|
|
8
|
+
], function(
|
|
9
|
+
FlexObject
|
|
10
|
+
) {
|
|
11
|
+
"use strict";
|
|
12
|
+
/**
|
|
13
|
+
* Base class for all variants.
|
|
14
|
+
*
|
|
15
|
+
* @class Base class for all variants
|
|
16
|
+
* @extends sap.ui.fl.apply._internal.flexObjects.FlexObject
|
|
17
|
+
* @alias sap.ui.fl.apply._internal.flexObjects.Variant
|
|
18
|
+
* @since 1.103
|
|
19
|
+
* @version 1.104.0
|
|
20
|
+
* @private
|
|
21
|
+
* @ui5-restricted sap.ui.fl
|
|
22
|
+
*/
|
|
23
|
+
var Variant = FlexObject.extend("sap.ui.fl.apply._internal.flexObjects.Variant", /* @lends sap.ui.fl.apply._internal.flexObjects.Variant.prototype */ {
|
|
24
|
+
metadata: {
|
|
25
|
+
properties: {
|
|
26
|
+
/**
|
|
27
|
+
* Indicates whether favorite variants are shown in the variants list.
|
|
28
|
+
*/
|
|
29
|
+
favorite: {
|
|
30
|
+
type: "boolean",
|
|
31
|
+
defaultValue: false
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* Indicates whether the variant is automatically executed.
|
|
35
|
+
*/
|
|
36
|
+
executeOnSelection: {
|
|
37
|
+
type: "boolean",
|
|
38
|
+
defaultValue: false
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* Indicates whether this is a standard variant.
|
|
42
|
+
*/
|
|
43
|
+
standardVariant: {
|
|
44
|
+
type: "boolean",
|
|
45
|
+
defaultValue: false
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* Defines possible variant contexts like roles.
|
|
49
|
+
*/
|
|
50
|
+
contexts: {
|
|
51
|
+
type: "object",
|
|
52
|
+
defaultValue: {}
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* Variant identifier
|
|
56
|
+
*/
|
|
57
|
+
variantId: {
|
|
58
|
+
type: "string"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
aggregations: {
|
|
62
|
+
/**
|
|
63
|
+
* Changes belonging to the variant
|
|
64
|
+
*/
|
|
65
|
+
changes: {
|
|
66
|
+
type: "sap.ui.fl.Change",
|
|
67
|
+
multiple: true,
|
|
68
|
+
defaultValue: []
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
constructor: function() {
|
|
73
|
+
FlexObject.apply(this, arguments);
|
|
74
|
+
|
|
75
|
+
if (!this.getVariantId()) {
|
|
76
|
+
this.setVariantId(this.getId());
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Returns the mapping between flex object properties and file content properties in the back-end response.
|
|
83
|
+
* @returns {object} Mapping information
|
|
84
|
+
* @static
|
|
85
|
+
*/
|
|
86
|
+
Variant.getMappingInfo = function () {
|
|
87
|
+
return Object.assign(FlexObject.getMappingInfo(), {
|
|
88
|
+
favorite: "favorite",
|
|
89
|
+
executeOnSelection: "executeOnSelection",
|
|
90
|
+
standardVariant: "standardVariant",
|
|
91
|
+
contexts: "contexts",
|
|
92
|
+
variantId: "variantId"
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Returns the mapping between flex object properties and file content properties in the back-end response.
|
|
98
|
+
* Can be overridden to avoid access of static mapping within base methods.
|
|
99
|
+
* @returns {object} Mapping information
|
|
100
|
+
*/
|
|
101
|
+
Variant.prototype.getMappingInfo = function () {
|
|
102
|
+
return Variant.getMappingInfo();
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Retrieves the variant name from the <code>texts</code> FlexObject property
|
|
107
|
+
* @returns {string} Variant name
|
|
108
|
+
*/
|
|
109
|
+
Variant.prototype.getName = function () {
|
|
110
|
+
return this.getText("variantName");
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Sets the variant name on the correponding <code>texts</code> FlexObject property
|
|
115
|
+
* @param {string} sName - Variant name
|
|
116
|
+
* @param {boolean} [bSkipStateChange] - If set to <code>true</code>, doesn't set the state to dirty
|
|
117
|
+
*/
|
|
118
|
+
Variant.prototype.setName = function(sName, bSkipStateChange) {
|
|
119
|
+
this.setText("variantName", sName, bSkipStateChange);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
return Variant;
|
|
123
|
+
});
|
|
@@ -76,7 +76,7 @@ sap.ui.define([
|
|
|
76
76
|
* @namespace sap.ui.fl.apply._internal.flexState.FlexState
|
|
77
77
|
* @experimental
|
|
78
78
|
* @since 1.73
|
|
79
|
-
* @version 1.
|
|
79
|
+
* @version 1.104.0
|
|
80
80
|
* @private
|
|
81
81
|
* @ui5-restricted sap.ui.fl.apply._internal
|
|
82
82
|
*/
|
|
@@ -481,8 +481,9 @@ sap.ui.define([
|
|
|
481
481
|
return _mInstances[sReference].unfilteredStorageResponse;
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
|
-
return
|
|
484
|
+
return Promise.resolve();
|
|
485
485
|
};
|
|
486
|
+
|
|
486
487
|
// temporary function until the maps are ready
|
|
487
488
|
FlexState.getFlexObjectsFromStorageResponse = function(sReference) {
|
|
488
489
|
return _mInstances[sReference] && _mInstances[sReference].unfilteredStorageResponse.changes;
|
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/ui/fl/apply/_internal/flexObjects/CompVariant",
|
|
9
|
+
"sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory",
|
|
9
10
|
"sap/base/Log"
|
|
10
11
|
], function(
|
|
11
12
|
CompVariant,
|
|
13
|
+
FlexObjectFactory,
|
|
12
14
|
Log
|
|
13
15
|
) {
|
|
14
16
|
"use strict";
|
|
@@ -31,17 +33,17 @@ sap.ui.define([
|
|
|
31
33
|
if (oChangeContent.contexts) {
|
|
32
34
|
oVariant.setContexts(oChangeContent.contexts);
|
|
33
35
|
}
|
|
36
|
+
|
|
34
37
|
if (oChangeContent.variantContent) {
|
|
35
|
-
oVariant.setContent(oChangeContent.variantContent);
|
|
38
|
+
oVariant.setContent(oChangeContent.variantContent, /* bSkipStateChange = */ true);
|
|
36
39
|
}
|
|
37
|
-
|
|
38
40
|
var sVariantName = oChange.getText("variantName");
|
|
39
41
|
if (sVariantName) {
|
|
40
|
-
oVariant.setName(sVariantName);
|
|
42
|
+
oVariant.setName(sVariantName, /* bSkipStateChange = */ true);
|
|
41
43
|
}
|
|
42
44
|
},
|
|
43
45
|
standardVariant: function (oVariant, oChange) {
|
|
44
|
-
// legacy change on
|
|
46
|
+
// legacy change on standard variants
|
|
45
47
|
oVariant.setExecuteOnSelection(oChange.getContent().executeOnSelect);
|
|
46
48
|
}
|
|
47
49
|
};
|
|
@@ -69,7 +71,8 @@ sap.ui.define([
|
|
|
69
71
|
|
|
70
72
|
function createVariant(sPersistencyKey, oVariantInput) {
|
|
71
73
|
var oVariantData = {
|
|
72
|
-
fileName: oVariantInput.
|
|
74
|
+
fileName: oVariantInput.fileName,
|
|
75
|
+
variantId: oVariantInput.id || CompVariant.STANDARD_VARIANT_ID,
|
|
73
76
|
persisted: oVariantInput.persisted,
|
|
74
77
|
content: oVariantInput.content || {},
|
|
75
78
|
texts: {
|
|
@@ -90,7 +93,7 @@ sap.ui.define([
|
|
|
90
93
|
oVariantData.executeOnSelection = oVariantInput.executeOnSelection;
|
|
91
94
|
}
|
|
92
95
|
|
|
93
|
-
return
|
|
96
|
+
return FlexObjectFactory.createCompVariant(oVariantData);
|
|
94
97
|
}
|
|
95
98
|
|
|
96
99
|
function applyChangeOnVariant(oVariant, oChange) {
|
|
@@ -100,7 +103,7 @@ sap.ui.define([
|
|
|
100
103
|
}
|
|
101
104
|
|
|
102
105
|
function applyChangesOnVariant(mChanges, oVariant) {
|
|
103
|
-
var sVariantId = oVariant.
|
|
106
|
+
var sVariantId = oVariant.getVariantId();
|
|
104
107
|
if (mChanges[sVariantId]) {
|
|
105
108
|
mChanges[sVariantId].forEach(function (oChange) {
|
|
106
109
|
applyChangeOnVariant(oVariant, oChange);
|
|
@@ -114,7 +117,7 @@ sap.ui.define([
|
|
|
114
117
|
*
|
|
115
118
|
* @namespace sap.ui.fl.apply._internal.flexState.compVariants.CompVariantMerger
|
|
116
119
|
* @since 1.86
|
|
117
|
-
* @version 1.
|
|
120
|
+
* @version 1.104.0
|
|
118
121
|
* @private
|
|
119
122
|
* @ui5-restricted sap.ui.fl
|
|
120
123
|
*/
|
|
@@ -146,13 +149,13 @@ sap.ui.define([
|
|
|
146
149
|
// the standard must always be visible
|
|
147
150
|
oStandardVariant.setFavorite(true);
|
|
148
151
|
oStandardVariant.setStandardVariant(true);
|
|
149
|
-
mCompData.byId[oStandardVariant.
|
|
152
|
+
mCompData.byId[oStandardVariant.getVariantId()] = oStandardVariant;
|
|
150
153
|
|
|
151
154
|
var oStandardVariantChange = mCompData.standardVariantChange;
|
|
152
155
|
if (oStandardVariantChange) {
|
|
153
|
-
mChanges[oStandardVariant.
|
|
154
|
-
mChanges[oStandardVariant.
|
|
155
|
-
mChanges[oStandardVariant.
|
|
156
|
+
mChanges[oStandardVariant.getVariantId()] = mChanges[oStandardVariant.getVariantId()] || [];
|
|
157
|
+
mChanges[oStandardVariant.getVariantId()].push(oStandardVariantChange);
|
|
158
|
+
mChanges[oStandardVariant.getVariantId()].sort(function (a, b) {
|
|
156
159
|
if (a.getDefinition().creation < b.getDefinition().creation) {
|
|
157
160
|
return -1;
|
|
158
161
|
}
|
|
@@ -179,7 +182,7 @@ sap.ui.define([
|
|
|
179
182
|
*
|
|
180
183
|
* @function
|
|
181
184
|
* @since 1.89
|
|
182
|
-
* @version 1.
|
|
185
|
+
* @version 1.104.0
|
|
183
186
|
* @private
|
|
184
187
|
* @ui5-restricted sap.ui.fl
|
|
185
188
|
*
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
-
"sap/ui/fl/apply/_internal/flexObjects/
|
|
8
|
+
"sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory",
|
|
9
9
|
"sap/ui/fl/apply/_internal/flexObjects/States",
|
|
10
10
|
"sap/ui/fl/apply/_internal/flexObjects/UpdatableChange",
|
|
11
11
|
"sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger"
|
|
12
12
|
], function(
|
|
13
|
-
|
|
13
|
+
FlexObjectFactory,
|
|
14
14
|
States,
|
|
15
15
|
UpdatableChange,
|
|
16
16
|
CompVariantMerger
|
|
@@ -54,16 +54,23 @@ sap.ui.define([
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
function buildSectionMap(mCompSection, sSubSection, mCompVariants) {
|
|
57
|
-
var Class = sSubSection === "variants" ? CompVariant : UpdatableChange;
|
|
58
57
|
var aFlexObjects = mCompSection[sSubSection].map(function (oCompVariantChangeDefinition) {
|
|
59
|
-
var oFlexObject
|
|
58
|
+
var oFlexObject;
|
|
59
|
+
if (sSubSection === "variants") {
|
|
60
|
+
oFlexObject = FlexObjectFactory.createCompVariant(oCompVariantChangeDefinition);
|
|
61
|
+
} else {
|
|
62
|
+
oFlexObject = new UpdatableChange(oCompVariantChangeDefinition);
|
|
63
|
+
}
|
|
60
64
|
oFlexObject.setState(States.PERSISTED); // prevent persisting these anew
|
|
61
65
|
return oFlexObject;
|
|
62
66
|
});
|
|
63
67
|
|
|
64
68
|
aFlexObjects.forEach(function (oFlexObject) {
|
|
65
|
-
var sPersistencyKey = oFlexObject.getSelector().persistencyKey;
|
|
66
|
-
getOrCreate(
|
|
69
|
+
var sPersistencyKey = oFlexObject.getPersistencyKey ? oFlexObject.getPersistencyKey() : oFlexObject.getSelector().persistencyKey;
|
|
70
|
+
getOrCreate(
|
|
71
|
+
mCompVariants,
|
|
72
|
+
sPersistencyKey
|
|
73
|
+
).byId[oFlexObject.getId()] = oFlexObject;
|
|
67
74
|
|
|
68
75
|
switch (sSubSection) {
|
|
69
76
|
case "standardVariants":
|
|
@@ -14,7 +14,7 @@ sap.ui.define(["sap/ui/core/Core"], function(oCore) {
|
|
|
14
14
|
* @alias sap.ui.fl.apply._internal.preprocessors.EventHistory
|
|
15
15
|
* @experimental Since 1.47.0
|
|
16
16
|
* @author SAP SE
|
|
17
|
-
* @version 1.
|
|
17
|
+
* @version 1.104.0
|
|
18
18
|
*
|
|
19
19
|
* @private
|
|
20
20
|
* @ui5-restricted sap.ui.fl.apply._internal.preprocessors.RegistrationDelegator
|
|
@@ -29,7 +29,7 @@ sap.ui.define([
|
|
|
29
29
|
* @namespace sap.ui.fl.apply.api.ControlVariantApplyAPI
|
|
30
30
|
* @experimental Since 1.67
|
|
31
31
|
* @since 1.67
|
|
32
|
-
* @version 1.
|
|
32
|
+
* @version 1.104.0
|
|
33
33
|
* @public
|
|
34
34
|
*/
|
|
35
35
|
var ControlVariantApplyAPI = /** @lends sap.ui.fl.apply.api.ControlVariantApplyAPI */{
|
|
@@ -16,7 +16,7 @@ sap.ui.define([
|
|
|
16
16
|
*
|
|
17
17
|
* @alias sap.ui.fl.changeHandler.AddXML
|
|
18
18
|
* @author SAP SE
|
|
19
|
-
* @version 1.
|
|
19
|
+
* @version 1.104.0
|
|
20
20
|
* @since 1.54
|
|
21
21
|
* @private
|
|
22
22
|
* @experimental Since 1.54. This class is experimental and provides only limited functionality. Also the API might be changed in future.
|
|
@@ -16,7 +16,7 @@ sap.ui.define([
|
|
|
16
16
|
*
|
|
17
17
|
* @alias sap.ui.fl.changeHandler.AddXMLAtExtensionPoint
|
|
18
18
|
* @author SAP SE
|
|
19
|
-
* @version 1.
|
|
19
|
+
* @version 1.104.0
|
|
20
20
|
* @since 1.75
|
|
21
21
|
* @private
|
|
22
22
|
* @experimental Since 1.75. This class is experimental and provides only limited functionality. Also the API might be changed in future.
|
|
@@ -22,7 +22,7 @@ sap.ui.define([
|
|
|
22
22
|
*
|
|
23
23
|
* @alias sap.ui.fl.changeHandler.BaseAddXml
|
|
24
24
|
* @author SAP SE
|
|
25
|
-
* @version 1.
|
|
25
|
+
* @version 1.104.0
|
|
26
26
|
* @since 1.75
|
|
27
27
|
* @private
|
|
28
28
|
* @experimental Since 1.75. This class is experimental and provides only limited functionality. Also the API might be changed in future.
|