@openui5/sap.ui.fl 1.107.0 → 1.108.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/THIRDPARTY.txt +1 -1
- package/package.json +3 -3
- package/src/sap/ui/fl/.library +1 -1
- package/src/sap/ui/fl/Cache.js +1 -1
- package/src/sap/ui/fl/ChangePersistence.js +1 -1
- 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 +1 -1
- package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/Utils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddAnnotationsToOData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/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/SetTitle.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetAbstract.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/AddNewCard.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/ChangeCard.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddLibrary.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetFlexExtensionPointEnabled.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetMinUI5Version.js +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/flexObjects/AppDescriptorChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +3 -3
- package/src/sap/ui/fl/apply/_internal/flexObjects/ControllerExtensionChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlVariant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +14 -1
- 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/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 +1 -1
- package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +1 -1
- package/src/sap/ui/fl/apply/_internal/preprocessors/EventHistory.js +1 -1
- package/src/sap/ui/fl/apply/_internal/preprocessors/RegistrationDelegator.js +1 -1
- package/src/sap/ui/fl/apply/_internal/preprocessors/XmlPreprocessor.js +1 -1
- package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +1 -1
- 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/codeExt/CodeExtManager.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/Storage.js +1 -1
- package/src/sap/ui/fl/initial/_internal/StorageUtils.js +11 -6
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration.js +1 -1
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +1 -1
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeRegistryItem.js +1 -1
- package/src/sap/ui/fl/initial/_internal/connectors/BackendConnector.js +18 -4
- package/src/sap/ui/fl/initial/_internal/connectors/KeyUserConnector.js +14 -3
- package/src/sap/ui/fl/initial/_internal/connectors/LrepConnector.js +3 -0
- package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +1 -1
- package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +1 -1
- package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +1 -1
- package/src/sap/ui/fl/interfaces/Delegate.js +1 -1
- package/src/sap/ui/fl/library.js +43 -43
- package/src/sap/ui/fl/registry/Settings.js +39 -4
- package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +1 -1
- package/src/sap/ui/fl/support/_internal/getFlexSettings.js +1 -1
- package/src/sap/ui/fl/support/api/SupportAPI.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +1 -1
- package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
- 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 +1 -1
- package/src/sap/ui/fl/variants/context/Component.js +15 -0
- package/src/sap/ui/fl/variants/context/controller/ContextVisibility.controller.js +2 -2
- package/src/sap/ui/fl/variants/context/view/ContextVisibility.view.xml +4 -4
- package/src/sap/ui/fl/write/_internal/Storage.js +1 -1
- package/src/sap/ui/fl/write/_internal/StorageFeaturesMerger.js +8 -1
- package/src/sap/ui/fl/write/_internal/Versions.js +1 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +1 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +1 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChange.js +1 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory.js +1 -1
- package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +10 -4
- package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +7 -7
- package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +5 -1
- package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +25 -20
- package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +8 -4
- package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +20 -4
- 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/extensionPoint/Registry.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPAccess.js +4 -13
- 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/FlexObjectState.js +21 -1
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +72 -3
- 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/ContextSharingAPI.js +13 -5
- package/src/sap/ui/fl/write/api/ControlPersonalizationWriteAPI.js +35 -17
- package/src/sap/ui/fl/write/api/FeaturesAPI.js +5 -3
- package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
- package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +11 -0
- package/src/sap/ui/fl/write/api/SmartVariantManagementWriteAPI.js +85 -2
|
@@ -261,7 +261,7 @@ sap.ui.define([
|
|
|
261
261
|
*
|
|
262
262
|
* @namespace sap.ui.fl.write._internal.flexState.compVariants.CompVariantState
|
|
263
263
|
* @since 1.83
|
|
264
|
-
* @version 1.
|
|
264
|
+
* @version 1.108.0
|
|
265
265
|
* @private
|
|
266
266
|
* @ui5-restricted sap.ui.fl
|
|
267
267
|
*/
|
|
@@ -439,7 +439,8 @@ sap.ui.define([
|
|
|
439
439
|
previousFavorite: oVariant.getFavorite(),
|
|
440
440
|
previousExecuteOnSelection: oVariant.getExecuteOnSelection(),
|
|
441
441
|
previousContexts: oVariant.getContexts(),
|
|
442
|
-
previousName: oVariant.getName()
|
|
442
|
+
previousName: oVariant.getName(),
|
|
443
|
+
previousAction: mPropertyBag.action
|
|
443
444
|
}
|
|
444
445
|
};
|
|
445
446
|
oVariant.addRevertData(new CompVariantRevertData(oRevertData));
|
|
@@ -468,7 +469,7 @@ sap.ui.define([
|
|
|
468
469
|
|
|
469
470
|
function updateChange(mPropertyBag, oVariant, oChange) {
|
|
470
471
|
var aRevertData = oChange.getRevertData() || [];
|
|
471
|
-
var oChangeContent = oChange.getContent();
|
|
472
|
+
var oChangeContent = Object.assign({}, oChange.getContent());
|
|
472
473
|
var oRevertData = {
|
|
473
474
|
previousContent: Object.assign({}, oChangeContent),
|
|
474
475
|
previousState: oChange.getState(),
|
|
@@ -560,6 +561,54 @@ sap.ui.define([
|
|
|
560
561
|
return oVariant;
|
|
561
562
|
};
|
|
562
563
|
|
|
564
|
+
/**
|
|
565
|
+
* Discards the variant content to the original or last saved content;
|
|
566
|
+
*
|
|
567
|
+
* @param {object} mPropertyBag - Object with parameters as properties
|
|
568
|
+
* @param {string} mPropertyBag.reference - Flex reference of the application
|
|
569
|
+
* @param {sap.ui.comp.smartvariants.SmartVariantManagement|
|
|
570
|
+
* sap.ui.comp.smartfilterbar.SmartFilterBar|
|
|
571
|
+
* sap.ui.comp.smarttable.SmartTable|
|
|
572
|
+
* sap.ui.comp.smartchart.SmartChart} mPropertyBag.control - Variant management control for which the variant should be updated
|
|
573
|
+
* @param {string} mPropertyBag.id - ID of the variant
|
|
574
|
+
* @param {sap.ui.fl.Layer} [mPropertyBag.layer] - Layer in which the save of variant content takes place
|
|
575
|
+
* @returns {sap.ui.fl.apply._internal.flexObjects.CompVariant} The discarded variant
|
|
576
|
+
*/
|
|
577
|
+
CompVariantState.discardVariantContent = function(mPropertyBag) {
|
|
578
|
+
var oVariant = getVariantById(mPropertyBag);
|
|
579
|
+
var aVariantRevertData = oVariant.getRevertData();
|
|
580
|
+
if (aVariantRevertData.length !== 0) {
|
|
581
|
+
//Look at revert data backward, to find the content of last save action
|
|
582
|
+
var bIsVariantSaved = aVariantRevertData.slice().reverse().some(function (oRevertData) {
|
|
583
|
+
if (oRevertData.getContent().previousAction === CompVariantState.updateActionType.SAVE) {
|
|
584
|
+
mPropertyBag.content = oRevertData.getContent().previousContent;
|
|
585
|
+
mPropertyBag.action = CompVariantState.updateActionType.DISCARD;
|
|
586
|
+
return true;
|
|
587
|
+
}
|
|
588
|
+
});
|
|
589
|
+
|
|
590
|
+
if (!bIsVariantSaved) {
|
|
591
|
+
mPropertyBag.content = aVariantRevertData[0].getContent().previousContent;
|
|
592
|
+
mPropertyBag.action = CompVariantState.updateActionType.DISCARD;
|
|
593
|
+
}
|
|
594
|
+
//Update variant content to the last saved or original content
|
|
595
|
+
CompVariantState.updateVariant(mPropertyBag);
|
|
596
|
+
}
|
|
597
|
+
return oVariant;
|
|
598
|
+
};
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* Defines the different types of actions lead to a variant got update.
|
|
602
|
+
*
|
|
603
|
+
* @enum {string}
|
|
604
|
+
*/
|
|
605
|
+
CompVariantState.updateActionType = {
|
|
606
|
+
UPDATE: "update",
|
|
607
|
+
SAVE: "save",
|
|
608
|
+
DISCARD: "discard",
|
|
609
|
+
UPDATE_METADATA: "update_metadata"
|
|
610
|
+
};
|
|
611
|
+
|
|
563
612
|
/**
|
|
564
613
|
* Defines the different types of operations done on a variant.
|
|
565
614
|
* - StateUpdate only changes the variants persistence status. I.e. a removeVariant call only sets the variant to <code>DELETED</code>
|
|
@@ -825,5 +874,25 @@ sap.ui.define([
|
|
|
825
874
|
return Promise.all(aPromises);
|
|
826
875
|
};
|
|
827
876
|
|
|
877
|
+
/**
|
|
878
|
+
* Checks if dirty changes on SmartVariantManagement exist for a flex persistence associated by a reference;
|
|
879
|
+
*
|
|
880
|
+
* @param {string} sReference - Flex reference of the app
|
|
881
|
+
* @returns {boolean} <code>true</code> if dirty changes exist
|
|
882
|
+
*/
|
|
883
|
+
CompVariantState.hasDirtyChanges = function (sReference) {
|
|
884
|
+
var mCompEntities = FlexState.getCompVariantsMap(sReference);
|
|
885
|
+
var aEntities = [];
|
|
886
|
+
for (var sPersistencyKey in mCompEntities) {
|
|
887
|
+
var mCompVariantsOfPersistencyKey = mCompEntities[sPersistencyKey];
|
|
888
|
+
for (var sId in mCompVariantsOfPersistencyKey.byId) {
|
|
889
|
+
aEntities.push(mCompVariantsOfPersistencyKey.byId[sId]);
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
return aEntities.some(function(oFlexObject) {
|
|
893
|
+
return oFlexObject.getState() !== States.PERSISTED && !(oFlexObject.getVariantId && oFlexObject.getVariantId() === "*standard*");
|
|
894
|
+
});
|
|
895
|
+
};
|
|
896
|
+
|
|
828
897
|
return CompVariantState;
|
|
829
898
|
});
|
|
@@ -26,7 +26,7 @@ sap.ui.define([
|
|
|
26
26
|
* @private
|
|
27
27
|
* @alias sap.ui.fl.write._internal.transport.TransportSelection
|
|
28
28
|
* @author SAP SE
|
|
29
|
-
* @version 1.
|
|
29
|
+
* @version 1.108.0
|
|
30
30
|
* @since 1.74.0
|
|
31
31
|
* Helper object to select an ABAP transport for an LREP object. This is not a generic utility to select a transport request, but part
|
|
32
32
|
* of the SmartVariant control.
|
|
@@ -27,7 +27,7 @@ sap.ui.define([
|
|
|
27
27
|
* Entity that handles ABAP transport related information.
|
|
28
28
|
* @alias sap.ui.fl.write._internal.transport.Transports
|
|
29
29
|
* @author SAP SE
|
|
30
|
-
* @version 1.
|
|
30
|
+
* @version 1.108.0
|
|
31
31
|
* @since 1.74.0
|
|
32
32
|
* @private
|
|
33
33
|
* @ui5-restricted sap.ui.fl.write._internal.transport
|
|
@@ -5,13 +5,15 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
-
"sap/ui/fl/write/api/FeaturesAPI",
|
|
9
8
|
"sap/ui/fl/variants/context/Component",
|
|
10
|
-
"sap/ui/core/ComponentContainer"
|
|
9
|
+
"sap/ui/core/ComponentContainer",
|
|
10
|
+
"sap/ui/fl/Layer",
|
|
11
|
+
"sap/ui/fl/registry/Settings"
|
|
11
12
|
], function(
|
|
12
|
-
FeaturesAPI,
|
|
13
13
|
ContextSharingComponent,
|
|
14
|
-
ComponentContainer
|
|
14
|
+
ComponentContainer,
|
|
15
|
+
Layer,
|
|
16
|
+
Settings
|
|
15
17
|
) {
|
|
16
18
|
"use strict";
|
|
17
19
|
|
|
@@ -35,12 +37,18 @@ sap.ui.define([
|
|
|
35
37
|
*
|
|
36
38
|
* @param {object} mPropertyBag - Object with parameters as properties
|
|
37
39
|
* @param {string} [mPropertyBag.layer] - Layer
|
|
40
|
+
* @param {string} [mPropertyBag.isComp=true] - Flag if the control owning the Component is the comp.VariantManagement
|
|
38
41
|
* @returns {Promise<sap.ui.core.ComponentContainer>} Promise resolving with the ComponentContainer or nothing depending on the availability of the feature in the used back end
|
|
39
42
|
* @private
|
|
40
43
|
* @ui5-restricted sap.ui.comp, sap.ui.fl
|
|
41
44
|
*/
|
|
42
45
|
createComponent: function(mPropertyBag) {
|
|
43
|
-
|
|
46
|
+
if (mPropertyBag.layer !== Layer.CUSTOMER) {
|
|
47
|
+
return Promise.resolve();
|
|
48
|
+
}
|
|
49
|
+
return Settings.getInstance().then(function(oSettings) {
|
|
50
|
+
return (mPropertyBag.isComp) ? oSettings.isContextSharingEnabledForComp() : oSettings.isContextSharingEnabled();
|
|
51
|
+
}).then(function(bIsEnabled) {
|
|
44
52
|
if (bIsEnabled) {
|
|
45
53
|
if (!oComponentContainer || oComponentContainer.bIsDestroyed) {
|
|
46
54
|
var oComponent = new ContextSharingComponent("contextSharing");
|
|
@@ -9,6 +9,7 @@ sap.ui.define([
|
|
|
9
9
|
"sap/ui/core/util/reflection/JsControlTreeModifier",
|
|
10
10
|
"sap/ui/core/Core",
|
|
11
11
|
"sap/ui/core/Element",
|
|
12
|
+
"sap/ui/fl/apply/_internal/flexState/FlexState",
|
|
12
13
|
"sap/ui/fl/apply/_internal/controlVariants/Utils",
|
|
13
14
|
"sap/ui/fl/apply/api/FlexRuntimeInfoAPI",
|
|
14
15
|
"sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage",
|
|
@@ -21,6 +22,7 @@ sap.ui.define([
|
|
|
21
22
|
JsControlTreeModifier,
|
|
22
23
|
Core,
|
|
23
24
|
Element,
|
|
25
|
+
FlexState,
|
|
24
26
|
VariantUtils,
|
|
25
27
|
FlexRuntimeInfoAPI,
|
|
26
28
|
ChangeHandlerStorage,
|
|
@@ -187,15 +189,19 @@ sap.ui.define([
|
|
|
187
189
|
// Make sure to first create and add all changes so that change handlers
|
|
188
190
|
// that rely on change batching in the applier can wait for them, e.g.
|
|
189
191
|
// when adding multiple columns at once to a MDC table
|
|
190
|
-
return
|
|
191
|
-
.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
192
|
+
return FlexState.initialize({
|
|
193
|
+
componentId: oAppComponent.getId()
|
|
194
|
+
}).then(function() {
|
|
195
|
+
return createChanges()
|
|
196
|
+
.then(applyChanges)
|
|
197
|
+
.then(function() {
|
|
198
|
+
(mChangeCreationListeners[sFlexReference] || [])
|
|
199
|
+
.forEach(function(fnCallback) {
|
|
200
|
+
fnCallback(aSuccessfulChanges);
|
|
201
|
+
});
|
|
202
|
+
return aSuccessfulChanges;
|
|
203
|
+
});
|
|
204
|
+
});
|
|
199
205
|
},
|
|
200
206
|
|
|
201
207
|
/**
|
|
@@ -226,7 +232,10 @@ sap.ui.define([
|
|
|
226
232
|
return sLocalId || sControlId;
|
|
227
233
|
});
|
|
228
234
|
var oFlexController = FlexControllerFactory.createForControl(oAppComponent);
|
|
229
|
-
|
|
235
|
+
if (FlexState.isInitialized({control: oAppComponent})) {
|
|
236
|
+
return oFlexController.resetChanges(Layer.USER, undefined, oAppComponent, aSelectorIds, mPropertyBag.changeTypes);
|
|
237
|
+
}
|
|
238
|
+
return Promise.resolve();
|
|
230
239
|
},
|
|
231
240
|
|
|
232
241
|
/**
|
|
@@ -255,8 +264,11 @@ sap.ui.define([
|
|
|
255
264
|
}
|
|
256
265
|
|
|
257
266
|
var oFlexController = FlexControllerFactory.createForControl(oAppComponent);
|
|
258
|
-
|
|
259
|
-
|
|
267
|
+
if (FlexState.isInitialized({control: oAppComponent})) {
|
|
268
|
+
// limit the deletion to the passed selector control only
|
|
269
|
+
return oFlexController.removeDirtyChanges(Layer.USER, oAppComponent, mPropertyBag.selector, mPropertyBag.generator, mPropertyBag.changeTypes);
|
|
270
|
+
}
|
|
271
|
+
return Promise.resolve();
|
|
260
272
|
},
|
|
261
273
|
|
|
262
274
|
/**
|
|
@@ -279,11 +291,17 @@ sap.ui.define([
|
|
|
279
291
|
var oFlexController = FlexControllerFactory.createForControl(oAppComponent);
|
|
280
292
|
var oVariantModel = oAppComponent.getModel(Utils.VARIANT_MODEL_NAME);
|
|
281
293
|
var aVariantManagementReferences = getAllVariantManagementReferences(oAppComponent);
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
294
|
+
|
|
295
|
+
if (FlexState.isInitialized({control: oAppComponent})) {
|
|
296
|
+
return oFlexController.saveSequenceOfDirtyChanges(mPropertyBag.changes, oAppComponent)
|
|
297
|
+
.then(function(oResponse) {
|
|
298
|
+
if (oVariantModel) {
|
|
299
|
+
oVariantModel.checkDirtyStateForControlModels(aVariantManagementReferences);
|
|
300
|
+
}
|
|
301
|
+
return oResponse;
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
return Promise.resolve();
|
|
287
305
|
},
|
|
288
306
|
|
|
289
307
|
/**
|
|
@@ -6,11 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/ui/fl/registry/Settings",
|
|
9
|
-
"sap/ui/fl/write/_internal/Storage",
|
|
10
9
|
"sap/ui/fl/Layer"
|
|
11
10
|
], function(
|
|
12
11
|
Settings,
|
|
13
|
-
Storage,
|
|
14
12
|
Layer
|
|
15
13
|
) {
|
|
16
14
|
"use strict";
|
|
@@ -143,13 +141,17 @@ sap.ui.define([
|
|
|
143
141
|
* @param {string} sLayer - Layer to get correct connector
|
|
144
142
|
* @returns {Promise<boolean>} Resolves to a boolean indicating if context sharing is enabled
|
|
145
143
|
* @private
|
|
144
|
+
* @deprecated
|
|
146
145
|
* @ui5-restricted sap.ui.fl.write.api.ContextSharingAPI
|
|
147
146
|
*/
|
|
148
147
|
isContextSharingEnabled: function (sLayer) {
|
|
149
148
|
if (sLayer !== Layer.CUSTOMER) {
|
|
150
149
|
return Promise.resolve(false);
|
|
151
150
|
}
|
|
152
|
-
return
|
|
151
|
+
return Settings.getInstance()
|
|
152
|
+
.then(function (oSettings) {
|
|
153
|
+
return oSettings.isContextSharingEnabled({layer: sLayer});
|
|
154
|
+
});
|
|
153
155
|
}
|
|
154
156
|
};
|
|
155
157
|
|
|
@@ -80,6 +80,17 @@ sap.ui.define([
|
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Checks if dirty changes exist for the flex persistence associated with the selector control;
|
|
85
|
+
*
|
|
86
|
+
* @param {object} mPropertyBag Object with parameters as properties
|
|
87
|
+
* @param {sap.ui.fl.Selector} mPropertyBag.selector To retrieve the associated flex persistence
|
|
88
|
+
* @returns {boolean} <code>true</code> if dirty changes exist
|
|
89
|
+
*/
|
|
90
|
+
PersistenceWriteAPI.hasDirtyChanges = function(mPropertyBag) {
|
|
91
|
+
return FlexObjectState.hasDirtyFlexObjects(mPropertyBag);
|
|
92
|
+
};
|
|
93
|
+
|
|
83
94
|
/**
|
|
84
95
|
* Determines if user-specific changes or variants are present in the flex persistence.
|
|
85
96
|
*
|
|
@@ -36,7 +36,7 @@ sap.ui.define([
|
|
|
36
36
|
* @experimental
|
|
37
37
|
* @since 1.69.0
|
|
38
38
|
* @private
|
|
39
|
-
* @ui5-restricted sap.ui.comp
|
|
39
|
+
* @ui5-restricted sap.ui.comp, sap.ui.rta
|
|
40
40
|
*/
|
|
41
41
|
var SmartVariantManagementWriteAPI = /** @lends sap.ui.fl.write.api.SmartVariantManagementWriteAPI */{
|
|
42
42
|
/**
|
|
@@ -89,7 +89,7 @@ sap.ui.define([
|
|
|
89
89
|
* @param {object} [mPropertyBag.content] - Content of the new change
|
|
90
90
|
* @param {object} [mPropertyBag.favorite] - Flag if the variant should be flagged as a favorite
|
|
91
91
|
* @param {object} [mPropertyBag.executeOnSelection] - Flag if the variant should be executed on selection
|
|
92
|
-
* @param {sap.ui.fl.Layer} [mPropertyBag.layer] - Layer in which the variant
|
|
92
|
+
* @param {sap.ui.fl.Layer} [mPropertyBag.layer] - Layer in which the variant update takes place
|
|
93
93
|
* @param {boolean} [mPropertyBag.changeSpecificData.isUserDependent] - Flag if the variant is personalization only
|
|
94
94
|
* this either updates the variant from the layer or writes a change to that layer.
|
|
95
95
|
* @returns {sap.ui.fl.apply._internal.flexObjects.CompVariant} The updated variant
|
|
@@ -100,6 +100,89 @@ sap.ui.define([
|
|
|
100
100
|
return setReferenceAndPersistencyKeyInPropertyBagAndCallFunction(mPropertyBag, CompVariantState.updateVariant);
|
|
101
101
|
},
|
|
102
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Updates content of a variant; this may result in an update of the variant or the creation of a change.
|
|
105
|
+
*
|
|
106
|
+
* @param {object} mPropertyBag - Object with parameters as properties
|
|
107
|
+
* @param {string} mPropertyBag.reference - Flex reference of the application
|
|
108
|
+
* @param {sap.ui.comp.smartvariants.SmartVariantManagement|
|
|
109
|
+
* sap.ui.comp.smartfilterbar.SmartFilterBar|
|
|
110
|
+
* sap.ui.comp.smarttable.SmartTable|
|
|
111
|
+
* sap.ui.comp.smartchart.SmartChart} mPropertyBag.control - Variant management control for which the variant should be updated
|
|
112
|
+
* @param {string} mPropertyBag.id - ID of the variant
|
|
113
|
+
* @param {object} mPropertyBag.content - New content of the variant
|
|
114
|
+
* @param {sap.ui.fl.Layer} [mPropertyBag.layer] - Layer in which the variant content update takes place
|
|
115
|
+
* @returns {sap.ui.fl.apply._internal.flexObjects.CompVariant} The updated variant
|
|
116
|
+
* @private
|
|
117
|
+
* @ui5-restricted sap.ui.rta.command
|
|
118
|
+
*/
|
|
119
|
+
updateVariantContent: function (mPropertyBag) {
|
|
120
|
+
mPropertyBag.action = CompVariantState.updateActionType.UPDATE;
|
|
121
|
+
return setReferenceAndPersistencyKeyInPropertyBagAndCallFunction(mPropertyBag, CompVariantState.updateVariant);
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Saves the current content of a variant; this does not trigger the back end call to persist the variant.
|
|
126
|
+
*
|
|
127
|
+
* @param {object} mPropertyBag - Object with parameters as properties
|
|
128
|
+
* @param {string} mPropertyBag.reference - Flex reference of the application
|
|
129
|
+
* @param {sap.ui.comp.smartvariants.SmartVariantManagement|
|
|
130
|
+
* sap.ui.comp.smartfilterbar.SmartFilterBar|
|
|
131
|
+
* sap.ui.comp.smarttable.SmartTable|
|
|
132
|
+
* sap.ui.comp.smartchart.SmartChart} mPropertyBag.control - Variant management control for which the variant should be updated
|
|
133
|
+
* @param {string} mPropertyBag.id - ID of the variant
|
|
134
|
+
* @param {sap.ui.fl.Layer} [mPropertyBag.layer] - Layer in which the save of variant content takes place
|
|
135
|
+
* @private
|
|
136
|
+
* @ui5-restricted sap.ui.rta.command
|
|
137
|
+
*/
|
|
138
|
+
saveVariantContent: function (mPropertyBag) {
|
|
139
|
+
mPropertyBag.action = CompVariantState.updateActionType.SAVE;
|
|
140
|
+
return setReferenceAndPersistencyKeyInPropertyBagAndCallFunction(mPropertyBag, CompVariantState.updateVariant);
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Discards the variant content to the original or last saved content.
|
|
145
|
+
*
|
|
146
|
+
* @param {object} mPropertyBag - Object with parameters as properties
|
|
147
|
+
* @param {string} mPropertyBag.reference - Flex reference of the application
|
|
148
|
+
* @param {sap.ui.comp.smartvariants.SmartVariantManagement|
|
|
149
|
+
* sap.ui.comp.smartfilterbar.SmartFilterBar|
|
|
150
|
+
* sap.ui.comp.smarttable.SmartTable|
|
|
151
|
+
* sap.ui.comp.smartchart.SmartChart} mPropertyBag.control - Variant management control for which the variant should be updated
|
|
152
|
+
* @param {string} mPropertyBag.id - ID of the variant
|
|
153
|
+
* @param {sap.ui.fl.Layer} [mPropertyBag.layer] - Layer in which the save of variant content takes place
|
|
154
|
+
* @returns {sap.ui.fl.apply._internal.flexObjects.CompVariant} The discarded variant
|
|
155
|
+
* @private
|
|
156
|
+
* @ui5-restricted sap.ui.rta.command
|
|
157
|
+
*/
|
|
158
|
+
discardVariantContent: function (mPropertyBag) {
|
|
159
|
+
mPropertyBag.action = CompVariantState.updateActionType.DISCARD;
|
|
160
|
+
return setReferenceAndPersistencyKeyInPropertyBagAndCallFunction(mPropertyBag, CompVariantState.discardVariantContent);
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Updates the metadata of a variant; this may result in an update of the variant or the creation of a change.
|
|
165
|
+
* The metadata includes variant name and favorite, automatic apply on selection, default, contexts statuses.
|
|
166
|
+
*
|
|
167
|
+
* @param {object} mPropertyBag - Object with parameters as properties
|
|
168
|
+
* @param {string} mPropertyBag.reference - Flex reference of the application
|
|
169
|
+
* @param {sap.ui.comp.smartvariants.SmartVariantManagement|
|
|
170
|
+
* sap.ui.comp.smartfilterbar.SmartFilterBar|
|
|
171
|
+
* sap.ui.comp.smarttable.SmartTable|
|
|
172
|
+
* sap.ui.comp.smartchart.SmartChart} mPropertyBag.control - Variant management control for which the variant should be updated
|
|
173
|
+
* @param {string} mPropertyBag.id - ID of the variant
|
|
174
|
+
* @param {object} [mPropertyBag.name] - Title of the variant
|
|
175
|
+
* @param {object} [mPropertyBag.favorite] - Flag if the variant should be flagged as a favorite
|
|
176
|
+
* @param {object} [mPropertyBag.executeOnSelection] - Flag if the variant should be executed on selection
|
|
177
|
+
* @param {sap.ui.fl.Layer} [mPropertyBag.layer] - Layer in which the variant metadata update takes place
|
|
178
|
+
* @returns {sap.ui.fl.apply._internal.flexObjects.CompVariant} The updated variant
|
|
179
|
+
* @private
|
|
180
|
+
* @ui5-restricted sap.ui.rta.command
|
|
181
|
+
*/
|
|
182
|
+
updateVariantMetadata: function (mPropertyBag) {
|
|
183
|
+
mPropertyBag.action = CompVariantState.updateActionType.UPDATE_METADATA;
|
|
184
|
+
return setReferenceAndPersistencyKeyInPropertyBagAndCallFunction(mPropertyBag, CompVariantState.updateVariant);
|
|
185
|
+
},
|
|
103
186
|
|
|
104
187
|
/**
|
|
105
188
|
* Removes a variant; this may result in an deletion of the variant or the creation of a change.
|