@openui5/sap.ui.fl 1.99.1 → 1.102.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 +5 -5
- 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/Change.js +27 -5
- package/src/sap/ui/fl/ChangePersistence.js +118 -153
- package/src/sap/ui/fl/ChangePersistenceFactory.js +1 -1
- package/src/sap/ui/fl/FakeLrepConnectorLocalStorage.js +3 -4
- package/src/sap/ui/fl/FakeLrepConnectorSessionStorage.js +3 -4
- package/src/sap/ui/fl/FakeLrepLocalStorage.js +4 -4
- package/src/sap/ui/fl/FlexController.js +12 -55
- package/src/sap/ui/fl/FlexControllerFactory.js +4 -1
- package/src/sap/ui/fl/LayerUtils.js +1 -1
- package/src/sap/ui/fl/Scenario.js +27 -0
- package/src/sap/ui/fl/Utils.js +9 -7
- package/src/sap/ui/fl/Variant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/Applier.js +56 -9
- package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/Reverter.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/Utils.js +46 -2
- 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/controlVariants/Utils.js +9 -5
- package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +8 -0
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +452 -0
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +68 -0
- package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +28 -34
- package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +1 -3
- 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 +12 -10
- 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 +27 -16
- 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 +4 -2
- package/src/sap/ui/fl/changeHandler/BaseAddXml.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseRename.js +6 -4
- package/src/sap/ui/fl/changeHandler/HideControl.js +4 -2
- package/src/sap/ui/fl/changeHandler/MoveControls.js +10 -3
- package/src/sap/ui/fl/changeHandler/MoveElements.js +1 -1
- package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +6 -4
- package/src/sap/ui/fl/changeHandler/PropertyChange.js +4 -2
- package/src/sap/ui/fl/changeHandler/StashControl.js +17 -4
- package/src/sap/ui/fl/changeHandler/UnhideControl.js +6 -4
- package/src/sap/ui/fl/changeHandler/UnstashControl.js +7 -3
- package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +1 -1
- package/src/sap/ui/fl/changeHandler/condenser/Classification.js +43 -0
- 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 +8 -6
- package/src/sap/ui/fl/initial/_internal/StorageUtils.js +1 -1
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeRegistryItem.js +1 -1
- package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +7 -2
- 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 +22 -66
- package/src/sap/ui/fl/library.support.js +1 -1
- package/src/sap/ui/fl/messagebundle_fr.properties +14 -14
- package/src/sap/ui/fl/support/Flexibility.js +1 -1
- package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +1 -1
- package/src/sap/ui/fl/support/_internal/getFlexSettings.js +1 -1
- package/src/sap/ui/fl/support/api/SupportAPI.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +1 -1
- package/src/sap/ui/fl/support/diagnostics/Flexibility.controller.js +1 -1
- package/src/sap/ui/fl/themes/base/VariantManagement.less +23 -21
- 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/VariantManagement.js +2 -1
- package/src/sap/ui/fl/variants/VariantModel.js +7 -1
- package/src/sap/ui/fl/variants/context/Component.js +2 -6
- package/src/sap/ui/fl/variants/context/controller/ContextVisibility.controller.js +5 -44
- package/src/sap/ui/fl/variants/context/i18n/i18n.properties +3 -7
- package/src/sap/ui/fl/variants/context/i18n/i18n_ar.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_bg.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_ca.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_cs.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_cy.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_da.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_de.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_el.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_en.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_en_GB.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_en_US_sappsd.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_en_US_saprigi.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_en_US_saptrc.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_es.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_es_MX.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_et.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_fi.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_fr.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_fr_CA.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_hi.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_hr.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_hu.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_id.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_it.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_iw.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_ja.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_kk.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_ko.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_lt.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_lv.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_ms.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_nl.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_no.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_pl.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_pt.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_pt_PT.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_ro.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_ru.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_sh.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_sk.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_sl.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_sv.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_th.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_tr.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_uk.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_vi.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_zh_CN.properties +2 -4
- package/src/sap/ui/fl/variants/context/i18n/i18n_zh_TW.properties +2 -4
- package/src/sap/ui/fl/variants/context/view/ContextVisibility.view.xml +7 -6
- package/src/sap/ui/fl/write/_internal/Storage.js +7 -1
- package/src/sap/ui/fl/write/_internal/StorageFeaturesMerger.js +1 -1
- package/src/sap/ui/fl/write/_internal/Versions.js +85 -36
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +5 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +4 -2
- 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 +14 -12
- package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +5 -3
- package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +2 -2
- package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +78 -12
- package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/Utils.js +1 -1
- package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +1 -1
- package/src/sap/ui/fl/write/_internal/extensionPoint/Registry.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/FlexObjectState.js +28 -7
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +98 -41
- package/src/sap/ui/fl/write/_internal/transport/TransportDialog.js +13 -2
- package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +7 -4
- package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -1
- package/src/sap/ui/fl/write/api/AppVariantWriteAPI.js +13 -4
- package/src/sap/ui/fl/write/api/FeaturesAPI.js +2 -2
- package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
- package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +49 -4
- package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +18 -11
- package/src/sap/ui/fl/write/api/TranslationAPI.js +54 -17
- package/src/sap/ui/fl/write/api/Version.js +22 -0
- package/src/sap/ui/fl/write/api/VersionsAPI.js +90 -74
|
@@ -19,7 +19,9 @@ sap.ui.define([
|
|
|
19
19
|
"sap/ui/fl/apply/_internal/flexState/FlexState",
|
|
20
20
|
"sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger",
|
|
21
21
|
"sap/ui/fl/registry/Settings",
|
|
22
|
-
"sap/ui/fl/write/_internal/Storage"
|
|
22
|
+
"sap/ui/fl/write/_internal/Storage",
|
|
23
|
+
"sap/ui/fl/write/_internal/Versions",
|
|
24
|
+
"sap/ui/fl/write/api/Version"
|
|
23
25
|
], function(
|
|
24
26
|
_omit,
|
|
25
27
|
_pick,
|
|
@@ -35,20 +37,40 @@ sap.ui.define([
|
|
|
35
37
|
FlexState,
|
|
36
38
|
CompVariantMerger,
|
|
37
39
|
Settings,
|
|
38
|
-
Storage
|
|
40
|
+
Storage,
|
|
41
|
+
Versions,
|
|
42
|
+
Version
|
|
39
43
|
) {
|
|
40
44
|
"use strict";
|
|
41
45
|
|
|
42
|
-
function
|
|
46
|
+
function isVersionIndependentOrInDraft(oChange, mPropertyBag) {
|
|
47
|
+
var aDraftFilenames = getPropertyFromVersionsModel("/draftFilenames", mPropertyBag);
|
|
48
|
+
if (aDraftFilenames) {
|
|
49
|
+
return oChange.getState() === Change.states.NEW || aDraftFilenames.includes(oChange.getFileName());
|
|
50
|
+
}
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function getPropertyFromVersionsModel(sPropertyName, mPropertyBag) {
|
|
55
|
+
var bIsVersionEnabled = Settings.getInstanceOrUndef().isVersioningEnabled(mPropertyBag.layer);
|
|
56
|
+
if (bIsVersionEnabled && mPropertyBag.layer === Layer.CUSTOMER) {
|
|
57
|
+
return Versions.getVersionsModel({
|
|
58
|
+
reference: Utils.normalizeReference(mPropertyBag.reference),
|
|
59
|
+
layer: mPropertyBag.layer
|
|
60
|
+
}).getProperty(sPropertyName);
|
|
61
|
+
}
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function isChangeUpdatable(oChange, mPropertyBag) {
|
|
43
66
|
if (!["defaultVariant", "updateVariant"].includes(oChange.getChangeType())) {
|
|
44
67
|
return false;
|
|
45
68
|
}
|
|
46
|
-
|
|
47
|
-
var bSameLayer = oChange.getLayer() === sLayer;
|
|
69
|
+
var bSameLayer = oChange.getLayer() === mPropertyBag.layer;
|
|
48
70
|
var sPackageName = oChange.getDefinition().packageName;
|
|
49
71
|
var bNotTransported = !sPackageName || sPackageName === "$TMP";
|
|
50
72
|
|
|
51
|
-
return bSameLayer && bNotTransported;
|
|
73
|
+
return bSameLayer && bNotTransported && isVersionIndependentOrInDraft(oChange, mPropertyBag);
|
|
52
74
|
}
|
|
53
75
|
|
|
54
76
|
function getSubSection(mMap, oFlexObject) {
|
|
@@ -76,18 +98,25 @@ sap.ui.define([
|
|
|
76
98
|
}
|
|
77
99
|
|
|
78
100
|
function updateObjectAndStorage(oFlexObject, oStoredResponse) {
|
|
101
|
+
var sParentVersion = getPropertyFromVersionsModel("/persistedVersion", {layer: oFlexObject.getLayer(), reference: oFlexObject.getDefinition().reference});
|
|
79
102
|
return Storage.update({
|
|
80
103
|
flexObject: oFlexObject.getDefinition(),
|
|
81
104
|
layer: oFlexObject.getLayer(),
|
|
82
|
-
transport: oFlexObject.getRequest()
|
|
105
|
+
transport: oFlexObject.getRequest(),
|
|
106
|
+
parentVersion: sParentVersion
|
|
83
107
|
}).then(function (result) {
|
|
84
|
-
// update FlexObject
|
|
108
|
+
// update FlexObject and versionModel
|
|
85
109
|
if (result && result.response) {
|
|
86
110
|
oFlexObject.setResponse(result.response);
|
|
111
|
+
if (sParentVersion) {
|
|
112
|
+
Versions.onAllChangesSaved({
|
|
113
|
+
reference: result.response.reference,
|
|
114
|
+
layer: result.response.layer
|
|
115
|
+
});
|
|
116
|
+
}
|
|
87
117
|
} else {
|
|
88
118
|
oFlexObject.setState(States.PERSISTED);
|
|
89
119
|
}
|
|
90
|
-
|
|
91
120
|
return oStoredResponse;
|
|
92
121
|
}).then(function (oStoredResponse) {
|
|
93
122
|
// update StorageResponse
|
|
@@ -97,7 +126,7 @@ sap.ui.define([
|
|
|
97
126
|
});
|
|
98
127
|
}
|
|
99
128
|
|
|
100
|
-
function deleteObjectAndRemoveFromStorage(oFlexObject, mCompVariantsMapByPersistencyKey, oStoredResponse) {
|
|
129
|
+
function deleteObjectAndRemoveFromStorage(oFlexObject, mCompVariantsMapByPersistencyKey, oStoredResponse, sParentVersion) {
|
|
101
130
|
function removeFromArrayByName(aObjectArray, oFlexObject) {
|
|
102
131
|
for (var i = aObjectArray.length - 1; i >= 0; i--) {
|
|
103
132
|
//aObjectArray can come from either back end response or flex state
|
|
@@ -113,7 +142,8 @@ sap.ui.define([
|
|
|
113
142
|
return Storage.remove({
|
|
114
143
|
flexObject: oFlexObject.getDefinition(),
|
|
115
144
|
layer: oFlexObject.getLayer(),
|
|
116
|
-
transport: oFlexObject.getRequest()
|
|
145
|
+
transport: oFlexObject.getRequest(),
|
|
146
|
+
parentVersion: sParentVersion
|
|
117
147
|
}).then(function () {
|
|
118
148
|
// update compVariantsMap
|
|
119
149
|
delete mCompVariantsMapByPersistencyKey.byId[oFlexObject.getId()];
|
|
@@ -220,7 +250,7 @@ sap.ui.define([
|
|
|
220
250
|
*
|
|
221
251
|
* @namespace sap.ui.fl.write._internal.flexState.compVariants.CompVariantState
|
|
222
252
|
* @since 1.83
|
|
223
|
-
* @version 1.
|
|
253
|
+
* @version 1.102.0
|
|
224
254
|
* @private
|
|
225
255
|
* @ui5-restricted sap.ui.fl
|
|
226
256
|
*/
|
|
@@ -250,7 +280,7 @@ sap.ui.define([
|
|
|
250
280
|
var aDefaultVariantChanges = mCompVariantsMap.defaultVariants;
|
|
251
281
|
var oChange = aDefaultVariantChanges[aDefaultVariantChanges.length - 1];
|
|
252
282
|
|
|
253
|
-
if (!oChange || !isChangeUpdatable(oChange, mPropertyBag
|
|
283
|
+
if (!oChange || !isChangeUpdatable(oChange, mPropertyBag)) {
|
|
254
284
|
var oChangeParameter = {
|
|
255
285
|
fileName: Utils.createDefaultFileName(sChangeType),
|
|
256
286
|
fileType: "change",
|
|
@@ -404,13 +434,12 @@ sap.ui.define([
|
|
|
404
434
|
var bIsChangedOnLayer = oVariant.getChanges().some(function (oChange) {
|
|
405
435
|
return oChange.getLayer() === sLayer;
|
|
406
436
|
});
|
|
407
|
-
|
|
408
|
-
return oVariant.getPersisted() && bSameLayer && bNotTransported && !bIsChangedOnLayer;
|
|
437
|
+
return oVariant.getPersisted() && bSameLayer && bNotTransported && !bIsChangedOnLayer && isVersionIndependentOrInDraft(oVariant, mPropertyBag);
|
|
409
438
|
}
|
|
410
439
|
|
|
411
440
|
function getLatestUpdatableChange(oVariant) {
|
|
412
441
|
return oVariant.getChanges().reverse().find(function (oChange) {
|
|
413
|
-
return oChange.getChangeType() === "updateVariant" && isChangeUpdatable(oChange,
|
|
442
|
+
return oChange.getChangeType() === "updateVariant" && isChangeUpdatable(oChange, mPropertyBag);
|
|
414
443
|
});
|
|
415
444
|
}
|
|
416
445
|
|
|
@@ -719,21 +748,27 @@ sap.ui.define([
|
|
|
719
748
|
* @private
|
|
720
749
|
*/
|
|
721
750
|
CompVariantState.persist = function(mPropertyBag) {
|
|
722
|
-
function writeObjectAndAddToState(oFlexObject, oStoredResponse) {
|
|
751
|
+
function writeObjectAndAddToState(oFlexObject, oStoredResponse, sParentVersion) {
|
|
723
752
|
// TODO: remove this line as soon as layering and a condensing is in place
|
|
724
753
|
return Storage.write({
|
|
725
754
|
flexObjects: [oFlexObject.getDefinition()],
|
|
726
755
|
layer: oFlexObject.getLayer(),
|
|
727
756
|
transport: oFlexObject.getRequest(),
|
|
728
|
-
isLegacyVariant: oFlexObject.isVariant()
|
|
757
|
+
isLegacyVariant: oFlexObject.isVariant(),
|
|
758
|
+
parentVersion: sParentVersion
|
|
729
759
|
}).then(function (result) {
|
|
730
|
-
// updateFlexObject
|
|
760
|
+
// updateFlexObject and versionModel
|
|
731
761
|
if (result && result.response && result.response[0]) {
|
|
732
762
|
oFlexObject.setResponse(result.response[0]);
|
|
763
|
+
if (sParentVersion) {
|
|
764
|
+
Versions.onAllChangesSaved({
|
|
765
|
+
reference: result.response[0].reference,
|
|
766
|
+
layer: result.response[0].layer
|
|
767
|
+
});
|
|
768
|
+
}
|
|
733
769
|
} else {
|
|
734
770
|
oFlexObject.setState(States.PERSISTED);
|
|
735
771
|
}
|
|
736
|
-
|
|
737
772
|
return oStoredResponse;
|
|
738
773
|
}).then(function (oStoredResponse) {
|
|
739
774
|
// update StorageResponse
|
|
@@ -742,32 +777,54 @@ sap.ui.define([
|
|
|
742
777
|
});
|
|
743
778
|
}
|
|
744
779
|
|
|
780
|
+
function saveObject(oFlexObject, mCompVariantsMapByPersistencyKey, oStoredResponse, sParentVersion) {
|
|
781
|
+
switch (oFlexObject.getState()) {
|
|
782
|
+
case States.NEW:
|
|
783
|
+
ifVariantClearRevertData(oFlexObject);
|
|
784
|
+
return writeObjectAndAddToState(oFlexObject, oStoredResponse, sParentVersion);
|
|
785
|
+
case States.DIRTY:
|
|
786
|
+
ifVariantClearRevertData(oFlexObject);
|
|
787
|
+
return updateObjectAndStorage(oFlexObject, oStoredResponse, sParentVersion);
|
|
788
|
+
case States.DELETED:
|
|
789
|
+
ifVariantClearRevertData(oFlexObject);
|
|
790
|
+
return deleteObjectAndRemoveFromStorage(oFlexObject, mCompVariantsMapByPersistencyKey, oStoredResponse, sParentVersion);
|
|
791
|
+
default:
|
|
792
|
+
break;
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
|
|
745
796
|
var sReference = mPropertyBag.reference;
|
|
746
797
|
var sPersistencyKey = mPropertyBag.persistencyKey;
|
|
747
798
|
var mCompVariantsMap = FlexState.getCompVariantsMap(sReference);
|
|
748
799
|
var mCompVariantsMapByPersistencyKey = mCompVariantsMap._getOrCreate(sPersistencyKey);
|
|
749
|
-
var oStoredResponse = FlexState.getStorageResponse(sReference);
|
|
750
|
-
|
|
751
|
-
var aPromises = getAllCompVariantObjects(mCompVariantsMapByPersistencyKey)
|
|
752
|
-
.filter(needsPersistencyCall)
|
|
753
|
-
.map(function (oFlexObject) {
|
|
754
|
-
switch (oFlexObject.getState()) {
|
|
755
|
-
case States.NEW:
|
|
756
|
-
ifVariantClearRevertData(oFlexObject);
|
|
757
|
-
return writeObjectAndAddToState(oFlexObject, oStoredResponse);
|
|
758
|
-
case States.DIRTY:
|
|
759
|
-
ifVariantClearRevertData(oFlexObject);
|
|
760
|
-
return updateObjectAndStorage(oFlexObject, oStoredResponse);
|
|
761
|
-
case States.DELETED:
|
|
762
|
-
ifVariantClearRevertData(oFlexObject);
|
|
763
|
-
return deleteObjectAndRemoveFromStorage(oFlexObject, mCompVariantsMapByPersistencyKey, oStoredResponse);
|
|
764
|
-
default:
|
|
765
|
-
break;
|
|
766
|
-
}
|
|
767
|
-
});
|
|
768
800
|
|
|
769
|
-
|
|
770
|
-
|
|
801
|
+
return FlexState.getStorageResponse(sReference)
|
|
802
|
+
.then(function(oStoredResponse) {
|
|
803
|
+
var aFlexObject = getAllCompVariantObjects(mCompVariantsMapByPersistencyKey).filter(needsPersistencyCall);
|
|
804
|
+
var aPromises = aFlexObject.map(function (oFlexObject, index) {
|
|
805
|
+
if (index === 0) {
|
|
806
|
+
var sParentVersion = getPropertyFromVersionsModel("/persistedVersion", {
|
|
807
|
+
layer: oFlexObject.getLayer(),
|
|
808
|
+
reference: oFlexObject.getDefinition().reference
|
|
809
|
+
});
|
|
810
|
+
// TODO: use condensing route to reduce backend requests
|
|
811
|
+
// need to save first entry to generate draft version in backend
|
|
812
|
+
return saveObject(oFlexObject, mCompVariantsMapByPersistencyKey, oStoredResponse, sParentVersion)
|
|
813
|
+
.then(function () {
|
|
814
|
+
var aPromises = aFlexObject.map(function (oFlexObject, index) {
|
|
815
|
+
if (index !== 0) {
|
|
816
|
+
var sDraftVersion = sParentVersion ? Version.Number.Draft : undefined;
|
|
817
|
+
return saveObject(oFlexObject, mCompVariantsMapByPersistencyKey, oStoredResponse, sDraftVersion);
|
|
818
|
+
}
|
|
819
|
+
});
|
|
820
|
+
return aPromises;
|
|
821
|
+
});
|
|
822
|
+
}
|
|
823
|
+
});
|
|
824
|
+
|
|
825
|
+
// TODO Consider not rejecting with first error, but wait for all promises and collect the results
|
|
826
|
+
return Promise.all(aPromises);
|
|
827
|
+
});
|
|
771
828
|
};
|
|
772
829
|
|
|
773
830
|
/**
|
|
@@ -62,6 +62,11 @@ sap.ui.define([
|
|
|
62
62
|
*/
|
|
63
63
|
lrepObject: {type: "any", group: "Misc", defaultValue: null},
|
|
64
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Flag if the "Local Object" button should be visible.
|
|
67
|
+
*/
|
|
68
|
+
localObjectVisible: {type: "boolean", group: "Misc", defaultValue: true},
|
|
69
|
+
|
|
65
70
|
/**
|
|
66
71
|
* Flag indicating whether the selection of an ABAP package is to be hidden or not.
|
|
67
72
|
*/
|
|
@@ -143,13 +148,14 @@ sap.ui.define([
|
|
|
143
148
|
TransportDialog.prototype._createButtons = function() {
|
|
144
149
|
var that = this;
|
|
145
150
|
|
|
146
|
-
this.
|
|
151
|
+
this._oLocalObjectButton = new Button({
|
|
147
152
|
text: this._oResources.getText("TRANSPORT_DIALOG_LOCAL_OBJECT"),
|
|
148
153
|
tooltip: this._oResources.getText("TRANSPORT_DIALOG_LOCAL_OBJECT"),
|
|
149
154
|
press: function() {
|
|
150
155
|
that._onLocal();
|
|
151
156
|
}
|
|
152
|
-
})
|
|
157
|
+
});
|
|
158
|
+
this.addButton(this._oLocalObjectButton);
|
|
153
159
|
this.addButton(new Button({
|
|
154
160
|
text: this._oResources.getText("TRANSPORT_DIALOG_OK"),
|
|
155
161
|
tooltip: this._oResources.getText("TRANSPORT_DIALOG_OK"),
|
|
@@ -423,6 +429,11 @@ sap.ui.define([
|
|
|
423
429
|
return null;
|
|
424
430
|
};
|
|
425
431
|
|
|
432
|
+
TransportDialog.prototype.setLocalObjectVisible = function (bLocalObjectVisible) {
|
|
433
|
+
this._oLocalObjectButton.setVisible(bLocalObjectVisible);
|
|
434
|
+
this.setProperty("localObjectVisible", bLocalObjectVisible);
|
|
435
|
+
};
|
|
436
|
+
|
|
426
437
|
/**
|
|
427
438
|
* An ABAP package that can be used as default for the ABAP package selection.
|
|
428
439
|
* The property can only be set once and afterwards it cannot be changed.
|
|
@@ -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.102.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.
|
|
@@ -50,9 +50,10 @@ sap.ui.define([
|
|
|
50
50
|
* @param {boolean} bCompactMode - Flag indicating whether the transport dialog should be opened in compact mode
|
|
51
51
|
* @param {object} oControl - Control instance
|
|
52
52
|
* @param {string} sStyleClass - CSS style class that should be added to any dialogs
|
|
53
|
+
* @param {boolean} bLocalObjectVisible - Flag if the "Local Object" button should be visible in the transport dialog
|
|
53
54
|
* @public
|
|
54
55
|
*/
|
|
55
|
-
TransportSelection.prototype.selectTransport = function(oObjectInfo, fOkay, fError, bCompactMode, oControl, sStyleClass) {
|
|
56
|
+
TransportSelection.prototype.selectTransport = function(oObjectInfo, fOkay, fError, bCompactMode, oControl, sStyleClass, bLocalObjectVisible) {
|
|
56
57
|
//No transport selection unless Lrep connector is available
|
|
57
58
|
if (!FlUtils.getLrepUrl()) {
|
|
58
59
|
fOkay(this._createEventObject(oObjectInfo, {transportId: ""}));
|
|
@@ -65,6 +66,7 @@ sap.ui.define([
|
|
|
65
66
|
hidePackage: !LayerUtils.doesCurrentLayerRequirePackage(),
|
|
66
67
|
pkg: oObjectInfo.package,
|
|
67
68
|
transports: oGetTransportsResult.transports,
|
|
69
|
+
localObjectVisible: bLocalObjectVisible,
|
|
68
70
|
lrepObject: this._toLREPObject(oObjectInfo)
|
|
69
71
|
}, fOkay, fError, bCompactMode, sStyleClass);
|
|
70
72
|
} else {
|
|
@@ -305,10 +307,11 @@ sap.ui.define([
|
|
|
305
307
|
* @param {sap.ui.fl.Change} [oChange] - Change for which the transport information should be retrieved
|
|
306
308
|
* @param {object} oControl - Object of the root control for the transport dialog
|
|
307
309
|
* @param {string} sStyleClass - CSS style class that should be added to any dialogs
|
|
310
|
+
* @param {boolean} bLocalObjectVisible - Flag if the "Local Object" button should be visible in the transport dialog
|
|
308
311
|
* @returns {Promise} Promise that resolves
|
|
309
312
|
* @public
|
|
310
313
|
*/
|
|
311
|
-
TransportSelection.prototype.openTransportSelection = function(oChange, oControl, sStyleClass) {
|
|
314
|
+
TransportSelection.prototype.openTransportSelection = function(oChange, oControl, sStyleClass, bLocalObjectVisible) {
|
|
312
315
|
var that = this;
|
|
313
316
|
|
|
314
317
|
return new Promise(function(resolve, reject) {
|
|
@@ -342,7 +345,7 @@ sap.ui.define([
|
|
|
342
345
|
oObject.type = oChange.getDefinition().fileType;
|
|
343
346
|
}
|
|
344
347
|
|
|
345
|
-
that.selectTransport(oObject, fnOkay, fnError, false, oControl, sStyleClass);
|
|
348
|
+
that.selectTransport(oObject, fnOkay, fnError, false, oControl, sStyleClass, bLocalObjectVisible);
|
|
346
349
|
});
|
|
347
350
|
};
|
|
348
351
|
|
|
@@ -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.102.0
|
|
31
31
|
* @since 1.74.0
|
|
32
32
|
* @private
|
|
33
33
|
* @ui5-restricted sap.ui.fl.write._internal.transport
|
|
@@ -7,11 +7,15 @@
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/ui/fl/apply/_internal/ChangesController",
|
|
9
9
|
"sap/ui/fl/write/_internal/SaveAs",
|
|
10
|
-
"sap/ui/fl/write/_internal/connectors/LrepConnector"
|
|
10
|
+
"sap/ui/fl/write/_internal/connectors/LrepConnector",
|
|
11
|
+
"sap/ui/fl/write/api/FeaturesAPI",
|
|
12
|
+
"sap/ui/fl/write/_internal/Versions"
|
|
11
13
|
], function(
|
|
12
14
|
ChangesController,
|
|
13
15
|
SaveAs,
|
|
14
|
-
LrepConnector
|
|
16
|
+
LrepConnector,
|
|
17
|
+
FeaturesAPI,
|
|
18
|
+
Versions
|
|
15
19
|
) {
|
|
16
20
|
"use strict";
|
|
17
21
|
|
|
@@ -59,8 +63,13 @@ sap.ui.define([
|
|
|
59
63
|
}
|
|
60
64
|
var oFlexController = ChangesController.getDescriptorFlexControllerInstance(mPropertyBag.selector);
|
|
61
65
|
mPropertyBag.reference = oFlexController.getComponentName();
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
return FeaturesAPI.isVersioningEnabled(mPropertyBag.layer)
|
|
67
|
+
.then(function (bVersioningEnabled) {
|
|
68
|
+
if (bVersioningEnabled) {
|
|
69
|
+
mPropertyBag.parentVersion = Versions.getVersionsModel(mPropertyBag).getProperty("/displayedVersion");
|
|
70
|
+
}
|
|
71
|
+
return SaveAs.saveAs(mPropertyBag);
|
|
72
|
+
});
|
|
64
73
|
},
|
|
65
74
|
|
|
66
75
|
/**
|
|
@@ -53,7 +53,7 @@ sap.ui.define([
|
|
|
53
53
|
* @description App variant functionality is only supported in S/4HANA Cloud Platform & S/4HANA on Premise.
|
|
54
54
|
* App variant functionality should be available if the following conditions are met:
|
|
55
55
|
* When the current layer is 'CUSTOMER'.
|
|
56
|
-
* When it is not a standalone app
|
|
56
|
+
* When it is not a standalone app running on Neo Cloud.
|
|
57
57
|
* When the backend supports this feature.
|
|
58
58
|
* @private
|
|
59
59
|
* @ui5-restricted
|
|
@@ -105,7 +105,7 @@ sap.ui.define([
|
|
|
105
105
|
* Checks if key user has also the admin role to enable the translation button
|
|
106
106
|
*
|
|
107
107
|
* @param {sap.ui.fl.Layer} sLayer - Current layer
|
|
108
|
-
* @returns {Promise<boolean>} Resolves to a boolean indicating if
|
|
108
|
+
* @returns {Promise<boolean>} Resolves to a boolean indicating if the key user is also an admin
|
|
109
109
|
* @public
|
|
110
110
|
*/
|
|
111
111
|
isKeyUserTranslationEnabled: function (sLayer) {
|
|
@@ -14,11 +14,14 @@ sap.ui.define([
|
|
|
14
14
|
"sap/ui/fl/apply/_internal/appVariant/DescriptorChangeTypes",
|
|
15
15
|
"sap/ui/fl/write/_internal/condenser/Condenser",
|
|
16
16
|
"sap/ui/fl/write/_internal/flexState/FlexObjectState",
|
|
17
|
+
"sap/ui/fl/write/_internal/Storage",
|
|
17
18
|
"sap/ui/fl/apply/_internal/flexState/ManifestUtils",
|
|
19
|
+
"sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState",
|
|
18
20
|
"sap/ui/fl/write/api/FeaturesAPI",
|
|
19
21
|
"sap/ui/fl/Layer",
|
|
20
22
|
"sap/ui/fl/LayerUtils",
|
|
21
|
-
"sap/ui/fl/registry/Settings"
|
|
23
|
+
"sap/ui/fl/registry/Settings",
|
|
24
|
+
"sap/ui/fl/Utils"
|
|
22
25
|
], function(
|
|
23
26
|
includes,
|
|
24
27
|
_omit,
|
|
@@ -29,11 +32,14 @@ sap.ui.define([
|
|
|
29
32
|
DescriptorChangeTypes,
|
|
30
33
|
Condenser,
|
|
31
34
|
FlexObjectState,
|
|
35
|
+
Storage,
|
|
32
36
|
ManifestUtils,
|
|
37
|
+
VariantManagementState,
|
|
33
38
|
FeaturesAPI,
|
|
34
39
|
Layer,
|
|
35
40
|
LayerUtils,
|
|
36
|
-
Settings
|
|
41
|
+
Settings,
|
|
42
|
+
FlUtils
|
|
37
43
|
) {
|
|
38
44
|
"use strict";
|
|
39
45
|
|
|
@@ -78,6 +84,37 @@ sap.ui.define([
|
|
|
78
84
|
});
|
|
79
85
|
}
|
|
80
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Removes variant-dependent changes belonging to variants which are currently not selected
|
|
89
|
+
*
|
|
90
|
+
* @param {array} aChanges - List of changes to check
|
|
91
|
+
* @param {sap.ui.fl.Control} oControl - Control for which the changes are being checked
|
|
92
|
+
* @returns {sap.ui.fl.Change[]} List of variant-dependent changes belonging to the currently selected variants
|
|
93
|
+
*/
|
|
94
|
+
function filterChangesByCurrentVariants(aChanges, oControl) {
|
|
95
|
+
// 1. Get current variant references
|
|
96
|
+
var oComponent = FlUtils.getAppComponentForControl(oControl);
|
|
97
|
+
var oModel = oComponent.getModel(FlUtils.VARIANT_MODEL_NAME);
|
|
98
|
+
var sFlexReference = oModel && oModel.sFlexReference;
|
|
99
|
+
var aVariantManagementReferences = VariantManagementState.getVariantManagementReferences(sFlexReference);
|
|
100
|
+
|
|
101
|
+
if (aVariantManagementReferences.length === 0) {
|
|
102
|
+
return aChanges;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
var aCurrentVariantReferences = aVariantManagementReferences.map(function(sVMReference) {
|
|
106
|
+
return oModel.getCurrentVariantReference(sVMReference);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
// 2. Remove variant-dependent changes not assigned to a current variant reference
|
|
110
|
+
return aChanges.filter(function(oChange) {
|
|
111
|
+
return aCurrentVariantReferences.some(function(sCurrentVariantReference) {
|
|
112
|
+
return oChange.getVariantReference() === sCurrentVariantReference
|
|
113
|
+
|| !oChange.getVariantReference();
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
81
118
|
/**
|
|
82
119
|
* Determines if user-specific changes or variants are present in the flex persistence.
|
|
83
120
|
*
|
|
@@ -154,7 +191,7 @@ sap.ui.define([
|
|
|
154
191
|
// If there is change and the layer is transportable , the request to back end is always necessary
|
|
155
192
|
// because of control variant reset logic through setVisible change and app descriptor changes
|
|
156
193
|
if (bIsLayerTransportable) {
|
|
157
|
-
return
|
|
194
|
+
return Storage.getFlexInfo(mPropertyBag)
|
|
158
195
|
.then(function(oResponse) {
|
|
159
196
|
oFlexInfo.allContextsProvided = oResponse.allContextsProvided === undefined || oResponse.allContextsProvided;
|
|
160
197
|
oFlexInfo.isResetEnabled = oResponse.isResetEnabled;
|
|
@@ -365,6 +402,7 @@ sap.ui.define([
|
|
|
365
402
|
* @param {boolean} [mPropertyBag.includeDirtyChanges] - Flag if dirty UI changes should be included
|
|
366
403
|
* @param {string} [mPropertyBag.cacheKey] - Key to validate the cache entry stored on client side
|
|
367
404
|
* @param {boolean} [mPropertyBag.invalidateCache] - Indicates whether the cache is to be invalidated
|
|
405
|
+
* @param {boolean} [mPropertyBag.onlyCurrentVariants] - Whether only changes for the currently active variants should be considered
|
|
368
406
|
*
|
|
369
407
|
* @returns {Promise} Promise resolves with an array of all change instances {@see sap.ui.fl.Change}
|
|
370
408
|
* @private
|
|
@@ -375,7 +413,14 @@ sap.ui.define([
|
|
|
375
413
|
mPropertyBag.currentLayer = mPropertyBag.layer;
|
|
376
414
|
}
|
|
377
415
|
|
|
378
|
-
|
|
416
|
+
//TODO: Check the mPropertyBag.selector parameter name - the methods called on FlexObjectState expect a control
|
|
417
|
+
return FlexObjectState.getFlexObjects(mPropertyBag)
|
|
418
|
+
.then(function(aChanges) {
|
|
419
|
+
if (mPropertyBag.onlyCurrentVariants) {
|
|
420
|
+
return filterChangesByCurrentVariants(aChanges, mPropertyBag.selector);
|
|
421
|
+
}
|
|
422
|
+
return aChanges;
|
|
423
|
+
});
|
|
379
424
|
};
|
|
380
425
|
|
|
381
426
|
return PersistenceWriteAPI;
|
|
@@ -8,6 +8,7 @@ sap.ui.define([
|
|
|
8
8
|
"sap/ui/fl/LayerUtils",
|
|
9
9
|
"sap/ui/fl/Layer",
|
|
10
10
|
"sap/ui/fl/Utils",
|
|
11
|
+
"sap/ui/fl/write/api/Version",
|
|
11
12
|
"sap/ui/fl/apply/_internal/flexState/ManifestUtils",
|
|
12
13
|
"sap/ui/fl/write/api/VersionsAPI",
|
|
13
14
|
"sap/ui/fl/write/api/FeaturesAPI",
|
|
@@ -17,6 +18,7 @@ sap.ui.define([
|
|
|
17
18
|
LayerUtils,
|
|
18
19
|
Layer,
|
|
19
20
|
Utils,
|
|
21
|
+
Version,
|
|
20
22
|
ManifestUtils,
|
|
21
23
|
VersionsAPI,
|
|
22
24
|
FeaturesAPI,
|
|
@@ -25,14 +27,14 @@ sap.ui.define([
|
|
|
25
27
|
"use strict";
|
|
26
28
|
|
|
27
29
|
function isDraftAvailable(oReloadInfo) {
|
|
28
|
-
var bUrlHasVersionParameter = !!Utils.getParameter(
|
|
30
|
+
var bUrlHasVersionParameter = !!Utils.getParameter(Version.UrlParameter, oReloadInfo.URLParsingService);
|
|
29
31
|
if (bUrlHasVersionParameter) {
|
|
30
32
|
return Promise.resolve(false);
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
return FeaturesAPI.isVersioningEnabled(oReloadInfo.layer).then(function(bVersioningAvailable) {
|
|
34
36
|
return bVersioningAvailable && VersionsAPI.isDraftAvailable({
|
|
35
|
-
|
|
37
|
+
control: oReloadInfo.selector,
|
|
36
38
|
layer: oReloadInfo.layer
|
|
37
39
|
});
|
|
38
40
|
});
|
|
@@ -137,7 +139,7 @@ sap.ui.define([
|
|
|
137
139
|
* @returns {boolean} True if the parameter with the given value is in the URL
|
|
138
140
|
*/
|
|
139
141
|
hasVersionParameterWithValue: function(oParameter, oURLParsingService) {
|
|
140
|
-
return Utils.hasParameterAndValue(
|
|
142
|
+
return Utils.hasParameterAndValue(Version.UrlParameter, oParameter.value, oURLParsingService);
|
|
141
143
|
},
|
|
142
144
|
|
|
143
145
|
/**
|
|
@@ -175,16 +177,16 @@ sap.ui.define([
|
|
|
175
177
|
}
|
|
176
178
|
|
|
177
179
|
// removes any version number set (original, draft, inactive and active versions)
|
|
178
|
-
var oVersionRegExp = new RegExp("\&*" +
|
|
180
|
+
var oVersionRegExp = new RegExp("\&*" + Version.UrlParameter + "=-?\\d*\&?", "g");
|
|
179
181
|
oReloadInfo.parameters = oReloadInfo.parameters.replace(oVersionRegExp, "");
|
|
180
182
|
|
|
181
183
|
// startup reload due to draft
|
|
182
184
|
if (oReloadInfo.isDraftAvailable && !oReloadInfo.onExit) {
|
|
183
|
-
oReloadInfo.parameters = Utils.handleUrlParameters(oReloadInfo.parameters,
|
|
185
|
+
oReloadInfo.parameters = Utils.handleUrlParameters(oReloadInfo.parameters, Version.UrlParameter, Version.Number.Draft, oReloadInfo.URLParsingService);
|
|
184
186
|
}
|
|
185
187
|
|
|
186
188
|
if (oReloadInfo.versionSwitch) {
|
|
187
|
-
oReloadInfo.parameters = Utils.handleUrlParameters(oReloadInfo.parameters,
|
|
189
|
+
oReloadInfo.parameters = Utils.handleUrlParameters(oReloadInfo.parameters, Version.UrlParameter, oReloadInfo.version, oReloadInfo.URLParsingService);
|
|
188
190
|
}
|
|
189
191
|
|
|
190
192
|
// clean up if the last parameter was removed
|
|
@@ -215,7 +217,7 @@ sap.ui.define([
|
|
|
215
217
|
mParsedHash.params[LayerUtils.FL_MAX_LAYER_PARAM] = [oReloadInfo.layer];
|
|
216
218
|
}
|
|
217
219
|
if (oReloadInfo.isDraftAvailable) {
|
|
218
|
-
mParsedHash.params[
|
|
220
|
+
mParsedHash.params[Version.UrlParameter] = [Version.Number.Draft];
|
|
219
221
|
}
|
|
220
222
|
return mParsedHash;
|
|
221
223
|
},
|
|
@@ -232,8 +234,11 @@ sap.ui.define([
|
|
|
232
234
|
*/
|
|
233
235
|
initialDraftGotActivated: function(oReloadInfo) {
|
|
234
236
|
if (oReloadInfo.versioningEnabled) {
|
|
235
|
-
var bUrlHasVersionParameter = this.hasVersionParameterWithValue({value:
|
|
236
|
-
return !VersionsAPI.isDraftAvailable(
|
|
237
|
+
var bUrlHasVersionParameter = this.hasVersionParameterWithValue({value: Version.Number.Draft}, oReloadInfo.URLParsingService);
|
|
238
|
+
return !VersionsAPI.isDraftAvailable({
|
|
239
|
+
control: oReloadInfo.selector,
|
|
240
|
+
layer: oReloadInfo.layer
|
|
241
|
+
}) && bUrlHasVersionParameter;
|
|
237
242
|
}
|
|
238
243
|
return false;
|
|
239
244
|
},
|
|
@@ -262,9 +267,11 @@ sap.ui.define([
|
|
|
262
267
|
|
|
263
268
|
// TODO fix app descriptor handling and reload behavior
|
|
264
269
|
// TODO move changesNeedReload near flexState; set flag when saving change that needs a reload
|
|
265
|
-
oReloadInfo.isDraftAvailable = oReloadInfo.isDraftAvailable || ReloadInfoAPI.hasVersionParameterWithValue({value:
|
|
270
|
+
oReloadInfo.isDraftAvailable = oReloadInfo.isDraftAvailable || ReloadInfoAPI.hasVersionParameterWithValue({value: Version.Number.Draft}, oReloadInfo.URLParsingService);
|
|
266
271
|
|
|
267
|
-
|
|
272
|
+
oReloadInfo.hasVersionUrlParameter = !!Utils.getParameter(Version.UrlParameter, oReloadInfo.URLParsingService);
|
|
273
|
+
|
|
274
|
+
if (oReloadInfo.activeVersion !== Version.Number.Original) {
|
|
268
275
|
oReloadInfo.activeVersionNotSelected = oReloadInfo.activeVersion && !ReloadInfoAPI.hasVersionParameterWithValue({value: oReloadInfo.activeVersion}, oReloadInfo.URLParsingService);
|
|
269
276
|
}
|
|
270
277
|
oReloadInfo.hasHigherLayerChanges = ReloadInfoAPI.hasMaxLayerParameterWithValue({value: oReloadInfo.layer}, oReloadInfo.URLParsingService);
|