@openui5/sap.ui.fl 1.122.0 → 1.123.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/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 +1 -1
- package/src/sap/ui/fl/Utils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +90 -46
- package/src/sap/ui/fl/apply/_internal/DelegateMediatorNew.js +193 -0
- package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/Utils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddAnnotationsToOData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/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/ObjectStorageConnector.js +8 -4
- 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/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 +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +7 -11
- package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +6 -2
- package/src/sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor.js +7 -6
- package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +39 -24
- package/src/sap/ui/fl/apply/_internal/flexState/InitialPrepareFunctions.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/changes/UIChangesState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/preprocessors/ComponentLifecycleHooks.js +0 -3
- package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +1 -1
- package/src/sap/ui/fl/apply/_internal/preprocessors/RegistrationDelegator.js +11 -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/apply/api/DelegateMediatorAPI.js +75 -7
- package/src/sap/ui/fl/changeHandler/AddIFrame.js +1 -1
- package/src/sap/ui/fl/changeHandler/AddXML.js +1 -1
- package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +1 -1
- package/src/sap/ui/fl/changeHandler/Base.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseAddXml.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseRename.js +1 -1
- package/src/sap/ui/fl/changeHandler/HideControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/MoveControls.js +1 -1
- package/src/sap/ui/fl/changeHandler/MoveElements.js +1 -1
- package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +1 -1
- package/src/sap/ui/fl/changeHandler/PropertyChange.js +1 -1
- package/src/sap/ui/fl/changeHandler/StashControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UnhideControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UnstashControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +1 -1
- package/src/sap/ui/fl/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/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 +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/LrepConnector.js +12 -8
- 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/support/_internal/getAllUIChanges.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/transport/TransportSelection.js +1 -1
- package/src/sap/ui/fl/util/IFrame.js +1 -1
- package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
- package/src/sap/ui/fl/util/resolveBinding.js +1 -1
- package/src/sap/ui/fl/variants/VariantModel.js +18 -1
- package/src/sap/ui/fl/write/_internal/Storage.js +1 -1
- package/src/sap/ui/fl/write/_internal/Versions.js +12 -9
- 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/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/delegates/ODataV2ReadDelegate.js +276 -0
- 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/FlexObjectState.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/UI2Personalization/UI2PersonalizationState.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/FieldExtensibility.js +37 -7
- package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +0 -1
- package/src/sap/ui/fl/write/api/VersionsAPI.js +33 -35
- package/src/sap/ui/fl/write/api/connectors/FileListBaseConnector.js +8 -4
|
@@ -21,7 +21,7 @@ sap.ui.define([
|
|
|
21
21
|
* Connector for saving and deleting data from SAPUI5 Flexibility KeyUser service - including personalization.
|
|
22
22
|
*
|
|
23
23
|
* @namespace sap.ui.fl.write._internal.connectors.BtpServiceConnector
|
|
24
|
-
* @version 1.
|
|
24
|
+
* @version 1.123.0
|
|
25
25
|
* @private
|
|
26
26
|
* @ui5-restricted sap.ui.fl.write._internal.Storage
|
|
27
27
|
*/
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
sap.ui.define(["sap/ui/model/ListBinding"], function(ListBinding) {
|
|
7
|
+
"use strict";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Checks if the property is using a complex type.
|
|
11
|
+
*
|
|
12
|
+
* @param {Object} mProperty - The property object from the entity type.
|
|
13
|
+
* @returns {boolean} - Returns true if the property is using a complex type, otherwise false.
|
|
14
|
+
*/
|
|
15
|
+
function isComplexType(mProperty) {
|
|
16
|
+
return !!(mProperty && mProperty.type && mProperty.type.toLowerCase().indexOf("edm") !== 0);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Check for absolute aggregation binding.
|
|
21
|
+
*
|
|
22
|
+
* @param {Object} oElement - the element to check
|
|
23
|
+
* @param {string} sAggregationName - the name of the aggregation
|
|
24
|
+
* @return {boolean} whether the path starts with "/"
|
|
25
|
+
*/
|
|
26
|
+
function checkForAbsoluteAggregationBinding(oElement, sAggregationName) {
|
|
27
|
+
if (!oElement) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
const mBindingInfo = oElement.getBindingInfo(sAggregationName);
|
|
31
|
+
const sPath = mBindingInfo && mBindingInfo.path;
|
|
32
|
+
if (!sPath) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
return sPath.indexOf("/") === 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Retrieves the default model binding data for the given element based on certain conditions.
|
|
40
|
+
*
|
|
41
|
+
* @param {Object} oElement - The element for which the binding data is retrieved.
|
|
42
|
+
* @param {boolean} bAbsoluteAggregationBinding - Flag indicating whether to use absolute aggregation binding.
|
|
43
|
+
* @param {string} sAggregationName - The name of the aggregation for which binding data is fetched.
|
|
44
|
+
* @return {Object|undefined} The binding data for the element or undefined if not found.
|
|
45
|
+
*/
|
|
46
|
+
function getDefaultModelBindingData(oElement, bAbsoluteAggregationBinding, sAggregationName) {
|
|
47
|
+
let vBinding;
|
|
48
|
+
if (bAbsoluteAggregationBinding) {
|
|
49
|
+
vBinding = oElement.getBindingInfo(sAggregationName);
|
|
50
|
+
// check to be default model binding otherwise return undefined
|
|
51
|
+
if (typeof vBinding.model === "string" && vBinding.model !== "") {
|
|
52
|
+
vBinding = undefined;
|
|
53
|
+
}
|
|
54
|
+
} else {
|
|
55
|
+
// here we explicitly request the default models binding context
|
|
56
|
+
vBinding = oElement.getBindingContext();
|
|
57
|
+
}
|
|
58
|
+
return vBinding;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Enriches a property with additional information such as label, tooltip, and visibility.
|
|
63
|
+
*
|
|
64
|
+
* @param {object} mProperty - The property object to be enriched
|
|
65
|
+
* @param {object} mODataEntity - The OData entity object containing metadata
|
|
66
|
+
* @param {object} oElement - The element to which the property belongs
|
|
67
|
+
* @param {string} sAggregationName - The name of the aggregation
|
|
68
|
+
* @return {object} The enriched property object
|
|
69
|
+
*/
|
|
70
|
+
function enrichProperty(mProperty, mODataEntity, oElement, sAggregationName) {
|
|
71
|
+
const mProp = {
|
|
72
|
+
name: mProperty.name,
|
|
73
|
+
bindingPath: mProperty.name,
|
|
74
|
+
entityType: mODataEntity.name
|
|
75
|
+
};
|
|
76
|
+
const mLabelAnnotation = mProperty["com.sap.vocabularies.Common.v1.Label"];
|
|
77
|
+
mProp.label = mLabelAnnotation && mLabelAnnotation.String;
|
|
78
|
+
|
|
79
|
+
const mQuickInfoAnnotation = mProperty["com.sap.vocabularies.Common.v1.QuickInfo"];
|
|
80
|
+
mProp.tooltip = mQuickInfoAnnotation && mQuickInfoAnnotation.String;
|
|
81
|
+
|
|
82
|
+
// CDS UI.Hidden new way also for sap:visible = false
|
|
83
|
+
const mHiddenAnnotation = mProperty["com.sap.vocabularies.UI.v1.Hidden"];
|
|
84
|
+
mProp.hideFromReveal = !!mHiddenAnnotation && mHiddenAnnotation.Bool === "true";
|
|
85
|
+
|
|
86
|
+
if (!mProp.hideFromReveal) {
|
|
87
|
+
// Old hidden annotation
|
|
88
|
+
const mFieldControlAnnotation = mProperty["com.sap.vocabularies.Common.v1.FieldControl"];
|
|
89
|
+
if (mFieldControlAnnotation && mFieldControlAnnotation.EnumMember) {
|
|
90
|
+
mProp.hideFromReveal = mFieldControlAnnotation.EnumMember === "com.sap.vocabularies.Common.v1.FieldControlType/Hidden";
|
|
91
|
+
} else {
|
|
92
|
+
// @runtime hidden by field control value = 0
|
|
93
|
+
const sFieldControlPath = mFieldControlAnnotation && mFieldControlAnnotation.Path;
|
|
94
|
+
if (sFieldControlPath) {
|
|
95
|
+
// if the binding is a list binding, we skip the check for field control
|
|
96
|
+
const bListBinding = oElement.getBinding(sAggregationName) instanceof ListBinding;
|
|
97
|
+
if (!bListBinding) {
|
|
98
|
+
const iFieldControlValue = oElement.getBindingContext().getProperty(sFieldControlPath);
|
|
99
|
+
mProp.hideFromReveal = iFieldControlValue === 0;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return mProp;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Converts metadata to delegate format.
|
|
109
|
+
*
|
|
110
|
+
* @param {object} mODataEntity - The OData entity metadata object
|
|
111
|
+
* @param {object} oMetaModel - The meta model object
|
|
112
|
+
* @param {object} oElement - The element object
|
|
113
|
+
* @param {string} sAggregationName - The name of the aggregation
|
|
114
|
+
* @return {array} The properties in delegate format
|
|
115
|
+
*/
|
|
116
|
+
function convertMetadataToDelegateFormat(mODataEntity, oMetaModel, oElement, sAggregationName) {
|
|
117
|
+
const aFieldControlProperties = mODataEntity.property
|
|
118
|
+
.map((mProperty) => mProperty["sap:field-control"])
|
|
119
|
+
.filter(Boolean);
|
|
120
|
+
|
|
121
|
+
const fnFilterFieldControlProperties = (mProperty) => !aFieldControlProperties.includes(mProperty.name);
|
|
122
|
+
|
|
123
|
+
const aProperties = mODataEntity.property.map((mProperty) => {
|
|
124
|
+
const mProp = enrichProperty(mProperty, mODataEntity, oElement, sAggregationName);
|
|
125
|
+
if (isComplexType(mProperty)) {
|
|
126
|
+
const mComplexType = oMetaModel.getODataComplexType(mProperty.type);
|
|
127
|
+
if (mComplexType) {
|
|
128
|
+
// deep properties, could get multiple-level deep
|
|
129
|
+
mProp.properties = mComplexType.property
|
|
130
|
+
.map((mComplexProperty) => {
|
|
131
|
+
const mInnerProp = enrichProperty(mComplexProperty, mODataEntity, oElement, sAggregationName);
|
|
132
|
+
mInnerProp.bindingPath = `${mProperty.name}/${mComplexProperty.name}`;
|
|
133
|
+
mInnerProp.referencedComplexPropertyName = mProp.label || mProp.name;
|
|
134
|
+
return mInnerProp;
|
|
135
|
+
})
|
|
136
|
+
.filter(fnFilterFieldControlProperties);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return mProp;
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
if (mODataEntity.navigationProperty) {
|
|
143
|
+
const aNavigationProperties = mODataEntity.navigationProperty.map((mNavProp) => {
|
|
144
|
+
const sFullyQualifiedEntityName = oMetaModel.getODataAssociationEnd(mODataEntity, mNavProp.name)?.type;
|
|
145
|
+
return {
|
|
146
|
+
name: mNavProp.name,
|
|
147
|
+
// no labels or tooltips for navigation properties
|
|
148
|
+
entityType: sFullyQualifiedEntityName,
|
|
149
|
+
bindingPath: mNavProp.name,
|
|
150
|
+
unsupported: true // no support for navigation properties yet
|
|
151
|
+
// can have properties (like complex types in future)
|
|
152
|
+
};
|
|
153
|
+
});
|
|
154
|
+
aProperties.push(...aNavigationProperties);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return aProperties.filter(fnFilterFieldControlProperties);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Retrieves the binding path based on the provided element, aggregation name, and payload.
|
|
162
|
+
*
|
|
163
|
+
* @param {Object} oElement - the element to get the binding path for
|
|
164
|
+
* @param {string} sAggregationName - the name of the aggregation
|
|
165
|
+
* @param {Object} mPayload - the payload containing the path
|
|
166
|
+
* @return {string} the binding path
|
|
167
|
+
*/
|
|
168
|
+
function getBindingPath(oElement, sAggregationName, mPayload) {
|
|
169
|
+
if (mPayload.path) {
|
|
170
|
+
return mPayload.path;
|
|
171
|
+
}
|
|
172
|
+
return checkForAbsoluteAggregationBinding(oElement, sAggregationName)
|
|
173
|
+
? getDefaultModelBindingData(oElement, true, sAggregationName).path
|
|
174
|
+
: getDefaultModelBindingData(oElement, false, sAggregationName).getPath();
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Load the OData meta model for the given element.
|
|
179
|
+
*
|
|
180
|
+
* @param {object} oElement - The element to load the meta model for
|
|
181
|
+
* @param {object} mPayload - The payload containing model information
|
|
182
|
+
* @return {Promise} A Promise that resolves with the OData meta model or null if not found
|
|
183
|
+
*/
|
|
184
|
+
async function loadODataMetaModel(oElement, mPayload) {
|
|
185
|
+
const oModel = oElement.getModel(mPayload.modelName);
|
|
186
|
+
if (oModel && ["sap.ui.model.odata.ODataModel", "sap.ui.model.odata.v2.ODataModel"].includes(oModel.getMetadata().getName())) {
|
|
187
|
+
const oMetaModel = oModel.getMetaModel();
|
|
188
|
+
await oMetaModel.loaded();
|
|
189
|
+
return oMetaModel;
|
|
190
|
+
}
|
|
191
|
+
return null;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Retrieve OData entity from meta model based on the binding context path.
|
|
196
|
+
*
|
|
197
|
+
* @param {object} oMetaModel - The meta model object
|
|
198
|
+
* @param {string} sBindingContextPath - The binding context path
|
|
199
|
+
* @returns {object} - The OData entity object
|
|
200
|
+
*/
|
|
201
|
+
function getODataEntityFromMetaModel(oMetaModel, sBindingContextPath) {
|
|
202
|
+
const oMetaModelContext = oMetaModel.getMetaContext(sBindingContextPath);
|
|
203
|
+
return oMetaModelContext.getObject();
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Adjusts the OData entity for list bindings based on the default aggregation of the given element.
|
|
208
|
+
*
|
|
209
|
+
* @param {sap.ui.core.Element} oElement - The UI5 element for which the OData entity needs to be adjusted.
|
|
210
|
+
* @param {sap.ui.model.odata.ODataMetaModel} oMetaModel - The OData metamodel.
|
|
211
|
+
* @param {object} mODataEntity - The OData entity to be adjusted.
|
|
212
|
+
* @returns {object} The adjusted OData entity.
|
|
213
|
+
*/
|
|
214
|
+
function adjustODataEntityForListBindings(oElement, oMetaModel, mODataEntity) {
|
|
215
|
+
const oDefaultAggregation = oElement.getMetadata().getAggregation();
|
|
216
|
+
if (oDefaultAggregation) {
|
|
217
|
+
const oBinding = oElement.getBindingInfo(oDefaultAggregation.name);
|
|
218
|
+
const oTemplate = oBinding && oBinding.template;
|
|
219
|
+
|
|
220
|
+
if (oTemplate) {
|
|
221
|
+
const sPath = oElement.getBindingPath(oDefaultAggregation.name);
|
|
222
|
+
const oODataAssociationEnd = oMetaModel.getODataAssociationEnd(mODataEntity, sPath);
|
|
223
|
+
const sFullyQualifiedEntityName = oODataAssociationEnd && oODataAssociationEnd.type;
|
|
224
|
+
if (sFullyQualifiedEntityName) {
|
|
225
|
+
const oEntityType = oMetaModel.getODataEntityType(sFullyQualifiedEntityName);
|
|
226
|
+
mODataEntity = oEntityType;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return mODataEntity;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Retrieve OData properties of a model based on the element, aggregation name, and payload.
|
|
235
|
+
*
|
|
236
|
+
* @param {Object} oElement - The element to retrieve OData properties from.
|
|
237
|
+
* @param {string} sAggregationName - The name of the aggregation.
|
|
238
|
+
* @param {Object} mPayload - The payload containing additional data.
|
|
239
|
+
* @return {Array} The array of OData properties of the model.
|
|
240
|
+
*/
|
|
241
|
+
async function getODataPropertiesOfModel(oElement, sAggregationName, mPayload) {
|
|
242
|
+
const oMetaModel = await loadODataMetaModel(oElement, mPayload);
|
|
243
|
+
let aProperties = [];
|
|
244
|
+
if (oMetaModel) {
|
|
245
|
+
const sBindingContextPath = getBindingPath(oElement, sAggregationName, mPayload);
|
|
246
|
+
if (sBindingContextPath) {
|
|
247
|
+
let mODataEntity = getODataEntityFromMetaModel(oMetaModel, sBindingContextPath);
|
|
248
|
+
mODataEntity = adjustODataEntityForListBindings(oElement, oMetaModel, mODataEntity);
|
|
249
|
+
aProperties = convertMetadataToDelegateFormat(
|
|
250
|
+
mODataEntity,
|
|
251
|
+
oMetaModel,
|
|
252
|
+
oElement,
|
|
253
|
+
sAggregationName);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
return aProperties;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Default read delegate for ODataV2 protocoll.
|
|
260
|
+
* @namespace sap.ui.fl.write._internal.delegate.ODataV2ReadDelegate
|
|
261
|
+
* @implements {sap.ui.fl.interfaces.Delegate}
|
|
262
|
+
* @experimental Since 1.123
|
|
263
|
+
* @since 1.123
|
|
264
|
+
* @private
|
|
265
|
+
*/
|
|
266
|
+
var ODataV2ReadDelegate = {}; /** @lends sap/ui/fl/write/_internal/delegates/oDataV2ReadDelegate */
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* @inheritdoc
|
|
270
|
+
*/
|
|
271
|
+
ODataV2ReadDelegate.getPropertyInfo = function(mPropertyBag) {
|
|
272
|
+
return getODataPropertiesOfModel(mPropertyBag.element, mPropertyBag.aggregationName, mPropertyBag.payload);
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
return ODataV2ReadDelegate;
|
|
276
|
+
});
|
|
@@ -17,7 +17,7 @@ sap.ui.define([
|
|
|
17
17
|
* @class
|
|
18
18
|
* @namespace sap.ui.fl.write._internal.fieldExtensibility.ABAPExtensibilityVariant
|
|
19
19
|
* @since 1.87
|
|
20
|
-
* @version 1.
|
|
20
|
+
* @version 1.123.0
|
|
21
21
|
* @public
|
|
22
22
|
* @param {sap.ui.base.ManagedObject} oControl - Control to add extensions
|
|
23
23
|
*/
|
|
@@ -115,7 +115,7 @@ sap.ui.define([
|
|
|
115
115
|
* @namespace sap.ui.fl.write._internal.fieldExtensibility.ABAPExtensibilityVariantFactory
|
|
116
116
|
* @since 1.87.0
|
|
117
117
|
* @author SAP SE
|
|
118
|
-
* @version 1.
|
|
118
|
+
* @version 1.123.0
|
|
119
119
|
* @private
|
|
120
120
|
*/
|
|
121
121
|
var ABAPExtensibilityVariantFactory = {};
|
|
@@ -82,7 +82,7 @@ sap.ui.define([
|
|
|
82
82
|
* @extends sap.ui.base.ManagedObject
|
|
83
83
|
* @alias sap.ui.fl.write._internal.fieldExtensibility.cap.dialog.CustomFieldCAPDialog
|
|
84
84
|
* @author SAP SE
|
|
85
|
-
* @version 1.
|
|
85
|
+
* @version 1.123.0
|
|
86
86
|
* @since 1.93
|
|
87
87
|
* @private
|
|
88
88
|
* @ui5-restricted
|
|
@@ -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.123.0
|
|
30
30
|
* @since 1.74.0
|
|
31
31
|
* Helper object to select an ABAP transport for an LREP object. This is not a generic utility to select a transport request, but part
|
|
32
32
|
* of the SmartVariant control.
|
|
@@ -27,7 +27,7 @@ sap.ui.define([
|
|
|
27
27
|
* Entity that handles ABAP transport related information.
|
|
28
28
|
* @alias sap.ui.fl.write._internal.transport.Transports
|
|
29
29
|
* @author SAP SE
|
|
30
|
-
* @version 1.
|
|
30
|
+
* @version 1.123.0
|
|
31
31
|
* @since 1.74.0
|
|
32
32
|
* @private
|
|
33
33
|
* @ui5-restricted sap.ui.fl.write._internal.transport
|
|
@@ -22,7 +22,7 @@ sap.ui.define([
|
|
|
22
22
|
*
|
|
23
23
|
* @namespace sap.ui.fl.write.api.FieldExtensibility
|
|
24
24
|
* @since 1.87
|
|
25
|
-
* @version 1.
|
|
25
|
+
* @version 1.123.0
|
|
26
26
|
* @private
|
|
27
27
|
* @ui5-restricted sap.ui.fl, sap.ui.rta, sap.ui.mdc
|
|
28
28
|
*/
|
|
@@ -104,6 +104,29 @@ sap.ui.define([
|
|
|
104
104
|
/**
|
|
105
105
|
* Retrieves the necessary texts.
|
|
106
106
|
*
|
|
107
|
+
* The result should have the following structure
|
|
108
|
+
* Scenario 1 Legacy: Create Custom Field
|
|
109
|
+
* {
|
|
110
|
+
* headerText: string, // Header text for the business contexts
|
|
111
|
+
* tooltip: string // Tooltip for the button
|
|
112
|
+
* }
|
|
113
|
+
*
|
|
114
|
+
* Scenario 2: Potentially multiple options
|
|
115
|
+
* {
|
|
116
|
+
* headerText: string, // Header text for the business contexts
|
|
117
|
+
* buttonText: string, // Text for the MenuButton
|
|
118
|
+
* tooltip: string, // Tooltip for the MenuButton
|
|
119
|
+
* options:
|
|
120
|
+
* [
|
|
121
|
+
* {
|
|
122
|
+
* actionKey: string, // MenuItem unique key (e.g. for Uri assignment)
|
|
123
|
+
* text: string, // Text for the MenuItem, for a single option this becomes the button text
|
|
124
|
+
* tooltip: string // Tooltip for the MenuItem, for a single option this becomes the button tooltip
|
|
125
|
+
* },
|
|
126
|
+
* ...
|
|
127
|
+
* ]
|
|
128
|
+
* }
|
|
129
|
+
*
|
|
107
130
|
* @returns {Promise<object>} - Object with <code>tooltip</code> and <code>headerText</code>
|
|
108
131
|
*/
|
|
109
132
|
FieldExtensibility.getTexts = function() {
|
|
@@ -112,12 +135,18 @@ sap.ui.define([
|
|
|
112
135
|
|
|
113
136
|
/**
|
|
114
137
|
* Retrieves the extension data.
|
|
115
|
-
*
|
|
116
|
-
*
|
|
138
|
+
* The extension data should have the following format:
|
|
139
|
+
* [
|
|
140
|
+
* {
|
|
141
|
+
* businessContext: "string",
|
|
142
|
+
* description: "string",
|
|
143
|
+
* ...
|
|
144
|
+
* },
|
|
145
|
+
* ...
|
|
146
|
+
* ]
|
|
147
|
+
* @returns {Promise<object>} An object containing the <code>extensionData</code> array. This will be passed to <code>FieldExtensibility.onTriggerCreateExtensionData</code>
|
|
117
148
|
*/
|
|
118
149
|
FieldExtensibility.getExtensionData = function() {
|
|
119
|
-
// TODO: currently the return value must be an object that includes .BusinessContexts in order to be shown in the Dialog.
|
|
120
|
-
// Will be changed in a follow up
|
|
121
150
|
return callFunctionInImplementation("getExtensionData");
|
|
122
151
|
};
|
|
123
152
|
|
|
@@ -126,10 +155,11 @@ sap.ui.define([
|
|
|
126
155
|
*
|
|
127
156
|
* @param {object} oExtensibilityInfo - Information about the extension data. Should be the return value of <code>FieldExtensibility.getExtensionData</code>
|
|
128
157
|
* @param {string} sRtaStyleClassName - CSS style class that should be added to any dialogs
|
|
158
|
+
* @param {string} sActionKey - Key for the mapping of specific actions (e.g. which URI to open for given extension data)
|
|
129
159
|
* @returns {Promise} Resolves with the return value of the function in the implementation
|
|
130
160
|
*/
|
|
131
|
-
FieldExtensibility.onTriggerCreateExtensionData = function(oExtensibilityInfo, sRtaStyleClassName) {
|
|
132
|
-
return callFunctionInImplementation("onTriggerCreateExtensionData", oExtensibilityInfo, sRtaStyleClassName);
|
|
161
|
+
FieldExtensibility.onTriggerCreateExtensionData = function(oExtensibilityInfo, sRtaStyleClassName, sActionKey) {
|
|
162
|
+
return callFunctionInImplementation("onTriggerCreateExtensionData", oExtensibilityInfo, sRtaStyleClassName, sActionKey);
|
|
133
163
|
};
|
|
134
164
|
|
|
135
165
|
// Resets the current scenario for testing purposes
|