@openui5/sap.ui.fl 1.99.0 → 1.100.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 (191) hide show
  1. package/THIRDPARTY.txt +2 -2
  2. package/package.json +3 -3
  3. package/src/sap/ui/fl/.library +1 -1
  4. package/src/sap/ui/fl/Cache.js +1 -1
  5. package/src/sap/ui/fl/Change.js +27 -5
  6. package/src/sap/ui/fl/ChangePersistence.js +85 -133
  7. package/src/sap/ui/fl/ChangePersistenceFactory.js +1 -1
  8. package/src/sap/ui/fl/FakeLrepConnectorLocalStorage.js +3 -4
  9. package/src/sap/ui/fl/FakeLrepConnectorSessionStorage.js +3 -4
  10. package/src/sap/ui/fl/FakeLrepLocalStorage.js +4 -4
  11. package/src/sap/ui/fl/FlexController.js +9 -50
  12. package/src/sap/ui/fl/FlexControllerFactory.js +1 -1
  13. package/src/sap/ui/fl/LayerUtils.js +1 -1
  14. package/src/sap/ui/fl/Utils.js +1 -1
  15. package/src/sap/ui/fl/Variant.js +1 -1
  16. package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +1 -1
  17. package/src/sap/ui/fl/apply/_internal/changes/Applier.js +10 -8
  18. package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
  19. package/src/sap/ui/fl/apply/_internal/changes/Reverter.js +1 -1
  20. package/src/sap/ui/fl/apply/_internal/changes/Utils.js +46 -2
  21. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +1 -1
  22. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +1 -1
  23. package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +1 -1
  24. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddAnnotationsToOData.js +1 -1
  25. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeDataSource.js +1 -1
  26. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound.js +1 -1
  27. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetTitle.js +1 -1
  28. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetAbstract.js +1 -1
  29. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds.js +1 -1
  30. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/AddNewCard.js +1 -1
  31. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/ChangeCard.js +1 -1
  32. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard.js +1 -1
  33. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages.js +1 -1
  34. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddLibrary.js +1 -1
  35. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel.js +1 -1
  36. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith.js +1 -1
  37. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetFlexExtensionPointEnabled.js +1 -1
  38. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetMinUI5Version.js +1 -1
  39. package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageUtils.js +1 -1
  40. package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +1 -1
  41. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +452 -0
  42. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +68 -0
  43. package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +21 -24
  44. package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +1 -3
  45. package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +1 -1
  46. package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
  47. package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +1 -1
  48. package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +12 -10
  49. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +2 -2
  50. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +1 -1
  51. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +1 -16
  52. package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +1 -1
  53. package/src/sap/ui/fl/apply/_internal/preprocessors/EventHistory.js +1 -1
  54. package/src/sap/ui/fl/apply/_internal/preprocessors/RegistrationDelegator.js +1 -1
  55. package/src/sap/ui/fl/apply/_internal/preprocessors/XmlPreprocessor.js +1 -1
  56. package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +1 -1
  57. package/src/sap/ui/fl/changeHandler/AddIFrame.js +1 -1
  58. package/src/sap/ui/fl/changeHandler/AddXML.js +1 -1
  59. package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +1 -1
  60. package/src/sap/ui/fl/changeHandler/Base.js +1 -1
  61. package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +1 -1
  62. package/src/sap/ui/fl/changeHandler/BaseAddXml.js +1 -1
  63. package/src/sap/ui/fl/changeHandler/BaseRename.js +1 -1
  64. package/src/sap/ui/fl/changeHandler/HideControl.js +1 -1
  65. package/src/sap/ui/fl/changeHandler/MoveControls.js +1 -1
  66. package/src/sap/ui/fl/changeHandler/MoveElements.js +1 -1
  67. package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +1 -1
  68. package/src/sap/ui/fl/changeHandler/PropertyChange.js +1 -1
  69. package/src/sap/ui/fl/changeHandler/StashControl.js +1 -1
  70. package/src/sap/ui/fl/changeHandler/UnhideControl.js +1 -1
  71. package/src/sap/ui/fl/changeHandler/UnstashControl.js +1 -1
  72. package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +1 -1
  73. package/src/sap/ui/fl/codeExt/CodeExtManager.js +1 -1
  74. package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +4 -4
  75. package/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js +1 -1
  76. package/src/sap/ui/fl/descriptorRelated/api/DescriptorVariantFactory.js +1 -1
  77. package/src/sap/ui/fl/initial/_internal/Storage.js +1 -1
  78. package/src/sap/ui/fl/initial/_internal/StorageUtils.js +1 -1
  79. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeRegistryItem.js +1 -1
  80. package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +1 -1
  81. package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +1 -1
  82. package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +1 -1
  83. package/src/sap/ui/fl/interfaces/Delegate.js +1 -1
  84. package/src/sap/ui/fl/library.js +9 -9
  85. package/src/sap/ui/fl/support/Flexibility.js +1 -1
  86. package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +1 -1
  87. package/src/sap/ui/fl/support/_internal/getFlexSettings.js +1 -1
  88. package/src/sap/ui/fl/support/api/SupportAPI.js +1 -1
  89. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +1 -1
  90. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +1 -1
  91. package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +1 -1
  92. package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +1 -1
  93. package/src/sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector.js +1 -1
  94. package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +1 -1
  95. package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +1 -1
  96. package/src/sap/ui/fl/support/diagnostics/Flexibility.controller.js +1 -1
  97. package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
  98. package/src/sap/ui/fl/util/IFrame.js +1 -1
  99. package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
  100. package/src/sap/ui/fl/util/resolveBinding.js +1 -1
  101. package/src/sap/ui/fl/variants/VariantModel.js +1 -1
  102. package/src/sap/ui/fl/variants/context/Component.js +2 -6
  103. package/src/sap/ui/fl/variants/context/controller/ContextVisibility.controller.js +5 -44
  104. package/src/sap/ui/fl/variants/context/i18n/i18n.properties +3 -7
  105. package/src/sap/ui/fl/variants/context/i18n/i18n_ar.properties +2 -4
  106. package/src/sap/ui/fl/variants/context/i18n/i18n_bg.properties +2 -4
  107. package/src/sap/ui/fl/variants/context/i18n/i18n_ca.properties +2 -4
  108. package/src/sap/ui/fl/variants/context/i18n/i18n_cs.properties +2 -4
  109. package/src/sap/ui/fl/variants/context/i18n/i18n_cy.properties +2 -4
  110. package/src/sap/ui/fl/variants/context/i18n/i18n_da.properties +2 -4
  111. package/src/sap/ui/fl/variants/context/i18n/i18n_de.properties +2 -4
  112. package/src/sap/ui/fl/variants/context/i18n/i18n_el.properties +2 -4
  113. package/src/sap/ui/fl/variants/context/i18n/i18n_en.properties +2 -4
  114. package/src/sap/ui/fl/variants/context/i18n/i18n_en_GB.properties +2 -4
  115. package/src/sap/ui/fl/variants/context/i18n/i18n_en_US_sappsd.properties +2 -4
  116. package/src/sap/ui/fl/variants/context/i18n/i18n_en_US_saprigi.properties +2 -4
  117. package/src/sap/ui/fl/variants/context/i18n/i18n_en_US_saptrc.properties +2 -4
  118. package/src/sap/ui/fl/variants/context/i18n/i18n_es.properties +2 -4
  119. package/src/sap/ui/fl/variants/context/i18n/i18n_es_MX.properties +2 -4
  120. package/src/sap/ui/fl/variants/context/i18n/i18n_et.properties +2 -4
  121. package/src/sap/ui/fl/variants/context/i18n/i18n_fi.properties +2 -4
  122. package/src/sap/ui/fl/variants/context/i18n/i18n_fr.properties +2 -4
  123. package/src/sap/ui/fl/variants/context/i18n/i18n_fr_CA.properties +2 -4
  124. package/src/sap/ui/fl/variants/context/i18n/i18n_hi.properties +2 -4
  125. package/src/sap/ui/fl/variants/context/i18n/i18n_hr.properties +2 -4
  126. package/src/sap/ui/fl/variants/context/i18n/i18n_hu.properties +2 -4
  127. package/src/sap/ui/fl/variants/context/i18n/i18n_id.properties +2 -4
  128. package/src/sap/ui/fl/variants/context/i18n/i18n_it.properties +2 -4
  129. package/src/sap/ui/fl/variants/context/i18n/i18n_iw.properties +2 -4
  130. package/src/sap/ui/fl/variants/context/i18n/i18n_ja.properties +2 -4
  131. package/src/sap/ui/fl/variants/context/i18n/i18n_kk.properties +2 -4
  132. package/src/sap/ui/fl/variants/context/i18n/i18n_ko.properties +2 -4
  133. package/src/sap/ui/fl/variants/context/i18n/i18n_lt.properties +2 -4
  134. package/src/sap/ui/fl/variants/context/i18n/i18n_lv.properties +2 -4
  135. package/src/sap/ui/fl/variants/context/i18n/i18n_ms.properties +2 -4
  136. package/src/sap/ui/fl/variants/context/i18n/i18n_nl.properties +2 -4
  137. package/src/sap/ui/fl/variants/context/i18n/i18n_no.properties +2 -4
  138. package/src/sap/ui/fl/variants/context/i18n/i18n_pl.properties +2 -4
  139. package/src/sap/ui/fl/variants/context/i18n/i18n_pt.properties +2 -4
  140. package/src/sap/ui/fl/variants/context/i18n/i18n_pt_PT.properties +2 -4
  141. package/src/sap/ui/fl/variants/context/i18n/i18n_ro.properties +2 -4
  142. package/src/sap/ui/fl/variants/context/i18n/i18n_ru.properties +2 -4
  143. package/src/sap/ui/fl/variants/context/i18n/i18n_sh.properties +2 -4
  144. package/src/sap/ui/fl/variants/context/i18n/i18n_sk.properties +2 -4
  145. package/src/sap/ui/fl/variants/context/i18n/i18n_sl.properties +2 -4
  146. package/src/sap/ui/fl/variants/context/i18n/i18n_sv.properties +2 -4
  147. package/src/sap/ui/fl/variants/context/i18n/i18n_th.properties +2 -4
  148. package/src/sap/ui/fl/variants/context/i18n/i18n_tr.properties +2 -4
  149. package/src/sap/ui/fl/variants/context/i18n/i18n_uk.properties +2 -4
  150. package/src/sap/ui/fl/variants/context/i18n/i18n_vi.properties +2 -4
  151. package/src/sap/ui/fl/variants/context/i18n/i18n_zh_CN.properties +2 -4
  152. package/src/sap/ui/fl/variants/context/i18n/i18n_zh_TW.properties +2 -4
  153. package/src/sap/ui/fl/variants/context/view/ContextVisibility.view.xml +7 -6
  154. package/src/sap/ui/fl/write/_internal/Storage.js +1 -1
  155. package/src/sap/ui/fl/write/_internal/StorageFeaturesMerger.js +1 -1
  156. package/src/sap/ui/fl/write/_internal/Versions.js +2 -2
  157. package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +5 -1
  158. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +4 -2
  159. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChange.js +1 -1
  160. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory.js +1 -1
  161. package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +2 -2
  162. package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +1 -1
  163. package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +1 -1
  164. package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +1 -1
  165. package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +1 -1
  166. package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +1 -1
  167. package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +1 -1
  168. package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +1 -1
  169. package/src/sap/ui/fl/write/_internal/connectors/Utils.js +1 -1
  170. package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +1 -1
  171. package/src/sap/ui/fl/write/_internal/extensionPoint/Registry.js +1 -1
  172. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPAccess.js +1 -1
  173. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariant.js +1 -1
  174. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariantFactory.js +1 -1
  175. package/src/sap/ui/fl/write/_internal/fieldExtensibility/MultiTenantABAPExtensibilityVariant.js +1 -1
  176. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ServiceValidation.js +1 -1
  177. package/src/sap/ui/fl/write/_internal/fieldExtensibility/SingleTenantABAPExtensibilityVariant.js +1 -1
  178. package/src/sap/ui/fl/write/_internal/fieldExtensibility/UriParser.js +1 -1
  179. package/src/sap/ui/fl/write/_internal/fieldExtensibility/Utils.js +1 -1
  180. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/CAPAccess.js +1 -1
  181. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.js +1 -1
  182. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.js +1 -1
  183. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.js +1 -1
  184. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +1 -1
  185. package/src/sap/ui/fl/write/_internal/flexState/FlexObjectState.js +2 -2
  186. package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +1 -1
  187. package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +1 -1
  188. package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -1
  189. package/src/sap/ui/fl/write/api/AppVariantWriteAPI.js +13 -4
  190. package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
  191. package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +49 -4
