@openui5/sap.ui.fl 1.123.1 → 1.124.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/package.json +3 -3
- package/src/sap/ui/fl/.library +1 -1
- package/src/sap/ui/fl/ChangePersistence.js +39 -48
- 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 +3 -34
- 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 +1 -1
- package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +113 -270
- package/src/sap/ui/fl/apply/_internal/appVariant/DescriptorChangeTypes.js +2 -1
- package/src/sap/ui/fl/apply/_internal/changes/Applier.js +36 -3
- 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/AddNewInbound.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/RemoveAllInboundsExceptOne.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 +49 -5
- package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageUtils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/controlVariants/URLHandler.js +28 -27
- 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/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 +1 -1
- 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/FlexState.js +75 -41
- 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 +30 -11
- package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +67 -70
- package/src/sap/ui/fl/apply/_internal/flexState/changes/UIChangesState.js +14 -6
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/Utils.js +4 -0
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +8 -7
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +108 -41
- package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +8 -15
- package/src/sap/ui/fl/apply/_internal/preprocessors/RegistrationDelegator.js +7 -12
- package/src/sap/ui/fl/apply/_internal/preprocessors/XmlPreprocessor.js +15 -19
- package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +1 -1
- package/src/sap/ui/fl/apply/api/DelegateMediatorAPI.js +13 -86
- package/src/sap/ui/fl/apply/api/FlexRuntimeInfoAPI.js +14 -11
- 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 +14 -29
- 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 +2 -2
- package/src/sap/ui/fl/changeHandler/common/createIFrame.js +5 -2
- package/src/sap/ui/fl/descriptorRelated/Utils.js +16 -7
- 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/util/IFrame.designtime.js +26 -0
- package/src/sap/ui/fl/designtime/util/editIFrame.js +8 -5
- package/src/sap/ui/fl/initial/_internal/FlexConfiguration.js +1 -1
- package/src/sap/ui/fl/initial/_internal/Storage.js +5 -2
- 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 +1 -1
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +1 -1
- package/src/sap/ui/fl/initial/_internal/connectors/KeyUserConnector.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 +43 -43
- package/src/sap/ui/fl/messagebundle_sh.properties +9 -9
- 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/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/apps/contentbrowser/view/ContentDetails.view.xml +0 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/view/ContentDetailsEdit.view.xml +0 -1
- package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
- package/src/sap/ui/fl/util/IFrame.js +51 -64
- package/src/sap/ui/fl/util/IFrameRenderer.js +15 -9
- 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 +5 -5
- package/src/sap/ui/fl/write/_internal/Storage.js +1 -1
- package/src/sap/ui/fl/write/_internal/Versions.js +1 -1
- 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 +2 -2
- 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/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 +1 -1
- 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/delegates/ODataV2ReadDelegate.js +5 -5
- 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 +12 -23
- 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 +63 -95
- package/src/sap/ui/fl/write/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +2 -1
- 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/LocalResetAPI.js +9 -8
- package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +3 -7
- package/src/sap/ui/fl/write/api/SACIntegrationUpdateVariant.js +78 -0
- package/src/sap/ui/fl/write/api/connectors/ObjectStorageConnector.js +9 -1
- package/src/sap/ui/fl/apply/_internal/DelegateMediatorNew.js +0 -193
- package/src/sap/ui/fl/apply/_internal/flexState/appDescriptorChanges/prepareAppDescriptorMap.js +0 -39
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/base/util/restricted/_omit",
|
|
9
9
|
"sap/ui/fl/apply/_internal/flexObjects/States",
|
|
10
|
+
"sap/ui/fl/apply/_internal/flexState/changes/UIChangesState",
|
|
10
11
|
"sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger",
|
|
11
12
|
"sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState",
|
|
12
13
|
"sap/ui/fl/apply/_internal/flexState/FlexState",
|
|
13
14
|
"sap/ui/fl/apply/_internal/flexState/ManifestUtils",
|
|
14
|
-
"sap/ui/fl/apply/api/ControlVariantApplyAPI",
|
|
15
15
|
"sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState",
|
|
16
16
|
"sap/ui/fl/write/_internal/Versions",
|
|
17
17
|
"sap/ui/fl/FlexControllerFactory",
|
|
@@ -21,11 +21,11 @@ sap.ui.define([
|
|
|
21
21
|
], function(
|
|
22
22
|
_omit,
|
|
23
23
|
States,
|
|
24
|
+
UIChangesState,
|
|
24
25
|
CompVariantMerger,
|
|
25
26
|
VariantManagementState,
|
|
26
27
|
FlexState,
|
|
27
28
|
ManifestUtils,
|
|
28
|
-
ControlVariantApplyAPI,
|
|
29
29
|
CompVariantState,
|
|
30
30
|
Versions,
|
|
31
31
|
FlexControllerFactory,
|
|
@@ -39,43 +39,44 @@ sap.ui.define([
|
|
|
39
39
|
* @namespace
|
|
40
40
|
* @alias sap.ui.fl.write._internal.flexState.FlexObjectState
|
|
41
41
|
* @since 1.83
|
|
42
|
-
* @version 1.
|
|
42
|
+
* @version 1.124.1
|
|
43
43
|
* @private
|
|
44
44
|
* @ui5-restricted sap.ui.fl
|
|
45
45
|
*/
|
|
46
46
|
var FlexObjectState = {};
|
|
47
47
|
|
|
48
48
|
function getCompVariantEntities(mPropertyBag) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (oDataToRestore) {
|
|
55
|
-
Object.keys(oDataToRestore).forEach(function(sPersistencyKey) {
|
|
56
|
-
mCompEntities._initialize(
|
|
57
|
-
sPersistencyKey,
|
|
58
|
-
oDataToRestore[sPersistencyKey].variants,
|
|
59
|
-
oDataToRestore[sPersistencyKey].controlId
|
|
60
|
-
);
|
|
61
|
-
CompVariantMerger.merge(
|
|
62
|
-
sPersistencyKey,
|
|
63
|
-
mCompEntities[sPersistencyKey],
|
|
64
|
-
oDataToRestore[sPersistencyKey].standardVariant
|
|
65
|
-
);
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
for (var sPersistencyKey in mCompEntities) {
|
|
71
|
-
var mCompVariantsOfPersistencyKey = mCompEntities[sPersistencyKey];
|
|
72
|
-
for (var sId in mCompVariantsOfPersistencyKey.byId) {
|
|
49
|
+
const aEntities = [];
|
|
50
|
+
const mCompEntities = FlexState.getCompVariantsMap(mPropertyBag.reference);
|
|
51
|
+
for (const sPersistencyKey in mCompEntities) {
|
|
52
|
+
const mCompVariantsOfPersistencyKey = mCompEntities[sPersistencyKey];
|
|
53
|
+
for (const sId in mCompVariantsOfPersistencyKey.byId) {
|
|
73
54
|
aEntities.push(mCompVariantsOfPersistencyKey.byId[sId]);
|
|
74
55
|
}
|
|
75
56
|
}
|
|
76
57
|
return LayerUtils.filterChangeOrChangeDefinitionsByCurrentLayer(aEntities, mPropertyBag.currentLayer);
|
|
77
58
|
}
|
|
78
59
|
|
|
60
|
+
// Enhance CompVariantsMap with external data and standard variant after FlexState was cleared and reinitialized
|
|
61
|
+
function updateCompEntities(mPropertyBag) {
|
|
62
|
+
const mCompEntities = FlexState.getCompVariantsMap(mPropertyBag.reference);
|
|
63
|
+
const oDataToRestore = FlexState.getInitialNonFlCompVariantData(mPropertyBag.reference);
|
|
64
|
+
if (oDataToRestore) {
|
|
65
|
+
Object.keys(oDataToRestore).forEach(function(sPersistencyKey) {
|
|
66
|
+
mCompEntities._initialize(
|
|
67
|
+
sPersistencyKey,
|
|
68
|
+
oDataToRestore[sPersistencyKey].variants,
|
|
69
|
+
oDataToRestore[sPersistencyKey].controlId
|
|
70
|
+
);
|
|
71
|
+
CompVariantMerger.merge(
|
|
72
|
+
sPersistencyKey,
|
|
73
|
+
mCompEntities[sPersistencyKey],
|
|
74
|
+
oDataToRestore[sPersistencyKey].standardVariant
|
|
75
|
+
);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
79
80
|
function saveCompEntities(mPropertyBag) {
|
|
80
81
|
var sReference = ManifestUtils.getFlexReferenceForControl(mPropertyBag.selector);
|
|
81
82
|
return CompVariantState.persistAll(sReference);
|
|
@@ -86,67 +87,6 @@ sap.ui.define([
|
|
|
86
87
|
return ChangePersistenceFactory.getChangePersistenceForComponent(mPropertyBag.reference);
|
|
87
88
|
}
|
|
88
89
|
|
|
89
|
-
/**
|
|
90
|
-
* Removes variant-dependent changes belonging to variants which are currently not selected
|
|
91
|
-
*
|
|
92
|
-
* @param {array} aChanges - List of changes to check
|
|
93
|
-
* @param {sap.ui.fl.Control} oControl - Control for which the changes are being checked
|
|
94
|
-
* @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} List of variant-dependent changes belonging to the currently selected variants
|
|
95
|
-
*/
|
|
96
|
-
function filterChangesByCurrentVariants(aChanges, oControl) {
|
|
97
|
-
// 1. Get current variant references
|
|
98
|
-
var oComponent = Utils.getAppComponentForControl(oControl);
|
|
99
|
-
var oModel = oComponent.getModel(ControlVariantApplyAPI.getVariantModelName());
|
|
100
|
-
var aVariantManagementReferences;
|
|
101
|
-
if (oModel) {
|
|
102
|
-
var sFlexReference = oModel && oModel.sFlexReference;
|
|
103
|
-
aVariantManagementReferences = VariantManagementState.getVariantManagementReferences(sFlexReference);
|
|
104
|
-
} else {
|
|
105
|
-
aVariantManagementReferences = [];
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (aVariantManagementReferences.length === 0) {
|
|
109
|
-
return aChanges;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
var aCurrentVariantReferences = aVariantManagementReferences.map(function(sVMReference) {
|
|
113
|
-
return oModel.getCurrentVariantReference(sVMReference);
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
// 2. Remove variant-dependent changes not assigned to a current variant reference
|
|
117
|
-
// only changes of type 'change' are relevant for this filter
|
|
118
|
-
// 'ctrl_variants' also have a variant reference, but should not be filtered
|
|
119
|
-
return aChanges.filter(function(oChange) {
|
|
120
|
-
return oChange.getFileType() !== "change"
|
|
121
|
-
|| aCurrentVariantReferences.some(function(sCurrentVariantReference) {
|
|
122
|
-
return oChange.getVariantReference() === sCurrentVariantReference
|
|
123
|
-
|| !oChange.getVariantReference();
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function getChangePersistenceEntities(mPropertyBag) {
|
|
129
|
-
var oChangePersistence = getChangePersistence(mPropertyBag);
|
|
130
|
-
|
|
131
|
-
return oChangePersistence.getChangesForComponent(_omit(mPropertyBag, ["invalidateCache", "selector"]), mPropertyBag.invalidateCache)
|
|
132
|
-
.then(function(aPersistedChanges) {
|
|
133
|
-
var aDirtyChanges = [];
|
|
134
|
-
if (mPropertyBag.includeDirtyChanges) {
|
|
135
|
-
aDirtyChanges = oChangePersistence.getDirtyChanges();
|
|
136
|
-
if (mPropertyBag.currentLayer) {
|
|
137
|
-
aDirtyChanges = aDirtyChanges.filter(function(oChange) {
|
|
138
|
-
return oChange.getLayer() === mPropertyBag.currentLayer;
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
var aChanges = aPersistedChanges.concat(aDirtyChanges);
|
|
143
|
-
if (mPropertyBag.onlyCurrentVariants) {
|
|
144
|
-
return filterChangesByCurrentVariants(aChanges, mPropertyBag.selector);
|
|
145
|
-
}
|
|
146
|
-
return aChanges;
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
|
|
150
90
|
function saveChangePersistenceEntities(mPropertyBag, oAppComponent) {
|
|
151
91
|
var oFlexController = FlexControllerFactory.createForSelector(mPropertyBag.selector);
|
|
152
92
|
|
|
@@ -177,18 +117,47 @@ sap.ui.define([
|
|
|
177
117
|
*
|
|
178
118
|
* @param {object} mPropertyBag - Object with parameters as properties
|
|
179
119
|
* @param {sap.ui.fl.Selector} mPropertyBag.selector - Retrieves the associated flex persistence
|
|
180
|
-
* @param {string} [mPropertyBag.layer] - Specifies a single layer for loading change; if this parameter is set, the max layer filtering is not applied
|
|
181
120
|
* @param {string} [mPropertyBag.currentLayer] - Specifies a single layer to filtering changes (without filtering ctrl variant changes)
|
|
182
121
|
* @param {boolean} [mPropertyBag.invalidateCache] - Flag if the cache should be invalidated
|
|
183
|
-
* @param {boolean} [mPropertyBag.includeCtrlVariants] - Flag if control variant changes should be included
|
|
184
|
-
* @param {boolean} [mPropertyBag.
|
|
185
|
-
* @param {boolean} [mPropertyBag.version] - The version for which the objects are retrieved
|
|
122
|
+
* @param {boolean} [mPropertyBag.includeCtrlVariants] - Flag if all control variant changes should be included - otherwise only initially applied UIChanges are included
|
|
123
|
+
* @param {boolean} [mPropertyBag.onlyCurrentVariants] - Flag if only current variants should be included. Is only considered if includeCtrlVariants is true
|
|
124
|
+
* @param {boolean} [mPropertyBag.version] - The version for which the objects are retrieved if the Cache should be invalidated
|
|
186
125
|
* @returns {Promise<sap.ui.fl.apply._internal.flexObjects.FlexObject[]>} Flex objects, containing changes, compVariants & changes as well as ctrl_variant and changes
|
|
187
126
|
*/
|
|
188
127
|
FlexObjectState.getFlexObjects = async function(mPropertyBag) {
|
|
189
128
|
mPropertyBag.reference = ManifestUtils.getFlexReferenceForControl(mPropertyBag.selector);
|
|
190
|
-
|
|
191
|
-
|
|
129
|
+
if (mPropertyBag.invalidateCache) {
|
|
130
|
+
await FlexState.update(mPropertyBag);
|
|
131
|
+
updateCompEntities(mPropertyBag);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
let aRelevantFlexObjects = UIChangesState.getVariantIndependentUIChanges(mPropertyBag.reference);
|
|
135
|
+
|
|
136
|
+
// getInitialUIChanges will only add variant related UIChanges from the initial variants,
|
|
137
|
+
// with includeCtrlVariants set all variant related flex objects are added
|
|
138
|
+
// onlyCurrentVariants is only valid in combination with includeCtrlVariants,
|
|
139
|
+
// will add all variants, all variant management changes, and all UIChanges of all initial variants
|
|
140
|
+
if (!mPropertyBag.includeCtrlVariants) {
|
|
141
|
+
aRelevantFlexObjects = aRelevantFlexObjects.concat(
|
|
142
|
+
VariantManagementState.getInitialUIChanges({reference: mPropertyBag.reference, includeDirtyChanges: true})
|
|
143
|
+
);
|
|
144
|
+
} else if (!mPropertyBag.onlyCurrentVariants) {
|
|
145
|
+
aRelevantFlexObjects = aRelevantFlexObjects.concat(
|
|
146
|
+
VariantManagementState.getVariantDependentFlexObjects(mPropertyBag.reference)
|
|
147
|
+
);
|
|
148
|
+
} else {
|
|
149
|
+
aRelevantFlexObjects = aRelevantFlexObjects.concat(
|
|
150
|
+
VariantManagementState.getAllCurrentFlexObjects({reference: mPropertyBag.reference})
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (mPropertyBag.currentLayer) {
|
|
155
|
+
aRelevantFlexObjects = aRelevantFlexObjects.filter((oFlexObject) => {
|
|
156
|
+
return oFlexObject.getLayer() === mPropertyBag.currentLayer;
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return aRelevantFlexObjects.concat(getCompVariantEntities(mPropertyBag));
|
|
192
161
|
};
|
|
193
162
|
|
|
194
163
|
/**
|
|
@@ -197,7 +166,6 @@ sap.ui.define([
|
|
|
197
166
|
*
|
|
198
167
|
* @param {object} mPropertyBag - Object with parameters as properties
|
|
199
168
|
* @param {sap.ui.fl.Selector} mPropertyBag.selector - Retrieves the associated flex persistence
|
|
200
|
-
* @param {boolean} mPropertyBag.invalidateCache - Flag if the cache should be invalidated
|
|
201
169
|
* @param {boolean} mPropertyBag.includeCtrlVariants - Flag if control variant changes should be included
|
|
202
170
|
* @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} Flex objects, containing changes, compVariants & changes as well as ctrl_variant and changes
|
|
203
171
|
*/
|
|
@@ -291,7 +291,7 @@ sap.ui.define([
|
|
|
291
291
|
*
|
|
292
292
|
* @namespace sap.ui.fl.write._internal.flexState.compVariants.CompVariantState
|
|
293
293
|
* @since 1.83
|
|
294
|
-
* @version 1.
|
|
294
|
+
* @version 1.124.1
|
|
295
295
|
* @private
|
|
296
296
|
* @ui5-restricted sap.ui.fl
|
|
297
297
|
*/
|
|
@@ -607,6 +607,7 @@ sap.ui.define([
|
|
|
607
607
|
|
|
608
608
|
var oVariant = getVariantById(mPropertyBag);
|
|
609
609
|
var sLayer = determineLayer(mPropertyBag);
|
|
610
|
+
mPropertyBag.layer ||= sLayer;
|
|
610
611
|
|
|
611
612
|
if (mPropertyBag.forceCreate) {
|
|
612
613
|
createChange(mPropertyBag, oVariant);
|
|
@@ -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.124.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.124.1
|
|
31
31
|
* @since 1.74.0
|
|
32
32
|
* @private
|
|
33
33
|
* @ui5-restricted sap.ui.fl.write._internal.transport
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/ui/fl/apply/_internal/flexObjects/States",
|
|
9
|
+
"sap/ui/fl/apply/_internal/flexState/changes/UIChangesState",
|
|
10
|
+
"sap/ui/fl/apply/_internal/flexState/ManifestUtils",
|
|
9
11
|
"sap/ui/fl/write/api/PersistenceWriteAPI",
|
|
10
12
|
"sap/ui/fl/write/api/ChangesWriteAPI",
|
|
11
13
|
"sap/ui/core/util/reflection/JsControlTreeModifier",
|
|
@@ -14,6 +16,8 @@ sap.ui.define([
|
|
|
14
16
|
"sap/base/util/restricted/_union"
|
|
15
17
|
], function(
|
|
16
18
|
States,
|
|
19
|
+
UIChangesState,
|
|
20
|
+
ManifestUtils,
|
|
17
21
|
PersistenceWriteAPI,
|
|
18
22
|
ChangesWriteAPI,
|
|
19
23
|
JsControlTreeModifier,
|
|
@@ -34,16 +38,13 @@ sap.ui.define([
|
|
|
34
38
|
var LocalResetAPI = /** @lends sap.ui.fl.write.api.LocalResetAPI */ {};
|
|
35
39
|
|
|
36
40
|
function getAllChanges(oControl, sLayer, sCurrentVariant) {
|
|
37
|
-
|
|
38
|
-
includeDirtyChanges: true,
|
|
39
|
-
layer: sLayer
|
|
40
|
-
};
|
|
41
|
-
var oChangePersistence = ChangePersistenceFactory.getChangePersistenceForControl(oControl);
|
|
42
|
-
return oChangePersistence.getAllUIChanges(mPropertyBag)
|
|
41
|
+
return UIChangesState.getAllUIChanges(ManifestUtils.getFlexReferenceForControl(oControl))
|
|
43
42
|
.filter(function(oChange) {
|
|
44
43
|
return (
|
|
45
|
-
oChange.
|
|
46
|
-
|
|
44
|
+
oChange.getFileType() === "change"
|
|
45
|
+
&& oChange.getLayer() === sLayer
|
|
46
|
+
&& oChange.getState() !== States.LifecycleState.DELETED
|
|
47
|
+
&& oChange.getVariantReference() === (sCurrentVariant || undefined)
|
|
47
48
|
);
|
|
48
49
|
});
|
|
49
50
|
}
|
|
@@ -76,7 +76,6 @@ sap.ui.define([
|
|
|
76
76
|
*/
|
|
77
77
|
function hasChanges(mPropertyBag) {
|
|
78
78
|
mPropertyBag.includeCtrlVariants = true;
|
|
79
|
-
mPropertyBag.invalidateCache = false;
|
|
80
79
|
return PersistenceWriteAPI._getUIChanges(mPropertyBag)
|
|
81
80
|
.then(function(aChanges) {
|
|
82
81
|
return aChanges.length > 0;
|
|
@@ -384,14 +383,11 @@ sap.ui.define([
|
|
|
384
383
|
*
|
|
385
384
|
* @param {object} mPropertyBag - Object with parameters as properties
|
|
386
385
|
* @param {sap.ui.fl.Selector} mPropertyBag.selector - Retrieves the associated flex persistence
|
|
387
|
-
* @param {string} [mPropertyBag.layer] - Layer for which changes
|
|
388
|
-
* @param {string} [mPropertyBag.generator] - Generator of changes
|
|
389
|
-
* @param {string[]} [mPropertyBag.selectorIds] - Selector IDs in local format
|
|
390
|
-
* @param {string[]} [mPropertyBag.changeTypes] - Types of changes
|
|
386
|
+
* @param {string} [mPropertyBag.layer] - Layer for which changes should be checked
|
|
391
387
|
* @returns {Promise} Resolves with object that decides if warning should be shown
|
|
392
388
|
*
|
|
393
389
|
*/
|
|
394
|
-
|
|
390
|
+
PersistenceWriteAPI.getChangesWarning = function(mPropertyBag) {
|
|
395
391
|
return this._getUIChanges(mPropertyBag).then(function(aChanges) {
|
|
396
392
|
var bHasChangesFromOtherSystem = aChanges.some(function(oChange) {
|
|
397
393
|
return oChange.isChangeFromOtherSystem();
|
|
@@ -452,7 +448,6 @@ sap.ui.define([
|
|
|
452
448
|
* @param {boolean} [mPropertyBag.includeCtrlVariants] - Flag if control variant changes should be included
|
|
453
449
|
* @param {boolean} [mPropertyBag.includeDirtyChanges] - Flag if dirty UI changes should be included
|
|
454
450
|
* @param {string} [mPropertyBag.cacheKey] - Key to validate the cache entry stored on client side
|
|
455
|
-
* @param {boolean} [mPropertyBag.invalidateCache] - Indicates whether the cache is to be invalidated
|
|
456
451
|
* @param {boolean} [mPropertyBag.onlyCurrentVariants] - Whether only changes for the currently active variants should be considered
|
|
457
452
|
*
|
|
458
453
|
* @returns {Promise} Promise resolves with an array of all change instances {@see sap.ui.fl.apply._internal.flexObjects.FlexObject}
|
|
@@ -464,6 +459,7 @@ sap.ui.define([
|
|
|
464
459
|
mPropertyBag.currentLayer = mPropertyBag.layer;
|
|
465
460
|
}
|
|
466
461
|
|
|
462
|
+
mPropertyBag.invalidateCache = false;
|
|
467
463
|
// TODO: Check the mPropertyBag.selector parameter name - the methods called on FlexObjectState expect a control
|
|
468
464
|
return FlexObjectState.getFlexObjects(mPropertyBag);
|
|
469
465
|
};
|
|
@@ -0,0 +1,78 @@
|
|
|
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/write/_internal/flexState/compVariants/CompVariantState",
|
|
9
|
+
"sap/ui/fl/apply/_internal/flexState/ManifestUtils",
|
|
10
|
+
"sap/ui/fl/apply/_internal/flexState/compVariants/Utils",
|
|
11
|
+
"sap/ui/fl/apply/_internal/flexState/FlexState",
|
|
12
|
+
"sap/ui/fl/Layer"
|
|
13
|
+
], function(
|
|
14
|
+
CompVariantState,
|
|
15
|
+
ManifestUtils,
|
|
16
|
+
CompVariantUtils,
|
|
17
|
+
FlexState,
|
|
18
|
+
Layer
|
|
19
|
+
) {
|
|
20
|
+
"use strict";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Provides an API for SAC Integration to update variants of the app <code>sap.ui.comp.smartVariant.SmartVariantManagement</code> programmatically.
|
|
24
|
+
*
|
|
25
|
+
* @function
|
|
26
|
+
* @alias module:sap/ui/fl/write/api/flexState/SacIntegrationAPIupdateVariant
|
|
27
|
+
* @since 1.124
|
|
28
|
+
* @deprecated Since 1.124
|
|
29
|
+
* @private
|
|
30
|
+
* @ui5-restricted ui.cloudfnd.sac.integration.s1
|
|
31
|
+
*
|
|
32
|
+
* @param {object} mPropertyBag - Object with parameters as properties
|
|
33
|
+
* @param {string} mPropertyBag.id - ID of variant
|
|
34
|
+
* @param {sap.ui.comp.smartvariants.SmartVariantManagement} mPropertyBag.control - Variant management control in which the variant exists
|
|
35
|
+
* @param {object} mPropertyBag.content - New content of the variant
|
|
36
|
+
*
|
|
37
|
+
* @returns {Promise} Promise which gets resolved after the update and save operation was completed or gets rejected with a first error
|
|
38
|
+
* @private
|
|
39
|
+
* @ui5-restricted ui.cloudfnd.sac.integration.s1
|
|
40
|
+
*/
|
|
41
|
+
return (mPropertyBag) => {
|
|
42
|
+
if (!mPropertyBag) {
|
|
43
|
+
return Promise.reject("A property bag must be provided");
|
|
44
|
+
}
|
|
45
|
+
if (!mPropertyBag.control) {
|
|
46
|
+
return Promise.reject("variant management control must be provided");
|
|
47
|
+
}
|
|
48
|
+
if (!mPropertyBag.id) {
|
|
49
|
+
return Promise.reject("variant ID must be provided");
|
|
50
|
+
}
|
|
51
|
+
if (!mPropertyBag.content) {
|
|
52
|
+
return Promise.reject("content must be provided");
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
mPropertyBag.reference = ManifestUtils.getFlexReferenceForControl(mPropertyBag.control);
|
|
56
|
+
mPropertyBag.persistencyKey = CompVariantUtils.getPersistencyKey(mPropertyBag.control);
|
|
57
|
+
|
|
58
|
+
const aFlexObjects = FlexState.getFlexObjectsDataSelector().get(mPropertyBag);
|
|
59
|
+
const oVariant = aFlexObjects.find((oFlexObject) => oFlexObject.getId() === mPropertyBag.id);
|
|
60
|
+
|
|
61
|
+
if (oVariant?.getFileType() !== "variant") {
|
|
62
|
+
return Promise.reject("no variant with the ID found");
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
mPropertyBag.layer = oVariant.getLayer();
|
|
66
|
+
|
|
67
|
+
if (![Layer.USER, Layer.PUBLIC].includes(mPropertyBag.layer)) {
|
|
68
|
+
return Promise.reject("only variants in the USER and PUBLIC layer can be updated");
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (!oVariant.isEditEnabled()) {
|
|
72
|
+
return Promise.reject("the user is not authorized to edit the PUBLIC variant (no author nor key user)");
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
CompVariantState.updateVariant(mPropertyBag);
|
|
76
|
+
return CompVariantState.persist(mPropertyBag);
|
|
77
|
+
};
|
|
78
|
+
});
|
|
@@ -278,8 +278,16 @@ sap.ui.define([
|
|
|
278
278
|
/**
|
|
279
279
|
* @inheritDoc
|
|
280
280
|
*/
|
|
281
|
-
update(mPropertyBag) {
|
|
281
|
+
async update(mPropertyBag) {
|
|
282
282
|
var oFlexObject = mPropertyBag.flexObject;
|
|
283
|
+
if (mFeatures.isVersioningEnabled && mPropertyBag.layer === Layer.CUSTOMER) {
|
|
284
|
+
mPropertyBag.reference = oFlexObject.reference;
|
|
285
|
+
const aVersions = await this.versions.load.call(this, mPropertyBag);
|
|
286
|
+
const sDraftVersionId = aVersions.find((oVersion) => oVersion.isDraft)?.id;
|
|
287
|
+
if (sDraftVersionId) {
|
|
288
|
+
oFlexObject.version = sDraftVersionId;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
283
291
|
var sKey = ObjectStorageUtils.createFlexObjectKey(mPropertyBag.flexObject);
|
|
284
292
|
var vFlexObject = this.storage._itemsStoredAsObjects ? oFlexObject : JSON.stringify(oFlexObject);
|
|
285
293
|
var vSetResponse = this.storage.setItem(sKey, vFlexObject);
|