@openui5/sap.ui.fl 1.131.1 → 1.132.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/.eslintrc.json +1 -2
- package/THIRDPARTY.txt +1 -1
- package/package.json +3 -3
- package/src/sap/ui/fl/.library +2 -2
- package/src/sap/ui/fl/ChangePersistence.js +11 -5
- package/src/sap/ui/fl/ChangePersistenceFactory.js +2 -2
- package/src/sap/ui/fl/FakeLrepConnector.js +1 -1
- package/src/sap/ui/fl/FakeLrepConnectorLocalStorage.js +2 -2
- package/src/sap/ui/fl/FakeLrepConnectorSessionStorage.js +2 -2
- package/src/sap/ui/fl/FakeLrepLocalStorage.js +2 -2
- package/src/sap/ui/fl/FlexController.js +3 -2
- package/src/sap/ui/fl/FlexControllerFactory.js +2 -2
- package/src/sap/ui/fl/Layer.js +1 -1
- package/src/sap/ui/fl/LayerUtils.js +2 -2
- package/src/sap/ui/fl/Scenario.js +1 -1
- package/src/sap/ui/fl/Utils.js +2 -2
- package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +2 -2
- package/src/sap/ui/fl/apply/_internal/appVariant/DescriptorChangeTypes.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/Applier.js +13 -3
- package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/Reverter.js +7 -2
- package/src/sap/ui/fl/apply/_internal/changes/Utils.js +49 -23
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Applier.js +20 -21
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ApplyStrategyFactory.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ApplyUtil.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 +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddAnnotationsToOData.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewDataSource.js +4 -4
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewInbound.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewOutbound.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddTechnicalAttributes.js +3 -3
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeDataSource.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeOutbound.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/RemoveAllInboundsExceptOne.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetAch.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetDescription.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetTitle.js +16 -4
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetAbstract.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetCloudDevAdaptationStatus.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/AddNewCard.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/ChangeCard.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddLibrary.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/ChangeModel.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetFlexExtensionPointEnabled.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetMinUI5Version.js +2 -2
- package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageConnector.js +1 -1
- package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageUtils.js +2 -2
- package/src/sap/ui/fl/apply/_internal/controlVariants/URLHandler.js +1 -1
- package/src/sap/ui/fl/apply/_internal/controlVariants/Utils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +2 -2
- package/src/sap/ui/fl/apply/_internal/extensionPoint/Registry.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexObjects/AnnotationChange.js +17 -10
- package/src/sap/ui/fl/apply/_internal/flexObjects/AppDescriptorChange.js +16 -2
- package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariantRevertData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/ControllerExtensionChange.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlVariant.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +21 -2
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +19 -3
- package/src/sap/ui/fl/apply/_internal/flexObjects/RevertData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/States.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +21 -2
- package/src/sap/ui/fl/apply/_internal/flexObjects/UpdatableChange.js +5 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +7 -2
- package/src/sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexState/DataSelector.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/FlexObjectState.js +10 -4
- package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +14 -8
- package/src/sap/ui/fl/apply/_internal/flexState/InitialPrepareFunctions.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +21 -16
- package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexState/changes/UIChangesState.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexState/communication/FLPAboutInfo.js +140 -0
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantManagementState.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +3 -3
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/Utils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/prepareCompVariantsMap.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +2 -2
- package/src/sap/ui/fl/apply/_internal/preprocessors/ComponentLifecycleHooks.js +60 -1
- package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +2 -2
- package/src/sap/ui/fl/apply/_internal/preprocessors/RegistrationDelegator.js +20 -3
- package/src/sap/ui/fl/apply/_internal/preprocessors/XmlPreprocessor.js +2 -2
- package/src/sap/ui/fl/apply/api/AnnotationChangeHandlerAPI.js +11 -9
- package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +1 -1
- package/src/sap/ui/fl/apply/api/DelegateMediatorAPI.js +1 -1
- package/src/sap/ui/fl/apply/api/ExtensionPointRegistryAPI.js +1 -1
- package/src/sap/ui/fl/apply/api/FlexRuntimeInfoAPI.js +23 -1
- package/src/sap/ui/fl/apply/api/SmartVariantManagementApplyAPI.js +1 -1
- package/src/sap/ui/fl/apply/api/UI2PersonalizationApplyAPI.js +1 -1
- package/src/sap/ui/fl/changeHandler/AddIFrame.js +2 -2
- package/src/sap/ui/fl/changeHandler/AddXML.js +2 -2
- package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +2 -2
- package/src/sap/ui/fl/changeHandler/Base.js +2 -2
- package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +2 -2
- package/src/sap/ui/fl/changeHandler/BaseAddXml.js +2 -2
- package/src/sap/ui/fl/changeHandler/BaseRename.js +2 -2
- package/src/sap/ui/fl/changeHandler/BaseTreeModifier.js +1 -1
- package/src/sap/ui/fl/changeHandler/ChangeAnnotation.js +78 -0
- package/src/sap/ui/fl/changeHandler/HideControl.js +2 -2
- package/src/sap/ui/fl/changeHandler/MoveControls.js +2 -2
- package/src/sap/ui/fl/changeHandler/MoveElements.js +2 -2
- package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +2 -2
- package/src/sap/ui/fl/changeHandler/PropertyChange.js +2 -2
- package/src/sap/ui/fl/changeHandler/StashControl.js +2 -2
- package/src/sap/ui/fl/changeHandler/UnhideControl.js +2 -2
- package/src/sap/ui/fl/changeHandler/UnstashControl.js +2 -2
- package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +2 -2
- package/src/sap/ui/fl/changeHandler/common/ChangeCategories.js +1 -1
- package/src/sap/ui/fl/changeHandler/common/createIFrame.js +1 -1
- package/src/sap/ui/fl/changeHandler/common/getTargetAggregationIndex.js +1 -1
- package/src/sap/ui/fl/changeHandler/common/revertAddedControls.js +1 -1
- package/src/sap/ui/fl/changeHandler/condenser/Classification.js +1 -1
- package/src/sap/ui/fl/descriptorRelated/Utils.js +1 -1
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +9 -7
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js +2 -2
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorVariantFactory.js +2 -2
- package/src/sap/ui/fl/designtime/library.designtime.js +1 -1
- package/src/sap/ui/fl/designtime/messagebundle_en_US_saptrc.properties +1 -1
- package/src/sap/ui/fl/designtime/util/IFrame.designtime.js +1 -1
- package/src/sap/ui/fl/designtime/util/editIFrame.js +1 -1
- package/src/sap/ui/fl/designtime/variants/VariantManagement.designtime.js +1 -1
- package/src/sap/ui/fl/initial/_internal/FlexConfiguration.js +2 -2
- package/src/sap/ui/fl/initial/_internal/FlexInfoSession.js +1 -1
- package/src/sap/ui/fl/initial/_internal/Storage.js +2 -2
- package/src/sap/ui/fl/initial/_internal/StorageFeaturesMerger.js +2 -2
- package/src/sap/ui/fl/initial/_internal/StorageResultMerger.js +1 -1
- package/src/sap/ui/fl/initial/_internal/StorageUtils.js +7 -4
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration.js +8 -7
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +14 -11
- package/src/sap/ui/fl/initial/_internal/connectors/BackendConnector.js +1 -1
- package/src/sap/ui/fl/initial/_internal/connectors/BtpServiceConnector.js +15 -1
- package/src/sap/ui/fl/initial/_internal/connectors/KeyUserConnector.js +1 -1
- package/src/sap/ui/fl/initial/_internal/connectors/LrepConnector.js +1 -1
- package/src/sap/ui/fl/initial/_internal/connectors/NeoLrepConnector.js +1 -1
- package/src/sap/ui/fl/initial/_internal/connectors/PersonalizationConnector.js +1 -1
- package/src/sap/ui/fl/initial/_internal/connectors/StaticFileConnector.js +1 -1
- package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +2 -2
- package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +2 -2
- package/src/sap/ui/fl/initial/api/InitialFlexAPI.js +57 -0
- package/src/sap/ui/fl/initial/api/Version.js +1 -1
- package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +2 -2
- package/src/sap/ui/fl/interfaces/Delegate.js +2 -2
- package/src/sap/ui/fl/library.js +44 -44
- package/src/sap/ui/fl/library.support.js +3 -3
- package/src/sap/ui/fl/messagebundle.properties +4 -1
- package/src/sap/ui/fl/messagebundle_ar.properties +2 -0
- package/src/sap/ui/fl/messagebundle_bg.properties +2 -0
- package/src/sap/ui/fl/messagebundle_ca.properties +2 -0
- package/src/sap/ui/fl/messagebundle_cnr.properties +2 -0
- package/src/sap/ui/fl/messagebundle_cs.properties +2 -0
- package/src/sap/ui/fl/messagebundle_cy.properties +2 -0
- package/src/sap/ui/fl/messagebundle_da.properties +2 -0
- package/src/sap/ui/fl/messagebundle_de.properties +2 -0
- package/src/sap/ui/fl/messagebundle_el.properties +2 -0
- package/src/sap/ui/fl/messagebundle_en.properties +2 -0
- package/src/sap/ui/fl/messagebundle_en_GB.properties +2 -0
- package/src/sap/ui/fl/messagebundle_en_US_saprigi.properties +2 -0
- package/src/sap/ui/fl/messagebundle_en_US_saptrc.properties +45 -45
- package/src/sap/ui/fl/messagebundle_es.properties +2 -0
- package/src/sap/ui/fl/messagebundle_es_MX.properties +2 -0
- package/src/sap/ui/fl/messagebundle_et.properties +2 -0
- package/src/sap/ui/fl/messagebundle_fi.properties +2 -0
- package/src/sap/ui/fl/messagebundle_fr.properties +2 -0
- package/src/sap/ui/fl/messagebundle_fr_CA.properties +2 -0
- package/src/sap/ui/fl/messagebundle_hi.properties +2 -0
- package/src/sap/ui/fl/messagebundle_hr.properties +2 -0
- package/src/sap/ui/fl/messagebundle_hu.properties +2 -0
- package/src/sap/ui/fl/messagebundle_id.properties +2 -0
- package/src/sap/ui/fl/messagebundle_it.properties +2 -0
- package/src/sap/ui/fl/messagebundle_iw.properties +2 -0
- package/src/sap/ui/fl/messagebundle_ja.properties +2 -0
- package/src/sap/ui/fl/messagebundle_kk.properties +2 -0
- package/src/sap/ui/fl/messagebundle_ko.properties +2 -0
- package/src/sap/ui/fl/messagebundle_lt.properties +2 -0
- package/src/sap/ui/fl/messagebundle_lv.properties +2 -0
- package/src/sap/ui/fl/messagebundle_mk.properties +2 -0
- package/src/sap/ui/fl/messagebundle_ms.properties +2 -0
- package/src/sap/ui/fl/messagebundle_nl.properties +2 -0
- package/src/sap/ui/fl/messagebundle_no.properties +2 -0
- package/src/sap/ui/fl/messagebundle_pl.properties +2 -0
- package/src/sap/ui/fl/messagebundle_pt.properties +2 -0
- package/src/sap/ui/fl/messagebundle_pt_PT.properties +2 -0
- package/src/sap/ui/fl/messagebundle_ro.properties +2 -0
- package/src/sap/ui/fl/messagebundle_ru.properties +2 -0
- package/src/sap/ui/fl/messagebundle_sh.properties +2 -0
- package/src/sap/ui/fl/messagebundle_sk.properties +2 -0
- package/src/sap/ui/fl/messagebundle_sl.properties +2 -0
- package/src/sap/ui/fl/messagebundle_sr.properties +2 -0
- package/src/sap/ui/fl/messagebundle_sv.properties +2 -0
- package/src/sap/ui/fl/messagebundle_th.properties +2 -0
- package/src/sap/ui/fl/messagebundle_tr.properties +2 -0
- package/src/sap/ui/fl/messagebundle_uk.properties +2 -0
- package/src/sap/ui/fl/messagebundle_vi.properties +2 -0
- package/src/sap/ui/fl/messagebundle_zh_CN.properties +2 -0
- package/src/sap/ui/fl/messagebundle_zh_TW.properties +2 -0
- package/src/sap/ui/fl/registry/Settings.js +1 -1
- package/src/sap/ui/fl/requireAsync.js +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 +2 -2
- package/src/sap/ui/fl/support/_internal/getFlexObjectInfos.js +2 -2
- package/src/sap/ui/fl/support/_internal/getFlexSettings.js +2 -2
- package/src/sap/ui/fl/support/api/SupportAPI.js +2 -2
- package/src/sap/ui/fl/support/apps/contentbrowser/Component.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +2 -2
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +2 -2
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +2 -2
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +2 -2
- package/src/sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector.js +2 -2
- package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +2 -2
- package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +2 -2
- package/src/sap/ui/fl/themes/base/library.source.less +1 -1
- package/src/sap/ui/fl/themes/sap_hcb/library.source.less +1 -1
- package/src/sap/ui/fl/transport/TransportDialog.js +1 -1
- package/src/sap/ui/fl/transport/TransportSelection.js +2 -2
- package/src/sap/ui/fl/util/DescriptorChangeCheck.js +3 -3
- package/src/sap/ui/fl/util/IFrame.flexibility.js +1 -1
- package/src/sap/ui/fl/util/IFrame.js +2 -2
- package/src/sap/ui/fl/util/IFrameRenderer.js +1 -1
- package/src/sap/ui/fl/util/ManagedObjectModel.js +3 -3
- package/src/sap/ui/fl/util/changePropertyValueByPath.js +1 -1
- package/src/sap/ui/fl/util/getContainerUserInfo.js +1 -1
- package/src/sap/ui/fl/util/resolveBinding.js +2 -2
- package/src/sap/ui/fl/variants/VariantManagement.js +1 -1
- package/src/sap/ui/fl/variants/VariantManager.js +604 -0
- package/src/sap/ui/fl/variants/VariantModel.js +27 -557
- package/src/sap/ui/fl/variants/context/Component.js +1 -1
- package/src/sap/ui/fl/variants/context/controller/ContextVisibility.controller.js +1 -1
- package/src/sap/ui/fl/variants/context/i18n/i18n_en_US_saptrc.properties +12 -12
- package/src/sap/ui/fl/write/_internal/SaveAs.js +1 -1
- package/src/sap/ui/fl/write/_internal/Storage.js +8 -3
- package/src/sap/ui/fl/write/_internal/Versions.js +2 -2
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +2 -2
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +2 -2
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChange.js +2 -2
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory.js +9 -3
- package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +69 -48
- package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +2 -2
- package/src/sap/ui/fl/write/_internal/condenser/Utils.js +1 -1
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Create.js +1 -1
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Destroy.js +1 -1
- package/src/sap/ui/fl/write/_internal/condenser/classifications/LastOneWins.js +1 -1
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Move.js +1 -1
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Reverse.js +1 -1
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Update.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +2 -2
- package/src/sap/ui/fl/write/_internal/connectors/BtpServiceConnector.js +32 -2
- package/src/sap/ui/fl/write/_internal/connectors/JsObjectConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +2 -2
- package/src/sap/ui/fl/write/_internal/connectors/LocalStorageConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +2 -2
- package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +2 -2
- package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +2 -2
- package/src/sap/ui/fl/write/_internal/connectors/ObjectStorageConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +2 -2
- package/src/sap/ui/fl/write/_internal/connectors/SessionStorageConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/Utils.js +2 -2
- package/src/sap/ui/fl/write/_internal/controlVariants/ControlVariantWriteUtils.js +1 -1
- package/src/sap/ui/fl/write/_internal/delegates/ODataV2ReadDelegate.js +1 -1
- package/src/sap/ui/fl/write/_internal/delegates/ODataV4ReadDelegate.js +1 -1
- package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +2 -2
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPAccess.js +2 -2
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariant.js +2 -2
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariantFactory.js +2 -2
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/MultiTenantABAPExtensibilityVariant.js +2 -2
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ServiceValidation.js +2 -2
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/SingleTenantABAPExtensibilityVariant.js +2 -2
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/UriParser.js +2 -2
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/Utils.js +2 -2
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/CAPAccess.js +2 -2
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.js +2 -2
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/getEditorConfig.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.js +2 -2
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.js +2 -2
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +2 -2
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/validators/IsRequired.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/FlexObjectManager.js +2 -2
- package/src/sap/ui/fl/write/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +2 -2
- package/src/sap/ui/fl/write/_internal/flexState/changes/UIChangeManager.js +2 -2
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +9 -12
- package/src/sap/ui/fl/write/_internal/transport/TransportDialog.js +1 -1
- package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +2 -2
- package/src/sap/ui/fl/write/_internal/transport/Transports.js +2 -2
- package/src/sap/ui/fl/write/api/Adaptations.js +1 -1
- package/src/sap/ui/fl/write/api/AppVariantWriteAPI.js +1 -1
- package/src/sap/ui/fl/write/api/ChangesWriteAPI.js +33 -10
- package/src/sap/ui/fl/write/api/ContextBasedAdaptationsAPI.js +40 -27
- package/src/sap/ui/fl/write/api/ContextSharingAPI.js +1 -1
- package/src/sap/ui/fl/write/api/ControlPersonalizationWriteAPI.js +14 -2
- package/src/sap/ui/fl/write/api/FeaturesAPI.js +1 -1
- package/src/sap/ui/fl/write/api/FieldExtensibility.js +2 -2
- package/src/sap/ui/fl/write/api/LocalResetAPI.js +1 -1
- package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +43 -5
- package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +1 -1
- package/src/sap/ui/fl/write/api/SACIntegrationUpdateVariant.js +1 -1
- package/src/sap/ui/fl/write/api/SmartBusinessWriteAPI.js +1 -1
- package/src/sap/ui/fl/write/api/SmartVariantManagementWriteAPI.js +1 -1
- package/src/sap/ui/fl/write/api/TranslationAPI.js +1 -1
- package/src/sap/ui/fl/write/api/UI2PersonalizationWriteAPI.js +1 -1
- package/src/sap/ui/fl/write/api/VersionsAPI.js +1 -1
- package/src/sap/ui/fl/write/api/connectors/FileListBaseConnector.js +1 -1
- package/src/sap/ui/fl/write/api/connectors/ObjectStorageConnector.js +1 -1
- package/src/sap/ui/fl/write/connectors/BaseConnector.js +1 -1
- package/ui5.yaml +2 -1
|
@@ -0,0 +1,604 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ! OpenUI5
|
|
3
|
+
* (c) Copyright 2009-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/base/util/restricted/_difference",
|
|
9
|
+
"sap/base/util/merge",
|
|
10
|
+
"sap/base/util/ObjectPath",
|
|
11
|
+
"sap/ui/core/util/reflection/JsControlTreeModifier",
|
|
12
|
+
"sap/ui/core/Element",
|
|
13
|
+
"sap/ui/fl/apply/_internal/changes/Applier",
|
|
14
|
+
"sap/ui/fl/apply/_internal/changes/Reverter",
|
|
15
|
+
"sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory",
|
|
16
|
+
"sap/ui/fl/apply/_internal/flexObjects/States",
|
|
17
|
+
"sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState",
|
|
18
|
+
"sap/ui/fl/apply/_internal/flexState/FlexObjectState",
|
|
19
|
+
"sap/ui/fl/apply/api/ControlVariantApplyAPI",
|
|
20
|
+
"sap/ui/fl/write/_internal/controlVariants/ControlVariantWriteUtils",
|
|
21
|
+
"sap/ui/fl/write/_internal/flexState/changes/UIChangeManager",
|
|
22
|
+
"sap/ui/fl/write/_internal/flexState/FlexObjectManager",
|
|
23
|
+
"sap/ui/fl/write/api/ContextBasedAdaptationsAPI",
|
|
24
|
+
"sap/ui/fl/Layer",
|
|
25
|
+
"sap/ui/fl/Utils"
|
|
26
|
+
], function(
|
|
27
|
+
_difference,
|
|
28
|
+
merge,
|
|
29
|
+
ObjectPath,
|
|
30
|
+
JsControlTreeModifier,
|
|
31
|
+
Element,
|
|
32
|
+
Applier,
|
|
33
|
+
Reverter,
|
|
34
|
+
FlexObjectFactory,
|
|
35
|
+
States,
|
|
36
|
+
VariantManagementState,
|
|
37
|
+
FlexObjectState,
|
|
38
|
+
ControlVariantApplyAPI,
|
|
39
|
+
ControlVariantWriteUtils,
|
|
40
|
+
UIChangeManager,
|
|
41
|
+
FlexObjectManager,
|
|
42
|
+
ContextBasedAdaptationsAPI,
|
|
43
|
+
Layer,
|
|
44
|
+
Utils
|
|
45
|
+
) {
|
|
46
|
+
"use strict";
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Manager for all FlVariant related tasks that are triggered by a user interaction.
|
|
50
|
+
*
|
|
51
|
+
* @namespace sap.ui.fl.variants.VariantManager
|
|
52
|
+
* @since 1.132
|
|
53
|
+
* @version 1.132.1
|
|
54
|
+
* @private
|
|
55
|
+
* @ui5-restricted sap.ui.fl, sap.ui.rta
|
|
56
|
+
*/
|
|
57
|
+
var VariantManager = {};
|
|
58
|
+
|
|
59
|
+
function getVariantModel(oControl) {
|
|
60
|
+
const oAppComponent = Utils.getAppComponentForControl(oControl);
|
|
61
|
+
return oAppComponent.getModel(ControlVariantApplyAPI.getVariantModelName());
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Removes passed control changes which are in DIRTY state from the variant state and flex controller.
|
|
66
|
+
*
|
|
67
|
+
* @param {object} mPropertyBag - Object with properties
|
|
68
|
+
* @param {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} mPropertyBag.changes - Array of control changes
|
|
69
|
+
* @param {string} mPropertyBag.vmReference - Variant management reference
|
|
70
|
+
* @param {string} mPropertyBag.vReference - Variant reference to remove dirty changes from
|
|
71
|
+
* @param {sap.ui.fl.variants.VariantModel} mPropertyBag.model - Variant model instance
|
|
72
|
+
* @param {boolean} [mPropertyBag.revert] - Revert the given changes
|
|
73
|
+
*
|
|
74
|
+
* @returns {Promise<undefined>} Resolves when changes have been erased
|
|
75
|
+
*/
|
|
76
|
+
async function eraseDirtyChanges(mPropertyBag) {
|
|
77
|
+
var aVariantDirtyChanges = mPropertyBag.model._getDirtyChangesFromVariantChanges(mPropertyBag.changes);
|
|
78
|
+
aVariantDirtyChanges = aVariantDirtyChanges.reverse();
|
|
79
|
+
|
|
80
|
+
if (mPropertyBag.revert) {
|
|
81
|
+
await Reverter.revertMultipleChanges(aVariantDirtyChanges, {
|
|
82
|
+
appComponent: mPropertyBag.model.oAppComponent,
|
|
83
|
+
modifier: JsControlTreeModifier,
|
|
84
|
+
reference: mPropertyBag.model.sFlexReference
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
FlexObjectManager.deleteFlexObjects({
|
|
88
|
+
reference: mPropertyBag.model.sFlexReference,
|
|
89
|
+
flexObjects: aVariantDirtyChanges
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Adds the passed function to the variant switch promise and returns the whole promise chain.
|
|
95
|
+
*
|
|
96
|
+
* @param {function():Promise} fnCallback - Callback function returning a promise
|
|
97
|
+
* @param {sap.ui.fl.variants.VariantModel} oModel - Variant model
|
|
98
|
+
* @param {string} sVMReference - Variant Management reference
|
|
99
|
+
* @returns {Promise<undefined>} Resolves when the variant model is not busy anymore
|
|
100
|
+
* @private
|
|
101
|
+
*/
|
|
102
|
+
function executeAfterSwitch(fnCallback, oModel) {
|
|
103
|
+
// if there are multiple switches triggered very quickly this makes sure that they are being executed one after another
|
|
104
|
+
oModel._oVariantSwitchPromise = oModel._oVariantSwitchPromise
|
|
105
|
+
.catch(function() {})
|
|
106
|
+
.then(fnCallback);
|
|
107
|
+
VariantManagementState.setVariantSwitchPromise(oModel.sFlexReference, oModel._oVariantSwitchPromise);
|
|
108
|
+
return oModel._oVariantSwitchPromise;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
async function handleDirtyChanges(oFlexController, aDirtyChanges, sVariantManagementReference, oAppComponent, oVariantModel) {
|
|
112
|
+
if (!oVariantModel._bDesignTimeMode) {
|
|
113
|
+
const oResponse = await oFlexController.saveSequenceOfDirtyChanges(aDirtyChanges, oAppComponent);
|
|
114
|
+
if (oResponse) {
|
|
115
|
+
const oVariantFlexObject = oResponse.response.find((oFlexObject) => oFlexObject.fileType === "ctrl_variant");
|
|
116
|
+
const oAffectedVariant = oVariantModel.oData[sVariantManagementReference].variants
|
|
117
|
+
.find((oVariant) => oVariant.key === oVariantFlexObject.fileName);
|
|
118
|
+
const oSupportInformation = oAffectedVariant.instance.getSupportInformation();
|
|
119
|
+
oSupportInformation.user = oVariantFlexObject.support.user;
|
|
120
|
+
oAffectedVariant.instance.setSupportInformation(oSupportInformation);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// TODO: as soon as the invalidation is done automatically this can be removed
|
|
124
|
+
oVariantModel.invalidateMap();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function getAdaptationId(sLayer, oControl, sFlexReference) {
|
|
129
|
+
var mContextBasedAdaptationBag = {
|
|
130
|
+
layer: sLayer,
|
|
131
|
+
control: oControl,
|
|
132
|
+
reference: sFlexReference
|
|
133
|
+
};
|
|
134
|
+
// the VariantManager uses the ContextBasedAdaptationsAPI to fetch the adaptation id,
|
|
135
|
+
// and the ContextBasedAdaptationsAPI uses the VariantManager to create changes
|
|
136
|
+
// TODO: the logic needs to be refactored to get rid of this circular dependency
|
|
137
|
+
var bHasAdaptationsModel = ContextBasedAdaptationsAPI.hasAdaptationsModel(mContextBasedAdaptationBag);
|
|
138
|
+
return bHasAdaptationsModel && ContextBasedAdaptationsAPI.getDisplayedAdaptationId(mContextBasedAdaptationBag);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Handler for "select" event fired from a variant management control. Adds to the variant switch promise chain,
|
|
143
|
+
* resolving when new variant (if applicable) has been switched and all source variant dirty changes have been removed.
|
|
144
|
+
*
|
|
145
|
+
* @param {sap.ui.base.Event} oEvent - Event object
|
|
146
|
+
* @param {object} mPropertyBag - Object with properties
|
|
147
|
+
* @param {string} mPropertyBag.vmReference - Variant management reference
|
|
148
|
+
* @param {sap.ui.fl.variants.VariantModel} mPropertyBag.model - Variant model instance
|
|
149
|
+
* @returns {Promise<undefined>} Resolves with undefined
|
|
150
|
+
*/
|
|
151
|
+
VariantManager.handleSelectVariant = function(oEvent, mPropertyBag) {
|
|
152
|
+
return executeAfterSwitch(async function(mParameters, mVariantProperties) {
|
|
153
|
+
var oModel = mVariantProperties.model;
|
|
154
|
+
var sVMReference = mVariantProperties.vmReference;
|
|
155
|
+
var bVariantSwitch = false;
|
|
156
|
+
var bOldVariantWasModified = ObjectPath.get([sVMReference, "modified"], oModel.oData);
|
|
157
|
+
var sTargetVReference = mParameters.key;
|
|
158
|
+
var sSourceVReference = mParameters.key;
|
|
159
|
+
// for standard variants 'currentVariant' property is not set
|
|
160
|
+
// e.g. variants generated through _ensureStandardVariantExists()
|
|
161
|
+
if (
|
|
162
|
+
ObjectPath.get([sVMReference, "currentVariant"], oModel.oData)
|
|
163
|
+
&& oModel.oData[sVMReference].currentVariant !== sTargetVReference
|
|
164
|
+
) {
|
|
165
|
+
sSourceVReference = oModel.oData[sVMReference].currentVariant;
|
|
166
|
+
bVariantSwitch = true;
|
|
167
|
+
await oModel.updateCurrentVariant({
|
|
168
|
+
variantManagementReference: sVMReference,
|
|
169
|
+
newVariantReference: sTargetVReference,
|
|
170
|
+
appComponent: oModel.oAppComponent,
|
|
171
|
+
internallyCalled: true
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
if (bOldVariantWasModified) {
|
|
175
|
+
var aControlChanges = VariantManagementState.getControlChangesForVariant({
|
|
176
|
+
reference: oModel.sFlexReference,
|
|
177
|
+
vmReference: sVMReference,
|
|
178
|
+
vReference: sSourceVReference
|
|
179
|
+
});
|
|
180
|
+
await eraseDirtyChanges({
|
|
181
|
+
changes: aControlChanges,
|
|
182
|
+
vmReference: sVMReference,
|
|
183
|
+
vReference: sSourceVReference,
|
|
184
|
+
revert: !bVariantSwitch,
|
|
185
|
+
model: oModel
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
// the variant switch already calls the listeners
|
|
189
|
+
if (!bVariantSwitch) {
|
|
190
|
+
oModel.callVariantSwitchListeners(sVMReference, oModel.oData[sVMReference].currentVariant);
|
|
191
|
+
}
|
|
192
|
+
}.bind(null, oEvent.getParameters(), mPropertyBag), mPropertyBag.model);
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
VariantManager.handleManageEvent = async function(oEvent, oData, oVariantModel) {
|
|
196
|
+
const sVMReference = oData.variantManagementReference;
|
|
197
|
+
if (!oVariantModel.oFlexController || !oVariantModel.getData()) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
const {
|
|
201
|
+
changes: aConfigurationChangesContent,
|
|
202
|
+
variantsToBeDeleted: aVariantsToBeDeleted
|
|
203
|
+
} = oVariantModel._collectModelChanges(sVMReference, Layer.USER, oEvent);
|
|
204
|
+
|
|
205
|
+
if (aConfigurationChangesContent.some((oChange) => {
|
|
206
|
+
return oChange.visible === false
|
|
207
|
+
&& oChange.variantReference === oVariantModel.getCurrentVariantReference(sVMReference);
|
|
208
|
+
})) {
|
|
209
|
+
await oVariantModel.updateCurrentVariant({
|
|
210
|
+
variantManagementReference: sVMReference,
|
|
211
|
+
newVariantReference: sVMReference
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
aConfigurationChangesContent.forEach(function(oChangeProperties) {
|
|
216
|
+
oChangeProperties.appComponent = oVariantModel.oAppComponent;
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
const aNewVariantChanges = VariantManager.addVariantChanges(sVMReference, aConfigurationChangesContent);
|
|
220
|
+
const aVariantDeletionChanges = aVariantsToBeDeleted
|
|
221
|
+
.map((sVariantKey) => {
|
|
222
|
+
const oVariant = VariantManagementState.getVariant({
|
|
223
|
+
reference: oVariantModel.sFlexReference,
|
|
224
|
+
vmReference: sVMReference,
|
|
225
|
+
vReference: sVariantKey
|
|
226
|
+
});
|
|
227
|
+
if (oVariant.layer === Layer.USER) {
|
|
228
|
+
return ControlVariantWriteUtils.deleteVariant(oVariantModel.sFlexReference, sVMReference, sVariantKey);
|
|
229
|
+
}
|
|
230
|
+
return [];
|
|
231
|
+
})
|
|
232
|
+
.flat();
|
|
233
|
+
// Save all changes unless they were just added and then removed immediately
|
|
234
|
+
// or are deleted and still dirty and were thus directly removed from the state
|
|
235
|
+
const aChanges = [
|
|
236
|
+
..._difference(aNewVariantChanges, aVariantDeletionChanges),
|
|
237
|
+
...aVariantDeletionChanges.filter((oChange) => oChange.getState() !== States.LifecycleState.NEW)
|
|
238
|
+
];
|
|
239
|
+
// Always pass the pre-defined changes here to avoid that UI changes that are part of the FlexState
|
|
240
|
+
// are also persisted during variant manage save
|
|
241
|
+
oVariantModel.oChangePersistence.saveDirtyChanges(oVariantModel.oAppComponent, false, aChanges);
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
VariantManager.handleSaveEvent = async function(oVariantManagementControl, mParameters, oVariantModel) {
|
|
245
|
+
var oAppComponent = Utils.getAppComponentForControl(oVariantManagementControl);
|
|
246
|
+
var sVMReference = oVariantModel.getLocalId(oVariantManagementControl.getId(), oAppComponent);
|
|
247
|
+
var aNewVariantDirtyChanges;
|
|
248
|
+
|
|
249
|
+
await executeAfterSwitch(async function(sVariantManagementReference, oAppComponent, mParameters) {
|
|
250
|
+
var sSourceVariantReference = oVariantModel.getCurrentVariantReference(sVariantManagementReference);
|
|
251
|
+
var aSourceVariantChanges = VariantManagementState.getControlChangesForVariant({
|
|
252
|
+
reference: oVariantModel.sFlexReference,
|
|
253
|
+
vmReference: sVariantManagementReference,
|
|
254
|
+
vReference: sSourceVariantReference
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
if (mParameters.overwrite) {
|
|
258
|
+
// handle triggered "Save" button
|
|
259
|
+
// Includes special handling for PUBLIC variant which requires changing all the dirty changes to PUBLIC layer before saving
|
|
260
|
+
aNewVariantDirtyChanges = oVariantModel._getDirtyChangesFromVariantChanges(aSourceVariantChanges);
|
|
261
|
+
if (oVariantModel.getVariant(sSourceVariantReference, sVariantManagementReference).layer === Layer.PUBLIC) {
|
|
262
|
+
aNewVariantDirtyChanges.forEach((oChange) => oChange.setLayer(Layer.PUBLIC));
|
|
263
|
+
}
|
|
264
|
+
const oResponse = oVariantModel.oFlexController.saveSequenceOfDirtyChanges(
|
|
265
|
+
aNewVariantDirtyChanges,
|
|
266
|
+
oAppComponent
|
|
267
|
+
);
|
|
268
|
+
// TODO: as soon as the invalidation is done automatically this can be removed
|
|
269
|
+
oVariantModel.invalidateMap();
|
|
270
|
+
return oResponse;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
var sVariantLayer = mParameters.layer || (mParameters.public ? Layer.PUBLIC : Layer.USER);
|
|
274
|
+
var sVariantChangeLayer = mParameters.layer || Layer.USER;
|
|
275
|
+
|
|
276
|
+
// handle triggered "SaveAs" button
|
|
277
|
+
var sNewVariantReference = mParameters.newVariantReference || Utils.createDefaultFileName("flVariant");
|
|
278
|
+
var mPropertyBag = {
|
|
279
|
+
variantManagementReference: sVariantManagementReference,
|
|
280
|
+
appComponent: oAppComponent,
|
|
281
|
+
layer: sVariantLayer,
|
|
282
|
+
title: mParameters.name,
|
|
283
|
+
contexts: mParameters.contexts,
|
|
284
|
+
sourceVariantReference: sSourceVariantReference,
|
|
285
|
+
newVariantReference: sNewVariantReference,
|
|
286
|
+
generator: mParameters.generator,
|
|
287
|
+
additionalVariantChanges: [],
|
|
288
|
+
adaptationId: getAdaptationId(sVariantChangeLayer, oAppComponent, oVariantModel.sFlexReference)
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
var oBaseChangeProperties = {
|
|
292
|
+
content: {},
|
|
293
|
+
reference: oVariantModel.sFlexReference,
|
|
294
|
+
generator: mPropertyBag.generator,
|
|
295
|
+
layer: sVariantChangeLayer,
|
|
296
|
+
adaptationId: mPropertyBag.adaptationId
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
if (mParameters.def) {
|
|
300
|
+
var mPropertyBagSetDefault = merge({
|
|
301
|
+
changeType: "setDefault",
|
|
302
|
+
content: {
|
|
303
|
+
defaultVariant: sNewVariantReference
|
|
304
|
+
},
|
|
305
|
+
fileType: "ctrl_variant_management_change",
|
|
306
|
+
selector: JsControlTreeModifier.getSelector(sVariantManagementReference, mPropertyBag.appComponent)
|
|
307
|
+
}, oBaseChangeProperties);
|
|
308
|
+
mPropertyBag.additionalVariantChanges.push(FlexObjectFactory.createUIChange(mPropertyBagSetDefault));
|
|
309
|
+
}
|
|
310
|
+
if (mParameters.execute) {
|
|
311
|
+
var mPropertyBagSetExecute = merge({
|
|
312
|
+
changeType: "setExecuteOnSelect",
|
|
313
|
+
content: {
|
|
314
|
+
executeOnSelect: true
|
|
315
|
+
},
|
|
316
|
+
fileType: "ctrl_variant_change",
|
|
317
|
+
selector: JsControlTreeModifier.getSelector(mPropertyBag.newVariantReference, mPropertyBag.appComponent)
|
|
318
|
+
}, oBaseChangeProperties);
|
|
319
|
+
mPropertyBag.additionalVariantChanges.push(FlexObjectFactory.createUIChange(mPropertyBagSetExecute));
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
const aCopiedVariantDirtyChanges = await VariantManager.copyVariant(mPropertyBag);
|
|
323
|
+
aNewVariantDirtyChanges = aCopiedVariantDirtyChanges;
|
|
324
|
+
// unsaved changes on the source variant are removed before copied variant changes are saved
|
|
325
|
+
await eraseDirtyChanges({
|
|
326
|
+
changes: aSourceVariantChanges,
|
|
327
|
+
vmReference: sVariantManagementReference,
|
|
328
|
+
vReference: sSourceVariantReference,
|
|
329
|
+
model: oVariantModel
|
|
330
|
+
});
|
|
331
|
+
return handleDirtyChanges(
|
|
332
|
+
oVariantModel.oFlexController,
|
|
333
|
+
aNewVariantDirtyChanges,
|
|
334
|
+
sVariantManagementReference,
|
|
335
|
+
oAppComponent,
|
|
336
|
+
oVariantModel
|
|
337
|
+
);
|
|
338
|
+
}.bind(oVariantModel, sVMReference, oAppComponent, mParameters), oVariantModel);
|
|
339
|
+
return aNewVariantDirtyChanges;
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Adds and applies the given changes.
|
|
344
|
+
*
|
|
345
|
+
* @param {Array<sap.ui.fl.apply._internal.flexObjects.FlexObject>} aChanges Changes to be applied
|
|
346
|
+
* @param {sap.ui.core.Control} oControl - Control instance to fetch the variant model
|
|
347
|
+
* @returns {Promise<undefined>} Promise resolving when all changes are applied
|
|
348
|
+
*/
|
|
349
|
+
VariantManager.addAndApplyChangesOnVariant = function(aChanges, oControl) {
|
|
350
|
+
const oVariantModel = getVariantModel(oControl);
|
|
351
|
+
const aAddedChanges = UIChangeManager.addDirtyChanges(oVariantModel.sFlexReference, aChanges, oVariantModel.oAppComponent);
|
|
352
|
+
return aAddedChanges.reduce(async function(oPreviousPromise, oChange) {
|
|
353
|
+
await oPreviousPromise;
|
|
354
|
+
const oControl = Element.getElementById(
|
|
355
|
+
JsControlTreeModifier.getControlIdBySelector(oChange.getSelector(), oVariantModel.oAppComponent)
|
|
356
|
+
);
|
|
357
|
+
const oReturn = await Applier.applyChangeOnControl(oChange, oControl, {
|
|
358
|
+
modifier: JsControlTreeModifier,
|
|
359
|
+
appComponent: oVariantModel.oAppComponent,
|
|
360
|
+
view: Utils.getViewForControl(oControl)
|
|
361
|
+
});
|
|
362
|
+
if (!oReturn.success) {
|
|
363
|
+
var oException = oReturn.error || new Error("The change could not be applied.");
|
|
364
|
+
FlexObjectManager.deleteFlexObjects({
|
|
365
|
+
reference: oVariantModel.sFlexReference,
|
|
366
|
+
flexObjects: [oChange]
|
|
367
|
+
});
|
|
368
|
+
throw oException;
|
|
369
|
+
}
|
|
370
|
+
}, Promise.resolve());
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Erases dirty changes on a given variant and returns the dirty changes.
|
|
375
|
+
*
|
|
376
|
+
* @param {string} sVariantManagementReference - Variant management reference
|
|
377
|
+
* @param {string} sVariantReference - Variant reference to remove dirty changes from
|
|
378
|
+
* @param {sap.ui.core.Control} oControl - Control instance to fetch the variant model
|
|
379
|
+
* @returns {Promise<sap.ui.fl.apply._internal.flexObjects.FlexObject[]>} Resolves with the removed dirty changes
|
|
380
|
+
*/
|
|
381
|
+
VariantManager.eraseDirtyChangesOnVariant = async function(sVariantManagementReference, sVariantReference, oControl) {
|
|
382
|
+
const oVariantModel = getVariantModel(oControl);
|
|
383
|
+
var aSourceVariantChanges = VariantManagementState.getControlChangesForVariant({
|
|
384
|
+
reference: oVariantModel.sFlexReference,
|
|
385
|
+
vmReference: sVariantManagementReference,
|
|
386
|
+
vReference: sVariantReference
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
var aSourceVariantDirtyChanges = oVariantModel._getDirtyChangesFromVariantChanges(aSourceVariantChanges);
|
|
390
|
+
|
|
391
|
+
await eraseDirtyChanges({
|
|
392
|
+
changes: aSourceVariantChanges,
|
|
393
|
+
vmReference: sVariantManagementReference,
|
|
394
|
+
vReference: sVariantReference,
|
|
395
|
+
model: oVariantModel,
|
|
396
|
+
revert: true
|
|
397
|
+
});
|
|
398
|
+
return aSourceVariantDirtyChanges;
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Copies a variant.
|
|
403
|
+
*
|
|
404
|
+
* @param {object} mPropertyBag - Map of properties
|
|
405
|
+
* @param {string} mPropertyBag.variantManagementReference - Variant management reference
|
|
406
|
+
* @param {string} mPropertyBag.title - Title for the variant
|
|
407
|
+
* @param {sap.ui.core.Component} mPropertyBag.appComponent - Model's app component
|
|
408
|
+
* @param {string} mPropertyBag.layer - Layer on which the new variant should be created
|
|
409
|
+
* @param {string} mPropertyBag.newVariantReference - <code>variantReference</code> for the new variant
|
|
410
|
+
* @param {string} mPropertyBag.sourceVariantReference - <code>variantReference</code> of the source variant
|
|
411
|
+
* @param {string} mPropertyBag.generator - Information about who created the change
|
|
412
|
+
* @param {object} mPropertyBag.contexts - Context structure containing roles and countries
|
|
413
|
+
* @param {sap.ui.core.Control} oControl - Control instance to fetch the variant model
|
|
414
|
+
* @returns {Promise<sap.ui.fl.apply._internal.flexObjects.FlexObject[]>} Resolves with dirty changes created during variant copy
|
|
415
|
+
* @private
|
|
416
|
+
*/
|
|
417
|
+
VariantManager.copyVariant = async function(mPropertyBag) {
|
|
418
|
+
const oVariantModel = getVariantModel(mPropertyBag.appComponent);
|
|
419
|
+
var oDuplicateVariantData = oVariantModel._duplicateVariant(mPropertyBag);
|
|
420
|
+
oDuplicateVariantData.generator = mPropertyBag.generator;
|
|
421
|
+
|
|
422
|
+
oVariantModel.oData[mPropertyBag.variantManagementReference].variants.push({
|
|
423
|
+
key: oDuplicateVariantData.instance.getId(),
|
|
424
|
+
rename: true,
|
|
425
|
+
change: true,
|
|
426
|
+
remove: true,
|
|
427
|
+
sharing: mPropertyBag.layer === Layer.USER
|
|
428
|
+
? oVariantModel.sharing.PRIVATE
|
|
429
|
+
: oVariantModel.sharing.PUBLIC
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
var aChanges = [];
|
|
433
|
+
|
|
434
|
+
// when created a new public variant other users do not see the new public variant
|
|
435
|
+
if (mPropertyBag.layer === Layer.PUBLIC) {
|
|
436
|
+
oDuplicateVariantData.instance.setFavorite(false);
|
|
437
|
+
var oChangeProperties = {
|
|
438
|
+
selector: JsControlTreeModifier.getSelector(mPropertyBag.newVariantReference, mPropertyBag.appComponent),
|
|
439
|
+
changeType: "setFavorite",
|
|
440
|
+
fileType: "ctrl_variant_change",
|
|
441
|
+
generator: mPropertyBag.generator,
|
|
442
|
+
layer: Layer.USER,
|
|
443
|
+
reference: oVariantModel.sFlexReference,
|
|
444
|
+
content: {favorite: true}
|
|
445
|
+
};
|
|
446
|
+
aChanges.push(FlexObjectFactory.createUIChange(oChangeProperties));
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
// sets copied variant and associated changes as dirty
|
|
450
|
+
aChanges = FlexObjectManager.addDirtyFlexObjects(
|
|
451
|
+
oVariantModel.sFlexReference,
|
|
452
|
+
aChanges
|
|
453
|
+
.concat([oDuplicateVariantData.instance]
|
|
454
|
+
.concat(oDuplicateVariantData.controlChanges)
|
|
455
|
+
.concat(mPropertyBag.additionalVariantChanges))
|
|
456
|
+
);
|
|
457
|
+
|
|
458
|
+
await oVariantModel.updateCurrentVariant({
|
|
459
|
+
variantManagementReference: mPropertyBag.variantManagementReference,
|
|
460
|
+
newVariantReference: oDuplicateVariantData.instance.getId(),
|
|
461
|
+
appComponent: mPropertyBag.appComponent,
|
|
462
|
+
internallyCalled: true,
|
|
463
|
+
scenario: "saveAs"
|
|
464
|
+
});
|
|
465
|
+
return aChanges;
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
VariantManager.removeVariant = async function(mPropertyBag) {
|
|
469
|
+
const oVariantModel = getVariantModel(mPropertyBag.appComponent);
|
|
470
|
+
var aChangesToBeDeleted = FlexObjectState.getDirtyFlexObjects(oVariantModel.sFlexReference)
|
|
471
|
+
.filter(function(oChange) {
|
|
472
|
+
return (oChange.getVariantReference && oChange.getVariantReference() === mPropertyBag.variant.getId()) ||
|
|
473
|
+
oChange.getId() === mPropertyBag.variant.getId();
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
await oVariantModel.updateCurrentVariant({
|
|
477
|
+
variantManagementReference: mPropertyBag.variantManagementReference,
|
|
478
|
+
newVariantReference: mPropertyBag.sourceVariantReference,
|
|
479
|
+
appComponent: mPropertyBag.component
|
|
480
|
+
});
|
|
481
|
+
FlexObjectManager.deleteFlexObjects({
|
|
482
|
+
reference: oVariantModel.sFlexReference,
|
|
483
|
+
flexObjects: aChangesToBeDeleted
|
|
484
|
+
});
|
|
485
|
+
};
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* Sets the variant properties and adds a variant change
|
|
489
|
+
*
|
|
490
|
+
* @param {string} sVariantManagementReference - Variant management reference
|
|
491
|
+
* @param {object} mPropertyBag - Map of properties
|
|
492
|
+
* @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject} Created Change object
|
|
493
|
+
*/
|
|
494
|
+
VariantManager.addVariantChange = function(sVariantManagementReference, mPropertyBag) {
|
|
495
|
+
const oVariantModel = getVariantModel(mPropertyBag.appComponent);
|
|
496
|
+
var oChange = VariantManager.createVariantChange(sVariantManagementReference, mPropertyBag);
|
|
497
|
+
FlexObjectManager.addDirtyFlexObjects(oVariantModel.sFlexReference, [oChange]);
|
|
498
|
+
|
|
499
|
+
return oChange;
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* Sets the variant properties and adds variant changes
|
|
504
|
+
* @param {string} sVariantManagementReference - Variant management reference
|
|
505
|
+
* @param {object[]} aChangePropertyMaps - Array of property maps optionally including the adaptation ID
|
|
506
|
+
* @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} Created Change objects
|
|
507
|
+
*/
|
|
508
|
+
VariantManager.addVariantChanges = function(sVariantManagementReference, aChangePropertyMaps) {
|
|
509
|
+
const oVariantModel = getVariantModel(aChangePropertyMaps[0].appComponent);
|
|
510
|
+
var aChanges = aChangePropertyMaps.map(function(mProperties) {
|
|
511
|
+
return VariantManager.createVariantChange(sVariantManagementReference, mProperties);
|
|
512
|
+
});
|
|
513
|
+
FlexObjectManager.addDirtyFlexObjects(oVariantModel.sFlexReference, aChanges);
|
|
514
|
+
|
|
515
|
+
return aChanges;
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Sets the variant properties and deletes a variant change
|
|
520
|
+
*
|
|
521
|
+
* @param {string} sVariantManagementReference - Variant management reference
|
|
522
|
+
* @param {object} mPropertyBag - Property bag
|
|
523
|
+
* @param {sap.ui.fl.apply._internal.flexObjects.FlexObject} oChange - Variant change to be deleted
|
|
524
|
+
*/
|
|
525
|
+
VariantManager.deleteVariantChange = function(sVariantManagementReference, mPropertyBag, oChange) {
|
|
526
|
+
const oVariantModel = getVariantModel(mPropertyBag.appComponent);
|
|
527
|
+
oVariantModel.setVariantProperties(sVariantManagementReference, mPropertyBag);
|
|
528
|
+
FlexObjectManager.deleteFlexObjects({
|
|
529
|
+
reference: oVariantModel.sFlexReference,
|
|
530
|
+
flexObjects: [oChange]
|
|
531
|
+
});
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Sets the variant properties and creates a variant change
|
|
536
|
+
*
|
|
537
|
+
* @param {string} sVariantManagementReference - Variant management reference
|
|
538
|
+
* @param {object} mPropertyBag - Map of properties
|
|
539
|
+
* @param {string} [mPropertyBag.adaptationId] - Adaptation ID to set which overrules the currently display adaptation
|
|
540
|
+
* @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject} Created Change object
|
|
541
|
+
*/
|
|
542
|
+
VariantManager.createVariantChange = function(sVariantManagementReference, mPropertyBag) {
|
|
543
|
+
const oVariantModel = getVariantModel(mPropertyBag.appComponent);
|
|
544
|
+
var mAdditionalChangeContent = oVariantModel.setVariantProperties(sVariantManagementReference, mPropertyBag);
|
|
545
|
+
|
|
546
|
+
var mNewChangeData = {
|
|
547
|
+
changeType: mPropertyBag.changeType,
|
|
548
|
+
layer: mPropertyBag.layer,
|
|
549
|
+
generator: mPropertyBag.generator,
|
|
550
|
+
reference: oVariantModel.sFlexReference
|
|
551
|
+
};
|
|
552
|
+
|
|
553
|
+
if (mPropertyBag.adaptationId !== undefined) {
|
|
554
|
+
mNewChangeData.adaptationId = mPropertyBag.adaptationId;
|
|
555
|
+
} else {
|
|
556
|
+
mNewChangeData.adaptationId = getAdaptationId(mPropertyBag.layer, mPropertyBag.appComponent, oVariantModel.sFlexReference);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
if (mPropertyBag.changeType === "setDefault") {
|
|
560
|
+
mNewChangeData.fileType = "ctrl_variant_management_change";
|
|
561
|
+
mNewChangeData.selector = JsControlTreeModifier.getSelector(sVariantManagementReference, mPropertyBag.appComponent);
|
|
562
|
+
} else {
|
|
563
|
+
mNewChangeData.fileType = "ctrl_variant_change";
|
|
564
|
+
mNewChangeData.selector = JsControlTreeModifier.getSelector(mPropertyBag.variantReference, mPropertyBag.appComponent);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
var oChange = FlexObjectFactory.createUIChange(mNewChangeData);
|
|
568
|
+
// update change with additional content
|
|
569
|
+
oChange.setContent(mAdditionalChangeContent);
|
|
570
|
+
if (mPropertyBag.changeType === "setTitle") {
|
|
571
|
+
oChange.setText("title", mPropertyBag.title, "XFLD");
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
return oChange;
|
|
575
|
+
};
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* Opens the <i>Manage Views</i> dialog.
|
|
579
|
+
* Returns a promise which resolves to changes made from the manage dialog, based on the parameters passed.
|
|
580
|
+
*
|
|
581
|
+
* @param {sap.ui.fl.variants.VariantManagement} oVariantManagementControl - Variant management control
|
|
582
|
+
* @param {string} sVMReference - Variant management reference
|
|
583
|
+
* @param {string} sLayer - Current layer
|
|
584
|
+
* @param {string} sClass - Style class assigned to the management dialog
|
|
585
|
+
* @param {Promise<sap.ui.core.ComponentContainer>} oContextSharingComponentPromise - Promise resolving with the ComponentContainer
|
|
586
|
+
* @returns {Promise<void>} Resolves when "manage" event is fired from the variant management control
|
|
587
|
+
* @private
|
|
588
|
+
* @ui5-restricted
|
|
589
|
+
*/
|
|
590
|
+
VariantManager.manageVariants = function(oVariantManagementControl, sVMReference, sLayer, sClass, oContextSharingComponentPromise) {
|
|
591
|
+
const oVariantModel = getVariantModel(oVariantManagementControl);
|
|
592
|
+
// called from the ControlVariant plugin in Adaptation mode
|
|
593
|
+
return new Promise(function(resolve) {
|
|
594
|
+
oVariantManagementControl.attachEventOnce("manage", {
|
|
595
|
+
resolve,
|
|
596
|
+
variantManagementReference: sVMReference,
|
|
597
|
+
layer: sLayer
|
|
598
|
+
}, oVariantModel.fnManageClickRta, oVariantModel);
|
|
599
|
+
oVariantManagementControl.openManagementDialog(true, sClass, oContextSharingComponentPromise);
|
|
600
|
+
});
|
|
601
|
+
};
|
|
602
|
+
|
|
603
|
+
return VariantManager;
|
|
604
|
+
});
|