@sapui5/sap.fe.core 1.98.0 → 1.99.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 -2
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AnnotationHelper.js +377 -405
- package/src/sap/fe/core/AnnotationHelper.ts +385 -0
- package/src/sap/fe/core/AppComponent.js +3 -2
- package/src/sap/fe/core/AppStateHandler.js +229 -181
- package/src/sap/fe/core/AppStateHandler.ts +171 -0
- package/src/sap/fe/core/BaseController.js +3 -2
- package/src/sap/fe/core/BusyLocker.js +105 -121
- package/src/sap/fe/core/BusyLocker.ts +98 -0
- package/src/sap/fe/core/CommonUtils.js +2073 -2399
- package/src/sap/fe/core/CommonUtils.ts +2078 -0
- package/src/sap/fe/core/ExtensionAPI.js +3 -2
- package/src/sap/fe/core/PageController.js +84 -125
- package/src/sap/fe/core/PageController.ts +101 -0
- package/src/sap/fe/core/RouterProxy.js +986 -823
- package/src/sap/fe/core/RouterProxy.ts +838 -0
- package/src/sap/fe/core/Synchronization.js +51 -35
- package/src/sap/fe/core/Synchronization.ts +29 -0
- package/src/sap/fe/core/TemplateComponent.js +173 -164
- package/src/sap/fe/core/TemplateComponent.ts +166 -0
- package/src/sap/fe/core/TemplateModel.js +97 -54
- package/src/sap/fe/core/TemplateModel.ts +63 -0
- package/src/sap/fe/core/TransactionHelper.js +1576 -1664
- package/src/sap/fe/core/TransactionHelper.ts +1706 -0
- package/src/sap/fe/core/actions/draft.js +559 -608
- package/src/sap/fe/core/actions/draft.ts +593 -0
- package/src/sap/fe/core/actions/messageHandling.js +545 -514
- package/src/sap/fe/core/actions/messageHandling.ts +532 -0
- package/src/sap/fe/core/actions/nonDraft.js +17 -19
- package/src/sap/fe/core/actions/nonDraft.ts +12 -0
- package/src/sap/fe/core/actions/operations.js +1074 -1215
- package/src/sap/fe/core/actions/operations.ts +1162 -0
- package/src/sap/fe/core/actions/sticky.js +102 -105
- package/src/sap/fe/core/actions/sticky.ts +102 -0
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +3 -2
- package/src/sap/fe/core/controllerextensions/EditFlow.js +54 -211
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +3 -2
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +279 -11
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +8 -6
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +47 -45
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +2 -3
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +29 -26
- package/src/sap/fe/core/controllerextensions/MassEdit.js +101 -8
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +17 -8
- package/src/sap/fe/core/controllerextensions/PageReady.js +2 -2
- package/src/sap/fe/core/controllerextensions/PageReady.ts +12 -8
- package/src/sap/fe/core/controllerextensions/Paginator.js +3 -2
- package/src/sap/fe/core/controllerextensions/Placeholder.js +3 -2
- package/src/sap/fe/core/controllerextensions/Routing.js +9 -4
- package/src/sap/fe/core/controllerextensions/RoutingListener.js +3 -2
- package/src/sap/fe/core/controllerextensions/Share.js +3 -2
- package/src/sap/fe/core/controllerextensions/SideEffects.js +3 -3
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +18 -18
- package/src/sap/fe/core/controllerextensions/ViewState.js +3 -2
- package/src/sap/fe/core/controls/CommandExecution.js +3 -2
- package/src/sap/fe/core/controls/ConditionalWrapper.js +3 -2
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +3 -2
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +3 -2
- package/src/sap/fe/core/controls/FieldWrapper.js +11 -22
- package/src/sap/fe/core/controls/FilterBar.js +3 -2
- package/src/sap/fe/core/controls/FormElementWrapper.js +3 -2
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +3 -2
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +1 -0
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +3 -2
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +5 -4
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -2
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +3 -2
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +3 -2
- package/src/sap/fe/core/converters/ConverterContext.js +2 -2
- package/src/sap/fe/core/converters/ConverterContext.ts +4 -3
- package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +1 -0
- package/src/sap/fe/core/converters/ManifestWrapper.js +39 -26
- package/src/sap/fe/core/converters/ManifestWrapper.ts +9 -0
- package/src/sap/fe/core/converters/MetaModelConverter.js +11 -8
- package/src/sap/fe/core/converters/MetaModelConverter.ts +16 -16
- package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
- package/src/sap/fe/core/converters/TemplateConverter.ts +2 -2
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +17 -13
- package/src/sap/fe/core/converters/controls/Common/Action.js +2 -2
- package/src/sap/fe/core/converters/controls/Common/Action.ts +2 -2
- package/src/sap/fe/core/converters/controls/Common/Chart.js +5 -3
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +11 -3
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +3 -3
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +2 -2
- package/src/sap/fe/core/converters/controls/Common/Form.js +4 -2
- package/src/sap/fe/core/converters/controls/Common/Form.ts +16 -2
- package/src/sap/fe/core/converters/controls/Common/Table.js +250 -146
- package/src/sap/fe/core/converters/controls/Common/Table.ts +300 -167
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +115 -56
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +120 -74
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +467 -32
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +483 -54
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +6 -6
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +9 -15
- package/src/sap/fe/core/converters/helpers/Aggregation.js +13 -5
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +20 -5
- package/src/sap/fe/core/converters/helpers/IssueManager.js +4 -1
- package/src/sap/fe/core/converters/helpers/IssueManager.ts +3 -0
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +4 -4
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +3 -3
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +13 -6
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +26 -15
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +3 -2
- package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
- package/src/sap/fe/core/formatters/CriticalityFormatter.ts +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.ts +4 -10
- package/src/sap/fe/core/formatters/KPIFormatter.js +1 -1
- package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -1
- package/src/sap/fe/core/formatters/TableFormatter.js +39 -28
- package/src/sap/fe/core/formatters/TableFormatter.ts +43 -28
- package/src/sap/fe/core/formatters/ValueFormatter.js +1 -1
- package/src/sap/fe/core/formatters/ValueFormatter.ts +7 -6
- package/src/sap/fe/core/fpm/Component.js +3 -2
- package/src/sap/fe/core/helpers/AppStartupHelper.js +2 -2
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +7 -4
- package/src/sap/fe/core/helpers/BindingExpression.js +314 -355
- package/src/sap/fe/core/helpers/BindingExpression.ts +317 -391
- package/src/sap/fe/core/helpers/ClassSupport.js +27 -15
- package/src/sap/fe/core/helpers/ClassSupport.ts +31 -20
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +63 -59
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +56 -0
- package/src/sap/fe/core/helpers/EditState.js +81 -84
- package/src/sap/fe/core/helpers/EditState.ts +81 -0
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +62 -48
- package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +49 -0
- package/src/sap/fe/core/helpers/FPMHelper.js +52 -56
- package/src/sap/fe/core/helpers/FPMHelper.ts +62 -0
- package/src/sap/fe/core/helpers/KeepAliveHelper.js +3 -4
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +9 -9
- package/src/sap/fe/core/helpers/MassEditHelper.js +27 -18
- package/src/sap/fe/core/helpers/ModelHelper.js +229 -225
- package/src/sap/fe/core/helpers/ModelHelper.ts +227 -0
- package/src/sap/fe/core/helpers/PasteHelper.js +210 -132
- package/src/sap/fe/core/helpers/PasteHelper.ts +196 -0
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +332 -313
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +330 -0
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +66 -67
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +73 -0
- package/src/sap/fe/core/helpers/StableIdHelper.js +4 -7
- package/src/sap/fe/core/helpers/StableIdHelper.ts +2 -6
- package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx.ts +1 -1
- package/src/sap/fe/core/library.js +4 -3
- package/src/sap/fe/core/library.support.js +3 -2
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +1 -1
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +1 -1
- package/src/sap/fe/core/messagebundle.properties +23 -10
- package/src/sap/fe/core/messagebundle_ar.properties +9 -0
- package/src/sap/fe/core/messagebundle_bg.properties +9 -0
- package/src/sap/fe/core/messagebundle_ca.properties +9 -0
- package/src/sap/fe/core/messagebundle_cs.properties +10 -1
- package/src/sap/fe/core/messagebundle_cy.properties +9 -0
- package/src/sap/fe/core/messagebundle_da.properties +9 -0
- package/src/sap/fe/core/messagebundle_de.properties +9 -0
- package/src/sap/fe/core/messagebundle_el.properties +9 -0
- package/src/sap/fe/core/messagebundle_en.properties +9 -0
- package/src/sap/fe/core/messagebundle_en_GB.properties +9 -0
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +9 -0
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +9 -0
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +9 -0
- package/src/sap/fe/core/messagebundle_es.properties +9 -0
- package/src/sap/fe/core/messagebundle_es_MX.properties +9 -0
- package/src/sap/fe/core/messagebundle_et.properties +9 -0
- package/src/sap/fe/core/messagebundle_fi.properties +9 -0
- package/src/sap/fe/core/messagebundle_fr.properties +13 -4
- package/src/sap/fe/core/messagebundle_fr_CA.properties +15 -6
- package/src/sap/fe/core/messagebundle_hi.properties +15 -6
- package/src/sap/fe/core/messagebundle_hr.properties +15 -6
- package/src/sap/fe/core/messagebundle_hu.properties +9 -0
- package/src/sap/fe/core/messagebundle_id.properties +10 -1
- package/src/sap/fe/core/messagebundle_it.properties +9 -0
- package/src/sap/fe/core/messagebundle_iw.properties +9 -0
- package/src/sap/fe/core/messagebundle_ja.properties +9 -0
- package/src/sap/fe/core/messagebundle_kk.properties +15 -6
- package/src/sap/fe/core/messagebundle_ko.properties +9 -0
- package/src/sap/fe/core/messagebundle_lt.properties +9 -0
- package/src/sap/fe/core/messagebundle_lv.properties +15 -6
- package/src/sap/fe/core/messagebundle_ms.properties +14 -5
- package/src/sap/fe/core/messagebundle_nl.properties +9 -0
- package/src/sap/fe/core/messagebundle_no.properties +9 -0
- package/src/sap/fe/core/messagebundle_pl.properties +9 -0
- package/src/sap/fe/core/messagebundle_pt.properties +9 -0
- package/src/sap/fe/core/messagebundle_pt_PT.properties +9 -0
- package/src/sap/fe/core/messagebundle_ro.properties +9 -0
- package/src/sap/fe/core/messagebundle_ru.properties +9 -0
- package/src/sap/fe/core/messagebundle_sh.properties +11 -2
- package/src/sap/fe/core/messagebundle_sk.properties +9 -0
- package/src/sap/fe/core/messagebundle_sl.properties +15 -6
- package/src/sap/fe/core/messagebundle_sv.properties +9 -0
- package/src/sap/fe/core/messagebundle_th.properties +9 -0
- package/src/sap/fe/core/messagebundle_tr.properties +9 -0
- package/src/sap/fe/core/messagebundle_uk.properties +9 -0
- package/src/sap/fe/core/messagebundle_vi.properties +9 -0
- package/src/sap/fe/core/messagebundle_zh_CN.properties +9 -0
- package/src/sap/fe/core/messagebundle_zh_TW.properties +15 -6
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +1 -1
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +269 -202
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +212 -0
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +1 -1
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +7 -6
- package/src/sap/fe/core/services/NavigationServiceFactory.js +406 -300
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +316 -0
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +149 -81
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +80 -0
- package/src/sap/fe/core/services/RoutingServiceFactory.js +987 -899
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +898 -0
- package/src/sap/fe/core/services/ShellServicesFactory.js +1 -1
- package/src/sap/fe/core/services/ShellServicesFactory.ts +15 -10
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +35 -81
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +46 -94
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +461 -487
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +453 -0
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +10 -8
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +8 -0
- package/src/sap/fe/core/support/AnnotationIssue.support.js +15 -3
- package/src/sap/fe/core/support/AnnotationIssue.support.ts +16 -2
- package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -2
- package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.ts +1 -1
- package/src/sap/fe/core/templating/FieldControlHelper.js +8 -8
- package/src/sap/fe/core/templating/FieldControlHelper.ts +25 -7
- package/src/sap/fe/core/templating/FilterHelper.js +138 -72
- package/src/sap/fe/core/templating/FilterHelper.ts +139 -71
- package/src/sap/fe/core/templating/UIFormatters.js +31 -1
- package/src/sap/fe/core/templating/UIFormatters.ts +33 -2
- package/src/sap/fe/core/type/Email.js +1 -1
- package/src/sap/fe/core/type/Email.ts +4 -6
- package/ui5.yaml +0 -3
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AvailabilityType,
|
|
3
|
-
FilterFieldManifestConfiguration,
|
|
4
|
-
FilterManifestConfiguration,
|
|
5
|
-
FilterSettings,
|
|
6
|
-
TemplateType
|
|
7
|
-
} from "../../ManifestSettings";
|
|
1
|
+
import { AvailabilityType, FilterFieldManifestConfiguration, FilterManifestConfiguration, FilterSettings } from "../../ManifestSettings";
|
|
8
2
|
import { EntityType, NavigationProperty, Property } from "@sap-ux/annotation-converter";
|
|
9
3
|
import ConverterContext from "sap/fe/core/converters/ConverterContext";
|
|
10
4
|
import { AnnotationTerm, DataFieldAbstractTypes, DataFieldTypes, ReferenceFacetTypes, UIAnnotationTerms } from "@sap-ux/vocabularies-types";
|
|
@@ -12,8 +6,10 @@ import {
|
|
|
12
6
|
getSelectionVariantConfiguration,
|
|
13
7
|
SelectionVariantConfiguration,
|
|
14
8
|
TableVisualization,
|
|
15
|
-
isFilteringCaseSensitive
|
|
9
|
+
isFilteringCaseSensitive,
|
|
10
|
+
getTypeConfig
|
|
16
11
|
} from "sap/fe/core/converters/controls/Common/Table";
|
|
12
|
+
import { ChartVisualization } from "sap/fe/core/converters/controls/Common/Chart";
|
|
17
13
|
import { ConfigurableObject, CustomElement, insertCustomElements, Placement } from "sap/fe/core/converters/helpers/ConfigurableObject";
|
|
18
14
|
import { getVisualFilters, VisualFilters } from "sap/fe/core/converters/controls/ListReport/VisualFilters";
|
|
19
15
|
import { SelectOptionType, FieldGroupType, FieldGroup } from "@sap-ux/vocabularies-types/dist/generated/UI";
|
|
@@ -22,6 +18,7 @@ import { getSelectionVariant } from "../Common/DataVisualization";
|
|
|
22
18
|
import { KeyHelper } from "sap/fe/core/converters/helpers/Key";
|
|
23
19
|
import { IssueType, IssueSeverity, IssueCategory } from "sap/fe/core/converters/helpers/IssueManager";
|
|
24
20
|
import { PropertyPath } from "@sap-ux/vocabularies-types/dist/Edm";
|
|
21
|
+
import { hasValueHelp } from "sap/fe/core/templating/PropertyHelper";
|
|
25
22
|
|
|
26
23
|
export type FilterField = ConfigurableObject & {
|
|
27
24
|
type?: string;
|
|
@@ -178,6 +175,70 @@ const _createFilterSelectionField = function(
|
|
|
178
175
|
return undefined;
|
|
179
176
|
};
|
|
180
177
|
|
|
178
|
+
export function getModelType(sType: any) {
|
|
179
|
+
type defaultModelType = {
|
|
180
|
+
[key: string]: {
|
|
181
|
+
[key: string]: string;
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
const mDefaultTypeForEdmType: defaultModelType = {
|
|
185
|
+
"Edm.Boolean": {
|
|
186
|
+
modelType: "Bool"
|
|
187
|
+
},
|
|
188
|
+
"Edm.Byte": {
|
|
189
|
+
modelType: "Int"
|
|
190
|
+
},
|
|
191
|
+
"Edm.Date": {
|
|
192
|
+
modelType: "Date"
|
|
193
|
+
},
|
|
194
|
+
"Edm.DateTime": {
|
|
195
|
+
modelType: "Date"
|
|
196
|
+
},
|
|
197
|
+
"Edm.DateTimeOffset": {
|
|
198
|
+
modelType: "DateTimeOffset"
|
|
199
|
+
},
|
|
200
|
+
"Edm.Decimal": {
|
|
201
|
+
modelType: "Decimal"
|
|
202
|
+
},
|
|
203
|
+
"Edm.Double": {
|
|
204
|
+
modelType: "Float"
|
|
205
|
+
},
|
|
206
|
+
"Edm.Float": {
|
|
207
|
+
modelType: "Float"
|
|
208
|
+
},
|
|
209
|
+
"Edm.Guid": {
|
|
210
|
+
modelType: "Guid"
|
|
211
|
+
},
|
|
212
|
+
"Edm.Int16": {
|
|
213
|
+
modelType: "Int"
|
|
214
|
+
},
|
|
215
|
+
"Edm.Int32": {
|
|
216
|
+
modelType: "Int"
|
|
217
|
+
},
|
|
218
|
+
"Edm.Int64": {
|
|
219
|
+
modelType: "Int"
|
|
220
|
+
},
|
|
221
|
+
"Edm.SByte": {
|
|
222
|
+
modelType: "Int"
|
|
223
|
+
},
|
|
224
|
+
"Edm.Single": {
|
|
225
|
+
modelType: "Float"
|
|
226
|
+
},
|
|
227
|
+
"Edm.String": {
|
|
228
|
+
modelType: "String"
|
|
229
|
+
},
|
|
230
|
+
"Edm.Time": {
|
|
231
|
+
modelType: "TimeOfDay"
|
|
232
|
+
},
|
|
233
|
+
"Edm.TimeOfDay": {
|
|
234
|
+
modelType: "TimeOfDay"
|
|
235
|
+
},
|
|
236
|
+
"Edm.Stream": {
|
|
237
|
+
//no corresponding modelType - ignore for filtering
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
return sType && sType in mDefaultTypeForEdmType && mDefaultTypeForEdmType[sType].modelType;
|
|
241
|
+
}
|
|
181
242
|
const _getSelectionFields = function(
|
|
182
243
|
entityType: EntityType,
|
|
183
244
|
navigationPath: string,
|
|
@@ -264,7 +325,7 @@ const _getFilterField = function(
|
|
|
264
325
|
filterField = _createFilterSelectionField(entityType, entityType.resolvePath(propertyPath), propertyPath, true, converterContext);
|
|
265
326
|
}
|
|
266
327
|
if (!filterField) {
|
|
267
|
-
converterContext.getDiagnostics()
|
|
328
|
+
converterContext.getDiagnostics()?.addIssue(IssueCategory.Annotation, IssueSeverity.High, IssueType.MISSING_SELECTIONFIELD);
|
|
268
329
|
}
|
|
269
330
|
// defined SelectionFields are available by default
|
|
270
331
|
if (filterField) {
|
|
@@ -348,24 +409,25 @@ function _getParameterFields(converterContext: ConverterContext): FilterField[]
|
|
|
348
409
|
* Determines if the FilterBar search field is hidden or not.
|
|
349
410
|
*
|
|
350
411
|
* @param {TableVisualization[]} listReportTables The list report tables
|
|
412
|
+
* @param {ChartVisualization[]} charts The ALP charts
|
|
351
413
|
* @param {ConverterContext} converterContext The converter context
|
|
352
414
|
* @returns {boolean} The information if the FilterBar search field is hidden or not
|
|
353
415
|
*/
|
|
354
|
-
export const getFilterBarhideBasicSearch = function(
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
416
|
+
export const getFilterBarhideBasicSearch = function(
|
|
417
|
+
listReportTables: TableVisualization[],
|
|
418
|
+
charts: ChartVisualization[],
|
|
419
|
+
converterContext: ConverterContext
|
|
420
|
+
): boolean {
|
|
421
|
+
// Check if charts allow search
|
|
422
|
+
const noSearchInCharts = charts.length === 0 || charts.every(chart => !chart.applySupported.enableSearch);
|
|
423
|
+
|
|
424
|
+
// Check if all tables are analytical and none of them allow for search
|
|
425
|
+
const noSearchInTables =
|
|
426
|
+
listReportTables.length === 0 || listReportTables.every(table => table.enableAnalytics && !table.enableAnalyticsSearch);
|
|
361
427
|
|
|
362
|
-
// If all tables are analytical and none of them allow for search
|
|
363
|
-
// then the search field must be hidden
|
|
364
428
|
const contextPath = converterContext.getContextPath();
|
|
365
|
-
if (contextPath &&
|
|
366
|
-
return
|
|
367
|
-
return visualization.enableAnalytics && !visualization.enableAnalyticsSearch;
|
|
368
|
-
});
|
|
429
|
+
if (contextPath && noSearchInCharts && noSearchInTables) {
|
|
430
|
+
return true;
|
|
369
431
|
} else {
|
|
370
432
|
return false;
|
|
371
433
|
}
|
|
@@ -421,6 +483,249 @@ export const getFilterField = function(propertyPath: string, converterContext: C
|
|
|
421
483
|
return _getFilterField({}, propertyPath, converterContext, entityType);
|
|
422
484
|
};
|
|
423
485
|
|
|
486
|
+
export const getFilterRestrictions = function(oFilterRestrictionsAnnotation: any, sRestriction: any) {
|
|
487
|
+
if (sRestriction === "RequiredProperties" || sRestriction === "NonFilterableProperties") {
|
|
488
|
+
let aProps = [];
|
|
489
|
+
if (oFilterRestrictionsAnnotation && oFilterRestrictionsAnnotation[sRestriction]) {
|
|
490
|
+
aProps = oFilterRestrictionsAnnotation[sRestriction].map(function(oProperty: any) {
|
|
491
|
+
return oProperty.$PropertyPath || oProperty.value;
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
return aProps;
|
|
495
|
+
} else if (sRestriction === "FilterAllowedExpressions") {
|
|
496
|
+
const mAllowedExpressions = {} as any;
|
|
497
|
+
if (oFilterRestrictionsAnnotation && oFilterRestrictionsAnnotation.FilterExpressionRestrictions) {
|
|
498
|
+
oFilterRestrictionsAnnotation.FilterExpressionRestrictions.forEach(function(oProperty: any) {
|
|
499
|
+
//SingleValue | MultiValue | SingleRange | MultiRange | SearchExpression | MultiRangeOrSearchExpression
|
|
500
|
+
if (mAllowedExpressions[oProperty.Property.value]) {
|
|
501
|
+
mAllowedExpressions[oProperty.Property.value].push(oProperty.AllowedExpressions);
|
|
502
|
+
} else {
|
|
503
|
+
mAllowedExpressions[oProperty.Property.value] = [oProperty.AllowedExpressions];
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
return mAllowedExpressions;
|
|
508
|
+
}
|
|
509
|
+
return oFilterRestrictionsAnnotation;
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
const getSearchFilterPropertyInfo = function() {
|
|
513
|
+
return {
|
|
514
|
+
name: "$search",
|
|
515
|
+
path: "$search",
|
|
516
|
+
dataType: "Edm.String",
|
|
517
|
+
maxConditions: 1
|
|
518
|
+
};
|
|
519
|
+
};
|
|
520
|
+
|
|
521
|
+
const getEditStateFilterPropertyInfo = function() {
|
|
522
|
+
return {
|
|
523
|
+
name: "$editState",
|
|
524
|
+
path: "$editState",
|
|
525
|
+
groupLabel: "",
|
|
526
|
+
group: "",
|
|
527
|
+
dataType: "Edm.String",
|
|
528
|
+
tooltip: null,
|
|
529
|
+
hiddenFilter: false
|
|
530
|
+
};
|
|
531
|
+
};
|
|
532
|
+
|
|
533
|
+
const getSearchRestrictions = function(converterContext: ConverterContext) {
|
|
534
|
+
return converterContext.getEntitySet()?.annotations?.Capabilities?.SearchRestrictions;
|
|
535
|
+
};
|
|
536
|
+
|
|
537
|
+
export const getNavigationRestrictions = function(converterContext: ConverterContext, sNavigationPath: string) {
|
|
538
|
+
const oNavigationRestrictions: any = converterContext.getEntitySet()?.annotations?.Capabilities?.NavigationRestrictions;
|
|
539
|
+
const aRestrictedProperties = oNavigationRestrictions && oNavigationRestrictions.RestrictedProperties;
|
|
540
|
+
return (
|
|
541
|
+
aRestrictedProperties &&
|
|
542
|
+
aRestrictedProperties.find(function(oRestrictedProperty: any) {
|
|
543
|
+
return (
|
|
544
|
+
oRestrictedProperty &&
|
|
545
|
+
oRestrictedProperty.NavigationProperty &&
|
|
546
|
+
(oRestrictedProperty.NavigationProperty.$NavigationPropertyPath === sNavigationPath ||
|
|
547
|
+
oRestrictedProperty.NavigationProperty.value === sNavigationPath)
|
|
548
|
+
);
|
|
549
|
+
})
|
|
550
|
+
);
|
|
551
|
+
};
|
|
552
|
+
|
|
553
|
+
const _fetchBasicPropertyInfo = function(oFilterFieldInfo: any) {
|
|
554
|
+
return {
|
|
555
|
+
key: oFilterFieldInfo.key,
|
|
556
|
+
annotationPath: oFilterFieldInfo.annotationPath,
|
|
557
|
+
conditionPath: oFilterFieldInfo.conditionPath,
|
|
558
|
+
name: oFilterFieldInfo.conditionPath,
|
|
559
|
+
path: oFilterFieldInfo.conditionPath,
|
|
560
|
+
groupLabel: oFilterFieldInfo.groupLabel,
|
|
561
|
+
group: oFilterFieldInfo.group,
|
|
562
|
+
label: oFilterFieldInfo.label,
|
|
563
|
+
tooltip: null,
|
|
564
|
+
hiddenFilter: oFilterFieldInfo.availability === "Hidden",
|
|
565
|
+
removeFromAppState: false,
|
|
566
|
+
hasValueHelp: false,
|
|
567
|
+
display: "Value",
|
|
568
|
+
isParameter: oFilterFieldInfo.isParameter,
|
|
569
|
+
caseSensitive: oFilterFieldInfo.caseSensitive,
|
|
570
|
+
availability: oFilterFieldInfo.availability,
|
|
571
|
+
position: oFilterFieldInfo.position,
|
|
572
|
+
type: oFilterFieldInfo.type
|
|
573
|
+
};
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
export const getSpecificAllowedExpression = function(aExpressions: any) {
|
|
577
|
+
const aAllowedExpressionsPriority = [
|
|
578
|
+
"SingleValue",
|
|
579
|
+
"MultiValue",
|
|
580
|
+
"SingleRange",
|
|
581
|
+
"MultiRange",
|
|
582
|
+
"SearchExpression",
|
|
583
|
+
"MultiRangeOrSearchExpression"
|
|
584
|
+
];
|
|
585
|
+
|
|
586
|
+
aExpressions.sort(function(a: any, b: any) {
|
|
587
|
+
return aAllowedExpressionsPriority.indexOf(a) - aAllowedExpressionsPriority.indexOf(b);
|
|
588
|
+
});
|
|
589
|
+
|
|
590
|
+
return aExpressions[0];
|
|
591
|
+
};
|
|
592
|
+
|
|
593
|
+
export const displayMode = function(oPropertyAnnotations: any, oCollectionAnnotations: any) {
|
|
594
|
+
const oTextAnnotation = oPropertyAnnotations?.Common?.Text,
|
|
595
|
+
oTextArrangmentAnnotation =
|
|
596
|
+
oTextAnnotation &&
|
|
597
|
+
((oPropertyAnnotations && oPropertyAnnotations?.Common?.Text?.annotations?.UI?.TextArrangement) ||
|
|
598
|
+
(oCollectionAnnotations && oCollectionAnnotations?.UI?.TextArrangement));
|
|
599
|
+
|
|
600
|
+
if (oTextArrangmentAnnotation) {
|
|
601
|
+
if (oTextArrangmentAnnotation.valueOf() === "UI.TextArrangementType/TextOnly") {
|
|
602
|
+
return "Description";
|
|
603
|
+
} else if (oTextArrangmentAnnotation.valueOf() === "UI.TextArrangementType/TextLast") {
|
|
604
|
+
return "ValueDescription";
|
|
605
|
+
}
|
|
606
|
+
return "DescriptionValue"; //TextFirst
|
|
607
|
+
}
|
|
608
|
+
return oTextAnnotation ? "DescriptionValue" : "Value";
|
|
609
|
+
};
|
|
610
|
+
|
|
611
|
+
const _fetchPropertyInfo = function(converterContext: ConverterContext, oFilterFieldInfo: any, oTypeConfig: any) {
|
|
612
|
+
let oPropertyInfo = _fetchBasicPropertyInfo(oFilterFieldInfo);
|
|
613
|
+
const sAnnotationPath = oFilterFieldInfo.annotationPath;
|
|
614
|
+
|
|
615
|
+
if (!sAnnotationPath) {
|
|
616
|
+
return oPropertyInfo;
|
|
617
|
+
}
|
|
618
|
+
const targetPropertyObject = converterContext.getConverterContextFor(sAnnotationPath).getDataModelObjectPath().targetObject;
|
|
619
|
+
const oProperty = {
|
|
620
|
+
$MaxLength: targetPropertyObject.maxLength,
|
|
621
|
+
$Type: targetPropertyObject.type,
|
|
622
|
+
$kind: targetPropertyObject._type
|
|
623
|
+
};
|
|
624
|
+
const oPropertyAnnotations = targetPropertyObject?.annotations;
|
|
625
|
+
const oCollectionAnnotations = converterContext?.getDataModelObjectPath().targetObject?.annotations;
|
|
626
|
+
|
|
627
|
+
let oFilterDefaultValue;
|
|
628
|
+
const oFormatOptions = oTypeConfig.formatOptions;
|
|
629
|
+
const oConstraints = oTypeConfig.constraints;
|
|
630
|
+
const bRemoveFromAppState =
|
|
631
|
+
oPropertyAnnotations?.PersonalData?.IsPotentiallySensitive ||
|
|
632
|
+
oPropertyAnnotations?.ExcludeFromNavigationContext ||
|
|
633
|
+
oPropertyAnnotations?.Analytics?.Measure;
|
|
634
|
+
|
|
635
|
+
const oFilterDefaultValueAnnotation = oPropertyAnnotations?.Common?.FilterDefaultValue;
|
|
636
|
+
if (oFilterDefaultValueAnnotation) {
|
|
637
|
+
oFilterDefaultValue = oFilterDefaultValueAnnotation["$" + getModelType(oProperty.$Type)];
|
|
638
|
+
}
|
|
639
|
+
oPropertyInfo = Object.assign(oPropertyInfo, {
|
|
640
|
+
tooltip: oPropertyAnnotations?.Common?.QuickInfo?.valueOf() || undefined,
|
|
641
|
+
removeFromAppState: bRemoveFromAppState,
|
|
642
|
+
hasValueHelp: hasValueHelp(targetPropertyObject),
|
|
643
|
+
formatOptions: oFormatOptions,
|
|
644
|
+
constraints: oConstraints,
|
|
645
|
+
display: displayMode(oPropertyAnnotations, oCollectionAnnotations),
|
|
646
|
+
defaultFilterConditions: oFilterDefaultValue
|
|
647
|
+
? [
|
|
648
|
+
{
|
|
649
|
+
fieldPath: oFilterFieldInfo.conditionPath,
|
|
650
|
+
operator: "EQ",
|
|
651
|
+
values: [oFilterDefaultValue]
|
|
652
|
+
}
|
|
653
|
+
]
|
|
654
|
+
: undefined
|
|
655
|
+
});
|
|
656
|
+
return oPropertyInfo;
|
|
657
|
+
};
|
|
658
|
+
|
|
659
|
+
export const isMultiValue = function(oProperty: any) {
|
|
660
|
+
let bIsMultiValue = true;
|
|
661
|
+
//SingleValue | MultiValue | SingleRange | MultiRange | SearchExpression | MultiRangeOrSearchExpression
|
|
662
|
+
switch (oProperty.filterExpression) {
|
|
663
|
+
case "SearchExpression":
|
|
664
|
+
case "SingleRange":
|
|
665
|
+
case "SingleValue":
|
|
666
|
+
bIsMultiValue = false;
|
|
667
|
+
break;
|
|
668
|
+
default:
|
|
669
|
+
break;
|
|
670
|
+
}
|
|
671
|
+
if (oProperty.type && oProperty.type.indexOf("Boolean") > 0) {
|
|
672
|
+
bIsMultiValue = false;
|
|
673
|
+
}
|
|
674
|
+
return bIsMultiValue;
|
|
675
|
+
};
|
|
676
|
+
|
|
677
|
+
const getAnnotatedSelectionFieldData = function(
|
|
678
|
+
converterContext: ConverterContext,
|
|
679
|
+
lrTables: TableVisualization[] = [],
|
|
680
|
+
annotationPath: string = ""
|
|
681
|
+
) {
|
|
682
|
+
// Fetch all selectionVariants defined in the different visualizations and different views (multi table mode)
|
|
683
|
+
const selectionVariants: SelectionVariantConfiguration[] = getSelectionVariants(lrTables, converterContext);
|
|
684
|
+
|
|
685
|
+
// create a map of properties to be used in selection variants
|
|
686
|
+
const excludedFilterProperties: Record<string, boolean> = getExcludedFilterProperties(selectionVariants);
|
|
687
|
+
const entityType = converterContext.getEntityType();
|
|
688
|
+
//Filters which has to be added which is part of SV/Default annotations but not present in the SelectionFields
|
|
689
|
+
const annotatedSelectionFields = ((annotationPath && converterContext.getEntityTypeAnnotation(annotationPath)?.annotation) ||
|
|
690
|
+
entityType.annotations?.UI?.SelectionFields ||
|
|
691
|
+
[]) as PropertyPath[];
|
|
692
|
+
|
|
693
|
+
// create a map of all potential filter fields based on...
|
|
694
|
+
const filterFields: Record<string, FilterField> = {
|
|
695
|
+
// ...non hidden properties of the entity
|
|
696
|
+
..._getSelectionFields(entityType, "", entityType.entityProperties, false, converterContext),
|
|
697
|
+
// ...additional manifest defined navigation properties
|
|
698
|
+
..._getSelectionFieldsByPath(
|
|
699
|
+
entityType,
|
|
700
|
+
converterContext.getManifestWrapper().getFilterConfiguration().navigationProperties,
|
|
701
|
+
false,
|
|
702
|
+
converterContext
|
|
703
|
+
)
|
|
704
|
+
};
|
|
705
|
+
|
|
706
|
+
const propertyInfoFields: any =
|
|
707
|
+
annotatedSelectionFields?.reduce((selectionFields: FilterField[], selectionField) => {
|
|
708
|
+
const propertyPath = selectionField.value;
|
|
709
|
+
if (!(propertyPath in excludedFilterProperties)) {
|
|
710
|
+
const filterField: FilterField | undefined = _getFilterField(filterFields, propertyPath, converterContext, entityType);
|
|
711
|
+
if (filterField) {
|
|
712
|
+
filterField.group = "";
|
|
713
|
+
filterField.groupLabel = "";
|
|
714
|
+
selectionFields.push(filterField);
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
return selectionFields;
|
|
718
|
+
}, []) || [];
|
|
719
|
+
|
|
720
|
+
return {
|
|
721
|
+
excludedFilterProperties: excludedFilterProperties,
|
|
722
|
+
entityType: entityType,
|
|
723
|
+
annotatedSelectionFields: annotatedSelectionFields,
|
|
724
|
+
filterFields: filterFields,
|
|
725
|
+
propertyInfoFields: propertyInfoFields
|
|
726
|
+
};
|
|
727
|
+
};
|
|
728
|
+
|
|
424
729
|
/**
|
|
425
730
|
* Retrieve the configuration for the selection fields that will be used within the filter bar
|
|
426
731
|
* This configuration takes into account annotation and the selection variants.
|
|
@@ -435,12 +740,11 @@ export const getSelectionFields = function(
|
|
|
435
740
|
lrTables: TableVisualization[] = [],
|
|
436
741
|
annotationPath: string = ""
|
|
437
742
|
): FilterField[] {
|
|
438
|
-
|
|
439
|
-
const selectionVariants: SelectionVariantConfiguration[] = getSelectionVariants(lrTables, converterContext);
|
|
743
|
+
const oAnnotatedSelectionFieldData = getAnnotatedSelectionFieldData(converterContext, lrTables, annotationPath);
|
|
440
744
|
|
|
441
745
|
// create a map of properties to be used in selection variants
|
|
442
|
-
const excludedFilterProperties: Record<string, boolean> =
|
|
443
|
-
const entityType =
|
|
746
|
+
const excludedFilterProperties: Record<string, boolean> = oAnnotatedSelectionFieldData.excludedFilterProperties;
|
|
747
|
+
const entityType = oAnnotatedSelectionFieldData.entityType;
|
|
444
748
|
const filterFacets = entityType.annotations.UI?.FilterFacets;
|
|
445
749
|
let filterFacetMap: Record<string, FilterGroup> = {};
|
|
446
750
|
|
|
@@ -472,22 +776,10 @@ export const getSelectionFields = function(
|
|
|
472
776
|
}
|
|
473
777
|
|
|
474
778
|
// create a map of all potential filter fields based on...
|
|
475
|
-
const filterFields: Record<string, FilterField> =
|
|
476
|
-
// ...non hidden properties of the entity
|
|
477
|
-
..._getSelectionFields(entityType, "", entityType.entityProperties, false, converterContext),
|
|
478
|
-
// ...additional manifest defined navigation properties
|
|
479
|
-
..._getSelectionFieldsByPath(
|
|
480
|
-
entityType,
|
|
481
|
-
converterContext.getManifestWrapper().getFilterConfiguration().navigationProperties,
|
|
482
|
-
false,
|
|
483
|
-
converterContext
|
|
484
|
-
)
|
|
485
|
-
};
|
|
779
|
+
const filterFields: Record<string, FilterField> = oAnnotatedSelectionFieldData.filterFields;
|
|
486
780
|
|
|
487
781
|
//Filters which has to be added which is part of SV/Default annotations but not present in the SelectionFields
|
|
488
|
-
const annotatedSelectionFields =
|
|
489
|
-
entityType.annotations?.UI?.SelectionFields ||
|
|
490
|
-
[]) as PropertyPath[];
|
|
782
|
+
const annotatedSelectionFields = oAnnotatedSelectionFieldData.annotatedSelectionFields;
|
|
491
783
|
const defaultFilters = _getDefaultFilterFields(
|
|
492
784
|
filterFields,
|
|
493
785
|
aSelectOptions,
|
|
@@ -497,23 +789,23 @@ export const getSelectionFields = function(
|
|
|
497
789
|
annotatedSelectionFields
|
|
498
790
|
);
|
|
499
791
|
const parameterFields = _getParameterFields(converterContext);
|
|
792
|
+
const propertyInfoFields: any =
|
|
793
|
+
annotatedSelectionFields?.reduce((selectionFields: FilterField[], selectionField) => {
|
|
794
|
+
const propertyPath = selectionField.value;
|
|
795
|
+
if (!(propertyPath in excludedFilterProperties)) {
|
|
796
|
+
const filterField: FilterField | undefined = _getFilterField(filterFields, propertyPath, converterContext, entityType);
|
|
797
|
+
if (filterField) {
|
|
798
|
+
filterField.group = "";
|
|
799
|
+
filterField.groupLabel = "";
|
|
800
|
+
selectionFields.push(filterField);
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
return selectionFields;
|
|
804
|
+
}, []) || [];
|
|
500
805
|
|
|
501
806
|
// finally create final list of filter fields by adding the SelectionFields first (order matters)...
|
|
502
807
|
let allFilters = parameterFields
|
|
503
|
-
.concat(
|
|
504
|
-
annotatedSelectionFields?.reduce((selectionFields: FilterField[], selectionField) => {
|
|
505
|
-
const propertyPath = selectionField.value;
|
|
506
|
-
if (!(propertyPath in excludedFilterProperties)) {
|
|
507
|
-
const filterField: FilterField | undefined = _getFilterField(filterFields, propertyPath, converterContext, entityType);
|
|
508
|
-
if (filterField) {
|
|
509
|
-
filterField.group = "";
|
|
510
|
-
filterField.groupLabel = "";
|
|
511
|
-
selectionFields.push(filterField);
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
return selectionFields;
|
|
515
|
-
}, []) || []
|
|
516
|
-
)
|
|
808
|
+
.concat(propertyInfoFields)
|
|
517
809
|
// To add the FilterField which is not part of the Selection Fields but the property is mentioned in the Selection Variant
|
|
518
810
|
.concat(defaultFilters || [])
|
|
519
811
|
// ...and adding remaining filter fields, that are not used in a SelectionVariant (order doesn't matter)
|
|
@@ -558,3 +850,140 @@ export const getSelectionFields = function(
|
|
|
558
850
|
|
|
559
851
|
return selectionFields;
|
|
560
852
|
};
|
|
853
|
+
|
|
854
|
+
export const getPropertyInfoFields = function(
|
|
855
|
+
converterContext: ConverterContext,
|
|
856
|
+
lrTables: TableVisualization[] = [],
|
|
857
|
+
lrCharts: ChartVisualization[] = [],
|
|
858
|
+
annotationPath: string = ""
|
|
859
|
+
) {
|
|
860
|
+
const oAnnotatedSelectionFieldData = getAnnotatedSelectionFieldData(converterContext, lrTables, annotationPath);
|
|
861
|
+
//const annotatedSelectionFields: any = oAnnotatedSelectionFieldData.annotatedSelectionFields;
|
|
862
|
+
const selectionFieldTypes: any = [];
|
|
863
|
+
const isCaseSensitive = isFilteringCaseSensitive(converterContext);
|
|
864
|
+
const aTypeConfig: any = [];
|
|
865
|
+
const _fnTypeConfig = function(property: Property) {
|
|
866
|
+
const oTypeConfig = getTypeConfig(property, undefined);
|
|
867
|
+
selectionFieldTypes.push(property?.type);
|
|
868
|
+
if (property?.type === "Edm.String" && (!oTypeConfig.constraints.nullable || oTypeConfig.constraints.nullable === true)) {
|
|
869
|
+
oTypeConfig.formatOptions.parseKeepsEmptyString = false;
|
|
870
|
+
}
|
|
871
|
+
aTypeConfig.push(oTypeConfig);
|
|
872
|
+
};
|
|
873
|
+
|
|
874
|
+
let propertyInfoFields: any = oAnnotatedSelectionFieldData.propertyInfoFields;
|
|
875
|
+
const parameterFields = _getParameterFields(converterContext);
|
|
876
|
+
propertyInfoFields = propertyInfoFields.concat(parameterFields);
|
|
877
|
+
|
|
878
|
+
propertyInfoFields = insertCustomElements(
|
|
879
|
+
propertyInfoFields,
|
|
880
|
+
getManifestFilterFields(converterContext.getEntityType(), converterContext),
|
|
881
|
+
{
|
|
882
|
+
"availability": "overwrite",
|
|
883
|
+
label: "overwrite",
|
|
884
|
+
type: "overwrite",
|
|
885
|
+
position: "overwrite",
|
|
886
|
+
template: "overwrite",
|
|
887
|
+
settings: "overwrite",
|
|
888
|
+
visualFilter: "overwrite"
|
|
889
|
+
}
|
|
890
|
+
);
|
|
891
|
+
|
|
892
|
+
propertyInfoFields.forEach(function(parameterField: any) {
|
|
893
|
+
if (parameterField.annotationPath) {
|
|
894
|
+
const propertyConvertyContext = converterContext.getConverterContextFor(parameterField.annotationPath);
|
|
895
|
+
const propertyTargetObject = propertyConvertyContext.getDataModelObjectPath().targetObject;
|
|
896
|
+
_fnTypeConfig(propertyTargetObject);
|
|
897
|
+
} else {
|
|
898
|
+
selectionFieldTypes.push("Edm.String");
|
|
899
|
+
aTypeConfig.push({});
|
|
900
|
+
}
|
|
901
|
+
});
|
|
902
|
+
|
|
903
|
+
const oFilterRestrictions = converterContext.getEntitySet()?.annotations?.Capabilities?.FilterRestrictions;
|
|
904
|
+
const oRet = {} as any;
|
|
905
|
+
oRet["RequiredProperties"] = getFilterRestrictions(oFilterRestrictions, "RequiredProperties") || [];
|
|
906
|
+
oRet["NonFilterableProperties"] = getFilterRestrictions(oFilterRestrictions, "NonFilterableProperties") || [];
|
|
907
|
+
oRet["FilterAllowedExpressions"] = getFilterRestrictions(oFilterRestrictions, "FilterAllowedExpressions") || {};
|
|
908
|
+
|
|
909
|
+
const sEntitySetPath = converterContext.getContextPath();
|
|
910
|
+
const aPathParts = sEntitySetPath.split("/");
|
|
911
|
+
if (aPathParts.length > 2) {
|
|
912
|
+
const sNavigationPath = aPathParts[aPathParts.length - 1];
|
|
913
|
+
aPathParts.splice(-1, 1);
|
|
914
|
+
const oNavigationRestrictions = getNavigationRestrictions(converterContext, sNavigationPath);
|
|
915
|
+
const oNavigationFilterRestrictions = oNavigationRestrictions && oNavigationRestrictions.FilterRestrictions;
|
|
916
|
+
oRet.RequiredProperties.concat(getFilterRestrictions(oNavigationFilterRestrictions, "RequiredProperties") || []);
|
|
917
|
+
oRet.NonFilterableProperties.concat(getFilterRestrictions(oNavigationFilterRestrictions, "NonFilterableProperties") || []);
|
|
918
|
+
oRet.FilterAllowedExpressions = {
|
|
919
|
+
...(getFilterRestrictions(oNavigationFilterRestrictions, "FilterAllowedExpressions") || {}),
|
|
920
|
+
...oRet.FilterAllowedExpressions
|
|
921
|
+
};
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
const aRequiredProps = oRet.RequiredProperties;
|
|
925
|
+
const aNonFilterableProps = oRet.NonFilterableProperties;
|
|
926
|
+
const mAllowedExpressions = oRet.FilterAllowedExpressions;
|
|
927
|
+
let oPropertyInfo;
|
|
928
|
+
const aFetchedProperties: any = [],
|
|
929
|
+
aParameterFields = [];
|
|
930
|
+
Object.keys(propertyInfoFields).forEach(function(sFilterFieldKey: string) {
|
|
931
|
+
const oConvertedProperty = propertyInfoFields[sFilterFieldKey];
|
|
932
|
+
const sPropertyPath = oConvertedProperty.conditionPath.replace(/\+|\*/g, "");
|
|
933
|
+
|
|
934
|
+
if (aNonFilterableProps.indexOf(sPropertyPath) === -1) {
|
|
935
|
+
oPropertyInfo = _fetchPropertyInfo(converterContext, oConvertedProperty, aTypeConfig[sFilterFieldKey]);
|
|
936
|
+
if (oPropertyInfo) {
|
|
937
|
+
if (mAllowedExpressions[sPropertyPath] && mAllowedExpressions[sPropertyPath].length > 0) {
|
|
938
|
+
oPropertyInfo = Object.assign(oPropertyInfo, {
|
|
939
|
+
filterExpression: getSpecificAllowedExpression(mAllowedExpressions[sPropertyPath])
|
|
940
|
+
});
|
|
941
|
+
} else {
|
|
942
|
+
oPropertyInfo = Object.assign(oPropertyInfo, {
|
|
943
|
+
filterExpression: "auto"
|
|
944
|
+
});
|
|
945
|
+
}
|
|
946
|
+
oPropertyInfo = Object.assign(oPropertyInfo, {
|
|
947
|
+
maxConditions: !oPropertyInfo.isParameter && isMultiValue(oPropertyInfo) ? -1 : 1,
|
|
948
|
+
required: oPropertyInfo.isParameter || aRequiredProps.indexOf(sPropertyPath) >= 0,
|
|
949
|
+
caseSensitive: isCaseSensitive,
|
|
950
|
+
visible: oConvertedProperty.availability === "Default",
|
|
951
|
+
dataType: selectionFieldTypes[sFilterFieldKey]
|
|
952
|
+
//label: getLocalizedText(oConvertedProperty.label)
|
|
953
|
+
});
|
|
954
|
+
|
|
955
|
+
aFetchedProperties.push(oPropertyInfo);
|
|
956
|
+
if (oPropertyInfo.isParameter) {
|
|
957
|
+
aParameterFields.push(sPropertyPath);
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
});
|
|
962
|
+
|
|
963
|
+
if (converterContext.getDataModelObjectPath().targetObject?.annotations?.Common?.DraftRoot) {
|
|
964
|
+
aFetchedProperties.push(getEditStateFilterPropertyInfo());
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
if (sEntitySetPath && getFilterBarhideBasicSearch(lrTables, lrCharts, converterContext) !== true) {
|
|
968
|
+
const searchRestrictions = getSearchRestrictions(converterContext);
|
|
969
|
+
if (!searchRestrictions || searchRestrictions?.Searchable) {
|
|
970
|
+
aFetchedProperties.push(getSearchFilterPropertyInfo());
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
aFetchedProperties.sort(function(a: any, b: any) {
|
|
975
|
+
if (a.groupLabel === undefined || a.groupLabel === null) {
|
|
976
|
+
return -1;
|
|
977
|
+
}
|
|
978
|
+
if (b.groupLabel === undefined || b.groupLabel === null) {
|
|
979
|
+
return 1;
|
|
980
|
+
}
|
|
981
|
+
return a.groupLabel.localeCompare(b.groupLabel);
|
|
982
|
+
});
|
|
983
|
+
|
|
984
|
+
let sFetchProperties = JSON.stringify(aFetchedProperties);
|
|
985
|
+
sFetchProperties = sFetchProperties.replace(/\{/g, "\\{");
|
|
986
|
+
sFetchProperties = sFetchProperties.replace(/\}/g, "\\}");
|
|
987
|
+
|
|
988
|
+
return sFetchProperties;
|
|
989
|
+
};
|