@sapui5/sap.fe.core 1.99.0 → 1.101.1
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 -4
- package/src/sap/fe/core/.library +2 -3
- package/src/sap/fe/core/AnnotationHelper.js +43 -92
- package/src/sap/fe/core/AnnotationHelper.ts +43 -107
- package/src/sap/fe/core/AppComponent.js +381 -399
- package/src/sap/fe/core/AppComponent.ts +397 -0
- package/src/sap/fe/core/AppStateHandler.js +131 -162
- package/src/sap/fe/core/AppStateHandler.ts +2 -2
- package/src/sap/fe/core/BaseController.js +82 -58
- package/src/sap/fe/core/BaseController.ts +67 -0
- package/src/sap/fe/core/CommonUtils.js +179 -31
- package/src/sap/fe/core/CommonUtils.ts +295 -125
- package/src/sap/fe/core/ExtensionAPI.js +279 -274
- package/src/sap/fe/core/ExtensionAPI.ts +242 -0
- package/src/sap/fe/core/PageController.js +158 -29
- package/src/sap/fe/core/PageController.ts +65 -37
- package/src/sap/fe/core/RouterProxy.js +700 -750
- package/src/sap/fe/core/RouterProxy.ts +47 -31
- package/src/sap/fe/core/Synchronization.js +21 -31
- package/src/sap/fe/core/TemplateComponent.js +193 -118
- package/src/sap/fe/core/TemplateComponent.ts +104 -109
- package/src/sap/fe/core/TemplateModel.js +24 -44
- package/src/sap/fe/core/TemplateModel.ts +3 -3
- package/src/sap/fe/core/TransactionHelper.js +1368 -1369
- package/src/sap/fe/core/TransactionHelper.ts +201 -171
- package/src/sap/fe/core/actions/collaboration/ActivitySync.js +406 -0
- package/src/sap/fe/core/actions/collaboration/ActivitySync.ts +362 -0
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +146 -0
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.ts +129 -0
- package/src/sap/fe/core/actions/collaboration/Manage.js +264 -0
- package/src/sap/fe/core/actions/collaboration/Manage.ts +246 -0
- package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +100 -0
- package/src/sap/fe/core/actions/collaboration/UserDetails.fragment.xml +13 -0
- package/src/sap/fe/core/actions/draft.js +324 -220
- package/src/sap/fe/core/actions/draft.ts +209 -133
- package/src/sap/fe/core/actions/messageHandling.js +79 -48
- package/src/sap/fe/core/actions/messageHandling.ts +113 -83
- package/src/sap/fe/core/actions/operations.js +37 -18
- package/src/sap/fe/core/actions/operations.ts +51 -20
- package/src/sap/fe/core/actions/sticky.js +17 -4
- package/src/sap/fe/core/actions/sticky.ts +21 -4
- package/src/sap/fe/core/buildingBlocks/AttributeModel.js +60 -0
- package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +37 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +165 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +178 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +707 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +628 -0
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +436 -0
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +431 -0
- package/src/sap/fe/core/controllerextensions/EditFlow.js +1854 -1669
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +1792 -0
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +79 -54
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +60 -0
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +716 -779
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +785 -0
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +796 -816
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +810 -0
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +1056 -1005
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +1001 -0
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +498 -532
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +13 -12
- package/src/sap/fe/core/controllerextensions/MassEdit.js +141 -169
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +155 -0
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +221 -244
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +215 -0
- package/src/sap/fe/core/controllerextensions/PageReady.js +312 -345
- package/src/sap/fe/core/controllerextensions/PageReady.ts +57 -53
- package/src/sap/fe/core/controllerextensions/Paginator.js +188 -175
- package/src/sap/fe/core/controllerextensions/Paginator.ts +169 -0
- package/src/sap/fe/core/controllerextensions/Placeholder.js +157 -149
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +149 -0
- package/src/sap/fe/core/controllerextensions/Routing.js +144 -125
- package/src/sap/fe/core/controllerextensions/Routing.ts +131 -0
- package/src/sap/fe/core/controllerextensions/RoutingListener.js +7 -6
- package/src/sap/fe/core/controllerextensions/RoutingListener.ts +3 -0
- package/src/sap/fe/core/controllerextensions/Share.js +230 -268
- package/src/sap/fe/core/controllerextensions/Share.ts +231 -0
- package/src/sap/fe/core/controllerextensions/SideEffects.js +603 -644
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +68 -68
- package/src/sap/fe/core/controllerextensions/ViewState.js +774 -806
- package/src/sap/fe/core/controllerextensions/ViewState.ts +796 -0
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +2 -2
- package/src/sap/fe/core/controls/ActionPartial.fragment.xml +2 -2
- package/src/sap/fe/core/controls/Any.js +28 -0
- package/src/sap/fe/core/controls/Any.ts +30 -0
- package/src/sap/fe/core/controls/CommandExecution.js +92 -68
- package/src/sap/fe/core/controls/CommandExecution.ts +72 -0
- package/src/sap/fe/core/controls/ConditionalWrapper.js +165 -79
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +74 -0
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +366 -0
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +278 -0
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +167 -125
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +116 -0
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossDraft.fragment.xml +44 -5
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +163 -122
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +155 -0
- package/src/sap/fe/core/controls/FieldWrapper.js +212 -141
- package/src/sap/fe/core/controls/FieldWrapper.ts +104 -0
- package/src/sap/fe/core/controls/FileWrapper.js +313 -0
- package/src/sap/fe/core/controls/FileWrapper.ts +169 -0
- package/src/sap/fe/core/controls/FilterBar.js +197 -159
- package/src/sap/fe/core/controls/FilterBar.ts +148 -0
- package/src/sap/fe/core/controls/FormElementWrapper.js +100 -39
- package/src/sap/fe/core/controls/FormElementWrapper.ts +37 -0
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +37 -42
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.ts +31 -0
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +147 -115
- package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +102 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +300 -265
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +252 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +185 -140
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +125 -0
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +335 -322
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +337 -0
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +37 -42
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +75 -74
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +71 -0
- package/src/sap/fe/core/converters/ConverterContext.js +348 -379
- package/src/sap/fe/core/converters/ConverterContext.ts +19 -16
- package/src/sap/fe/core/converters/ManifestSettings.js +13 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +17 -2
- package/src/sap/fe/core/converters/ManifestWrapper.js +354 -378
- package/src/sap/fe/core/converters/ManifestWrapper.ts +10 -0
- package/src/sap/fe/core/converters/MetaModelConverter.js +6 -4
- package/src/sap/fe/core/converters/MetaModelConverter.ts +5 -2
- package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
- package/src/sap/fe/core/converters/TemplateConverter.ts +2 -1
- package/src/sap/fe/core/converters/annotations/DataField.js +26 -13
- package/src/sap/fe/core/converters/annotations/DataField.ts +40 -17
- package/src/sap/fe/core/converters/controls/Common/Action.js +10 -10
- package/src/sap/fe/core/converters/controls/Common/Action.ts +20 -19
- package/src/sap/fe/core/converters/controls/Common/Chart.js +8 -8
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +12 -11
- package/src/sap/fe/core/converters/controls/Common/Form.js +6 -6
- package/src/sap/fe/core/converters/controls/Common/Form.ts +7 -3
- package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +2 -2
- package/src/sap/fe/core/converters/controls/Common/Table.js +326 -86
- package/src/sap/fe/core/converters/controls/Common/Table.ts +384 -167
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +120 -55
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +158 -98
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +206 -223
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +263 -287
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +6 -6
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +20 -18
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +5 -2
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +4 -1
- package/src/sap/fe/core/converters/helpers/Aggregation.js +115 -133
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +20 -6
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +16 -4
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +12 -1
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +11 -0
- package/src/sap/fe/core/converters/helpers/Key.js +42 -57
- package/src/sap/fe/core/converters/helpers/Key.ts +1 -1
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +1 -1
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +0 -4
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +51 -27
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +69 -43
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +42 -25
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +91 -65
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +11 -9
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +8 -8
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +92 -98
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +91 -0
- package/src/sap/fe/core/formatters/CollaborationFormatter.js +104 -0
- package/src/sap/fe/core/formatters/CollaborationFormatter.ts +60 -0
- package/src/sap/fe/core/formatters/KPIFormatter.js +3 -12
- package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -2
- package/src/sap/fe/core/formatters/TableFormatter.js +53 -2
- package/src/sap/fe/core/formatters/TableFormatter.ts +51 -0
- package/src/sap/fe/core/formatters/ValueFormatter.js +4 -4
- package/src/sap/fe/core/formatters/ValueFormatter.ts +4 -7
- package/src/sap/fe/core/fpm/Component.js +80 -55
- package/src/sap/fe/core/fpm/Component.ts +43 -0
- package/src/sap/fe/core/helpers/AppStartupHelper.js +323 -309
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +363 -337
- package/src/sap/fe/core/helpers/BindingExpression.js +7 -7
- package/src/sap/fe/core/helpers/BindingExpression.ts +7 -7
- package/src/sap/fe/core/helpers/ClassSupport.js +307 -166
- package/src/sap/fe/core/helpers/ClassSupport.ts +348 -155
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +5 -4
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +1 -5
- package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
- package/src/sap/fe/core/helpers/FPMHelper.ts +1 -1
- package/src/sap/fe/core/helpers/MassEditHelper.js +735 -684
- package/src/sap/fe/core/helpers/MassEditHelper.ts +803 -0
- package/src/sap/fe/core/helpers/ModelHelper.js +53 -1
- package/src/sap/fe/core/helpers/ModelHelper.ts +46 -0
- package/src/sap/fe/core/helpers/PasteHelper.js +4 -4
- package/src/sap/fe/core/helpers/PasteHelper.ts +4 -3
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +7 -3
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +7 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +1 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +1 -1
- package/src/sap/fe/core/helpers/StableIdHelper.js +1 -7
- package/src/sap/fe/core/helpers/StableIdHelper.ts +0 -4
- package/src/sap/fe/core/jsx-runtime/jsx.js +35 -5
- package/src/sap/fe/core/jsx-runtime/jsx.ts +22 -8
- package/src/sap/fe/core/library.js +425 -451
- package/src/sap/fe/core/library.support.js +22 -33
- package/src/sap/fe/core/library.support.ts +23 -0
- package/src/sap/fe/core/library.ts +420 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +5 -3
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +4 -4
- package/src/sap/fe/core/messagebundle.properties +45 -13
- package/src/sap/fe/core/messagebundle_ar.properties +29 -7
- package/src/sap/fe/core/messagebundle_bg.properties +29 -7
- package/src/sap/fe/core/messagebundle_ca.properties +29 -7
- package/src/sap/fe/core/messagebundle_cs.properties +29 -7
- package/src/sap/fe/core/messagebundle_cy.properties +29 -7
- package/src/sap/fe/core/messagebundle_da.properties +29 -7
- package/src/sap/fe/core/messagebundle_de.properties +29 -7
- package/src/sap/fe/core/messagebundle_el.properties +29 -7
- package/src/sap/fe/core/messagebundle_en.properties +29 -7
- package/src/sap/fe/core/messagebundle_en_GB.properties +29 -7
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +29 -7
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +29 -7
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +29 -7
- package/src/sap/fe/core/messagebundle_es.properties +29 -7
- package/src/sap/fe/core/messagebundle_es_MX.properties +29 -7
- package/src/sap/fe/core/messagebundle_et.properties +29 -7
- package/src/sap/fe/core/messagebundle_fi.properties +30 -8
- package/src/sap/fe/core/messagebundle_fr.properties +31 -9
- package/src/sap/fe/core/messagebundle_fr_CA.properties +31 -9
- package/src/sap/fe/core/messagebundle_hi.properties +29 -7
- package/src/sap/fe/core/messagebundle_hr.properties +29 -7
- package/src/sap/fe/core/messagebundle_hu.properties +29 -7
- package/src/sap/fe/core/messagebundle_id.properties +29 -7
- package/src/sap/fe/core/messagebundle_it.properties +29 -7
- package/src/sap/fe/core/messagebundle_iw.properties +29 -7
- package/src/sap/fe/core/messagebundle_ja.properties +28 -6
- package/src/sap/fe/core/messagebundle_kk.properties +29 -7
- package/src/sap/fe/core/messagebundle_ko.properties +29 -7
- package/src/sap/fe/core/messagebundle_lt.properties +29 -7
- package/src/sap/fe/core/messagebundle_lv.properties +30 -8
- package/src/sap/fe/core/messagebundle_ms.properties +29 -7
- package/src/sap/fe/core/messagebundle_nl.properties +29 -7
- package/src/sap/fe/core/messagebundle_no.properties +29 -7
- package/src/sap/fe/core/messagebundle_pl.properties +29 -7
- package/src/sap/fe/core/messagebundle_pt.properties +30 -8
- package/src/sap/fe/core/messagebundle_pt_PT.properties +29 -7
- package/src/sap/fe/core/messagebundle_ro.properties +29 -7
- package/src/sap/fe/core/messagebundle_ru.properties +29 -7
- package/src/sap/fe/core/messagebundle_sh.properties +29 -7
- package/src/sap/fe/core/messagebundle_sk.properties +29 -7
- package/src/sap/fe/core/messagebundle_sl.properties +29 -7
- package/src/sap/fe/core/messagebundle_sv.properties +30 -8
- package/src/sap/fe/core/messagebundle_th.properties +28 -6
- package/src/sap/fe/core/messagebundle_tr.properties +32 -10
- package/src/sap/fe/core/messagebundle_uk.properties +29 -7
- package/src/sap/fe/core/messagebundle_vi.properties +29 -7
- package/src/sap/fe/core/messagebundle_zh_CN.properties +29 -7
- package/src/sap/fe/core/messagebundle_zh_TW.properties +29 -7
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +47 -73
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +158 -196
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +5 -6
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +70 -96
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +7 -6
- package/src/sap/fe/core/services/NavigationServiceFactory.js +287 -342
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +11 -14
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +70 -105
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +6 -3
- package/src/sap/fe/core/services/RoutingServiceFactory.js +796 -820
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +62 -53
- package/src/sap/fe/core/services/ShellServicesFactory.js +694 -741
- package/src/sap/fe/core/services/ShellServicesFactory.ts +33 -33
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +570 -595
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +23 -4
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +357 -389
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +25 -29
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +43 -5
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +7 -4
- package/src/sap/fe/core/support/CommonHelper.js +1 -1
- package/src/sap/fe/core/support/CommonHelper.ts +1 -4
- package/src/sap/fe/core/support/Diagnostics.js +36 -48
- package/src/sap/fe/core/templating/DataModelPathHelper.js +91 -90
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +126 -123
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +23 -3
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +26 -5
- package/src/sap/fe/core/templating/FilterHelper.js +25 -32
- package/src/sap/fe/core/templating/FilterHelper.ts +36 -35
- package/src/sap/fe/core/templating/PropertyHelper.js +16 -2
- package/src/sap/fe/core/templating/PropertyHelper.ts +31 -24
- package/src/sap/fe/core/templating/UIFormatters.js +150 -44
- package/src/sap/fe/core/templating/UIFormatters.ts +165 -67
- package/src/sap/fe/core/type/Email.js +26 -8
- package/src/sap/fe/core/type/Email.ts +8 -7
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +0 -75
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EntityType, Property, TypeDefinition } from "@sap-ux/annotation-converter";
|
|
1
2
|
import {
|
|
2
3
|
CriticalityType,
|
|
3
4
|
DataField,
|
|
@@ -9,6 +10,7 @@ import {
|
|
|
9
10
|
DataPoint,
|
|
10
11
|
DataPointTypeTypes,
|
|
11
12
|
EnumValue,
|
|
13
|
+
FieldGroupType,
|
|
12
14
|
LineItem,
|
|
13
15
|
PathAnnotationExpression,
|
|
14
16
|
PresentationVariantTypeTypes,
|
|
@@ -17,35 +19,9 @@ import {
|
|
|
17
19
|
SelectOptionType,
|
|
18
20
|
UIAnnotationTypes
|
|
19
21
|
} from "@sap-ux/vocabularies-types";
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
CreationMode,
|
|
24
|
-
FormatOptionsType,
|
|
25
|
-
HorizontalAlign,
|
|
26
|
-
ManifestTableColumn,
|
|
27
|
-
NavigationSettingsConfiguration,
|
|
28
|
-
NavigationTargetConfiguration,
|
|
29
|
-
SelectionMode,
|
|
30
|
-
TableColumnSettings,
|
|
31
|
-
TableManifestConfiguration,
|
|
32
|
-
TableManifestSettingsConfiguration,
|
|
33
|
-
TemplateType,
|
|
34
|
-
VariantManagementType,
|
|
35
|
-
ViewPathConfiguration,
|
|
36
|
-
VisualizationType
|
|
37
|
-
} from "../../ManifestSettings";
|
|
38
|
-
import { EntityType, Property, TypeDefinition } from "@sap-ux/annotation-converter";
|
|
39
|
-
import { TableID } from "../../helpers/ID";
|
|
40
|
-
import {
|
|
41
|
-
AnnotationAction,
|
|
42
|
-
BaseAction,
|
|
43
|
-
CustomAction,
|
|
44
|
-
getActionsFromManifest,
|
|
45
|
-
isActionNavigable,
|
|
46
|
-
removeDuplicateActions
|
|
47
|
-
} from "sap/fe/core/converters/controls/Common/Action";
|
|
48
|
-
import { ConfigurableObject, CustomElement, insertCustomElements, Placement } from "sap/fe/core/converters/helpers/ConfigurableObject";
|
|
22
|
+
import { FilterFunctions } from "@sap-ux/vocabularies-types/dist/generated/Capabilities";
|
|
23
|
+
import { CommonAnnotationTerms } from "@sap-ux/vocabularies-types/dist/generated/Common";
|
|
24
|
+
import { SemanticKey } from "@sap-ux/vocabularies-types/types/generated/Common";
|
|
49
25
|
import {
|
|
50
26
|
collectRelatedProperties,
|
|
51
27
|
collectRelatedPropertiesRecursively,
|
|
@@ -56,6 +32,20 @@ import {
|
|
|
56
32
|
isDataFieldForActionAbstract,
|
|
57
33
|
isDataFieldTypes
|
|
58
34
|
} from "sap/fe/core/converters/annotations/DataField";
|
|
35
|
+
import {
|
|
36
|
+
AnnotationAction,
|
|
37
|
+
BaseAction,
|
|
38
|
+
CustomAction,
|
|
39
|
+
getActionsFromManifest,
|
|
40
|
+
isActionNavigable,
|
|
41
|
+
removeDuplicateActions
|
|
42
|
+
} from "sap/fe/core/converters/controls/Common/Action";
|
|
43
|
+
import { bindingContextPathVisitor, Entity, UI } from "sap/fe/core/converters/helpers/BindingHelper";
|
|
44
|
+
import { ConfigurableObject, CustomElement, insertCustomElements, Placement } from "sap/fe/core/converters/helpers/ConfigurableObject";
|
|
45
|
+
import { IssueCategory, IssueCategoryType, IssueSeverity, IssueType } from "sap/fe/core/converters/helpers/IssueManager";
|
|
46
|
+
import { KeyHelper } from "sap/fe/core/converters/helpers/Key";
|
|
47
|
+
import tableFormatters from "sap/fe/core/formatters/TableFormatter";
|
|
48
|
+
import { MessageType } from "sap/fe/core/formatters/TableFormatterTypes";
|
|
59
49
|
import {
|
|
60
50
|
and,
|
|
61
51
|
annotationExpression,
|
|
@@ -74,10 +64,7 @@ import {
|
|
|
74
64
|
or,
|
|
75
65
|
resolveBindingString
|
|
76
66
|
} from "sap/fe/core/helpers/BindingExpression";
|
|
77
|
-
import {
|
|
78
|
-
import { KeyHelper } from "sap/fe/core/converters/helpers/Key";
|
|
79
|
-
import tableFormatters from "sap/fe/core/formatters/TableFormatter";
|
|
80
|
-
import { MessageType } from "sap/fe/core/formatters/TableFormatterTypes";
|
|
67
|
+
import { replaceSpecialChars } from "sap/fe/core/helpers/StableIdHelper";
|
|
81
68
|
import {
|
|
82
69
|
DataModelObjectPath,
|
|
83
70
|
getTargetObjectPath,
|
|
@@ -85,38 +72,54 @@ import {
|
|
|
85
72
|
isPathSearchable,
|
|
86
73
|
isPathUpdatable
|
|
87
74
|
} from "sap/fe/core/templating/DataModelPathHelper";
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
|
|
91
|
-
import ManifestWrapper from "../../ManifestWrapper";
|
|
92
|
-
import ConverterContext from "../../ConverterContext";
|
|
75
|
+
import { DisplayMode, EDM_TYPE_MAPPING, getDisplayMode } from "sap/fe/core/templating/DisplayModeFormatter";
|
|
76
|
+
import { getNonSortablePropertiesRestrictions } from "sap/fe/core/templating/EntitySetHelper";
|
|
93
77
|
import {
|
|
94
|
-
isProperty,
|
|
95
|
-
getAssociatedUnitProperty,
|
|
96
78
|
getAssociatedCurrencyProperty,
|
|
79
|
+
getAssociatedUnitProperty,
|
|
80
|
+
getTargetValueOnDataPoint,
|
|
97
81
|
isPathExpression,
|
|
98
|
-
|
|
82
|
+
isProperty
|
|
99
83
|
} from "sap/fe/core/templating/PropertyHelper";
|
|
84
|
+
import ConverterContext from "../../ConverterContext";
|
|
100
85
|
import { AggregationHelper } from "../../helpers/Aggregation";
|
|
101
|
-
import {
|
|
86
|
+
import { TableID } from "../../helpers/ID";
|
|
87
|
+
import {
|
|
88
|
+
ActionType,
|
|
89
|
+
AvailabilityType,
|
|
90
|
+
CreationMode,
|
|
91
|
+
FormatOptionsType,
|
|
92
|
+
HorizontalAlign,
|
|
93
|
+
Importance,
|
|
94
|
+
ManifestTableColumn,
|
|
95
|
+
NavigationSettingsConfiguration,
|
|
96
|
+
NavigationTargetConfiguration,
|
|
97
|
+
SelectionMode,
|
|
98
|
+
TableColumnSettings,
|
|
99
|
+
TableManifestConfiguration,
|
|
100
|
+
TableManifestSettingsConfiguration,
|
|
101
|
+
TemplateType,
|
|
102
|
+
VariantManagementType,
|
|
103
|
+
ViewPathConfiguration,
|
|
104
|
+
VisualizationType
|
|
105
|
+
} from "../../ManifestSettings";
|
|
106
|
+
import ManifestWrapper from "../../ManifestWrapper";
|
|
102
107
|
import { getMessageTypeFromCriticalityType } from "./Criticality";
|
|
103
|
-
import { FilterFunctions } from "@sap-ux/vocabularies-types/dist/generated/Capabilities";
|
|
104
|
-
import { getNonSortablePropertiesRestrictions } from "sap/fe/core/templating/EntitySetHelper";
|
|
105
108
|
import {
|
|
106
109
|
generateStandardActionsContext,
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
getCreateVisibility,
|
|
111
|
+
getCreationRow,
|
|
109
112
|
getDeleteVisibility,
|
|
113
|
+
getInsertUpdateActionsTemplating,
|
|
114
|
+
getMassEditVisibility,
|
|
115
|
+
getRestrictions,
|
|
110
116
|
getStandardActionCreate,
|
|
111
117
|
getStandardActionDelete,
|
|
112
|
-
getStandardActionPaste,
|
|
113
118
|
getStandardActionMassEdit,
|
|
119
|
+
getStandardActionPaste,
|
|
114
120
|
isDraftOrStickySupported,
|
|
115
|
-
getInsertUpdateActionsTemplating,
|
|
116
|
-
getCreateVisibility,
|
|
117
121
|
isInDisplayMode,
|
|
118
|
-
|
|
119
|
-
getRestrictions
|
|
122
|
+
StandardActionConfigType
|
|
120
123
|
} from "./table/StandardActions";
|
|
121
124
|
|
|
122
125
|
export type TableAnnotationConfiguration = {
|
|
@@ -147,7 +150,7 @@ export type TableAnnotationConfiguration = {
|
|
|
147
150
|
aggregateConditions?: string;
|
|
148
151
|
|
|
149
152
|
/** Create new entries */
|
|
150
|
-
create:
|
|
153
|
+
create: CreateBehavior | CreateBehaviorExternal;
|
|
151
154
|
title: string;
|
|
152
155
|
searchable: boolean;
|
|
153
156
|
};
|
|
@@ -155,9 +158,9 @@ export type TableAnnotationConfiguration = {
|
|
|
155
158
|
/**
|
|
156
159
|
* New entries are created within the app (default case)
|
|
157
160
|
*/
|
|
158
|
-
type
|
|
161
|
+
type CreateBehavior = {
|
|
159
162
|
mode: CreationMode;
|
|
160
|
-
append:
|
|
163
|
+
append: boolean;
|
|
161
164
|
newAction?: string;
|
|
162
165
|
navigateToTarget?: string;
|
|
163
166
|
};
|
|
@@ -165,7 +168,7 @@ type CreateBehaviour = {
|
|
|
165
168
|
/**
|
|
166
169
|
* New entries are created by navigating to some target
|
|
167
170
|
*/
|
|
168
|
-
type
|
|
171
|
+
type CreateBehaviorExternal = {
|
|
169
172
|
mode: "External";
|
|
170
173
|
outbound: string;
|
|
171
174
|
outboundDetail: NavigationTargetConfiguration["outboundDetail"];
|
|
@@ -235,6 +238,7 @@ export type BaseTableColumn = ConfigurableObject & {
|
|
|
235
238
|
sortable: boolean;
|
|
236
239
|
horizontalAlign?: HorizontalAlign;
|
|
237
240
|
formatOptions: FormatOptionsType;
|
|
241
|
+
importance: string;
|
|
238
242
|
};
|
|
239
243
|
|
|
240
244
|
export type CustomTableColumn = BaseTableColumn & {
|
|
@@ -267,6 +271,8 @@ export type AnnotationTableColumn = BaseTableColumn & {
|
|
|
267
271
|
delimiter?: boolean;
|
|
268
272
|
trueValue?: boolean;
|
|
269
273
|
falseValue?: boolean;
|
|
274
|
+
unit?: string;
|
|
275
|
+
unitProperty?: string;
|
|
270
276
|
};
|
|
271
277
|
isDataPointFakeTargetProperty?: boolean;
|
|
272
278
|
textArrangement?: {
|
|
@@ -290,7 +296,7 @@ export type WidthCalculation = null | {
|
|
|
290
296
|
includeLabel?: boolean;
|
|
291
297
|
gap?: number;
|
|
292
298
|
// only relevant for complex types
|
|
293
|
-
excludeProperties?: string
|
|
299
|
+
excludeProperties?: string[];
|
|
294
300
|
verticalArrangement?: boolean;
|
|
295
301
|
};
|
|
296
302
|
|
|
@@ -388,6 +394,7 @@ export function getTableColumns(
|
|
|
388
394
|
|
|
389
395
|
return insertCustomElements(annotationColumns, manifestColumns, {
|
|
390
396
|
width: "overwrite",
|
|
397
|
+
importance: "overwrite",
|
|
391
398
|
isNavigable: "overwrite",
|
|
392
399
|
availability: "overwrite",
|
|
393
400
|
settings: "overwrite",
|
|
@@ -404,7 +411,7 @@ export function getTableColumns(
|
|
|
404
411
|
* @param converterContext The converter context.
|
|
405
412
|
* @returns The aggregate definitions from the entityType, or undefined if the entity doesn't support analytical queries.
|
|
406
413
|
*/
|
|
407
|
-
export const getAggregateDefinitionsFromEntityType = function(
|
|
414
|
+
export const getAggregateDefinitionsFromEntityType = function (
|
|
408
415
|
entityType: EntityType,
|
|
409
416
|
tableColumns: TableColumn[],
|
|
410
417
|
converterContext: ConverterContext
|
|
@@ -412,7 +419,7 @@ export const getAggregateDefinitionsFromEntityType = function(
|
|
|
412
419
|
const aggregationHelper = new AggregationHelper(entityType, converterContext);
|
|
413
420
|
|
|
414
421
|
function findColumnFromPath(path: string): TableColumn | undefined {
|
|
415
|
-
return tableColumns.find(column => {
|
|
422
|
+
return tableColumns.find((column) => {
|
|
416
423
|
const annotationColumn = column as AnnotationTableColumn;
|
|
417
424
|
return annotationColumn.propertyInfos === undefined && annotationColumn.relativePath === path;
|
|
418
425
|
});
|
|
@@ -425,7 +432,7 @@ export const getAggregateDefinitionsFromEntityType = function(
|
|
|
425
432
|
// Keep a set of all currency/unit properties, as we don't want to consider them as aggregates
|
|
426
433
|
// They are aggregates for technical reasons (to manage multi-units situations) but it doesn't make sense from a user standpoint
|
|
427
434
|
const mCurrencyOrUnitProperties = new Set();
|
|
428
|
-
tableColumns.forEach(oColumn => {
|
|
435
|
+
tableColumns.forEach((oColumn) => {
|
|
429
436
|
const oTableColumn = oColumn as AnnotationTableColumn;
|
|
430
437
|
if (oTableColumn.unit) {
|
|
431
438
|
mCurrencyOrUnitProperties.add(oTableColumn.unit);
|
|
@@ -435,15 +442,15 @@ export const getAggregateDefinitionsFromEntityType = function(
|
|
|
435
442
|
const aCustomAggregateAnnotations = aggregationHelper.getCustomAggregateDefinitions();
|
|
436
443
|
const mRawDefinitions: Record<string, string[]> = {};
|
|
437
444
|
|
|
438
|
-
aCustomAggregateAnnotations.forEach(annotation => {
|
|
439
|
-
const oAggregatedProperty = aggregationHelper._entityType.entityProperties.find(oProperty => {
|
|
445
|
+
aCustomAggregateAnnotations.forEach((annotation) => {
|
|
446
|
+
const oAggregatedProperty = aggregationHelper._entityType.entityProperties.find((oProperty) => {
|
|
440
447
|
return oProperty.name === annotation.qualifier;
|
|
441
448
|
});
|
|
442
449
|
|
|
443
450
|
if (oAggregatedProperty) {
|
|
444
451
|
const aContextDefiningProperties = annotation.annotations?.Aggregation?.ContextDefiningProperties;
|
|
445
452
|
mRawDefinitions[oAggregatedProperty.name] = aContextDefiningProperties
|
|
446
|
-
? aContextDefiningProperties.map(oCtxDefProperty => {
|
|
453
|
+
? aContextDefiningProperties.map((oCtxDefProperty) => {
|
|
447
454
|
return oCtxDefProperty.value;
|
|
448
455
|
})
|
|
449
456
|
: [];
|
|
@@ -451,7 +458,7 @@ export const getAggregateDefinitionsFromEntityType = function(
|
|
|
451
458
|
});
|
|
452
459
|
const mResult: Record<string, AggregateData> = {};
|
|
453
460
|
|
|
454
|
-
tableColumns.forEach(oColumn => {
|
|
461
|
+
tableColumns.forEach((oColumn) => {
|
|
455
462
|
const oTableColumn = oColumn as AnnotationTableColumn;
|
|
456
463
|
if (oTableColumn.propertyInfos === undefined && oTableColumn.relativePath) {
|
|
457
464
|
const aRawContextDefiningProperties = mRawDefinitions[oTableColumn.relativePath];
|
|
@@ -467,7 +474,7 @@ export const getAggregateDefinitionsFromEntityType = function(
|
|
|
467
474
|
relativePath: oTableColumn.relativePath
|
|
468
475
|
};
|
|
469
476
|
const aContextDefiningProperties: string[] = [];
|
|
470
|
-
aRawContextDefiningProperties.forEach(contextDefiningPropertyName => {
|
|
477
|
+
aRawContextDefiningProperties.forEach((contextDefiningPropertyName) => {
|
|
471
478
|
const oColumn = findColumnFromPath(contextDefiningPropertyName);
|
|
472
479
|
if (oColumn) {
|
|
473
480
|
aContextDefiningProperties.push(oColumn.name);
|
|
@@ -555,13 +562,13 @@ function getNavigationTargetPath(converterContext: ConverterContext, navigationP
|
|
|
555
562
|
*/
|
|
556
563
|
export function updateLinkedProperties(entityType: EntityType, tableColumns: TableColumn[]) {
|
|
557
564
|
function findColumnByPath(path: string): TableColumn | undefined {
|
|
558
|
-
return tableColumns.find(column => {
|
|
565
|
+
return tableColumns.find((column) => {
|
|
559
566
|
const annotationColumn = column as AnnotationTableColumn;
|
|
560
567
|
return annotationColumn.propertyInfos === undefined && annotationColumn.relativePath === path;
|
|
561
568
|
});
|
|
562
569
|
}
|
|
563
570
|
|
|
564
|
-
tableColumns.forEach(oColumn => {
|
|
571
|
+
tableColumns.forEach((oColumn) => {
|
|
565
572
|
const oTableColumn = oColumn as AnnotationTableColumn;
|
|
566
573
|
if (oTableColumn.propertyInfos === undefined && oTableColumn.relativePath) {
|
|
567
574
|
const oProperty = entityType.entityProperties.find((oProp: Property) => oProp.name === oTableColumn.relativePath);
|
|
@@ -671,14 +678,14 @@ export function createDefaultTableVisualization(converterContext: ConverterConte
|
|
|
671
678
|
*/
|
|
672
679
|
function getOperationAvailableMap(lineItemAnnotation: LineItem | undefined, converterContext: ConverterContext): Record<string, any> {
|
|
673
680
|
const operationAvailableMap: Record<string, any> = {};
|
|
674
|
-
const addToMap = function(key: string, value: any) {
|
|
681
|
+
const addToMap = function (key: string, value: any) {
|
|
675
682
|
if (key) {
|
|
676
683
|
operationAvailableMap[key] = value;
|
|
677
684
|
}
|
|
678
685
|
};
|
|
679
686
|
|
|
680
687
|
if (lineItemAnnotation) {
|
|
681
|
-
lineItemAnnotation.forEach(dataField => {
|
|
688
|
+
lineItemAnnotation.forEach((dataField) => {
|
|
682
689
|
if (dataField.$Type === UIAnnotationTypes.DataFieldForAction) {
|
|
683
690
|
const actionName = dataField.Action as string;
|
|
684
691
|
if (actionName?.indexOf("/") < 0 && !dataField.Determining) {
|
|
@@ -719,7 +726,7 @@ function getCurrentEntitySetUpdatablePath(converterContext: ConverterContext): s
|
|
|
719
726
|
const restrictions = getRestrictions(converterContext);
|
|
720
727
|
const entitySet = converterContext.getEntitySet();
|
|
721
728
|
const updatable = restrictions.isUpdatable;
|
|
722
|
-
const isOnlyDynamicOnCurrentEntity: any = updatable.
|
|
729
|
+
const isOnlyDynamicOnCurrentEntity: any = !isConstant(updatable.expression) && updatable.navigationExpression._type === "Unresolvable";
|
|
723
730
|
const updatablePropertyPath = (entitySet?.annotations.Capabilities?.UpdateRestrictions?.Updatable as any)?.path;
|
|
724
731
|
|
|
725
732
|
return isOnlyDynamicOnCurrentEntity ? (updatablePropertyPath as string) : "";
|
|
@@ -776,7 +783,7 @@ function getUIHiddenExpForActionsRequiringContext(
|
|
|
776
783
|
isEntitySet: boolean
|
|
777
784
|
): Expression<boolean>[] {
|
|
778
785
|
const aUiHiddenPathExpressions: Expression<boolean>[] = [];
|
|
779
|
-
lineItemAnnotation.forEach(dataField => {
|
|
786
|
+
lineItemAnnotation.forEach((dataField) => {
|
|
780
787
|
// Check if the lineItem context is the same as that of the action:
|
|
781
788
|
if (
|
|
782
789
|
(dataField.$Type === UIAnnotationTypes.DataFieldForAction &&
|
|
@@ -870,7 +877,7 @@ function getBindingExpFromContext(
|
|
|
870
877
|
* @returns {boolean} `true` if there is at least 1 action that meets the criteria
|
|
871
878
|
*/
|
|
872
879
|
function hasBoundActionsAlwaysVisibleInToolBar(lineItemAnnotation: LineItem, currentEntityType: EntityType): boolean {
|
|
873
|
-
return lineItemAnnotation.some(dataField => {
|
|
880
|
+
return lineItemAnnotation.some((dataField) => {
|
|
874
881
|
if (
|
|
875
882
|
(dataField.$Type === UIAnnotationTypes.DataFieldForAction ||
|
|
876
883
|
dataField.$Type === UIAnnotationTypes.DataFieldForIntentBasedNavigation) &&
|
|
@@ -889,7 +896,7 @@ function hasBoundActionsAlwaysVisibleInToolBar(lineItemAnnotation: LineItem, cur
|
|
|
889
896
|
}
|
|
890
897
|
|
|
891
898
|
function hasCustomActionsAlwaysVisibleInToolBar(manifestActions: Record<string, CustomAction>): boolean {
|
|
892
|
-
return Object.keys(manifestActions).some(actionKey => {
|
|
899
|
+
return Object.keys(manifestActions).some((actionKey) => {
|
|
893
900
|
const action = manifestActions[actionKey];
|
|
894
901
|
if (action.requiresSelection && action.visible?.toString() === "true") {
|
|
895
902
|
return true;
|
|
@@ -908,7 +915,7 @@ function hasCustomActionsAlwaysVisibleInToolBar(manifestActions: Record<string,
|
|
|
908
915
|
function getVisibleExpForCustomActionsRequiringContext(manifestActions: Record<string, CustomAction>): Expression<boolean>[] {
|
|
909
916
|
const aVisiblePathExpressions: Expression<boolean>[] = [];
|
|
910
917
|
if (manifestActions) {
|
|
911
|
-
Object.keys(manifestActions).forEach(actionKey => {
|
|
918
|
+
Object.keys(manifestActions).forEach((actionKey) => {
|
|
912
919
|
const action = manifestActions[actionKey];
|
|
913
920
|
if (action.requiresSelection === true && action.visible !== undefined) {
|
|
914
921
|
if (typeof action.visible === "string") {
|
|
@@ -966,7 +973,7 @@ export function getSelectionMode(
|
|
|
966
973
|
);
|
|
967
974
|
let isParentDeletable, parentEntitySetDeletable;
|
|
968
975
|
if (converterContext.getTemplateType() === TemplateType.ObjectPage) {
|
|
969
|
-
isParentDeletable = isPathDeletable(converterContext.getDataModelObjectPath()
|
|
976
|
+
isParentDeletable = isPathDeletable(converterContext.getDataModelObjectPath());
|
|
970
977
|
parentEntitySetDeletable = isParentDeletable ? compileBinding(isParentDeletable, true) : isParentDeletable;
|
|
971
978
|
}
|
|
972
979
|
|
|
@@ -976,7 +983,7 @@ export function getSelectionMode(
|
|
|
976
983
|
// Mass Edit in OP is enabled only in edit mode.
|
|
977
984
|
return compileBinding(
|
|
978
985
|
ifElse(
|
|
979
|
-
and(
|
|
986
|
+
and(UI.IsEditable, massEditVisibilityExpression),
|
|
980
987
|
constant("Multi"),
|
|
981
988
|
ifElse(deleteButtonVisibilityExpression, constant("Multi"), constant("None"))
|
|
982
989
|
)
|
|
@@ -1024,11 +1031,7 @@ export function getSelectionMode(
|
|
|
1024
1031
|
massEditVisibilityExpression
|
|
1025
1032
|
);
|
|
1026
1033
|
return compileBinding(
|
|
1027
|
-
ifElse(
|
|
1028
|
-
and(equal(bindingExpression("/editMode", "ui"), "Editable"), buttonVisibilityExpression),
|
|
1029
|
-
constant(selectionMode),
|
|
1030
|
-
constant(SelectionMode.None)
|
|
1031
|
-
)
|
|
1034
|
+
ifElse(and(UI.IsEditable, buttonVisibilityExpression), constant(selectionMode), constant(SelectionMode.None))
|
|
1032
1035
|
);
|
|
1033
1036
|
} else {
|
|
1034
1037
|
return SelectionMode.None;
|
|
@@ -1055,7 +1058,7 @@ export function getSelectionMode(
|
|
|
1055
1058
|
);
|
|
1056
1059
|
return compileBinding(
|
|
1057
1060
|
ifElse(
|
|
1058
|
-
and(
|
|
1061
|
+
and(UI.IsEditable, editModebuttonVisibilityExpression),
|
|
1059
1062
|
constant(selectionMode),
|
|
1060
1063
|
ifElse(
|
|
1061
1064
|
or(...aHiddenBindingExpressions.concat(aVisibleBindingExpressions)),
|
|
@@ -1218,10 +1221,10 @@ function _getCreationBehaviour(
|
|
|
1218
1221
|
const navigation = navigationSettings?.create || navigationSettings?.detail;
|
|
1219
1222
|
|
|
1220
1223
|
// cross-app
|
|
1221
|
-
if (
|
|
1224
|
+
if (navigation?.outbound && navigation.outboundDetail && navigationSettings?.create) {
|
|
1222
1225
|
return {
|
|
1223
1226
|
mode: "External",
|
|
1224
|
-
outbound: navigation.outbound
|
|
1227
|
+
outbound: navigation.outbound,
|
|
1225
1228
|
outboundDetail: navigation.outboundDetail,
|
|
1226
1229
|
navigationSettings: navigationSettings
|
|
1227
1230
|
};
|
|
@@ -1261,7 +1264,7 @@ function _getCreationBehaviour(
|
|
|
1261
1264
|
};
|
|
1262
1265
|
}
|
|
1263
1266
|
|
|
1264
|
-
const _getRowConfigurationProperty = function(
|
|
1267
|
+
const _getRowConfigurationProperty = function (
|
|
1265
1268
|
lineItemAnnotation: LineItem | undefined,
|
|
1266
1269
|
visualizationPath: string,
|
|
1267
1270
|
converterContext: ConverterContext,
|
|
@@ -1322,7 +1325,7 @@ const _getRowConfigurationProperty = function(
|
|
|
1322
1325
|
* @param tableType The table type.
|
|
1323
1326
|
* @returns {AnnotationTableColumn[]} The column from the entityType
|
|
1324
1327
|
*/
|
|
1325
|
-
export const getColumnsFromEntityType = function(
|
|
1328
|
+
export const getColumnsFromEntityType = function (
|
|
1326
1329
|
columnsToBeCreated: Record<string, Property>,
|
|
1327
1330
|
entityType: EntityType,
|
|
1328
1331
|
annotationColumns: AnnotationTableColumn[] = [],
|
|
@@ -1336,7 +1339,7 @@ export const getColumnsFromEntityType = function(
|
|
|
1336
1339
|
|
|
1337
1340
|
entityType.entityProperties.forEach((property: Property) => {
|
|
1338
1341
|
// Catch already existing columns - which were added before by LineItem Annotations
|
|
1339
|
-
const exists = annotationColumns.some(column => {
|
|
1342
|
+
const exists = annotationColumns.some((column) => {
|
|
1340
1343
|
return column.name === property.name;
|
|
1341
1344
|
});
|
|
1342
1345
|
|
|
@@ -1361,10 +1364,10 @@ export const getColumnsFromEntityType = function(
|
|
|
1361
1364
|
aggregationHelper,
|
|
1362
1365
|
converterContext
|
|
1363
1366
|
);
|
|
1364
|
-
const semanticKeys = converterContext.getAnnotationsByTerm("Common",
|
|
1367
|
+
const semanticKeys = converterContext.getAnnotationsByTerm("Common", CommonAnnotationTerms.SemanticKey, [
|
|
1365
1368
|
converterContext.getEntityType()
|
|
1366
1369
|
])[0];
|
|
1367
|
-
const oColumnDraftIndicator = getDefaultDraftIndicatorForColumn(columnInfo.name, semanticKeys);
|
|
1370
|
+
const oColumnDraftIndicator = getDefaultDraftIndicatorForColumn(columnInfo.name, semanticKeys, false, null);
|
|
1368
1371
|
if (Object.keys(oColumnDraftIndicator).length > 0) {
|
|
1369
1372
|
columnInfo.formatOptions = {
|
|
1370
1373
|
...oColumnDraftIndicator
|
|
@@ -1378,8 +1381,15 @@ export const getColumnsFromEntityType = function(
|
|
|
1378
1381
|
wrap: relatedPropertiesInfo.exportSettingsWrapping
|
|
1379
1382
|
};
|
|
1380
1383
|
|
|
1384
|
+
if (relatedPropertiesInfo.exportUnitName) {
|
|
1385
|
+
columnInfo.exportSettings.unitProperty = relatedPropertiesInfo.exportUnitName;
|
|
1386
|
+
columnInfo.exportSettings.type = "Currency"; // Force to a currency because there's a unitProperty (otherwise the value isn't properly formatted when exported)
|
|
1387
|
+
} else if (relatedPropertiesInfo.exportUnitString) {
|
|
1388
|
+
columnInfo.exportSettings.unit = relatedPropertiesInfo.exportUnitString;
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1381
1391
|
// Collect information of related columns to be created.
|
|
1382
|
-
relatedPropertyNames.forEach(name => {
|
|
1392
|
+
relatedPropertyNames.forEach((name) => {
|
|
1383
1393
|
columnsToBeCreated[name] = relatedPropertiesInfo.properties[name];
|
|
1384
1394
|
});
|
|
1385
1395
|
}
|
|
@@ -1387,7 +1397,7 @@ export const getColumnsFromEntityType = function(
|
|
|
1387
1397
|
if (additionalPropertyNames.length > 0) {
|
|
1388
1398
|
columnInfo.additionalPropertyInfos = additionalPropertyNames;
|
|
1389
1399
|
// Create columns for additional properties identified for ALP use case.
|
|
1390
|
-
additionalPropertyNames.forEach(name => {
|
|
1400
|
+
additionalPropertyNames.forEach((name) => {
|
|
1391
1401
|
// Intentional overwrite as we require only one new PropertyInfo for a related Property.
|
|
1392
1402
|
columnsToBeCreated[name] = relatedPropertiesInfo.additionalProperties[name];
|
|
1393
1403
|
});
|
|
@@ -1404,13 +1414,13 @@ export const getColumnsFromEntityType = function(
|
|
|
1404
1414
|
* @param {string} fullPropertyPath The full path to the target property
|
|
1405
1415
|
* @param {string} relativePath The relative path to the target property based on the context
|
|
1406
1416
|
* @param {boolean} useDataFieldPrefix Should be prefixed with "DataField::", else it will be prefixed with "Property::"
|
|
1407
|
-
* @param {boolean} availableForAdaptation Decides whether column should be available for adaptation
|
|
1408
|
-
* @param {string[]} nonSortableColumns The array of all non
|
|
1417
|
+
* @param {boolean} availableForAdaptation Decides whether the column should be available for adaptation
|
|
1418
|
+
* @param {string[]} nonSortableColumns The array of all non-sortable column names
|
|
1409
1419
|
* @param {AggregationHelper} aggregationHelper The aggregationHelper for the entity
|
|
1410
1420
|
* @param {ConverterContext} converterContext The converter context
|
|
1411
1421
|
* @returns {AnnotationTableColumn} The annotation column definition
|
|
1412
1422
|
*/
|
|
1413
|
-
const getColumnDefinitionFromProperty = function(
|
|
1423
|
+
const getColumnDefinitionFromProperty = function (
|
|
1414
1424
|
property: Property,
|
|
1415
1425
|
fullPropertyPath: string,
|
|
1416
1426
|
relativePath: string,
|
|
@@ -1431,6 +1441,9 @@ const getColumnDefinitionFromProperty = function(
|
|
|
1431
1441
|
const sDateInputFormat: string | undefined = property.type === "Edm.Date" ? "YYYY-MM-DD" : undefined;
|
|
1432
1442
|
const dataType: string | undefined = getDataFieldDataType(property);
|
|
1433
1443
|
const propertyTypeConfig = !isDataPointFakeProperty ? getTypeConfig(property, dataType) : undefined;
|
|
1444
|
+
const semanticKeys: SemanticKey = converterContext.getAnnotationsByTerm("Common", CommonAnnotationTerms.SemanticKey, [
|
|
1445
|
+
converterContext.getEntityType()
|
|
1446
|
+
])[0];
|
|
1434
1447
|
const oTypeConfig = !isDataPointFakeProperty
|
|
1435
1448
|
? {
|
|
1436
1449
|
className: property.type || dataType,
|
|
@@ -1438,7 +1451,7 @@ const getColumnDefinitionFromProperty = function(
|
|
|
1438
1451
|
oConstraints: propertyTypeConfig.constraints
|
|
1439
1452
|
}
|
|
1440
1453
|
: undefined;
|
|
1441
|
-
const exportSettings = isDataPointFakeProperty
|
|
1454
|
+
const exportSettings: any = isDataPointFakeProperty
|
|
1442
1455
|
? {
|
|
1443
1456
|
template: getTargetValueOnDataPoint(property)
|
|
1444
1457
|
}
|
|
@@ -1451,6 +1464,17 @@ const getColumnDefinitionFromProperty = function(
|
|
|
1451
1464
|
falseValue: property.type === "Edm.Boolean" ? "No" : undefined
|
|
1452
1465
|
};
|
|
1453
1466
|
|
|
1467
|
+
if (!isDataPointFakeProperty) {
|
|
1468
|
+
const oUnitProperty = getAssociatedCurrencyProperty(property) || getAssociatedUnitProperty(property);
|
|
1469
|
+
const sUnitText = property?.annotations?.Measures?.ISOCurrency || property?.annotations?.Measures?.Unit;
|
|
1470
|
+
if (oUnitProperty) {
|
|
1471
|
+
exportSettings.unitProperty = oUnitProperty.name;
|
|
1472
|
+
exportSettings.type = "Currency"; // Force to a currency because there's a unitProperty (otherwise the value isn't properly formatted when exported)
|
|
1473
|
+
} else if (sUnitText) {
|
|
1474
|
+
exportSettings.unit = `${sUnitText}`;
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1454
1478
|
const oColumn: any = {
|
|
1455
1479
|
key: key,
|
|
1456
1480
|
isGroupable: !isDataPointFakeProperty && !isHidden ? aggregationHelper.isPropertyGroupable(property) : false,
|
|
@@ -1473,7 +1497,8 @@ const getColumnDefinitionFromProperty = function(
|
|
|
1473
1497
|
exportSettings: exportSettings,
|
|
1474
1498
|
caseSensitive: isFilteringCaseSensitive(converterContext),
|
|
1475
1499
|
typeConfig: oTypeConfig,
|
|
1476
|
-
visualSettings: isDataPointFakeProperty ? { widthCalculation: null } : undefined
|
|
1500
|
+
visualSettings: isDataPointFakeProperty ? { widthCalculation: null } : undefined,
|
|
1501
|
+
importance: getImportance((property as any).annotations?.UI?.DataFieldDefault, semanticKeys)
|
|
1477
1502
|
};
|
|
1478
1503
|
const sTooltip = _getTooltip(property);
|
|
1479
1504
|
if (sTooltip) {
|
|
@@ -1490,14 +1515,13 @@ const getColumnDefinitionFromProperty = function(
|
|
|
1490
1515
|
* @returns {boolean} True for valid columns, false for invalid columns
|
|
1491
1516
|
* @private
|
|
1492
1517
|
*/
|
|
1493
|
-
const _isValidColumn = function(dataField: DataFieldAbstractTypes) {
|
|
1518
|
+
const _isValidColumn = function (dataField: DataFieldAbstractTypes) {
|
|
1494
1519
|
switch (dataField.$Type) {
|
|
1495
1520
|
case UIAnnotationTypes.DataFieldForAction:
|
|
1496
1521
|
case UIAnnotationTypes.DataFieldForIntentBasedNavigation:
|
|
1497
1522
|
return !!dataField.Inline;
|
|
1498
1523
|
case UIAnnotationTypes.DataFieldWithAction:
|
|
1499
1524
|
case UIAnnotationTypes.DataFieldWithIntentBasedNavigation:
|
|
1500
|
-
return false;
|
|
1501
1525
|
case UIAnnotationTypes.DataField:
|
|
1502
1526
|
case UIAnnotationTypes.DataFieldWithUrl:
|
|
1503
1527
|
case UIAnnotationTypes.DataFieldForAnnotation:
|
|
@@ -1515,11 +1539,12 @@ const _isValidColumn = function(dataField: DataFieldAbstractTypes) {
|
|
|
1515
1539
|
* SAP Fiori elements will evaluate either the UI.Hidden annotation defined on the annotation itself or on the target property.
|
|
1516
1540
|
*
|
|
1517
1541
|
* @param {DataModelObjectPath} dataFieldModelPath The metapath referring to the annotation that is evaluated by SAP Fiori elements.
|
|
1518
|
-
* @param {
|
|
1542
|
+
* @param {object} [formatOptions] FormatOptions optional.
|
|
1543
|
+
* @param {boolean} formatOptions.isAnalytics This flag is used to check if the analytic table has GroupHeader expanded.
|
|
1519
1544
|
* @param {boolean} [returnExpression] ReturnExpression optional.
|
|
1520
1545
|
* @returns {BindingExpression<string>} An expression that you can bind to the UI.
|
|
1521
1546
|
*/
|
|
1522
|
-
export const _getVisibleExpression = function(
|
|
1547
|
+
export const _getVisibleExpression = function (
|
|
1523
1548
|
dataFieldModelPath: DataModelObjectPath,
|
|
1524
1549
|
formatOptions?: any,
|
|
1525
1550
|
returnExpression: boolean = false
|
|
@@ -1562,17 +1587,18 @@ export const _getVisibleExpression = function(
|
|
|
1562
1587
|
or(not(isAnalyticalGroupHeaderExpanded), isAnalyticalLeaf)
|
|
1563
1588
|
]
|
|
1564
1589
|
);
|
|
1565
|
-
return returnExpression ? (expression as BindingExpression<string>) : compileBinding(expression);
|
|
1590
|
+
return returnExpression ? (expression as any as BindingExpression<string>) : compileBinding(expression);
|
|
1566
1591
|
};
|
|
1567
1592
|
|
|
1568
1593
|
/**
|
|
1569
1594
|
* Returns hidden binding expressions for a field group.
|
|
1570
1595
|
* @param {DataFieldAbstractTypes} dataFieldGroup DataField defined in the annotations
|
|
1571
|
-
* @param {
|
|
1596
|
+
* @param {object} fieldFormatOptions FormatOptions optional.
|
|
1597
|
+
* @param {boolean} fieldFormatOptions.isAnalytics This flag is used to check if the analytic table has GroupHeader expanded.
|
|
1572
1598
|
* @returns {BindingExpression<string>} Compile binding of field group expressions.
|
|
1573
1599
|
* @private
|
|
1574
1600
|
*/
|
|
1575
|
-
const _getFieldGroupHiddenExpressions = function(
|
|
1601
|
+
const _getFieldGroupHiddenExpressions = function (
|
|
1576
1602
|
dataFieldGroup: DataFieldAbstractTypes,
|
|
1577
1603
|
fieldFormatOptions: any
|
|
1578
1604
|
): BindingExpression<string> | undefined {
|
|
@@ -1587,7 +1613,7 @@ const _getFieldGroupHiddenExpressions = function(
|
|
|
1587
1613
|
);
|
|
1588
1614
|
});
|
|
1589
1615
|
return compileBinding(
|
|
1590
|
-
ifElse(or(...(aFieldGroupHiddenExpressions as ExpressionOrPrimitive<boolean>[])), constant(true), constant(false))
|
|
1616
|
+
ifElse(or(...(aFieldGroupHiddenExpressions as any as ExpressionOrPrimitive<boolean>[])), constant(true), constant(false))
|
|
1591
1617
|
);
|
|
1592
1618
|
} else {
|
|
1593
1619
|
return undefined;
|
|
@@ -1601,7 +1627,7 @@ const _getFieldGroupHiddenExpressions = function(
|
|
|
1601
1627
|
* @returns {string} Label of the property or DataField
|
|
1602
1628
|
* @private
|
|
1603
1629
|
*/
|
|
1604
|
-
const _getLabel = function(property: DataFieldAbstractTypes | Property, isGroup: boolean = false): string | undefined {
|
|
1630
|
+
const _getLabel = function (property: DataFieldAbstractTypes | Property, isGroup: boolean = false): string | undefined {
|
|
1605
1631
|
if (!property) {
|
|
1606
1632
|
return undefined;
|
|
1607
1633
|
}
|
|
@@ -1631,7 +1657,7 @@ const _getLabel = function(property: DataFieldAbstractTypes | Property, isGroup:
|
|
|
1631
1657
|
}
|
|
1632
1658
|
};
|
|
1633
1659
|
|
|
1634
|
-
const _getTooltip = function(source: DataFieldAbstractTypes | Property): string | undefined {
|
|
1660
|
+
const _getTooltip = function (source: DataFieldAbstractTypes | Property): string | undefined {
|
|
1635
1661
|
if (!source) {
|
|
1636
1662
|
return undefined;
|
|
1637
1663
|
}
|
|
@@ -1653,7 +1679,12 @@ const _getTooltip = function(source: DataFieldAbstractTypes | Property): string
|
|
|
1653
1679
|
return undefined;
|
|
1654
1680
|
}
|
|
1655
1681
|
};
|
|
1656
|
-
|
|
1682
|
+
export function getRowStatusVisibility(): Expression<boolean> {
|
|
1683
|
+
return formatResult(
|
|
1684
|
+
[bindingExpression(`semanticKeyHasDraftIndicator`, "internal"), bindingExpression(`filteredMessages`, "internal")],
|
|
1685
|
+
tableFormatters.getErrorStatusTextVisibilityFormatter
|
|
1686
|
+
);
|
|
1687
|
+
}
|
|
1657
1688
|
/**
|
|
1658
1689
|
* Creates a PropertyInfo for each identified property consumed by a LineItem.
|
|
1659
1690
|
*
|
|
@@ -1664,7 +1695,7 @@ const _getTooltip = function(source: DataFieldAbstractTypes | Property): string
|
|
|
1664
1695
|
* @param entityType The entity type for the LineItem
|
|
1665
1696
|
* @returns {AnnotationTableColumn[]} The array of columns created.
|
|
1666
1697
|
*/
|
|
1667
|
-
const _createRelatedColumns = function(
|
|
1698
|
+
const _createRelatedColumns = function (
|
|
1668
1699
|
columnsToBeCreated: Record<string, Property>,
|
|
1669
1700
|
existingColumns: AnnotationTableColumn[],
|
|
1670
1701
|
nonSortableColumns: string[],
|
|
@@ -1675,11 +1706,11 @@ const _createRelatedColumns = function(
|
|
|
1675
1706
|
const relatedPropertyNameMap: Record<string, string> = {};
|
|
1676
1707
|
const aggregationHelper = new AggregationHelper(entityType, converterContext);
|
|
1677
1708
|
|
|
1678
|
-
Object.keys(columnsToBeCreated).forEach(name => {
|
|
1709
|
+
Object.keys(columnsToBeCreated).forEach((name) => {
|
|
1679
1710
|
const property = columnsToBeCreated[name],
|
|
1680
1711
|
annotationPath = converterContext.getAbsoluteAnnotationPath(name),
|
|
1681
1712
|
// Check whether the related column already exists.
|
|
1682
|
-
relatedColumn = existingColumns.find(column => column.name === name);
|
|
1713
|
+
relatedColumn = existingColumns.find((column) => column.name === name);
|
|
1683
1714
|
if (relatedColumn === undefined) {
|
|
1684
1715
|
// Case 1: Key contains DataField prefix to ensure all property columns have the same key format.
|
|
1685
1716
|
// New created property column is set to hidden.
|
|
@@ -1706,7 +1737,7 @@ const _createRelatedColumns = function(
|
|
|
1706
1737
|
const newName = "Property::" + name;
|
|
1707
1738
|
|
|
1708
1739
|
// Checking whether the related property column has already been created in a previous iteration.
|
|
1709
|
-
if (!existingColumns.some(column => column.name === newName)) {
|
|
1740
|
+
if (!existingColumns.some((column) => column.name === newName)) {
|
|
1710
1741
|
// Create a new property column with 'Property::' prefix,
|
|
1711
1742
|
// Set it to hidden as it is only consumed by Complex property infos.
|
|
1712
1743
|
relatedColumns.push(
|
|
@@ -1728,10 +1759,10 @@ const _createRelatedColumns = function(
|
|
|
1728
1759
|
|
|
1729
1760
|
// The property 'name' has been prefixed with 'Property::' for uniqueness.
|
|
1730
1761
|
// Update the same in other propertyInfos[] references which point to this property.
|
|
1731
|
-
existingColumns.forEach(column => {
|
|
1732
|
-
column.propertyInfos = column.propertyInfos?.map(propertyInfo => relatedPropertyNameMap[propertyInfo] ?? propertyInfo);
|
|
1762
|
+
existingColumns.forEach((column) => {
|
|
1763
|
+
column.propertyInfos = column.propertyInfos?.map((propertyInfo) => relatedPropertyNameMap[propertyInfo] ?? propertyInfo);
|
|
1733
1764
|
column.additionalPropertyInfos = column.additionalPropertyInfos?.map(
|
|
1734
|
-
propertyInfo => relatedPropertyNameMap[propertyInfo] ?? propertyInfo
|
|
1765
|
+
(propertyInfo) => relatedPropertyNameMap[propertyInfo] ?? propertyInfo
|
|
1735
1766
|
);
|
|
1736
1767
|
});
|
|
1737
1768
|
|
|
@@ -1747,7 +1778,7 @@ const _createRelatedColumns = function(
|
|
|
1747
1778
|
* @returns {string} The name of annotation columns
|
|
1748
1779
|
* @private
|
|
1749
1780
|
*/
|
|
1750
|
-
const _getAnnotationColumnName = function(dataField: DataFieldAbstractTypes) {
|
|
1781
|
+
const _getAnnotationColumnName = function (dataField: DataFieldAbstractTypes) {
|
|
1751
1782
|
// This is needed as we have flexibility changes already that we have to check against
|
|
1752
1783
|
if (isDataFieldTypes(dataField)) {
|
|
1753
1784
|
return dataField.Value?.path;
|
|
@@ -1767,12 +1798,12 @@ const _getAnnotationColumnName = function(dataField: DataFieldAbstractTypes) {
|
|
|
1767
1798
|
* @returns {boolean} `showDataFieldsLabel` value from the manifest
|
|
1768
1799
|
* @private
|
|
1769
1800
|
*/
|
|
1770
|
-
const _getShowDataFieldsLabel = function(fieldGroupName: string, visualizationPath: string, converterContext: ConverterContext): boolean {
|
|
1801
|
+
const _getShowDataFieldsLabel = function (fieldGroupName: string, visualizationPath: string, converterContext: ConverterContext): boolean {
|
|
1771
1802
|
const oColumns = converterContext.getManifestControlConfiguration(visualizationPath)?.columns;
|
|
1772
1803
|
const aColumnKeys = oColumns && Object.keys(oColumns);
|
|
1773
1804
|
return (
|
|
1774
1805
|
aColumnKeys &&
|
|
1775
|
-
!!aColumnKeys.find(function(key: string) {
|
|
1806
|
+
!!aColumnKeys.find(function (key: string) {
|
|
1776
1807
|
return key === fieldGroupName && oColumns[key].showDataFieldsLabel;
|
|
1777
1808
|
})
|
|
1778
1809
|
);
|
|
@@ -1783,13 +1814,15 @@ const _getShowDataFieldsLabel = function(fieldGroupName: string, visualizationPa
|
|
|
1783
1814
|
* @param dataField The `DataField` being processed.
|
|
1784
1815
|
* @returns {string} The relative path
|
|
1785
1816
|
*/
|
|
1786
|
-
const _getRelativePath = function(dataField: DataFieldAbstractTypes): string {
|
|
1817
|
+
const _getRelativePath = function (dataField: DataFieldAbstractTypes): string {
|
|
1787
1818
|
let relativePath: string = "";
|
|
1788
1819
|
|
|
1789
1820
|
switch (dataField.$Type) {
|
|
1790
1821
|
case UIAnnotationTypes.DataField:
|
|
1791
1822
|
case UIAnnotationTypes.DataFieldWithNavigationPath:
|
|
1792
1823
|
case UIAnnotationTypes.DataFieldWithUrl:
|
|
1824
|
+
case UIAnnotationTypes.DataFieldWithIntentBasedNavigation:
|
|
1825
|
+
case UIAnnotationTypes.DataFieldWithAction:
|
|
1793
1826
|
relativePath = (dataField as DataField)?.Value?.path;
|
|
1794
1827
|
break;
|
|
1795
1828
|
|
|
@@ -1806,7 +1839,7 @@ const _getRelativePath = function(dataField: DataFieldAbstractTypes): string {
|
|
|
1806
1839
|
return relativePath;
|
|
1807
1840
|
};
|
|
1808
1841
|
|
|
1809
|
-
const _sliceAtSlash = function(path: string, isLastSlash: boolean, isLastPart: boolean) {
|
|
1842
|
+
const _sliceAtSlash = function (path: string, isLastSlash: boolean, isLastPart: boolean) {
|
|
1810
1843
|
const iSlashIndex = isLastSlash ? path.lastIndexOf("/") : path.indexOf("/");
|
|
1811
1844
|
|
|
1812
1845
|
if (iSlashIndex === -1) {
|
|
@@ -1823,7 +1856,7 @@ const _sliceAtSlash = function(path: string, isLastSlash: boolean, isLastPart: b
|
|
|
1823
1856
|
* @param nonSortableColumns Collection of non-sortable column names as per annotation
|
|
1824
1857
|
* @returns {boolean} True if the column is sortable
|
|
1825
1858
|
*/
|
|
1826
|
-
const _isColumnSortable = function(dataField: DataFieldAbstractTypes, propertyPath: string, nonSortableColumns: string[]): boolean {
|
|
1859
|
+
const _isColumnSortable = function (dataField: DataFieldAbstractTypes, propertyPath: string, nonSortableColumns: string[]): boolean {
|
|
1827
1860
|
let isSortable: boolean = false;
|
|
1828
1861
|
if (nonSortableColumns.indexOf(propertyPath) === -1) {
|
|
1829
1862
|
// Column is not marked as non-sortable via annotation
|
|
@@ -1849,7 +1882,7 @@ const _isColumnSortable = function(dataField: DataFieldAbstractTypes, propertyPa
|
|
|
1849
1882
|
* @param {ConverterContext} converterContext The instance of the converter context
|
|
1850
1883
|
* @returns {boolean} Returns 'false' if FilterFunctions annotation supports 'tolower', else 'true'
|
|
1851
1884
|
*/
|
|
1852
|
-
export const isFilteringCaseSensitive = function(converterContext: ConverterContext): boolean {
|
|
1885
|
+
export const isFilteringCaseSensitive = function (converterContext: ConverterContext): boolean {
|
|
1853
1886
|
const filterFunctions: FilterFunctions | undefined =
|
|
1854
1887
|
converterContext.getEntitySet()?.annotations?.Capabilities?.FilterFunctions ||
|
|
1855
1888
|
converterContext.getEntityContainer().annotations?.Capabilities?.FilterFunctions;
|
|
@@ -1867,34 +1900,197 @@ function getDefaultFormatOptionsForTable(): FormatOptionsType {
|
|
|
1867
1900
|
};
|
|
1868
1901
|
}
|
|
1869
1902
|
|
|
1903
|
+
function _findSemanticKeyValues(semanticKeys: any[], name: string): any {
|
|
1904
|
+
const aSemanticKeyValues: string[] = [];
|
|
1905
|
+
let bSemanticKeyFound = false;
|
|
1906
|
+
for (let i = 0; i < semanticKeys.length; i++) {
|
|
1907
|
+
aSemanticKeyValues.push(semanticKeys[i].value);
|
|
1908
|
+
if (semanticKeys[i].value === name) {
|
|
1909
|
+
bSemanticKeyFound = true;
|
|
1910
|
+
}
|
|
1911
|
+
}
|
|
1912
|
+
return {
|
|
1913
|
+
values: aSemanticKeyValues,
|
|
1914
|
+
semanticKeyFound: bSemanticKeyFound
|
|
1915
|
+
};
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
function _findProperties(semanticKeyValues: any[], fieldGroupProperties: any[]) {
|
|
1919
|
+
let semanticKeyHasPropertyInFieldGroup = false;
|
|
1920
|
+
let sPropertyPath;
|
|
1921
|
+
if (semanticKeyValues && semanticKeyValues.length >= 1 && fieldGroupProperties && fieldGroupProperties.length >= 1) {
|
|
1922
|
+
for (let i = 0; i < semanticKeyValues.length; i++) {
|
|
1923
|
+
if ([semanticKeyValues[i]].some((tmp) => fieldGroupProperties.indexOf(tmp) >= 0)) {
|
|
1924
|
+
semanticKeyHasPropertyInFieldGroup = true;
|
|
1925
|
+
sPropertyPath = semanticKeyValues[i];
|
|
1926
|
+
break;
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
return {
|
|
1931
|
+
semanticKeyHasPropertyInFieldGroup: semanticKeyHasPropertyInFieldGroup,
|
|
1932
|
+
fieldGroupPropertyPath: sPropertyPath
|
|
1933
|
+
};
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
function _findSemanticKeyValuesInFieldGroup(dataFieldGroup: DataFieldAbstractTypes | null, semanticKeyValues: []): any {
|
|
1937
|
+
const aProperties: any[] = [];
|
|
1938
|
+
let _propertiesFound: { semanticKeyHasPropertyInFieldGroup: boolean; fieldGroupPropertyPath: any } = {
|
|
1939
|
+
semanticKeyHasPropertyInFieldGroup: false,
|
|
1940
|
+
fieldGroupPropertyPath: undefined
|
|
1941
|
+
};
|
|
1942
|
+
if (
|
|
1943
|
+
dataFieldGroup &&
|
|
1944
|
+
dataFieldGroup.$Type === UIAnnotationTypes.DataFieldForAnnotation &&
|
|
1945
|
+
dataFieldGroup.Target?.$target?.$Type === UIAnnotationTypes.FieldGroupType
|
|
1946
|
+
) {
|
|
1947
|
+
dataFieldGroup.Target.$target.Data?.forEach((innerDataField: DataFieldAbstractTypes) => {
|
|
1948
|
+
if (
|
|
1949
|
+
(innerDataField.$Type === UIAnnotationTypes.DataField || innerDataField.$Type === UIAnnotationTypes.DataFieldWithUrl) &&
|
|
1950
|
+
innerDataField.Value
|
|
1951
|
+
) {
|
|
1952
|
+
aProperties.push(innerDataField.Value.path);
|
|
1953
|
+
}
|
|
1954
|
+
_propertiesFound = _findProperties(semanticKeyValues, aProperties);
|
|
1955
|
+
});
|
|
1956
|
+
}
|
|
1957
|
+
return {
|
|
1958
|
+
semanticKeyHasPropertyInFieldGroup: _propertiesFound.semanticKeyHasPropertyInFieldGroup,
|
|
1959
|
+
propertyPath: _propertiesFound.fieldGroupPropertyPath
|
|
1960
|
+
};
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1870
1963
|
/**
|
|
1871
1964
|
* Returns default format options with draftIndicator for a column.
|
|
1872
1965
|
* @param name
|
|
1873
1966
|
* @param semanticKeys
|
|
1967
|
+
* @param isFieldGroupColumn
|
|
1968
|
+
* @param dataFieldGroup
|
|
1874
1969
|
* @returns {FormatOptionsType} Collection of format options with default values
|
|
1875
1970
|
*/
|
|
1876
|
-
function getDefaultDraftIndicatorForColumn(
|
|
1877
|
-
|
|
1878
|
-
|
|
1971
|
+
function getDefaultDraftIndicatorForColumn(
|
|
1972
|
+
name: string,
|
|
1973
|
+
semanticKeys: any[],
|
|
1974
|
+
isFieldGroupColumn: boolean,
|
|
1975
|
+
dataFieldGroup: DataFieldAbstractTypes | null
|
|
1976
|
+
) {
|
|
1879
1977
|
if (!semanticKeys) {
|
|
1880
1978
|
return {};
|
|
1881
1979
|
}
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
bSemanticKeyFound = true;
|
|
1886
|
-
}
|
|
1887
|
-
}
|
|
1888
|
-
if (bSemanticKeyFound) {
|
|
1980
|
+
const semanticKey = _findSemanticKeyValues(semanticKeys, name);
|
|
1981
|
+
const semanticKeyInFieldGroup = _findSemanticKeyValuesInFieldGroup(dataFieldGroup, semanticKey.values);
|
|
1982
|
+
if (semanticKey.semanticKeyFound) {
|
|
1889
1983
|
return {
|
|
1890
1984
|
hasDraftIndicator: true,
|
|
1891
|
-
semantickeys:
|
|
1985
|
+
semantickeys: semanticKey.values,
|
|
1986
|
+
objectStatusTextVisibility: compileBinding(getRowStatusVisibility())
|
|
1892
1987
|
};
|
|
1893
1988
|
} else {
|
|
1894
|
-
|
|
1989
|
+
if (!semanticKeyInFieldGroup.semanticKeyHasPropertyInFieldGroup) {
|
|
1990
|
+
return {};
|
|
1991
|
+
} else {
|
|
1992
|
+
// Semantic Key has a property in a FieldGroup
|
|
1993
|
+
return {
|
|
1994
|
+
FieldGroupDraftIndicatorPropertyPath: semanticKeyInFieldGroup.propertyPath,
|
|
1995
|
+
FieldGroupName: name
|
|
1996
|
+
};
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
function _getImpNumber(dataField: DataFieldTypes): number {
|
|
2002
|
+
const importance = dataField?.annotations?.UI?.Importance as string;
|
|
2003
|
+
|
|
2004
|
+
if (importance && importance.includes("UI.ImportanceType/High")) {
|
|
2005
|
+
return 3;
|
|
2006
|
+
}
|
|
2007
|
+
if (importance && importance.includes("UI.ImportanceType/Medium")) {
|
|
2008
|
+
return 2;
|
|
2009
|
+
}
|
|
2010
|
+
if (importance && importance.includes("UI.ImportanceType/Low")) {
|
|
2011
|
+
return 1;
|
|
2012
|
+
}
|
|
2013
|
+
return 0;
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
function _getDataFieldImportance(dataField: DataFieldTypes): Importance {
|
|
2017
|
+
const importance = dataField?.annotations?.UI?.Importance as string;
|
|
2018
|
+
return importance ? (importance.split("/")[1] as Importance) : Importance.None;
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
function _getMaxImportance(fields: DataFieldTypes[]): Importance {
|
|
2022
|
+
if (fields && fields.length > 0) {
|
|
2023
|
+
let maxImpNumber = -1;
|
|
2024
|
+
let impNumber = -1;
|
|
2025
|
+
let DataFieldWithMaxImportance;
|
|
2026
|
+
for (const field of fields) {
|
|
2027
|
+
impNumber = _getImpNumber(field);
|
|
2028
|
+
if (impNumber > maxImpNumber) {
|
|
2029
|
+
maxImpNumber = impNumber;
|
|
2030
|
+
DataFieldWithMaxImportance = field;
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
return _getDataFieldImportance(DataFieldWithMaxImportance as DataFieldTypes);
|
|
1895
2034
|
}
|
|
2035
|
+
return Importance.None;
|
|
1896
2036
|
}
|
|
1897
2037
|
|
|
2038
|
+
/**
|
|
2039
|
+
* Returns the importance value for a column.
|
|
2040
|
+
*
|
|
2041
|
+
* @param dataField
|
|
2042
|
+
* @param semanticKeys
|
|
2043
|
+
* @returns {Importance} The importance value
|
|
2044
|
+
*/
|
|
2045
|
+
export function getImportance(dataField: DataFieldAbstractTypes, semanticKeys: SemanticKey): Importance | undefined {
|
|
2046
|
+
//Evaluate default Importance is not set explicitly
|
|
2047
|
+
let fieldsWithImportance, mapSemanticKeys: any;
|
|
2048
|
+
//Check if semanticKeys are defined at the EntitySet level
|
|
2049
|
+
if (semanticKeys && semanticKeys.length > 0) {
|
|
2050
|
+
mapSemanticKeys = semanticKeys.map(function (key) {
|
|
2051
|
+
return key.value;
|
|
2052
|
+
});
|
|
2053
|
+
}
|
|
2054
|
+
if (!dataField) {
|
|
2055
|
+
return undefined;
|
|
2056
|
+
}
|
|
2057
|
+
if (dataField.$Type === UIAnnotationTypes.DataFieldForAnnotation) {
|
|
2058
|
+
const fieldGroupData = (dataField as any).Target["$target"]["Data"] as FieldGroupType,
|
|
2059
|
+
fieldGroupHasSemanticKey =
|
|
2060
|
+
fieldGroupData &&
|
|
2061
|
+
(fieldGroupData as any).some(function (fieldGroupDataField: DataFieldAbstractTypes) {
|
|
2062
|
+
return (
|
|
2063
|
+
(fieldGroupDataField as unknown as DataFieldTypes)?.Value?.path &&
|
|
2064
|
+
fieldGroupDataField.$Type !== UIAnnotationTypes.DataFieldForAnnotation &&
|
|
2065
|
+
mapSemanticKeys &&
|
|
2066
|
+
mapSemanticKeys.includes((fieldGroupDataField as unknown as DataFieldTypes)?.Value?.path)
|
|
2067
|
+
);
|
|
2068
|
+
});
|
|
2069
|
+
//If a FieldGroup contains a semanticKey, importance set to High
|
|
2070
|
+
if (fieldGroupHasSemanticKey) {
|
|
2071
|
+
return Importance.High;
|
|
2072
|
+
} else {
|
|
2073
|
+
//If the DataFieldForAnnotation has an Importance we take it
|
|
2074
|
+
if (dataField?.annotations?.UI?.Importance) {
|
|
2075
|
+
return _getDataFieldImportance(dataField as unknown as DataFieldTypes);
|
|
2076
|
+
}
|
|
2077
|
+
// else the highest importance (if any) is returned
|
|
2078
|
+
fieldsWithImportance =
|
|
2079
|
+
fieldGroupData &&
|
|
2080
|
+
(fieldGroupData as any).filter(function (item: DataFieldTypes) {
|
|
2081
|
+
return item?.annotations?.UI?.Importance;
|
|
2082
|
+
});
|
|
2083
|
+
return _getMaxImportance(fieldsWithImportance as DataFieldTypes[]);
|
|
2084
|
+
}
|
|
2085
|
+
//If the current field is a semanticKey, importance set to High
|
|
2086
|
+
}
|
|
2087
|
+
return (dataField as DataFieldTypes).Value &&
|
|
2088
|
+
(dataField as DataFieldTypes)?.Value?.path &&
|
|
2089
|
+
mapSemanticKeys &&
|
|
2090
|
+
mapSemanticKeys.includes((dataField as DataFieldTypes).Value.path)
|
|
2091
|
+
? Importance.High
|
|
2092
|
+
: _getDataFieldImportance(dataField as unknown as DataFieldTypes);
|
|
2093
|
+
}
|
|
1898
2094
|
/**
|
|
1899
2095
|
* Returns line items from metadata annotations.
|
|
1900
2096
|
*
|
|
@@ -1903,7 +2099,7 @@ function getDefaultDraftIndicatorForColumn(name: string, semanticKeys: any[]) {
|
|
|
1903
2099
|
* @param {ConverterContext} converterContext The converter context
|
|
1904
2100
|
* @returns {TableColumn[]} The columns from the annotations
|
|
1905
2101
|
*/
|
|
1906
|
-
const getColumnsFromAnnotations = function(
|
|
2102
|
+
const getColumnsFromAnnotations = function (
|
|
1907
2103
|
lineItemAnnotation: LineItem,
|
|
1908
2104
|
visualizationPath: string,
|
|
1909
2105
|
converterContext: ConverterContext
|
|
@@ -1914,11 +2110,11 @@ const getColumnsFromAnnotations = function(
|
|
|
1914
2110
|
nonSortableColumns: string[] = getNonSortablePropertiesRestrictions(converterContext.getEntitySet()),
|
|
1915
2111
|
tableManifestSettings: TableManifestConfiguration = converterContext.getManifestControlConfiguration(visualizationPath),
|
|
1916
2112
|
tableType: TableType = tableManifestSettings?.tableSettings?.type || "ResponsiveTable";
|
|
1917
|
-
const semanticKeys = converterContext.getAnnotationsByTerm("Common",
|
|
2113
|
+
const semanticKeys: SemanticKey = converterContext.getAnnotationsByTerm("Common", CommonAnnotationTerms.SemanticKey, [
|
|
1918
2114
|
converterContext.getEntityType()
|
|
1919
2115
|
])[0];
|
|
1920
2116
|
if (lineItemAnnotation) {
|
|
1921
|
-
lineItemAnnotation.forEach(lineItem => {
|
|
2117
|
+
lineItemAnnotation.forEach((lineItem) => {
|
|
1922
2118
|
if (!_isValidColumn(lineItem)) {
|
|
1923
2119
|
return;
|
|
1924
2120
|
}
|
|
@@ -1943,7 +2139,7 @@ const getColumnsFromAnnotations = function(
|
|
|
1943
2139
|
const sDateInputFormat: string | undefined = dataType === "Edm.Date" ? "YYYY-MM-DD" : undefined;
|
|
1944
2140
|
const formatOptions = {
|
|
1945
2141
|
...getDefaultFormatOptionsForTable(),
|
|
1946
|
-
...getDefaultDraftIndicatorForColumn(name, semanticKeys)
|
|
2142
|
+
...getDefaultDraftIndicatorForColumn(name, semanticKeys, isFieldGroupColumn, lineItem)
|
|
1947
2143
|
};
|
|
1948
2144
|
let fieldGroupHiddenExpressions: BindingExpression<string>;
|
|
1949
2145
|
if (
|
|
@@ -1952,7 +2148,7 @@ const getColumnsFromAnnotations = function(
|
|
|
1952
2148
|
) {
|
|
1953
2149
|
fieldGroupHiddenExpressions = _getFieldGroupHiddenExpressions(lineItem, formatOptions);
|
|
1954
2150
|
}
|
|
1955
|
-
const exportSettings = {
|
|
2151
|
+
const exportSettings: any = {
|
|
1956
2152
|
template: relatedPropertiesInfo.exportSettingsTemplate,
|
|
1957
2153
|
wrap: relatedPropertiesInfo.exportSettingsWrapping,
|
|
1958
2154
|
type: dataType ? _getExportDataType(dataType, relatedPropertyNames.length > 1) : undefined,
|
|
@@ -1961,6 +2157,13 @@ const getColumnsFromAnnotations = function(
|
|
|
1961
2157
|
trueValue: dataType === "Edm.Boolean" ? "Yes" : undefined,
|
|
1962
2158
|
falseValue: dataType === "Edm.Boolean" ? "No" : undefined
|
|
1963
2159
|
};
|
|
2160
|
+
|
|
2161
|
+
if (relatedPropertiesInfo.exportUnitName) {
|
|
2162
|
+
exportSettings.unitProperty = relatedPropertiesInfo.exportUnitName;
|
|
2163
|
+
exportSettings.type = "Currency"; // Force to a currency because there's a unitProperty (otherwise the value isn't properly formatted when exported)
|
|
2164
|
+
} else if (relatedPropertiesInfo.exportUnitString) {
|
|
2165
|
+
exportSettings.unit = relatedPropertiesInfo.exportUnitString;
|
|
2166
|
+
}
|
|
1964
2167
|
const propertyTypeConfig = dataType && getTypeConfig(lineItem, dataType);
|
|
1965
2168
|
const oTypeConfig = propertyTypeConfig
|
|
1966
2169
|
? {
|
|
@@ -1977,7 +2180,7 @@ const getColumnsFromAnnotations = function(
|
|
|
1977
2180
|
// In case of text arrangement annotation with display mode as text only, exclude text property from the width calculation
|
|
1978
2181
|
visualSettings = {
|
|
1979
2182
|
widthCalculation: {
|
|
1980
|
-
excludeProperties: "Property::" + relatedPropertiesInfo.visualSettingsToBeExcluded
|
|
2183
|
+
excludeProperties: ["Property::" + relatedPropertiesInfo.visualSettingsToBeExcluded]
|
|
1981
2184
|
}
|
|
1982
2185
|
};
|
|
1983
2186
|
} else if (!dataType || !oTypeConfig) {
|
|
@@ -1988,7 +2191,7 @@ const getColumnsFromAnnotations = function(
|
|
|
1988
2191
|
// TODO: For situation POC - increase width of the column with the situations indicator - works for the situations demo app only!
|
|
1989
2192
|
// Might be a good idea to move the complete column width determination to the converter, that would allow us to widen
|
|
1990
2193
|
// the columns as needed. This workaround only deals with Date columns.
|
|
1991
|
-
const { hasDraftIndicator } = getDefaultDraftIndicatorForColumn(name, semanticKeys);
|
|
2194
|
+
const { hasDraftIndicator } = getDefaultDraftIndicatorForColumn(name, semanticKeys, isFieldGroupColumn, lineItem);
|
|
1992
2195
|
const widthOverride =
|
|
1993
2196
|
(converterContext.getEntityType().annotations as any).FE?.Situations &&
|
|
1994
2197
|
hasDraftIndicator &&
|
|
@@ -2015,6 +2218,7 @@ const getColumnsFromAnnotations = function(
|
|
|
2015
2218
|
additionalPropertyInfos: additionalPropertyNames.length > 0 ? additionalPropertyNames : undefined,
|
|
2016
2219
|
exportSettings: exportSettings,
|
|
2017
2220
|
width: lineItem.annotations?.HTML5?.CssDefaults?.width || widthOverride || undefined,
|
|
2221
|
+
importance: getImportance(lineItem as DataFieldTypes, semanticKeys),
|
|
2018
2222
|
isNavigable: true,
|
|
2019
2223
|
formatOptions: formatOptions,
|
|
2020
2224
|
exportContactProperty: relatedPropertiesInfo.exportSettingsContactProperty,
|
|
@@ -2030,12 +2234,12 @@ const getColumnsFromAnnotations = function(
|
|
|
2030
2234
|
annotationColumns.push(oColumn as AnnotationTableColumn);
|
|
2031
2235
|
|
|
2032
2236
|
// Collect information of related columns to be created.
|
|
2033
|
-
relatedPropertyNames.forEach(name => {
|
|
2237
|
+
relatedPropertyNames.forEach((name) => {
|
|
2034
2238
|
columnsToBeCreated[name] = relatedPropertiesInfo.properties[name];
|
|
2035
2239
|
});
|
|
2036
2240
|
|
|
2037
2241
|
// Create columns for additional properties identified for ALP use case.
|
|
2038
|
-
additionalPropertyNames.forEach(name => {
|
|
2242
|
+
additionalPropertyNames.forEach((name) => {
|
|
2039
2243
|
// Intentional overwrite as we require only one new PropertyInfo for a related Property.
|
|
2040
2244
|
columnsToBeCreated[name] = relatedPropertiesInfo.additionalProperties[name];
|
|
2041
2245
|
});
|
|
@@ -2069,7 +2273,7 @@ const getColumnsFromAnnotations = function(
|
|
|
2069
2273
|
* @param entityType
|
|
2070
2274
|
* @returns {string[]} The columns from the annotations
|
|
2071
2275
|
*/
|
|
2072
|
-
const _getPropertyNames = function(
|
|
2276
|
+
const _getPropertyNames = function (
|
|
2073
2277
|
properties: string[] | undefined,
|
|
2074
2278
|
annotationColumns: AnnotationTableColumn[],
|
|
2075
2279
|
converterContext: ConverterContext,
|
|
@@ -2077,8 +2281,8 @@ const _getPropertyNames = function(
|
|
|
2077
2281
|
): string[] | undefined {
|
|
2078
2282
|
let matchedProperties: string[] | undefined;
|
|
2079
2283
|
if (properties) {
|
|
2080
|
-
matchedProperties = properties.map(function(propertyPath) {
|
|
2081
|
-
const annotationColumn = annotationColumns.find(function(annotationColumn) {
|
|
2284
|
+
matchedProperties = properties.map(function (propertyPath) {
|
|
2285
|
+
const annotationColumn = annotationColumns.find(function (annotationColumn) {
|
|
2082
2286
|
return annotationColumn.relativePath === propertyPath && annotationColumn.propertyInfos === undefined;
|
|
2083
2287
|
});
|
|
2084
2288
|
if (annotationColumn) {
|
|
@@ -2100,9 +2304,9 @@ const _getPropertyNames = function(
|
|
|
2100
2304
|
return matchedProperties;
|
|
2101
2305
|
};
|
|
2102
2306
|
|
|
2103
|
-
const _appendCustomTemplate = function(properties: string[]): string {
|
|
2307
|
+
const _appendCustomTemplate = function (properties: string[]): string {
|
|
2104
2308
|
return properties
|
|
2105
|
-
.map(property => {
|
|
2309
|
+
.map((property) => {
|
|
2106
2310
|
return `{${properties.indexOf(property)}}`;
|
|
2107
2311
|
})
|
|
2108
2312
|
.join(`${"\n"}`);
|
|
@@ -2119,7 +2323,7 @@ const _appendCustomTemplate = function(properties: string[]): string {
|
|
|
2119
2323
|
* @param {boolean} isAnnotationColumn Whether the column, defined in manifest, corresponds to an existing annotation column.
|
|
2120
2324
|
* @returns {any} Determined property value for the column
|
|
2121
2325
|
*/
|
|
2122
|
-
const _getManifestOrDefaultValue = function(property: any, defaultValue: any, isAnnotationColumn: boolean): any {
|
|
2326
|
+
const _getManifestOrDefaultValue = function (property: any, defaultValue: any, isAnnotationColumn: boolean): any {
|
|
2123
2327
|
if (property === undefined) {
|
|
2124
2328
|
// If annotation column has no property defined in manifest,
|
|
2125
2329
|
// do not overwrite it with manifest column's default value.
|
|
@@ -2138,7 +2342,7 @@ const _getManifestOrDefaultValue = function(property: any, defaultValue: any, is
|
|
|
2138
2342
|
* @param navigationSettings
|
|
2139
2343
|
* @returns {Record<string, CustomColumn>} The columns from the manifest
|
|
2140
2344
|
*/
|
|
2141
|
-
const getColumnsFromManifest = function(
|
|
2345
|
+
const getColumnsFromManifest = function (
|
|
2142
2346
|
columns: Record<string, ManifestTableColumn>,
|
|
2143
2347
|
annotationColumns: AnnotationTableColumn[],
|
|
2144
2348
|
converterContext: ConverterContext,
|
|
@@ -2150,7 +2354,7 @@ const getColumnsFromManifest = function(
|
|
|
2150
2354
|
for (const key in columns) {
|
|
2151
2355
|
const manifestColumn = columns[key];
|
|
2152
2356
|
// To identify the annotation column property overwrite via manifest use-case.
|
|
2153
|
-
const isAnnotationColumn = annotationColumns.some(column => column.key === key);
|
|
2357
|
+
const isAnnotationColumn = annotationColumns.some((column) => column.key === key);
|
|
2154
2358
|
KeyHelper.validateKey(key);
|
|
2155
2359
|
const propertyInfos: string[] | undefined = _getPropertyNames(
|
|
2156
2360
|
manifestColumn.properties,
|
|
@@ -2158,7 +2362,7 @@ const getColumnsFromManifest = function(
|
|
|
2158
2362
|
converterContext,
|
|
2159
2363
|
entityType
|
|
2160
2364
|
);
|
|
2161
|
-
if (!manifestColumn?.template && !isAnnotationColumn) {
|
|
2365
|
+
if (!manifestColumn?.template && manifestColumn?.type !== "Slot" && !isAnnotationColumn) {
|
|
2162
2366
|
const Message = "The annotation column '" + key + "' referenced in the manifest is not found";
|
|
2163
2367
|
converterContext
|
|
2164
2368
|
.getDiagnostics()
|
|
@@ -2176,6 +2380,7 @@ const getColumnsFromManifest = function(
|
|
|
2176
2380
|
name: "CustomColumn::" + key,
|
|
2177
2381
|
header: manifestColumn.header,
|
|
2178
2382
|
width: manifestColumn.width || undefined,
|
|
2383
|
+
importance: _getManifestOrDefaultValue(manifestColumn?.importance, Importance.None, isAnnotationColumn),
|
|
2179
2384
|
horizontalAlign: _getManifestOrDefaultValue(manifestColumn?.horizontalAlign, HorizontalAlign.Begin, isAnnotationColumn),
|
|
2180
2385
|
type: manifestColumn.type === "Slot" ? ColumnType.Slot : ColumnType.Default,
|
|
2181
2386
|
availability: _getManifestOrDefaultValue(manifestColumn?.availability, AvailabilityType.Default, isAnnotationColumn),
|
|
@@ -2188,10 +2393,14 @@ const getColumnsFromManifest = function(
|
|
|
2188
2393
|
settings: manifestColumn.settings,
|
|
2189
2394
|
sortable: false,
|
|
2190
2395
|
propertyInfos: propertyInfos,
|
|
2191
|
-
formatOptions:
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2396
|
+
formatOptions: _getManifestOrDefaultValue(
|
|
2397
|
+
manifestColumn.formatOptions,
|
|
2398
|
+
{
|
|
2399
|
+
...getDefaultFormatOptionsForTable(),
|
|
2400
|
+
...manifestColumn.formatOptions
|
|
2401
|
+
},
|
|
2402
|
+
isAnnotationColumn
|
|
2403
|
+
),
|
|
2195
2404
|
exportSettings: {
|
|
2196
2405
|
template: propertyInfos ? _appendCustomTemplate(propertyInfos) : undefined,
|
|
2197
2406
|
fieldLabel: propertyInfos ? manifestColumn.header : undefined,
|
|
@@ -2243,12 +2452,17 @@ export function getP13nMode(
|
|
|
2243
2452
|
// No personalization configured in manifest.
|
|
2244
2453
|
aPersonalization.push("Sort");
|
|
2245
2454
|
aPersonalization.push("Column");
|
|
2246
|
-
if (
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2455
|
+
if (converterContext.getTemplateType() === TemplateType.ListReport) {
|
|
2456
|
+
if (variantManagement === VariantManagementType.Control || _isFilterBarHidden(manifestWrapper, converterContext)) {
|
|
2457
|
+
// Feature parity with V2.
|
|
2458
|
+
// Enable table filtering by default only in case of Control level variant management.
|
|
2459
|
+
// Or when the LR filter bar is hidden via manifest setting
|
|
2460
|
+
aPersonalization.push("Filter");
|
|
2461
|
+
}
|
|
2462
|
+
} else {
|
|
2250
2463
|
aPersonalization.push("Filter");
|
|
2251
2464
|
}
|
|
2465
|
+
|
|
2252
2466
|
if (bAnalyticalTable) {
|
|
2253
2467
|
aPersonalization.push("Group");
|
|
2254
2468
|
aPersonalization.push("Aggregate");
|
|
@@ -2297,7 +2511,7 @@ function getSortConditions(
|
|
|
2297
2511
|
const conditions = {
|
|
2298
2512
|
sorters: sorters
|
|
2299
2513
|
};
|
|
2300
|
-
presentationVariantAnnotation.SortOrder.forEach(condition => {
|
|
2514
|
+
presentationVariantAnnotation.SortOrder.forEach((condition) => {
|
|
2301
2515
|
const conditionProperty = condition.Property;
|
|
2302
2516
|
if (conditionProperty && nonSortableProperties.indexOf(conditionProperty.$target?.name) === -1) {
|
|
2303
2517
|
const infoName = convertPropertyPathsToInfoNames([conditionProperty], columns)[0];
|
|
@@ -2324,9 +2538,9 @@ function getSortConditions(
|
|
|
2324
2538
|
|
|
2325
2539
|
function convertPropertyPathsToInfoNames(paths: PropertyPath[], columns: TableColumn[]): string[] {
|
|
2326
2540
|
const infoNames: string[] = [];
|
|
2327
|
-
paths.forEach(currentPath => {
|
|
2541
|
+
paths.forEach((currentPath) => {
|
|
2328
2542
|
if (currentPath?.$target?.name) {
|
|
2329
|
-
const propertyInfo = columns.find(column => {
|
|
2543
|
+
const propertyInfo = columns.find((column) => {
|
|
2330
2544
|
const annotationColumn = column as AnnotationTableColumn;
|
|
2331
2545
|
return !annotationColumn.propertyInfos && annotationColumn.relativePath === currentPath?.$target?.name;
|
|
2332
2546
|
});
|
|
@@ -2353,7 +2567,7 @@ function getGroupConditions(
|
|
|
2353
2567
|
let groupConditions: string | undefined;
|
|
2354
2568
|
if (presentationVariantAnnotation?.GroupBy) {
|
|
2355
2569
|
const aGroupBy = presentationVariantAnnotation.GroupBy as PropertyPath[];
|
|
2356
|
-
const aGroupLevels = convertPropertyPathsToInfoNames(aGroupBy, columns).map(infoName => {
|
|
2570
|
+
const aGroupLevels = convertPropertyPathsToInfoNames(aGroupBy, columns).map((infoName) => {
|
|
2357
2571
|
return { name: infoName };
|
|
2358
2572
|
});
|
|
2359
2573
|
|
|
@@ -2377,7 +2591,7 @@ function getAggregateConditions(
|
|
|
2377
2591
|
if (presentationVariantAnnotation?.Total) {
|
|
2378
2592
|
const aTotals = presentationVariantAnnotation.Total as PropertyPath[];
|
|
2379
2593
|
const aggregates: Record<string, object> = {};
|
|
2380
|
-
convertPropertyPathsToInfoNames(aTotals, columns).forEach(infoName => {
|
|
2594
|
+
convertPropertyPathsToInfoNames(aTotals, columns).forEach((infoName) => {
|
|
2381
2595
|
aggregates[infoName] = {};
|
|
2382
2596
|
});
|
|
2383
2597
|
|
|
@@ -2407,9 +2621,10 @@ export function getTableAnnotationConfiguration(
|
|
|
2407
2621
|
const targetCapabilities = getCapabilityRestriction(converterContext);
|
|
2408
2622
|
const navigationTargetPath = getNavigationTargetPath(converterContext, navigationPropertyPath);
|
|
2409
2623
|
const navigationSettings = pageManifestSettings.getNavigationConfiguration(navigationTargetPath);
|
|
2624
|
+
const creationBehaviour = _getCreationBehaviour(lineItemAnnotation, tableManifestConfiguration, converterContext, navigationSettings);
|
|
2410
2625
|
const standardActionsContext = generateStandardActionsContext(
|
|
2411
2626
|
converterContext,
|
|
2412
|
-
|
|
2627
|
+
creationBehaviour.mode as CreationMode,
|
|
2413
2628
|
tableManifestConfiguration,
|
|
2414
2629
|
viewConfiguration
|
|
2415
2630
|
);
|
|
@@ -2437,14 +2652,14 @@ export function getTableAnnotationConfiguration(
|
|
|
2437
2652
|
threshold = presentationVariantAnnotation.MaxItems.valueOf() as number;
|
|
2438
2653
|
}
|
|
2439
2654
|
|
|
2440
|
-
const creationBehaviour = _getCreationBehaviour(lineItemAnnotation, tableManifestConfiguration, converterContext, navigationSettings);
|
|
2441
2655
|
const variantManagement: VariantManagementType = pageManifestSettings.getVariantManagement();
|
|
2442
2656
|
const isSearchable = isPathSearchable(converterContext.getDataModelObjectPath());
|
|
2443
2657
|
const standardActions = {
|
|
2444
2658
|
create: getStandardActionCreate(converterContext, standardActionsContext),
|
|
2445
2659
|
"delete": getStandardActionDelete(converterContext, standardActionsContext),
|
|
2446
2660
|
paste: getStandardActionPaste(converterContext, standardActionsContext, isInsertUpdateTemplated),
|
|
2447
|
-
massEdit: getStandardActionMassEdit(converterContext, standardActionsContext)
|
|
2661
|
+
massEdit: getStandardActionMassEdit(converterContext, standardActionsContext),
|
|
2662
|
+
creationRow: getCreationRow(converterContext, standardActionsContext)
|
|
2448
2663
|
};
|
|
2449
2664
|
|
|
2450
2665
|
return {
|
|
@@ -2615,6 +2830,7 @@ function _getTableType(
|
|
|
2615
2830
|
}
|
|
2616
2831
|
return tableType;
|
|
2617
2832
|
}
|
|
2833
|
+
|
|
2618
2834
|
function _getFilters(
|
|
2619
2835
|
tableSettings: TableManifestSettingsConfiguration,
|
|
2620
2836
|
quickFilterPaths: { annotationPath: string }[],
|
|
@@ -2687,10 +2903,11 @@ export function getTableManifestConfiguration(
|
|
|
2687
2903
|
const isCondensedTableLayoutCompliant = checkCondensedLayout && converterContext.getManifestWrapper().isCondensedLayoutCompliant();
|
|
2688
2904
|
const oFilterConfiguration = _getFilterConfiguration(tableSettings, lineItemAnnotation, converterContext);
|
|
2689
2905
|
const customValidationFunction = tableSettings.creationMode?.customValidationFunction;
|
|
2690
|
-
const condensedTableLayout = tableSettings.condensedTableLayout !== undefined ? tableSettings.condensedTableLayout : false;
|
|
2691
2906
|
const entityType = converterContext.getEntityType();
|
|
2692
2907
|
const aggregationHelper = new AggregationHelper(entityType, converterContext);
|
|
2693
2908
|
const tableType: TableType = _getTableType(tableSettings, aggregationHelper, converterContext);
|
|
2909
|
+
const condensedTableLayout =
|
|
2910
|
+
tableSettings.condensedTableLayout !== undefined && tableType !== "ResponsiveTable" ? tableSettings.condensedTableLayout : false;
|
|
2694
2911
|
const oConfiguration = {
|
|
2695
2912
|
createAtEnd: tableSettings.creationMode?.createAtEnd !== undefined ? tableSettings.creationMode?.createAtEnd : true,
|
|
2696
2913
|
creationMode: tableSettings.creationMode?.name || creationMode,
|