@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
|
@@ -7,22 +7,101 @@
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/base/util/restricted/_pick",
|
|
9
9
|
"sap/ui/fl/apply/_internal/flexObjects/States",
|
|
10
|
-
"sap/ui/fl/
|
|
10
|
+
"sap/ui/fl/apply/_internal/flexObjects/Variant",
|
|
11
|
+
"sap/ui/fl/LayerUtils",
|
|
11
12
|
"sap/ui/fl/Layer",
|
|
12
13
|
"sap/ui/fl/registry/Settings",
|
|
13
|
-
"sap/ui/fl/LayerUtils",
|
|
14
14
|
"sap/ui/fl/Utils"
|
|
15
15
|
], function (
|
|
16
16
|
_pick,
|
|
17
17
|
States,
|
|
18
|
-
|
|
18
|
+
Variant,
|
|
19
|
+
LayerUtils,
|
|
19
20
|
Layer,
|
|
20
21
|
Settings,
|
|
21
|
-
LayerUtils,
|
|
22
22
|
Utils
|
|
23
23
|
) {
|
|
24
24
|
"use strict";
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Flexibility CompVariant class. Stores variant content and related information.
|
|
28
|
+
*
|
|
29
|
+
* @param {object} mPropertyBag - Initial object properties
|
|
30
|
+
*
|
|
31
|
+
* @class CompVariant instance
|
|
32
|
+
* @extends sap.ui.fl.apply._internal.flexObjects.Variant
|
|
33
|
+
* @alias sap.ui.fl.apply._internal.flexObjects.CompVariant
|
|
34
|
+
* @since 1.103
|
|
35
|
+
* @version 1.104.0
|
|
36
|
+
* @private
|
|
37
|
+
* @ui5-restricted sap.ui.fl sap.ui.comp
|
|
38
|
+
*/
|
|
39
|
+
var CompVariant = Variant.extend("sap.ui.fl.apply._internal.flexObjects.CompVariant", /** @lends sap.ui.fl.apply._internal.flexObjects.CompVariant.prototype */ {
|
|
40
|
+
metadata: {
|
|
41
|
+
properties: {
|
|
42
|
+
/**
|
|
43
|
+
* Indicates whether the variant is persisted
|
|
44
|
+
*/
|
|
45
|
+
persisted: {
|
|
46
|
+
type: "boolean",
|
|
47
|
+
defaultValue: true
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* Key used by SmartVariantManagement to access personalization data
|
|
51
|
+
*/
|
|
52
|
+
persistencyKey: {
|
|
53
|
+
type: "string"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
aggregations: {
|
|
57
|
+
/**
|
|
58
|
+
* Stores required data to revert variant updates.
|
|
59
|
+
* TODO: When the FL Variant is also a FlexObject, try to consolidate RevertData from both
|
|
60
|
+
*/
|
|
61
|
+
revertData: {
|
|
62
|
+
type: "sap.ui.fl.apply._internal.flexObjects.CompVariantRevertData",
|
|
63
|
+
multiple: true,
|
|
64
|
+
singularName: "revertData",
|
|
65
|
+
defaultValue: []
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
constructor: function(mPropertyBag) {
|
|
70
|
+
Variant.apply(this, arguments);
|
|
71
|
+
|
|
72
|
+
// fileType "variant" is only for compVariant
|
|
73
|
+
this.setFileType("variant");
|
|
74
|
+
|
|
75
|
+
if (mPropertyBag.favorite !== undefined) {
|
|
76
|
+
this.setFavorite(!!mPropertyBag.favorite);
|
|
77
|
+
} else if (mPropertyBag.layer === Layer.VENDOR || mPropertyBag.layer === Layer.CUSTOMER_BASE) {
|
|
78
|
+
this.setFavorite(true);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
CompVariant.STANDARD_VARIANT_ID = "*standard*";
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Returns the mapping between flex object properties and file content properties in the back-end response.
|
|
87
|
+
* @returns {object} Mapping information
|
|
88
|
+
* @static
|
|
89
|
+
*/
|
|
90
|
+
CompVariant.getMappingInfo = function () {
|
|
91
|
+
return Object.assign(Variant.getMappingInfo(), {
|
|
92
|
+
persistencyKey: "selector.persistencyKey"
|
|
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
|
+
CompVariant.prototype.getMappingInfo = function () {
|
|
102
|
+
return CompVariant.getMappingInfo();
|
|
103
|
+
};
|
|
104
|
+
|
|
26
105
|
function isUserAuthor(oAuthor) {
|
|
27
106
|
var oSettings = Settings.getInstanceOrUndef();
|
|
28
107
|
var vUserId = oSettings && oSettings.getUserId();
|
|
@@ -35,8 +114,6 @@ sap.ui.define([
|
|
|
35
114
|
* @param {sap.ui.fl.Layer} [sActiveLayer] - Layer in which the operation may take place
|
|
36
115
|
* @param {string} sUserId - ID of the variants creator
|
|
37
116
|
* @returns {boolean} <code>true</code> if the variant is read only
|
|
38
|
-
*
|
|
39
|
-
* @private
|
|
40
117
|
*/
|
|
41
118
|
function checkLayerAndUserAuthorization(sLayer, sActiveLayer, sUserId) {
|
|
42
119
|
if (sActiveLayer) {
|
|
@@ -61,12 +138,8 @@ sap.ui.define([
|
|
|
61
138
|
* A variant can only be modified if the current language equals the original language.
|
|
62
139
|
* Returns <code>false</code> if the current language does not equal the original language of the variant file.
|
|
63
140
|
* Returns <code>false</code> if the original language is initial.
|
|
64
|
-
*
|
|
65
141
|
* @param {string} sOriginalLanguage - Language code of the language used on the variant creation
|
|
66
|
-
*
|
|
67
142
|
* @returns {boolean} <code>true</code> if the current logon language equals the original language of the variant file
|
|
68
|
-
*
|
|
69
|
-
* @private
|
|
70
143
|
*/
|
|
71
144
|
function isRenameEnableDueToOriginalLanguage(sOriginalLanguage) {
|
|
72
145
|
return !sOriginalLanguage || Utils.getCurrentLanguage() === sOriginalLanguage;
|
|
@@ -87,144 +160,78 @@ sap.ui.define([
|
|
|
87
160
|
}
|
|
88
161
|
|
|
89
162
|
/**
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* @
|
|
93
|
-
*
|
|
94
|
-
* @class sap.ui.fl.apply._internal.flexObjects.CompVariant
|
|
95
|
-
* @extends sap.ui.fl.Change
|
|
96
|
-
* @private
|
|
97
|
-
* @ui5-restricted
|
|
98
|
-
* @since 1.86.0
|
|
163
|
+
* Returns the package name of the variant.
|
|
164
|
+
* Used by the SmartVariantManagement control.
|
|
165
|
+
* @returns {string} Package name
|
|
99
166
|
*/
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
favorite: {
|
|
104
|
-
type: "boolean",
|
|
105
|
-
defaultValue: false
|
|
106
|
-
},
|
|
107
|
-
executeOnSelection: {
|
|
108
|
-
type: "boolean",
|
|
109
|
-
defaultValue: false
|
|
110
|
-
},
|
|
111
|
-
standardVariant: {
|
|
112
|
-
type: "boolean",
|
|
113
|
-
defaultValue: false
|
|
114
|
-
},
|
|
115
|
-
contexts: {
|
|
116
|
-
type: "object",
|
|
117
|
-
defaultValue: {}
|
|
118
|
-
},
|
|
119
|
-
persisted: {
|
|
120
|
-
type: "boolean",
|
|
121
|
-
defaultValue: true
|
|
122
|
-
},
|
|
123
|
-
name: {
|
|
124
|
-
type: "string",
|
|
125
|
-
defaultValue: ""
|
|
126
|
-
},
|
|
127
|
-
content: {
|
|
128
|
-
type: "object",
|
|
129
|
-
defaultValue: {}
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
aggregations: {
|
|
133
|
-
// TODO: change to revertData for alignment, but this will conflict with the derived Change.getRevertData as of today
|
|
134
|
-
revertInfo: {
|
|
135
|
-
type: "sap.ui.fl.apply._internal.flexObjects.CompVariantRevertData",
|
|
136
|
-
multiple: true,
|
|
137
|
-
singularName: "revertInfo",
|
|
138
|
-
defaultValue: []
|
|
139
|
-
},
|
|
140
|
-
changes: {
|
|
141
|
-
type: "sap.ui.fl.Change",
|
|
142
|
-
multiple: true,
|
|
143
|
-
defaultValue: []
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
|
|
148
|
-
constructor: function(oFile) {
|
|
149
|
-
Change.apply(this, arguments);
|
|
150
|
-
|
|
151
|
-
var bExecuteOnSelect = oFile.content && (oFile.content.executeOnSelect || oFile.content.executeOnSelection);
|
|
152
|
-
|
|
153
|
-
// new property always overrules older content
|
|
154
|
-
if (oFile.executeOnSelection !== undefined) {
|
|
155
|
-
bExecuteOnSelect = oFile.executeOnSelection;
|
|
156
|
-
}
|
|
157
|
-
this.setExecuteOnSelection(bExecuteOnSelect);
|
|
158
|
-
|
|
159
|
-
this.setContexts(oFile.contexts || {});
|
|
160
|
-
this.setContent(oFile.content || {});
|
|
161
|
-
|
|
162
|
-
this.setName(this.getText("variantName"));
|
|
163
|
-
|
|
164
|
-
if (oFile.layer === Layer.VENDOR || oFile.layer === Layer.CUSTOMER_BASE) {
|
|
165
|
-
this.setFavorite(true);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
if (oFile.favorite !== undefined) {
|
|
169
|
-
this.setFavorite(!!oFile.favorite);
|
|
170
|
-
}
|
|
167
|
+
CompVariant.prototype.getPackage = function() {
|
|
168
|
+
return this.getFlexObjectMetadata().packageName;
|
|
169
|
+
};
|
|
171
170
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
171
|
+
/**
|
|
172
|
+
* Sets the transport request.
|
|
173
|
+
* Used by the SmartVariantManagement control.
|
|
174
|
+
* @param {string} sRequest Transport request
|
|
175
|
+
*/
|
|
176
|
+
CompVariant.prototype.setRequest = function (sRequest) {
|
|
177
|
+
this._sRequest = sRequest;
|
|
178
|
+
};
|
|
177
179
|
|
|
178
|
-
|
|
180
|
+
/**
|
|
181
|
+
* Gets the transport request.
|
|
182
|
+
* Used by the SmartVariantManagement control.
|
|
183
|
+
* @returns {string} Transport request
|
|
184
|
+
*/
|
|
185
|
+
CompVariant.prototype.getRequest = function () {
|
|
186
|
+
return this._sRequest;
|
|
187
|
+
};
|
|
179
188
|
|
|
180
189
|
/**
|
|
181
|
-
*
|
|
182
|
-
*
|
|
190
|
+
* Checks if the object is a variant from smart variant management.
|
|
191
|
+
* Used by the SmartVariantManagement control.
|
|
192
|
+
* @returns {boolean} <code>true</code> if object is a variant
|
|
183
193
|
*/
|
|
184
|
-
CompVariant.prototype.
|
|
185
|
-
return
|
|
194
|
+
CompVariant.prototype.isVariant = function () {
|
|
195
|
+
return true;
|
|
186
196
|
};
|
|
187
197
|
|
|
188
198
|
/**
|
|
189
199
|
* Checks whenever the variant can be renamed updating the entity or crating an <code>updateChange</code>.
|
|
190
|
-
*
|
|
191
200
|
* @param {sap.ui.fl.Layer} [sLayer] - Layer in which the edition may take place
|
|
192
|
-
*
|
|
193
201
|
* @returns {boolean} <code>true</code> if the variant can be updated
|
|
194
|
-
*
|
|
195
|
-
* @public
|
|
196
202
|
*/
|
|
197
203
|
CompVariant.prototype.isRenameEnabled = function (sLayer) {
|
|
198
|
-
return !this.getStandardVariant()
|
|
204
|
+
return !this.getStandardVariant()
|
|
205
|
+
&& this.isEditEnabled(sLayer)
|
|
206
|
+
&& isRenameEnableDueToOriginalLanguage(this.getSupportInformation().originalLanguage);
|
|
199
207
|
};
|
|
200
208
|
|
|
201
209
|
/**
|
|
202
210
|
* Checks whenever the variant can be edited (a save operation) updating the entity or crating an <code>updateChange</code>.
|
|
203
|
-
*
|
|
204
211
|
* @param {sap.ui.fl.Layer} [sActiveLayer] - Layer in which the edition may take place
|
|
205
|
-
*
|
|
206
212
|
* @returns {boolean} <code>true</code> if the variant can be updated
|
|
207
|
-
*
|
|
208
|
-
* @public
|
|
209
213
|
*/
|
|
210
214
|
CompVariant.prototype.isEditEnabled = function (sActiveLayer) {
|
|
211
215
|
var bDeveloperLayer = sActiveLayer && LayerUtils.isDeveloperLayer(sActiveLayer);
|
|
212
|
-
var bOriginSystem = isOriginSystem(
|
|
216
|
+
var bOriginSystem = isOriginSystem(
|
|
217
|
+
this.getSupportInformation().sourceSystem,
|
|
218
|
+
this.getSupportInformation().sourceClient
|
|
219
|
+
);
|
|
213
220
|
var bUserAuthorized = checkLayerAndUserAuthorization(this.getLayer(), sActiveLayer, this.getOwnerId());
|
|
214
221
|
return bDeveloperLayer || bOriginSystem && bUserAuthorized;
|
|
215
222
|
};
|
|
216
223
|
|
|
217
224
|
/**
|
|
218
225
|
* Checks whenever the variant can be deleted.
|
|
219
|
-
*
|
|
220
226
|
* @param {sap.ui.fl.Layer} [sLayer] - Layer in which the deletion may take place
|
|
221
|
-
*
|
|
222
227
|
* @returns {boolean} <code>true</code> if the variant file can be deleted
|
|
223
|
-
*
|
|
224
|
-
* @public
|
|
225
228
|
*/
|
|
226
229
|
CompVariant.prototype.isDeleteEnabled = function (sLayer) {
|
|
227
|
-
|
|
230
|
+
var bOriginSystem = isOriginSystem(
|
|
231
|
+
this.getSupportInformation().sourceSystem,
|
|
232
|
+
this.getSupportInformation().sourceClient
|
|
233
|
+
);
|
|
234
|
+
return bOriginSystem
|
|
228
235
|
&& checkLayerAndUserAuthorization(this.getLayer(), sLayer, this.getOwnerId())
|
|
229
236
|
&& !this.getStandardVariant();
|
|
230
237
|
};
|
|
@@ -232,153 +239,73 @@ sap.ui.define([
|
|
|
232
239
|
/**
|
|
233
240
|
* Sets the favorite flag of the runtime instance as well as the persistent representation.
|
|
234
241
|
* This results in setting the definition as well as flagging the entity as 'dirty'.
|
|
235
|
-
*
|
|
236
242
|
* @param {boolean} bFavorite - Boolean to which the favorite flag should be set
|
|
237
|
-
*
|
|
238
243
|
* @private
|
|
239
244
|
* @ui5-restricted sap.ui.fl
|
|
240
245
|
*/
|
|
241
246
|
CompVariant.prototype.storeFavorite = function (bFavorite) {
|
|
242
|
-
if (bFavorite !==
|
|
243
|
-
this.
|
|
244
|
-
|
|
245
|
-
delete this._oDefinition.favorite;
|
|
247
|
+
if (bFavorite !== this.getFavorite()) {
|
|
248
|
+
this.setState(States.DIRTY);
|
|
249
|
+
this.setFavorite(bFavorite);
|
|
246
250
|
}
|
|
247
|
-
this.setState(States.DIRTY);
|
|
248
|
-
this.setFavorite(bFavorite);
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* Sets the content of the runtime instance.
|
|
253
|
-
*
|
|
254
|
-
* @param {object} [oContent={}] - Content object to be set
|
|
255
|
-
*
|
|
256
|
-
* @private
|
|
257
|
-
* @ui5-restricted sap.ui.fl
|
|
258
|
-
*/
|
|
259
|
-
CompVariant.prototype.setContent = function (oContent) {
|
|
260
|
-
// TODO: remove after the extended Change.js does not overwrite the default setContent
|
|
261
|
-
this.setProperty("content", oContent || {});
|
|
262
251
|
};
|
|
263
252
|
|
|
264
253
|
/**
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
* @returns {object} Content object of the variant
|
|
268
|
-
*
|
|
269
|
-
* @private
|
|
270
|
-
* @ui5-restricted sap.ui.fl
|
|
254
|
+
* Retrieves the owner ID (user)
|
|
255
|
+
* @returns {string} User ID
|
|
271
256
|
*/
|
|
272
|
-
CompVariant.prototype.getContent = function () {
|
|
273
|
-
// TODO: remove after the extended Change.js does not overwrite the default getContent
|
|
274
|
-
return this.getProperty("content");
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
|
|
278
257
|
CompVariant.prototype.getOwnerId = function() {
|
|
279
|
-
return this.
|
|
258
|
+
return this.getSupportInformation().user || "";
|
|
280
259
|
};
|
|
281
260
|
|
|
282
261
|
/**
|
|
283
262
|
* Sets the content of the runtime instance as well as the persistent representation.
|
|
284
263
|
* This results in setting the definition as well as flagging the entity as 'dirty'.
|
|
285
|
-
*
|
|
286
264
|
* @param {object} [oContent={}] - Content object to be stored
|
|
287
|
-
*
|
|
288
265
|
* @private
|
|
289
266
|
* @ui5-restricted sap.ui.fl
|
|
290
267
|
*/
|
|
291
268
|
CompVariant.prototype.storeContent = function (oContent) {
|
|
292
|
-
|
|
293
|
-
this.setState(States.DIRTY);
|
|
269
|
+
// setContent() already sets the dirty state by default
|
|
294
270
|
this.setContent(oContent);
|
|
295
271
|
};
|
|
296
272
|
|
|
297
273
|
/**
|
|
298
274
|
* Sets the e'Apply Automatically' flag of the runtime instance as well as the persistent representation.
|
|
299
275
|
* This results in setting the definition as well as flagging the entity as 'dirty'.
|
|
300
|
-
*
|
|
301
276
|
* @param {boolean} bExecuteOnSelection - Boolean to which the 'Apply Automatically' flag should be set
|
|
302
|
-
*
|
|
303
277
|
* @private
|
|
304
278
|
* @ui5-restricted sap.ui.fl
|
|
305
279
|
*/
|
|
306
280
|
CompVariant.prototype.storeExecuteOnSelection = function (bExecuteOnSelection) {
|
|
307
|
-
if (bExecuteOnSelection !==
|
|
308
|
-
this.
|
|
309
|
-
|
|
310
|
-
delete this._oDefinition.executeOnSelection;
|
|
281
|
+
if (bExecuteOnSelection !== this.getExecuteOnSelection()) {
|
|
282
|
+
this.setState(States.DIRTY);
|
|
283
|
+
this.setExecuteOnSelection(bExecuteOnSelection);
|
|
311
284
|
}
|
|
312
|
-
delete this._oDefinition.content.executeOnSelection;
|
|
313
|
-
this.setState(States.DIRTY);
|
|
314
|
-
this.setExecuteOnSelection(bExecuteOnSelection);
|
|
315
285
|
};
|
|
316
286
|
|
|
317
287
|
/**
|
|
318
288
|
* Sets the name of the runtime instance as well as the persistent representation.
|
|
319
289
|
* This results in a entity within the texts section flagged as a field for translation.
|
|
320
|
-
*
|
|
321
290
|
* @param {string} sName - Name to be set
|
|
322
|
-
*
|
|
323
291
|
* @private
|
|
324
292
|
* @ui5-restricted sap.ui.fl
|
|
325
293
|
*/
|
|
326
294
|
CompVariant.prototype.storeName = function (sName) {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
this.setState(States.DIRTY);
|
|
295
|
+
// setName() already sets the dirty state by default
|
|
330
296
|
this.setName(sName);
|
|
331
297
|
};
|
|
332
298
|
|
|
333
299
|
/**
|
|
334
300
|
* Sets the object of the contexts attribute.
|
|
335
|
-
*
|
|
336
301
|
* @param {object} mContexts - Contexts of the variant file
|
|
337
|
-
*
|
|
338
302
|
* @private
|
|
339
303
|
* @ui5-restricted sap.ui.fl
|
|
340
304
|
*/
|
|
341
305
|
CompVariant.prototype.storeContexts = function (mContexts) {
|
|
342
|
-
if (mContexts !== undefined) {
|
|
343
|
-
this._oDefinition.contexts = mContexts;
|
|
344
|
-
} else {
|
|
345
|
-
delete this._oDefinition.contexts;
|
|
346
|
-
}
|
|
347
306
|
this.setContexts(mContexts);
|
|
348
307
|
this.setState(States.DIRTY);
|
|
349
308
|
};
|
|
350
309
|
|
|
351
|
-
CompVariant.createInitialFileContent = function (oPropertyBag) {
|
|
352
|
-
var oNewFile = Change.createInitialFileContent(oPropertyBag);
|
|
353
|
-
if (oPropertyBag.contexts) {
|
|
354
|
-
oNewFile.contexts = oPropertyBag.contexts;
|
|
355
|
-
}
|
|
356
|
-
if (oPropertyBag.favorite !== undefined) {
|
|
357
|
-
oNewFile.favorite = oPropertyBag.favorite;
|
|
358
|
-
}
|
|
359
|
-
if (oPropertyBag.executeOnSelection !== undefined) {
|
|
360
|
-
oNewFile.executeOnSelection = oPropertyBag.executeOnSelection;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
// TODO: clean up the createInitialFileContent within the Change class plus create a base class FlexObject
|
|
364
|
-
return _pick(oNewFile, [
|
|
365
|
-
"changeType",
|
|
366
|
-
"namespace",
|
|
367
|
-
"service",
|
|
368
|
-
"content",
|
|
369
|
-
"reference",
|
|
370
|
-
"fileName",
|
|
371
|
-
"fileType",
|
|
372
|
-
"packageName",
|
|
373
|
-
"layer",
|
|
374
|
-
"favorite",
|
|
375
|
-
"executeOnSelection",
|
|
376
|
-
"selector",
|
|
377
|
-
"texts",
|
|
378
|
-
"support",
|
|
379
|
-
"contexts"
|
|
380
|
-
]);
|
|
381
|
-
};
|
|
382
|
-
|
|
383
310
|
return CompVariant;
|
|
384
311
|
});
|
|
@@ -35,6 +35,7 @@ sap.ui.define([
|
|
|
35
35
|
* @static
|
|
36
36
|
* @constant
|
|
37
37
|
* @typedef {object} sap.ui.fl.apply._internal.flexObjects.FlexObject.FlexObjectMetadata
|
|
38
|
+
* @property {string} changeType - Type of the flexObject
|
|
38
39
|
* @property {string} reference - Application component name
|
|
39
40
|
* @property {string} namespace - Namespace of the flex object file
|
|
40
41
|
* @property {string} creation - Timestamp of creation date
|
|
@@ -70,7 +71,7 @@ sap.ui.define([
|
|
|
70
71
|
* @extends sap.ui.base.ManagedObject
|
|
71
72
|
* @alias sap.ui.fl.apply._internal.flexObjects.FlexObject
|
|
72
73
|
* @since 1.100
|
|
73
|
-
* @version 1.
|
|
74
|
+
* @version 1.104.0
|
|
74
75
|
* @private
|
|
75
76
|
* @ui5-restricted sap.ui.fl
|
|
76
77
|
*/
|
|
@@ -121,7 +122,8 @@ sap.ui.define([
|
|
|
121
122
|
* Content of the flex object that is used to apply the flex object.
|
|
122
123
|
*/
|
|
123
124
|
content: {
|
|
124
|
-
type: "any"
|
|
125
|
+
type: "any",
|
|
126
|
+
defaultValue: {}
|
|
125
127
|
},
|
|
126
128
|
/**
|
|
127
129
|
* Map of texts that should be translated.
|
|
@@ -165,6 +167,7 @@ sap.ui.define([
|
|
|
165
167
|
*/
|
|
166
168
|
FlexObject.getMappingInfo = function () {
|
|
167
169
|
return Object.assign({}, {
|
|
170
|
+
"flexObjectMetadata.changeType": "changeType",
|
|
168
171
|
"flexObjectMetadata.reference": "reference",
|
|
169
172
|
"flexObjectMetadata.namespace": "namespace",
|
|
170
173
|
"flexObjectMetadata.creation": "creation",
|
|
@@ -184,8 +187,8 @@ sap.ui.define([
|
|
|
184
187
|
"supportInformation.originalLanguage": "originalLanguage",
|
|
185
188
|
layer: "layer",
|
|
186
189
|
fileType: "fileType",
|
|
187
|
-
content: "content",
|
|
188
190
|
id: "fileName",
|
|
191
|
+
content: "content",
|
|
189
192
|
texts: "texts"
|
|
190
193
|
});
|
|
191
194
|
};
|
|
@@ -202,11 +205,14 @@ sap.ui.define([
|
|
|
202
205
|
/**
|
|
203
206
|
* Sets the content of the flex object and marks the state as DIRTY.
|
|
204
207
|
* @param {any} oContent - Flex object content
|
|
208
|
+
* @param {boolean} [bSkipStateChange] - If set to true, doesn't set the state to dirty
|
|
205
209
|
* @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject} <code>this</code> for chaining
|
|
206
210
|
*/
|
|
207
|
-
FlexObject.prototype.setContent = function (oContent) {
|
|
211
|
+
FlexObject.prototype.setContent = function (oContent, bSkipStateChange) {
|
|
208
212
|
this.setProperty("content", oContent);
|
|
209
|
-
|
|
213
|
+
if (!bSkipStateChange) {
|
|
214
|
+
this.setState(States.DIRTY);
|
|
215
|
+
}
|
|
210
216
|
return this;
|
|
211
217
|
};
|
|
212
218
|
|
|
@@ -294,6 +300,22 @@ sap.ui.define([
|
|
|
294
300
|
return (sSourceSystem !== sSystem || sSourceClient !== sClient);
|
|
295
301
|
};
|
|
296
302
|
|
|
303
|
+
/**
|
|
304
|
+
* Getter for the namespace from the FlexObjectMetadata.
|
|
305
|
+
* @returns {string} Namespace
|
|
306
|
+
*/
|
|
307
|
+
FlexObject.prototype.getNamespace = function() {
|
|
308
|
+
return this.getFlexObjectMetadata().namespace;
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Getter for the change type from the FlexObjectMetadata.
|
|
313
|
+
* @returns {string} Change type
|
|
314
|
+
*/
|
|
315
|
+
FlexObject.prototype.getChangeType = function() {
|
|
316
|
+
return this.getFlexObjectMetadata().changeType;
|
|
317
|
+
};
|
|
318
|
+
|
|
297
319
|
/**
|
|
298
320
|
* Returns <code>true</code> if the flex object is user dependent.
|
|
299
321
|
* @returns {boolean} <code>true</code> if the flex object is only relevant for the current user
|
|
@@ -313,18 +335,19 @@ sap.ui.define([
|
|
|
313
335
|
};
|
|
314
336
|
|
|
315
337
|
/**
|
|
316
|
-
* Sets the new text for the given text ID.
|
|
338
|
+
* Sets the new text for the given text ID or creates new text with the given ID.
|
|
317
339
|
* @param {string} sTextId - Text ID which was used as part of the <code>texts</code> property
|
|
318
340
|
* @param {string} sNewText - New text for the given text ID
|
|
341
|
+
* @param {boolean} [bSkipStateChange] - If set to <code>true</code>, doesn't set the state to dirty
|
|
319
342
|
* @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject} <code>this</code> context for chaining
|
|
320
343
|
*/
|
|
321
|
-
FlexObject.prototype.setText = function (sTextId, sNewText) {
|
|
344
|
+
FlexObject.prototype.setText = function (sTextId, sNewText, bSkipStateChange) {
|
|
322
345
|
var oTexts = Object.assign({}, this.getTexts());
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
346
|
+
oTexts[sTextId] = Object.assign({}, oTexts[sTextId], {
|
|
347
|
+
value: sNewText
|
|
348
|
+
});
|
|
349
|
+
this.setTexts(oTexts);
|
|
350
|
+
if (!bSkipStateChange) {
|
|
328
351
|
this.setState(States.DIRTY);
|
|
329
352
|
}
|
|
330
353
|
return this;
|
|
@@ -429,8 +452,9 @@ sap.ui.define([
|
|
|
429
452
|
* @param {object} oFileContent - File content of the flex object
|
|
430
453
|
*/
|
|
431
454
|
FlexObject.prototype.update = function (oFileContent) {
|
|
432
|
-
|
|
433
|
-
var
|
|
455
|
+
// filename is mapped to id and this is not updatable
|
|
456
|
+
var oNewFileContent = _omit(oFileContent, ["fileName"]);
|
|
457
|
+
var mProperties = FlexObject.mapFileContent(oNewFileContent, this.getMappingInfo());
|
|
434
458
|
Object.entries(mProperties).forEach(function (aProperty) {
|
|
435
459
|
updateProperty.call(this, aProperty[0], aProperty[1]);
|
|
436
460
|
}.bind(this));
|