@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
|
@@ -8,14 +8,15 @@ sap.ui.define([
|
|
|
8
8
|
"sap/base/util/restricted/_omit",
|
|
9
9
|
"sap/base/util/restricted/_pick",
|
|
10
10
|
"sap/base/util/UriParameters",
|
|
11
|
-
"sap/ui/fl/Layer",
|
|
12
11
|
"sap/ui/fl/Change",
|
|
13
|
-
"sap/ui/fl/
|
|
12
|
+
"sap/ui/fl/Layer",
|
|
13
|
+
"sap/ui/fl/Utils",
|
|
14
14
|
"sap/ui/fl/apply/_internal/flexObjects/CompVariant",
|
|
15
|
-
"sap/ui/fl/apply/_internal/flexObjects/RevertData",
|
|
16
15
|
"sap/ui/fl/apply/_internal/flexObjects/CompVariantRevertData",
|
|
16
|
+
"sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory",
|
|
17
|
+
"sap/ui/fl/apply/_internal/flexObjects/RevertData",
|
|
17
18
|
"sap/ui/fl/apply/_internal/flexObjects/States",
|
|
18
|
-
"sap/ui/fl/
|
|
19
|
+
"sap/ui/fl/apply/_internal/flexObjects/UpdatableChange",
|
|
19
20
|
"sap/ui/fl/apply/_internal/flexState/FlexState",
|
|
20
21
|
"sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger",
|
|
21
22
|
"sap/ui/fl/registry/Settings",
|
|
@@ -26,14 +27,15 @@ sap.ui.define([
|
|
|
26
27
|
_omit,
|
|
27
28
|
_pick,
|
|
28
29
|
UriParameters,
|
|
29
|
-
Layer,
|
|
30
30
|
Change,
|
|
31
|
-
|
|
31
|
+
Layer,
|
|
32
|
+
Utils,
|
|
32
33
|
CompVariant,
|
|
33
|
-
RevertData,
|
|
34
34
|
CompVariantRevertData,
|
|
35
|
+
FlexObjectFactory,
|
|
36
|
+
RevertData,
|
|
35
37
|
States,
|
|
36
|
-
|
|
38
|
+
UpdatableChange,
|
|
37
39
|
FlexState,
|
|
38
40
|
CompVariantMerger,
|
|
39
41
|
Settings,
|
|
@@ -46,31 +48,34 @@ sap.ui.define([
|
|
|
46
48
|
function isVersionIndependentOrInDraft(oChange, mPropertyBag) {
|
|
47
49
|
var aDraftFilenames = getPropertyFromVersionsModel("/draftFilenames", mPropertyBag);
|
|
48
50
|
if (aDraftFilenames) {
|
|
49
|
-
return oChange.getState() === Change.states.NEW
|
|
51
|
+
return oChange.getState() === Change.states.NEW
|
|
52
|
+
|| aDraftFilenames.includes(oChange.getFileName ? oChange.getFileName() : oChange.getId());
|
|
50
53
|
}
|
|
51
54
|
return true;
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
function getPropertyFromVersionsModel(sPropertyName, mPropertyBag) {
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
var mPropertyBag = {
|
|
59
|
+
reference: Utils.normalizeReference(mPropertyBag.reference),
|
|
60
|
+
layer: mPropertyBag.layer
|
|
61
|
+
};
|
|
62
|
+
if (Versions.hasVersionsModel(mPropertyBag)) {
|
|
63
|
+
return Versions.getVersionsModel(mPropertyBag).getProperty(sPropertyName);
|
|
61
64
|
}
|
|
62
65
|
return undefined;
|
|
63
66
|
}
|
|
64
67
|
|
|
65
|
-
function isChangeUpdatable(
|
|
66
|
-
|
|
68
|
+
function isChangeUpdatable(oFlexObject, mPropertyBag) {
|
|
69
|
+
var oChangeType = oFlexObject.getFlexObjectMetadata ? oFlexObject.getFlexObjectMetadata().changeType : oFlexObject.getChangeType();
|
|
70
|
+
if (!["defaultVariant", "updateVariant"].includes(oChangeType)) {
|
|
67
71
|
return false;
|
|
68
72
|
}
|
|
69
|
-
|
|
70
|
-
var
|
|
73
|
+
|
|
74
|
+
var bSameLayer = oFlexObject.getLayer() === mPropertyBag.layer;
|
|
75
|
+
var sPackageName = oFlexObject.getPackage();
|
|
71
76
|
var bNotTransported = !sPackageName || sPackageName === "$TMP";
|
|
72
77
|
|
|
73
|
-
return bSameLayer && bNotTransported && isVersionIndependentOrInDraft(
|
|
78
|
+
return bSameLayer && bNotTransported && isVersionIndependentOrInDraft(oFlexObject, mPropertyBag);
|
|
74
79
|
}
|
|
75
80
|
|
|
76
81
|
function getSubSection(mMap, oFlexObject) {
|
|
@@ -78,7 +83,8 @@ sap.ui.define([
|
|
|
78
83
|
return mMap.variants;
|
|
79
84
|
}
|
|
80
85
|
|
|
81
|
-
|
|
86
|
+
var oChangeType = oFlexObject.getChangeType();
|
|
87
|
+
switch (oChangeType) {
|
|
82
88
|
case "defaultVariant":
|
|
83
89
|
return mMap.defaultVariants;
|
|
84
90
|
case "standardVariant":
|
|
@@ -97,10 +103,9 @@ sap.ui.define([
|
|
|
97
103
|
}
|
|
98
104
|
}
|
|
99
105
|
|
|
100
|
-
function updateObjectAndStorage(oFlexObject, oStoredResponse) {
|
|
101
|
-
var sParentVersion = getPropertyFromVersionsModel("/persistedVersion", {layer: oFlexObject.getLayer(), reference: oFlexObject.getDefinition().reference});
|
|
106
|
+
function updateObjectAndStorage(oFlexObject, oStoredResponse, sParentVersion) {
|
|
102
107
|
return Storage.update({
|
|
103
|
-
flexObject: oFlexObject.getDefinition(),
|
|
108
|
+
flexObject: oFlexObject.convertToFileContent ? oFlexObject.convertToFileContent() : oFlexObject.getDefinition(),
|
|
104
109
|
layer: oFlexObject.getLayer(),
|
|
105
110
|
transport: oFlexObject.getRequest(),
|
|
106
111
|
parentVersion: sParentVersion
|
|
@@ -117,61 +122,57 @@ sap.ui.define([
|
|
|
117
122
|
} else {
|
|
118
123
|
oFlexObject.setState(States.PERSISTED);
|
|
119
124
|
}
|
|
120
|
-
|
|
121
|
-
}).then(function (oStoredResponse) {
|
|
125
|
+
}).then(function () {
|
|
122
126
|
// update StorageResponse
|
|
123
127
|
var aObjectArray = getSubSection(oStoredResponse.changes.comp, oFlexObject);
|
|
124
|
-
|
|
125
|
-
|
|
128
|
+
var oFileContent = oFlexObject.convertToFileContent ? oFlexObject.convertToFileContent() : oFlexObject.getDefinition();
|
|
129
|
+
updateArrayByName(aObjectArray, oFileContent);
|
|
130
|
+
return oFileContent;
|
|
126
131
|
});
|
|
127
132
|
}
|
|
128
133
|
|
|
129
|
-
function
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
134
|
+
function removeFromArrayById(aObjectArray, sObjectId) {
|
|
135
|
+
for (var i = aObjectArray.length - 1; i >= 0; i--) {
|
|
136
|
+
//aObjectArray can come from either back end response or flex state
|
|
137
|
+
//In the first case, the fileName is a direct property of object
|
|
138
|
+
//In the second case, it can be obtained from getId() function
|
|
139
|
+
var sFileName = aObjectArray[i].fileName || (aObjectArray[i].getFileName && aObjectArray[i].getFileName());
|
|
140
|
+
if ((sFileName || aObjectArray[i].getId()) === sObjectId) {
|
|
141
|
+
aObjectArray.splice(i, 1);
|
|
142
|
+
break;
|
|
139
143
|
}
|
|
140
144
|
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function removeFromCompVariantsMap(oFlexObject, mCompVariantsMapByPersistencyKey) {
|
|
148
|
+
delete mCompVariantsMapByPersistencyKey.byId[oFlexObject.getId()];
|
|
149
|
+
if (oFlexObject.getChangeType() === "standardVariant") {
|
|
150
|
+
mCompVariantsMapByPersistencyKey.standardVariantChange = undefined;
|
|
151
|
+
} else {
|
|
152
|
+
removeFromArrayById(getSubSection(mCompVariantsMapByPersistencyKey, oFlexObject), oFlexObject.getId());
|
|
153
|
+
}
|
|
154
|
+
}
|
|
141
155
|
|
|
156
|
+
function deleteObjectAndRemoveFromStorage(oFlexObject, mCompVariantsMapByPersistencyKey, oStoredResponse, sParentVersion) {
|
|
157
|
+
var oFileContent = oFlexObject.convertToFileContent ? oFlexObject.convertToFileContent() : oFlexObject.getDefinition();
|
|
142
158
|
return Storage.remove({
|
|
143
|
-
flexObject:
|
|
159
|
+
flexObject: oFileContent,
|
|
144
160
|
layer: oFlexObject.getLayer(),
|
|
145
161
|
transport: oFlexObject.getRequest(),
|
|
146
162
|
parentVersion: sParentVersion
|
|
147
163
|
}).then(function () {
|
|
148
|
-
// update
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
mCompVariantsMapByPersistencyKey.standardVariantChange = undefined;
|
|
152
|
-
} else {
|
|
153
|
-
removeFromArrayByName(getSubSection(mCompVariantsMapByPersistencyKey, oFlexObject), oFlexObject.getDefinition());
|
|
154
|
-
}
|
|
155
|
-
return oStoredResponse;
|
|
156
|
-
}).then(function (oStoredResponse) {
|
|
164
|
+
// update CompVariantsMap
|
|
165
|
+
removeFromCompVariantsMap(oFlexObject, mCompVariantsMapByPersistencyKey);
|
|
166
|
+
}).then(function () {
|
|
157
167
|
// update StorageResponse
|
|
158
|
-
|
|
159
|
-
|
|
168
|
+
removeFromArrayById(
|
|
169
|
+
getSubSection(oStoredResponse.changes.comp, oFlexObject),
|
|
170
|
+
oFileContent.fileName
|
|
171
|
+
);
|
|
172
|
+
return oFileContent;
|
|
160
173
|
});
|
|
161
174
|
}
|
|
162
175
|
|
|
163
|
-
function needsPersistencyCall(oFlexObject) {
|
|
164
|
-
return oFlexObject &&
|
|
165
|
-
[States.NEW, States.DIRTY, States.DELETED].includes(oFlexObject.getState());
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function getAllCompVariantObjects(mCompVariantsMapByPersistencyKey) {
|
|
169
|
-
return mCompVariantsMapByPersistencyKey.variants
|
|
170
|
-
.concat(mCompVariantsMapByPersistencyKey.changes)
|
|
171
|
-
.concat(mCompVariantsMapByPersistencyKey.defaultVariants)
|
|
172
|
-
.concat(mCompVariantsMapByPersistencyKey.standardVariantChange);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
176
|
function getTexts(mPropertyBag) {
|
|
176
177
|
var mInternalTexts = {};
|
|
177
178
|
if (typeof (mPropertyBag.texts) === "object") {
|
|
@@ -185,6 +186,18 @@ sap.ui.define([
|
|
|
185
186
|
return mInternalTexts;
|
|
186
187
|
}
|
|
187
188
|
|
|
189
|
+
function needsPersistencyCall(oFlexObject) {
|
|
190
|
+
return oFlexObject &&
|
|
191
|
+
[States.NEW, States.DIRTY, States.DELETED].includes(oFlexObject.getState());
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function getAllCompVariantObjects(mCompVariantsMapByPersistencyKey) {
|
|
195
|
+
return mCompVariantsMapByPersistencyKey.variants
|
|
196
|
+
.concat(mCompVariantsMapByPersistencyKey.changes)
|
|
197
|
+
.concat(mCompVariantsMapByPersistencyKey.defaultVariants)
|
|
198
|
+
.concat(mCompVariantsMapByPersistencyKey.standardVariantChange);
|
|
199
|
+
}
|
|
200
|
+
|
|
188
201
|
function determineLayer(mPropertyBag) {
|
|
189
202
|
// the SmartVariantManagementWriteAPI.addVariant-caller within sap.ui.rta provides a layer ...
|
|
190
203
|
if (mPropertyBag.layer) {
|
|
@@ -218,7 +231,7 @@ sap.ui.define([
|
|
|
218
231
|
|
|
219
232
|
function ifVariantClearRevertData(oFlexObject) {
|
|
220
233
|
if (oFlexObject instanceof CompVariant) {
|
|
221
|
-
oFlexObject.
|
|
234
|
+
oFlexObject.removeAllRevertData();
|
|
222
235
|
}
|
|
223
236
|
}
|
|
224
237
|
|
|
@@ -226,9 +239,7 @@ sap.ui.define([
|
|
|
226
239
|
oVariant.storeExecuteOnSelection(mPropertyBag.executeOnSelection);
|
|
227
240
|
oVariant.storeFavorite(mPropertyBag.favorite);
|
|
228
241
|
oVariant.storeContexts(mPropertyBag.contexts);
|
|
229
|
-
|
|
230
|
-
oVariant.setText("variantName", mPropertyBag.name);
|
|
231
|
-
}
|
|
242
|
+
oVariant.storeName(mPropertyBag.name);
|
|
232
243
|
oVariant.storeContent(mPropertyBag.content || oVariant.getContent());
|
|
233
244
|
return oVariant;
|
|
234
245
|
}
|
|
@@ -237,9 +248,7 @@ sap.ui.define([
|
|
|
237
248
|
oVariant.setExecuteOnSelection(mPropertyBag.executeOnSelection);
|
|
238
249
|
oVariant.setFavorite(mPropertyBag.favorite);
|
|
239
250
|
oVariant.setContexts(mPropertyBag.contexts);
|
|
240
|
-
|
|
241
|
-
oVariant.setName(mPropertyBag.name);
|
|
242
|
-
}
|
|
251
|
+
oVariant.setName(mPropertyBag.name);
|
|
243
252
|
oVariant.setContent(mPropertyBag.content || oVariant.getContent());
|
|
244
253
|
return oVariant;
|
|
245
254
|
}
|
|
@@ -250,7 +259,7 @@ sap.ui.define([
|
|
|
250
259
|
*
|
|
251
260
|
* @namespace sap.ui.fl.write._internal.flexState.compVariants.CompVariantState
|
|
252
261
|
* @since 1.83
|
|
253
|
-
* @version 1.
|
|
262
|
+
* @version 1.104.0
|
|
254
263
|
* @private
|
|
255
264
|
* @ui5-restricted sap.ui.fl
|
|
256
265
|
*/
|
|
@@ -368,35 +377,11 @@ sap.ui.define([
|
|
|
368
377
|
|
|
369
378
|
var oChangeSpecificData = mPropertyBag.changeSpecificData;
|
|
370
379
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
reference: mPropertyBag.reference,
|
|
377
|
-
fileType: "variant",
|
|
378
|
-
packageName: oChangeSpecificData.packageName,
|
|
379
|
-
layer: determineLayer(oChangeSpecificData),
|
|
380
|
-
selector: {
|
|
381
|
-
persistencyKey: mPropertyBag.persistencyKey
|
|
382
|
-
},
|
|
383
|
-
texts: getTexts(oChangeSpecificData),
|
|
384
|
-
command: mPropertyBag.command,
|
|
385
|
-
generator: mPropertyBag.generator
|
|
386
|
-
};
|
|
387
|
-
|
|
388
|
-
if (oChangeSpecificData.favorite !== undefined) {
|
|
389
|
-
oInfo.favorite = oChangeSpecificData.favorite;
|
|
390
|
-
}
|
|
391
|
-
if (oChangeSpecificData.executeOnSelection !== undefined) {
|
|
392
|
-
oInfo.executeOnSelection = oChangeSpecificData.executeOnSelection;
|
|
393
|
-
}
|
|
394
|
-
if (oChangeSpecificData.contexts !== undefined) {
|
|
395
|
-
oInfo.contexts = oChangeSpecificData.contexts;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
var oFile = CompVariant.createInitialFileContent(oInfo);
|
|
399
|
-
var oFlexObject = new CompVariant(oFile);
|
|
380
|
+
oChangeSpecificData.layer = determineLayer(oChangeSpecificData);
|
|
381
|
+
oChangeSpecificData.changeType = oChangeSpecificData.type;
|
|
382
|
+
oChangeSpecificData.texts = getTexts(oChangeSpecificData);
|
|
383
|
+
var oFileContent = Object.assign({}, oChangeSpecificData, _omit(mPropertyBag, "changeSpecificData"));
|
|
384
|
+
var oFlexObject = FlexObjectFactory.createCompVariant(oFileContent);
|
|
400
385
|
|
|
401
386
|
var mCompVariantsMap = FlexState.getCompVariantsMap(mPropertyBag.reference);
|
|
402
387
|
var oMapOfPersistencyKey = mCompVariantsMap._getOrCreate(mPropertyBag.persistencyKey);
|
|
@@ -452,13 +437,11 @@ sap.ui.define([
|
|
|
452
437
|
previousContent: oVariant.getContent(),
|
|
453
438
|
previousFavorite: oVariant.getFavorite(),
|
|
454
439
|
previousExecuteOnSelection: oVariant.getExecuteOnSelection(),
|
|
455
|
-
previousContexts: oVariant.getContexts()
|
|
440
|
+
previousContexts: oVariant.getContexts(),
|
|
441
|
+
previousName: oVariant.getName()
|
|
456
442
|
}
|
|
457
443
|
};
|
|
458
|
-
|
|
459
|
-
oRevertData.content.previousName = oVariant.getText("variantName");
|
|
460
|
-
}
|
|
461
|
-
oVariant.addRevertInfo(new CompVariantRevertData(oRevertData));
|
|
444
|
+
oVariant.addRevertData(new CompVariantRevertData(oRevertData));
|
|
462
445
|
}
|
|
463
446
|
|
|
464
447
|
function updateVariant(mPropertyBag, oVariant) {
|
|
@@ -493,23 +476,18 @@ sap.ui.define([
|
|
|
493
476
|
aRevertData.push(oRevertData);
|
|
494
477
|
oChange.setRevertData(aRevertData);
|
|
495
478
|
if (mPropertyBag.executeOnSelection !== undefined) {
|
|
496
|
-
oVariant.setExecuteOnSelection(mPropertyBag.executeOnSelection);
|
|
497
479
|
oChangeContent.executeOnSelection = mPropertyBag.executeOnSelection;
|
|
498
480
|
}
|
|
499
481
|
if (mPropertyBag.favorite !== undefined) {
|
|
500
|
-
oVariant.setFavorite(mPropertyBag.favorite);
|
|
501
482
|
oChangeContent.favorite = mPropertyBag.favorite;
|
|
502
483
|
}
|
|
503
484
|
if (mPropertyBag.contexts) {
|
|
504
|
-
oVariant.setContexts(mPropertyBag.contexts);
|
|
505
485
|
oChangeContent.contexts = mPropertyBag.contexts;
|
|
506
486
|
}
|
|
507
487
|
if (mPropertyBag.content) {
|
|
508
|
-
oVariant.setContent(mPropertyBag.content);
|
|
509
488
|
oChangeContent.variantContent = mPropertyBag.content;
|
|
510
489
|
}
|
|
511
490
|
if (mPropertyBag.name) {
|
|
512
|
-
oVariant.setName(mPropertyBag.name);
|
|
513
491
|
oChangeContent.texts = {
|
|
514
492
|
variantName: {
|
|
515
493
|
value: mPropertyBag.name,
|
|
@@ -521,8 +499,8 @@ sap.ui.define([
|
|
|
521
499
|
if (mPropertyBag.transportId) {
|
|
522
500
|
oChange.setRequest(mPropertyBag.transportId);
|
|
523
501
|
}
|
|
524
|
-
CompVariantMerger.applyChangeOnVariant(oVariant, oChange);
|
|
525
502
|
storeRevertDataInVariant(mPropertyBag, oVariant, CompVariantState.operationType.UpdateVariantViaChangeUpdate, oChange);
|
|
503
|
+
CompVariantMerger.applyChangeOnVariant(oVariant, oChange);
|
|
526
504
|
}
|
|
527
505
|
|
|
528
506
|
function createChange(mPropertyBag, oVariant) {
|
|
@@ -544,7 +522,7 @@ sap.ui.define([
|
|
|
544
522
|
content: {},
|
|
545
523
|
selector: {
|
|
546
524
|
persistencyKey: mPropertyBag.persistencyKey,
|
|
547
|
-
variantId: oVariant.
|
|
525
|
+
variantId: oVariant.getVariantId()
|
|
548
526
|
}
|
|
549
527
|
});
|
|
550
528
|
|
|
@@ -617,18 +595,25 @@ sap.ui.define([
|
|
|
617
595
|
*/
|
|
618
596
|
CompVariantState.removeVariant = function (mPropertyBag) {
|
|
619
597
|
var oVariant = getVariantById(mPropertyBag);
|
|
598
|
+
var sCurrentState = oVariant.getState();
|
|
620
599
|
|
|
621
600
|
if (!mPropertyBag.revert) {
|
|
622
601
|
var oRevertData = new CompVariantRevertData({
|
|
623
602
|
type: CompVariantState.operationType.StateUpdate,
|
|
624
603
|
content: {
|
|
625
|
-
previousState:
|
|
604
|
+
previousState: sCurrentState
|
|
626
605
|
}
|
|
627
606
|
});
|
|
628
|
-
oVariant.
|
|
607
|
+
oVariant.addRevertData(oRevertData);
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
if (sCurrentState === States.NEW) {
|
|
611
|
+
var mCompVariantsMap = FlexState.getCompVariantsMap(mPropertyBag.reference);
|
|
612
|
+
var mCompVariantsMapByPersistencyKey = mCompVariantsMap._getOrCreate(mPropertyBag.persistencyKey);
|
|
613
|
+
removeFromCompVariantsMap(oVariant, mCompVariantsMapByPersistencyKey);
|
|
614
|
+
return oVariant;
|
|
629
615
|
}
|
|
630
616
|
|
|
631
|
-
// TODO: check if it is an deletion or create corresponding changes
|
|
632
617
|
oVariant.markForDeletion();
|
|
633
618
|
return oVariant;
|
|
634
619
|
};
|
|
@@ -654,8 +639,8 @@ sap.ui.define([
|
|
|
654
639
|
|
|
655
640
|
var oVariant = getVariantById(mPropertyBag);
|
|
656
641
|
|
|
657
|
-
var oVariantRevertData = oVariant.
|
|
658
|
-
oVariant.
|
|
642
|
+
var oVariantRevertData = oVariant.getRevertData().pop();
|
|
643
|
+
oVariant.removeRevertData(oVariantRevertData);
|
|
659
644
|
var oRevertDataContent = oVariantRevertData.getContent();
|
|
660
645
|
var oChange;
|
|
661
646
|
|
|
@@ -727,7 +712,7 @@ sap.ui.define([
|
|
|
727
712
|
*/
|
|
728
713
|
CompVariantState.overrideStandardVariant = function(mPropertyBag) {
|
|
729
714
|
var mCompVariantsMap = FlexState.getCompVariantsMap(mPropertyBag.reference)[mPropertyBag.persistencyKey];
|
|
730
|
-
var oStandardVariant = mCompVariantsMap.byId[mCompVariantsMap.standardVariant.
|
|
715
|
+
var oStandardVariant = mCompVariantsMap.byId[mCompVariantsMap.standardVariant.getVariantId()];
|
|
731
716
|
|
|
732
717
|
oStandardVariant.setExecuteOnSelection(!!mPropertyBag.executeOnSelection);
|
|
733
718
|
var aChanges = oStandardVariant.getChanges();
|
|
@@ -751,7 +736,7 @@ sap.ui.define([
|
|
|
751
736
|
function writeObjectAndAddToState(oFlexObject, oStoredResponse, sParentVersion) {
|
|
752
737
|
// TODO: remove this line as soon as layering and a condensing is in place
|
|
753
738
|
return Storage.write({
|
|
754
|
-
flexObjects: [oFlexObject.getDefinition()],
|
|
739
|
+
flexObjects: [oFlexObject.convertToFileContent ? oFlexObject.convertToFileContent() : oFlexObject.getDefinition()],
|
|
755
740
|
layer: oFlexObject.getLayer(),
|
|
756
741
|
transport: oFlexObject.getRequest(),
|
|
757
742
|
isLegacyVariant: oFlexObject.isVariant(),
|
|
@@ -769,11 +754,11 @@ sap.ui.define([
|
|
|
769
754
|
} else {
|
|
770
755
|
oFlexObject.setState(States.PERSISTED);
|
|
771
756
|
}
|
|
772
|
-
|
|
773
|
-
}).then(function (oStoredResponse) {
|
|
757
|
+
}).then(function () {
|
|
774
758
|
// update StorageResponse
|
|
775
|
-
|
|
776
|
-
|
|
759
|
+
var oFileContent = oFlexObject.convertToFileContent ? oFlexObject.convertToFileContent() : oFlexObject.getDefinition();
|
|
760
|
+
getSubSection(oStoredResponse.changes.comp, oFlexObject).push(oFileContent);
|
|
761
|
+
return oFileContent;
|
|
777
762
|
});
|
|
778
763
|
}
|
|
779
764
|
|
|
@@ -800,28 +785,29 @@ sap.ui.define([
|
|
|
800
785
|
|
|
801
786
|
return FlexState.getStorageResponse(sReference)
|
|
802
787
|
.then(function(oStoredResponse) {
|
|
803
|
-
var
|
|
804
|
-
var aPromises =
|
|
788
|
+
var aFlexObjects = getAllCompVariantObjects(mCompVariantsMapByPersistencyKey).filter(needsPersistencyCall);
|
|
789
|
+
var aPromises = aFlexObjects.map(function(oFlexObject, index) {
|
|
805
790
|
if (index === 0) {
|
|
806
791
|
var sParentVersion = getPropertyFromVersionsModel("/persistedVersion", {
|
|
807
792
|
layer: oFlexObject.getLayer(),
|
|
808
|
-
reference: oFlexObject.
|
|
793
|
+
reference: oFlexObject.getFlexObjectMetadata ?
|
|
794
|
+
oFlexObject.getFlexObjectMetadata().reference :
|
|
795
|
+
oFlexObject.getDefinition().reference
|
|
809
796
|
});
|
|
810
797
|
// TODO: use condensing route to reduce backend requests
|
|
811
798
|
// need to save first entry to generate draft version in backend
|
|
812
799
|
return saveObject(oFlexObject, mCompVariantsMapByPersistencyKey, oStoredResponse, sParentVersion)
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
});
|
|
820
|
-
return aPromises;
|
|
800
|
+
.then(function() {
|
|
801
|
+
var aPromises = aFlexObjects.map(function(oFlexObject, index) {
|
|
802
|
+
if (index !== 0) {
|
|
803
|
+
var sDraftVersion = sParentVersion ? Version.Number.Draft : undefined;
|
|
804
|
+
return saveObject(oFlexObject, mCompVariantsMapByPersistencyKey, oStoredResponse, sDraftVersion);
|
|
805
|
+
}
|
|
821
806
|
});
|
|
807
|
+
return aPromises;
|
|
808
|
+
});
|
|
822
809
|
}
|
|
823
810
|
});
|
|
824
|
-
|
|
825
811
|
// TODO Consider not rejecting with first error, but wait for all promises and collect the results
|
|
826
812
|
return Promise.all(aPromises);
|
|
827
813
|
});
|
|
@@ -230,8 +230,8 @@ sap.ui.define([
|
|
|
230
230
|
};
|
|
231
231
|
|
|
232
232
|
/**
|
|
233
|
-
* Creates the transport <code>sap.
|
|
234
|
-
* @returns {sap.
|
|
233
|
+
* Creates the transport <code>sap.m.ComboBox</code>.
|
|
234
|
+
* @returns {sap.m.ComboBox} Transport <code>sap.m.ComboBox</code>
|
|
235
235
|
*
|
|
236
236
|
* @private
|
|
237
237
|
*/
|
|
@@ -273,8 +273,8 @@ sap.ui.define([
|
|
|
273
273
|
};
|
|
274
274
|
|
|
275
275
|
/**
|
|
276
|
-
* Creates
|
|
277
|
-
* @returns {sap.
|
|
276
|
+
* Creates an <code>sap.m.Input</code> field for the package.
|
|
277
|
+
* @returns {sap.m.Input} Input field for the package
|
|
278
278
|
*
|
|
279
279
|
* @private
|
|
280
280
|
*/
|
|
@@ -26,7 +26,7 @@ sap.ui.define([
|
|
|
26
26
|
* @private
|
|
27
27
|
* @alias sap.ui.fl.write._internal.transport.TransportSelection
|
|
28
28
|
* @author SAP SE
|
|
29
|
-
* @version 1.
|
|
29
|
+
* @version 1.104.0
|
|
30
30
|
* @since 1.74.0
|
|
31
31
|
* Helper object to select an ABAP transport for an LREP object. This is not a generic utility to select a transport request, but part
|
|
32
32
|
* of the SmartVariant control.
|
|
@@ -27,7 +27,7 @@ sap.ui.define([
|
|
|
27
27
|
* Entity that handles ABAP transport related information.
|
|
28
28
|
* @alias sap.ui.fl.write._internal.transport.Transports
|
|
29
29
|
* @author SAP SE
|
|
30
|
-
* @version 1.
|
|
30
|
+
* @version 1.104.0
|
|
31
31
|
* @since 1.74.0
|
|
32
32
|
* @private
|
|
33
33
|
* @ui5-restricted sap.ui.fl.write._internal.transport
|