@sapui5/sap.fe.core 1.102.0 → 1.103.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 +5 -5
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AppComponent.js +62 -26
- package/src/sap/fe/core/AppComponent.ts +56 -40
- package/src/sap/fe/core/AppStateHandler.js +10 -10
- package/src/sap/fe/core/AppStateHandler.ts +9 -9
- package/src/sap/fe/core/BaseController.js +11 -9
- package/src/sap/fe/core/BaseController.ts +15 -13
- package/src/sap/fe/core/CommonUtils.js +236 -109
- package/src/sap/fe/core/CommonUtils.ts +252 -136
- package/src/sap/fe/core/ExtensionAPI.js +24 -27
- package/src/sap/fe/core/ExtensionAPI.ts +36 -38
- package/src/sap/fe/core/PageController.js +4 -4
- package/src/sap/fe/core/PageController.ts +4 -5
- package/src/sap/fe/core/TemplateComponent.js +1 -1
- package/src/sap/fe/core/TemplateComponent.ts +6 -6
- package/src/sap/fe/core/TemplateModel.js +1 -1
- package/src/sap/fe/core/TemplateModel.ts +1 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel.js +1 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +1 -1
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +8 -8
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +11 -10
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +27 -27
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +28 -26
- package/src/sap/fe/core/controllerextensions/EditFlow.js +129 -118
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +154 -141
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +9 -9
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +10 -10
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +31 -26
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +34 -35
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +70 -70
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +77 -77
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +84 -78
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +105 -101
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +66 -68
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +106 -123
- package/src/sap/fe/core/controllerextensions/MassEdit.js +8 -8
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +19 -26
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +20 -12
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +29 -14
- package/src/sap/fe/core/controllerextensions/PageReady.js +97 -25
- package/src/sap/fe/core/controllerextensions/PageReady.ts +94 -34
- package/src/sap/fe/core/controllerextensions/Paginator.js +21 -22
- package/src/sap/fe/core/controllerextensions/Paginator.ts +24 -25
- package/src/sap/fe/core/controllerextensions/Placeholder.js +4 -6
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
- package/src/sap/fe/core/controllerextensions/Routing.js +10 -11
- package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
- package/src/sap/fe/core/controllerextensions/Share.js +22 -22
- package/src/sap/fe/core/controllerextensions/Share.ts +30 -29
- package/src/sap/fe/core/controllerextensions/SideEffects.js +46 -50
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +56 -60
- package/src/sap/fe/core/controllerextensions/ViewState.js +65 -62
- package/src/sap/fe/core/controllerextensions/ViewState.ts +68 -63
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +5 -5
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +8 -7
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +6 -6
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.ts +12 -17
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +2 -2
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +4 -4
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +7 -9
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.ts +18 -19
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +184 -137
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +253 -206
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +113 -121
- package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +148 -158
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js +198 -148
- package/src/sap/fe/core/controllerextensions/editFlow/operations.ts +223 -159
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +24 -26
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +35 -33
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +78 -44
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +90 -60
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +52 -55
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +55 -58
- package/src/sap/fe/core/controls/Any.js +9 -5
- package/src/sap/fe/core/controls/Any.ts +10 -4
- package/src/sap/fe/core/controls/CommandExecution.js +11 -25
- package/src/sap/fe/core/controls/CommandExecution.ts +11 -25
- package/src/sap/fe/core/controls/ConditionalWrapper.js +2 -2
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +3 -3
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +22 -22
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +25 -24
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +2 -2
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +2 -2
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +3 -3
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +5 -5
- package/src/sap/fe/core/controls/FieldWrapper.js +2 -2
- package/src/sap/fe/core/controls/FieldWrapper.ts +3 -3
- package/src/sap/fe/core/controls/FileWrapper.js +2 -2
- package/src/sap/fe/core/controls/FileWrapper.ts +11 -11
- package/src/sap/fe/core/controls/FilterBar.js +6 -2
- package/src/sap/fe/core/controls/FilterBar.ts +13 -9
- package/src/sap/fe/core/controls/FormElementWrapper.js +1 -1
- package/src/sap/fe/core/controls/FormElementWrapper.ts +2 -2
- package/src/sap/fe/core/controls/MassEditSelect.js +1 -1
- package/src/sap/fe/core/controls/MassEditSelect.ts +0 -4
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +3 -3
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +16 -12
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +20 -22
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -3
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +8 -8
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +47 -47
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +52 -52
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +8 -2
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +89 -88
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +107 -106
- package/src/sap/fe/core/converters/ConverterContext.js +26 -33
- package/src/sap/fe/core/converters/ConverterContext.ts +51 -60
- package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +14 -14
- package/src/sap/fe/core/converters/ManifestWrapper.js +59 -45
- package/src/sap/fe/core/converters/ManifestWrapper.ts +55 -45
- package/src/sap/fe/core/converters/MetaModelConverter.js +50 -32
- package/src/sap/fe/core/converters/MetaModelConverter.ts +145 -127
- package/src/sap/fe/core/converters/TemplateConverter.js +21 -20
- package/src/sap/fe/core/converters/TemplateConverter.ts +27 -24
- package/src/sap/fe/core/converters/annotations/DataField.js +54 -34
- package/src/sap/fe/core/converters/annotations/DataField.ts +97 -75
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +1911 -1495
- package/src/sap/fe/core/converters/controls/Common/Action.js +50 -41
- package/src/sap/fe/core/converters/controls/Common/Action.ts +56 -46
- package/src/sap/fe/core/converters/controls/Common/Chart.js +14 -14
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +23 -26
- package/src/sap/fe/core/converters/controls/Common/Criticality.js +3 -3
- package/src/sap/fe/core/converters/controls/Common/Criticality.ts +4 -4
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +28 -28
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +40 -36
- package/src/sap/fe/core/converters/controls/Common/Form.js +25 -27
- package/src/sap/fe/core/converters/controls/Common/Form.ts +37 -45
- package/src/sap/fe/core/converters/controls/Common/KPI.js +11 -11
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +35 -39
- package/src/sap/fe/core/converters/controls/Common/Table.js +174 -183
- package/src/sap/fe/core/converters/controls/Common/Table.ts +237 -250
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +119 -119
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +144 -141
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +45 -41
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +64 -57
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +28 -26
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +46 -43
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.js +9 -9
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.ts +14 -13
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +67 -64
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +69 -66
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +73 -72
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +98 -96
- package/src/sap/fe/core/converters/helpers/Aggregation.js +2 -4
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +10 -13
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +31 -31
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +30 -29
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +4 -4
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +9 -9
- package/src/sap/fe/core/converters/helpers/ID.js +46 -46
- package/src/sap/fe/core/converters/helpers/ID.ts +25 -25
- package/src/sap/fe/core/converters/helpers/Key.js +7 -7
- package/src/sap/fe/core/converters/helpers/Key.ts +7 -7
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.js +1 -1
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.ts +4 -4
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +6 -6
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +10 -10
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +46 -62
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +54 -82
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +30 -29
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +40 -40
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +39 -38
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +52 -61
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +4 -4
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +4 -4
- package/src/sap/fe/core/formatters/CollaborationFormatter.js +2 -2
- package/src/sap/fe/core/formatters/CollaborationFormatter.ts +3 -3
- package/src/sap/fe/core/formatters/FPMFormatter.js +5 -5
- package/src/sap/fe/core/formatters/FPMFormatter.ts +10 -10
- package/src/sap/fe/core/formatters/KPIFormatter.js +7 -7
- package/src/sap/fe/core/formatters/KPIFormatter.ts +10 -10
- package/src/sap/fe/core/formatters/StandardFormatter.js +89 -0
- package/src/sap/fe/core/formatters/StandardFormatter.ts +64 -0
- package/src/sap/fe/core/formatters/TableFormatter.js +11 -11
- package/src/sap/fe/core/formatters/TableFormatter.ts +12 -12
- package/src/sap/fe/core/formatters/ValueFormatter.js +8 -8
- package/src/sap/fe/core/formatters/ValueFormatter.ts +9 -9
- package/src/sap/fe/core/helpers/AppStartupHelper.js +15 -15
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +37 -40
- package/src/sap/fe/core/helpers/BindingToolkit.js +1809 -0
- package/src/sap/fe/core/helpers/{BindingExpression.ts → BindingToolkit.ts} +365 -264
- package/src/sap/fe/core/helpers/ClassSupport.js +20 -11
- package/src/sap/fe/core/helpers/ClassSupport.ts +14 -10
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +2 -2
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +1 -1
- package/src/sap/fe/core/helpers/EditState.js +1 -6
- package/src/sap/fe/core/helpers/EditState.ts +5 -10
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +2 -2
- package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +4 -4
- package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
- package/src/sap/fe/core/helpers/FPMHelper.ts +2 -2
- package/src/sap/fe/core/helpers/KeepAliveHelper.js +31 -31
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +52 -56
- package/src/sap/fe/core/helpers/MassEditHelper.js +281 -254
- package/src/sap/fe/core/helpers/MassEditHelper.ts +337 -289
- package/src/sap/fe/core/helpers/ModelHelper.js +25 -25
- package/src/sap/fe/core/helpers/ModelHelper.ts +34 -32
- package/src/sap/fe/core/helpers/PasteHelper.js +3 -10
- package/src/sap/fe/core/helpers/PasteHelper.ts +20 -25
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +1 -1
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +11 -11
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +3 -3
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +8 -8
- package/src/sap/fe/core/helpers/StableIdHelper.js +12 -12
- package/src/sap/fe/core/helpers/StableIdHelper.ts +12 -12
- package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx.ts +8 -8
- package/src/sap/fe/core/library.js +42 -3
- package/src/sap/fe/core/library.ts +38 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +3 -3
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +2 -2
- package/src/sap/fe/core/messagebundle.properties +49 -35
- package/src/sap/fe/core/messagebundle_ar.properties +13 -5
- package/src/sap/fe/core/messagebundle_bg.properties +13 -5
- package/src/sap/fe/core/messagebundle_ca.properties +13 -5
- package/src/sap/fe/core/messagebundle_cs.properties +13 -5
- package/src/sap/fe/core/messagebundle_cy.properties +14 -6
- package/src/sap/fe/core/messagebundle_da.properties +13 -5
- package/src/sap/fe/core/messagebundle_de.properties +15 -7
- package/src/sap/fe/core/messagebundle_el.properties +14 -6
- package/src/sap/fe/core/messagebundle_en.properties +9 -1
- package/src/sap/fe/core/messagebundle_en_GB.properties +11 -3
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +7 -1
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +9 -1
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +44 -85
- package/src/sap/fe/core/messagebundle_es.properties +13 -5
- package/src/sap/fe/core/messagebundle_es_MX.properties +13 -5
- package/src/sap/fe/core/messagebundle_et.properties +13 -5
- package/src/sap/fe/core/messagebundle_fi.properties +14 -6
- package/src/sap/fe/core/messagebundle_fr.properties +14 -6
- package/src/sap/fe/core/messagebundle_fr_CA.properties +14 -6
- package/src/sap/fe/core/messagebundle_hi.properties +14 -6
- package/src/sap/fe/core/messagebundle_hr.properties +14 -6
- package/src/sap/fe/core/messagebundle_hu.properties +13 -5
- package/src/sap/fe/core/messagebundle_id.properties +13 -5
- package/src/sap/fe/core/messagebundle_it.properties +33 -25
- package/src/sap/fe/core/messagebundle_iw.properties +13 -5
- package/src/sap/fe/core/messagebundle_ja.properties +14 -6
- package/src/sap/fe/core/messagebundle_kk.properties +13 -5
- package/src/sap/fe/core/messagebundle_ko.properties +13 -5
- package/src/sap/fe/core/messagebundle_lt.properties +13 -5
- package/src/sap/fe/core/messagebundle_lv.properties +14 -6
- package/src/sap/fe/core/messagebundle_ms.properties +13 -5
- package/src/sap/fe/core/messagebundle_nl.properties +13 -5
- package/src/sap/fe/core/messagebundle_no.properties +13 -5
- package/src/sap/fe/core/messagebundle_pl.properties +13 -5
- package/src/sap/fe/core/messagebundle_pt.properties +13 -5
- package/src/sap/fe/core/messagebundle_pt_PT.properties +14 -6
- package/src/sap/fe/core/messagebundle_ro.properties +13 -5
- package/src/sap/fe/core/messagebundle_ru.properties +13 -5
- package/src/sap/fe/core/messagebundle_sh.properties +13 -5
- package/src/sap/fe/core/messagebundle_sk.properties +13 -5
- package/src/sap/fe/core/messagebundle_sl.properties +17 -9
- package/src/sap/fe/core/messagebundle_sv.properties +14 -6
- package/src/sap/fe/core/messagebundle_th.properties +13 -5
- package/src/sap/fe/core/messagebundle_tr.properties +13 -5
- package/src/sap/fe/core/messagebundle_uk.properties +13 -5
- package/src/sap/fe/core/messagebundle_vi.properties +13 -5
- package/src/sap/fe/core/messagebundle_zh_CN.properties +14 -6
- package/src/sap/fe/core/messagebundle_zh_TW.properties +13 -5
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +5 -5
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +2 -2
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +14 -14
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +1 -1
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +3 -2
- package/src/sap/fe/core/services/NavigationServiceFactory.js +53 -44
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +54 -46
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +2 -2
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +4 -4
- package/src/sap/fe/core/services/RoutingServiceFactory.js +55 -55
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +67 -65
- package/src/sap/fe/core/services/ShellServicesFactory.js +72 -76
- package/src/sap/fe/core/services/ShellServicesFactory.ts +76 -82
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +61 -61
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +102 -92
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +20 -15
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +26 -21
- package/src/sap/fe/core/support/CommonHelper.js +3 -2
- package/src/sap/fe/core/support/CommonHelper.ts +9 -13
- package/src/sap/fe/core/support/Diagnostics.js +1 -1
- package/src/sap/fe/core/support/Diagnostics.ts +5 -5
- package/src/sap/fe/core/templating/CommonFormatters.js +84 -0
- package/src/sap/fe/core/templating/CommonFormatters.ts +86 -0
- package/src/sap/fe/core/templating/CriticalityFormatters.js +31 -31
- package/src/sap/fe/core/templating/CriticalityFormatters.ts +42 -40
- package/src/sap/fe/core/templating/DataFieldFormatters.js +8 -8
- package/src/sap/fe/core/templating/DataFieldFormatters.ts +13 -10
- package/src/sap/fe/core/templating/DataModelPathHelper.js +16 -15
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +42 -32
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +1 -1
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +2 -3
- package/src/sap/fe/core/templating/EntitySetHelper.js +7 -7
- package/src/sap/fe/core/templating/EntitySetHelper.ts +6 -8
- package/src/sap/fe/core/templating/FieldControlHelper.js +35 -34
- package/src/sap/fe/core/templating/FieldControlHelper.ts +29 -46
- package/src/sap/fe/core/templating/FilterHelper.js +10 -9
- package/src/sap/fe/core/templating/FilterHelper.ts +13 -13
- package/src/sap/fe/core/templating/FilterTemplating.js +1 -1
- package/src/sap/fe/core/templating/FilterTemplating.ts +3 -3
- package/src/sap/fe/core/templating/PropertyFormatters.js +7 -7
- package/src/sap/fe/core/templating/PropertyFormatters.ts +21 -19
- package/src/sap/fe/core/templating/PropertyHelper.js +25 -25
- package/src/sap/fe/core/templating/PropertyHelper.ts +25 -26
- package/src/sap/fe/core/templating/UIFormatters.js +148 -93
- package/src/sap/fe/core/templating/UIFormatters.ts +196 -124
- package/src/sap/fe/core/type/Email.js +2 -2
- package/src/sap/fe/core/type/Email.ts +2 -2
- package/src/sap/fe/core/helpers/BindingExpression.js +0 -1732
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import ResourceBundle from "sap/base/i18n/ResourceBundle";
|
|
1
|
+
import type ResourceBundle from "sap/base/i18n/ResourceBundle";
|
|
2
2
|
import Log from "sap/base/Log";
|
|
3
3
|
import mergeObjects from "sap/base/util/merge";
|
|
4
|
-
import AppComponent from "sap/fe/core/AppComponent";
|
|
4
|
+
import type AppComponent from "sap/fe/core/AppComponent";
|
|
5
5
|
import { IssueCategory, IssueCategoryType, IssueSeverity } from "sap/fe/core/converters/helpers/IssueManager";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
bindingExpression,
|
|
9
|
-
compileBinding,
|
|
10
|
-
constant,
|
|
11
|
-
not,
|
|
12
|
-
transformRecursively
|
|
13
|
-
} from "sap/fe/core/helpers/BindingExpression";
|
|
6
|
+
import type { CompiledBindingToolkitExpression } from "sap/fe/core/helpers/BindingToolkit";
|
|
7
|
+
import { compileExpression, constant, not, or, pathInModel, transformRecursively } from "sap/fe/core/helpers/BindingToolkit";
|
|
14
8
|
import ModelHelper from "sap/fe/core/helpers/ModelHelper";
|
|
15
9
|
import SemanticDateOperators from "sap/fe/core/helpers/SemanticDateOperators";
|
|
10
|
+
import SemanticKeyHelper from "sap/fe/core/helpers/SemanticKeyHelper";
|
|
16
11
|
import { generate } from "sap/fe/core/helpers/StableIdHelper";
|
|
17
12
|
import Bar from "sap/m/Bar";
|
|
18
13
|
import Button from "sap/m/Button";
|
|
@@ -20,7 +15,7 @@ import Dialog from "sap/m/Dialog";
|
|
|
20
15
|
import MessageBox from "sap/m/MessageBox";
|
|
21
16
|
import Title from "sap/m/Title";
|
|
22
17
|
import Component from "sap/ui/core/Component";
|
|
23
|
-
import Control from "sap/ui/core/Control";
|
|
18
|
+
import type Control from "sap/ui/core/Control";
|
|
24
19
|
import Core from "sap/ui/core/Core";
|
|
25
20
|
import Fragment from "sap/ui/core/Fragment";
|
|
26
21
|
import View from "sap/ui/core/mvc/View";
|
|
@@ -29,11 +24,11 @@ import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
|
|
|
29
24
|
import { system } from "sap/ui/Device";
|
|
30
25
|
import FilterOperatorUtil from "sap/ui/mdc/condition/FilterOperatorUtil";
|
|
31
26
|
import TypeUtil from "sap/ui/mdc/odata/v4/TypeUtil";
|
|
32
|
-
import Context from "sap/ui/model/Context";
|
|
27
|
+
import type Context from "sap/ui/model/Context";
|
|
33
28
|
import JSONModel from "sap/ui/model/json/JSONModel";
|
|
34
|
-
import ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
|
|
35
|
-
import ODataModel from "sap/ui/model/odata/v4/ODataModel";
|
|
36
|
-
import { CoreEx } from "types/extension_types";
|
|
29
|
+
import type ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
|
|
30
|
+
import type ODataModel from "sap/ui/model/odata/v4/ODataModel";
|
|
31
|
+
import type { CoreEx } from "types/extension_types";
|
|
37
32
|
import messageHandling from "./controllerextensions/messageHandler/messageHandling";
|
|
38
33
|
import { getConditions } from "./templating/FilterHelper";
|
|
39
34
|
|
|
@@ -67,7 +62,7 @@ function normalizeSearchTerm(sSearchTerm: string) {
|
|
|
67
62
|
.split(/\s+/)
|
|
68
63
|
.reduce(function (sNormalized: string | undefined, sCurrentWord: string) {
|
|
69
64
|
if (sCurrentWord !== "") {
|
|
70
|
-
sNormalized =
|
|
65
|
+
sNormalized = `${sNormalized ? `${sNormalized} ` : ""}"${sCurrentWord}"`;
|
|
71
66
|
}
|
|
72
67
|
return sNormalized;
|
|
73
68
|
}, undefined);
|
|
@@ -131,12 +126,12 @@ function getSearchRestrictions(sFullPath: any, oMetaModel: any) {
|
|
|
131
126
|
if (oNavigationRestrictions && oNavigationRestrictions["SearchRestrictions"]) {
|
|
132
127
|
return oNavigationRestrictions["SearchRestrictions"];
|
|
133
128
|
}
|
|
134
|
-
sPath = sPath
|
|
129
|
+
sPath = `${sPath}/$NavigationPropertyBinding/${aNavigationParts[i]}`;
|
|
135
130
|
}
|
|
136
|
-
return oMetaModel.getObject(sFullPath
|
|
131
|
+
return oMetaModel.getObject(`${sFullPath}@Org.OData.Capabilities.V1.SearchRestrictions`);
|
|
137
132
|
}
|
|
138
133
|
function getNavigationRestrictions(oModel: any, sEntitySetPath: any, sNavigationPath: any) {
|
|
139
|
-
const oNavigationRestrictions = oModel.getObject(sEntitySetPath
|
|
134
|
+
const oNavigationRestrictions = oModel.getObject(`${sEntitySetPath}@Org.OData.Capabilities.V1.NavigationRestrictions`);
|
|
140
135
|
const aRestrictedProperties = oNavigationRestrictions && oNavigationRestrictions.RestrictedProperties;
|
|
141
136
|
return (
|
|
142
137
|
aRestrictedProperties &&
|
|
@@ -151,7 +146,7 @@ function getNavigationRestrictions(oModel: any, sEntitySetPath: any, sNavigation
|
|
|
151
146
|
}
|
|
152
147
|
function _isInNonFilterableProperties(oModel: any, sEntitySetPath: any, sContextPath: any) {
|
|
153
148
|
let bIsNotFilterable = false;
|
|
154
|
-
const oAnnotation = oModel.getObject(sEntitySetPath
|
|
149
|
+
const oAnnotation = oModel.getObject(`${sEntitySetPath}@Org.OData.Capabilities.V1.FilterRestrictions`);
|
|
155
150
|
if (oAnnotation && oAnnotation.NonFilterableProperties) {
|
|
156
151
|
bIsNotFilterable = oAnnotation.NonFilterableProperties.some(function (property: any) {
|
|
157
152
|
return property.$NavigationPropertyPath === sContextPath || property.$PropertyPath === sContextPath;
|
|
@@ -161,7 +156,7 @@ function _isInNonFilterableProperties(oModel: any, sEntitySetPath: any, sContext
|
|
|
161
156
|
}
|
|
162
157
|
// TODO rework this!
|
|
163
158
|
function _isContextPathFilterable(oModel: any, sEntitySetPath: any, sContexPath: any) {
|
|
164
|
-
const sFullPath = sEntitySetPath
|
|
159
|
+
const sFullPath = `${sEntitySetPath}/${sContexPath}`,
|
|
165
160
|
aESParts = sFullPath.split("/").splice(0, 2),
|
|
166
161
|
aContext = sFullPath.split("/").splice(2);
|
|
167
162
|
let bIsNotFilterable = false,
|
|
@@ -171,7 +166,7 @@ function _isContextPathFilterable(oModel: any, sEntitySetPath: any, sContexPath:
|
|
|
171
166
|
|
|
172
167
|
bIsNotFilterable = aContext.some(function (item: string, index: number, array: string[]) {
|
|
173
168
|
if (sContext.length > 0) {
|
|
174
|
-
sContext +=
|
|
169
|
+
sContext += `/${item}`;
|
|
175
170
|
} else {
|
|
176
171
|
sContext = item;
|
|
177
172
|
}
|
|
@@ -193,12 +188,12 @@ function _isContextPathFilterable(oModel: any, sEntitySetPath: any, sContexPath:
|
|
|
193
188
|
if (index === array.length - 1) {
|
|
194
189
|
//last path segment
|
|
195
190
|
bIsNotFilterable = _isInNonFilterableProperties(oModel, sEntitySetPath, sContext);
|
|
196
|
-
} else if (oModel.getObject(sEntitySetPath
|
|
191
|
+
} else if (oModel.getObject(`${sEntitySetPath}/$NavigationPropertyBinding/${item}`)) {
|
|
197
192
|
//check existing context path and initialize it
|
|
198
193
|
bIsNotFilterable = _isInNonFilterableProperties(oModel, sEntitySetPath, sContext);
|
|
199
194
|
sContext = "";
|
|
200
195
|
//set the new EntitySet
|
|
201
|
-
sEntitySetPath =
|
|
196
|
+
sEntitySetPath = `/${oModel.getObject(`${sEntitySetPath}/$NavigationPropertyBinding/${item}`)}`;
|
|
202
197
|
}
|
|
203
198
|
return bIsNotFilterable === true;
|
|
204
199
|
});
|
|
@@ -210,33 +205,38 @@ function isPropertyFilterable(
|
|
|
210
205
|
sEntitySetPath: string,
|
|
211
206
|
sProperty: string,
|
|
212
207
|
bSkipHiddenFilter?: boolean
|
|
213
|
-
): boolean |
|
|
208
|
+
): boolean | CompiledBindingToolkitExpression {
|
|
214
209
|
if (typeof sProperty !== "string") {
|
|
215
210
|
throw new Error("sProperty parameter must be a string");
|
|
216
211
|
}
|
|
217
212
|
let bIsFilterable;
|
|
218
213
|
|
|
219
214
|
// Parameters should be rendered as filterfields
|
|
220
|
-
if (oModel.getObject(sEntitySetPath
|
|
215
|
+
if (oModel.getObject(`${sEntitySetPath}/@com.sap.vocabularies.Common.v1.ResultContext`) === true) {
|
|
221
216
|
return true;
|
|
222
217
|
}
|
|
223
218
|
|
|
224
|
-
const oNavigationContext = oModel.createBindingContext(sEntitySetPath
|
|
219
|
+
const oNavigationContext = oModel.createBindingContext(`${sEntitySetPath}/${sProperty}`) as Context;
|
|
225
220
|
|
|
226
|
-
if (
|
|
227
|
-
if (
|
|
221
|
+
if (!bSkipHiddenFilter) {
|
|
222
|
+
if (
|
|
223
|
+
oNavigationContext.getProperty("@com.sap.vocabularies.UI.v1.Hidden") === true ||
|
|
224
|
+
oNavigationContext.getProperty("@com.sap.vocabularies.UI.v1.HiddenFilter") === true
|
|
225
|
+
) {
|
|
228
226
|
return false;
|
|
229
227
|
}
|
|
230
228
|
const sHiddenPath = oNavigationContext.getProperty("@com.sap.vocabularies.UI.v1.Hidden/$Path");
|
|
231
|
-
|
|
232
|
-
|
|
229
|
+
const sHiddenFilterPath = oNavigationContext.getProperty("@com.sap.vocabularies.UI.v1.HiddenFilter/$Path");
|
|
230
|
+
|
|
231
|
+
if (sHiddenPath && sHiddenFilterPath) {
|
|
232
|
+
return compileExpression(not(or(pathInModel(sHiddenPath), pathInModel(sHiddenFilterPath))));
|
|
233
|
+
} else if (sHiddenPath) {
|
|
234
|
+
return compileExpression(not(pathInModel(sHiddenPath)));
|
|
235
|
+
} else if (sHiddenFilterPath) {
|
|
236
|
+
return compileExpression(not(pathInModel(sHiddenFilterPath)));
|
|
233
237
|
}
|
|
234
238
|
}
|
|
235
239
|
|
|
236
|
-
if (!bSkipHiddenFilter && oNavigationContext.getProperty("@com.sap.vocabularies.UI.v1.HiddenFilter")) {
|
|
237
|
-
return false;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
240
|
if (sEntitySetPath.split("/").length === 2 && sProperty.indexOf("/") < 0) {
|
|
241
241
|
// there is no navigation in entitySet path and property path
|
|
242
242
|
bIsFilterable = !_isInNonFilterableProperties(oModel, sEntitySetPath, sProperty);
|
|
@@ -348,7 +348,7 @@ function updateRelateAppsModel(
|
|
|
348
348
|
}
|
|
349
349
|
} else {
|
|
350
350
|
// fallback to Technical Keys if no Semantic Key is present
|
|
351
|
-
const aTechnicalKeys = oMetaModel.getObject(oMetaPath
|
|
351
|
+
const aTechnicalKeys = oMetaModel.getObject(`${oMetaPath}/$Type/$Key`);
|
|
352
352
|
for (const key in aTechnicalKeys) {
|
|
353
353
|
const sObjKey = aTechnicalKeys[key];
|
|
354
354
|
if (!oParam[sObjKey]) {
|
|
@@ -367,7 +367,7 @@ function updateRelateAppsModel(
|
|
|
367
367
|
_getSOIntents(oObjectPageLayout, aManifestSOKeys[key], oParam)
|
|
368
368
|
.then(
|
|
369
369
|
_getRelatedIntents.bind(
|
|
370
|
-
this
|
|
370
|
+
this,
|
|
371
371
|
oManifestData.additionalSemanticObjects[aManifestSOKeys[key]],
|
|
372
372
|
oBindingContext,
|
|
373
373
|
aManifestSOItems
|
|
@@ -391,8 +391,8 @@ function updateRelateAppsModel(
|
|
|
391
391
|
if (aLinks && aLinks.length > 0) {
|
|
392
392
|
const oTargetParams: any = {};
|
|
393
393
|
const aAnnotationsSOItems: any[] = [];
|
|
394
|
-
const sEntitySetPath = oMetaPath
|
|
395
|
-
const sEntityTypePath = oMetaPath
|
|
394
|
+
const sEntitySetPath = `${oMetaPath}@`;
|
|
395
|
+
const sEntityTypePath = `${oMetaPath}/@`;
|
|
396
396
|
const oEntitySetAnnotations = oMetaModel.getObject(sEntitySetPath);
|
|
397
397
|
oSemanticObjectAnnotations = _getSemanticObjectAnnotations(oEntitySetAnnotations, sCurrentSemObj);
|
|
398
398
|
if (!oSemanticObjectAnnotations.bHasEntitySetSO) {
|
|
@@ -434,8 +434,8 @@ function _getSemanticObjectAnnotations(oEntityAnnotations: any, sCurrentSemObj:
|
|
|
434
434
|
|
|
435
435
|
if (key.indexOf("#") > -1) {
|
|
436
436
|
sQualifier = key.split("#")[1];
|
|
437
|
-
sAnnotationMappingTerm = sAnnotationMappingTerm
|
|
438
|
-
sAnnotationActionTerm = sAnnotationActionTerm
|
|
437
|
+
sAnnotationMappingTerm = `${sAnnotationMappingTerm}#${sQualifier}`;
|
|
438
|
+
sAnnotationActionTerm = `${sAnnotationActionTerm}#${sQualifier}`;
|
|
439
439
|
}
|
|
440
440
|
|
|
441
441
|
oSemanticObjectAnnotations.aMappings = oSemanticObjectAnnotations.aMappings.concat(oEntityAnnotations[sAnnotationMappingTerm]);
|
|
@@ -454,7 +454,7 @@ function fnUpdateRelatedAppsDetails(oObjectPageLayout: any) {
|
|
|
454
454
|
const oPath = oBindingContext && oBindingContext.getPath();
|
|
455
455
|
const oMetaPath = oMetaModel.getMetaPath(oPath);
|
|
456
456
|
// Semantic Key Vocabulary
|
|
457
|
-
const sSemanticKeyVocabulary = oMetaPath +
|
|
457
|
+
const sSemanticKeyVocabulary = `${oMetaPath}/` + `@com.sap.vocabularies.Common.v1.SemanticKey`;
|
|
458
458
|
//Semantic Keys
|
|
459
459
|
const aSemKeys = oMetaModel.getObject(sSemanticKeyVocabulary);
|
|
460
460
|
// Unavailable Actions
|
|
@@ -462,8 +462,8 @@ function fnUpdateRelatedAppsDetails(oObjectPageLayout: any) {
|
|
|
462
462
|
if (!oEntry) {
|
|
463
463
|
oBindingContext
|
|
464
464
|
.requestObject()
|
|
465
|
-
.then(function (
|
|
466
|
-
return updateRelateAppsModel(oBindingContext,
|
|
465
|
+
.then(function (requestedObject: any) {
|
|
466
|
+
return updateRelateAppsModel(oBindingContext, requestedObject, oObjectPageLayout, aSemKeys, oMetaModel, oMetaPath);
|
|
467
467
|
})
|
|
468
468
|
.catch(function (oError: any) {
|
|
469
469
|
Log.error("Cannot update the related app details", oError);
|
|
@@ -535,7 +535,7 @@ function removeSensitiveData(aAttributes: any[], oMetaModel: ODataMetaModel) {
|
|
|
535
535
|
const aProperties = Object.keys(oAttribute);
|
|
536
536
|
for (let j = 0; j < aProperties.length; j++) {
|
|
537
537
|
const sProp = aProperties[j],
|
|
538
|
-
aPropertyAnnotations = oMetaModel.getObject(
|
|
538
|
+
aPropertyAnnotations = oMetaModel.getObject(`/${sEntitySet}/${sProp}@`);
|
|
539
539
|
if (aPropertyAnnotations) {
|
|
540
540
|
if (
|
|
541
541
|
aPropertyAnnotations["@com.sap.vocabularies.PersonalData.v1.IsPotentiallySensitive"] ||
|
|
@@ -567,7 +567,7 @@ function _fnCheckIsMatch(oObject: any, oKeysToCheck: any) {
|
|
|
567
567
|
return true;
|
|
568
568
|
}
|
|
569
569
|
function fnGetContextPathProperties(oMetaModel: ODataMetaModel, sContextPath: string, oFilter?: object) {
|
|
570
|
-
const oEntityType = oMetaModel.getObject(sContextPath
|
|
570
|
+
const oEntityType = oMetaModel.getObject(`${sContextPath}/`) || {},
|
|
571
571
|
oProperties: any = {};
|
|
572
572
|
|
|
573
573
|
for (const sKey in oEntityType) {
|
|
@@ -585,7 +585,7 @@ function fnGetContextPathProperties(oMetaModel: ODataMetaModel, sContextPath: st
|
|
|
585
585
|
function fnGetMandatoryFilterFields(oMetaModel: ODataMetaModel, sContextPath: string) {
|
|
586
586
|
let aMandatoryFilterFields;
|
|
587
587
|
if (oMetaModel && sContextPath) {
|
|
588
|
-
aMandatoryFilterFields = oMetaModel.getObject(sContextPath
|
|
588
|
+
aMandatoryFilterFields = oMetaModel.getObject(`${sContextPath}@Org.OData.Capabilities.V1.FilterRestrictions/RequiredProperties`);
|
|
589
589
|
}
|
|
590
590
|
return aMandatoryFilterFields;
|
|
591
591
|
}
|
|
@@ -662,12 +662,12 @@ function getTranslatedText(sFrameworkKey: string, oResourceBundle: ResourceBundl
|
|
|
662
662
|
// hence we need to do this recurrsively to check if the key exists in any of the bundles the forms the FE resource bundle
|
|
663
663
|
const bResourceKeyExists = _checkIfResourceKeyExists(
|
|
664
664
|
(oResourceBundle as any).aCustomBundles,
|
|
665
|
-
sFrameworkKey
|
|
665
|
+
`${sFrameworkKey}|${sEntitySetName}`
|
|
666
666
|
);
|
|
667
667
|
|
|
668
668
|
// if resource key with entity set name for instance specific text overriding is provided by the application
|
|
669
669
|
// then use the same key otherwise use the Framework key
|
|
670
|
-
sResourceKey = bResourceKeyExists ? sFrameworkKey
|
|
670
|
+
sResourceKey = bResourceKeyExists ? `${sFrameworkKey}|${sEntitySetName}` : sFrameworkKey;
|
|
671
671
|
}
|
|
672
672
|
return oResourceBundle.getText(sResourceKey, oParams);
|
|
673
673
|
}
|
|
@@ -695,18 +695,18 @@ function getActionPath(oAction: any, bReturnOnlyPath: boolean, sActionName?: str
|
|
|
695
695
|
const sEntityTypeName = oAction.getObject(sContextPath).$Type;
|
|
696
696
|
const sEntityName = getEntitySetName(oAction.getModel(), sEntityTypeName);
|
|
697
697
|
if (sEntityName) {
|
|
698
|
-
sContextPath =
|
|
698
|
+
sContextPath = `/${sEntityName}`;
|
|
699
699
|
}
|
|
700
700
|
if (bCheckStaticValue) {
|
|
701
|
-
return oAction.getObject(sContextPath
|
|
701
|
+
return oAction.getObject(`${sContextPath}/${sActionName}@Org.OData.Core.V1.OperationAvailable`);
|
|
702
702
|
}
|
|
703
703
|
if (bReturnOnlyPath) {
|
|
704
|
-
return sContextPath
|
|
704
|
+
return `${sContextPath}/${sActionName}`;
|
|
705
705
|
} else {
|
|
706
706
|
return {
|
|
707
707
|
sContextPath: sContextPath,
|
|
708
|
-
sProperty: oAction.getObject(sContextPath
|
|
709
|
-
sBindingParameter: oAction.getObject(sContextPath
|
|
708
|
+
sProperty: oAction.getObject(`${sContextPath}/${sActionName}@Org.OData.Core.V1.OperationAvailable/$Path`),
|
|
709
|
+
sBindingParameter: oAction.getObject(`${sContextPath}/${sActionName}/@$ui5.overload/0/$Parameter/0/$Name`)
|
|
710
710
|
};
|
|
711
711
|
}
|
|
712
712
|
}
|
|
@@ -741,7 +741,7 @@ function computeDisplayMode(oPropertyAnnotations: any, oCollectionAnnotations?:
|
|
|
741
741
|
}
|
|
742
742
|
function _getEntityType(oContext: any) {
|
|
743
743
|
const oMetaModel = oContext.getModel().getMetaModel();
|
|
744
|
-
return oMetaModel.getObject(oMetaModel.getMetaPath(oContext.getPath())
|
|
744
|
+
return oMetaModel.getObject(`${oMetaModel.getMetaPath(oContext.getPath())}/$Type`);
|
|
745
745
|
}
|
|
746
746
|
function _requestObject(sAction: any, oSelectedContext: any, sProperty: any) {
|
|
747
747
|
let oContext = oSelectedContext;
|
|
@@ -810,16 +810,16 @@ function _setContextsBasedOnOperationAvailable(oInternalModelContext: any, aRequ
|
|
|
810
810
|
* @param aNotApplicable
|
|
811
811
|
*/
|
|
812
812
|
function _setDynamicActionContexts(oInternalModelContext: any, sAction: any, aApplicable: any, aNotApplicable: any) {
|
|
813
|
-
const sDynamicActionPathPrefix = oInternalModelContext.getPath()
|
|
813
|
+
const sDynamicActionPathPrefix = `${oInternalModelContext.getPath()}/dynamicActions/${sAction}`,
|
|
814
814
|
oInternalModel = oInternalModelContext.getModel();
|
|
815
|
-
oInternalModel.setProperty(sDynamicActionPathPrefix
|
|
816
|
-
oInternalModel.setProperty(sDynamicActionPathPrefix
|
|
815
|
+
oInternalModel.setProperty(`${sDynamicActionPathPrefix}/aApplicable`, aApplicable);
|
|
816
|
+
oInternalModel.setProperty(`${sDynamicActionPathPrefix}/aNotApplicable`, aNotApplicable);
|
|
817
817
|
}
|
|
818
818
|
function setActionEnablement(oInternalModelContext: any, oActionOperationAvailableMap: any, aSelectedContexts: any) {
|
|
819
819
|
const aPromises = [];
|
|
820
820
|
for (const sAction in oActionOperationAvailableMap) {
|
|
821
821
|
// Reset all properties before computation
|
|
822
|
-
oInternalModelContext.setProperty(
|
|
822
|
+
oInternalModelContext.setProperty(`dynamicActions/${sAction}`, {
|
|
823
823
|
bEnabled: false,
|
|
824
824
|
aApplicable: [],
|
|
825
825
|
aNotApplicable: []
|
|
@@ -830,7 +830,7 @@ function setActionEnablement(oInternalModelContext: any, oActionOperationAvailab
|
|
|
830
830
|
const aApplicable = [],
|
|
831
831
|
aNotApplicable = [],
|
|
832
832
|
sProperty = oActionOperationAvailableMap[sAction],
|
|
833
|
-
sDynamicActionEnabledPath = oInternalModelContext.getPath()
|
|
833
|
+
sDynamicActionEnabledPath = `${oInternalModelContext.getPath()}/dynamicActions/${sAction}/bEnabled`;
|
|
834
834
|
|
|
835
835
|
if (typeof sProperty === "object" && sProperty !== null && sProperty !== undefined) {
|
|
836
836
|
for (let i = 0; i < aSelectedContexts.length; i++) {
|
|
@@ -839,14 +839,14 @@ function setActionEnablement(oInternalModelContext: any, oActionOperationAvailab
|
|
|
839
839
|
const oContextData = oSelectedContext.getObject();
|
|
840
840
|
const oTransformedBinding = transformRecursively(
|
|
841
841
|
sProperty,
|
|
842
|
-
"
|
|
842
|
+
"PathInModel",
|
|
843
843
|
// eslint-disable-next-line no-loop-func
|
|
844
844
|
function (oBindingExpression: any) {
|
|
845
845
|
return constant(oContextData[oBindingExpression.path]);
|
|
846
846
|
},
|
|
847
847
|
true
|
|
848
848
|
);
|
|
849
|
-
const sResult =
|
|
849
|
+
const sResult = compileExpression(oTransformedBinding);
|
|
850
850
|
if (sResult === "true") {
|
|
851
851
|
oInternalModelContext.getModel().setProperty(sDynamicActionEnabledPath, true);
|
|
852
852
|
aApplicable.push(oSelectedContext);
|
|
@@ -862,7 +862,7 @@ function setActionEnablement(oInternalModelContext: any, oActionOperationAvailab
|
|
|
862
862
|
const oSelectedContext = aSelectedContexts[i];
|
|
863
863
|
if (oSelectedContext) {
|
|
864
864
|
const oContextData = oSelectedContext.getObject();
|
|
865
|
-
if (sProperty === null && !!oContextData[
|
|
865
|
+
if (sProperty === null && !!oContextData[`#${sAction}`]) {
|
|
866
866
|
//look for action advertisement if present and its value is not null
|
|
867
867
|
oInternalModelContext.getModel().setProperty(sDynamicActionEnabledPath, true);
|
|
868
868
|
break;
|
|
@@ -957,7 +957,7 @@ function getOperatorsForProperty(
|
|
|
957
957
|
let aSemanticDateOps: any[] = [];
|
|
958
958
|
const oSettings = typeof sSettings === "string" ? JSON.parse(sSettings).customData : sSettings;
|
|
959
959
|
|
|
960
|
-
if (oContext.getObject(sEntitySetPath
|
|
960
|
+
if (oContext.getObject(`${sEntitySetPath}/@com.sap.vocabularies.Common.v1.ResultContext`) === true) {
|
|
961
961
|
return aEqualsOps.toString();
|
|
962
962
|
}
|
|
963
963
|
|
|
@@ -993,15 +993,20 @@ function getOperatorsForProperty(
|
|
|
993
993
|
sRestrictions = _getRestrictions(aDefaultOperators, aEqualsOps);
|
|
994
994
|
break;
|
|
995
995
|
case "SingleRange":
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
996
|
+
let aExpressionOps;
|
|
997
|
+
if (bSemanticDateRange) {
|
|
998
|
+
if (sType === "Edm.Date") {
|
|
999
|
+
aExpressionOps = aSemanticDateOps;
|
|
1000
|
+
} else if (sType === "Edm.DateTimeOffset") {
|
|
1001
|
+
aExpressionOps = aSingleRangeDateTimeOps.concat(aBasicDateTimeOps);
|
|
1002
|
+
} else {
|
|
1003
|
+
aExpressionOps = aSingleRangeOps;
|
|
1004
|
+
}
|
|
1005
|
+
} else if (sType === "Edm.DateTimeOffset") {
|
|
1006
|
+
aExpressionOps = aSingleRangeDTBasicOps;
|
|
1007
|
+
} else {
|
|
1008
|
+
aExpressionOps = aSingleRangeOps;
|
|
1009
|
+
}
|
|
1005
1010
|
const sOperators = _getRestrictions(aDefaultOperators, aExpressionOps);
|
|
1006
1011
|
sRestrictions = sOperators ? sOperators : "";
|
|
1007
1012
|
break;
|
|
@@ -1033,7 +1038,7 @@ function getOperatorsForProperty(
|
|
|
1033
1038
|
}
|
|
1034
1039
|
function getParameterInfo(oMetaModel: any, sContextPath: any) {
|
|
1035
1040
|
const sParameterContextPath = sContextPath.substring(0, sContextPath.lastIndexOf("/"));
|
|
1036
|
-
const bResultContext = oMetaModel.getObject(sParameterContextPath
|
|
1041
|
+
const bResultContext = oMetaModel.getObject(`${sParameterContextPath}/@com.sap.vocabularies.Common.v1.ResultContext`);
|
|
1037
1042
|
const oParameterInfo: any = {};
|
|
1038
1043
|
if (bResultContext && sParameterContextPath !== sContextPath) {
|
|
1039
1044
|
oParameterInfo.contextPath = sParameterContextPath;
|
|
@@ -1111,24 +1116,24 @@ function addSelectionVariantToConditions(oSelectionVariant: any, oConditions: ob
|
|
|
1111
1116
|
const aMetadataParameters = Object.keys(oValidParameterProperties);
|
|
1112
1117
|
aMetadataParameters.forEach(function (sMetadataParameter: string) {
|
|
1113
1118
|
let sSelectOptionName;
|
|
1114
|
-
if (aSelectOptionsPropertyNames.includes(
|
|
1115
|
-
sSelectOptionName =
|
|
1119
|
+
if (aSelectOptionsPropertyNames.includes(`$Parameter.${sMetadataParameter}`)) {
|
|
1120
|
+
sSelectOptionName = `$Parameter.${sMetadataParameter}`;
|
|
1116
1121
|
} else if (aSelectOptionsPropertyNames.includes(sMetadataParameter)) {
|
|
1117
1122
|
sSelectOptionName = sMetadataParameter;
|
|
1118
1123
|
} else if (
|
|
1119
1124
|
sMetadataParameter.startsWith("P_") &&
|
|
1120
|
-
aSelectOptionsPropertyNames.includes(
|
|
1125
|
+
aSelectOptionsPropertyNames.includes(`$Parameter.${sMetadataParameter.slice(2, sMetadataParameter.length)}`)
|
|
1121
1126
|
) {
|
|
1122
|
-
sSelectOptionName =
|
|
1127
|
+
sSelectOptionName = `$Parameter.${sMetadataParameter.slice(2, sMetadataParameter.length)}`;
|
|
1123
1128
|
} else if (
|
|
1124
1129
|
sMetadataParameter.startsWith("P_") &&
|
|
1125
1130
|
aSelectOptionsPropertyNames.includes(sMetadataParameter.slice(2, sMetadataParameter.length))
|
|
1126
1131
|
) {
|
|
1127
1132
|
sSelectOptionName = sMetadataParameter.slice(2, sMetadataParameter.length);
|
|
1128
|
-
} else if (aSelectOptionsPropertyNames.includes(
|
|
1129
|
-
sSelectOptionName =
|
|
1130
|
-
} else if (aSelectOptionsPropertyNames.includes(
|
|
1131
|
-
sSelectOptionName =
|
|
1133
|
+
} else if (aSelectOptionsPropertyNames.includes(`$Parameter.P_${sMetadataParameter}`)) {
|
|
1134
|
+
sSelectOptionName = `$Parameter.P_${sMetadataParameter}`;
|
|
1135
|
+
} else if (aSelectOptionsPropertyNames.includes(`P_${sMetadataParameter}`)) {
|
|
1136
|
+
sSelectOptionName = `P_${sMetadataParameter}`;
|
|
1132
1137
|
}
|
|
1133
1138
|
|
|
1134
1139
|
if (sSelectOptionName) {
|
|
@@ -1155,8 +1160,8 @@ function addSelectionVariantToConditions(oSelectionVariant: any, oConditions: ob
|
|
|
1155
1160
|
aSelectOptionsPropertyNames.includes(sMetadataProperty.slice(2, sMetadataProperty.length))
|
|
1156
1161
|
) {
|
|
1157
1162
|
sSelectOptionName = sMetadataProperty.slice(2, sMetadataProperty.length);
|
|
1158
|
-
} else if (aSelectOptionsPropertyNames.includes(
|
|
1159
|
-
sSelectOptionName =
|
|
1163
|
+
} else if (aSelectOptionsPropertyNames.includes(`P_${sMetadataProperty}`)) {
|
|
1164
|
+
sSelectOptionName = `P_${sMetadataProperty}`;
|
|
1160
1165
|
}
|
|
1161
1166
|
if (sSelectOptionName) {
|
|
1162
1167
|
addSelectOptionsToConditions(
|
|
@@ -1175,9 +1180,9 @@ function addSelectionVariantToConditions(oSelectionVariant: any, oConditions: ob
|
|
|
1175
1180
|
|
|
1176
1181
|
aSelectOptionsPropertyNames.forEach(function (sSelectOption: any) {
|
|
1177
1182
|
if (sSelectOption.indexOf(".") > 0 && !sSelectOption.includes("$Parameter")) {
|
|
1178
|
-
const sFullContextPath =
|
|
1179
|
-
?
|
|
1180
|
-
: sContextPath
|
|
1183
|
+
const sFullContextPath = `/${sSelectOption.replaceAll(".", "/")}`.startsWith(sContextPath)
|
|
1184
|
+
? `/${sSelectOption.replaceAll(".", "/")}`
|
|
1185
|
+
: `${sContextPath}/${sSelectOption.replaceAll(".", "/")}`; // check if the full path, eg SalesOrderManage._Item.Material exists in the metamodel
|
|
1181
1186
|
if (oMetaModel.getObject(sFullContextPath.replace("P_", ""))) {
|
|
1182
1187
|
_createConditionsForNavProperties(
|
|
1183
1188
|
sFullContextPath,
|
|
@@ -1210,20 +1215,20 @@ function _createConditionsForNavProperties(
|
|
|
1210
1215
|
) {
|
|
1211
1216
|
let aNavObjectNames = sSelectOption.split(".");
|
|
1212
1217
|
// Eg: "SalesOrderManage._Item._Material.Material" or "_Item.Material"
|
|
1213
|
-
if (
|
|
1214
|
-
const sFullPath = (
|
|
1215
|
-
sNavPath = sFullPath.replace(sMainEntitySetPath
|
|
1218
|
+
if (`/${sSelectOption.replaceAll(".", "/")}`.startsWith(sMainEntitySetPath)) {
|
|
1219
|
+
const sFullPath = (`/${sSelectOption}` as any).replaceAll(".", "/"),
|
|
1220
|
+
sNavPath = sFullPath.replace(`${sMainEntitySetPath}/`, "");
|
|
1216
1221
|
aNavObjectNames = sNavPath.split("/");
|
|
1217
1222
|
}
|
|
1218
1223
|
let sConditionPath = "";
|
|
1219
1224
|
const sPropertyName = aNavObjectNames[aNavObjectNames.length - 1]; // Material from SalesOrderManage._Item.Material
|
|
1220
1225
|
for (let i = 0; i < aNavObjectNames.length - 1; i++) {
|
|
1221
|
-
if (oMetaModel.getObject(sMainEntitySetPath
|
|
1222
|
-
sConditionPath = sConditionPath + aNavObjectNames[i]
|
|
1226
|
+
if (oMetaModel.getObject(`${sMainEntitySetPath}/${aNavObjectNames[i].replace("P_", "")}`).$isCollection) {
|
|
1227
|
+
sConditionPath = `${sConditionPath + aNavObjectNames[i]}*/`; // _Item*/ in case of 1:n cardinality
|
|
1223
1228
|
} else {
|
|
1224
|
-
sConditionPath = sConditionPath + aNavObjectNames[i]
|
|
1229
|
+
sConditionPath = `${sConditionPath + aNavObjectNames[i]}/`; // _Item/ in case of 1:1 cardinality
|
|
1225
1230
|
}
|
|
1226
|
-
sMainEntitySetPath = sMainEntitySetPath
|
|
1231
|
+
sMainEntitySetPath = `${sMainEntitySetPath}/${aNavObjectNames[i]}`;
|
|
1227
1232
|
}
|
|
1228
1233
|
const sNavPropertyPath = sFullContextPath.slice(0, sFullContextPath.lastIndexOf("/")),
|
|
1229
1234
|
oValidProperties = CommonUtils.getContextPathProperties(oMetaModel, sNavPropertyPath),
|
|
@@ -1233,12 +1238,11 @@ function _createConditionsForNavProperties(
|
|
|
1233
1238
|
sSelectOptionName = sPropertyName;
|
|
1234
1239
|
} else if (sPropertyName.startsWith("P_") && oValidProperties[sPropertyName.replace("P_", "")]) {
|
|
1235
1240
|
sSelectOptionName = sPropertyName.replace("P_", "");
|
|
1236
|
-
} else if (oValidProperties[
|
|
1237
|
-
sSelectOptionName =
|
|
1241
|
+
} else if (oValidProperties[`P_${sPropertyName}`] && aSelectOptionsPropertyNames.includes(`P_${sPropertyName}`)) {
|
|
1242
|
+
sSelectOptionName = `P_${sPropertyName}`;
|
|
1238
1243
|
}
|
|
1239
1244
|
if (sPropertyName.startsWith("P_") && oConditions[sConditionPath + sSelectOptionName]) {
|
|
1240
1245
|
// if there is no SalesOrderManage._Item.Material yet in the oConditions
|
|
1241
|
-
return;
|
|
1242
1246
|
} else if (!sPropertyName.startsWith("P_") && oConditions[sConditionPath + sSelectOptionName]) {
|
|
1243
1247
|
delete oConditions[sConditionPath + sSelectOptionName];
|
|
1244
1248
|
addSelectOptionsToConditions(
|
|
@@ -1292,7 +1296,7 @@ function addExternalStateFiltersToSelectionVariant(oSelectionVariant: any, mFilt
|
|
|
1292
1296
|
break;
|
|
1293
1297
|
case "EndsWith":
|
|
1294
1298
|
oSelectOptionState.option = "CP";
|
|
1295
|
-
oSelectOptionState.low =
|
|
1299
|
+
oSelectOptionState.low = `*${oSelectOptionState.low}`;
|
|
1296
1300
|
break;
|
|
1297
1301
|
case "BT":
|
|
1298
1302
|
case "LE":
|
|
@@ -1328,7 +1332,7 @@ function addExternalStateFiltersToSelectionVariant(oSelectionVariant: any, mFilt
|
|
|
1328
1332
|
break;
|
|
1329
1333
|
case "NotEndsWith":
|
|
1330
1334
|
oSelectOptionState.option = "CP";
|
|
1331
|
-
oSelectOptionState.low =
|
|
1335
|
+
oSelectOptionState.low = `*${oSelectOptionState.low}`;
|
|
1332
1336
|
oSelectOptionState.sign = "E";
|
|
1333
1337
|
break;
|
|
1334
1338
|
case "NotEmpty":
|
|
@@ -1352,29 +1356,29 @@ function addExternalStateFiltersToSelectionVariant(oSelectionVariant: any, mFilt
|
|
|
1352
1356
|
oSelectOptionState.sign = "E";
|
|
1353
1357
|
break;
|
|
1354
1358
|
default:
|
|
1355
|
-
Log.warning(sOperator
|
|
1359
|
+
Log.warning(`${sOperator} is not supported. ${sFilter} could not be added to the navigation context`);
|
|
1356
1360
|
}
|
|
1357
1361
|
return oSelectOptionState;
|
|
1358
1362
|
};
|
|
1359
1363
|
const oFilterConditions = mFilters.filterConditions;
|
|
1360
1364
|
const oFiltersWithoutConflict = mFilters.filterConditionsWithoutConflict ? mFilters.filterConditionsWithoutConflict : {};
|
|
1361
1365
|
const oTablePropertiesWithoutConflict = oTargetInfo.propertiesWithoutConflict ? oTargetInfo.propertiesWithoutConflict : {};
|
|
1362
|
-
const addFiltersToSelectionVariant = function (
|
|
1366
|
+
const addFiltersToSelectionVariant = function (selectionVariant: any, sFilterName: any, sPath?: any) {
|
|
1363
1367
|
const aFilters = oFilterConditions[sFilterName];
|
|
1364
1368
|
for (const item in aFilters) {
|
|
1365
1369
|
const oFilter = aFilters[item];
|
|
1366
1370
|
sLow = (oFilter.values[0] && oFilter.values[0].toString()) || "";
|
|
1367
1371
|
sHigh = (oFilter.values[1] && oFilter.values[1].toString()) || null;
|
|
1368
1372
|
if (oFilter.operator === "TODAY" || oFilter.operator === "DATE") {
|
|
1369
|
-
const aFilter = oFilterInfo[0].aFilters.filter(function (
|
|
1370
|
-
return
|
|
1373
|
+
const aFilter = oFilterInfo[0].aFilters.filter(function (filter: any) {
|
|
1374
|
+
return filter.sPath === sFilterName;
|
|
1371
1375
|
});
|
|
1372
1376
|
sLow = aFilter[0].oValue1 || "";
|
|
1373
1377
|
sHigh = null;
|
|
1374
1378
|
}
|
|
1375
1379
|
const oSelectOptionValues = fnGetSignAndOption(oFilter.operator, sLow, sHigh);
|
|
1376
1380
|
if (oSelectOptionValues.option) {
|
|
1377
|
-
|
|
1381
|
+
selectionVariant.addSelectOption(
|
|
1378
1382
|
sPath ? sPath : sFilterName,
|
|
1379
1383
|
oSelectOptionValues.sign,
|
|
1380
1384
|
oSelectOptionValues.option,
|
|
@@ -1437,12 +1441,13 @@ function addDefaultDisplayCurrency(aMandatoryFilterFields: any[], oSelectionVari
|
|
|
1437
1441
|
}
|
|
1438
1442
|
}
|
|
1439
1443
|
function getNonComputedVisibleFields(oMetaModel: ODataMetaModel, sPath: any, oView?: any) {
|
|
1440
|
-
const aTechnicalKeys = oMetaModel.getObject(sPath
|
|
1441
|
-
const aNonComputedVisibleFields = [];
|
|
1442
|
-
const
|
|
1444
|
+
const aTechnicalKeys = oMetaModel.getObject(`${sPath}/`).$Key;
|
|
1445
|
+
const aNonComputedVisibleFields: any = [];
|
|
1446
|
+
const aImmutableVisibleFields: any = [];
|
|
1447
|
+
const oEntityType = oMetaModel.getObject(`${sPath}/`);
|
|
1443
1448
|
for (const item in oEntityType) {
|
|
1444
1449
|
if (oEntityType[item].$kind && oEntityType[item].$kind === "Property") {
|
|
1445
|
-
const oAnnotations = oMetaModel.getObject(sPath
|
|
1450
|
+
const oAnnotations = oMetaModel.getObject(`${sPath}/${item}@`) || {},
|
|
1446
1451
|
bIsKey = aTechnicalKeys.indexOf(item) > -1,
|
|
1447
1452
|
bIsImmutable = oAnnotations["@Org.OData.Core.V1.Immutable"],
|
|
1448
1453
|
bIsNonComputed = !oAnnotations["@Org.OData.Core.V1.Computed"],
|
|
@@ -1453,11 +1458,13 @@ function getNonComputedVisibleFields(oMetaModel: ODataMetaModel, sPath: any, oVi
|
|
|
1453
1458
|
? bIsComputedDefaultValue && oAnnotations["@com.sap.vocabularies.Common.v1.Text"]
|
|
1454
1459
|
: false;
|
|
1455
1460
|
if (
|
|
1456
|
-
(
|
|
1461
|
+
(bIsKeyComputedDefaultValueWithText || (bIsKey && oEntityType[item].$Type !== "Edm.Guid")) &&
|
|
1457
1462
|
bIsNonComputed &&
|
|
1458
1463
|
bIsVisible
|
|
1459
1464
|
) {
|
|
1460
1465
|
aNonComputedVisibleFields.push(item);
|
|
1466
|
+
} else if (bIsImmutable && bIsNonComputed && bIsVisible) {
|
|
1467
|
+
aImmutableVisibleFields.push(item);
|
|
1461
1468
|
}
|
|
1462
1469
|
|
|
1463
1470
|
if (!bIsNonComputed && bIsComputedDefaultValue && oView) {
|
|
@@ -1473,8 +1480,95 @@ function getNonComputedVisibleFields(oMetaModel: ODataMetaModel, sPath: any, oVi
|
|
|
1473
1480
|
}
|
|
1474
1481
|
}
|
|
1475
1482
|
}
|
|
1476
|
-
|
|
1483
|
+
const aRequiredProperties = CommonUtils.getRequiredPropertiesFromInsertRestrictions(sPath, oMetaModel);
|
|
1484
|
+
if (aRequiredProperties.length) {
|
|
1485
|
+
aRequiredProperties.forEach(function (sProperty: any) {
|
|
1486
|
+
const oAnnotations = oMetaModel.getObject(`${sPath}/${sProperty}@`),
|
|
1487
|
+
bIsVisible = !oAnnotations || !oAnnotations["@com.sap.vocabularies.UI.v1.Hidden"];
|
|
1488
|
+
if (bIsVisible && aNonComputedVisibleFields.indexOf(sProperty) === -1 && aImmutableVisibleFields.indexOf(sProperty) === -1) {
|
|
1489
|
+
aNonComputedVisibleFields.push(sProperty);
|
|
1490
|
+
}
|
|
1491
|
+
});
|
|
1492
|
+
}
|
|
1493
|
+
return aNonComputedVisibleFields.concat(aImmutableVisibleFields);
|
|
1477
1494
|
}
|
|
1495
|
+
|
|
1496
|
+
function getRequiredProperties(sPath: any, oMetaModel: any, bCheckUpdateRestrictions: boolean = false) {
|
|
1497
|
+
const aPathParts = sPath.split("/");
|
|
1498
|
+
const aRequiredProperties: any = [];
|
|
1499
|
+
let aRequiredPropertiesWithPaths: any = [];
|
|
1500
|
+
let oEntitySetAnnotations = oMetaModel.getObject(`${sPath}@`);
|
|
1501
|
+
if (aPathParts.length > 2) {
|
|
1502
|
+
const sNavigationPath = aPathParts[aPathParts.length - 1];
|
|
1503
|
+
aPathParts.splice(-1, 1); // removing NavigationProperty from the end.
|
|
1504
|
+
const sParentEntitySetPath = aPathParts.join("/");
|
|
1505
|
+
const oNavigationRestrictions = CommonUtils.getNavigationRestrictions(oMetaModel, sParentEntitySetPath, sNavigationPath);
|
|
1506
|
+
oEntitySetAnnotations = oMetaModel.getObject(`${sParentEntitySetPath}/$NavigationPropertyBinding/${sNavigationPath}@`);
|
|
1507
|
+
if (CommonUtils.hasRestrictedPropertiesInAnnotations(oNavigationRestrictions, true, bCheckUpdateRestrictions)) {
|
|
1508
|
+
aRequiredPropertiesWithPaths = bCheckUpdateRestrictions
|
|
1509
|
+
? oNavigationRestrictions["UpdateRestrictions"].RequiredProperties
|
|
1510
|
+
: oNavigationRestrictions["InsertRestrictions"].RequiredProperties;
|
|
1511
|
+
}
|
|
1512
|
+
if (
|
|
1513
|
+
(!aRequiredPropertiesWithPaths || !aRequiredPropertiesWithPaths.length) &&
|
|
1514
|
+
CommonUtils.hasRestrictedPropertiesInAnnotations(oEntitySetAnnotations, false, bCheckUpdateRestrictions)
|
|
1515
|
+
) {
|
|
1516
|
+
aRequiredPropertiesWithPaths = CommonUtils.getRequiredPropertiesFromAnnotations(
|
|
1517
|
+
oEntitySetAnnotations,
|
|
1518
|
+
bCheckUpdateRestrictions
|
|
1519
|
+
);
|
|
1520
|
+
}
|
|
1521
|
+
} else if (CommonUtils.hasRestrictedPropertiesInAnnotations(oEntitySetAnnotations, false, bCheckUpdateRestrictions)) {
|
|
1522
|
+
aRequiredPropertiesWithPaths = CommonUtils.getRequiredPropertiesFromAnnotations(oEntitySetAnnotations, bCheckUpdateRestrictions);
|
|
1523
|
+
}
|
|
1524
|
+
aRequiredPropertiesWithPaths.forEach(function (oRequiredProperty: any) {
|
|
1525
|
+
const sProperty = oRequiredProperty["$PropertyPath"];
|
|
1526
|
+
aRequiredProperties.push(sProperty);
|
|
1527
|
+
});
|
|
1528
|
+
return aRequiredProperties;
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
function getRequiredPropertiesFromInsertRestrictions(sPath: any, oMetaModel: any) {
|
|
1532
|
+
return CommonUtils.getRequiredProperties(sPath, oMetaModel);
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
function getRequiredPropertiesFromUpdateRestrictions(sPath: any, oMetaModel: any) {
|
|
1536
|
+
return CommonUtils.getRequiredProperties(sPath, oMetaModel, true);
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
function getRequiredPropertiesFromAnnotations(oAnnotations: any, bCheckUpdateRestrictions: boolean = false) {
|
|
1540
|
+
if (bCheckUpdateRestrictions) {
|
|
1541
|
+
return oAnnotations["@Org.OData.Capabilities.V1.UpdateRestrictions"].RequiredProperties;
|
|
1542
|
+
}
|
|
1543
|
+
return oAnnotations["@Org.OData.Capabilities.V1.InsertRestrictions"].RequiredProperties;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
function hasRestrictedPropertiesInAnnotations(
|
|
1547
|
+
oAnnotations: any,
|
|
1548
|
+
bIsNavigationRestrictions: boolean = false,
|
|
1549
|
+
bCheckUpdateRestrictions: boolean = false
|
|
1550
|
+
) {
|
|
1551
|
+
if (bIsNavigationRestrictions) {
|
|
1552
|
+
if (bCheckUpdateRestrictions) {
|
|
1553
|
+
return oAnnotations && oAnnotations["UpdateRestrictions"] && oAnnotations["UpdateRestrictions"].RequiredProperties
|
|
1554
|
+
? true
|
|
1555
|
+
: false;
|
|
1556
|
+
}
|
|
1557
|
+
return oAnnotations && oAnnotations["InsertRestrictions"] && oAnnotations["InsertRestrictions"].RequiredProperties ? true : false;
|
|
1558
|
+
} else if (bCheckUpdateRestrictions) {
|
|
1559
|
+
return oAnnotations &&
|
|
1560
|
+
oAnnotations["@Org.OData.Capabilities.V1.UpdateRestrictions"] &&
|
|
1561
|
+
oAnnotations["@Org.OData.Capabilities.V1.UpdateRestrictions"].RequiredProperties
|
|
1562
|
+
? true
|
|
1563
|
+
: false;
|
|
1564
|
+
}
|
|
1565
|
+
return oAnnotations &&
|
|
1566
|
+
oAnnotations["@Org.OData.Capabilities.V1.InsertRestrictions"] &&
|
|
1567
|
+
oAnnotations["@Org.OData.Capabilities.V1.InsertRestrictions"].RequiredProperties
|
|
1568
|
+
? true
|
|
1569
|
+
: false;
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1478
1572
|
function setUserDefaults(
|
|
1479
1573
|
oAppComponent: AppComponent,
|
|
1480
1574
|
aParameters: any[],
|
|
@@ -1490,7 +1584,7 @@ function setUserDefaults(
|
|
|
1490
1584
|
if (!oShellServices.hasUShell()) {
|
|
1491
1585
|
aParameters.forEach(function (oParameter: any) {
|
|
1492
1586
|
const sPropertyName = bIsAction
|
|
1493
|
-
?
|
|
1587
|
+
? `/${oParameter.$Name}`
|
|
1494
1588
|
: oParameter.getPath().slice(oParameter.getPath().lastIndexOf("/") + 1);
|
|
1495
1589
|
const sParameterName = bIsAction ? sPropertyName.slice(1) : sPropertyName;
|
|
1496
1590
|
if (oActionDefaultValues && bIsCreate) {
|
|
@@ -1508,7 +1602,7 @@ function setUserDefaults(
|
|
|
1508
1602
|
aExtendedParameters = (oData.selectionVariant && oData.selectionVariant.SelectOptions) || [];
|
|
1509
1603
|
aParameters.forEach(function (oParameter: any) {
|
|
1510
1604
|
const sPropertyName = bIsAction
|
|
1511
|
-
?
|
|
1605
|
+
? `/${oParameter.$Name}`
|
|
1512
1606
|
: oParameter.getPath().slice(oParameter.getPath().lastIndexOf("/") + 1);
|
|
1513
1607
|
const sParameterName = bIsAction ? sPropertyName.slice(1) : sPropertyName;
|
|
1514
1608
|
if (oActionDefaultValues && bIsCreate) {
|
|
@@ -1614,7 +1708,7 @@ function getHeaderFacetItemConfigForExternalNavigation(oViewData: any, oCrossNav
|
|
|
1614
1708
|
semanticObjectMapping: aSemanticObjectMapping
|
|
1615
1709
|
};
|
|
1616
1710
|
} else {
|
|
1617
|
-
Log.error(
|
|
1711
|
+
Log.error(`Cross navigation outbound is configured without semantic object and action for ${sOutbound}`);
|
|
1618
1712
|
}
|
|
1619
1713
|
}
|
|
1620
1714
|
}
|
|
@@ -1642,9 +1736,9 @@ function setSemanticObjectMappings(oSelectionVariant: any, vMappings: object) {
|
|
|
1642
1736
|
}
|
|
1643
1737
|
function fnGetSemanticObjectsFromPath(oMetaModel: any, sPath: any) {
|
|
1644
1738
|
return new Promise(function (resolve: (value: any) => void) {
|
|
1645
|
-
const sSemanticObject = oMetaModel.getObject(sPath
|
|
1739
|
+
const sSemanticObject = oMetaModel.getObject(`${sPath}@com.sap.vocabularies.Common.v1.SemanticObject`);
|
|
1646
1740
|
const aSemanticObjectUnavailableActions = oMetaModel.getObject(
|
|
1647
|
-
sPath
|
|
1741
|
+
`${sPath}@com.sap.vocabularies.Common.v1.SemanticObjectUnavailableActions`
|
|
1648
1742
|
);
|
|
1649
1743
|
const aSemanticObjectForGetLinks = [{ semanticObject: sSemanticObject }];
|
|
1650
1744
|
const oSemanticObject = {
|
|
@@ -1822,7 +1916,7 @@ function fnGetSemanticTargetsFromPageModel(oController: any, sPageModel: string)
|
|
|
1822
1916
|
element.semanticObject.semanticObject &&
|
|
1823
1917
|
typeof element.semanticObject.semanticObject === "object"
|
|
1824
1918
|
) {
|
|
1825
|
-
sSemObjExpression =
|
|
1919
|
+
sSemObjExpression = compileExpression(pathInModel(element.semanticObject.semanticObject.$Path));
|
|
1826
1920
|
element.semanticObject.semanticObject = sSemObjExpression;
|
|
1827
1921
|
element.semanticObjectForGetLinks[0].semanticObject = sSemObjExpression;
|
|
1828
1922
|
return true;
|
|
@@ -1888,7 +1982,7 @@ function getFilterRestrictions(oFilterRestrictionsAnnotation: any, sRestriction:
|
|
|
1888
1982
|
function getFilterRestrictionsByPath(sEntitySetPath: any, oMetaModel: any) {
|
|
1889
1983
|
const oRet: any = {},
|
|
1890
1984
|
FilterRestrictions = CommonUtils.FilterRestrictions,
|
|
1891
|
-
oFilterRestrictions = sEntitySetPath ? oMetaModel.getObject(sEntitySetPath
|
|
1985
|
+
oFilterRestrictions = sEntitySetPath ? oMetaModel.getObject(`${sEntitySetPath}@Org.OData.Capabilities.V1.FilterRestrictions`) : {};
|
|
1892
1986
|
oRet[FilterRestrictions.REQUIRED_PROPERTIES] = getFilterRestrictions(oFilterRestrictions, FilterRestrictions.REQUIRED_PROPERTIES) || [];
|
|
1893
1987
|
oRet[FilterRestrictions.NON_FILTERABLE_PROPERTIES] =
|
|
1894
1988
|
getFilterRestrictions(oFilterRestrictions, FilterRestrictions.NON_FILTERABLE_PROPERTIES) || [];
|
|
@@ -1954,10 +2048,10 @@ function getSingletonPath(path: string, metaModel: ODataMetaModel): string | und
|
|
|
1954
2048
|
const parts = path.split("/").filter(Boolean),
|
|
1955
2049
|
propertyName = parts.pop(),
|
|
1956
2050
|
navigationPath = parts.join("/"),
|
|
1957
|
-
entitySet = navigationPath && metaModel.getObject(
|
|
2051
|
+
entitySet = navigationPath && metaModel.getObject(`/${navigationPath}`);
|
|
1958
2052
|
if (entitySet?.$kind === "Singleton") {
|
|
1959
2053
|
const singletonName = parts[parts.length - 1];
|
|
1960
|
-
return
|
|
2054
|
+
return `/${singletonName}/${propertyName}`;
|
|
1961
2055
|
}
|
|
1962
2056
|
return undefined;
|
|
1963
2057
|
}
|
|
@@ -2019,10 +2113,10 @@ function loadMacroLibrary() {
|
|
|
2019
2113
|
function fnOnStrictHandlingFailed(sGroupId: string, actionName: string, oModel: ODataModel, aMessages: any[]) {
|
|
2020
2114
|
const localI18nRef = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core"),
|
|
2021
2115
|
sActionName = actionName,
|
|
2022
|
-
sCancelButtonTxt = localI18nRef.getText("
|
|
2116
|
+
sCancelButtonTxt = localI18nRef.getText("C_COMMON_DIALOG_CANCEL");
|
|
2023
2117
|
if (aMessages.length === 1) {
|
|
2024
|
-
const sMessage = aMessages[0].message
|
|
2025
|
-
|
|
2118
|
+
const sMessage = `${aMessages[0].message}\n${localI18nRef.getText("PROCEED")}`;
|
|
2119
|
+
return new Promise(function (resolve) {
|
|
2026
2120
|
MessageBox.warning(sMessage, {
|
|
2027
2121
|
title: localI18nRef.getText("WARNING"),
|
|
2028
2122
|
actions: [sActionName, sCancelButtonTxt],
|
|
@@ -2037,7 +2131,6 @@ function fnOnStrictHandlingFailed(sGroupId: string, actionName: string, oModel:
|
|
|
2037
2131
|
}
|
|
2038
2132
|
});
|
|
2039
2133
|
});
|
|
2040
|
-
return dialogPromise;
|
|
2041
2134
|
}
|
|
2042
2135
|
return new Promise(function (resolve) {
|
|
2043
2136
|
const oMessageDialogModel = new JSONModel();
|
|
@@ -2085,9 +2178,9 @@ function getMessageColumn(oControl: any): string {
|
|
|
2085
2178
|
return "";
|
|
2086
2179
|
}
|
|
2087
2180
|
const headerInfoTitlePath = oControl.getParent().getTableDefinition().headerInfoTitle;
|
|
2088
|
-
const oMetaModel = oControl &&
|
|
2181
|
+
const oMetaModel = oControl && oControl.getModel().getMetaModel(),
|
|
2089
2182
|
sCurrentEntitySetName = oControl.data("metaPath");
|
|
2090
|
-
const aTechnicalKeys = oMetaModel.getObject(sCurrentEntitySetName
|
|
2183
|
+
const aTechnicalKeys = oMetaModel.getObject(`${sCurrentEntitySetName}/$Type/$Key`);
|
|
2091
2184
|
const aFilteredTechnicalKeys: string[] = [];
|
|
2092
2185
|
|
|
2093
2186
|
aTechnicalKeys.forEach(function (technicalKey: string) {
|
|
@@ -2120,6 +2213,27 @@ function getMessageColumn(oControl: any): string {
|
|
|
2120
2213
|
return subtitleColumn;
|
|
2121
2214
|
}
|
|
2122
2215
|
|
|
2216
|
+
function getKeys(oMetaModel: any, sPath: string, sEntitySetName: string): string {
|
|
2217
|
+
const sMetaPath = oMetaModel.getMetaPath(sPath);
|
|
2218
|
+
const aTechnicalKeys = oMetaModel.getObject(`${sMetaPath}/$Type/$Key`);
|
|
2219
|
+
let sKey: string = "";
|
|
2220
|
+
const semanticKey = SemanticKeyHelper.getSemanticKeys(oMetaModel, sEntitySetName);
|
|
2221
|
+
if (semanticKey !== undefined && semanticKey.length === 1) {
|
|
2222
|
+
sKey = semanticKey[0].$PropertyPath;
|
|
2223
|
+
} else if (aTechnicalKeys) {
|
|
2224
|
+
const aFilteredTechnicalKeys: string[] = [];
|
|
2225
|
+
aTechnicalKeys.forEach(function (technicalKey: string) {
|
|
2226
|
+
if (technicalKey !== "IsActiveEntity") {
|
|
2227
|
+
aFilteredTechnicalKeys.push(technicalKey);
|
|
2228
|
+
}
|
|
2229
|
+
});
|
|
2230
|
+
if (aFilteredTechnicalKeys !== undefined && aFilteredTechnicalKeys.length === 1) {
|
|
2231
|
+
sKey = aFilteredTechnicalKeys[0];
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
return sKey;
|
|
2235
|
+
}
|
|
2236
|
+
|
|
2123
2237
|
function getMessageStripText(
|
|
2124
2238
|
view: any,
|
|
2125
2239
|
aIgnoredLabels: any,
|
|
@@ -2141,19 +2255,15 @@ function getMessageStripText(
|
|
|
2141
2255
|
} else if (aIgnoredLabels.length === 1 && bIsDraftSupported) {
|
|
2142
2256
|
sText = oResourceBundle.getText("C_MULTIVIZ_CHART_IGNORED_FILTER_DRAFT_DATA");
|
|
2143
2257
|
} else {
|
|
2144
|
-
const sResource =
|
|
2145
|
-
"
|
|
2146
|
-
|
|
2147
|
-
"_IGNORED_FILTER_" +
|
|
2148
|
-
(system.desktop ? "LARGE" : "SMALL");
|
|
2258
|
+
const sResource = `C_LR_MULTIVIZ_CHART_${aIgnoredLabels.length === 1 ? "SINGLE" : "MULTI"}_IGNORED_FILTER_${
|
|
2259
|
+
system.desktop ? "LARGE" : "SMALL"
|
|
2260
|
+
}`;
|
|
2149
2261
|
sText = oResourceBundle.getText(sResource, [aIgnoredLabels.join(", ")]);
|
|
2150
2262
|
}
|
|
2151
2263
|
} else {
|
|
2152
|
-
const sResource =
|
|
2153
|
-
"
|
|
2154
|
-
|
|
2155
|
-
"_IGNORED_FILTER_" +
|
|
2156
|
-
(system.desktop ? "LARGE" : "SMALL"),
|
|
2264
|
+
const sResource = `C_LR_MULTITABLES_${aIgnoredLabels.length === 1 ? "SINGLE" : "MULTI"}_IGNORED_FILTER_${
|
|
2265
|
+
system.desktop ? "LARGE" : "SMALL"
|
|
2266
|
+
}`,
|
|
2157
2267
|
sLocalizedTableTitle = fnGetLocalizedText(sTabTitle, oFilterBar);
|
|
2158
2268
|
sText = oResourceBundle.getText(sResource, [aIgnoredLabels.join(", "), sLocalizedTableTitle]);
|
|
2159
2269
|
}
|
|
@@ -2217,7 +2327,13 @@ const CommonUtils = {
|
|
|
2217
2327
|
fnOnStrictHandlingFailed: fnOnStrictHandlingFailed,
|
|
2218
2328
|
getSingletonPath: getSingletonPath,
|
|
2219
2329
|
getMessageStripText: getMessageStripText,
|
|
2220
|
-
getMessageColumn: getMessageColumn
|
|
2330
|
+
getMessageColumn: getMessageColumn,
|
|
2331
|
+
getRequiredPropertiesFromUpdateRestrictions: getRequiredPropertiesFromUpdateRestrictions,
|
|
2332
|
+
getRequiredPropertiesFromInsertRestrictions: getRequiredPropertiesFromInsertRestrictions,
|
|
2333
|
+
hasRestrictedPropertiesInAnnotations: hasRestrictedPropertiesInAnnotations,
|
|
2334
|
+
getRequiredPropertiesFromAnnotations: getRequiredPropertiesFromAnnotations,
|
|
2335
|
+
getRequiredProperties: getRequiredProperties,
|
|
2336
|
+
getKeys: getKeys
|
|
2221
2337
|
};
|
|
2222
2338
|
|
|
2223
2339
|
export default CommonUtils;
|