@openui5/sap.ui.fl 1.118.0 → 1.119.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 +2 -2
- package/package.json +3 -3
- package/src/sap/ui/fl/.library +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 +14 -7
- package/src/sap/ui/fl/Utils.js +72 -172
- package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/Applier.js +8 -4
- 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/ApplyStrategyFactory.js +28 -8
- 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/AddNewInbound.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/RemoveAllInboundsExceptOne.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 +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/ControllerExtensionChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlVariant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +5 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +17 -88
- 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/compVariants/Utils.js +6 -1
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +96 -77
- 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 +45 -59
- package/src/sap/ui/fl/changeHandler/HideControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/MoveControls.js +168 -260
- package/src/sap/ui/fl/changeHandler/MoveElements.js +33 -87
- 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 +31 -53
- package/src/sap/ui/fl/changeHandler/UnhideControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UnstashControl.js +24 -26
- package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +3 -5
- package/src/sap/ui/fl/changeHandler/common/createIFrame.js +2 -0
- 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/designtime/util/IFrame.designtime.js +5 -0
- package/src/sap/ui/fl/{write → initial}/_internal/FlexInfoSession.js +11 -3
- package/src/sap/ui/fl/initial/_internal/Storage.js +5 -5
- package/src/sap/ui/fl/initial/_internal/StorageUtils.js +1 -1
- 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/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/messagebundle_bg.properties +2 -2
- package/src/sap/ui/fl/messagebundle_en.properties +2 -2
- package/src/sap/ui/fl/messagebundle_ja.properties +6 -6
- package/src/sap/ui/fl/messagebundle_sl.properties +2 -2
- package/src/sap/ui/fl/messagebundle_uk.properties +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/transport/TransportSelection.js +1 -1
- package/src/sap/ui/fl/util/IFrame.js +60 -27
- package/src/sap/ui/fl/util/IFrameRenderer.js +9 -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 +17 -18
- package/src/sap/ui/fl/variants/VariantModel.js +2 -1
- package/src/sap/ui/fl/variants/context/manifest.json +2 -2
- package/src/sap/ui/fl/write/_internal/Storage.js +1 -1
- package/src/sap/ui/fl/write/_internal/StorageFeaturesMerger.js +1 -1
- package/src/sap/ui/fl/write/_internal/Versions.js +3 -3
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +1 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +1 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChange.js +1 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory.js +1 -1
- package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +1 -1
- package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +2 -2
- package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/Utils.js +1 -1
- package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +1 -1
- package/src/sap/ui/fl/write/_internal/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 +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +63 -43
- 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/ContextBasedAdaptationsAPI.js +1 -1
- package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
- package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +1 -1
- package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +12 -2
- package/src/sap/ui/fl/write/api/connectors/ObjectStorageConnector.js +14 -11
|
@@ -81,10 +81,14 @@ sap.ui.define([
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
function checkAndAdjustChangeStatus(oControl, oChange, mChangesMap, oFlexController, mPropertyBag) {
|
|
84
|
-
|
|
84
|
+
// in case of changes in templates, the original control is not always available at this point
|
|
85
|
+
// example: rename on a control created by a change inside a template
|
|
86
|
+
var oOriginalControl = Utils.getControlIfTemplateAffected(oChange, oControl, mPropertyBag).control;
|
|
85
87
|
var oModifier = mPropertyBag.modifier;
|
|
86
|
-
var bHasAppliedCustomData =
|
|
87
|
-
|
|
88
|
+
var bHasAppliedCustomData = oOriginalControl
|
|
89
|
+
&& !!FlexCustomData.getAppliedCustomDataValue(oOriginalControl, oChange, oModifier);
|
|
90
|
+
var bIsCurrentlyAppliedOnControl = oOriginalControl
|
|
91
|
+
&& FlexCustomData.hasChangeApplyFinishedCustomData(oOriginalControl, oChange, oModifier);
|
|
88
92
|
var bChangeStatusAppliedFinished = oChange.isApplyProcessFinished();
|
|
89
93
|
var oAppComponent = mPropertyBag.appComponent;
|
|
90
94
|
if (bChangeStatusAppliedFinished && !bIsCurrentlyAppliedOnControl) {
|
|
@@ -100,7 +104,7 @@ sap.ui.define([
|
|
|
100
104
|
// scenario: viewCache
|
|
101
105
|
if (bHasAppliedCustomData) {
|
|
102
106
|
// if the change was applied, set the revert data fetched from the custom data
|
|
103
|
-
oChange.setRevertData(FlexCustomData.getParsedRevertDataFromCustomData(
|
|
107
|
+
oChange.setRevertData(FlexCustomData.getParsedRevertDataFromCustomData(oOriginalControl, oChange, oModifier));
|
|
104
108
|
oChange.markSuccessful();
|
|
105
109
|
} else {
|
|
106
110
|
oChange.markFailed();
|
|
@@ -14,6 +14,26 @@ sap.ui.define([
|
|
|
14
14
|
) {
|
|
15
15
|
"use strict";
|
|
16
16
|
|
|
17
|
+
function processManifestPart(vManifestPart, oChangeTexts) {
|
|
18
|
+
// Recursively search the manifest for localization bindings and replace them with default texts
|
|
19
|
+
const vNewManifestPart = Array.isArray(vManifestPart)
|
|
20
|
+
? [...vManifestPart]
|
|
21
|
+
: { ...vManifestPart };
|
|
22
|
+
Object.entries(vNewManifestPart).forEach(([sKey, vValue]) => {
|
|
23
|
+
if (typeof vValue === "object" && vValue !== null) {
|
|
24
|
+
vNewManifestPart[sKey] = processManifestPart(vValue, oChangeTexts);
|
|
25
|
+
} else if (typeof vValue === "string") {
|
|
26
|
+
vNewManifestPart[sKey] = vValue.replaceAll(/{{.*?}}/g, (sMatch) => {
|
|
27
|
+
// Extract the key and replace it if there is a value for it
|
|
28
|
+
const sTextKey = sMatch.slice(2, -2);
|
|
29
|
+
const sResolvedValue = oChangeTexts[sTextKey];
|
|
30
|
+
return sResolvedValue || sMatch;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return vNewManifestPart;
|
|
35
|
+
}
|
|
36
|
+
|
|
17
37
|
var RuntimeStrategy = {
|
|
18
38
|
registry() {
|
|
19
39
|
return requireAsync("sap/ui/fl/apply/_internal/changes/descriptor/Registration");
|
|
@@ -22,16 +42,16 @@ sap.ui.define([
|
|
|
22
42
|
Log.error(oError);
|
|
23
43
|
},
|
|
24
44
|
processTexts(oManifest, oChangeTexts) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Log.error("Text change has to contain default language");
|
|
45
|
+
const oValidChangeTexts = {};
|
|
46
|
+
Object.entries(oChangeTexts).forEach(([sTextKey, { value: mChangeTextValue }]) => {
|
|
47
|
+
// Always use the default language (key = "")
|
|
48
|
+
if (mChangeTextValue[""]) {
|
|
49
|
+
oValidChangeTexts[sTextKey] = mChangeTextValue[""];
|
|
50
|
+
return;
|
|
32
51
|
}
|
|
52
|
+
Log.error("Text change has to contain default language");
|
|
33
53
|
});
|
|
34
|
-
return
|
|
54
|
+
return processManifestPart(oManifest, oValidChangeTexts);
|
|
35
55
|
}
|
|
36
56
|
};
|
|
37
57
|
|
|
@@ -19,7 +19,7 @@ sap.ui.define([
|
|
|
19
19
|
* Available for both runtime and build {@link sap.ui.fl.apply._internal.changes.descriptor.Registration}.
|
|
20
20
|
*
|
|
21
21
|
* @namespace sap.ui.fl.apply._internal.changes.descriptor.app.SetTitle
|
|
22
|
-
* @version 1.
|
|
22
|
+
* @version 1.119.0
|
|
23
23
|
* @private
|
|
24
24
|
* @ui5-restricted sap.ui.fl.apply._internal
|
|
25
25
|
*/
|
|
@@ -18,7 +18,7 @@ sap.ui.define([
|
|
|
18
18
|
* Available for both runtime and build {@link sap.ui.fl.apply._internal.changes.descriptor.Registration}.
|
|
19
19
|
*
|
|
20
20
|
* @namespace sap.ui.fl.apply._internal.changes.descriptor.ovp.DeleteCard
|
|
21
|
-
* @version 1.
|
|
21
|
+
* @version 1.119.0
|
|
22
22
|
* @private
|
|
23
23
|
* @ui5-restricted sap.ui.fl.apply._internal
|
|
24
24
|
*/
|
|
@@ -32,7 +32,7 @@ sap.ui.define([
|
|
|
32
32
|
* @extends sap.ui.fl.apply._internal.flexObjects.Variant
|
|
33
33
|
* @alias sap.ui.fl.apply._internal.flexObjects.CompVariant
|
|
34
34
|
* @since 1.103
|
|
35
|
-
* @version 1.
|
|
35
|
+
* @version 1.119.0
|
|
36
36
|
* @private
|
|
37
37
|
* @ui5-restricted sap.ui.fl, sap.ui.comp
|
|
38
38
|
*/
|
|
@@ -20,7 +20,7 @@ sap.ui.define([
|
|
|
20
20
|
* @extends sap.ui.fl.apply._internal.flexObjects.FlexObject
|
|
21
21
|
* @alias sap.ui.fl.apply._internal.flexObjects.ControllerExtensionChange
|
|
22
22
|
* @since 1.105
|
|
23
|
-
* @version 1.
|
|
23
|
+
* @version 1.119.0
|
|
24
24
|
* @private
|
|
25
25
|
* @ui5-restricted sap.ui.fl
|
|
26
26
|
*/
|
|
@@ -69,7 +69,7 @@ sap.ui.define([
|
|
|
69
69
|
* @extends sap.ui.base.ManagedObject
|
|
70
70
|
* @alias sap.ui.fl.apply._internal.flexObjects.FlexObject
|
|
71
71
|
* @since 1.100
|
|
72
|
-
* @version 1.
|
|
72
|
+
* @version 1.119.0
|
|
73
73
|
* @private
|
|
74
74
|
* @ui5-restricted sap.ui.fl
|
|
75
75
|
*/
|
|
@@ -144,6 +144,10 @@ sap.ui.define([
|
|
|
144
144
|
var oFlexObjectMetadata = this.getFlexObjectMetadata();
|
|
145
145
|
var sReference = oFlexObjectMetadata.reference;
|
|
146
146
|
if (sReference) {
|
|
147
|
+
// old changes have an unnecessary '.Component' in the reference, that is not actually part of the reference
|
|
148
|
+
oFlexObjectMetadata.reference = sReference.endsWith(".Component")
|
|
149
|
+
? sReference.replace(/\.Component(?!.*\.Component)/, "")
|
|
150
|
+
: sReference;
|
|
147
151
|
oFlexObjectMetadata.namespace ||= Utils.createNamespace({ reference: sReference }, this.getFileType());
|
|
148
152
|
oFlexObjectMetadata.projectId ||= sReference;
|
|
149
153
|
}
|
|
@@ -20,10 +20,9 @@ sap.ui.define([
|
|
|
20
20
|
"sap/ui/fl/apply/_internal/flexState/InitialPrepareFunctions",
|
|
21
21
|
"sap/ui/fl/apply/_internal/flexState/Loader",
|
|
22
22
|
"sap/ui/fl/apply/_internal/flexState/ManifestUtils",
|
|
23
|
-
"sap/ui/fl/
|
|
23
|
+
"sap/ui/fl/initial/_internal/FlexInfoSession",
|
|
24
24
|
"sap/ui/fl/LayerUtils",
|
|
25
|
-
"sap/ui/fl/requireAsync"
|
|
26
|
-
"sap/ui/fl/Utils"
|
|
25
|
+
"sap/ui/fl/requireAsync"
|
|
27
26
|
], function(
|
|
28
27
|
_omit,
|
|
29
28
|
each,
|
|
@@ -42,8 +41,7 @@ sap.ui.define([
|
|
|
42
41
|
ManifestUtils,
|
|
43
42
|
FlexInfoSession,
|
|
44
43
|
LayerUtils,
|
|
45
|
-
requireAsync
|
|
46
|
-
Utils
|
|
44
|
+
requireAsync
|
|
47
45
|
) {
|
|
48
46
|
"use strict";
|
|
49
47
|
|
|
@@ -87,17 +85,14 @@ sap.ui.define([
|
|
|
87
85
|
*
|
|
88
86
|
* @namespace sap.ui.fl.apply._internal.flexState.FlexState
|
|
89
87
|
* @since 1.73
|
|
90
|
-
* @version 1.
|
|
88
|
+
* @version 1.119.0
|
|
91
89
|
* @private
|
|
92
90
|
* @ui5-restricted sap.ui.fl.apply._internal
|
|
93
91
|
*/
|
|
94
92
|
var FlexState = {};
|
|
95
93
|
|
|
96
94
|
var _mInstances = {};
|
|
97
|
-
var _mNavigationHandlers = {};
|
|
98
95
|
var _mInitPromises = {};
|
|
99
|
-
var _oShellNavigationService;
|
|
100
|
-
var _oURLParsingService;
|
|
101
96
|
var _oChangePersistenceFactory;
|
|
102
97
|
var _mFlexObjectInfo = {
|
|
103
98
|
appDescriptorChanges: {
|
|
@@ -318,7 +313,7 @@ sap.ui.define([
|
|
|
318
313
|
bDataUpdated = true;
|
|
319
314
|
}
|
|
320
315
|
if (!_mInstances[sReference].storageResponse) {
|
|
321
|
-
_mInstances[sReference].storageResponse = filterByMaxLayer(_mInstances[sReference].unfilteredStorageResponse);
|
|
316
|
+
_mInstances[sReference].storageResponse = filterByMaxLayer(sReference, _mInstances[sReference].unfilteredStorageResponse);
|
|
322
317
|
// Flex objects need to be recreated
|
|
323
318
|
delete _mInstances[sReference].runtimePersistence;
|
|
324
319
|
bDataUpdated = true;
|
|
@@ -341,15 +336,17 @@ sap.ui.define([
|
|
|
341
336
|
}
|
|
342
337
|
}
|
|
343
338
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
if (LayerUtils.isLayerFilteringRequired(oURLParsingService)) {
|
|
339
|
+
function filterByMaxLayer(sReference, mResponse) {
|
|
340
|
+
const mFilteredReturn = merge({}, mResponse);
|
|
341
|
+
const mFlexObjects = mFilteredReturn.changes;
|
|
342
|
+
if (LayerUtils.isLayerFilteringRequired(sReference)) {
|
|
343
|
+
const oFlexInfoSession = FlexInfoSession.getByReference(sReference);
|
|
350
344
|
each(_mFlexObjectInfo, function(iIndex, mFlexObjectInfo) {
|
|
351
345
|
mFlexObjectInfo.pathInResponse.forEach(function(sPath) {
|
|
352
|
-
|
|
346
|
+
const aFilterByMaxLayer = ObjectPath.get(sPath, mFlexObjects).filter(function(oChangeDefinition) {
|
|
347
|
+
return !oChangeDefinition.layer || !LayerUtils.isOverLayer(oChangeDefinition.layer, oFlexInfoSession.maxLayer);
|
|
348
|
+
});
|
|
349
|
+
ObjectPath.set(sPath, aFilterByMaxLayer, mFlexObjects);
|
|
353
350
|
});
|
|
354
351
|
});
|
|
355
352
|
}
|
|
@@ -359,6 +356,7 @@ sap.ui.define([
|
|
|
359
356
|
function loadFlexData(mPropertyBag) {
|
|
360
357
|
_mInitPromises[mPropertyBag.reference] = Loader.loadFlexData(mPropertyBag)
|
|
361
358
|
.then(function(mResponse) {
|
|
359
|
+
// The following line is used by the Flex Support Tool to set breakpoints - please adjust the tool if you change it!
|
|
362
360
|
_mInstances[mPropertyBag.reference] = merge({}, {
|
|
363
361
|
unfilteredStorageResponse: mResponse,
|
|
364
362
|
preparedMaps: {},
|
|
@@ -367,7 +365,6 @@ sap.ui.define([
|
|
|
367
365
|
partialFlexState: mPropertyBag.partialFlexState
|
|
368
366
|
});
|
|
369
367
|
|
|
370
|
-
registerMaxLayerHandler(mPropertyBag.reference);
|
|
371
368
|
storeInfoInSession(mPropertyBag.reference, mResponse);
|
|
372
369
|
|
|
373
370
|
// no further changes to storageResponse properties allowed
|
|
@@ -391,42 +388,6 @@ sap.ui.define([
|
|
|
391
388
|
FlexInfoSession.setByReference(oFlexInfoSession, sReference);
|
|
392
389
|
}
|
|
393
390
|
|
|
394
|
-
function registerMaxLayerHandler(sReference) {
|
|
395
|
-
var oShellNavigationService = getUShellService("ShellNavigation");
|
|
396
|
-
if (oShellNavigationService && !_mNavigationHandlers[sReference]) {
|
|
397
|
-
_mNavigationHandlers[sReference] = handleMaxLayerChange.bind(null, sReference);
|
|
398
|
-
oShellNavigationService.registerNavigationFilter(_mNavigationHandlers[sReference]);
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
function deRegisterMaxLayerHandler(sReference) {
|
|
403
|
-
var oShellNavigationService = getUShellService("ShellNavigation");
|
|
404
|
-
if (oShellNavigationService) {
|
|
405
|
-
if (_mNavigationHandlers[sReference]) {
|
|
406
|
-
oShellNavigationService.unregisterNavigationFilter(_mNavigationHandlers[sReference]);
|
|
407
|
-
delete _mNavigationHandlers[sReference];
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
function handleMaxLayerChange(sReference, sNewHash, sOldHash) {
|
|
413
|
-
var oShellNavigationService = getUShellService("ShellNavigation");
|
|
414
|
-
if (oShellNavigationService) {
|
|
415
|
-
try {
|
|
416
|
-
var sCurrentMaxLayer = LayerUtils.getMaxLayerTechnicalParameter(sNewHash, getUShellService("URLParsing"));
|
|
417
|
-
var sPreviousMaxLayer = LayerUtils.getMaxLayerTechnicalParameter(sOldHash, getUShellService("URLParsing"));
|
|
418
|
-
if (sCurrentMaxLayer !== sPreviousMaxLayer) {
|
|
419
|
-
FlexState.rebuildFilteredResponse(sReference);
|
|
420
|
-
}
|
|
421
|
-
} catch (oError) {
|
|
422
|
-
// required to hinder any errors - can break FLP navigation
|
|
423
|
-
Log.error(oError.message);
|
|
424
|
-
}
|
|
425
|
-
return oShellNavigationService.NavigationFilterStatus.Continue;
|
|
426
|
-
}
|
|
427
|
-
return undefined;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
391
|
function checkPartialFlexState(mInitProperties) {
|
|
431
392
|
var oFlexInstance = _mInstances[mInitProperties.reference];
|
|
432
393
|
if (oFlexInstance.partialFlexState === true && mInitProperties.partialFlexState !== true) {
|
|
@@ -446,30 +407,6 @@ sap.ui.define([
|
|
|
446
407
|
return mInitProperties;
|
|
447
408
|
}
|
|
448
409
|
|
|
449
|
-
function loadUShellServices() {
|
|
450
|
-
return Promise.all([
|
|
451
|
-
Utils.getUShellService("ShellNavigation"),
|
|
452
|
-
Utils.getUShellService("URLParsing")
|
|
453
|
-
])
|
|
454
|
-
.then(function(aServices) {
|
|
455
|
-
[_oShellNavigationService, _oURLParsingService] = aServices;
|
|
456
|
-
})
|
|
457
|
-
.catch(function(oError) {
|
|
458
|
-
Log.error(`Error getting service from Unified Shell: ${oError.message}`);
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
function getUShellService(sServiceName) {
|
|
463
|
-
if (Utils.getUshellContainer()) {
|
|
464
|
-
if (sServiceName === "ShellNavigation") {
|
|
465
|
-
return _oShellNavigationService;
|
|
466
|
-
} else if (sServiceName === "URLParsing") {
|
|
467
|
-
return _oURLParsingService;
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
return undefined;
|
|
471
|
-
}
|
|
472
|
-
|
|
473
410
|
// TODO: get rid of the following module dependencies as soon as the change state
|
|
474
411
|
// is migrated from changePersistenceFactory to the FlexState
|
|
475
412
|
function lazyLoadModules() {
|
|
@@ -499,7 +436,6 @@ sap.ui.define([
|
|
|
499
436
|
*/
|
|
500
437
|
FlexState.initialize = function(mPropertyBag) {
|
|
501
438
|
return Promise.all([
|
|
502
|
-
loadUShellServices(),
|
|
503
439
|
lazyLoadModules()
|
|
504
440
|
])
|
|
505
441
|
.then(function() {
|
|
@@ -570,9 +506,6 @@ sap.ui.define([
|
|
|
570
506
|
FlexState.update = function(mPropertyBag) {
|
|
571
507
|
enhancePropertyBag(mPropertyBag);
|
|
572
508
|
var sReference = mPropertyBag.reference;
|
|
573
|
-
|
|
574
|
-
deRegisterMaxLayerHandler(sReference);
|
|
575
|
-
|
|
576
509
|
var oCurrentRuntimePersistence = _mInstances[sReference].runtimePersistence;
|
|
577
510
|
|
|
578
511
|
// TODO: get rid of the following persistence operations as soon as the change state
|
|
@@ -587,7 +520,7 @@ sap.ui.define([
|
|
|
587
520
|
return (_mInitPromises[sReference] || Promise.resolve())
|
|
588
521
|
.then(loadFlexData.bind(this, mPropertyBag))
|
|
589
522
|
.then(function() {
|
|
590
|
-
_mInstances[sReference].storageResponse = filterByMaxLayer(_mInstances[sReference].unfilteredStorageResponse);
|
|
523
|
+
_mInstances[sReference].storageResponse = filterByMaxLayer(sReference, _mInstances[sReference].unfilteredStorageResponse);
|
|
591
524
|
var bUpdated = updateRuntimePersistence(
|
|
592
525
|
sReference,
|
|
593
526
|
_mInstances[sReference].storageResponse,
|
|
@@ -659,7 +592,6 @@ sap.ui.define([
|
|
|
659
592
|
|
|
660
593
|
FlexState.clearState = function(sReference) {
|
|
661
594
|
if (sReference) {
|
|
662
|
-
deRegisterMaxLayerHandler(sReference);
|
|
663
595
|
delete _mInstances[sReference];
|
|
664
596
|
delete _mInitPromises[sReference];
|
|
665
597
|
oFlexObjectsDataSelector.clearCachedResult({ reference: sReference });
|
|
@@ -672,9 +604,6 @@ sap.ui.define([
|
|
|
672
604
|
_oChangePersistenceFactory._instanceCache[sReference].removeDirtyChanges();
|
|
673
605
|
}
|
|
674
606
|
} else {
|
|
675
|
-
Object.keys(_mInstances).forEach(function(sReference) {
|
|
676
|
-
deRegisterMaxLayerHandler(sReference);
|
|
677
|
-
});
|
|
678
607
|
_mInstances = {};
|
|
679
608
|
_mInitPromises = {};
|
|
680
609
|
oFlexObjectsDataSelector.clearCachedResult();
|
|
@@ -739,7 +668,7 @@ sap.ui.define([
|
|
|
739
668
|
FlexState.rebuildFilteredResponse = function(sReference) {
|
|
740
669
|
if (_mInstances[sReference]) {
|
|
741
670
|
_mInstances[sReference].preparedMaps = {};
|
|
742
|
-
_mInstances[sReference].storageResponse = filterByMaxLayer(_mInstances[sReference].unfilteredStorageResponse);
|
|
671
|
+
_mInstances[sReference].storageResponse = filterByMaxLayer(sReference, _mInstances[sReference].unfilteredStorageResponse);
|
|
743
672
|
// Storage response has changed, recreate the flex objects
|
|
744
673
|
_mInstances[sReference].runtimePersistence = buildRuntimePersistence(
|
|
745
674
|
_mInstances[sReference].storageResponse,
|