@openui5/sap.ui.fl 1.134.0 → 1.135.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 +2 -2
- 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 +16 -3
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Applier.js +3 -41
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/InlineApplier.js +47 -0
- 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/AddNewDataSource.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewInbound.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewOutbound.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddTechnicalAttributes.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeDataSource.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeOutbound.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/RemoveAllInboundsExceptOne.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetAch.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetDescription.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetTitle.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetAbstract.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetCloudDevAdaptationStatus.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/AddNewCard.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/ChangeCard.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddLibrary.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/ChangeModel.js +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/extensionPoint/Registry.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/AnnotationChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/AppDescriptorChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/ControllerExtensionChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlVariant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +11 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +38 -2
- package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +5 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/VariantChange.js +78 -0
- package/src/sap/ui/fl/apply/_internal/flexObjects/VariantManagementChange.js +84 -0
- package/src/sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/FlexObjectState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +17 -7
- package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +37 -9
- package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/changes/UIChangesState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantManagementState.js +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 +29 -4
- package/src/sap/ui/fl/apply/_internal/preprocessors/ComponentLifecycleHooks.js +3 -3
- package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +27 -11
- 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/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/ChangeAnnotation.js +23 -4
- package/src/sap/ui/fl/changeHandler/HideControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/MoveControls.js +1 -1
- package/src/sap/ui/fl/changeHandler/MoveElements.js +1 -1
- package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +1 -1
- package/src/sap/ui/fl/changeHandler/PropertyChange.js +1 -1
- package/src/sap/ui/fl/changeHandler/StashControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UnhideControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UnstashControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +1 -1
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorChange.js +121 -0
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +7 -95
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js +1 -1
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorVariantFactory.js +1 -1
- package/src/sap/ui/fl/initial/_internal/FlexConfiguration.js +1 -1
- package/src/sap/ui/fl/initial/_internal/Storage.js +1 -1
- package/src/sap/ui/fl/initial/_internal/StorageFeaturesMerger.js +1 -1
- package/src/sap/ui/fl/initial/_internal/StorageUtils.js +13 -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/initial/api/InitialFlexAPI.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_sl.properties +1 -1
- package/src/sap/ui/fl/support/_internal/getAllUIChanges.js +1 -1
- package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +1 -1
- package/src/sap/ui/fl/support/_internal/getFlexObjectInfos.js +1 -1
- package/src/sap/ui/fl/support/_internal/getFlexSettings.js +1 -1
- package/src/sap/ui/fl/support/api/SupportAPI.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/index.html +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/VariantManager.js +21 -21
- package/src/sap/ui/fl/variants/VariantModel.js +5 -5
- package/src/sap/ui/fl/write/_internal/Storage.js +1 -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 +24 -21
- package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +7 -9
- 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/BtpServiceConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +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/fieldExtensibility/ABAPAccess.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariant.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariantFactory.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/MultiTenantABAPExtensibilityVariant.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ServiceValidation.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/SingleTenantABAPExtensibilityVariant.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/UriParser.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/Utils.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/CAPAccess.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/FlexObjectManager.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/changes/UIChangeManager.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +1 -1
- 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/BusinessNetworkAPI.js +138 -0
- package/src/sap/ui/fl/write/api/ChangesWriteAPI.js +52 -62
- package/src/sap/ui/fl/write/api/ContextBasedAdaptationsAPI.js +8 -9
- package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
- package/src/sap/ui/fl/write/api/LocalResetAPI.js +49 -29
- package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +56 -62
- package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +5 -6
|
@@ -13,6 +13,7 @@ sap.ui.define([
|
|
|
13
13
|
"sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler",
|
|
14
14
|
"sap/ui/fl/apply/_internal/flexState/DataSelector",
|
|
15
15
|
"sap/ui/fl/apply/_internal/flexState/FlexState",
|
|
16
|
+
"sap/ui/fl/changeHandler/condenser/Classification",
|
|
16
17
|
"sap/ui/fl/initial/_internal/Storage",
|
|
17
18
|
"sap/ui/fl/LayerUtils"
|
|
18
19
|
], function(
|
|
@@ -24,17 +25,37 @@ sap.ui.define([
|
|
|
24
25
|
DependencyHandler,
|
|
25
26
|
DataSelector,
|
|
26
27
|
FlexState,
|
|
28
|
+
Classification,
|
|
27
29
|
Storage,
|
|
28
30
|
LayerUtils
|
|
29
31
|
) {
|
|
30
32
|
"use strict";
|
|
31
33
|
|
|
34
|
+
const oChangeInformationProviders = {
|
|
35
|
+
ctrl_variant_change: {
|
|
36
|
+
getCondenserInfo(oFlexObject) {
|
|
37
|
+
return {
|
|
38
|
+
classification: Classification.LastOneWins,
|
|
39
|
+
uniqueKey: oFlexObject.getVariantId() + oFlexObject.getChangeType()
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
ctrl_variant_management_change: {
|
|
44
|
+
getCondenserInfo(oFlexObject, mPropertyBag) {
|
|
45
|
+
return {
|
|
46
|
+
classification: Classification.LastOneWins,
|
|
47
|
+
uniqueKey: mPropertyBag.modifier.getControlIdBySelector(oFlexObject.getSelector(), mPropertyBag.appComponent)
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
32
53
|
/**
|
|
33
54
|
* Handler class to manipulate control variant changes in a variants map. See also {@link sap.ui.fl.variants.VariantManagement}.
|
|
34
55
|
*
|
|
35
56
|
* @namespace sap.ui.fl.apply._internal.flexState.controlVariants.VariantManagementState
|
|
36
57
|
* @since 1.74
|
|
37
|
-
* @version 1.
|
|
58
|
+
* @version 1.135.0
|
|
38
59
|
* @private
|
|
39
60
|
* @ui5-restricted
|
|
40
61
|
*/
|
|
@@ -126,7 +147,7 @@ sap.ui.define([
|
|
|
126
147
|
return {
|
|
127
148
|
instance: oVariantInstance,
|
|
128
149
|
variantChanges: oGroupedFlexObjects.variantChanges.filter(function(oFlexObject) {
|
|
129
|
-
return oFlexObject.
|
|
150
|
+
return oFlexObject.getVariantId() === oVariantInstance.getId();
|
|
130
151
|
}),
|
|
131
152
|
controlChanges: oGroupedFlexObjects.changes.filter(function(oFlexObject) {
|
|
132
153
|
var bCorrectFlexObjectType = oFlexObject.isA("sap.ui.fl.apply._internal.flexObjects.UIChange");
|
|
@@ -304,7 +325,7 @@ sap.ui.define([
|
|
|
304
325
|
var oFoundVariant;
|
|
305
326
|
Object.values(oVariantsMap).some(function(oVariantsMapEntry) {
|
|
306
327
|
return oVariantsMapEntry.variants.some(function(oVariant) {
|
|
307
|
-
if (oVariantChange.
|
|
328
|
+
if (oVariantChange.getVariantId() === oVariant.key) {
|
|
308
329
|
oFoundVariant = oVariant;
|
|
309
330
|
return true;
|
|
310
331
|
}
|
|
@@ -406,6 +427,10 @@ sap.ui.define([
|
|
|
406
427
|
return oVariantDependentFlexObjectsDataSelector.get({reference: sReference});
|
|
407
428
|
};
|
|
408
429
|
|
|
430
|
+
VariantManagementState.getChangeInformationProvider = function(oFlexObject) {
|
|
431
|
+
return oChangeInformationProviders[oFlexObject.getFileType()];
|
|
432
|
+
};
|
|
433
|
+
|
|
409
434
|
/**
|
|
410
435
|
* Removes the saved current variant from the internal map for the given reference
|
|
411
436
|
*
|
|
@@ -735,7 +760,7 @@ sap.ui.define([
|
|
|
735
760
|
// eslint-disable-next-line camelcase
|
|
736
761
|
ctrl_variant: () => (oFilteredFlexObject.getVariantId()),
|
|
737
762
|
// eslint-disable-next-line camelcase
|
|
738
|
-
ctrl_variant_change: () => (oFilteredFlexObject.
|
|
763
|
+
ctrl_variant_change: () => (oFilteredFlexObject.getVariantId()),
|
|
739
764
|
change: () => (oFilteredFlexObject.getVariantReference())
|
|
740
765
|
}[oFilteredFlexObject.getFileType()]?.();
|
|
741
766
|
return !aHiddenVariants.includes(sVariantReference);
|
|
@@ -8,8 +8,8 @@ sap.ui.define([
|
|
|
8
8
|
"sap/base/Log",
|
|
9
9
|
"sap/ui/core/Component",
|
|
10
10
|
"sap/ui/core/Lib",
|
|
11
|
-
"sap/ui/fl/apply/_internal/changes/descriptor/Applier",
|
|
12
11
|
"sap/ui/fl/apply/_internal/changes/descriptor/ApplyStrategyFactory",
|
|
12
|
+
"sap/ui/fl/apply/_internal/changes/descriptor/InlineApplier",
|
|
13
13
|
"sap/ui/fl/apply/_internal/changes/Applier",
|
|
14
14
|
"sap/ui/fl/apply/_internal/flexState/FlexState",
|
|
15
15
|
"sap/ui/fl/apply/_internal/flexState/ManifestUtils",
|
|
@@ -26,8 +26,8 @@ sap.ui.define([
|
|
|
26
26
|
Log,
|
|
27
27
|
Component,
|
|
28
28
|
Lib,
|
|
29
|
-
AppDescriptorApplier,
|
|
30
29
|
ApplyStrategyFactory,
|
|
30
|
+
InlineApplier,
|
|
31
31
|
ChangesApplier,
|
|
32
32
|
FlexState,
|
|
33
33
|
ManifestUtils,
|
|
@@ -200,7 +200,7 @@ sap.ui.define([
|
|
|
200
200
|
// manifest descriptor changes for ABAP mixed mode can only be applied in this hook,
|
|
201
201
|
// because at this point all libs have been loaded (in contrast to the first Component(s) 'onPreprocessManifest' hook),
|
|
202
202
|
// but the manifest is still adaptable
|
|
203
|
-
return
|
|
203
|
+
return InlineApplier.applyChanges(oManifest, ApplyStrategyFactory.getRuntimeStrategy());
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
// the current sinon version used in UI5 does not support stubbing the constructor
|
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
+
"sap/base/Log",
|
|
8
9
|
"sap/ui/core/Component",
|
|
9
|
-
"sap/ui/fl/apply/_internal/flexState/ManifestUtils",
|
|
10
10
|
"sap/ui/fl/apply/_internal/flexState/FlexState",
|
|
11
|
-
"sap/ui/fl/
|
|
12
|
-
"sap/
|
|
11
|
+
"sap/ui/fl/apply/_internal/flexState/ManifestUtils",
|
|
12
|
+
"sap/ui/fl/Utils"
|
|
13
13
|
], function(
|
|
14
|
+
Log,
|
|
14
15
|
Component,
|
|
15
|
-
ManifestUtils,
|
|
16
16
|
FlexState,
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
ManifestUtils,
|
|
18
|
+
Utils
|
|
19
19
|
) {
|
|
20
20
|
"use strict";
|
|
21
21
|
|
|
@@ -26,7 +26,7 @@ sap.ui.define([
|
|
|
26
26
|
* @class
|
|
27
27
|
* @constructor
|
|
28
28
|
* @author SAP SE
|
|
29
|
-
* @version 1.
|
|
29
|
+
* @version 1.135.0
|
|
30
30
|
* @since 1.27.0
|
|
31
31
|
* @private
|
|
32
32
|
* @ui5-restricted sap.ui.fl, sap.ui.core
|
|
@@ -37,9 +37,25 @@ sap.ui.define([
|
|
|
37
37
|
return oChange.getChangeType() === "codeExt";
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
function migrateToNewSyntaxIfNecessary(sControllerName) {
|
|
41
|
+
if (!sControllerName.startsWith("module:")) {
|
|
42
|
+
return `module:${sControllerName.replace(/\./g, "/")}.controller`;
|
|
43
|
+
}
|
|
44
|
+
return sControllerName;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Checks if the controller name saved in the change matches the provided controller name.
|
|
49
|
+
* The syntax for the controller name changed to module syntax in 1.134, so legacy changes need
|
|
50
|
+
* to be transformed to module syntax before the check.
|
|
51
|
+
*
|
|
52
|
+
* @param {string} sControllerName - Name of the controller in module syntax
|
|
53
|
+
* @param {sap.ui.fl.apply._internal.flexObjects.ControllerExtensionChange} oChange - ControllerExtensionChange instance
|
|
54
|
+
* @returns {boolean} - Returns true if the controller name of the change matches the provided controller name
|
|
55
|
+
*/
|
|
40
56
|
function isForController(sControllerName, oChange) {
|
|
41
|
-
var sSelectorControllerName = oChange.getSelector().controllerName;
|
|
42
|
-
return
|
|
57
|
+
var sSelectorControllerName = migrateToNewSyntaxIfNecessary(oChange.getSelector().controllerName);
|
|
58
|
+
return sSelectorControllerName === migrateToNewSyntaxIfNecessary(sControllerName);
|
|
43
59
|
}
|
|
44
60
|
|
|
45
61
|
function getExtensionModules(aCodeExtModuleNames) {
|
|
@@ -58,8 +74,8 @@ sap.ui.define([
|
|
|
58
74
|
}
|
|
59
75
|
|
|
60
76
|
/**
|
|
61
|
-
* Provides an array of extension providers. An extension provider is an object which were defined as controller extensions.
|
|
62
|
-
*
|
|
77
|
+
* Provides an array of extension providers. An extension provider is an object which were defined as controller extensions.
|
|
78
|
+
* These objects provide lifecycle and event handler functions of a specific controller.
|
|
63
79
|
*
|
|
64
80
|
* @param {string} sControllerName - Name of the controller
|
|
65
81
|
* @param {string} sComponentId - Unique id for the running controller - unique as well for manifest first
|
|
@@ -15,7 +15,7 @@ sap.ui.define([
|
|
|
15
15
|
* Default change handler for annotations.
|
|
16
16
|
* @alias sap.ui.fl.changeHandler.ChangeAnnotation
|
|
17
17
|
* @author SAP SE
|
|
18
|
-
* @version 1.
|
|
18
|
+
* @version 1.135.0
|
|
19
19
|
* @since 1.132
|
|
20
20
|
* @public
|
|
21
21
|
*/
|
|
@@ -32,10 +32,20 @@ sap.ui.define([
|
|
|
32
32
|
* @returns {object} Information for the model to apply the change
|
|
33
33
|
*/
|
|
34
34
|
ChangeAnnotation.applyChange = function(oChange) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
const oContent = oChange.getContent();
|
|
36
|
+
const oReturn = {
|
|
37
|
+
path: oContent.annotationPath
|
|
38
38
|
};
|
|
39
|
+
|
|
40
|
+
const sValue = oChange.getText("annotationText") || oContent.value;
|
|
41
|
+
|
|
42
|
+
const oObjectTemplateInfo = oContent.objectTemplateInfo;
|
|
43
|
+
if (oObjectTemplateInfo) {
|
|
44
|
+
oReturn.value = JSON.parse(oObjectTemplateInfo.templateAsString.replace(oObjectTemplateInfo.placeholder, sValue));
|
|
45
|
+
} else {
|
|
46
|
+
oReturn.value = sValue;
|
|
47
|
+
}
|
|
48
|
+
return oReturn;
|
|
39
49
|
};
|
|
40
50
|
|
|
41
51
|
/**
|
|
@@ -50,11 +60,20 @@ sap.ui.define([
|
|
|
50
60
|
* @param {object} oSpecificChangeInfo - Information needed to complete the change
|
|
51
61
|
* @param {string} oSpecificChangeInfo.content.annotationPath - Path of the annotation to be changed
|
|
52
62
|
* @param {string} oSpecificChangeInfo.content.value - Value of the annotation to be changed
|
|
63
|
+
* @param {string} oSpecificChangeInfo.content.text - Translatable value of the annotation. If given, the value is ignored
|
|
64
|
+
* @param {object} [oSpecificChangeInfo.content.objectTemplateInfo] - Object template to construct a return object
|
|
65
|
+
* @param {string} [oSpecificChangeInfo.content.objectTemplateInfo.templateAsString] - Stringified template to be used for constructing the return object
|
|
66
|
+
* @param {string} [oSpecificChangeInfo.content.objectTemplateInfo.placeholder] - Placeholder in the template string
|
|
53
67
|
*/
|
|
54
68
|
ChangeAnnotation.completeChangeContent = function(oChange, oSpecificChangeInfo) {
|
|
55
69
|
const oNewContent = {
|
|
56
70
|
annotationPath: oSpecificChangeInfo.content.annotationPath
|
|
57
71
|
};
|
|
72
|
+
|
|
73
|
+
if (oSpecificChangeInfo.content.objectTemplateInfo) {
|
|
74
|
+
oNewContent.objectTemplateInfo = oSpecificChangeInfo.content.objectTemplateInfo;
|
|
75
|
+
}
|
|
76
|
+
|
|
58
77
|
if (oSpecificChangeInfo.content.text) {
|
|
59
78
|
oChange.setText("annotationText", oSpecificChangeInfo.content.text);
|
|
60
79
|
} else {
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2025 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
sap.ui.define([
|
|
7
|
+
"sap/base/util/merge",
|
|
8
|
+
"sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory",
|
|
9
|
+
"sap/ui/fl/write/_internal/flexState/changes/UIChangeManager",
|
|
10
|
+
"sap/ui/fl/ChangePersistenceFactory",
|
|
11
|
+
"sap/ui/fl/Utils"
|
|
12
|
+
], function(
|
|
13
|
+
fnBaseMerge,
|
|
14
|
+
FlexObjectFactory,
|
|
15
|
+
UIChangeManager,
|
|
16
|
+
ChangePersistenceFactory,
|
|
17
|
+
Utils
|
|
18
|
+
) {
|
|
19
|
+
"use strict";
|
|
20
|
+
/**
|
|
21
|
+
* Descriptor Related
|
|
22
|
+
* @namespace
|
|
23
|
+
* @name sap.ui.fl.descriptorRelated
|
|
24
|
+
* @author SAP SE
|
|
25
|
+
* @version 1.135.0
|
|
26
|
+
* @private
|
|
27
|
+
* @ui5-restricted sap.ui.rta, smart business
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Descriptor Related Apis
|
|
32
|
+
* @namespace
|
|
33
|
+
* @name sap.ui.fl.descriptorRelated.api
|
|
34
|
+
* @author SAP SE
|
|
35
|
+
* @version 1.135.0
|
|
36
|
+
* @private
|
|
37
|
+
* @ui5-restricted sap.ui.rta, smart business
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Descriptor Change
|
|
42
|
+
*
|
|
43
|
+
* @param {object} mChangeFile change file
|
|
44
|
+
* @param {sap.ui.fl.descriptorRelated.api.DescriptorInlineChange} oInlineChange inline change object
|
|
45
|
+
*
|
|
46
|
+
* @constructor
|
|
47
|
+
* @alias sap.ui.fl.descriptorRelated.api.DescriptorChange
|
|
48
|
+
* @author SAP SE
|
|
49
|
+
* @version 1.135.0
|
|
50
|
+
* @private
|
|
51
|
+
* @ui5-restricted sap.ui.rta, smart business
|
|
52
|
+
*/
|
|
53
|
+
const DescriptorChange = function(mChangeFile, oInlineChange) { // so far, parameter correspond to inline change format
|
|
54
|
+
this._mChangeFile = mChangeFile;
|
|
55
|
+
this._mChangeFile.packageName = "";
|
|
56
|
+
this._oInlineChange = oInlineChange;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Submits the descriptor change to the backend
|
|
61
|
+
*
|
|
62
|
+
* @return {Promise} resolving after all changes have been saved
|
|
63
|
+
*
|
|
64
|
+
* @private
|
|
65
|
+
* @ui5-restricted sap.ui.rta, smart business
|
|
66
|
+
*/
|
|
67
|
+
DescriptorChange.prototype.submit = function() {
|
|
68
|
+
this.store();
|
|
69
|
+
|
|
70
|
+
// submit
|
|
71
|
+
const oChangePersistence = this._getChangePersistence(this._mChangeFile.reference);
|
|
72
|
+
return oChangePersistence.saveDirtyChanges();
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Stores the descriptor change in change persistence
|
|
77
|
+
*
|
|
78
|
+
* @return {object} change object
|
|
79
|
+
*
|
|
80
|
+
* @private
|
|
81
|
+
* @ui5-restricted sap.ui.rta, smart business
|
|
82
|
+
*/
|
|
83
|
+
DescriptorChange.prototype.store = function() {
|
|
84
|
+
const sReference = this._mChangeFile.reference;
|
|
85
|
+
const oComponent = Utils.getComponentForControl(this._mChangeFile.selector);
|
|
86
|
+
const oChange = this._getChangeToSubmit();
|
|
87
|
+
UIChangeManager.addDirtyChanges(sReference, [oChange], oComponent);
|
|
88
|
+
|
|
89
|
+
return oChange;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
DescriptorChange.prototype._getChangePersistence = function(sComponentName) {
|
|
93
|
+
return ChangePersistenceFactory.getChangePersistenceForComponent(sComponentName);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
DescriptorChange.prototype._getChangeToSubmit = function() {
|
|
97
|
+
return FlexObjectFactory.createAppDescriptorChange(this._getMap());
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
DescriptorChange.prototype._getMap = function() {
|
|
101
|
+
var mInlineChange = this._oInlineChange.getMap();
|
|
102
|
+
|
|
103
|
+
this._mChangeFile.content = mInlineChange.content;
|
|
104
|
+
this._mChangeFile.texts = mInlineChange.texts;
|
|
105
|
+
return this._mChangeFile;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Returns a copy of the JSON object of the descriptor change
|
|
110
|
+
*
|
|
111
|
+
* @return {object} copy of JSON object of the descriptor change
|
|
112
|
+
*
|
|
113
|
+
* @private
|
|
114
|
+
* @ui5-restricted sap.ui.rta, smart business
|
|
115
|
+
*/
|
|
116
|
+
DescriptorChange.prototype.getJson = function() {
|
|
117
|
+
return fnBaseMerge({}, this._getMap());
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
return DescriptorChange;
|
|
121
|
+
});
|