@@ -0,0 +1,452 @@
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/base/Log",
8
+ "sap/base/util/deepClone",
9
+ "sap/base/util/isEmptyObject",
10
+ "sap/base/util/isPlainObject",
11
+ "sap/base/util/ObjectPath",
12
+ "sap/base/util/restricted/_omit",
13
+ "sap/ui/base/ManagedObject",
14
+ "sap/ui/fl/apply/_internal/flexObjects/States",
15
+ "sap/ui/fl/Layer",
16
+ "sap/ui/fl/registry/Settings",
17
+ "sap/ui/fl/Utils"
18
+ ], function(
19
+ Log,
20
+ deepClone,
21
+ isEmptyObject,
22
+ isPlainObject,
23
+ ObjectPath,
24
+ _omit,
25
+ ManagedObject,
26
+ States,
27
+ Layer,
28
+ Settings,
29
+ Utils
30
+ ) {
31
+ "use strict";
32
+
33
+ /**
34
+ * @type {sap.ui.fl.apply._internal.flexObjects.FlexObject.FlexObjectMetadata}
35
+ * @static
36
+ * @constant
37
+ * @typedef {object} sap.ui.fl.apply._internal.flexObjects.FlexObject.FlexObjectMetadata
38
+ * @property {string} reference - Application component name
39
+ * @property {string} namespace - Namespace of the flex object file
40
+ * @property {string} creation - Timestamp of creation date
41
+ * @property {string} projectId - Project ID of the flex object file
42
+ * @property {string} packageName - ABAP package name
43
+ * @property {string} moduleName - Name of the module which this flex object refers to (XML or JS)
44
+ * @private
45
+ */
46
+
47
+ /**
48
+ * @type {sap.ui.fl.apply._internal.flexObjects.FlexObject.SupportInformation}
49
+ * @static
50
+ * @constant
51
+ * @typedef {object} sap.ui.fl.apply._internal.flexObjects.FlexObject.SupportInformation
52
+ * @property {string} generator - Tool that is used to generate the flex object file
53
+ * @property {string} service - Name of the OData service
54
+ * @property {string} sourceSystem - ABAP source system
55
+ * @property {string} sourceClient - ABAP source client
56
+ * @property {string} user - Username who created the flex object
57
+ * @property {string} sapui5Version - UI5 version in which the flex object was created
58
+ * @property {string} sourceChangeFileName - File name of the source flex object in case of a copied flex object
59
+ * @property {string} compositeCommand - Unique ID that defines which flex objects belong together in a composite command
60
+ * @property {string} command - Name of the command
61
+ * @property {string} oDataInformation - Object with information about the OData service
62
+ * @property {string} originalLanguage - Language in which the flex object was created
63
+ * @private
64
+ */
65
+
66
+ /**
67
+ * Base class for any flex object.
68
+ *
69
+ * @class Base class for any flex object
70
+ * @extends sap.ui.base.ManagedObject
71
+ * @alias sap.ui.fl.apply._internal.flexObjects.FlexObject
72
+ * @since 1.100
73
+ * @version 1.100.0
74
+ * @private
75
+ * @ui5-restricted sap.ui.fl
76
+ */
77
+ var FlexObject = ManagedObject.extend("sap.ui.fl.apply._internal.flexObjects.FlexObject", /* @lends sap.ui.fl.apply._internal.flexObjects.FlexObject.prototype */ {
78
+ metadata: {
79
+ properties: {
80
+ /**
81
+ * Current state of the flex object regarding the persistence.
82
+ * See {@link sap.ui.fl.apply._internal.flexObjects.States}.
83
+ */
84
+ state: {
85
+ type: "string",
86
+ defaultValue: States.NEW
87
+ },
88
+ /**
89
+ * File type of the flex object.
90
+ * One of <code>change</code>, <code>variant</code>, <code>ctrl_variant</code>,
91
+ * <code>ctrl_variant_change</code> or <code>ctrl_variant_management_change</code>
92
+ */
93
+ fileType: {
94
+ type: "string",
95
+ defaultValue: "change"
96
+ },
97
+ /**
98
+ * Layer of the flex object.
99
+ * See {@link sap.ui.fl.Layer}.
100
+ */
101
+ layer: {
102
+ type: "string"
103
+ },
104
+ /**
105
+ * Additional metadata of the flex object.
106
+ * See {@link sap.ui.fl.apply._internal.flexObjects.FlexObject.FlexObjectMetadata}.
107
+ */
108
+ flexObjectMetadata: {
109
+ type: "object",
110
+ defaultValue: {}
111
+ },
112
+ /**
113
+ * Optional support information.
114
+ * See {@link sap.ui.fl.apply._internal.flexObjects.FlexObject.SupportInformation}.
115
+ */
116
+ supportInformation: {
117
+ type: "object",
118
+ defaultValue: {}
119
+ },
120
+ /**
121
+ * Content of the flex object that is used to apply the flex object.
122
+ */
123
+ content: {
124
+ type: "any"
125
+ },
126
+ /**
127
+ * Map of texts that should be translated.
128
+ */
129
+ texts: {
130
+ type: "object",
131
+ defaultValue: {}
132
+ }
133
+ }
134
+ },
135
+ constructor: function() {
136
+ ManagedObject.apply(this, arguments);
137
+ var oFlexObjectMetadata = this.getFlexObjectMetadata();
138
+ if (oFlexObjectMetadata.reference) {
139
+ oFlexObjectMetadata.namespace = (
140
+ oFlexObjectMetadata.namespace
141
+ || Utils.createNamespace(
142
+ { reference: oFlexObjectMetadata.reference },
143
+ this.getFileType()
144
+ )
145
+ );
146
+
147
+ if (!oFlexObjectMetadata.projectId) {
148
+ oFlexObjectMetadata.projectId = oFlexObjectMetadata.reference.replace(".Component", "");
149
+ }
150
+ }
151
+ this.setFlexObjectMetadata(oFlexObjectMetadata);
152
+
153
+ var oSupportInformation = this.getSupportInformation();
154
+ if (!oSupportInformation.originalLanguage) {
155
+ oSupportInformation.originalLanguage = Utils.getCurrentLanguage();
156
+ }
157
+ this.setSupportInformation(oSupportInformation);
158
+ }
159
+ });
160
+
161
+ /**
162
+ * Returns the mapping between flex object properties and file content properties in the back-end response.
163
+ * @returns {object} Mapping information
164
+ * @static
165
+ */
166
+ FlexObject.getMappingInfo = function () {
167
+ return Object.assign({}, {
168
+ "flexObjectMetadata.reference": "reference",
169
+ "flexObjectMetadata.namespace": "namespace",
170
+ "flexObjectMetadata.creation": "creation",
171
+ "flexObjectMetadata.projectId": "projectId",
172
+ "flexObjectMetadata.packageName": "packageName",
173
+ "flexObjectMetadata.moduleName": "moduleName",
174
+ "supportInformation.generator": "support.generator",
175
+ "supportInformation.service": "support.service",
176
+ "supportInformation.sourceSystem": "sourceSystem",
177
+ "supportInformation.sourceClient": "sourceClient",
178
+ "supportInformation.user": "support.user",
179
+ "supportInformation.sapui5Version": "support.sapui5Version",
180
+ "supportInformation.sourceChangeFileName": "support.sourceChangeFileName",
181
+ "supportInformation.compositeCommand": "support.compositeCommand",
182
+ "supportInformation.command": "support.command",
183
+ "supportInformation.oDataInformation": "oDataInformation",
184
+ "supportInformation.originalLanguage": "originalLanguage",
185
+ layer: "layer",
186
+ fileType: "fileType",
187
+ content: "content",
188
+ id: "fileName",
189
+ texts: "texts"
190
+ });
191
+ };
192
+
193
+ /**
194
+ * Returns the mapping between flex object properties and file content properties in the back-end response.
195
+ * Can be overridden to avoid access of static mapping within base methods.
196
+ * @returns {object} Mapping information
197
+ */
198
+ FlexObject.prototype.getMappingInfo = function () {
199
+ return FlexObject.getMappingInfo();
200
+ };
201
+
202
+ /**
203
+ * Sets the content of the flex object and marks the state as DIRTY.
204
+ * @param {any} oContent - Flex object content
205
+ * @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject} <code>this</code> for chaining
206
+ */
207
+ FlexObject.prototype.setContent = function (oContent) {
208
+ this.setProperty("content", oContent);
209
+ this.setState(States.DIRTY);
210
+ return this;
211
+ };
212
+
213
+ /**
214
+ * Getter for additional flex object metadata.
215
+ * @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject.FlexObjectMetadata} Additional metadata
216
+ */
217
+ FlexObject.prototype.getFlexObjectMetadata = function () {
218
+ return Object.assign({}, this.getProperty("flexObjectMetadata"));
219
+ };
220
+
221
+ /**
222
+ * Getter for flex object support information.
223
+ * @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject.SupportInformation} Support information
224
+ */
225
+ FlexObject.prototype.getSupportInformation = function () {
226
+ return Object.assign({}, this.getProperty("supportInformation"));
227
+ };
228
+
229
+ function isValidStateChange(sNewState, sCurrentState) {
230
+ if (!Object.values(States).includes(sNewState)) {
231
+ return false;
232
+ }
233
+ // flex object state cannot move from NEW to DIRTY directly
234
+ if (
235
+ sCurrentState === States.NEW
236
+ && sNewState === States.DIRTY
237
+ ) {
238
+ return false;
239
+ }
240
+ return true;
241
+ }
242
+
243
+ /**
244
+ * Validates and sets the state of the flex object.
245
+ * @param {sap.ui.fl.States} sState - New state
246
+ * @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject} <code>this</code> for chaining
247
+ */
248
+ FlexObject.prototype.setState = function (sState) {
249
+ var sCurrentState = this.getState();
250
+ if (sCurrentState !== sState && isValidStateChange(sState, sCurrentState)) {
251
+ this._sPreviousState = sCurrentState;
252
+ this.setProperty("state", sState);
253
+ }
254
+ return this;
255
+ };
256
+
257
+ /**
258
+ * Changes the state of the flex object to DELETED.
259
+ */
260
+ FlexObject.prototype.markForDeletion = function () {
261
+ this.setState(States.DELETED);
262
+ };
263
+
264
+ /**
265
+ * Restores the state before the last state change.
266
+ * Cannot go back further than the previous state.
267
+ */
268
+ FlexObject.prototype.restorePreviousState = function () {
269
+ if (this._sPreviousState) {
270
+ this.setState(this._sPreviousState);
271
+ delete this._sPreviousState;
272
+ }
273
+ };
274
+
275
+ /**
276
+ * Checks if flex object is read only because of its source system.
277
+ * @returns {boolean} <code>true</code> if the flex object is from another system
278
+ */
279
+ FlexObject.prototype.isChangeFromOtherSystem = function () {
280
+ var sSourceSystem = this.getSupportInformation().sourceSystem;
281
+ var sSourceClient = this.getSupportInformation().sourceClient;
282
+ if (!sSourceSystem || !sSourceClient) {
283
+ return false;
284
+ }
285
+ var oSettings = Settings.getInstanceOrUndef();
286
+ if (!oSettings) {
287
+ return true; // without settings the right to edit or delete a flex object cannot be determined
288
+ }
289
+ var sSystem = oSettings.getSystem();
290
+ var sClient = oSettings.getClient();
291
+ if (!sSystem || !sClient) {
292
+ return false;
293
+ }
294
+ return (sSourceSystem !== sSystem || sSourceClient !== sClient);
295
+ };
296
+
297
+ /**
298
+ * Returns <code>true</code> if the flex object is user dependent.
299
+ * @returns {boolean} <code>true</code> if the flex object is only relevant for the current user
300
+ */
301
+ FlexObject.prototype.isUserDependent = function () {
302
+ return this.getLayer() === Layer.USER;
303
+ };
304
+
305
+ /**
306
+ * Returns the text in the current language for a given ID.
307
+ * @param {string} sTextId - Text ID which was used as part of the <code>texts</code> property
308
+ * @returns {string} The text for the given text ID
309
+ */
310
+ FlexObject.prototype.getText = function (sTextId) {
311
+ var oText = this.getTexts()[sTextId] || {};
312
+ return oText.value || "";
313
+ };
314
+
315
+ /**
316
+ * Sets the new text for the given text ID.
317
+ * @param {string} sTextId - Text ID which was used as part of the <code>texts</code> property
318
+ * @param {string} sNewText - New text for the given text ID
319
+ * @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject} <code>this</code> context for chaining
320
+ */
321
+ FlexObject.prototype.setText = function (sTextId, sNewText) {
322
+ var oTexts = Object.assign({}, this.getTexts());
323
+ if (oTexts[sTextId]) {
324
+ oTexts[sTextId] = Object.assign({}, oTexts[sTextId], {
325
+ value: sNewText
326
+ });
327
+ this.setTexts(oTexts);
328
+ this.setState(States.DIRTY);
329
+ }
330
+ return this;
331
+ };
332
+
333
+ function capitalize(sKey) {
334
+ return sKey.length ? sKey.charAt(0).toUpperCase() + sKey.slice(1) : sKey;
335
+ }
336
+
337
+ function getOriginalMutator(sFunctionName) {
338
+ return typeof this[sFunctionName] === "function"
339
+ ? this[sFunctionName].bind(this)
340
+ : function () {
341
+ throw new Error(sFunctionName + " is not a valid mutator");
342
+ };
343
+ }
344
+
345
+ function getMutators(sPropertyName) {
346
+ var aInstanceParts = sPropertyName.split(".");
347
+ aInstanceParts[0] = capitalize(aInstanceParts[0]);
348
+ var sFunctionName = aInstanceParts.shift();
349
+ var fnGetter = getOriginalMutator.call(this, "get" + sFunctionName);
350
+ var fnSetter = getOriginalMutator.call(this, "set" + sFunctionName);
351
+ return {
352
+ getValue: function () {
353
+ var vCurrentValue = deepClone(fnGetter());
354
+ if (aInstanceParts.length > 0) {
355
+ return ObjectPath.get(aInstanceParts, vCurrentValue);
356
+ }
357
+ return vCurrentValue;
358
+ },
359
+ setValue: function (vValue) {
360
+ var vPropertyValue = deepClone(fnGetter());
361
+ if (aInstanceParts.length > 0) {
362
+ ObjectPath.set(aInstanceParts, vValue, vPropertyValue);
363
+ } else {
364
+ vPropertyValue = vValue;
365
+ }
366
+ fnSetter(vPropertyValue);
367
+ return this;
368
+ }.bind(this)
369
+ };
370
+ }
371
+
372
+ /**
373
+ * Converts properties of the flex object to the file content format according to the mapping info.
374
+ * @returns {object} File content of the flex object that can be persisted
375
+ */
376
+ FlexObject.prototype.convertToFileContent = function() {
377
+ var oFileContent = {};
378
+ Object.entries(this.getMappingInfo()).forEach(function (aProperty) {
379
+ var oValueToSet = getMutators.call(this, aProperty[0]).getValue();
380
+ if (oValueToSet !== undefined) {
381
+ ObjectPath.set(aProperty[1], oValueToSet, oFileContent);
382
+ }
383
+ }.bind(this));
384
+ return oFileContent;
385
+ };
386
+
387
+ function updateProperty(sPropertyName, vValue) {
388
+ var oMutators = getMutators.call(this, sPropertyName);
389
+ var vCurrentValue = oMutators.getValue();
390
+ if (vCurrentValue !== vValue) {
391
+ oMutators.setValue(vValue);
392
+ }
393
+ }
394
+
395
+ /**
396
+ * Converts the file content to the properties of the flex object according to the mapping info.
397
+ * @param {object} oFileContent - File content
398
+ * @param {object} oMappingInfo - Mapping info
399
+ * @returns {object} Properties map to create a new flex object
400
+ * @static
401
+ */
402
+ FlexObject.mapFileContent = function (oFileContent, oMappingInfo) {
403
+ var aValidFileProperties = Object.values(oMappingInfo);
404
+ var mPropertyMap = {};
405
+
406
+ var fnMapProperty = function (sKey, vValue, sPath) {
407
+ var sNewPath = sPath ? sPath + "." + sKey : sKey;
408
+ var iIndex = aValidFileProperties.indexOf(sNewPath);
409
+ if (iIndex >= 0) {
410
+ var sPropertyName = Object.keys(oMappingInfo)[iIndex];
411
+ mPropertyMap[sPropertyName] = vValue;
412
+ } else if (isPlainObject(vValue)) {
413
+ Object.entries(vValue).forEach(function(aEntry) {
414
+ fnMapProperty(aEntry[0], aEntry[1], sNewPath);
415
+ });
416
+ } else {
417
+ Log.error("Missing mapping info for property " + sNewPath);
418
+ }
419
+ };
420
+
421
+ Object.entries(deepClone(oFileContent)).forEach(function (aEntry) {
422
+ fnMapProperty(aEntry[0], aEntry[1]);
423
+ });
424
+ return mPropertyMap;
425
+ };
426
+
427
+ /**
428
+ * Updates the flex object with a file content delta.
429
+ * @param {object} oFileContent - File content of the flex object
430
+ */
431
+ FlexObject.prototype.update = function (oFileContent) {
432
+ var oFilteredFileContent = _omit(oFileContent, ["fileName"]);
433
+ var mProperties = FlexObject.mapFileContent(oFilteredFileContent, this.getMappingInfo());
434
+ Object.entries(mProperties).forEach(function (aProperty) {
435
+ updateProperty.call(this, aProperty[0], aProperty[1]);
436
+ }.bind(this));
437
+ };
438
+
439
+ /**
440
+ * Sets the response from the back end after the flex object is saved.
441
+ * @param {object} oResponse - File content
442
+ */
443
+ FlexObject.prototype.setResponse = function (oResponse) {
444
+ if (!oResponse || isEmptyObject(oResponse)) {
445
+ return;
446
+ }
447
+ this.update(oResponse);
448
+ this.setState(States.PERSISTED);
449
+ };
450
+
451
+ return FlexObject;
452
+ });
@@ -0,0 +1,68 @@
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/base/util/ObjectPath",
8
+ "sap/ui/fl/apply/_internal/flexObjects/FlexObject"
9
+ ], function(
10
+ ObjectPath,
11
+ FlexObject
12
+ ) {
13
+ "use strict";
14
+
15
+ /**
16
+ * @enum {string}
17
+ * Valid flex object types.
18
+ *
19
+ * @alias sap.ui.fl.apply._internal.flexObjects.FlexObjectFactory.FLEX_OBJECT_TYPES
20
+ * @private
21
+ */
22
+ var FLEX_OBJECT_TYPES = {
23
+ BASE_FLEX_OBJECT: FlexObject
24
+ };
25
+
26
+ function getFlexObjectClass () {
27
+ return FLEX_OBJECT_TYPES.BASE_FLEX_OBJECT;
28
+ }
29
+
30
+ /**
31
+ * Helper class to create any flex object.
32
+ *
33
+ * @namespace sap.ui.fl.apply._internal.flexObjects.FlexObjectFactory
34
+ * @since 1.100
35
+ * @version 1.100.0
36
+ * @private
37
+ * @ui5-restricted sap.ui.fl
38
+ */
39
+ var FlexObjectFactory = {};
40
+
41
+ /**
42
+ * Creates a new flex object.
43
+ *
44
+ * @param {object} oFileContent - File content
45
+ * @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject} The created flex object
46
+ */
47
+ FlexObjectFactory.createFromFileContent = function (oFileContent) {
48
+ var oNewFileContent = Object.assign({}, oFileContent);
49
+ var FlexObjectClass = getFlexObjectClass(oNewFileContent);
50
+ if (!FlexObjectClass) {
51
+ throw new Error("Unknown file type");
52
+ }
53
+ oNewFileContent.support = Object.assign(
54
+ { generator: "FlexObjectFactory.createFromFileContent" },
55
+ oNewFileContent.support || {}
56
+ );
57
+ var oMappingInfo = FlexObjectClass.getMappingInfo();
58
+ var mCreationInfo = FlexObjectClass.mapFileContent(oNewFileContent, oMappingInfo);
59
+ var mProperties = Object.entries(mCreationInfo).reduce(function (mPropertyMap, aProperty) {
60
+ ObjectPath.set(aProperty[0].split('.'), aProperty[1], mPropertyMap);
61
+ return mPropertyMap;
62
+ }, {});
63
+ var oFlexObject = new FlexObjectClass(mProperties);
64
+ return oFlexObject;
65
+ };
66
+
67
+ return FlexObjectFactory;
68
+ });
@@ -44,10 +44,12 @@ sap.ui.define([
44
44
  * The persistence happens inside an object mapped to the component reference, with the following properties:
45
45
  *
46
46
  * {
47
- * appDescriptorMap: {},
48
- * changesMap: {},
49
- * variantsMap: {},
50
- * compVariantsMap: {},
47
+ * preparedMaps: {
48
+ * appDescriptorMap: {},
49
+ * changesMap: {},
50
+ * variantsMap: {},
51
+ * compVariantsMap: {},
52
+ * },
51
53
  * storageResponse: {
52
54
  * changes: {
53
55
  * changes: [...],
@@ -65,14 +67,16 @@ sap.ui.define([
65
67
  * },
66
68
  * loadModules: <boolean>
67
69
  * },
70
+ * unfilteredStorageResnonse: {...}, // same as above but without layer filtering
68
71
  * partialFlexState: <boolean>,
69
- * componentId: "<componentId>"
72
+ * componentId: "<componentId>",
73
+ * componentData: {...}
70
74
  * }
71
75
  *
72
76
  * @namespace sap.ui.fl.apply._internal.flexState.FlexState
73
77
  * @experimental
74
78
  * @since 1.73
75
- * @version 1.99.0
79
+ * @version 1.100.0
76
80
  * @private
77
81
  * @ui5-restricted sap.ui.fl.apply._internal
78
82
  */
@@ -103,6 +107,7 @@ sap.ui.define([
103
107
  }
104
108
  };
105
109
  // some runtime data is only fetched once (e.g. during control init) and has to survive an invalidation of the FlexState
110
+ // TODO: move to maps as soon as they don't get cleared with cache invalidation
106
111
  var _mExternalData = {
107
112
  compVariants: {},
108
113
  variants: {}
@@ -213,7 +218,7 @@ sap.ui.define([
213
218
 
214
219
  function registerMaxLayerHandler(sReference) {
215
220
  var oShellNavigationService = getUShellService("ShellNavigation");
216
- if (oShellNavigationService) {
221
+ if (oShellNavigationService && !_mNavigationHandlers[sReference]) {
217
222
  _mNavigationHandlers[sReference] = handleMaxLayerChange.bind(null, sReference);
218
223
  oShellNavigationService.registerNavigationFilter(_mNavigationHandlers[sReference]);
219
224
  }
@@ -247,10 +252,6 @@ sap.ui.define([
247
252
  return undefined;
248
253
  }
249
254
 
250
- function clearPreparedMaps(sReference) {
251
- _mInstances[sReference].preparedMaps = {};
252
- }
253
-
254
255
  function checkPartialFlexState(mInitProperties) {
255
256
  var oFlexInstance = _mInstances[mInitProperties.reference];
256
257
  if (oFlexInstance.partialFlexState === true && mInitProperties.partialFlexState !== true) {
@@ -295,8 +296,8 @@ sap.ui.define([
295
296
  return undefined;
296
297
  }
297
298
 
298
- // TODO: get rid of the following module dependencies as far as the change state
299
- // is migrated from changePersistenceFactory to the FlexState
299
+ // TODO: get rid of the following module dependencies as soon as the change state
300
+ // is migrated from changePersistenceFactory to the FlexState
300
301
  function lazyLoadModules() {
301
302
  return Promise.all([
302
303
  Utils.requireAsync("sap/ui/fl/ChangePersistenceFactory")
@@ -322,7 +323,7 @@ sap.ui.define([
322
323
  * @param {object} [mPropertyBag.asyncHints] - Async hints passed from the app index to the component processing
323
324
  * @param {string} [mPropertyBag.version] - Number of the version in which the state should be initialized
324
325
  * @param {boolean} [mPropertyBag.partialFlexState=false] - if true state is initialized partially and does not include flex bundles
325
- * @returns {promise<undefined>} Resolves a promise as soon as FlexState is initialized
326
+ * @returns {Promise<undefined>} Resolves a promise as soon as FlexState is initialized
326
327
  */
327
328
  FlexState.initialize = function(mPropertyBag) {
328
329
  return Promise.all([
@@ -364,7 +365,7 @@ sap.ui.define([
364
365
  * @param {object} [mPropertyBag.manifest] - Manifest that belongs to actual component
365
366
  * @param {string} [mPropertyBag.componentData] - Component data of the current component
366
367
  * @param {string} [mPropertyBag.version] - Number of the version in which the state should be initialized
367
- * @returns {promise<undefined>} Resolves a promise as soon as FlexState is initialized again
368
+ * @returns {Promise<undefined>} Resolves a promise as soon as FlexState is initialized again
368
369
  */
369
370
  FlexState.clearAndInitialize = function(mPropertyBag) {
370
371
  enhancePropertyBag(mPropertyBag);
@@ -380,8 +381,8 @@ sap.ui.define([
380
381
  deRegisterMaxLayerHandler(sReference);
381
382
  delete _mInstances[sReference];
382
383
  delete _mInitPromises[sReference];
383
- // TODO: get rid of the following deletes as far as the change state
384
- // is migrated from changePersistenceFactory to the FlexState
384
+ // TODO: get rid of the following deletes as soon as the change state
385
+ // is migrated from changePersistenceFactory to the FlexState
385
386
  if (
386
387
  _oChangePersistenceFactory
387
388
  && (_oChangePersistenceFactory._instanceCache || {}).hasOwnProperty(sReference)
@@ -430,14 +431,10 @@ sap.ui.define([
430
431
  * The next initialize call will add it again.
431
432
  *
432
433
  * @param {string} sReference - Flex reference of the app
433
- * @param {string} sComponentId - Component instance ID
434
434
  */
435
- FlexState.clearFilteredResponse = function(sReference, sComponentId) {
436
- if (
437
- _mInstances[sReference]
438
- && (!sComponentId || sComponentId === _mInstances[sReference].componentId)
439
- ) {
440
- clearPreparedMaps(sReference);
435
+ FlexState.clearFilteredResponse = function(sReference) {
436
+ if (_mInstances[sReference]) {
437
+ _mInstances[sReference].preparedMaps = {};
441
438
  delete _mInstances[sReference].storageResponse;
442
439
  }
443
440
  };
@@ -5,12 +5,10 @@
5
5
  */
6
6
 
7
7
  sap.ui.define([
8
- "sap/base/util/deepClone",
9
8
  "sap/ui/fl/apply/_internal/flexState/ManifestUtils",
10
9
  "sap/ui/fl/initial/_internal/Storage",
11
10
  "sap/ui/fl/Utils"
12
11
  ], function(
13
- deepClone,
14
12
  ManifestUtils,
15
13
  ApplyStorage,
16
14
  Utils
@@ -75,7 +73,7 @@ sap.ui.define([
75
73
  * @namespace sap.ui.fl.apply._internal.flexState.Loader
76
74
  * @experimental
77
75
  * @since 1.74
78
- * @version 1.99.0
76
+ * @version 1.100.0
79
77
  * @private
80
78
  * @ui5-restricted sap.ui.fl.apply._internal.flexState
81
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.99.0
36
+ * @version 1.100.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.99.0
22
+ * @version 1.100.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.99.0
26
+ * @version 1.100.0
27
27
  * @private
28
28
  * @ui5-restricted sap.ui.fl
29
29
  */