@openui5/sap.ui.fl 1.129.0 → 1.130.1
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/THIRDPARTY.txt +1 -1
- package/package.json +3 -3
- package/src/sap/ui/fl/.library +1 -1
- package/src/sap/ui/fl/ChangePersistence.js +26 -38
- 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 +8 -8
- package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +1 -1
- package/src/sap/ui/fl/apply/_internal/appVariant/DescriptorChangeTypes.js +2 -1
- package/src/sap/ui/fl/apply/_internal/changes/Applier.js +152 -197
- package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +23 -17
- package/src/sap/ui/fl/apply/_internal/changes/Reverter.js +27 -37
- package/src/sap/ui/fl/apply/_internal/changes/Utils.js +26 -31
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +3 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +2 -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/AddNewDataSource.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewInbound.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewOutbound.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddTechnicalAttributes.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/ChangeOutbound.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/RemoveAllInboundsExceptOne.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetAch.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetDescription.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/SetCloudDevAdaptationStatus.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/ChangeModel.js +78 -0
- 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/extensionPoint/Registry.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/AnnotationChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/AppDescriptorChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/ControllerExtensionChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlVariant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +7 -3
- package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/FlexObjectState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +34 -13
- 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/changes/UIChangesState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantManagementState.js +108 -0
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +57 -9
- package/src/sap/ui/fl/apply/_internal/preprocessors/ComponentLifecycleHooks.js +2 -2
- package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +1 -1
- package/src/sap/ui/fl/apply/_internal/preprocessors/RegistrationDelegator.js +6 -6
- package/src/sap/ui/fl/apply/_internal/preprocessors/XmlPreprocessor.js +1 -1
- package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +25 -10
- package/src/sap/ui/fl/apply/api/SmartVariantManagementApplyAPI.js +18 -45
- 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/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/initial/_internal/FlexConfiguration.js +1 -1
- package/src/sap/ui/fl/initial/_internal/Storage.js +37 -1
- package/src/sap/ui/fl/initial/_internal/StorageFeaturesMerger.js +1 -1
- package/src/sap/ui/fl/initial/_internal/StorageUtils.js +1 -1
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration.js +3 -2
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.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 +15 -1
- package/src/sap/ui/fl/interfaces/Delegate.js +1 -1
- package/src/sap/ui/fl/library.js +43 -43
- package/src/sap/ui/fl/support/_internal/getAllUIChanges.js +1 -1
- package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +1 -1
- package/src/sap/ui/fl/support/_internal/getFlexObjectInfos.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/transport/TransportSelection.js +1 -1
- package/src/sap/ui/fl/util/DescriptorChangeCheck.js +35 -16
- package/src/sap/ui/fl/util/IFrame.js +1 -1
- 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/VariantModel.js +33 -11
- package/src/sap/ui/fl/write/_internal/Storage.js +1 -1
- package/src/sap/ui/fl/write/_internal/Versions.js +7 -3
- 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 +34 -1
- package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +163 -176
- package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +62 -61
- package/src/sap/ui/fl/write/_internal/condenser/Utils.js +17 -19
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Create.js +13 -13
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Destroy.js +17 -19
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Move.js +32 -35
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Update.js +2 -10
- package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/BtpServiceConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +56 -4
- 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/controlVariants/ControlVariantWriteUtils.js +59 -0
- package/src/sap/ui/fl/write/_internal/delegates/ODataV2ReadDelegate.js +1 -2
- package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.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/FlexObjectManager.js +33 -2
- package/src/sap/ui/fl/write/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/changes/UIChangeManager.js +26 -3
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +20 -12
- 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/ChangesWriteAPI.js +73 -3
- package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
- package/src/sap/ui/fl/write/api/LocalResetAPI.js +17 -27
- package/src/sap/ui/fl/write/api/VersionsAPI.js +26 -4
|
@@ -168,7 +168,7 @@ sap.ui.define([
|
|
|
168
168
|
*
|
|
169
169
|
* @namespace sap.ui.fl.write._internal.connectors.LrepConnector
|
|
170
170
|
* @since 1.67
|
|
171
|
-
* @version 1.
|
|
171
|
+
* @version 1.130.1
|
|
172
172
|
* @private
|
|
173
173
|
* @ui5-restricted sap.ui.fl.write._internal.Storage
|
|
174
174
|
*/
|
|
@@ -373,7 +373,7 @@ sap.ui.define([
|
|
|
373
373
|
* @returns {Promise<boolean>} Promise resolves with true
|
|
374
374
|
* @deprecated
|
|
375
375
|
*/
|
|
376
|
-
|
|
376
|
+
isContextSharingEnabled() {
|
|
377
377
|
return Promise.resolve(true);
|
|
378
378
|
},
|
|
379
379
|
|
|
@@ -434,19 +434,71 @@ sap.ui.define([
|
|
|
434
434
|
},
|
|
435
435
|
|
|
436
436
|
/**
|
|
437
|
-
* Write flex data into LRep back end; This
|
|
438
|
-
* that also condense the stored changes on the backend.
|
|
437
|
+
* Write flex data into LRep back end; This function splits the condense format by namespaces.
|
|
439
438
|
*
|
|
440
439
|
* @param {object} mPropertyBag Property bag
|
|
441
440
|
* @param {object} mPropertyBag.flexObjects Map of condensed changes
|
|
441
|
+
* @param {object} mPropertyBag.allChanges Original set of changes
|
|
442
442
|
* @param {string} mPropertyBag.url Configured url for the connector
|
|
443
443
|
* @param {string} [mPropertyBag.transport] The transport ID
|
|
444
444
|
* @param {boolean} [mPropertyBag.isLegacyVariant] Whether the new flex data has file type .variant or not
|
|
445
445
|
* @returns {Promise} Promise resolves as soon as the writing was completed
|
|
446
446
|
*/
|
|
447
447
|
condense(mPropertyBag) {
|
|
448
|
+
const oFlexObjects = mPropertyBag.flexObjects;
|
|
449
|
+
const oNamespaceMap = {};
|
|
450
|
+
|
|
451
|
+
// Helper to process each change and add it to the correct namespace/action
|
|
452
|
+
function processChange(sAction, sNamespace, sFileType, sFileName, oChange) {
|
|
453
|
+
// Ensure the namespace object exists
|
|
454
|
+
oNamespaceMap[sNamespace] ||= {
|
|
455
|
+
namespace: sNamespace,
|
|
456
|
+
layer: oFlexObjects.layer
|
|
457
|
+
};
|
|
458
|
+
|
|
459
|
+
oNamespaceMap[sNamespace][sAction] ||= {};
|
|
460
|
+
oNamespaceMap[sNamespace][sAction][sFileType] ||= [];
|
|
461
|
+
|
|
462
|
+
// For 'delete' and 'reorder', just add the file name
|
|
463
|
+
if (sAction === "delete" || sAction === "reorder") {
|
|
464
|
+
oNamespaceMap[sNamespace][sAction][sFileType].push(sFileName);
|
|
465
|
+
} else {
|
|
466
|
+
// For 'create' and 'update', add the full change object
|
|
467
|
+
oNamespaceMap[sNamespace][sAction][sFileType].push({
|
|
468
|
+
[sFileName]: oChange[sFileName] || oChange
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
// Loop through flexObjects to organize changes by namespace
|
|
474
|
+
["create", "reorder", "update", "delete"].forEach((sAction) => {
|
|
475
|
+
const oChangesByAction = oFlexObjects[sAction];
|
|
476
|
+
|
|
477
|
+
if (oChangesByAction) {
|
|
478
|
+
Object.keys(oChangesByAction).forEach((sFileType) => {
|
|
479
|
+
oChangesByAction[sFileType].forEach((oChange) => {
|
|
480
|
+
const sFileName = oChange.fileName || (typeof oChange === "object" ? Object.keys(oChange)[0] : oChange);
|
|
481
|
+
var sNamespace = oChange[sFileName]?.namespace || oChange[sFileType]?.namespace;
|
|
482
|
+
|
|
483
|
+
// If namespace is missing, fallback to allChanges to resolve it
|
|
484
|
+
if (!sNamespace) {
|
|
485
|
+
const oMatchingChange = mPropertyBag.allChanges.find((oChangeItem) => oChangeItem.getId() === sFileName);
|
|
486
|
+
sNamespace = oMatchingChange ? oMatchingChange.getNamespace() : undefined;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// Ensure we have a valid namespace and process the change
|
|
490
|
+
if (sNamespace) {
|
|
491
|
+
processChange(sAction, sNamespace, sFileType, sFileName, oChange);
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
});
|
|
497
|
+
|
|
498
|
+
mPropertyBag.flexObjects = Object.values(oNamespaceMap);
|
|
448
499
|
mPropertyBag.method = "POST";
|
|
449
500
|
mPropertyBag.isCondensingEnabled = true;
|
|
501
|
+
|
|
450
502
|
return _doWrite(mPropertyBag);
|
|
451
503
|
},
|
|
452
504
|
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
sap.ui.define([
|
|
8
|
+
"sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState",
|
|
9
|
+
"sap/ui/fl/registry/Settings",
|
|
10
|
+
"sap/ui/fl/write/_internal/flexState/FlexObjectManager"
|
|
11
|
+
], function(
|
|
12
|
+
VariantManagementState,
|
|
13
|
+
Settings,
|
|
14
|
+
FlexObjectManager
|
|
15
|
+
) {
|
|
16
|
+
"use strict";
|
|
17
|
+
|
|
18
|
+
const ControlVariantWriteUtils = {};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Deletes a control variant and its associated changes. This is only possible for USER layer variants
|
|
22
|
+
* and CUSTOMER layer variants which are part of a draft (not activated).
|
|
23
|
+
*
|
|
24
|
+
* @param {string} sReference - Flex reference
|
|
25
|
+
* @param {string} sVMReference - Variant management reference
|
|
26
|
+
* @param {string} sVariantReference - Variant reference
|
|
27
|
+
* @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} - Array of flex objects that were deleted
|
|
28
|
+
*/
|
|
29
|
+
ControlVariantWriteUtils.deleteVariant = function(sReference, sVMReference, sVariantReference) {
|
|
30
|
+
// Deletion of variant-related objects is only supported for backends with condensing enabled
|
|
31
|
+
if (!Settings.getInstanceOrUndef()?.isCondensingEnabled()) {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const mPropertyBag = {
|
|
36
|
+
reference: sReference,
|
|
37
|
+
vmReference: sVMReference,
|
|
38
|
+
vReference: sVariantReference
|
|
39
|
+
};
|
|
40
|
+
const aVMChanges = VariantManagementState.getVariantManagementChanges(mPropertyBag);
|
|
41
|
+
const aControlChanges = VariantManagementState.getControlChangesForVariant({
|
|
42
|
+
...mPropertyBag,
|
|
43
|
+
includeReferencedChanges: false
|
|
44
|
+
});
|
|
45
|
+
const oVariant = VariantManagementState.getVariant(mPropertyBag).instance;
|
|
46
|
+
const aVariantChanges = VariantManagementState.getVariantChangesForVariant(mPropertyBag);
|
|
47
|
+
|
|
48
|
+
const aFlexObjectsToDelete = [oVariant, ...aVMChanges, ...aVariantChanges, ...aControlChanges];
|
|
49
|
+
|
|
50
|
+
FlexObjectManager.deleteFlexObjects({
|
|
51
|
+
reference: sReference,
|
|
52
|
+
flexObjects: aFlexObjectsToDelete
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
return aFlexObjectsToDelete;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
return ControlVariantWriteUtils;
|
|
59
|
+
});
|
|
@@ -256,10 +256,9 @@ sap.ui.define(["sap/ui/model/ListBinding"], function(ListBinding) {
|
|
|
256
256
|
return aProperties;
|
|
257
257
|
}
|
|
258
258
|
/**
|
|
259
|
-
* Default read delegate for ODataV2
|
|
259
|
+
* Default read delegate for ODataV2 protocol.
|
|
260
260
|
* @namespace sap.ui.fl.write._internal.delegate.ODataV2ReadDelegate
|
|
261
261
|
* @implements {sap.ui.fl.interfaces.Delegate}
|
|
262
|
-
* @experimental Since 1.123
|
|
263
262
|
* @since 1.123
|
|
264
263
|
* @private
|
|
265
264
|
*/
|
|
@@ -17,7 +17,7 @@ sap.ui.define([
|
|
|
17
17
|
* @class
|
|
18
18
|
* @namespace sap.ui.fl.write._internal.fieldExtensibility.ABAPExtensibilityVariant
|
|
19
19
|
* @since 1.87
|
|
20
|
-
* @version 1.
|
|
20
|
+
* @version 1.130.1
|
|
21
21
|
* @public
|
|
22
22
|
* @param {sap.ui.base.ManagedObject} oControl - Control to add extensions
|
|
23
23
|
*/
|
|
@@ -115,7 +115,7 @@ sap.ui.define([
|
|
|
115
115
|
* @namespace sap.ui.fl.write._internal.fieldExtensibility.ABAPExtensibilityVariantFactory
|
|
116
116
|
* @since 1.87.0
|
|
117
117
|
* @author SAP SE
|
|
118
|
-
* @version 1.
|
|
118
|
+
* @version 1.130.1
|
|
119
119
|
* @private
|
|
120
120
|
*/
|
|
121
121
|
var ABAPExtensibilityVariantFactory = {};
|
package/src/sap/ui/fl/write/_internal/fieldExtensibility/SingleTenantABAPExtensibilityVariant.js
CHANGED
|
@@ -49,7 +49,7 @@ sap.ui.define([
|
|
|
49
49
|
*
|
|
50
50
|
* @namespace sap.ui.fl.write._internal.fieldExtensibility.SingleTenantABAPExtensibilityVariant
|
|
51
51
|
* @since 1.87
|
|
52
|
-
* @version 1.
|
|
52
|
+
* @version 1.130.1
|
|
53
53
|
* @public
|
|
54
54
|
*/
|
|
55
55
|
const SingleTenantABAPExtensibilityVariant = ABAPExtensibilityVariant.extend(sNamespace, {
|
|
@@ -82,7 +82,7 @@ sap.ui.define([
|
|
|
82
82
|
* @extends sap.ui.base.ManagedObject
|
|
83
83
|
* @alias sap.ui.fl.write._internal.fieldExtensibility.cap.dialog.CustomFieldCAPDialog
|
|
84
84
|
* @author SAP SE
|
|
85
|
-
* @version 1.
|
|
85
|
+
* @version 1.130.1
|
|
86
86
|
* @since 1.93
|
|
87
87
|
* @private
|
|
88
88
|
* @ui5-restricted
|
|
@@ -51,7 +51,7 @@ sap.ui.define([
|
|
|
51
51
|
* @namespace
|
|
52
52
|
* @alias sap.ui.fl.write._internal.flexState.FlexObjectManager
|
|
53
53
|
* @since 1.83
|
|
54
|
-
* @version 1.
|
|
54
|
+
* @version 1.130.1
|
|
55
55
|
* @private
|
|
56
56
|
* @ui5-restricted sap.ui.fl
|
|
57
57
|
*/
|
|
@@ -309,7 +309,38 @@ sap.ui.define([
|
|
|
309
309
|
removeFlexObjectFromDependencyHandler(mPropertyBag.reference, oFlexObject);
|
|
310
310
|
});
|
|
311
311
|
FlexState.removeDirtyFlexObjects(mPropertyBag.reference, aToBeRemovedDirtyFlexObjects);
|
|
312
|
-
FlexObjectManager.addDirtyFlexObjects(mPropertyBag.reference, aToBeDeletedFlexObjects);
|
|
312
|
+
const aAddedFlexObjects = FlexObjectManager.addDirtyFlexObjects(mPropertyBag.reference, aToBeDeletedFlexObjects);
|
|
313
|
+
if (!aToBeRemovedDirtyFlexObjects.length && !aAddedFlexObjects.length) {
|
|
314
|
+
const oFlexObjectsDataSelector = FlexState.getFlexObjectsDataSelector();
|
|
315
|
+
oFlexObjectsDataSelector.checkUpdate({
|
|
316
|
+
reference: mPropertyBag.reference
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Restores previously deleted flex objects. They can be in state DELETED or NEW (when they were dirty and removed from the FlexState).
|
|
323
|
+
* Objects are restored to the state they were in before deletion.
|
|
324
|
+
* If the flex object was not persisted, it is added as a dirty object again.
|
|
325
|
+
* Deleting a change in the State NEW is done by just removing the change from the map instead of changing the state to DELETED.
|
|
326
|
+
*
|
|
327
|
+
* @param {object} mPropertyBag - Object with parameters as properties
|
|
328
|
+
* @param {string} mPropertyBag.reference - Flex reference of the application
|
|
329
|
+
* @param {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} mPropertyBag.flexObjects - Flex objects to be restored
|
|
330
|
+
*/
|
|
331
|
+
FlexObjectManager.restoreDeletedFlexObjects = function(mPropertyBag) {
|
|
332
|
+
const aDeletedFlexObjects = mPropertyBag.flexObjects.filter((oFlexObject) => (
|
|
333
|
+
oFlexObject.getState() === States.LifecycleState.DELETED
|
|
334
|
+
|| oFlexObject.getState() === States.LifecycleState.NEW
|
|
335
|
+
));
|
|
336
|
+
aDeletedFlexObjects.forEach((oFlexObject) => {
|
|
337
|
+
oFlexObject.restorePreviousState();
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
const aDirtyFlexObjectsToBeAdded = aDeletedFlexObjects.filter((oFlexObject) => (
|
|
341
|
+
oFlexObject.getState() !== States.LifecycleState.PERSISTED
|
|
342
|
+
));
|
|
343
|
+
FlexObjectManager.addDirtyFlexObjects(mPropertyBag.reference, aDirtyFlexObjectsToBeAdded);
|
|
313
344
|
};
|
|
314
345
|
|
|
315
346
|
/**
|
|
@@ -9,17 +9,21 @@ sap.ui.define([
|
|
|
9
9
|
"sap/ui/core/Component",
|
|
10
10
|
"sap/ui/fl/apply/_internal/changes/Applier",
|
|
11
11
|
"sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory",
|
|
12
|
+
"sap/ui/fl/apply/_internal/flexObjects/States",
|
|
12
13
|
"sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler",
|
|
13
14
|
"sap/ui/fl/apply/_internal/flexState/FlexObjectState",
|
|
14
|
-
"sap/ui/fl/apply/_internal/flexState/FlexState"
|
|
15
|
+
"sap/ui/fl/apply/_internal/flexState/FlexState",
|
|
16
|
+
"sap/ui/fl/write/_internal/flexState/FlexObjectManager"
|
|
15
17
|
], function(
|
|
16
18
|
_omit,
|
|
17
19
|
Component,
|
|
18
20
|
Applier,
|
|
19
21
|
FlexObjectFactory,
|
|
22
|
+
States,
|
|
20
23
|
DependencyHandler,
|
|
21
24
|
FlexObjectState,
|
|
22
|
-
FlexState
|
|
25
|
+
FlexState,
|
|
26
|
+
FlexObjectManager
|
|
23
27
|
) {
|
|
24
28
|
"use strict";
|
|
25
29
|
|
|
@@ -29,7 +33,7 @@ sap.ui.define([
|
|
|
29
33
|
* @namespace
|
|
30
34
|
* @alias sap.ui.fl.write._internal.flexState.changes.UIChangeManager
|
|
31
35
|
* @since 1.129
|
|
32
|
-
* @version 1.
|
|
36
|
+
* @version 1.130.1
|
|
33
37
|
* @private
|
|
34
38
|
* @ui5-restricted sap.ui.fl
|
|
35
39
|
*/
|
|
@@ -82,5 +86,24 @@ sap.ui.define([
|
|
|
82
86
|
return aAddedChanges;
|
|
83
87
|
};
|
|
84
88
|
|
|
89
|
+
/**
|
|
90
|
+
* Restores previously deleted UIChanges.
|
|
91
|
+
* They can be in state DELETED or NEW (when they were dirty and removed from the FlexState).
|
|
92
|
+
*
|
|
93
|
+
* @param {string} sReference - Flex reference of the application
|
|
94
|
+
* @param {sap.ui.fl.apply._internal.flexObjects.UIChange[]} aChanges - Array of UIChange instances to be restored
|
|
95
|
+
* @param {sap.ui.core.Component} oAppComponent - Application component instance
|
|
96
|
+
*/
|
|
97
|
+
UIChangeManager.restoreDeletedChanges = function(sReference, aChanges, oAppComponent) {
|
|
98
|
+
FlexObjectManager.restoreDeletedFlexObjects({
|
|
99
|
+
reference: sReference,
|
|
100
|
+
flexObjects: aChanges
|
|
101
|
+
});
|
|
102
|
+
const aDirtyChanges = aChanges.filter((oChange) => oChange.getState() !== States.LifecycleState.PERSISTED);
|
|
103
|
+
aDirtyChanges.forEach((oChange) => {
|
|
104
|
+
finalizeChangeCreation(sReference, oChange, oAppComponent);
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
|
|
85
108
|
return UIChangeManager;
|
|
86
109
|
});
|
|
@@ -17,6 +17,7 @@ sap.ui.define([
|
|
|
17
17
|
"sap/ui/fl/apply/_internal/flexObjects/States",
|
|
18
18
|
"sap/ui/fl/apply/_internal/flexObjects/UpdatableChange",
|
|
19
19
|
"sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger",
|
|
20
|
+
"sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantManagementState",
|
|
20
21
|
"sap/ui/fl/apply/_internal/flexState/FlexState",
|
|
21
22
|
"sap/ui/fl/initial/api/Version",
|
|
22
23
|
"sap/ui/fl/registry/Settings",
|
|
@@ -35,6 +36,7 @@ sap.ui.define([
|
|
|
35
36
|
States,
|
|
36
37
|
UpdatableChange,
|
|
37
38
|
CompVariantMerger,
|
|
39
|
+
CompVariantManagementState,
|
|
38
40
|
FlexState,
|
|
39
41
|
Version,
|
|
40
42
|
Settings,
|
|
@@ -310,7 +312,7 @@ sap.ui.define([
|
|
|
310
312
|
*
|
|
311
313
|
* @namespace sap.ui.fl.write._internal.flexState.compVariants.CompVariantState
|
|
312
314
|
* @since 1.83
|
|
313
|
-
* @version 1.
|
|
315
|
+
* @version 1.130.1
|
|
314
316
|
* @private
|
|
315
317
|
* @ui5-restricted sap.ui.fl
|
|
316
318
|
*/
|
|
@@ -341,12 +343,11 @@ sap.ui.define([
|
|
|
341
343
|
// TODO: remove as soon as the development uses an IDE using rta which passes the correct parameter
|
|
342
344
|
mPropertyBag.layer ||= new URLSearchParams(window.location.search).get("sap-ui-layer") || Layer.USER;
|
|
343
345
|
|
|
344
|
-
|
|
345
|
-
var sChangeType = "defaultVariant";
|
|
346
|
-
var aDefaultVariantChanges = mCompVariantsMap.defaultVariants;
|
|
347
|
-
var oChange = aDefaultVariantChanges[aDefaultVariantChanges.length - 1];
|
|
346
|
+
let oChange = CompVariantManagementState.getDefaultChanges(mPropertyBag).slice(-1)[0];
|
|
348
347
|
|
|
349
348
|
if (!oChange || !isChangeUpdatable(oChange, mPropertyBag)) {
|
|
349
|
+
var mCompVariantsMap = FlexState.getCompVariantsMap(mPropertyBag.reference)._getOrCreate(mPropertyBag.persistencyKey);
|
|
350
|
+
var sChangeType = "defaultVariant";
|
|
350
351
|
var oChangeParameter = {
|
|
351
352
|
fileName: Utils.createDefaultFileName(sChangeType),
|
|
352
353
|
fileType: "change",
|
|
@@ -363,7 +364,6 @@ sap.ui.define([
|
|
|
363
364
|
oChangeParameter.adaptationId = mPropertyBag.changeSpecificData?.adaptationId;
|
|
364
365
|
oChangeParameter.support.generator ||= `CompVariantState.${sChangeType}`;
|
|
365
366
|
oChange = FlexObjectFactory.createFromFileContent(oChangeParameter, UpdatableChange);
|
|
366
|
-
mCompVariantsMap.defaultVariants.push(oChange);
|
|
367
367
|
mCompVariantsMap.byId[oChange.getId()] = oChange;
|
|
368
368
|
oChange.addRevertInfo(new RevertData({
|
|
369
369
|
type: CompVariantState.operationType.NewChange
|
|
@@ -390,16 +390,15 @@ sap.ui.define([
|
|
|
390
390
|
* @param {string} mPropertyBag.persistencyKey - ID of the variant management internal identifier
|
|
391
391
|
*/
|
|
392
392
|
CompVariantState.revertSetDefaultVariantId = function(mPropertyBag) {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
var oRevertInfo = oChange.popLatestRevertInfo();
|
|
393
|
+
const aDefaultChanges = CompVariantManagementState.getDefaultChanges(mPropertyBag);
|
|
394
|
+
const oChange = aDefaultChanges?.slice(-1)[0];
|
|
395
|
+
const oRevertInfo = oChange.popLatestRevertInfo();
|
|
397
396
|
if (oRevertInfo.getType() === CompVariantState.operationType.ContentUpdate) {
|
|
398
397
|
oChange.setContent(oRevertInfo.getContent().previousContent);
|
|
399
398
|
oChange.setState(oRevertInfo.getContent().previousState);
|
|
400
399
|
} else {
|
|
401
400
|
oChange.setState(States.LifecycleState.DELETED);
|
|
402
|
-
|
|
401
|
+
aDefaultChanges.pop();
|
|
403
402
|
}
|
|
404
403
|
};
|
|
405
404
|
|
|
@@ -919,9 +918,18 @@ sap.ui.define([
|
|
|
919
918
|
const sPersistencyKey = mPropertyBag.persistencyKey;
|
|
920
919
|
const mCompVariantsMap = FlexState.getCompVariantsMap(sReference);
|
|
921
920
|
const mCompVariantsMapByPersistencyKey = mCompVariantsMap._getOrCreate(sPersistencyKey);
|
|
921
|
+
const aSetDefaultChanges = CompVariantManagementState.getDefaultChanges({
|
|
922
|
+
reference: mPropertyBag.reference,
|
|
923
|
+
persistencyKey: mPropertyBag.persistencyKey
|
|
924
|
+
});
|
|
925
|
+
|
|
926
|
+
const aCompVariantEntities = [
|
|
927
|
+
...getAllCompVariantObjects(mCompVariantsMapByPersistencyKey),
|
|
928
|
+
...aSetDefaultChanges
|
|
929
|
+
];
|
|
922
930
|
|
|
923
931
|
const oStoredResponse = await FlexState.getStorageResponse(sReference);
|
|
924
|
-
const aFlexObjects =
|
|
932
|
+
const aFlexObjects = aCompVariantEntities.filter(needsPersistencyCall);
|
|
925
933
|
const aPromises = aFlexObjects.map(function(oFlexObject, index) {
|
|
926
934
|
if (index === 0) {
|
|
927
935
|
const sParentVersion = getPropertyFromVersionsModel("/persistedVersion", {
|
|
@@ -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.130.1
|
|
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.130.1
|
|
31
31
|
* @since 1.74.0
|
|
32
32
|
* @private
|
|
33
33
|
* @ui5-restricted sap.ui.fl.write._internal.transport
|