@sapui5/sap.fe.core 1.96.4 → 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 +6 -5
- 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 +5 -3
- package/src/sap/fe/core/AppStateHandler.js +229 -195
- 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 -2606
- package/src/sap/fe/core/CommonUtils.ts +2078 -0
- package/src/sap/fe/core/ExtensionAPI.js +16 -7
- package/src/sap/fe/core/PageController.js +84 -119
- package/src/sap/fe/core/PageController.ts +101 -0
- package/src/sap/fe/core/RouterProxy.js +986 -809
- 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 -155
- 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 -1627
- package/src/sap/fe/core/TransactionHelper.ts +1706 -0
- package/src/sap/fe/core/actions/draft.js +559 -581
- package/src/sap/fe/core/actions/draft.ts +593 -0
- package/src/sap/fe/core/actions/messageHandling.js +545 -435
- 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 -1192
- 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 +235 -264
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +3 -2
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +288 -13
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +35 -25
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +79 -46
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +86 -10
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +109 -31
- package/src/sap/fe/core/controllerextensions/MassEdit.js +172 -0
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +237 -104
- package/src/sap/fe/core/controllerextensions/PageReady.js +3 -3
- package/src/sap/fe/core/controllerextensions/PageReady.ts +12 -8
- package/src/sap/fe/core/controllerextensions/Paginator.js +37 -9
- package/src/sap/fe/core/controllerextensions/Placeholder.js +8 -4
- package/src/sap/fe/core/controllerextensions/Routing.js +25 -5
- 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 +9 -9
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +22 -21
- package/src/sap/fe/core/controllerextensions/ViewState.js +36 -8
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +2 -1
- 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 +112 -113
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +9 -5
- package/src/sap/fe/core/controls/FieldWrapper.js +18 -23
- package/src/sap/fe/core/controls/FilterBar.js +3 -2
- package/src/sap/fe/core/controls/FormElementWrapper.js +3 -7
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +3 -2
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +2 -1
- 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/MassEditDialog.fragment.xml +106 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +79 -0
- package/src/sap/fe/core/converters/ConverterContext.js +14 -2
- package/src/sap/fe/core/converters/ConverterContext.ts +14 -3
- package/src/sap/fe/core/converters/ManifestSettings.js +2 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +8 -1
- package/src/sap/fe/core/converters/ManifestWrapper.js +56 -32
- package/src/sap/fe/core/converters/ManifestWrapper.ts +24 -6
- package/src/sap/fe/core/converters/MetaModelConverter.js +76 -6
- package/src/sap/fe/core/converters/MetaModelConverter.ts +79 -15
- 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/annotations/DataField.js +3 -3
- package/src/sap/fe/core/converters/annotations/DataField.ts +1 -1
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +85 -46
- package/src/sap/fe/core/converters/controls/Common/Action.js +16 -4
- package/src/sap/fe/core/converters/controls/Common/Action.ts +14 -5
- 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 +60 -19
- package/src/sap/fe/core/converters/controls/Common/Form.ts +66 -14
- package/src/sap/fe/core/converters/controls/Common/KPI.js +69 -4
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +72 -0
- package/src/sap/fe/core/converters/controls/Common/Table.js +503 -399
- package/src/sap/fe/core/converters/controls/Common/Table.ts +615 -480
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +527 -0
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +655 -0
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +489 -37
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +506 -58
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +2 -2
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +1 -1
- 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 +18 -3
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +28 -5
- package/src/sap/fe/core/converters/helpers/ID.js +9 -1
- package/src/sap/fe/core/converters/helpers/ID.ts +4 -0
- package/src/sap/fe/core/converters/helpers/IssueManager.js +7 -1
- package/src/sap/fe/core/converters/helpers/IssueManager.ts +6 -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 +29 -11
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +36 -20
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +13 -3
- 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 +65 -31
- package/src/sap/fe/core/formatters/TableFormatter.ts +62 -30
- package/src/sap/fe/core/formatters/ValueFormatter.js +30 -5
- package/src/sap/fe/core/formatters/ValueFormatter.ts +30 -7
- package/src/sap/fe/core/fpm/Component.js +3 -2
- package/src/sap/fe/core/helpers/AppStartupHelper.js +359 -0
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +391 -0
- package/src/sap/fe/core/helpers/BindingExpression.js +479 -464
- package/src/sap/fe/core/helpers/BindingExpression.ts +477 -483
- 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 +210 -0
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +202 -0
- package/src/sap/fe/core/helpers/KeepAliveRefreshTypes.js +32 -0
- package/src/sap/fe/core/helpers/KeepAliveRefreshTypes.ts +36 -0
- package/src/sap/fe/core/helpers/MassEditHelper.js +687 -0
- package/src/sap/fe/core/helpers/ModelHelper.js +229 -174
- 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 +30 -3
- package/src/sap/fe/core/library.support.js +12 -5
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +62 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +66 -0
- package/src/sap/fe/core/messagebundle.properties +72 -10
- package/src/sap/fe/core/messagebundle_ar.properties +41 -0
- package/src/sap/fe/core/messagebundle_bg.properties +41 -0
- package/src/sap/fe/core/messagebundle_ca.properties +41 -0
- package/src/sap/fe/core/messagebundle_cs.properties +42 -1
- package/src/sap/fe/core/messagebundle_cy.properties +41 -0
- package/src/sap/fe/core/messagebundle_da.properties +41 -0
- package/src/sap/fe/core/messagebundle_de.properties +41 -0
- package/src/sap/fe/core/messagebundle_el.properties +41 -0
- package/src/sap/fe/core/messagebundle_en.properties +41 -0
- package/src/sap/fe/core/messagebundle_en_GB.properties +41 -0
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +41 -0
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +35 -0
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +41 -0
- package/src/sap/fe/core/messagebundle_es.properties +41 -0
- package/src/sap/fe/core/messagebundle_es_MX.properties +41 -0
- package/src/sap/fe/core/messagebundle_et.properties +41 -0
- package/src/sap/fe/core/messagebundle_fi.properties +41 -0
- package/src/sap/fe/core/messagebundle_fr.properties +46 -5
- package/src/sap/fe/core/messagebundle_fr_CA.properties +41 -0
- package/src/sap/fe/core/messagebundle_hi.properties +41 -0
- package/src/sap/fe/core/messagebundle_hr.properties +41 -0
- package/src/sap/fe/core/messagebundle_hu.properties +42 -1
- package/src/sap/fe/core/messagebundle_id.properties +45 -4
- package/src/sap/fe/core/messagebundle_it.properties +41 -0
- package/src/sap/fe/core/messagebundle_iw.properties +41 -0
- package/src/sap/fe/core/messagebundle_ja.properties +50 -9
- package/src/sap/fe/core/messagebundle_kk.properties +41 -0
- package/src/sap/fe/core/messagebundle_ko.properties +41 -0
- package/src/sap/fe/core/messagebundle_lt.properties +41 -0
- package/src/sap/fe/core/messagebundle_lv.properties +41 -0
- package/src/sap/fe/core/messagebundle_ms.properties +41 -0
- package/src/sap/fe/core/messagebundle_nl.properties +41 -0
- package/src/sap/fe/core/messagebundle_no.properties +41 -0
- package/src/sap/fe/core/messagebundle_pl.properties +41 -0
- package/src/sap/fe/core/messagebundle_pt.properties +43 -2
- package/src/sap/fe/core/messagebundle_pt_PT.properties +41 -0
- package/src/sap/fe/core/messagebundle_ro.properties +41 -0
- package/src/sap/fe/core/messagebundle_ru.properties +41 -0
- package/src/sap/fe/core/messagebundle_sh.properties +41 -0
- package/src/sap/fe/core/messagebundle_sk.properties +41 -0
- package/src/sap/fe/core/messagebundle_sl.properties +41 -0
- package/src/sap/fe/core/messagebundle_sv.properties +42 -1
- package/src/sap/fe/core/messagebundle_th.properties +41 -0
- package/src/sap/fe/core/messagebundle_tr.properties +41 -0
- package/src/sap/fe/core/messagebundle_uk.properties +41 -0
- package/src/sap/fe/core/messagebundle_vi.properties +41 -0
- package/src/sap/fe/core/messagebundle_zh_CN.properties +41 -0
- package/src/sap/fe/core/messagebundle_zh_TW.properties +41 -0
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
- 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 +4 -3
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +9 -5
- 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 -1166
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +898 -0
- package/src/sap/fe/core/services/ShellServicesFactory.js +31 -2
- package/src/sap/fe/core/services/ShellServicesFactory.ts +45 -11
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +41 -84
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +56 -99
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +461 -478
- 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/support/InvalidAnnotationColumnKey.support.js +38 -0
- package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.ts +18 -0
- package/src/sap/fe/core/templating/DataModelPathHelper.js +6 -24
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +10 -23
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +114 -0
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +86 -0
- package/src/sap/fe/core/templating/EntitySetHelper.js +80 -7
- package/src/sap/fe/core/templating/EntitySetHelper.ts +42 -2
- 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 +139 -70
- package/src/sap/fe/core/templating/FilterHelper.ts +140 -70
- package/src/sap/fe/core/templating/PropertyHelper.js +2 -2
- package/src/sap/fe/core/templating/PropertyHelper.ts +1 -1
- package/src/sap/fe/core/templating/UIFormatters.js +45 -113
- package/src/sap/fe/core/templating/UIFormatters.ts +39 -76
- 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,8 +18,10 @@ 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 & {
|
|
24
|
+
type?: string;
|
|
27
25
|
conditionPath: string;
|
|
28
26
|
availability: AvailabilityType;
|
|
29
27
|
annotationPath: string;
|
|
@@ -42,13 +40,18 @@ type FilterGroup = {
|
|
|
42
40
|
groupLabel?: string;
|
|
43
41
|
};
|
|
44
42
|
|
|
43
|
+
enum filterFieldType {
|
|
44
|
+
Default = "Default",
|
|
45
|
+
Slot = "Slot"
|
|
46
|
+
}
|
|
47
|
+
|
|
45
48
|
export type CustomElementFilterField = CustomElement<FilterField>;
|
|
46
49
|
|
|
47
50
|
/**
|
|
48
51
|
* Enter all DataFields of a given FieldGroup into the filterFacetMap.
|
|
49
52
|
*
|
|
50
53
|
* @param {AnnotationTerm<FieldGroupType>} fieldGroup
|
|
51
|
-
* @returns {Record<string, FilterGroup>} The map of facets for the given
|
|
54
|
+
* @returns {Record<string, FilterGroup>} The map of facets for the given FieldGroup
|
|
52
55
|
*/
|
|
53
56
|
function getFieldGroupFilterGroups(fieldGroup: AnnotationTerm<FieldGroupType>): Record<string, FilterGroup> {
|
|
54
57
|
const filterFacetMap: Record<string, FilterGroup> = {};
|
|
@@ -76,8 +79,8 @@ function getExcludedFilterProperties(selectionVariants: SelectionVariantConfigur
|
|
|
76
79
|
}
|
|
77
80
|
|
|
78
81
|
/**
|
|
79
|
-
* Check that all the tables for a dedicated
|
|
80
|
-
* @param {TableVisualization[]} listReportTables List
|
|
82
|
+
* Check that all the tables for a dedicated entity set are configured as analytical table.
|
|
83
|
+
* @param {TableVisualization[]} listReportTables List report tables
|
|
81
84
|
* @param {string} contextPath
|
|
82
85
|
* @returns {boolean} Is FilterBar search field hidden or not
|
|
83
86
|
*/
|
|
@@ -119,10 +122,10 @@ function getSelectionVariants(
|
|
|
119
122
|
}
|
|
120
123
|
|
|
121
124
|
/**
|
|
122
|
-
* Returns the condition path required for the condition model. It looks
|
|
125
|
+
* Returns the condition path required for the condition model. It looks as follows:
|
|
123
126
|
* <1:N-PropertyName>*\/<1:1-PropertyName>/<PropertyName>.
|
|
124
127
|
*
|
|
125
|
-
* @param entityType The root
|
|
128
|
+
* @param entityType The root EntityType
|
|
126
129
|
* @param propertyPath The full path to the target property
|
|
127
130
|
* @returns {string} The formatted condition path
|
|
128
131
|
*/
|
|
@@ -172,6 +175,70 @@ const _createFilterSelectionField = function(
|
|
|
172
175
|
return undefined;
|
|
173
176
|
};
|
|
174
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
|
+
}
|
|
175
242
|
const _getSelectionFields = function(
|
|
176
243
|
entityType: EntityType,
|
|
177
244
|
navigationPath: string,
|
|
@@ -217,7 +284,7 @@ const _getSelectionFieldsByPath = function(
|
|
|
217
284
|
includeHidden,
|
|
218
285
|
converterContext
|
|
219
286
|
);
|
|
220
|
-
} else if (property.targetType !== undefined) {
|
|
287
|
+
} else if (property.targetType !== undefined && property.targetType._type === "ComplexType") {
|
|
221
288
|
// handle ComplexType properties
|
|
222
289
|
localSelectionFields = _getSelectionFields(
|
|
223
290
|
entityType,
|
|
@@ -258,7 +325,7 @@ const _getFilterField = function(
|
|
|
258
325
|
filterField = _createFilterSelectionField(entityType, entityType.resolvePath(propertyPath), propertyPath, true, converterContext);
|
|
259
326
|
}
|
|
260
327
|
if (!filterField) {
|
|
261
|
-
converterContext.getDiagnostics()
|
|
328
|
+
converterContext.getDiagnostics()?.addIssue(IssueCategory.Annotation, IssueSeverity.High, IssueType.MISSING_SELECTIONFIELD);
|
|
262
329
|
}
|
|
263
330
|
// defined SelectionFields are available by default
|
|
264
331
|
if (filterField) {
|
|
@@ -318,7 +385,7 @@ const _getDefaultFilterFields = function(
|
|
|
318
385
|
};
|
|
319
386
|
|
|
320
387
|
/**
|
|
321
|
-
* Get all
|
|
388
|
+
* Get all parameter filter fields in case of a parameterized service.
|
|
322
389
|
* @param {ConverterContext} converterContext
|
|
323
390
|
* @returns {FilterField[]} An array of parameter filterfields
|
|
324
391
|
*/
|
|
@@ -342,20 +409,28 @@ function _getParameterFields(converterContext: ConverterContext): FilterField[]
|
|
|
342
409
|
* Determines if the FilterBar search field is hidden or not.
|
|
343
410
|
*
|
|
344
411
|
* @param {TableVisualization[]} listReportTables The list report tables
|
|
412
|
+
* @param {ChartVisualization[]} charts The ALP charts
|
|
345
413
|
* @param {ConverterContext} converterContext The converter context
|
|
346
414
|
* @returns {boolean} The information if the FilterBar search field is hidden or not
|
|
347
415
|
*/
|
|
348
|
-
export const getFilterBarhideBasicSearch = function(
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
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);
|
|
427
|
+
|
|
428
|
+
const contextPath = converterContext.getContextPath();
|
|
429
|
+
if (contextPath && noSearchInCharts && noSearchInTables) {
|
|
353
430
|
return true;
|
|
431
|
+
} else {
|
|
432
|
+
return false;
|
|
354
433
|
}
|
|
355
|
-
// Tries to find a non-analytical table with the main entity set (page entity set) as collection
|
|
356
|
-
// if at least one table matches these conditions, basic search field must be displayed.
|
|
357
|
-
const sContextPath = converterContext.getContextPath();
|
|
358
|
-
return checkAllTableForEntitySetAreAnalytical(listReportTables, sContextPath);
|
|
359
434
|
};
|
|
360
435
|
|
|
361
436
|
/**
|
|
@@ -383,9 +458,14 @@ export const getManifestFilterFields = function(
|
|
|
383
458
|
const filterField = definedFilterFields[sKey];
|
|
384
459
|
const propertyName = KeyHelper.getPathFromSelectionFieldKey(sKey);
|
|
385
460
|
const selectionField = selectionFields[propertyName];
|
|
386
|
-
const
|
|
461
|
+
const type = filterField.type === "Slot" ? filterFieldType.Slot : filterFieldType.Default;
|
|
462
|
+
const visualFilter =
|
|
463
|
+
filterField && filterField?.visualFilter
|
|
464
|
+
? getVisualFilters(entityType, converterContext, sKey, definedFilterFields)
|
|
465
|
+
: undefined;
|
|
387
466
|
filterFields[sKey] = {
|
|
388
467
|
key: sKey,
|
|
468
|
+
type: type,
|
|
389
469
|
annotationPath: selectionField?.annotationPath,
|
|
390
470
|
conditionPath: selectionField?.conditionPath || propertyName,
|
|
391
471
|
template: filterField.template,
|
|
@@ -403,6 +483,249 @@ export const getFilterField = function(propertyPath: string, converterContext: C
|
|
|
403
483
|
return _getFilterField({}, propertyPath, converterContext, entityType);
|
|
404
484
|
};
|
|
405
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
|
+
|
|
406
729
|
/**
|
|
407
730
|
* Retrieve the configuration for the selection fields that will be used within the filter bar
|
|
408
731
|
* This configuration takes into account annotation and the selection variants.
|
|
@@ -417,12 +740,11 @@ export const getSelectionFields = function(
|
|
|
417
740
|
lrTables: TableVisualization[] = [],
|
|
418
741
|
annotationPath: string = ""
|
|
419
742
|
): FilterField[] {
|
|
420
|
-
|
|
421
|
-
const selectionVariants: SelectionVariantConfiguration[] = getSelectionVariants(lrTables, converterContext);
|
|
743
|
+
const oAnnotatedSelectionFieldData = getAnnotatedSelectionFieldData(converterContext, lrTables, annotationPath);
|
|
422
744
|
|
|
423
745
|
// create a map of properties to be used in selection variants
|
|
424
|
-
const excludedFilterProperties: Record<string, boolean> =
|
|
425
|
-
const entityType =
|
|
746
|
+
const excludedFilterProperties: Record<string, boolean> = oAnnotatedSelectionFieldData.excludedFilterProperties;
|
|
747
|
+
const entityType = oAnnotatedSelectionFieldData.entityType;
|
|
426
748
|
const filterFacets = entityType.annotations.UI?.FilterFacets;
|
|
427
749
|
let filterFacetMap: Record<string, FilterGroup> = {};
|
|
428
750
|
|
|
@@ -454,22 +776,10 @@ export const getSelectionFields = function(
|
|
|
454
776
|
}
|
|
455
777
|
|
|
456
778
|
// create a map of all potential filter fields based on...
|
|
457
|
-
const filterFields: Record<string, FilterField> =
|
|
458
|
-
// ...non hidden properties of the entity
|
|
459
|
-
..._getSelectionFields(entityType, "", entityType.entityProperties, false, converterContext),
|
|
460
|
-
// ...additional manifest defined navigation properties
|
|
461
|
-
..._getSelectionFieldsByPath(
|
|
462
|
-
entityType,
|
|
463
|
-
converterContext.getManifestWrapper().getFilterConfiguration().navigationProperties,
|
|
464
|
-
false,
|
|
465
|
-
converterContext
|
|
466
|
-
)
|
|
467
|
-
};
|
|
779
|
+
const filterFields: Record<string, FilterField> = oAnnotatedSelectionFieldData.filterFields;
|
|
468
780
|
|
|
469
781
|
//Filters which has to be added which is part of SV/Default annotations but not present in the SelectionFields
|
|
470
|
-
const annotatedSelectionFields =
|
|
471
|
-
entityType.annotations?.UI?.SelectionFields ||
|
|
472
|
-
[]) as PropertyPath[];
|
|
782
|
+
const annotatedSelectionFields = oAnnotatedSelectionFieldData.annotatedSelectionFields;
|
|
473
783
|
const defaultFilters = _getDefaultFilterFields(
|
|
474
784
|
filterFields,
|
|
475
785
|
aSelectOptions,
|
|
@@ -479,23 +789,23 @@ export const getSelectionFields = function(
|
|
|
479
789
|
annotatedSelectionFields
|
|
480
790
|
);
|
|
481
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
|
+
}, []) || [];
|
|
482
805
|
|
|
483
806
|
// finally create final list of filter fields by adding the SelectionFields first (order matters)...
|
|
484
807
|
let allFilters = parameterFields
|
|
485
|
-
.concat(
|
|
486
|
-
annotatedSelectionFields?.reduce((selectionFields: FilterField[], selectionField) => {
|
|
487
|
-
const propertyPath = selectionField.value;
|
|
488
|
-
if (!(propertyPath in excludedFilterProperties)) {
|
|
489
|
-
const filterField: FilterField | undefined = _getFilterField(filterFields, propertyPath, converterContext, entityType);
|
|
490
|
-
if (filterField) {
|
|
491
|
-
filterField.group = "";
|
|
492
|
-
filterField.groupLabel = "";
|
|
493
|
-
selectionFields.push(filterField);
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
return selectionFields;
|
|
497
|
-
}, []) || []
|
|
498
|
-
)
|
|
808
|
+
.concat(propertyInfoFields)
|
|
499
809
|
// To add the FilterField which is not part of the Selection Fields but the property is mentioned in the Selection Variant
|
|
500
810
|
.concat(defaultFilters || [])
|
|
501
811
|
// ...and adding remaining filter fields, that are not used in a SelectionVariant (order doesn't matter)
|
|
@@ -525,6 +835,7 @@ export const getSelectionFields = function(
|
|
|
525
835
|
const selectionFields = insertCustomElements(allFilters, getManifestFilterFields(entityType, converterContext), {
|
|
526
836
|
"availability": "overwrite",
|
|
527
837
|
label: "overwrite",
|
|
838
|
+
type: "overwrite",
|
|
528
839
|
position: "overwrite",
|
|
529
840
|
template: "overwrite",
|
|
530
841
|
settings: "overwrite",
|
|
@@ -539,3 +850,140 @@ export const getSelectionFields = function(
|
|
|
539
850
|
|
|
540
851
|
return selectionFields;
|
|
541
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
|
+
};
|