@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.
Files changed (147) hide show
  1. package/.reuse/dep5 +17 -0
  2. package/LICENSES/LicenseRef-tzdata-PublicDomain.txt +5 -0
  3. package/THIRDPARTY.txt +35 -2
  4. package/package.json +3 -3
  5. package/src/sap/ui/fl/.library +1 -1
  6. package/src/sap/ui/fl/Cache.js +1 -1
  7. package/src/sap/ui/fl/Change.js +1 -1
  8. package/src/sap/ui/fl/ChangePersistence.js +1 -1
  9. package/src/sap/ui/fl/ChangePersistenceFactory.js +1 -1
  10. package/src/sap/ui/fl/FakeLrepConnectorLocalStorage.js +1 -1
  11. package/src/sap/ui/fl/FakeLrepConnectorSessionStorage.js +1 -1
  12. package/src/sap/ui/fl/FakeLrepLocalStorage.js +1 -1
  13. package/src/sap/ui/fl/FlexController.js +1 -1
  14. package/src/sap/ui/fl/FlexControllerFactory.js +1 -1
  15. package/src/sap/ui/fl/LayerUtils.js +1 -1
  16. package/src/sap/ui/fl/Utils.js +2 -6
  17. package/src/sap/ui/fl/Variant.js +1 -1
  18. package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +1 -1
  19. package/src/sap/ui/fl/apply/_internal/changes/Applier.js +1 -1
  20. package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
  21. package/src/sap/ui/fl/apply/_internal/changes/Utils.js +1 -1
  22. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +1 -1
  23. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +1 -1
  24. package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +1 -1
  25. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddAnnotationsToOData.js +1 -1
  26. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeDataSource.js +1 -1
  27. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound.js +1 -1
  28. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetTitle.js +1 -1
  29. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetAbstract.js +1 -1
  30. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds.js +1 -1
  31. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/AddNewCard.js +1 -1
  32. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/ChangeCard.js +1 -1
  33. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard.js +1 -1
  34. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages.js +1 -1
  35. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddLibrary.js +1 -1
  36. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel.js +1 -1
  37. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith.js +1 -1
  38. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetFlexExtensionPointEnabled.js +1 -1
  39. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetMinUI5Version.js +1 -1
  40. package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageUtils.js +1 -1
  41. package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +1 -1
  42. package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +133 -206
  43. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +38 -14
  44. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +109 -10
  45. package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +123 -0
  46. package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +3 -2
  47. package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +1 -1
  48. package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +1 -1
  49. package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
  50. package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +1 -1
  51. package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +1 -1
  52. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +16 -13
  53. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/prepareCompVariantsMap.js +13 -6
  54. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +1 -1
  55. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +1 -1
  56. package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +1 -1
  57. package/src/sap/ui/fl/apply/_internal/preprocessors/EventHistory.js +1 -1
  58. package/src/sap/ui/fl/apply/_internal/preprocessors/RegistrationDelegator.js +1 -1
  59. package/src/sap/ui/fl/apply/_internal/preprocessors/XmlPreprocessor.js +1 -1
  60. package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +1 -1
  61. package/src/sap/ui/fl/changeHandler/AddIFrame.js +1 -1
  62. package/src/sap/ui/fl/changeHandler/AddXML.js +1 -1
  63. package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +1 -1
  64. package/src/sap/ui/fl/changeHandler/Base.js +1 -1
  65. package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +1 -1
  66. package/src/sap/ui/fl/changeHandler/BaseAddXml.js +1 -1
  67. package/src/sap/ui/fl/changeHandler/BaseRename.js +1 -1
  68. package/src/sap/ui/fl/changeHandler/HideControl.js +1 -1
  69. package/src/sap/ui/fl/changeHandler/MoveControls.js +1 -1
  70. package/src/sap/ui/fl/changeHandler/MoveElements.js +1 -1
  71. package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +1 -1
  72. package/src/sap/ui/fl/changeHandler/PropertyChange.js +1 -1
  73. package/src/sap/ui/fl/changeHandler/StashControl.js +1 -1
  74. package/src/sap/ui/fl/changeHandler/UnhideControl.js +1 -1
  75. package/src/sap/ui/fl/changeHandler/UnstashControl.js +1 -1
  76. package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +1 -1
  77. package/src/sap/ui/fl/codeExt/CodeExtManager.js +1 -1
  78. package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +4 -4
  79. package/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js +1 -1
  80. package/src/sap/ui/fl/descriptorRelated/api/DescriptorVariantFactory.js +1 -1
  81. package/src/sap/ui/fl/designtime/variants/VariantManagement.designtime.js +3 -0
  82. package/src/sap/ui/fl/initial/_internal/Storage.js +1 -1
  83. package/src/sap/ui/fl/initial/_internal/StorageUtils.js +8 -39
  84. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeRegistryItem.js +1 -1
  85. package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +1 -1
  86. package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +1 -1
  87. package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +1 -1
  88. package/src/sap/ui/fl/interfaces/Delegate.js +1 -1
  89. package/src/sap/ui/fl/library.js +9 -9
  90. package/src/sap/ui/fl/support/Flexibility.js +1 -1
  91. package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +1 -1
  92. package/src/sap/ui/fl/support/_internal/getFlexSettings.js +1 -1
  93. package/src/sap/ui/fl/support/api/SupportAPI.js +1 -1
  94. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +1 -1
  95. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +1 -1
  96. package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +1 -1
  97. package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +1 -1
  98. package/src/sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector.js +1 -1
  99. package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +1 -1
  100. package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +1 -1
  101. package/src/sap/ui/fl/support/diagnostics/Flexibility.controller.js +1 -1
  102. package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
  103. package/src/sap/ui/fl/util/IFrame.js +4 -4
  104. package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
  105. package/src/sap/ui/fl/util/resolveBinding.js +1 -1
  106. package/src/sap/ui/fl/variants/VariantManagement.js +577 -2098
  107. package/src/sap/ui/fl/variants/VariantModel.js +1 -1
  108. package/src/sap/ui/fl/write/_internal/Storage.js +1 -1
  109. package/src/sap/ui/fl/write/_internal/StorageFeaturesMerger.js +1 -1
  110. package/src/sap/ui/fl/write/_internal/Versions.js +14 -8
  111. package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +1 -1
  112. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +1 -1
  113. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChange.js +1 -1
  114. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory.js +1 -1
  115. package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +1 -1
  116. package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +1 -1
  117. package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +1 -1
  118. package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +11 -3
  119. package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +9 -2
  120. package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +1 -1
  121. package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +1 -1
  122. package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +1 -1
  123. package/src/sap/ui/fl/write/_internal/connectors/Utils.js +1 -1
  124. package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +1 -1
  125. package/src/sap/ui/fl/write/_internal/extensionPoint/Registry.js +1 -1
  126. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPAccess.js +1 -1
  127. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariant.js +1 -1
  128. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariantFactory.js +1 -1
  129. package/src/sap/ui/fl/write/_internal/fieldExtensibility/MultiTenantABAPExtensibilityVariant.js +1 -1
  130. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ServiceValidation.js +1 -1
  131. package/src/sap/ui/fl/write/_internal/fieldExtensibility/SingleTenantABAPExtensibilityVariant.js +1 -1
  132. package/src/sap/ui/fl/write/_internal/fieldExtensibility/UriParser.js +1 -1
  133. package/src/sap/ui/fl/write/_internal/fieldExtensibility/Utils.js +1 -1
  134. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/CAPAccess.js +1 -1
  135. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.js +1 -1
  136. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.js +1 -1
  137. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.js +1 -1
  138. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +1 -1
  139. package/src/sap/ui/fl/write/_internal/flexState/FlexObjectState.js +1 -1
  140. package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +120 -134
  141. package/src/sap/ui/fl/write/_internal/transport/TransportDialog.js +4 -4
  142. package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +1 -1
  143. package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -1
  144. package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
  145. package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +101 -69
  146. package/src/sap/ui/fl/write/api/Version.js +6 -1
  147. 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/fl/apply/_internal/flexObjects/FlexObject"
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
- FlexObject
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.102.2
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
- * @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject} The created flex object
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
- { generator: "FlexObjectFactory.createFromFileContent" },
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 = FlexObjectClass.mapFileContent(oNewFileContent, oMappingInfo);
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.102.2
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 undefined;
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;
@@ -73,7 +73,7 @@ sap.ui.define([
73
73
  * @namespace sap.ui.fl.apply._internal.flexState.Loader
74
74
  * @experimental
75
75
  * @since 1.74
76
- * @version 1.102.2
76
+ * @version 1.104.0
77
77
  * @private
78
78
  * @ui5-restricted sap.ui.fl.apply._internal.flexState
79
79
  */
@@ -33,7 +33,7 @@ function(
33
33
  * @namespace sap.ui.fl.apply._internal.flexState.ManifestUtils
34
34
  * @experimental
35
35
  * @since 1.74
36
- * @version 1.102.2
36
+ * @version 1.104.0
37
37
  * @private
38
38
  */
39
39
  var ManifestUtils = {
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  * @namespace sap.ui.fl.apply._internal.flexState.UI2Personalization.UI2PersonalizationState
20
20
  * @experimental Since 1.75
21
21
  * @since 1.75
22
- * @version 1.102.2
22
+ * @version 1.104.0
23
23
  * @private
24
24
  * @ui5-restricted
25
25
  */
@@ -23,7 +23,7 @@ sap.ui.define([
23
23
  * @namespace sap.ui.fl.apply._internal.flexState.changes.DependencyHandler
24
24
  * @experimental
25
25
  * @since 1.74
26
- * @version 1.102.2
26
+ * @version 1.104.0
27
27
  * @private
28
28
  * @ui5-restricted sap.ui.fl
29
29
  */
@@ -28,7 +28,7 @@ sap.ui.define([
28
28
  * @namespace sap.ui.fl.apply._internal.flexState.changes.ExtensionPointState
29
29
  * @experimental Since 1.79
30
30
  * @since 1.79
31
- * @version 1.102.2
31
+ * @version 1.104.0
32
32
  * @private
33
33
  * @ui5-restricted
34
34
  */
@@ -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 stanard variants
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.id || CompVariant.STANDARD_VARIANT_ID,
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 new CompVariant(oVariantData);
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.getId();
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.102.2
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.getId()] = oStandardVariant;
152
+ mCompData.byId[oStandardVariant.getVariantId()] = oStandardVariant;
150
153
 
151
154
  var oStandardVariantChange = mCompData.standardVariantChange;
152
155
  if (oStandardVariantChange) {
153
- mChanges[oStandardVariant.getId()] = mChanges[oStandardVariant.getId()] || [];
154
- mChanges[oStandardVariant.getId()].push(oStandardVariantChange);
155
- mChanges[oStandardVariant.getId()].sort(function (a, b) {
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.102.2
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/CompVariant",
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
- CompVariant,
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 = new Class(oCompVariantChangeDefinition);
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(mCompVariants, sPersistencyKey).byId[oFlexObject.getId()] = oFlexObject;
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":
@@ -91,7 +91,7 @@ sap.ui.define([
91
91
  * @namespace sap.ui.fl.apply._internal.flexState.controlVariants.Switcher
92
92
  * @experimental Since 1.74
93
93
  * @since 1.74
94
- * @version 1.102.2
94
+ * @version 1.104.0
95
95
  * @private
96
96
  * @ui5-restricted
97
97
  */
@@ -43,7 +43,7 @@ sap.ui.define([
43
43
  * @namespace sap.ui.fl.apply._internal.flexState.controlVariants.VariantManagementState
44
44
  * @experimental Since 1.74
45
45
  * @since 1.74
46
- * @version 1.102.2
46
+ * @version 1.104.0
47
47
  * @private
48
48
  * @ui5-restricted
49
49
  */
@@ -26,7 +26,7 @@ sap.ui.define([
26
26
  * @class
27
27
  * @constructor
28
28
  * @author SAP SE
29
- * @version 1.102.2
29
+ * @version 1.104.0
30
30
  * @experimental Since 1.27.0
31
31
  * @private
32
32
  * @ui5-restricted sap.ui.fl, sap.ui.core
@@ -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.102.2
17
+ * @version 1.104.0
18
18
  *
19
19
  * @private
20
20
  * @ui5-restricted sap.ui.fl.apply._internal.preprocessors.RegistrationDelegator
@@ -44,7 +44,7 @@ sap.ui.define([
44
44
  * @class
45
45
  * @constructor
46
46
  * @author SAP SE
47
- * @version 1.102.2
47
+ * @version 1.104.0
48
48
  * @experimental Since 1.43.0
49
49
  */
50
50
  var RegistrationDelegator = {};
@@ -28,7 +28,7 @@ sap.ui.define([
28
28
  * @class
29
29
  * @constructor
30
30
  * @author SAP SE
31
- * @version 1.102.2
31
+ * @version 1.104.0
32
32
  * @experimental Since 1.27.0
33
33
  */
34
34
  var XmlPreprocessor = function() {};
@@ -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.102.2
32
+ * @version 1.104.0
33
33
  * @public
34
34
  */
35
35
  var ControlVariantApplyAPI = /** @lends sap.ui.fl.apply.api.ControlVariantApplyAPI */{
@@ -20,7 +20,7 @@ sap.ui.define([
20
20
  *
21
21
  * @alias sap.ui.fl.changeHandler.AddIFrame
22
22
  * @author SAP SE
23
- * @version 1.102.2
23
+ * @version 1.104.0
24
24
  * @since 1.72
25
25
  * @private
26
26
  */
@@ -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.102.2
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.102.2
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.
@@ -14,7 +14,7 @@ sap.ui.define([
14
14
  /**
15
15
  * Base functionality for all change handlers, which provides some reuse methods
16
16
  * @namespace sap.ui.fl.changeHandler.Base
17
- * @version 1.102.2
17
+ * @version 1.104.0
18
18
  * @private
19
19
  * @ui5-restricted change handlers
20
20
  */
@@ -39,7 +39,7 @@ sap.ui.define([
39
39
  * @constructor
40
40
  * @alias sap.ui.fl.changeHandler.BaseAddViaDelegate
41
41
  * @author SAP SE
42
- * @version 1.102.2
42
+ * @version 1.104.0
43
43
  * @public
44
44
  * @experimental Since 1.81
45
45
  */
@@ -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.102.2
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.
@@ -21,7 +21,7 @@ sap.ui.define([
21
21
  * @constructor
22
22
  * @alias sap.ui.fl.changeHandler.BaseRename
23
23
  * @author SAP SE
24
- * @version 1.102.2
24
+ * @version 1.104.0
25
25
  * @experimental Since 1.46
26
26
  */
27
27
  var BaseRename = {
@@ -21,7 +21,7 @@ sap.ui.define([
21
21
  * Change handler for hiding of a control.
22
22
  * @alias sap.ui.fl.changeHandler.HideControl
23
23
  * @author SAP SE
24
- * @version 1.102.2
24
+ * @version 1.104.0
25
25
  * @experimental Since 1.27.0
26
26
  */
27
27
  var HideControl = {};
@@ -21,7 +21,7 @@ function(
21
21
  *
22
22
  * @alias sap.ui.fl.changeHandler.MoveControls
23
23
  * @author SAP SE
24
- * @version 1.102.2
24
+ * @version 1.104.0
25
25
  * @experimental Since 1.46
26
26
  */
27
27
  var MoveControls = { };
@@ -18,7 +18,7 @@ sap.ui.define([
18
18
  *
19
19
  * @alias sap.ui.fl.changeHandler.MoveElements
20
20
  * @author SAP SE
21
- * @version 1.102.2
21
+ * @version 1.104.0
22
22
  * @experimental Since 1.34.0
23
23
  */
24
24
  var MoveElements = { };