@openui5/sap.ui.fl 1.139.0 → 1.141.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/.eslint-rules/import-check.js +71 -0
- package/THIRDPARTY.txt +2 -2
- package/package.json +3 -3
- package/src/sap/ui/fl/.library +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/LayerUtils.js +1 -1
- package/src/sap/ui/fl/Utils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +13 -3
- package/src/sap/ui/fl/apply/_internal/changes/Applier.js +3 -2
- package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/Reverter.js +4 -1
- package/src/sap/ui/fl/apply/_internal/changes/Utils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +2 -2
- 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/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 +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/controlVariants/URLHandler.js +14 -12
- package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +2 -2
- 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 +13 -10
- 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 +2 -2
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +2 -8
- package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexObjects/VariantChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/VariantManagementChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor.js +6 -3
- package/src/sap/ui/fl/apply/_internal/flexState/DataSelector.js +5 -5
- package/src/sap/ui/fl/apply/_internal/flexState/FlexObjectState.js +12 -26
- package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +68 -229
- package/src/sap/ui/fl/apply/_internal/flexState/InitialPrepareFunctions.js +0 -8
- 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 +3 -3
- package/src/sap/ui/fl/apply/_internal/flexState/changes/UIChangesState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/communication/FLPAboutInfo.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantManagementState.js +287 -10
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/applyChangesOnVariant.js +61 -0
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +22 -5
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +72 -19
- package/src/sap/ui/fl/apply/_internal/init.js +47 -0
- package/src/sap/ui/fl/apply/_internal/preprocessors/ComponentLifecycleHooks.js +17 -7
- package/src/sap/ui/fl/apply/api/AnnotationChangeHandlerAPI.js +2 -1
- package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +190 -53
- package/src/sap/ui/fl/apply/api/DelegateMediatorAPI.js +17 -1
- package/src/sap/ui/fl/apply/api/ExtensionPointRegistryAPI.js +2 -1
- package/src/sap/ui/fl/apply/api/FlexRuntimeInfoAPI.js +6 -5
- package/src/sap/ui/fl/apply/api/SmartVariantManagementApplyAPI.js +45 -45
- package/src/sap/ui/fl/apply/api/UI2PersonalizationApplyAPI.js +2 -1
- package/src/sap/ui/fl/changeHandler/AddIFrame.js +1 -1
- package/src/sap/ui/fl/changeHandler/AddXML.js +2 -2
- package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +4 -4
- package/src/sap/ui/fl/changeHandler/Base.js +3 -2
- package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseAddXml.js +21 -9
- package/src/sap/ui/fl/changeHandler/BaseRename.js +1 -1
- package/src/sap/ui/fl/changeHandler/ChangeAnnotation.js +7 -2
- 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/changeHandler/common/createIFrame.js +1 -4
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorChange.js +3 -3
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +3 -3
- 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 +14 -12
- package/src/sap/ui/fl/initial/_internal/FlexConfiguration.js +1 -1
- package/src/sap/ui/fl/initial/_internal/Loader.js +372 -0
- package/src/sap/ui/fl/{apply/_internal/flexState → initial/_internal}/ManifestUtils.js +1 -1
- package/src/sap/ui/fl/initial/_internal/Settings.js +1 -1
- package/src/sap/ui/fl/initial/_internal/Storage.js +1 -1
- package/src/sap/ui/fl/initial/_internal/StorageFeaturesMerger.js +1 -1
- package/src/sap/ui/fl/initial/_internal/StorageUtils.js +67 -9
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration.js +1 -1
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +12 -5
- package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +1 -1
- package/src/sap/ui/fl/{apply → initial}/_internal/preprocessors/ControllerExtension.js +16 -5
- package/src/sap/ui/fl/{apply → initial}/_internal/preprocessors/RegistrationDelegator.js +9 -40
- package/src/sap/ui/fl/{apply → initial}/_internal/preprocessors/XmlPreprocessor.js +29 -21
- package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +1 -1
- package/src/sap/ui/fl/initial/api/InitialFlexAPI.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 +44 -44
- package/src/sap/ui/fl/messagebundle_vi.properties +1 -1
- package/src/sap/ui/fl/support/_internal/extractChangeDependencies.js +1 -1
- package/src/sap/ui/fl/support/_internal/getAllUIChanges.js +2 -2
- package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +1 -1
- package/src/sap/ui/fl/support/_internal/getFlexObjectInfos.js +2 -2
- 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/IFrame.js +5 -4
- package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
- package/src/sap/ui/fl/variants/VariantManagement.js +88 -36
- package/src/sap/ui/fl/variants/VariantManager.js +81 -21
- package/src/sap/ui/fl/variants/VariantModel.js +38 -189
- package/src/sap/ui/fl/write/_internal/SaveAs.js +1 -1
- package/src/sap/ui/fl/write/_internal/Storage.js +14 -1
- package/src/sap/ui/fl/write/_internal/Versions.js +9 -5
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +10 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +6 -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/BtpServiceConnector.js +27 -2
- package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +4 -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/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 +40 -71
- package/src/sap/ui/fl/write/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +3 -3
- package/src/sap/ui/fl/write/_internal/flexState/changes/UIChangeManager.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/{CompVariantState.js → CompVariantManager.js} +176 -309
- package/src/sap/ui/fl/write/_internal/init.js +27 -0
- package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +2 -2
- package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -1
- package/src/sap/ui/fl/write/api/Adaptations.js +1 -1
- package/src/sap/ui/fl/write/api/AppVariantWriteAPI.js +4 -2
- package/src/sap/ui/fl/write/api/BusinessNetworkAPI.js +60 -26
- package/src/sap/ui/fl/write/api/ChangesWriteAPI.js +4 -3
- package/src/sap/ui/fl/write/api/ContextBasedAdaptationsAPI.js +19 -23
- package/src/sap/ui/fl/write/api/ContextSharingAPI.js +3 -2
- package/src/sap/ui/fl/write/api/ControlPersonalizationWriteAPI.js +2 -1
- package/src/sap/ui/fl/write/api/FeaturesAPI.js +2 -1
- package/src/sap/ui/fl/write/api/FieldExtensibility.js +3 -2
- package/src/sap/ui/fl/write/api/LocalResetAPI.js +3 -2
- package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +23 -20
- package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +10 -7
- package/src/sap/ui/fl/write/api/SACIntegrationUpdateVariant.js +8 -7
- package/src/sap/ui/fl/write/api/SmartBusinessWriteAPI.js +3 -2
- package/src/sap/ui/fl/write/api/SmartVariantManagementWriteAPI.js +26 -22
- package/src/sap/ui/fl/write/api/TranslationAPI.js +3 -2
- package/src/sap/ui/fl/write/api/UI2PersonalizationWriteAPI.js +4 -3
- package/src/sap/ui/fl/write/api/VersionsAPI.js +4 -3
- package/src/sap/ui/fl/write/api/connectors/FileListBaseConnector.js +3 -2
- package/src/sap/ui/fl/write/api/connectors/ObjectStorageConnector.js +4 -2
- package/src/sap/ui/fl/write/connectors/BaseConnector.js +13 -0
- package/ui5.yaml +0 -1
- package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +0 -208
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +0 -233
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/prepareCompVariantsMap.js +0 -118
- package/src/sap/ui/fl/util/resolveBinding.js +0 -79
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* OpenUI5
|
|
3
|
-
* (c) Copyright 2025 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/flexObjects/CompVariant",
|
|
9
|
-
"sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory",
|
|
10
|
-
"sap/ui/fl/apply/_internal/flexObjects/States",
|
|
11
|
-
"sap/ui/fl/apply/_internal/flexState/compVariants/Utils",
|
|
12
|
-
"sap/base/Log"
|
|
13
|
-
], function(
|
|
14
|
-
CompVariant,
|
|
15
|
-
FlexObjectFactory,
|
|
16
|
-
States,
|
|
17
|
-
CompVariantUtils,
|
|
18
|
-
Log
|
|
19
|
-
) {
|
|
20
|
-
"use strict";
|
|
21
|
-
|
|
22
|
-
var mChangeHandlers = {
|
|
23
|
-
addFavorite(oVariant) {
|
|
24
|
-
oVariant.setFavorite(true);
|
|
25
|
-
},
|
|
26
|
-
removeFavorite(oVariant) {
|
|
27
|
-
oVariant.setFavorite(false);
|
|
28
|
-
},
|
|
29
|
-
updateVariant(oVariant, oChange) {
|
|
30
|
-
var oChangeContent = oChange.getContent();
|
|
31
|
-
if (oChangeContent.executeOnSelection !== undefined) {
|
|
32
|
-
oVariant.setExecuteOnSelection(oChangeContent.executeOnSelection);
|
|
33
|
-
}
|
|
34
|
-
if (oChangeContent.favorite !== undefined) {
|
|
35
|
-
oVariant.setFavorite(oChangeContent.favorite);
|
|
36
|
-
}
|
|
37
|
-
if (oChangeContent.contexts) {
|
|
38
|
-
oVariant.setContexts(oChangeContent.contexts);
|
|
39
|
-
}
|
|
40
|
-
if (oChangeContent.visible !== undefined) {
|
|
41
|
-
oVariant.setVisible(oChangeContent.visible);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (oChangeContent.variantContent) {
|
|
45
|
-
oVariant.setContent(oChangeContent.variantContent, /* bSkipStateChange = */ true);
|
|
46
|
-
}
|
|
47
|
-
var sVariantName = oChange.getText("variantName");
|
|
48
|
-
if (sVariantName) {
|
|
49
|
-
oVariant.setName(sVariantName, /* bSkipStateChange = */ true);
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
standardVariant(oVariant, oChange) {
|
|
53
|
-
// legacy change on standard variants
|
|
54
|
-
oVariant.setExecuteOnSelection(oChange.getContent().executeOnSelect);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
function getChangesMappedByVariant(mCompVariants) {
|
|
59
|
-
var mChanges = {};
|
|
60
|
-
|
|
61
|
-
mCompVariants.changes.forEach(function(oChange) {
|
|
62
|
-
var sVariantId = oChange.getSelector().variantId || oChange.getContent().key;
|
|
63
|
-
mChanges[sVariantId] ||= [];
|
|
64
|
-
|
|
65
|
-
mChanges[sVariantId].push(oChange);
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
return mChanges;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function logNoChangeHandler(oVariant, oChange) {
|
|
72
|
-
Log.error(`No change handler for change with the ID '${oChange.getId()}' and type '${oChange.getChangeType()}' defined.
|
|
73
|
-
The variant '${oVariant.getId()}'was not modified'`);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function createVariant(sPersistencyKey, oVariantInput, mAuthors) {
|
|
77
|
-
var oVariantData = {
|
|
78
|
-
fileName: oVariantInput.fileName,
|
|
79
|
-
variantId: oVariantInput.id || CompVariant.STANDARD_VARIANT_ID,
|
|
80
|
-
persisted: oVariantInput.persisted,
|
|
81
|
-
content: oVariantInput.content || {},
|
|
82
|
-
texts: {
|
|
83
|
-
variantName: {
|
|
84
|
-
value: oVariantInput.name || ""
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
selector: {
|
|
88
|
-
persistencyKey: sPersistencyKey
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
if (oVariantInput.favorite !== undefined) {
|
|
93
|
-
oVariantData.favorite = oVariantInput.favorite;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
if (oVariantInput.executeOnSelection !== undefined) {
|
|
97
|
-
oVariantData.executeOnSelection = oVariantInput.executeOnSelection;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
if (oVariantInput.adaptationId !== undefined) {
|
|
101
|
-
oVariantData.adaptationId = oVariantInput.adaptationId;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
return FlexObjectFactory.createCompVariant(oVariantData, mAuthors);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function applyChangeOnVariant(oVariant, oChange) {
|
|
108
|
-
var oChangeHandler = mChangeHandlers[oChange.getChangeType()] || logNoChangeHandler;
|
|
109
|
-
oChangeHandler(oVariant, oChange);
|
|
110
|
-
oVariant.addChange(oChange);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function applyChangesOnVariant(mChanges, oVariant) {
|
|
114
|
-
var sVariantId = oVariant.getVariantId();
|
|
115
|
-
if (mChanges[sVariantId]) {
|
|
116
|
-
mChanges[sVariantId].forEach(function(oChange) {
|
|
117
|
-
applyChangeOnVariant(oVariant, oChange);
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Class in charge of applying changes.
|
|
124
|
-
* This includes combining the variants passed on the <code>merge</code> call, sorting and applying changes.
|
|
125
|
-
*
|
|
126
|
-
* @namespace sap.ui.fl.apply._internal.flexState.compVariants.CompVariantMerger
|
|
127
|
-
* @since 1.86
|
|
128
|
-
* @version 1.139.0
|
|
129
|
-
* @private
|
|
130
|
-
* @ui5-restricted sap.ui.fl
|
|
131
|
-
*/
|
|
132
|
-
return {
|
|
133
|
-
merge(sPersistencyKey, mCompData, oStandardVariantInput) {
|
|
134
|
-
var aVariants = mCompData.nonPersistedVariants.concat(mCompData.variants);
|
|
135
|
-
var mChanges = getChangesMappedByVariant(mCompData);
|
|
136
|
-
|
|
137
|
-
// check for an overwritten standard variant
|
|
138
|
-
var oStandardVariant;
|
|
139
|
-
aVariants.forEach(function(oVariant) {
|
|
140
|
-
if (oVariant.getContent() && oVariant.getContent().standardvariant) {
|
|
141
|
-
oStandardVariant = oVariant;
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
if (!oStandardVariant) {
|
|
146
|
-
// create a new standard variant with the passed input
|
|
147
|
-
oStandardVariant = createVariant(sPersistencyKey, oStandardVariantInput);
|
|
148
|
-
} else {
|
|
149
|
-
// remove all standard variant entries
|
|
150
|
-
aVariants = aVariants.filter(function(oVariant) {
|
|
151
|
-
return !oVariant.getContent() || !oVariant.getContent().standardvariant;
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// with setting the state to persisted it is made sure that they not show up as a dirty flex object
|
|
156
|
-
(mCompData.nonPersistedVariants.concat([oStandardVariant])).forEach((oVariant) => {
|
|
157
|
-
oVariant.setState(States.LifecycleState.PERSISTED);
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
// apply all changes on non-standard variants
|
|
161
|
-
aVariants.forEach(applyChangesOnVariant.bind(undefined, mChanges));
|
|
162
|
-
|
|
163
|
-
// Remove all invisible variants
|
|
164
|
-
aVariants = aVariants.filter(function(oVariant) {
|
|
165
|
-
var bVisible = oVariant.getVisible();
|
|
166
|
-
if (!bVisible) {
|
|
167
|
-
var sVariantId = oVariant.getId();
|
|
168
|
-
delete mChanges[sVariantId];
|
|
169
|
-
delete mCompData.byId[sVariantId];
|
|
170
|
-
}
|
|
171
|
-
return bVisible;
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
// the standard must always be visible
|
|
175
|
-
oStandardVariant.setFavorite(true);
|
|
176
|
-
oStandardVariant.setStandardVariant(true);
|
|
177
|
-
mCompData.byId[oStandardVariant.getVariantId()] = oStandardVariant;
|
|
178
|
-
|
|
179
|
-
var oStandardVariantChange = mCompData.standardVariantChange;
|
|
180
|
-
if (oStandardVariantChange) {
|
|
181
|
-
mChanges[oStandardVariant.getVariantId()] = mChanges[oStandardVariant.getVariantId()] || [];
|
|
182
|
-
mChanges[oStandardVariant.getVariantId()].push(oStandardVariantChange);
|
|
183
|
-
mChanges[oStandardVariant.getVariantId()].sort(function(a, b) {
|
|
184
|
-
if (a.getCreation() < b.getCreation()) {
|
|
185
|
-
return -1;
|
|
186
|
-
}
|
|
187
|
-
if (a.getCreation() > b.getCreation()) {
|
|
188
|
-
return 1;
|
|
189
|
-
}
|
|
190
|
-
return 0;
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
applyChangesOnVariant(mChanges, oStandardVariant);
|
|
194
|
-
|
|
195
|
-
mCompData.standardVariant = oStandardVariant;
|
|
196
|
-
|
|
197
|
-
// the default variant must always be a favorite
|
|
198
|
-
// e.g. end user sets variant to default, then key user removes it from favorites
|
|
199
|
-
const sDefaultVariantId = CompVariantUtils.getDefaultVariantId(mCompData);
|
|
200
|
-
aVariants.some((oVariant) => {
|
|
201
|
-
if (!oVariant.getFavorite() && oVariant.getId() === sDefaultVariantId) {
|
|
202
|
-
oVariant.setFavorite(true);
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
return {
|
|
207
|
-
standardVariant: oStandardVariant,
|
|
208
|
-
variants: aVariants
|
|
209
|
-
};
|
|
210
|
-
},
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* Enhances Standard Variants and non-persisted variants with additional properties and
|
|
214
|
-
* creates a new CompVariant out of it.
|
|
215
|
-
*
|
|
216
|
-
* @function
|
|
217
|
-
* @since 1.89
|
|
218
|
-
* @version 1.139.0
|
|
219
|
-
* @private
|
|
220
|
-
* @ui5-restricted sap.ui.fl
|
|
221
|
-
*
|
|
222
|
-
* @param {string} sPersistencyKey - Key of the variant management
|
|
223
|
-
* @param {object} oVariantInput - Standard Variant or non-persisted Variants like oData variant
|
|
224
|
-
* @param {object} mAuthors - Map of user IDs to full names
|
|
225
|
-
*
|
|
226
|
-
* @returns {sap.ui.fl.apply._internal.flexObjects.CompVariant} The created variant object
|
|
227
|
-
*/
|
|
228
|
-
createVariant(sPersistencyKey, oVariantInput, mAuthors) {
|
|
229
|
-
return createVariant(sPersistencyKey, oVariantInput, mAuthors);
|
|
230
|
-
},
|
|
231
|
-
applyChangeOnVariant
|
|
232
|
-
};
|
|
233
|
-
});
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* OpenUI5
|
|
3
|
-
* (c) Copyright 2025 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/flexObjects/FlexObjectFactory",
|
|
9
|
-
"sap/ui/fl/apply/_internal/flexObjects/States",
|
|
10
|
-
"sap/ui/fl/apply/_internal/flexObjects/UpdatableChange",
|
|
11
|
-
"sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger"
|
|
12
|
-
], function(
|
|
13
|
-
FlexObjectFactory,
|
|
14
|
-
States,
|
|
15
|
-
UpdatableChange,
|
|
16
|
-
CompVariantMerger
|
|
17
|
-
) {
|
|
18
|
-
"use strict";
|
|
19
|
-
|
|
20
|
-
function getOrCreate(mMap, sPersistencyKey) {
|
|
21
|
-
mMap[sPersistencyKey] ||= {
|
|
22
|
-
byId: {},
|
|
23
|
-
variants: [],
|
|
24
|
-
nonPersistedVariants: [],
|
|
25
|
-
changes: [],
|
|
26
|
-
defaultVariants: [],
|
|
27
|
-
standardVariantChange: undefined,
|
|
28
|
-
standardVariant: undefined
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
return mMap[sPersistencyKey];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function initialize(mMap, mAuthors, sPersistencyKey, aVariants, sSVMControlId) {
|
|
35
|
-
aVariants ||= [];
|
|
36
|
-
const mMapOfKey = getOrCreate(mMap, sPersistencyKey);
|
|
37
|
-
mMapOfKey.controlId = sSVMControlId;
|
|
38
|
-
|
|
39
|
-
// clear all non-persisted variants in case of a reinitialization
|
|
40
|
-
mMapOfKey.nonPersistedVariants.forEach(function(oVariant) {
|
|
41
|
-
delete mMapOfKey.byId[oVariant.getId()];
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
mMapOfKey.nonPersistedVariants = aVariants.map(function(oVariant) {
|
|
45
|
-
const oVariantInstance = CompVariantMerger.createVariant(
|
|
46
|
-
sPersistencyKey,
|
|
47
|
-
{
|
|
48
|
-
id: oVariant.id,
|
|
49
|
-
persisted: false,
|
|
50
|
-
...oVariant
|
|
51
|
-
},
|
|
52
|
-
mAuthors
|
|
53
|
-
);
|
|
54
|
-
mMapOfKey.byId[oVariant.id] = oVariantInstance;
|
|
55
|
-
return oVariantInstance;
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
return mMapOfKey;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function buildSectionMap(mCompSection, sSubSection, mCompVariants, mAuthors) {
|
|
62
|
-
const aFlexObjects = mCompSection[sSubSection].map(function(oCompVariantChangeDefinition) {
|
|
63
|
-
const oFlexObject = sSubSection === "variants"
|
|
64
|
-
? FlexObjectFactory.createCompVariant(oCompVariantChangeDefinition, mAuthors)
|
|
65
|
-
: FlexObjectFactory.createFromFileContent(oCompVariantChangeDefinition, UpdatableChange);
|
|
66
|
-
oFlexObject.setState(States.LifecycleState.PERSISTED); // prevent persisting these anew
|
|
67
|
-
return oFlexObject;
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
aFlexObjects.forEach(function(oFlexObject) {
|
|
71
|
-
const sPersistencyKey = oFlexObject.getPersistencyKey
|
|
72
|
-
? oFlexObject.getPersistencyKey()
|
|
73
|
-
: oFlexObject.getSelector().persistencyKey;
|
|
74
|
-
getOrCreate(
|
|
75
|
-
mCompVariants,
|
|
76
|
-
sPersistencyKey
|
|
77
|
-
).byId[oFlexObject.getId()] = oFlexObject;
|
|
78
|
-
|
|
79
|
-
switch (sSubSection) {
|
|
80
|
-
case "standardVariants":
|
|
81
|
-
getOrCreate(mCompVariants, sPersistencyKey).standardVariantChange = oFlexObject;
|
|
82
|
-
break;
|
|
83
|
-
default:
|
|
84
|
-
getOrCreate(mCompVariants, sPersistencyKey)[sSubSection].push(oFlexObject);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Prepares the CompVariants from the flex response.
|
|
91
|
-
*
|
|
92
|
-
* @function
|
|
93
|
-
* @since 1.83
|
|
94
|
-
* @private
|
|
95
|
-
* @ui5-restricted sap/ui/fl/apply/_internal/flexState/FlexState
|
|
96
|
-
* @alias module:sap/ui/fl/apply/_internal/flexState/compVariants/prepareCompVariantsMap
|
|
97
|
-
*
|
|
98
|
-
* @param {object} mPropertyBag - Contains additional data needed for preparing the map
|
|
99
|
-
* @param {object} mPropertyBag.storageResponse - Storage response with the flex data
|
|
100
|
-
* @returns {object} The prepared map for compVariants
|
|
101
|
-
*/
|
|
102
|
-
return function(mPropertyBag) {
|
|
103
|
-
const mCompVariants = {};
|
|
104
|
-
|
|
105
|
-
// provide the function for fl-internal consumers reuse
|
|
106
|
-
mCompVariants._getOrCreate = getOrCreate.bind(undefined, mCompVariants);
|
|
107
|
-
mCompVariants._initialize = initialize.bind(undefined, mCompVariants, mPropertyBag.storageResponse.authors);
|
|
108
|
-
|
|
109
|
-
// check for the existence due to test mocks
|
|
110
|
-
if (mPropertyBag.storageResponse.changes.comp) {
|
|
111
|
-
["variants", "changes", "defaultVariants", "standardVariants"].forEach(function(sSection) {
|
|
112
|
-
buildSectionMap(mPropertyBag.storageResponse.changes.comp, sSection, mCompVariants, mPropertyBag.storageResponse.authors);
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return mCompVariants;
|
|
117
|
-
};
|
|
118
|
-
});
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* OpenUI5
|
|
3
|
-
* (c) Copyright 2025 SAP SE or an SAP affiliate company.
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
-
*/
|
|
6
|
-
sap.ui.define([
|
|
7
|
-
"sap/ui/base/BindingInfo",
|
|
8
|
-
"sap/ui/base/ManagedObject",
|
|
9
|
-
"sap/ui/fl/Utils"
|
|
10
|
-
], function(
|
|
11
|
-
BindingInfo,
|
|
12
|
-
ManagedObject,
|
|
13
|
-
FlUtils
|
|
14
|
-
) {
|
|
15
|
-
"use strict";
|
|
16
|
-
|
|
17
|
-
// Helper class to resolve bindings
|
|
18
|
-
var HelperControl = ManagedObject.extend("sap.ui.fl.util.HelperControl", {
|
|
19
|
-
metadata: {
|
|
20
|
-
library: "sap.ui.fl",
|
|
21
|
-
properties: {
|
|
22
|
-
resolved: {
|
|
23
|
-
type: "any"
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Resolves bindings synchronously by copying model and binding context information
|
|
31
|
-
* from a given reference control.
|
|
32
|
-
*
|
|
33
|
-
* @param {object|string} vValue - Binding string or binding object
|
|
34
|
-
* @param {sap.ui.core.Control} oReferenceControl - Control to copy binding information from
|
|
35
|
-
* @returns {any} - Resolved value
|
|
36
|
-
*
|
|
37
|
-
* @function
|
|
38
|
-
* @author SAP SE
|
|
39
|
-
* @version 1.139.0
|
|
40
|
-
* @alias sap.ui.fl.util.resolveBinding
|
|
41
|
-
* @since 1.91
|
|
42
|
-
* @private
|
|
43
|
-
* @ui5-restricted sap.ui.fl, sap.ui.rta, sap.ui.dt
|
|
44
|
-
*/
|
|
45
|
-
return function(vValue, oReferenceControl) {
|
|
46
|
-
const oView = FlUtils.getViewForControl(oReferenceControl);
|
|
47
|
-
const oController = oView && oView.getController();
|
|
48
|
-
if (!FlUtils.isBinding(vValue, oController)) {
|
|
49
|
-
return undefined;
|
|
50
|
-
}
|
|
51
|
-
const oBindingInfo = typeof vValue === "string"
|
|
52
|
-
? BindingInfo.parse(vValue, oController)
|
|
53
|
-
: { ...vValue };
|
|
54
|
-
|
|
55
|
-
if (!oBindingInfo) {
|
|
56
|
-
return undefined;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const oHelperControl = new HelperControl();
|
|
60
|
-
|
|
61
|
-
const aParts = oBindingInfo.parts || [oBindingInfo];
|
|
62
|
-
aParts.forEach(function(oBindingPart) {
|
|
63
|
-
const sModelName = oBindingPart.model;
|
|
64
|
-
if (sModelName) {
|
|
65
|
-
oHelperControl.setModel(oReferenceControl.getModel(sModelName), sModelName);
|
|
66
|
-
oHelperControl.setBindingContext(oReferenceControl.getBindingContext(sModelName), sModelName);
|
|
67
|
-
} else {
|
|
68
|
-
oHelperControl.setModel(oReferenceControl.getModel());
|
|
69
|
-
oHelperControl.setBindingContext(oReferenceControl.getBindingContext());
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
oHelperControl.bindProperty("resolved", oBindingInfo);
|
|
74
|
-
const vResolvedValue = oHelperControl.getResolved();
|
|
75
|
-
oHelperControl.destroy();
|
|
76
|
-
|
|
77
|
-
return vResolvedValue;
|
|
78
|
-
};
|
|
79
|
-
});
|