@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
|
@@ -9,20 +9,22 @@ sap.ui.define([
|
|
|
9
9
|
"sap/base/util/restricted/_pick",
|
|
10
10
|
"sap/base/util/ObjectPath",
|
|
11
11
|
"sap/ui/fl/apply/_internal/controlVariants/Utils",
|
|
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/DataSelector",
|
|
14
|
-
"sap/ui/fl/apply/_internal/flexObjects/States",
|
|
15
15
|
"sap/ui/fl/apply/_internal/flexState/FlexState",
|
|
16
|
+
"sap/ui/fl/initial/_internal/Storage",
|
|
16
17
|
"sap/ui/fl/LayerUtils"
|
|
17
18
|
], function(
|
|
18
19
|
_omit,
|
|
19
20
|
_pick,
|
|
20
21
|
ObjectPath,
|
|
21
22
|
VariantsApplyUtil,
|
|
23
|
+
States,
|
|
22
24
|
DependencyHandler,
|
|
23
25
|
DataSelector,
|
|
24
|
-
States,
|
|
25
26
|
FlexState,
|
|
27
|
+
Storage,
|
|
26
28
|
LayerUtils
|
|
27
29
|
) {
|
|
28
30
|
"use strict";
|
|
@@ -32,7 +34,7 @@ sap.ui.define([
|
|
|
32
34
|
*
|
|
33
35
|
* @namespace sap.ui.fl.apply._internal.flexState.controlVariants.VariantManagementState
|
|
34
36
|
* @since 1.74
|
|
35
|
-
* @version 1.
|
|
37
|
+
* @version 1.130.1
|
|
36
38
|
* @private
|
|
37
39
|
* @ui5-restricted
|
|
38
40
|
*/
|
|
@@ -460,6 +462,24 @@ sap.ui.define([
|
|
|
460
462
|
FlexState.getFlexObjectsDataSelector().clearCachedResult({ reference: sReference });
|
|
461
463
|
};
|
|
462
464
|
|
|
465
|
+
/**
|
|
466
|
+
* Loads the flex objects for the given variant references and adds them to the FlexState.
|
|
467
|
+
*
|
|
468
|
+
* @param {object} mPropertyBag - Object with the necessary properties
|
|
469
|
+
* @param {string} mPropertyBag.reference - Flexibility reference
|
|
470
|
+
* @param {string[]} mPropertyBag.variantReferences - List of variant references to be loaded
|
|
471
|
+
*/
|
|
472
|
+
VariantManagementState.loadVariants = async function(mPropertyBag) {
|
|
473
|
+
const oStorageResponse = await Storage.loadFlVariants({
|
|
474
|
+
variantReferences: mPropertyBag.variantReferences,
|
|
475
|
+
reference: mPropertyBag.reference
|
|
476
|
+
});
|
|
477
|
+
FlexState.updateWithDataProvided({
|
|
478
|
+
reference: mPropertyBag.reference,
|
|
479
|
+
newData: oStorageResponse
|
|
480
|
+
});
|
|
481
|
+
};
|
|
482
|
+
|
|
463
483
|
/**
|
|
464
484
|
* Returns control changes for a given variant reference.
|
|
465
485
|
*
|
|
@@ -468,23 +488,26 @@ sap.ui.define([
|
|
|
468
488
|
* @param {string} mPropertyBag.vReference - ID of the variant
|
|
469
489
|
* @param {string} mPropertyBag.reference - Component reference
|
|
470
490
|
* @param {boolean} [mPropertyBag.includeDirtyChanges] - Whether dirty changes of the current session should be included, <code>true</code> by default
|
|
491
|
+
* @param {boolean} [mPropertyBag.includeReferencedChanges] - Whether changes from referenced variants should be included, <code>true</code> by default
|
|
471
492
|
*
|
|
472
493
|
* @returns {object[]|sap.ui.fl.apply._internal.flexObjects.FlexObject[]} All changes of the variant
|
|
473
494
|
* @private
|
|
474
495
|
* @ui5-restricted
|
|
475
496
|
*/
|
|
476
497
|
VariantManagementState.getControlChangesForVariant = function(mPropertyBag) {
|
|
477
|
-
|
|
478
|
-
var oVariant = VariantManagementState.getVariant(mPropertyBag);
|
|
498
|
+
const oVariant = VariantManagementState.getVariant(mPropertyBag);
|
|
479
499
|
if (oVariant) {
|
|
480
|
-
|
|
500
|
+
return oVariant.controlChanges.filter(function(oChange) {
|
|
501
|
+
const bIsDirty = oChange.getState() !== States.LifecycleState.PERSISTED;
|
|
502
|
+
const bIsFromReferencedVariant = oChange.getVariantReference() !== mPropertyBag.vReference;
|
|
503
|
+
|
|
481
504
|
return (
|
|
482
|
-
mPropertyBag.includeDirtyChanges !== false
|
|
483
|
-
|
|
505
|
+
(mPropertyBag.includeDirtyChanges !== false || !bIsDirty)
|
|
506
|
+
&& (mPropertyBag.includeReferencedChanges !== false || !bIsFromReferencedVariant)
|
|
484
507
|
);
|
|
485
508
|
});
|
|
486
509
|
}
|
|
487
|
-
return
|
|
510
|
+
return [];
|
|
488
511
|
};
|
|
489
512
|
|
|
490
513
|
/**
|
|
@@ -592,6 +615,31 @@ sap.ui.define([
|
|
|
592
615
|
}, []);
|
|
593
616
|
};
|
|
594
617
|
|
|
618
|
+
/**
|
|
619
|
+
* Returns all variant management changes related to the current variant management map.
|
|
620
|
+
*
|
|
621
|
+
* @param {object} mPropertyBag - Object with the necessary properties
|
|
622
|
+
* @param {string} mPropertyBag.reference - Flex reference of the current app
|
|
623
|
+
* @param {string} [mPropertyBag.vReference] - Variant reference, provide this parameter to filter for changes related to a specific variant
|
|
624
|
+
* @returns {object[]} Array of variant management changes
|
|
625
|
+
*/
|
|
626
|
+
VariantManagementState.getVariantManagementChanges = function(mPropertyBag) {
|
|
627
|
+
const oVariantsMap = oVariantManagementMapDataSelector.get({
|
|
628
|
+
reference: mPropertyBag.reference
|
|
629
|
+
});
|
|
630
|
+
const aVariantManagementChanges = Object.values(oVariantsMap)
|
|
631
|
+
.map((oVariantManagement) => oVariantManagement.variantManagementChanges)
|
|
632
|
+
.flat();
|
|
633
|
+
|
|
634
|
+
if (!mPropertyBag.vReference) {
|
|
635
|
+
return aVariantManagementChanges;
|
|
636
|
+
}
|
|
637
|
+
return aVariantManagementChanges.filter((oVariantManagementChange) => {
|
|
638
|
+
// Currently setDefault changes are the only type of variant management changes
|
|
639
|
+
return mPropertyBag.vReference === oVariantManagementChange.getContent().defaultVariant;
|
|
640
|
+
});
|
|
641
|
+
};
|
|
642
|
+
|
|
595
643
|
/**
|
|
596
644
|
* Loads the initial changes of all variant managements.
|
|
597
645
|
* If the application is started with valid variant references, they are used.
|
|
@@ -192,7 +192,7 @@ sap.ui.define([
|
|
|
192
192
|
});
|
|
193
193
|
|
|
194
194
|
// manifest descriptor changes for ABAP mixed mode can only be applied in this hook,
|
|
195
|
-
// because at this point all libs have been loaded (in contrast to the first Component
|
|
195
|
+
// because at this point all libs have been loaded (in contrast to the first Component(s) 'onPreprocessManifest' hook),
|
|
196
196
|
// but the manifest is still adaptable
|
|
197
197
|
return AppDescriptorApplier.applyChangesIncludedInManifest(oManifest, ApplyStrategyFactory.getRuntimeStrategy());
|
|
198
198
|
}
|
|
@@ -231,4 +231,4 @@ sap.ui.define([
|
|
|
231
231
|
};
|
|
232
232
|
|
|
233
233
|
return ComponentLifecycleHooks;
|
|
234
|
-
});
|
|
234
|
+
});
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
sap.ui.define([
|
|
9
9
|
"sap/ui/core/mvc/Controller",
|
|
10
10
|
"sap/ui/core/mvc/XMLView",
|
|
11
|
-
"sap/ui/core/
|
|
11
|
+
"sap/ui/core/ComponentHooks",
|
|
12
12
|
"sap/ui/core/ExtensionPoint",
|
|
13
13
|
"sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor",
|
|
14
14
|
"sap/ui/fl/apply/_internal/flexState/ManifestUtils",
|
|
@@ -22,7 +22,7 @@ sap.ui.define([
|
|
|
22
22
|
], function(
|
|
23
23
|
MvcController,
|
|
24
24
|
XMLView,
|
|
25
|
-
|
|
25
|
+
ComponentHooks,
|
|
26
26
|
ExtensionPoint,
|
|
27
27
|
Preprocessor,
|
|
28
28
|
ManifestUtils,
|
|
@@ -40,14 +40,14 @@ sap.ui.define([
|
|
|
40
40
|
* @class
|
|
41
41
|
* @constructor
|
|
42
42
|
* @author SAP SE
|
|
43
|
-
* @version 1.
|
|
43
|
+
* @version 1.130.1
|
|
44
44
|
* @since 1.43.0
|
|
45
45
|
* @private
|
|
46
46
|
*/
|
|
47
47
|
var RegistrationDelegator = {};
|
|
48
48
|
|
|
49
49
|
function registerChangesInComponent() {
|
|
50
|
-
|
|
50
|
+
ComponentHooks.onInstanceCreated.register(ComponentLifecycleHooks.instanceCreatedHook);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
function registerChangeHandlers() {
|
|
@@ -56,7 +56,7 @@ sap.ui.define([
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
function registerLoadComponentEventHandler() {
|
|
59
|
-
|
|
59
|
+
ComponentHooks.onComponentLoaded.register(ComponentLifecycleHooks.componentLoadedHook);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
function registerExtensionProvider() {
|
|
@@ -70,7 +70,7 @@ sap.ui.define([
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
function registerDescriptorChangeHandler() {
|
|
73
|
-
|
|
73
|
+
ComponentHooks.onPreprocessManifest.register(Preprocessor.preprocessManifest);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
function getExtensionPointProvider(oView) {
|
|
@@ -9,12 +9,14 @@ sap.ui.define([
|
|
|
9
9
|
"sap/ui/core/Component",
|
|
10
10
|
"sap/ui/core/Element",
|
|
11
11
|
"sap/ui/fl/apply/_internal/controlVariants/URLHandler",
|
|
12
|
+
"sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState",
|
|
12
13
|
"sap/ui/fl/Utils"
|
|
13
14
|
], function(
|
|
14
15
|
Log,
|
|
15
16
|
Component,
|
|
16
17
|
Element,
|
|
17
18
|
URLHandler,
|
|
19
|
+
VariantManagementState,
|
|
18
20
|
Utils
|
|
19
21
|
) {
|
|
20
22
|
"use strict";
|
|
@@ -116,6 +118,7 @@ sap.ui.define([
|
|
|
116
118
|
/**
|
|
117
119
|
*
|
|
118
120
|
* Activates the passed variant applicable to the passed control/component.
|
|
121
|
+
* If the Variant is not available and the backend supports lazy loading, a backend request is made to fetch the variant.
|
|
119
122
|
*
|
|
120
123
|
* @param {object} mPropertyBag - Object with parameters as properties
|
|
121
124
|
* @param {sap.ui.base.ManagedObject|string} mPropertyBag.element - Component or control (instance or ID) on which the <code>variantModel</code> is set
|
|
@@ -125,13 +128,13 @@ sap.ui.define([
|
|
|
125
128
|
*
|
|
126
129
|
* @public
|
|
127
130
|
*/
|
|
128
|
-
activateVariant(mPropertyBag) {
|
|
131
|
+
async activateVariant(mPropertyBag) {
|
|
129
132
|
function logAndReject(oError) {
|
|
130
133
|
Log.error(oError);
|
|
131
134
|
return Promise.reject(oError);
|
|
132
135
|
}
|
|
133
136
|
|
|
134
|
-
|
|
137
|
+
let oElement;
|
|
135
138
|
if (typeof mPropertyBag.element === "string") {
|
|
136
139
|
oElement = Component.getComponentById(mPropertyBag.element);
|
|
137
140
|
if (!(oElement instanceof Component)) {
|
|
@@ -145,34 +148,46 @@ sap.ui.define([
|
|
|
145
148
|
oElement = mPropertyBag.element;
|
|
146
149
|
}
|
|
147
150
|
|
|
148
|
-
|
|
151
|
+
const oAppComponent = Utils.getAppComponentForControl(oElement);
|
|
149
152
|
if (!oAppComponent) {
|
|
150
153
|
return logAndReject(Error("A valid variant management control or component (instance or ID) should be passed as parameter"));
|
|
151
154
|
}
|
|
152
155
|
|
|
153
|
-
|
|
156
|
+
const oVariantModel = oAppComponent.getModel(VARIANT_MODEL_NAME);
|
|
154
157
|
if (!oVariantModel) {
|
|
155
158
|
return logAndReject(Error("No variant management model found for the passed control or application component"));
|
|
156
159
|
}
|
|
157
|
-
|
|
160
|
+
|
|
161
|
+
// if the variant management reference is not available, the variant is not yet loaded
|
|
162
|
+
if (!oVariantModel.getVariantManagementReference(mPropertyBag.variantReference).variantManagementReference) {
|
|
163
|
+
try {
|
|
164
|
+
await VariantManagementState.loadVariants({
|
|
165
|
+
reference: oVariantModel.sFlexReference,
|
|
166
|
+
variantReferences: [mPropertyBag.variantReference]
|
|
167
|
+
});
|
|
168
|
+
} catch (oError) {
|
|
169
|
+
return logAndReject(Error(`Variant with reference '${mPropertyBag.variantReference}' could not be found`));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const sVariantManagementReference = oVariantModel.getVariantManagementReference(mPropertyBag.variantReference).variantManagementReference;
|
|
158
174
|
if (!sVariantManagementReference) {
|
|
159
175
|
return logAndReject(Error("A valid control or component, and a valid variant/ID combination are required"));
|
|
160
176
|
}
|
|
161
177
|
|
|
162
178
|
// sap/fe is using this API very early during app start, sometimes before FlexState is initialized
|
|
163
|
-
|
|
179
|
+
await oVariantModel.waitForVMControlInit(sVariantManagementReference);
|
|
164
180
|
|
|
165
|
-
|
|
181
|
+
try {
|
|
166
182
|
return oVariantModel.updateCurrentVariant({
|
|
167
183
|
variantManagementReference: sVariantManagementReference,
|
|
168
184
|
newVariantReference: mPropertyBag.variantReference,
|
|
169
185
|
appComponent: oAppComponent
|
|
170
186
|
});
|
|
171
|
-
})
|
|
172
|
-
.catch(function(oError) {
|
|
187
|
+
} catch (oError) {
|
|
173
188
|
Log.error(oError);
|
|
174
189
|
throw oError;
|
|
175
|
-
}
|
|
190
|
+
}
|
|
176
191
|
},
|
|
177
192
|
|
|
178
193
|
/**
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
+
"sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantManagementState",
|
|
8
9
|
"sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger",
|
|
9
10
|
"sap/ui/fl/apply/_internal/flexState/compVariants/Utils",
|
|
10
11
|
"sap/ui/fl/apply/_internal/flexState/FlexState",
|
|
@@ -12,6 +13,7 @@ sap.ui.define([
|
|
|
12
13
|
"sap/ui/fl/LayerUtils",
|
|
13
14
|
"sap/ui/fl/Utils"
|
|
14
15
|
], function(
|
|
16
|
+
CompVariantManagementState,
|
|
15
17
|
CompVariantMerger,
|
|
16
18
|
CompVariantUtils,
|
|
17
19
|
FlexState,
|
|
@@ -21,45 +23,27 @@ sap.ui.define([
|
|
|
21
23
|
) {
|
|
22
24
|
"use strict";
|
|
23
25
|
|
|
24
|
-
/**
|
|
25
|
-
* Returns the SmartVariant <code>ChangeMap</code> from the Change Persistence.
|
|
26
|
-
*
|
|
27
|
-
* @param {sap.ui.comp.smartvariants.SmartVariantManagement|
|
|
28
|
-
* sap.ui.comp.smartfilterbar.SmartFilterBar|
|
|
29
|
-
* sap.ui.comp.smarttable.SmartTable|
|
|
30
|
-
* sap.ui.comp.smartchart.SmartChart} oControl - Variant management control
|
|
31
|
-
* @returns {object} <code>persistencyKey</code> map and corresponding changes, or an empty object
|
|
32
|
-
*/
|
|
33
|
-
function getVariantsMapForKey(oControl) {
|
|
34
|
-
const sReference = ManifestUtils.getFlexReferenceForControl(oControl);
|
|
35
|
-
const sPersistencyKey = CompVariantUtils.getPersistencyKey(oControl);
|
|
36
|
-
const mCompVariantsMap = FlexState.getCompVariantsMap(sReference);
|
|
37
|
-
return mCompVariantsMap._getOrCreate(sPersistencyKey);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
26
|
function getCompEntities(mPropertyBag) {
|
|
41
27
|
var oControl = mPropertyBag.control;
|
|
42
28
|
var oVMControl = oControl.getVariantManagement?.() || oControl;
|
|
43
29
|
var sSVMControlId = oVMControl.getId();
|
|
44
|
-
var sReference = ManifestUtils.getFlexReferenceForControl(oControl);
|
|
45
30
|
|
|
46
31
|
return FlexState.initialize({
|
|
47
|
-
reference:
|
|
32
|
+
reference: mPropertyBag.reference,
|
|
48
33
|
componentData: {},
|
|
49
34
|
manifest: Utils.getAppDescriptor(oControl),
|
|
50
35
|
componentId: Utils.getAppComponentForControl(oControl).getId()
|
|
51
36
|
}).then(function() {
|
|
52
|
-
var
|
|
53
|
-
var mCompVariantsMap = FlexState.getCompVariantsMap(sReference);
|
|
37
|
+
var mCompVariantsMap = FlexState.getCompVariantsMap(mPropertyBag.reference);
|
|
54
38
|
// Store external input data to FlexState so they can be restored after invalidating cache
|
|
55
39
|
FlexState.setInitialNonFlCompVariantData(
|
|
56
|
-
|
|
57
|
-
|
|
40
|
+
mPropertyBag.reference,
|
|
41
|
+
mPropertyBag.persistencyKey,
|
|
58
42
|
mPropertyBag.standardVariant,
|
|
59
43
|
mPropertyBag.variants,
|
|
60
44
|
sSVMControlId
|
|
61
45
|
);
|
|
62
|
-
return mCompVariantsMap._initialize(
|
|
46
|
+
return mCompVariantsMap._initialize(mPropertyBag.persistencyKey, mPropertyBag.variants, sSVMControlId);
|
|
63
47
|
});
|
|
64
48
|
}
|
|
65
49
|
|
|
@@ -126,35 +110,24 @@ sap.ui.define([
|
|
|
126
110
|
* @ui5-restricted sap.ui.comp
|
|
127
111
|
*/
|
|
128
112
|
async loadVariants(mPropertyBag) {
|
|
113
|
+
mPropertyBag.reference = ManifestUtils.getFlexReferenceForControl(mPropertyBag.control);
|
|
114
|
+
mPropertyBag.persistencyKey = CompVariantUtils.getPersistencyKey(mPropertyBag.control);
|
|
115
|
+
|
|
129
116
|
const mCompMaps = await getCompEntities(mPropertyBag);
|
|
130
|
-
|
|
131
|
-
const sDefaultVariantId = CompVariantUtils.getDefaultVariantId(getVariantsMapForKey(mPropertyBag.control));
|
|
117
|
+
|
|
132
118
|
const mMergedCompVariants = CompVariantMerger.merge(
|
|
133
|
-
|
|
119
|
+
mPropertyBag.persistencyKey,
|
|
134
120
|
mCompMaps,
|
|
135
121
|
mPropertyBag.standardVariant,
|
|
136
122
|
mPropertyBag.control
|
|
137
123
|
);
|
|
138
|
-
mMergedCompVariants.defaultVariantId = sDefaultVariantId;
|
|
139
|
-
return mMergedCompVariants;
|
|
140
|
-
},
|
|
141
124
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
* @param {sap.ui.comp.smartvariants.SmartVariantManagement} mPropertyBag.control - SAPUI5 Smart Variant Management control
|
|
149
|
-
* @returns {string} ID of the default variant
|
|
150
|
-
* @private
|
|
151
|
-
* @ui5-restricted sap.ui.comp
|
|
152
|
-
* @deprecated
|
|
153
|
-
*/
|
|
154
|
-
getDefaultVariantId(mPropertyBag) {
|
|
155
|
-
var aDefaultVariantChanges = getVariantsMapForKey(mPropertyBag.control).defaultVariants;
|
|
156
|
-
var oChange = aDefaultVariantChanges[aDefaultVariantChanges.length - 1];
|
|
157
|
-
return oChange ? oChange.getContent().defaultVariantName : "";
|
|
125
|
+
mMergedCompVariants.defaultVariantId = CompVariantManagementState.getDefaultVariantId({
|
|
126
|
+
persistencyKey: mPropertyBag.persistencyKey,
|
|
127
|
+
reference: mPropertyBag.reference,
|
|
128
|
+
variants: mMergedCompVariants.variants
|
|
129
|
+
});
|
|
130
|
+
return mMergedCompVariants;
|
|
158
131
|
}
|
|
159
132
|
};
|
|
160
133
|
|
|
@@ -23,7 +23,7 @@ sap.ui.define([
|
|
|
23
23
|
* @namespace
|
|
24
24
|
* @name sap.ui.fl.descriptorRelated
|
|
25
25
|
* @author SAP SE
|
|
26
|
-
* @version 1.
|
|
26
|
+
* @version 1.130.1
|
|
27
27
|
* @private
|
|
28
28
|
* @ui5-restricted sap.ui.rta, smart business
|
|
29
29
|
*/
|
|
@@ -33,7 +33,7 @@ sap.ui.define([
|
|
|
33
33
|
* @namespace
|
|
34
34
|
* @name sap.ui.fl.descriptorRelated.api
|
|
35
35
|
* @author SAP SE
|
|
36
|
-
* @version 1.
|
|
36
|
+
* @version 1.130.1
|
|
37
37
|
* @private
|
|
38
38
|
* @ui5-restricted sap.ui.rta, smart business
|
|
39
39
|
*/
|
|
@@ -47,7 +47,7 @@ sap.ui.define([
|
|
|
47
47
|
* @constructor
|
|
48
48
|
* @alias sap.ui.fl.descriptorRelated.api.DescriptorChange
|
|
49
49
|
* @author SAP SE
|
|
50
|
-
* @version 1.
|
|
50
|
+
* @version 1.130.1
|
|
51
51
|
* @private
|
|
52
52
|
* @ui5-restricted sap.ui.rta, smart business
|
|
53
53
|
*/
|
|
@@ -125,7 +125,7 @@ sap.ui.define([
|
|
|
125
125
|
* @constructor
|
|
126
126
|
* @alias sap.ui.fl.descriptorRelated.api.DescriptorChangeFactory
|
|
127
127
|
* @author SAP SE
|
|
128
|
-
* @version 1.
|
|
128
|
+
* @version 1.130.1
|
|
129
129
|
* @private
|
|
130
130
|
* @ui5-restricted sap.ui.rta, smart business
|
|
131
131
|
*/
|
|
@@ -38,7 +38,7 @@ sap.ui.define([
|
|
|
38
38
|
* @namespace
|
|
39
39
|
* @alias sap.ui.fl.descriptorRelated.api.DescriptorInlineChangeFactory
|
|
40
40
|
* @author SAP SE
|
|
41
|
-
* @version 1.
|
|
41
|
+
* @version 1.130.1
|
|
42
42
|
* @private
|
|
43
43
|
* @deprecated Since version 1.76
|
|
44
44
|
* @ui5-restricted sap.ui.rta, smart business
|
|
@@ -16,7 +16,7 @@ sap.ui.define([
|
|
|
16
16
|
* @namespace
|
|
17
17
|
* @alias sap.ui.fl.descriptorRelated.api.DescriptorVariantFactory
|
|
18
18
|
* @author SAP SE
|
|
19
|
-
* @version 1.
|
|
19
|
+
* @version 1.130.1
|
|
20
20
|
* @private
|
|
21
21
|
* @deprecated Since version 1.73
|
|
22
22
|
* @ui5-restricted sap.ui.rta, smart business
|