@sapui5/sap.fe.core 1.102.3 → 1.105.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/ActionRuntime.js +120 -0
- package/src/sap/fe/core/ActionRuntime.ts +108 -0
- package/src/sap/fe/core/AppComponent.js +81 -35
- package/src/sap/fe/core/AppComponent.ts +68 -44
- package/src/sap/fe/core/AppStateHandler.js +82 -70
- package/src/sap/fe/core/AppStateHandler.ts +32 -37
- package/src/sap/fe/core/BaseController.js +12 -10
- package/src/sap/fe/core/BaseController.ts +15 -13
- package/src/sap/fe/core/CommonUtils.js +291 -218
- package/src/sap/fe/core/CommonUtils.ts +315 -251
- package/src/sap/fe/core/ExtensionAPI.js +25 -28
- package/src/sap/fe/core/ExtensionAPI.ts +36 -38
- package/src/sap/fe/core/PageController.js +5 -5
- package/src/sap/fe/core/PageController.ts +4 -5
- package/src/sap/fe/core/TemplateComponent.js +21 -10
- package/src/sap/fe/core/TemplateComponent.ts +9 -6
- package/src/sap/fe/core/TemplateModel.js +2 -2
- package/src/sap/fe/core/TemplateModel.ts +1 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel.js +11 -3
- package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +8 -2
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +197 -43
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +164 -24
- package/src/sap/fe/core/buildingBlocks/BuildingBlockFormatter.js +14 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockFormatter.ts +5 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +609 -230
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +275 -128
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +30 -30
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +32 -29
- package/src/sap/fe/core/controllerextensions/BusyLocker.js +1 -1
- package/src/sap/fe/core/controllerextensions/EditFlow.js +761 -700
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +478 -514
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +10 -10
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +10 -10
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +104 -75
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +71 -79
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +68 -68
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +76 -76
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +162 -102
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +177 -121
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +67 -69
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +106 -123
- package/src/sap/fe/core/controllerextensions/MassEdit.js +10 -10
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +20 -27
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +21 -13
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +21 -14
- package/src/sap/fe/core/controllerextensions/PageReady.js +98 -26
- package/src/sap/fe/core/controllerextensions/PageReady.ts +98 -34
- package/src/sap/fe/core/controllerextensions/Paginator.js +31 -32
- package/src/sap/fe/core/controllerextensions/Paginator.ts +33 -34
- package/src/sap/fe/core/controllerextensions/Placeholder.js +5 -7
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
- package/src/sap/fe/core/controllerextensions/Routing.js +11 -12
- package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
- package/src/sap/fe/core/controllerextensions/RoutingListener.js +1 -1
- package/src/sap/fe/core/controllerextensions/Share.js +171 -140
- package/src/sap/fe/core/controllerextensions/Share.ts +117 -118
- package/src/sap/fe/core/controllerextensions/SideEffects.js +47 -51
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +56 -60
- package/src/sap/fe/core/controllerextensions/ViewState.js +201 -132
- package/src/sap/fe/core/controllerextensions/ViewState.ts +141 -148
- 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 +13 -12
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.ts +17 -20
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +13 -12
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +15 -15
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +57 -18
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.ts +60 -28
- package/src/sap/fe/core/controllerextensions/collaboration/ManageDialog.fragment.xml +29 -21
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +1424 -940
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +799 -836
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +410 -377
- package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +275 -358
- package/src/sap/fe/core/controllerextensions/editFlow/draftDataLossPopup.js +309 -0
- package/src/sap/fe/core/controllerextensions/editFlow/draftDataLossPopup.ts +320 -0
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js +752 -579
- package/src/sap/fe/core/controllerextensions/editFlow/operations.ts +631 -599
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +92 -74
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +49 -52
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +78 -41
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +110 -84
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +69 -81
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +64 -73
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +18 -2
- package/src/sap/fe/core/controls/ActionParameterDialogFieldValueHelp.fragment.xml +35 -0
- package/src/sap/fe/core/controls/ActionParameterDialogValueHelp.fragment.xml +25 -24
- 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 +12 -26
- package/src/sap/fe/core/controls/CommandExecution.ts +11 -25
- package/src/sap/fe/core/controls/ConditionalWrapper.js +3 -3
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +3 -3
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +26 -26
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +25 -24
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +3 -3
- 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 +3 -3
- package/src/sap/fe/core/controls/FieldWrapper.ts +3 -3
- package/src/sap/fe/core/controls/FileWrapper.js +9 -4
- package/src/sap/fe/core/controls/FileWrapper.ts +16 -12
- package/src/sap/fe/core/controls/FilterBar.js +7 -3
- package/src/sap/fe/core/controls/FilterBar.ts +13 -9
- package/src/sap/fe/core/controls/FormElementWrapper.js +2 -2
- 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/MultiValueParameterDelegate.js +1 -1
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +44 -19
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +2 -2
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +17 -13
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +20 -22
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +4 -4
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +8 -8
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +49 -49
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +54 -54
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +8 -2
- package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +22 -35
- 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 +48 -34
- package/src/sap/fe/core/converters/ConverterContext.ts +81 -67
- package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +18 -15
- 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 +74 -40
- package/src/sap/fe/core/converters/MetaModelConverter.ts +176 -140
- 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 +58 -35
- package/src/sap/fe/core/converters/annotations/DataField.ts +102 -76
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +1956 -1494
- package/src/sap/fe/core/converters/controls/Common/Action.js +78 -51
- package/src/sap/fe/core/converters/controls/Common/Action.ts +87 -52
- package/src/sap/fe/core/converters/controls/Common/Chart.js +22 -16
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +42 -43
- 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 +65 -29
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +93 -62
- package/src/sap/fe/core/converters/controls/Common/Form.js +31 -31
- package/src/sap/fe/core/converters/controls/Common/Form.ts +46 -57
- package/src/sap/fe/core/converters/controls/Common/KPI.js +11 -11
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +49 -52
- package/src/sap/fe/core/converters/controls/Common/Table.js +251 -264
- package/src/sap/fe/core/converters/controls/Common/Table.ts +344 -370
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +119 -119
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +147 -144
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +89 -59
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +118 -71
- 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 +131 -95
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +123 -87
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +98 -87
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +121 -117
- package/src/sap/fe/core/converters/helpers/Aggregation.js +2 -4
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +12 -15
- 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 +8 -6
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +18 -10
- package/src/sap/fe/core/converters/helpers/DataFieldHelper.js +136 -0
- package/src/sap/fe/core/converters/helpers/DataFieldHelper.ts +139 -0
- package/src/sap/fe/core/converters/helpers/ID.js +48 -46
- package/src/sap/fe/core/converters/helpers/ID.ts +26 -25
- package/src/sap/fe/core/converters/helpers/IssueManager.js +1 -1
- 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 -5
- 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 +53 -75
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +59 -90
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +58 -57
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +93 -86
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +58 -44
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +87 -80
- 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 +96 -0
- package/src/sap/fe/core/formatters/StandardFormatter.ts +70 -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/TableFormatterTypes.js +1 -1
- 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/fpm/Component.js +33 -7
- package/src/sap/fe/core/fpm/Component.ts +14 -0
- package/src/sap/fe/core/helpers/AnnotationEnum.js +1 -1
- package/src/sap/fe/core/helpers/AppStartupHelper.js +19 -18
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +41 -43
- package/src/sap/fe/core/helpers/BindingToolkit.js +1836 -0
- package/src/sap/fe/core/helpers/{BindingExpression.ts → BindingToolkit.ts} +397 -270
- package/src/sap/fe/core/helpers/ClassSupport.js +49 -12
- package/src/sap/fe/core/helpers/ClassSupport.ts +37 -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/KeepAliveRefreshTypes.js +1 -1
- package/src/sap/fe/core/helpers/MassEditHelper.js +306 -280
- package/src/sap/fe/core/helpers/MassEditHelper.ts +380 -360
- package/src/sap/fe/core/helpers/MessageStrip.js +81 -0
- package/src/sap/fe/core/helpers/MessageStrip.ts +79 -0
- 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/helpers/Synchronization.js +1 -1
- package/src/sap/fe/core/helpers/ToES6Promise.js +32 -0
- package/src/sap/fe/core/helpers/ToES6Promise.ts +19 -0
- package/src/sap/fe/core/jsx-runtime/Fragment.js +16 -0
- package/src/sap/fe/core/jsx-runtime/Fragment.ts +3 -0
- package/src/sap/fe/core/jsx-runtime/ViewLoader.js +109 -0
- package/src/sap/fe/core/jsx-runtime/ViewLoader.tsx +47 -0
- package/src/sap/fe/core/jsx-runtime/jsx-control.js +110 -0
- package/src/sap/fe/core/jsx-runtime/jsx-control.ts +92 -0
- package/src/sap/fe/core/jsx-runtime/jsx-xml.js +105 -0
- package/src/sap/fe/core/jsx-runtime/jsx-xml.ts +89 -0
- package/src/sap/fe/core/jsx-runtime/jsx.js +12 -90
- package/src/sap/fe/core/jsx-runtime/jsx.ts +24 -85
- package/src/sap/fe/core/jsx-runtime/jsxs.js +1 -1
- package/src/sap/fe/core/jsx-runtime/useMDXComponents.js +179 -0
- package/src/sap/fe/core/jsx-runtime/useMDXComponents.tsx +150 -0
- package/src/sap/fe/core/library.js +42 -3
- package/src/sap/fe/core/library.support.js +1 -1
- 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 +39 -67
- package/src/sap/fe/core/messagebundle_ar.properties +27 -44
- package/src/sap/fe/core/messagebundle_bg.properties +27 -44
- package/src/sap/fe/core/messagebundle_ca.properties +27 -44
- package/src/sap/fe/core/messagebundle_cs.properties +27 -44
- package/src/sap/fe/core/messagebundle_cy.properties +26 -43
- package/src/sap/fe/core/messagebundle_da.properties +27 -44
- package/src/sap/fe/core/messagebundle_de.properties +25 -42
- package/src/sap/fe/core/messagebundle_el.properties +28 -45
- package/src/sap/fe/core/messagebundle_en.properties +27 -44
- package/src/sap/fe/core/messagebundle_en_GB.properties +27 -44
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +25 -42
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +26 -40
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +25 -42
- package/src/sap/fe/core/messagebundle_es.properties +27 -44
- package/src/sap/fe/core/messagebundle_es_MX.properties +27 -44
- package/src/sap/fe/core/messagebundle_et.properties +27 -44
- package/src/sap/fe/core/messagebundle_fi.properties +27 -44
- package/src/sap/fe/core/messagebundle_fr.properties +26 -43
- package/src/sap/fe/core/messagebundle_fr_CA.properties +25 -42
- package/src/sap/fe/core/messagebundle_hi.properties +27 -44
- package/src/sap/fe/core/messagebundle_hr.properties +27 -44
- package/src/sap/fe/core/messagebundle_hu.properties +27 -44
- package/src/sap/fe/core/messagebundle_id.properties +27 -44
- package/src/sap/fe/core/messagebundle_it.properties +43 -60
- package/src/sap/fe/core/messagebundle_iw.properties +27 -44
- package/src/sap/fe/core/messagebundle_ja.properties +27 -44
- package/src/sap/fe/core/messagebundle_kk.properties +27 -44
- package/src/sap/fe/core/messagebundle_ko.properties +30 -47
- package/src/sap/fe/core/messagebundle_lt.properties +27 -44
- package/src/sap/fe/core/messagebundle_lv.properties +27 -44
- package/src/sap/fe/core/messagebundle_ms.properties +27 -44
- package/src/sap/fe/core/messagebundle_nl.properties +29 -46
- package/src/sap/fe/core/messagebundle_no.properties +27 -44
- package/src/sap/fe/core/messagebundle_pl.properties +28 -45
- package/src/sap/fe/core/messagebundle_pt.properties +28 -45
- package/src/sap/fe/core/messagebundle_pt_PT.properties +27 -44
- package/src/sap/fe/core/messagebundle_ro.properties +27 -44
- package/src/sap/fe/core/messagebundle_ru.properties +27 -44
- package/src/sap/fe/core/messagebundle_sh.properties +27 -44
- package/src/sap/fe/core/messagebundle_sk.properties +27 -44
- package/src/sap/fe/core/messagebundle_sl.properties +27 -44
- package/src/sap/fe/core/messagebundle_sv.properties +27 -44
- package/src/sap/fe/core/messagebundle_th.properties +25 -42
- package/src/sap/fe/core/messagebundle_tr.properties +27 -44
- package/src/sap/fe/core/messagebundle_uk.properties +27 -44
- package/src/sap/fe/core/messagebundle_vi.properties +27 -44
- package/src/sap/fe/core/messagebundle_zh_CN.properties +27 -44
- package/src/sap/fe/core/messagebundle_zh_TW.properties +27 -44
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +3 -3
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +5 -5
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +103 -75
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +72 -73
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +2 -2
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +3 -2
- package/src/sap/fe/core/services/NavigationServiceFactory.js +62 -50
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +63 -52
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +3 -3
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +4 -4
- package/src/sap/fe/core/services/RoutingServiceFactory.js +56 -56
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +67 -65
- package/src/sap/fe/core/services/ShellServicesFactory.js +93 -77
- package/src/sap/fe/core/services/ShellServicesFactory.ts +95 -82
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +64 -64
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +102 -92
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +232 -200
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +145 -142
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +2 -2
- package/src/sap/fe/core/support/AnnotationIssue.support.js +1 -1
- package/src/sap/fe/core/support/CollectionFacetMissingID.support.js +1 -1
- package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +1 -1
- 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/support/InvalidAnnotationColumnKey.support.js +1 -1
- package/src/sap/fe/core/templating/CommonFormatters.js +85 -0
- package/src/sap/fe/core/templating/CommonFormatters.ts +90 -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 +23 -15
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +47 -34
- 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 +18 -17
- package/src/sap/fe/core/templating/FilterHelper.ts +18 -18
- 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 +152 -95
- package/src/sap/fe/core/templating/UIFormatters.ts +202 -128
- package/src/sap/fe/core/type/DateTimeWithTimezone.js +2 -2
- package/src/sap/fe/core/type/Email.js +3 -3
- package/src/sap/fe/core/type/Email.ts +2 -2
- package/src/sap/fe/core/helpers/BindingExpression.js +0 -1732
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CommonAnnotationTerms } from "@sap-ux/vocabularies-types/vocabularies/Common";
|
|
2
|
+
import type ResourceBundle from "sap/base/i18n/ResourceBundle";
|
|
2
3
|
import Log from "sap/base/Log";
|
|
3
4
|
import mergeObjects from "sap/base/util/merge";
|
|
4
|
-
import AppComponent from "sap/fe/core/AppComponent";
|
|
5
|
+
import type AppComponent from "sap/fe/core/AppComponent";
|
|
5
6
|
import { IssueCategory, IssueCategoryType, IssueSeverity } from "sap/fe/core/converters/helpers/IssueManager";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
bindingExpression,
|
|
9
|
-
compileBinding,
|
|
10
|
-
constant,
|
|
11
|
-
not,
|
|
12
|
-
or,
|
|
13
|
-
transformRecursively
|
|
14
|
-
} from "sap/fe/core/helpers/BindingExpression";
|
|
7
|
+
import type { CompiledBindingToolkitExpression } from "sap/fe/core/helpers/BindingToolkit";
|
|
8
|
+
import { compileExpression, not, or, pathInModel } from "sap/fe/core/helpers/BindingToolkit";
|
|
15
9
|
import ModelHelper from "sap/fe/core/helpers/ModelHelper";
|
|
16
10
|
import SemanticDateOperators from "sap/fe/core/helpers/SemanticDateOperators";
|
|
11
|
+
import SemanticKeyHelper from "sap/fe/core/helpers/SemanticKeyHelper";
|
|
17
12
|
import { generate } from "sap/fe/core/helpers/StableIdHelper";
|
|
18
13
|
import Bar from "sap/m/Bar";
|
|
19
14
|
import Button from "sap/m/Button";
|
|
@@ -21,20 +16,20 @@ import Dialog from "sap/m/Dialog";
|
|
|
21
16
|
import MessageBox from "sap/m/MessageBox";
|
|
22
17
|
import Title from "sap/m/Title";
|
|
23
18
|
import Component from "sap/ui/core/Component";
|
|
24
|
-
import Control from "sap/ui/core/Control";
|
|
19
|
+
import type Control from "sap/ui/core/Control";
|
|
25
20
|
import Core from "sap/ui/core/Core";
|
|
26
21
|
import Fragment from "sap/ui/core/Fragment";
|
|
27
22
|
import View from "sap/ui/core/mvc/View";
|
|
28
23
|
import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
|
|
29
24
|
import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
|
|
30
|
-
import { system } from "sap/ui/Device";
|
|
31
25
|
import FilterOperatorUtil from "sap/ui/mdc/condition/FilterOperatorUtil";
|
|
32
26
|
import TypeUtil from "sap/ui/mdc/odata/v4/TypeUtil";
|
|
33
|
-
import Context from "sap/ui/model/Context";
|
|
27
|
+
import type Context from "sap/ui/model/Context";
|
|
34
28
|
import JSONModel from "sap/ui/model/json/JSONModel";
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
29
|
+
import type ODataV4Context from "sap/ui/model/odata/v4/Context";
|
|
30
|
+
import type ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
|
|
31
|
+
import type ODataModel from "sap/ui/model/odata/v4/ODataModel";
|
|
32
|
+
import type { CoreEx } from "types/extension_types";
|
|
38
33
|
import messageHandling from "./controllerextensions/messageHandler/messageHandling";
|
|
39
34
|
import { getConditions } from "./templating/FilterHelper";
|
|
40
35
|
|
|
@@ -68,7 +63,7 @@ function normalizeSearchTerm(sSearchTerm: string) {
|
|
|
68
63
|
.split(/\s+/)
|
|
69
64
|
.reduce(function (sNormalized: string | undefined, sCurrentWord: string) {
|
|
70
65
|
if (sCurrentWord !== "") {
|
|
71
|
-
sNormalized =
|
|
66
|
+
sNormalized = `${sNormalized ? `${sNormalized} ` : ""}"${sCurrentWord}"`;
|
|
72
67
|
}
|
|
73
68
|
return sNormalized;
|
|
74
69
|
}, undefined);
|
|
@@ -132,12 +127,12 @@ function getSearchRestrictions(sFullPath: any, oMetaModel: any) {
|
|
|
132
127
|
if (oNavigationRestrictions && oNavigationRestrictions["SearchRestrictions"]) {
|
|
133
128
|
return oNavigationRestrictions["SearchRestrictions"];
|
|
134
129
|
}
|
|
135
|
-
sPath = sPath
|
|
130
|
+
sPath = `${sPath}/$NavigationPropertyBinding/${aNavigationParts[i]}`;
|
|
136
131
|
}
|
|
137
|
-
return oMetaModel.getObject(sFullPath
|
|
132
|
+
return oMetaModel.getObject(`${sFullPath}@Org.OData.Capabilities.V1.SearchRestrictions`);
|
|
138
133
|
}
|
|
139
134
|
function getNavigationRestrictions(oModel: any, sEntitySetPath: any, sNavigationPath: any) {
|
|
140
|
-
const oNavigationRestrictions = oModel.getObject(sEntitySetPath
|
|
135
|
+
const oNavigationRestrictions = oModel.getObject(`${sEntitySetPath}@Org.OData.Capabilities.V1.NavigationRestrictions`);
|
|
141
136
|
const aRestrictedProperties = oNavigationRestrictions && oNavigationRestrictions.RestrictedProperties;
|
|
142
137
|
return (
|
|
143
138
|
aRestrictedProperties &&
|
|
@@ -152,7 +147,7 @@ function getNavigationRestrictions(oModel: any, sEntitySetPath: any, sNavigation
|
|
|
152
147
|
}
|
|
153
148
|
function _isInNonFilterableProperties(oModel: any, sEntitySetPath: any, sContextPath: any) {
|
|
154
149
|
let bIsNotFilterable = false;
|
|
155
|
-
const oAnnotation = oModel.getObject(sEntitySetPath
|
|
150
|
+
const oAnnotation = oModel.getObject(`${sEntitySetPath}@Org.OData.Capabilities.V1.FilterRestrictions`);
|
|
156
151
|
if (oAnnotation && oAnnotation.NonFilterableProperties) {
|
|
157
152
|
bIsNotFilterable = oAnnotation.NonFilterableProperties.some(function (property: any) {
|
|
158
153
|
return property.$NavigationPropertyPath === sContextPath || property.$PropertyPath === sContextPath;
|
|
@@ -162,7 +157,7 @@ function _isInNonFilterableProperties(oModel: any, sEntitySetPath: any, sContext
|
|
|
162
157
|
}
|
|
163
158
|
// TODO rework this!
|
|
164
159
|
function _isContextPathFilterable(oModel: any, sEntitySetPath: any, sContexPath: any) {
|
|
165
|
-
const sFullPath = sEntitySetPath
|
|
160
|
+
const sFullPath = `${sEntitySetPath}/${sContexPath}`,
|
|
166
161
|
aESParts = sFullPath.split("/").splice(0, 2),
|
|
167
162
|
aContext = sFullPath.split("/").splice(2);
|
|
168
163
|
let bIsNotFilterable = false,
|
|
@@ -172,7 +167,7 @@ function _isContextPathFilterable(oModel: any, sEntitySetPath: any, sContexPath:
|
|
|
172
167
|
|
|
173
168
|
bIsNotFilterable = aContext.some(function (item: string, index: number, array: string[]) {
|
|
174
169
|
if (sContext.length > 0) {
|
|
175
|
-
sContext +=
|
|
170
|
+
sContext += `/${item}`;
|
|
176
171
|
} else {
|
|
177
172
|
sContext = item;
|
|
178
173
|
}
|
|
@@ -194,12 +189,12 @@ function _isContextPathFilterable(oModel: any, sEntitySetPath: any, sContexPath:
|
|
|
194
189
|
if (index === array.length - 1) {
|
|
195
190
|
//last path segment
|
|
196
191
|
bIsNotFilterable = _isInNonFilterableProperties(oModel, sEntitySetPath, sContext);
|
|
197
|
-
} else if (oModel.getObject(sEntitySetPath
|
|
192
|
+
} else if (oModel.getObject(`${sEntitySetPath}/$NavigationPropertyBinding/${item}`)) {
|
|
198
193
|
//check existing context path and initialize it
|
|
199
194
|
bIsNotFilterable = _isInNonFilterableProperties(oModel, sEntitySetPath, sContext);
|
|
200
195
|
sContext = "";
|
|
201
196
|
//set the new EntitySet
|
|
202
|
-
sEntitySetPath =
|
|
197
|
+
sEntitySetPath = `/${oModel.getObject(`${sEntitySetPath}/$NavigationPropertyBinding/${item}`)}`;
|
|
203
198
|
}
|
|
204
199
|
return bIsNotFilterable === true;
|
|
205
200
|
});
|
|
@@ -211,18 +206,18 @@ function isPropertyFilterable(
|
|
|
211
206
|
sEntitySetPath: string,
|
|
212
207
|
sProperty: string,
|
|
213
208
|
bSkipHiddenFilter?: boolean
|
|
214
|
-
): boolean |
|
|
209
|
+
): boolean | CompiledBindingToolkitExpression {
|
|
215
210
|
if (typeof sProperty !== "string") {
|
|
216
211
|
throw new Error("sProperty parameter must be a string");
|
|
217
212
|
}
|
|
218
213
|
let bIsFilterable;
|
|
219
214
|
|
|
220
215
|
// Parameters should be rendered as filterfields
|
|
221
|
-
if (oModel.getObject(sEntitySetPath
|
|
216
|
+
if (oModel.getObject(`${sEntitySetPath}/@com.sap.vocabularies.Common.v1.ResultContext`) === true) {
|
|
222
217
|
return true;
|
|
223
218
|
}
|
|
224
219
|
|
|
225
|
-
const oNavigationContext = oModel.createBindingContext(sEntitySetPath
|
|
220
|
+
const oNavigationContext = oModel.createBindingContext(`${sEntitySetPath}/${sProperty}`) as Context;
|
|
226
221
|
|
|
227
222
|
if (!bSkipHiddenFilter) {
|
|
228
223
|
if (
|
|
@@ -235,11 +230,11 @@ function isPropertyFilterable(
|
|
|
235
230
|
const sHiddenFilterPath = oNavigationContext.getProperty("@com.sap.vocabularies.UI.v1.HiddenFilter/$Path");
|
|
236
231
|
|
|
237
232
|
if (sHiddenPath && sHiddenFilterPath) {
|
|
238
|
-
return
|
|
233
|
+
return compileExpression(not(or(pathInModel(sHiddenPath), pathInModel(sHiddenFilterPath))));
|
|
239
234
|
} else if (sHiddenPath) {
|
|
240
|
-
return
|
|
235
|
+
return compileExpression(not(pathInModel(sHiddenPath)));
|
|
241
236
|
} else if (sHiddenFilterPath) {
|
|
242
|
-
return
|
|
237
|
+
return compileExpression(not(pathInModel(sHiddenFilterPath)));
|
|
243
238
|
}
|
|
244
239
|
}
|
|
245
240
|
|
|
@@ -354,7 +349,7 @@ function updateRelateAppsModel(
|
|
|
354
349
|
}
|
|
355
350
|
} else {
|
|
356
351
|
// fallback to Technical Keys if no Semantic Key is present
|
|
357
|
-
const aTechnicalKeys = oMetaModel.getObject(oMetaPath
|
|
352
|
+
const aTechnicalKeys = oMetaModel.getObject(`${oMetaPath}/$Type/$Key`);
|
|
358
353
|
for (const key in aTechnicalKeys) {
|
|
359
354
|
const sObjKey = aTechnicalKeys[key];
|
|
360
355
|
if (!oParam[sObjKey]) {
|
|
@@ -373,7 +368,7 @@ function updateRelateAppsModel(
|
|
|
373
368
|
_getSOIntents(oObjectPageLayout, aManifestSOKeys[key], oParam)
|
|
374
369
|
.then(
|
|
375
370
|
_getRelatedIntents.bind(
|
|
376
|
-
this
|
|
371
|
+
this,
|
|
377
372
|
oManifestData.additionalSemanticObjects[aManifestSOKeys[key]],
|
|
378
373
|
oBindingContext,
|
|
379
374
|
aManifestSOItems
|
|
@@ -397,8 +392,8 @@ function updateRelateAppsModel(
|
|
|
397
392
|
if (aLinks && aLinks.length > 0) {
|
|
398
393
|
const oTargetParams: any = {};
|
|
399
394
|
const aAnnotationsSOItems: any[] = [];
|
|
400
|
-
const sEntitySetPath = oMetaPath
|
|
401
|
-
const sEntityTypePath = oMetaPath
|
|
395
|
+
const sEntitySetPath = `${oMetaPath}@`;
|
|
396
|
+
const sEntityTypePath = `${oMetaPath}/@`;
|
|
402
397
|
const oEntitySetAnnotations = oMetaModel.getObject(sEntitySetPath);
|
|
403
398
|
oSemanticObjectAnnotations = _getSemanticObjectAnnotations(oEntitySetAnnotations, sCurrentSemObj);
|
|
404
399
|
if (!oSemanticObjectAnnotations.bHasEntitySetSO) {
|
|
@@ -433,15 +428,15 @@ function _getSemanticObjectAnnotations(oEntityAnnotations: any, sCurrentSemObj:
|
|
|
433
428
|
let sAnnotationMappingTerm, sAnnotationActionTerm;
|
|
434
429
|
let sQualifier;
|
|
435
430
|
for (const key in oEntityAnnotations) {
|
|
436
|
-
if (key.indexOf(
|
|
431
|
+
if (key.indexOf(CommonAnnotationTerms.SemanticObject) > -1 && oEntityAnnotations[key] === sCurrentSemObj) {
|
|
437
432
|
oSemanticObjectAnnotations.bHasEntitySetSO = true;
|
|
438
|
-
sAnnotationMappingTerm =
|
|
439
|
-
sAnnotationActionTerm =
|
|
433
|
+
sAnnotationMappingTerm = `@${CommonAnnotationTerms.SemanticObjectMapping}`;
|
|
434
|
+
sAnnotationActionTerm = `@${CommonAnnotationTerms.SemanticObjectUnavailableActions}`;
|
|
440
435
|
|
|
441
436
|
if (key.indexOf("#") > -1) {
|
|
442
437
|
sQualifier = key.split("#")[1];
|
|
443
|
-
sAnnotationMappingTerm = sAnnotationMappingTerm
|
|
444
|
-
sAnnotationActionTerm = sAnnotationActionTerm
|
|
438
|
+
sAnnotationMappingTerm = `${sAnnotationMappingTerm}#${sQualifier}`;
|
|
439
|
+
sAnnotationActionTerm = `${sAnnotationActionTerm}#${sQualifier}`;
|
|
445
440
|
}
|
|
446
441
|
|
|
447
442
|
oSemanticObjectAnnotations.aMappings = oSemanticObjectAnnotations.aMappings.concat(oEntityAnnotations[sAnnotationMappingTerm]);
|
|
@@ -460,7 +455,7 @@ function fnUpdateRelatedAppsDetails(oObjectPageLayout: any) {
|
|
|
460
455
|
const oPath = oBindingContext && oBindingContext.getPath();
|
|
461
456
|
const oMetaPath = oMetaModel.getMetaPath(oPath);
|
|
462
457
|
// Semantic Key Vocabulary
|
|
463
|
-
const sSemanticKeyVocabulary = oMetaPath +
|
|
458
|
+
const sSemanticKeyVocabulary = `${oMetaPath}/` + `@com.sap.vocabularies.Common.v1.SemanticKey`;
|
|
464
459
|
//Semantic Keys
|
|
465
460
|
const aSemKeys = oMetaModel.getObject(sSemanticKeyVocabulary);
|
|
466
461
|
// Unavailable Actions
|
|
@@ -468,8 +463,8 @@ function fnUpdateRelatedAppsDetails(oObjectPageLayout: any) {
|
|
|
468
463
|
if (!oEntry) {
|
|
469
464
|
oBindingContext
|
|
470
465
|
.requestObject()
|
|
471
|
-
.then(function (
|
|
472
|
-
return updateRelateAppsModel(oBindingContext,
|
|
466
|
+
.then(function (requestedObject: any) {
|
|
467
|
+
return updateRelateAppsModel(oBindingContext, requestedObject, oObjectPageLayout, aSemKeys, oMetaModel, oMetaPath);
|
|
473
468
|
})
|
|
474
469
|
.catch(function (oError: any) {
|
|
475
470
|
Log.error("Cannot update the related app details", oError);
|
|
@@ -510,7 +505,7 @@ function getTargetView(oControl: any) {
|
|
|
510
505
|
oControl = oControl.getComponentInstance();
|
|
511
506
|
oControl = oControl && oControl.getRootControl();
|
|
512
507
|
}
|
|
513
|
-
while (oControl && !(
|
|
508
|
+
while (oControl && !oControl.isA("sap.ui.core.mvc.View")) {
|
|
514
509
|
oControl = oControl.getParent();
|
|
515
510
|
}
|
|
516
511
|
return oControl;
|
|
@@ -541,7 +536,7 @@ function removeSensitiveData(aAttributes: any[], oMetaModel: ODataMetaModel) {
|
|
|
541
536
|
const aProperties = Object.keys(oAttribute);
|
|
542
537
|
for (let j = 0; j < aProperties.length; j++) {
|
|
543
538
|
const sProp = aProperties[j],
|
|
544
|
-
aPropertyAnnotations = oMetaModel.getObject(
|
|
539
|
+
aPropertyAnnotations = oMetaModel.getObject(`/${sEntitySet}/${sProp}@`);
|
|
545
540
|
if (aPropertyAnnotations) {
|
|
546
541
|
if (
|
|
547
542
|
aPropertyAnnotations["@com.sap.vocabularies.PersonalData.v1.IsPotentiallySensitive"] ||
|
|
@@ -573,7 +568,7 @@ function _fnCheckIsMatch(oObject: any, oKeysToCheck: any) {
|
|
|
573
568
|
return true;
|
|
574
569
|
}
|
|
575
570
|
function fnGetContextPathProperties(oMetaModel: ODataMetaModel, sContextPath: string, oFilter?: object) {
|
|
576
|
-
const oEntityType = oMetaModel.getObject(sContextPath
|
|
571
|
+
const oEntityType = oMetaModel.getObject(`${sContextPath}/`) || {},
|
|
577
572
|
oProperties: any = {};
|
|
578
573
|
|
|
579
574
|
for (const sKey in oEntityType) {
|
|
@@ -591,7 +586,7 @@ function fnGetContextPathProperties(oMetaModel: ODataMetaModel, sContextPath: st
|
|
|
591
586
|
function fnGetMandatoryFilterFields(oMetaModel: ODataMetaModel, sContextPath: string) {
|
|
592
587
|
let aMandatoryFilterFields;
|
|
593
588
|
if (oMetaModel && sContextPath) {
|
|
594
|
-
aMandatoryFilterFields = oMetaModel.getObject(sContextPath
|
|
589
|
+
aMandatoryFilterFields = oMetaModel.getObject(`${sContextPath}@Org.OData.Capabilities.V1.FilterRestrictions/RequiredProperties`);
|
|
595
590
|
}
|
|
596
591
|
return aMandatoryFilterFields;
|
|
597
592
|
}
|
|
@@ -666,14 +661,14 @@ function getTranslatedText(sFrameworkKey: string, oResourceBundle: ResourceBundl
|
|
|
666
661
|
|
|
667
662
|
// "hasText" only checks for the key in the immediate resource bundle and not it's custom bundles
|
|
668
663
|
// hence we need to do this recurrsively to check if the key exists in any of the bundles the forms the FE resource bundle
|
|
669
|
-
const bResourceKeyExists =
|
|
664
|
+
const bResourceKeyExists = checkIfResourceKeyExists(
|
|
670
665
|
(oResourceBundle as any).aCustomBundles,
|
|
671
|
-
sFrameworkKey
|
|
666
|
+
`${sFrameworkKey}|${sEntitySetName}`
|
|
672
667
|
);
|
|
673
668
|
|
|
674
669
|
// if resource key with entity set name for instance specific text overriding is provided by the application
|
|
675
670
|
// then use the same key otherwise use the Framework key
|
|
676
|
-
sResourceKey = bResourceKeyExists ? sFrameworkKey
|
|
671
|
+
sResourceKey = bResourceKeyExists ? `${sFrameworkKey}|${sEntitySetName}` : sFrameworkKey;
|
|
677
672
|
}
|
|
678
673
|
return oResourceBundle.getText(sResourceKey, oParams);
|
|
679
674
|
}
|
|
@@ -682,7 +677,7 @@ function getTranslatedText(sFrameworkKey: string, oResourceBundle: ResourceBundl
|
|
|
682
677
|
oResourceBundle = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core");
|
|
683
678
|
return oResourceBundle.getText(sResourceKey, oParams);
|
|
684
679
|
}
|
|
685
|
-
function
|
|
680
|
+
function checkIfResourceKeyExists(aCustomBundles: any, sKey: any) {
|
|
686
681
|
if (aCustomBundles.length) {
|
|
687
682
|
for (let i = aCustomBundles.length - 1; i >= 0; i--) {
|
|
688
683
|
const sValue = aCustomBundles[i].hasText(sKey);
|
|
@@ -690,7 +685,7 @@ function _checkIfResourceKeyExists(aCustomBundles: any, sKey: any) {
|
|
|
690
685
|
if (sValue) {
|
|
691
686
|
return true;
|
|
692
687
|
}
|
|
693
|
-
|
|
688
|
+
checkIfResourceKeyExists(aCustomBundles[i].aCustomBundles, sKey);
|
|
694
689
|
}
|
|
695
690
|
}
|
|
696
691
|
return false;
|
|
@@ -701,18 +696,18 @@ function getActionPath(oAction: any, bReturnOnlyPath: boolean, sActionName?: str
|
|
|
701
696
|
const sEntityTypeName = oAction.getObject(sContextPath).$Type;
|
|
702
697
|
const sEntityName = getEntitySetName(oAction.getModel(), sEntityTypeName);
|
|
703
698
|
if (sEntityName) {
|
|
704
|
-
sContextPath =
|
|
699
|
+
sContextPath = `/${sEntityName}`;
|
|
705
700
|
}
|
|
706
701
|
if (bCheckStaticValue) {
|
|
707
|
-
return oAction.getObject(sContextPath
|
|
702
|
+
return oAction.getObject(`${sContextPath}/${sActionName}@Org.OData.Core.V1.OperationAvailable`);
|
|
708
703
|
}
|
|
709
704
|
if (bReturnOnlyPath) {
|
|
710
|
-
return sContextPath
|
|
705
|
+
return `${sContextPath}/${sActionName}`;
|
|
711
706
|
} else {
|
|
712
707
|
return {
|
|
713
708
|
sContextPath: sContextPath,
|
|
714
|
-
sProperty: oAction.getObject(sContextPath
|
|
715
|
-
sBindingParameter: oAction.getObject(sContextPath
|
|
709
|
+
sProperty: oAction.getObject(`${sContextPath}/${sActionName}@Org.OData.Core.V1.OperationAvailable/$Path`),
|
|
710
|
+
sBindingParameter: oAction.getObject(`${sContextPath}/${sActionName}/@$ui5.overload/0/$Parameter/0/$Name`)
|
|
716
711
|
};
|
|
717
712
|
}
|
|
718
713
|
}
|
|
@@ -747,7 +742,7 @@ function computeDisplayMode(oPropertyAnnotations: any, oCollectionAnnotations?:
|
|
|
747
742
|
}
|
|
748
743
|
function _getEntityType(oContext: any) {
|
|
749
744
|
const oMetaModel = oContext.getModel().getMetaModel();
|
|
750
|
-
return oMetaModel.getObject(oMetaModel.getMetaPath(oContext.getPath())
|
|
745
|
+
return oMetaModel.getObject(`${oMetaModel.getMetaPath(oContext.getPath())}/$Type`);
|
|
751
746
|
}
|
|
752
747
|
function _requestObject(sAction: any, oSelectedContext: any, sProperty: any) {
|
|
753
748
|
let oContext = oSelectedContext;
|
|
@@ -771,7 +766,7 @@ function _requestObject(sAction: any, oSelectedContext: any, sProperty: any) {
|
|
|
771
766
|
|
|
772
767
|
return oContext.requestObject(sProperty);
|
|
773
768
|
}
|
|
774
|
-
function
|
|
769
|
+
function requestProperty(oSelectedContext: any, sAction: any, sProperty: any, sDynamicActionEnabledPath: any) {
|
|
775
770
|
const oPromise =
|
|
776
771
|
sProperty && sProperty.indexOf("/") === 0
|
|
777
772
|
? requestSingletonProperty(sProperty, oSelectedContext.getModel())
|
|
@@ -786,7 +781,7 @@ function _requestProperty(oSelectedContext: any, sAction: any, sProperty: any, s
|
|
|
786
781
|
});
|
|
787
782
|
});
|
|
788
783
|
}
|
|
789
|
-
function
|
|
784
|
+
function setContextsBasedOnOperationAvailable(oInternalModelContext: any, aRequestPromises: any) {
|
|
790
785
|
return Promise.all(aRequestPromises)
|
|
791
786
|
.then(function (aResults: any[]) {
|
|
792
787
|
if (aResults.length) {
|
|
@@ -802,7 +797,7 @@ function _setContextsBasedOnOperationAvailable(oInternalModelContext: any, aRequ
|
|
|
802
797
|
}
|
|
803
798
|
}
|
|
804
799
|
});
|
|
805
|
-
|
|
800
|
+
setDynamicActionContexts(oInternalModelContext, aResults[0].sAction, aApplicableContexts, aNotApplicableContexts);
|
|
806
801
|
}
|
|
807
802
|
})
|
|
808
803
|
.catch(function (oError: any) {
|
|
@@ -815,77 +810,11 @@ function _setContextsBasedOnOperationAvailable(oInternalModelContext: any, aRequ
|
|
|
815
810
|
* @param aApplicable
|
|
816
811
|
* @param aNotApplicable
|
|
817
812
|
*/
|
|
818
|
-
function
|
|
819
|
-
const sDynamicActionPathPrefix = oInternalModelContext.getPath()
|
|
813
|
+
function setDynamicActionContexts(oInternalModelContext: any, sAction: any, aApplicable: any, aNotApplicable: any) {
|
|
814
|
+
const sDynamicActionPathPrefix = `${oInternalModelContext.getPath()}/dynamicActions/${sAction}`,
|
|
820
815
|
oInternalModel = oInternalModelContext.getModel();
|
|
821
|
-
oInternalModel.setProperty(sDynamicActionPathPrefix
|
|
822
|
-
oInternalModel.setProperty(sDynamicActionPathPrefix
|
|
823
|
-
}
|
|
824
|
-
function setActionEnablement(oInternalModelContext: any, oActionOperationAvailableMap: any, aSelectedContexts: any) {
|
|
825
|
-
const aPromises = [];
|
|
826
|
-
for (const sAction in oActionOperationAvailableMap) {
|
|
827
|
-
// Reset all properties before computation
|
|
828
|
-
oInternalModelContext.setProperty("dynamicActions/" + sAction, {
|
|
829
|
-
bEnabled: false,
|
|
830
|
-
aApplicable: [],
|
|
831
|
-
aNotApplicable: []
|
|
832
|
-
});
|
|
833
|
-
// Note that non dynamic actions are not processed here. They are enabled because
|
|
834
|
-
// one or more are selected and the second part of the condition in the templating
|
|
835
|
-
// is then undefined and thus the button takes the default enabling, which is true!
|
|
836
|
-
const aApplicable = [],
|
|
837
|
-
aNotApplicable = [],
|
|
838
|
-
sProperty = oActionOperationAvailableMap[sAction],
|
|
839
|
-
sDynamicActionEnabledPath = oInternalModelContext.getPath() + "/dynamicActions/" + sAction + "/bEnabled";
|
|
840
|
-
|
|
841
|
-
if (typeof sProperty === "object" && sProperty !== null && sProperty !== undefined) {
|
|
842
|
-
for (let i = 0; i < aSelectedContexts.length; i++) {
|
|
843
|
-
const oSelectedContext = aSelectedContexts[i];
|
|
844
|
-
if (oSelectedContext) {
|
|
845
|
-
const oContextData = oSelectedContext.getObject();
|
|
846
|
-
const oTransformedBinding = transformRecursively(
|
|
847
|
-
sProperty,
|
|
848
|
-
"Binding",
|
|
849
|
-
// eslint-disable-next-line no-loop-func
|
|
850
|
-
function (oBindingExpression: any) {
|
|
851
|
-
return constant(oContextData[oBindingExpression.path]);
|
|
852
|
-
},
|
|
853
|
-
true
|
|
854
|
-
);
|
|
855
|
-
const sResult = compileBinding(oTransformedBinding);
|
|
856
|
-
if (sResult === "true") {
|
|
857
|
-
oInternalModelContext.getModel().setProperty(sDynamicActionEnabledPath, true);
|
|
858
|
-
aApplicable.push(oSelectedContext);
|
|
859
|
-
} else {
|
|
860
|
-
aNotApplicable.push(oSelectedContext);
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
_setDynamicActionContexts(oInternalModelContext, sAction, aApplicable, aNotApplicable);
|
|
865
|
-
} else {
|
|
866
|
-
const aRequestPromises = [];
|
|
867
|
-
for (let i = 0; i < aSelectedContexts.length; i++) {
|
|
868
|
-
const oSelectedContext = aSelectedContexts[i];
|
|
869
|
-
if (oSelectedContext) {
|
|
870
|
-
const oContextData = oSelectedContext.getObject();
|
|
871
|
-
if (sProperty === null && !!oContextData["#" + sAction]) {
|
|
872
|
-
//look for action advertisement if present and its value is not null
|
|
873
|
-
oInternalModelContext.getModel().setProperty(sDynamicActionEnabledPath, true);
|
|
874
|
-
break;
|
|
875
|
-
} else {
|
|
876
|
-
// Collect promises to retrieve singleton or normal property value asynchronously
|
|
877
|
-
aRequestPromises.push(_requestProperty(oSelectedContext, sAction, sProperty, sDynamicActionEnabledPath));
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
// When all property values have been retrieved, set
|
|
883
|
-
// The applicable and not-applicable selected contexts for each action and
|
|
884
|
-
// The enabled property of the dynamic action in internal model context.
|
|
885
|
-
aPromises.push(_setContextsBasedOnOperationAvailable(oInternalModelContext, aRequestPromises));
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
return Promise.all(aPromises);
|
|
816
|
+
oInternalModel.setProperty(`${sDynamicActionPathPrefix}/aApplicable`, aApplicable);
|
|
817
|
+
oInternalModel.setProperty(`${sDynamicActionPathPrefix}/aNotApplicable`, aNotApplicable);
|
|
889
818
|
}
|
|
890
819
|
|
|
891
820
|
function setObjectMappings(sSemanticObject: string, oParams: any, aSemanticObjectMappings: any) {
|
|
@@ -963,7 +892,7 @@ function getOperatorsForProperty(
|
|
|
963
892
|
let aSemanticDateOps: any[] = [];
|
|
964
893
|
const oSettings = typeof sSettings === "string" ? JSON.parse(sSettings).customData : sSettings;
|
|
965
894
|
|
|
966
|
-
if (oContext.getObject(sEntitySetPath
|
|
895
|
+
if (oContext.getObject(`${sEntitySetPath}/@com.sap.vocabularies.Common.v1.ResultContext`) === true) {
|
|
967
896
|
return aEqualsOps.toString();
|
|
968
897
|
}
|
|
969
898
|
|
|
@@ -999,15 +928,20 @@ function getOperatorsForProperty(
|
|
|
999
928
|
sRestrictions = _getRestrictions(aDefaultOperators, aEqualsOps);
|
|
1000
929
|
break;
|
|
1001
930
|
case "SingleRange":
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
931
|
+
let aExpressionOps;
|
|
932
|
+
if (bSemanticDateRange) {
|
|
933
|
+
if (sType === "Edm.Date") {
|
|
934
|
+
aExpressionOps = aSemanticDateOps;
|
|
935
|
+
} else if (sType === "Edm.DateTimeOffset") {
|
|
936
|
+
aExpressionOps = aSingleRangeDateTimeOps.concat(aBasicDateTimeOps);
|
|
937
|
+
} else {
|
|
938
|
+
aExpressionOps = aSingleRangeOps;
|
|
939
|
+
}
|
|
940
|
+
} else if (sType === "Edm.DateTimeOffset") {
|
|
941
|
+
aExpressionOps = aSingleRangeDTBasicOps;
|
|
942
|
+
} else {
|
|
943
|
+
aExpressionOps = aSingleRangeOps;
|
|
944
|
+
}
|
|
1011
945
|
const sOperators = _getRestrictions(aDefaultOperators, aExpressionOps);
|
|
1012
946
|
sRestrictions = sOperators ? sOperators : "";
|
|
1013
947
|
break;
|
|
@@ -1039,7 +973,7 @@ function getOperatorsForProperty(
|
|
|
1039
973
|
}
|
|
1040
974
|
function getParameterInfo(oMetaModel: any, sContextPath: any) {
|
|
1041
975
|
const sParameterContextPath = sContextPath.substring(0, sContextPath.lastIndexOf("/"));
|
|
1042
|
-
const bResultContext = oMetaModel.getObject(sParameterContextPath
|
|
976
|
+
const bResultContext = oMetaModel.getObject(`${sParameterContextPath}/@com.sap.vocabularies.Common.v1.ResultContext`);
|
|
1043
977
|
const oParameterInfo: any = {};
|
|
1044
978
|
if (bResultContext && sParameterContextPath !== sContextPath) {
|
|
1045
979
|
oParameterInfo.contextPath = sParameterContextPath;
|
|
@@ -1117,24 +1051,24 @@ function addSelectionVariantToConditions(oSelectionVariant: any, oConditions: ob
|
|
|
1117
1051
|
const aMetadataParameters = Object.keys(oValidParameterProperties);
|
|
1118
1052
|
aMetadataParameters.forEach(function (sMetadataParameter: string) {
|
|
1119
1053
|
let sSelectOptionName;
|
|
1120
|
-
if (aSelectOptionsPropertyNames.includes(
|
|
1121
|
-
sSelectOptionName =
|
|
1054
|
+
if (aSelectOptionsPropertyNames.includes(`$Parameter.${sMetadataParameter}`)) {
|
|
1055
|
+
sSelectOptionName = `$Parameter.${sMetadataParameter}`;
|
|
1122
1056
|
} else if (aSelectOptionsPropertyNames.includes(sMetadataParameter)) {
|
|
1123
1057
|
sSelectOptionName = sMetadataParameter;
|
|
1124
1058
|
} else if (
|
|
1125
1059
|
sMetadataParameter.startsWith("P_") &&
|
|
1126
|
-
aSelectOptionsPropertyNames.includes(
|
|
1060
|
+
aSelectOptionsPropertyNames.includes(`$Parameter.${sMetadataParameter.slice(2, sMetadataParameter.length)}`)
|
|
1127
1061
|
) {
|
|
1128
|
-
sSelectOptionName =
|
|
1062
|
+
sSelectOptionName = `$Parameter.${sMetadataParameter.slice(2, sMetadataParameter.length)}`;
|
|
1129
1063
|
} else if (
|
|
1130
1064
|
sMetadataParameter.startsWith("P_") &&
|
|
1131
1065
|
aSelectOptionsPropertyNames.includes(sMetadataParameter.slice(2, sMetadataParameter.length))
|
|
1132
1066
|
) {
|
|
1133
1067
|
sSelectOptionName = sMetadataParameter.slice(2, sMetadataParameter.length);
|
|
1134
|
-
} else if (aSelectOptionsPropertyNames.includes(
|
|
1135
|
-
sSelectOptionName =
|
|
1136
|
-
} else if (aSelectOptionsPropertyNames.includes(
|
|
1137
|
-
sSelectOptionName =
|
|
1068
|
+
} else if (aSelectOptionsPropertyNames.includes(`$Parameter.P_${sMetadataParameter}`)) {
|
|
1069
|
+
sSelectOptionName = `$Parameter.P_${sMetadataParameter}`;
|
|
1070
|
+
} else if (aSelectOptionsPropertyNames.includes(`P_${sMetadataParameter}`)) {
|
|
1071
|
+
sSelectOptionName = `P_${sMetadataParameter}`;
|
|
1138
1072
|
}
|
|
1139
1073
|
|
|
1140
1074
|
if (sSelectOptionName) {
|
|
@@ -1161,8 +1095,8 @@ function addSelectionVariantToConditions(oSelectionVariant: any, oConditions: ob
|
|
|
1161
1095
|
aSelectOptionsPropertyNames.includes(sMetadataProperty.slice(2, sMetadataProperty.length))
|
|
1162
1096
|
) {
|
|
1163
1097
|
sSelectOptionName = sMetadataProperty.slice(2, sMetadataProperty.length);
|
|
1164
|
-
} else if (aSelectOptionsPropertyNames.includes(
|
|
1165
|
-
sSelectOptionName =
|
|
1098
|
+
} else if (aSelectOptionsPropertyNames.includes(`P_${sMetadataProperty}`)) {
|
|
1099
|
+
sSelectOptionName = `P_${sMetadataProperty}`;
|
|
1166
1100
|
}
|
|
1167
1101
|
if (sSelectOptionName) {
|
|
1168
1102
|
addSelectOptionsToConditions(
|
|
@@ -1181,9 +1115,10 @@ function addSelectionVariantToConditions(oSelectionVariant: any, oConditions: ob
|
|
|
1181
1115
|
|
|
1182
1116
|
aSelectOptionsPropertyNames.forEach(function (sSelectOption: any) {
|
|
1183
1117
|
if (sSelectOption.indexOf(".") > 0 && !sSelectOption.includes("$Parameter")) {
|
|
1184
|
-
const
|
|
1185
|
-
|
|
1186
|
-
|
|
1118
|
+
const sReplacedOption = sSelectOption.replaceAll(".", "/");
|
|
1119
|
+
const sFullContextPath = `/${sReplacedOption}`.startsWith(sContextPath)
|
|
1120
|
+
? `/${sReplacedOption}`
|
|
1121
|
+
: `${sContextPath}/${sReplacedOption}`; // check if the full path, eg SalesOrderManage._Item.Material exists in the metamodel
|
|
1187
1122
|
if (oMetaModel.getObject(sFullContextPath.replace("P_", ""))) {
|
|
1188
1123
|
_createConditionsForNavProperties(
|
|
1189
1124
|
sFullContextPath,
|
|
@@ -1216,20 +1151,20 @@ function _createConditionsForNavProperties(
|
|
|
1216
1151
|
) {
|
|
1217
1152
|
let aNavObjectNames = sSelectOption.split(".");
|
|
1218
1153
|
// Eg: "SalesOrderManage._Item._Material.Material" or "_Item.Material"
|
|
1219
|
-
if (
|
|
1220
|
-
const sFullPath = (
|
|
1221
|
-
sNavPath = sFullPath.replace(sMainEntitySetPath
|
|
1154
|
+
if (`/${sSelectOption.replaceAll(".", "/")}`.startsWith(sMainEntitySetPath)) {
|
|
1155
|
+
const sFullPath = (`/${sSelectOption}` as any).replaceAll(".", "/"),
|
|
1156
|
+
sNavPath = sFullPath.replace(`${sMainEntitySetPath}/`, "");
|
|
1222
1157
|
aNavObjectNames = sNavPath.split("/");
|
|
1223
1158
|
}
|
|
1224
1159
|
let sConditionPath = "";
|
|
1225
1160
|
const sPropertyName = aNavObjectNames[aNavObjectNames.length - 1]; // Material from SalesOrderManage._Item.Material
|
|
1226
1161
|
for (let i = 0; i < aNavObjectNames.length - 1; i++) {
|
|
1227
|
-
if (oMetaModel.getObject(sMainEntitySetPath
|
|
1228
|
-
sConditionPath = sConditionPath + aNavObjectNames[i]
|
|
1162
|
+
if (oMetaModel.getObject(`${sMainEntitySetPath}/${aNavObjectNames[i].replace("P_", "")}`).$isCollection) {
|
|
1163
|
+
sConditionPath = `${sConditionPath + aNavObjectNames[i]}*/`; // _Item*/ in case of 1:n cardinality
|
|
1229
1164
|
} else {
|
|
1230
|
-
sConditionPath = sConditionPath + aNavObjectNames[i]
|
|
1165
|
+
sConditionPath = `${sConditionPath + aNavObjectNames[i]}/`; // _Item/ in case of 1:1 cardinality
|
|
1231
1166
|
}
|
|
1232
|
-
sMainEntitySetPath = sMainEntitySetPath
|
|
1167
|
+
sMainEntitySetPath = `${sMainEntitySetPath}/${aNavObjectNames[i]}`;
|
|
1233
1168
|
}
|
|
1234
1169
|
const sNavPropertyPath = sFullContextPath.slice(0, sFullContextPath.lastIndexOf("/")),
|
|
1235
1170
|
oValidProperties = CommonUtils.getContextPathProperties(oMetaModel, sNavPropertyPath),
|
|
@@ -1239,12 +1174,11 @@ function _createConditionsForNavProperties(
|
|
|
1239
1174
|
sSelectOptionName = sPropertyName;
|
|
1240
1175
|
} else if (sPropertyName.startsWith("P_") && oValidProperties[sPropertyName.replace("P_", "")]) {
|
|
1241
1176
|
sSelectOptionName = sPropertyName.replace("P_", "");
|
|
1242
|
-
} else if (oValidProperties[
|
|
1243
|
-
sSelectOptionName =
|
|
1177
|
+
} else if (oValidProperties[`P_${sPropertyName}`] && aSelectOptionsPropertyNames.includes(`P_${sPropertyName}`)) {
|
|
1178
|
+
sSelectOptionName = `P_${sPropertyName}`;
|
|
1244
1179
|
}
|
|
1245
1180
|
if (sPropertyName.startsWith("P_") && oConditions[sConditionPath + sSelectOptionName]) {
|
|
1246
1181
|
// if there is no SalesOrderManage._Item.Material yet in the oConditions
|
|
1247
|
-
return;
|
|
1248
1182
|
} else if (!sPropertyName.startsWith("P_") && oConditions[sConditionPath + sSelectOptionName]) {
|
|
1249
1183
|
delete oConditions[sConditionPath + sSelectOptionName];
|
|
1250
1184
|
addSelectOptionsToConditions(
|
|
@@ -1298,7 +1232,7 @@ function addExternalStateFiltersToSelectionVariant(oSelectionVariant: any, mFilt
|
|
|
1298
1232
|
break;
|
|
1299
1233
|
case "EndsWith":
|
|
1300
1234
|
oSelectOptionState.option = "CP";
|
|
1301
|
-
oSelectOptionState.low =
|
|
1235
|
+
oSelectOptionState.low = `*${oSelectOptionState.low}`;
|
|
1302
1236
|
break;
|
|
1303
1237
|
case "BT":
|
|
1304
1238
|
case "LE":
|
|
@@ -1334,7 +1268,7 @@ function addExternalStateFiltersToSelectionVariant(oSelectionVariant: any, mFilt
|
|
|
1334
1268
|
break;
|
|
1335
1269
|
case "NotEndsWith":
|
|
1336
1270
|
oSelectOptionState.option = "CP";
|
|
1337
|
-
oSelectOptionState.low =
|
|
1271
|
+
oSelectOptionState.low = `*${oSelectOptionState.low}`;
|
|
1338
1272
|
oSelectOptionState.sign = "E";
|
|
1339
1273
|
break;
|
|
1340
1274
|
case "NotEmpty":
|
|
@@ -1358,29 +1292,31 @@ function addExternalStateFiltersToSelectionVariant(oSelectionVariant: any, mFilt
|
|
|
1358
1292
|
oSelectOptionState.sign = "E";
|
|
1359
1293
|
break;
|
|
1360
1294
|
default:
|
|
1361
|
-
Log.warning(sOperator
|
|
1295
|
+
Log.warning(`${sOperator} is not supported. ${sFilter} could not be added to the navigation context`);
|
|
1362
1296
|
}
|
|
1363
1297
|
return oSelectOptionState;
|
|
1364
1298
|
};
|
|
1365
1299
|
const oFilterConditions = mFilters.filterConditions;
|
|
1366
1300
|
const oFiltersWithoutConflict = mFilters.filterConditionsWithoutConflict ? mFilters.filterConditionsWithoutConflict : {};
|
|
1367
1301
|
const oTablePropertiesWithoutConflict = oTargetInfo.propertiesWithoutConflict ? oTargetInfo.propertiesWithoutConflict : {};
|
|
1368
|
-
const addFiltersToSelectionVariant = function (
|
|
1302
|
+
const addFiltersToSelectionVariant = function (selectionVariant: any, sFilterName: any, sPath?: any) {
|
|
1369
1303
|
const aFilters = oFilterConditions[sFilterName];
|
|
1370
1304
|
for (const item in aFilters) {
|
|
1371
1305
|
const oFilter = aFilters[item];
|
|
1372
1306
|
sLow = (oFilter.values[0] && oFilter.values[0].toString()) || "";
|
|
1373
1307
|
sHigh = (oFilter.values[1] && oFilter.values[1].toString()) || null;
|
|
1374
1308
|
if (oFilter.operator === "TODAY" || oFilter.operator === "DATE") {
|
|
1375
|
-
const aFilter =
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1309
|
+
const aFilter =
|
|
1310
|
+
oFilterInfo[0].aFilters &&
|
|
1311
|
+
oFilterInfo[0].aFilters.filter(function (filter: any) {
|
|
1312
|
+
return filter.sPath === sFilterName;
|
|
1313
|
+
});
|
|
1314
|
+
sLow = (aFilter && aFilter[0].oValue1) || oFilterInfo[0].oValue1 || "";
|
|
1379
1315
|
sHigh = null;
|
|
1380
1316
|
}
|
|
1381
1317
|
const oSelectOptionValues = fnGetSignAndOption(oFilter.operator, sLow, sHigh);
|
|
1382
1318
|
if (oSelectOptionValues.option) {
|
|
1383
|
-
|
|
1319
|
+
selectionVariant.addSelectOption(
|
|
1384
1320
|
sPath ? sPath : sFilterName,
|
|
1385
1321
|
oSelectOptionValues.sign,
|
|
1386
1322
|
oSelectOptionValues.option,
|
|
@@ -1443,12 +1379,13 @@ function addDefaultDisplayCurrency(aMandatoryFilterFields: any[], oSelectionVari
|
|
|
1443
1379
|
}
|
|
1444
1380
|
}
|
|
1445
1381
|
function getNonComputedVisibleFields(oMetaModel: ODataMetaModel, sPath: any, oView?: any) {
|
|
1446
|
-
const aTechnicalKeys = oMetaModel.getObject(sPath
|
|
1447
|
-
const aNonComputedVisibleFields = [];
|
|
1448
|
-
const
|
|
1382
|
+
const aTechnicalKeys = oMetaModel.getObject(`${sPath}/`).$Key;
|
|
1383
|
+
const aNonComputedVisibleFields: any = [];
|
|
1384
|
+
const aImmutableVisibleFields: any = [];
|
|
1385
|
+
const oEntityType = oMetaModel.getObject(`${sPath}/`);
|
|
1449
1386
|
for (const item in oEntityType) {
|
|
1450
1387
|
if (oEntityType[item].$kind && oEntityType[item].$kind === "Property") {
|
|
1451
|
-
const oAnnotations = oMetaModel.getObject(sPath
|
|
1388
|
+
const oAnnotations = oMetaModel.getObject(`${sPath}/${item}@`) || {},
|
|
1452
1389
|
bIsKey = aTechnicalKeys.indexOf(item) > -1,
|
|
1453
1390
|
bIsImmutable = oAnnotations["@Org.OData.Core.V1.Immutable"],
|
|
1454
1391
|
bIsNonComputed = !oAnnotations["@Org.OData.Core.V1.Computed"],
|
|
@@ -1459,11 +1396,13 @@ function getNonComputedVisibleFields(oMetaModel: ODataMetaModel, sPath: any, oVi
|
|
|
1459
1396
|
? bIsComputedDefaultValue && oAnnotations["@com.sap.vocabularies.Common.v1.Text"]
|
|
1460
1397
|
: false;
|
|
1461
1398
|
if (
|
|
1462
|
-
(
|
|
1399
|
+
(bIsKeyComputedDefaultValueWithText || (bIsKey && oEntityType[item].$Type !== "Edm.Guid")) &&
|
|
1463
1400
|
bIsNonComputed &&
|
|
1464
1401
|
bIsVisible
|
|
1465
1402
|
) {
|
|
1466
1403
|
aNonComputedVisibleFields.push(item);
|
|
1404
|
+
} else if (bIsImmutable && bIsNonComputed && bIsVisible) {
|
|
1405
|
+
aImmutableVisibleFields.push(item);
|
|
1467
1406
|
}
|
|
1468
1407
|
|
|
1469
1408
|
if (!bIsNonComputed && bIsComputedDefaultValue && oView) {
|
|
@@ -1479,12 +1418,99 @@ function getNonComputedVisibleFields(oMetaModel: ODataMetaModel, sPath: any, oVi
|
|
|
1479
1418
|
}
|
|
1480
1419
|
}
|
|
1481
1420
|
}
|
|
1482
|
-
|
|
1421
|
+
const aRequiredProperties = CommonUtils.getRequiredPropertiesFromInsertRestrictions(sPath, oMetaModel);
|
|
1422
|
+
if (aRequiredProperties.length) {
|
|
1423
|
+
aRequiredProperties.forEach(function (sProperty: any) {
|
|
1424
|
+
const oAnnotations = oMetaModel.getObject(`${sPath}/${sProperty}@`),
|
|
1425
|
+
bIsVisible = !oAnnotations || !oAnnotations["@com.sap.vocabularies.UI.v1.Hidden"];
|
|
1426
|
+
if (bIsVisible && aNonComputedVisibleFields.indexOf(sProperty) === -1 && aImmutableVisibleFields.indexOf(sProperty) === -1) {
|
|
1427
|
+
aNonComputedVisibleFields.push(sProperty);
|
|
1428
|
+
}
|
|
1429
|
+
});
|
|
1430
|
+
}
|
|
1431
|
+
return aNonComputedVisibleFields.concat(aImmutableVisibleFields);
|
|
1483
1432
|
}
|
|
1433
|
+
|
|
1434
|
+
function getRequiredProperties(sPath: any, oMetaModel: any, bCheckUpdateRestrictions: boolean = false) {
|
|
1435
|
+
const aPathParts = sPath.split("/");
|
|
1436
|
+
const aRequiredProperties: any = [];
|
|
1437
|
+
let aRequiredPropertiesWithPaths: any = [];
|
|
1438
|
+
let oEntitySetAnnotations = oMetaModel.getObject(`${sPath}@`);
|
|
1439
|
+
if (aPathParts.length > 2) {
|
|
1440
|
+
const sNavigationPath = aPathParts[aPathParts.length - 1];
|
|
1441
|
+
aPathParts.splice(-1, 1); // removing NavigationProperty from the end.
|
|
1442
|
+
const sParentEntitySetPath = aPathParts.join("/");
|
|
1443
|
+
const oNavigationRestrictions = CommonUtils.getNavigationRestrictions(oMetaModel, sParentEntitySetPath, sNavigationPath);
|
|
1444
|
+
oEntitySetAnnotations = oMetaModel.getObject(`${sParentEntitySetPath}/$NavigationPropertyBinding/${sNavigationPath}@`);
|
|
1445
|
+
if (CommonUtils.hasRestrictedPropertiesInAnnotations(oNavigationRestrictions, true, bCheckUpdateRestrictions)) {
|
|
1446
|
+
aRequiredPropertiesWithPaths = bCheckUpdateRestrictions
|
|
1447
|
+
? oNavigationRestrictions["UpdateRestrictions"].RequiredProperties
|
|
1448
|
+
: oNavigationRestrictions["InsertRestrictions"].RequiredProperties;
|
|
1449
|
+
}
|
|
1450
|
+
if (
|
|
1451
|
+
(!aRequiredPropertiesWithPaths || !aRequiredPropertiesWithPaths.length) &&
|
|
1452
|
+
CommonUtils.hasRestrictedPropertiesInAnnotations(oEntitySetAnnotations, false, bCheckUpdateRestrictions)
|
|
1453
|
+
) {
|
|
1454
|
+
aRequiredPropertiesWithPaths = CommonUtils.getRequiredPropertiesFromAnnotations(
|
|
1455
|
+
oEntitySetAnnotations,
|
|
1456
|
+
bCheckUpdateRestrictions
|
|
1457
|
+
);
|
|
1458
|
+
}
|
|
1459
|
+
} else if (CommonUtils.hasRestrictedPropertiesInAnnotations(oEntitySetAnnotations, false, bCheckUpdateRestrictions)) {
|
|
1460
|
+
aRequiredPropertiesWithPaths = CommonUtils.getRequiredPropertiesFromAnnotations(oEntitySetAnnotations, bCheckUpdateRestrictions);
|
|
1461
|
+
}
|
|
1462
|
+
aRequiredPropertiesWithPaths.forEach(function (oRequiredProperty: any) {
|
|
1463
|
+
const sProperty = oRequiredProperty["$PropertyPath"];
|
|
1464
|
+
aRequiredProperties.push(sProperty);
|
|
1465
|
+
});
|
|
1466
|
+
return aRequiredProperties;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
function getRequiredPropertiesFromInsertRestrictions(sPath: any, oMetaModel: any) {
|
|
1470
|
+
return CommonUtils.getRequiredProperties(sPath, oMetaModel);
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
function getRequiredPropertiesFromUpdateRestrictions(sPath: any, oMetaModel: any) {
|
|
1474
|
+
return CommonUtils.getRequiredProperties(sPath, oMetaModel, true);
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
function getRequiredPropertiesFromAnnotations(oAnnotations: any, bCheckUpdateRestrictions: boolean = false) {
|
|
1478
|
+
if (bCheckUpdateRestrictions) {
|
|
1479
|
+
return oAnnotations["@Org.OData.Capabilities.V1.UpdateRestrictions"].RequiredProperties;
|
|
1480
|
+
}
|
|
1481
|
+
return oAnnotations["@Org.OData.Capabilities.V1.InsertRestrictions"].RequiredProperties;
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
function hasRestrictedPropertiesInAnnotations(
|
|
1485
|
+
oAnnotations: any,
|
|
1486
|
+
bIsNavigationRestrictions: boolean = false,
|
|
1487
|
+
bCheckUpdateRestrictions: boolean = false
|
|
1488
|
+
) {
|
|
1489
|
+
if (bIsNavigationRestrictions) {
|
|
1490
|
+
if (bCheckUpdateRestrictions) {
|
|
1491
|
+
return oAnnotations && oAnnotations["UpdateRestrictions"] && oAnnotations["UpdateRestrictions"].RequiredProperties
|
|
1492
|
+
? true
|
|
1493
|
+
: false;
|
|
1494
|
+
}
|
|
1495
|
+
return oAnnotations && oAnnotations["InsertRestrictions"] && oAnnotations["InsertRestrictions"].RequiredProperties ? true : false;
|
|
1496
|
+
} else if (bCheckUpdateRestrictions) {
|
|
1497
|
+
return oAnnotations &&
|
|
1498
|
+
oAnnotations["@Org.OData.Capabilities.V1.UpdateRestrictions"] &&
|
|
1499
|
+
oAnnotations["@Org.OData.Capabilities.V1.UpdateRestrictions"].RequiredProperties
|
|
1500
|
+
? true
|
|
1501
|
+
: false;
|
|
1502
|
+
}
|
|
1503
|
+
return oAnnotations &&
|
|
1504
|
+
oAnnotations["@Org.OData.Capabilities.V1.InsertRestrictions"] &&
|
|
1505
|
+
oAnnotations["@Org.OData.Capabilities.V1.InsertRestrictions"].RequiredProperties
|
|
1506
|
+
? true
|
|
1507
|
+
: false;
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1484
1510
|
function setUserDefaults(
|
|
1485
1511
|
oAppComponent: AppComponent,
|
|
1486
1512
|
aParameters: any[],
|
|
1487
|
-
oModel: JSONModel,
|
|
1513
|
+
oModel: JSONModel | ODataV4Context,
|
|
1488
1514
|
bIsAction: boolean,
|
|
1489
1515
|
bIsCreate?: boolean,
|
|
1490
1516
|
oActionDefaultValues?: any
|
|
@@ -1496,7 +1522,7 @@ function setUserDefaults(
|
|
|
1496
1522
|
if (!oShellServices.hasUShell()) {
|
|
1497
1523
|
aParameters.forEach(function (oParameter: any) {
|
|
1498
1524
|
const sPropertyName = bIsAction
|
|
1499
|
-
?
|
|
1525
|
+
? `/${oParameter.$Name}`
|
|
1500
1526
|
: oParameter.getPath().slice(oParameter.getPath().lastIndexOf("/") + 1);
|
|
1501
1527
|
const sParameterName = bIsAction ? sPropertyName.slice(1) : sPropertyName;
|
|
1502
1528
|
if (oActionDefaultValues && bIsCreate) {
|
|
@@ -1514,7 +1540,7 @@ function setUserDefaults(
|
|
|
1514
1540
|
aExtendedParameters = (oData.selectionVariant && oData.selectionVariant.SelectOptions) || [];
|
|
1515
1541
|
aParameters.forEach(function (oParameter: any) {
|
|
1516
1542
|
const sPropertyName = bIsAction
|
|
1517
|
-
?
|
|
1543
|
+
? `/${oParameter.$Name}`
|
|
1518
1544
|
: oParameter.getPath().slice(oParameter.getPath().lastIndexOf("/") + 1);
|
|
1519
1545
|
const sParameterName = bIsAction ? sPropertyName.slice(1) : sPropertyName;
|
|
1520
1546
|
if (oActionDefaultValues && bIsCreate) {
|
|
@@ -1620,7 +1646,7 @@ function getHeaderFacetItemConfigForExternalNavigation(oViewData: any, oCrossNav
|
|
|
1620
1646
|
semanticObjectMapping: aSemanticObjectMapping
|
|
1621
1647
|
};
|
|
1622
1648
|
} else {
|
|
1623
|
-
Log.error(
|
|
1649
|
+
Log.error(`Cross navigation outbound is configured without semantic object and action for ${sOutbound}`);
|
|
1624
1650
|
}
|
|
1625
1651
|
}
|
|
1626
1652
|
}
|
|
@@ -1646,12 +1672,19 @@ function setSemanticObjectMappings(oSelectionVariant: any, vMappings: object) {
|
|
|
1646
1672
|
}
|
|
1647
1673
|
return oSelectionVariant;
|
|
1648
1674
|
}
|
|
1649
|
-
function fnGetSemanticObjectsFromPath(oMetaModel: any, sPath:
|
|
1675
|
+
function fnGetSemanticObjectsFromPath(oMetaModel: any, sPath: string, sQualifier: string) {
|
|
1650
1676
|
return new Promise(function (resolve: (value: any) => void) {
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1677
|
+
let sSemanticObject, aSemanticObjectUnavailableActions;
|
|
1678
|
+
if (sQualifier === "") {
|
|
1679
|
+
sSemanticObject = oMetaModel.getObject(`${sPath}@${CommonAnnotationTerms.SemanticObject}`);
|
|
1680
|
+
aSemanticObjectUnavailableActions = oMetaModel.getObject(`${sPath}@${CommonAnnotationTerms.SemanticObjectUnavailableActions}`);
|
|
1681
|
+
} else {
|
|
1682
|
+
sSemanticObject = oMetaModel.getObject(`${sPath}@${CommonAnnotationTerms.SemanticObject}#${sQualifier}`);
|
|
1683
|
+
aSemanticObjectUnavailableActions = oMetaModel.getObject(
|
|
1684
|
+
`${sPath}@${CommonAnnotationTerms.SemanticObjectUnavailableActions}#${sQualifier}`
|
|
1685
|
+
);
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1655
1688
|
const aSemanticObjectForGetLinks = [{ semanticObject: sSemanticObject }];
|
|
1656
1689
|
const oSemanticObject = {
|
|
1657
1690
|
semanticObject: sSemanticObject
|
|
@@ -1748,8 +1781,35 @@ function fnUpdateSemanticTargetsModel(aGetLinksPromises: any, aSemanticObjects:
|
|
|
1748
1781
|
Log.error("fnUpdateSemanticTargetsModel: Cannot read links", oError);
|
|
1749
1782
|
});
|
|
1750
1783
|
}
|
|
1751
|
-
function fnGetSemanticObjectPromise(oAppComponent: any, oView: any, oMetaModel: any, sPath:
|
|
1752
|
-
return CommonUtils.getSemanticObjectsFromPath(oMetaModel, sPath);
|
|
1784
|
+
function fnGetSemanticObjectPromise(oAppComponent: any, oView: any, oMetaModel: any, sPath: string, sQualifier: string) {
|
|
1785
|
+
return CommonUtils.getSemanticObjectsFromPath(oMetaModel, sPath, sQualifier);
|
|
1786
|
+
}
|
|
1787
|
+
function fnPrepareSemanticObjectsPromises(
|
|
1788
|
+
_oAppComponent: any,
|
|
1789
|
+
_oView: any,
|
|
1790
|
+
_oMetaModel: any,
|
|
1791
|
+
_aSemanticObjectsFound: string[],
|
|
1792
|
+
_aSemanticObjectsPromises: Promise<any>[]
|
|
1793
|
+
) {
|
|
1794
|
+
let _Keys: string[], sPath;
|
|
1795
|
+
let sQualifier: string, regexResult;
|
|
1796
|
+
for (let i = 0; i < _aSemanticObjectsFound.length; i++) {
|
|
1797
|
+
sPath = _aSemanticObjectsFound[i];
|
|
1798
|
+
_Keys = Object.keys(_oMetaModel.getObject(sPath + "@"));
|
|
1799
|
+
for (let index = 0; index < _Keys.length; index++) {
|
|
1800
|
+
if (
|
|
1801
|
+
_Keys[index].indexOf(`@${CommonAnnotationTerms.SemanticObject}`) === 0 &&
|
|
1802
|
+
_Keys[index].indexOf(`@${CommonAnnotationTerms.SemanticObjectMapping}`) === -1 &&
|
|
1803
|
+
_Keys[index].indexOf(`@${CommonAnnotationTerms.SemanticObjectUnavailableActions}`) === -1
|
|
1804
|
+
) {
|
|
1805
|
+
regexResult = /#(.*)/.exec(_Keys[index]);
|
|
1806
|
+
sQualifier = regexResult ? regexResult[1] : "";
|
|
1807
|
+
_aSemanticObjectsPromises.push(
|
|
1808
|
+
CommonUtils.getSemanticObjectPromise(_oAppComponent, _oView, _oMetaModel, sPath, sQualifier)
|
|
1809
|
+
);
|
|
1810
|
+
}
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1753
1813
|
}
|
|
1754
1814
|
function fnGetSemanticTargetsFromPageModel(oController: any, sPageModel: string) {
|
|
1755
1815
|
const _fnfindValuesHelper = function (obj: any, key: any, list: any) {
|
|
@@ -1788,7 +1848,7 @@ function fnGetSemanticTargetsFromPageModel(oController: any, sPageModel: string)
|
|
|
1788
1848
|
const oInternalModelContext = oView.getBindingContext("internal");
|
|
1789
1849
|
|
|
1790
1850
|
if (oInternalModelContext) {
|
|
1791
|
-
const aSemanticObjectsPromises = [];
|
|
1851
|
+
const aSemanticObjectsPromises: Promise<any>[] = [];
|
|
1792
1852
|
const oComponent = oController.getOwnerComponent();
|
|
1793
1853
|
const oAppComponent = Component.getOwnerComponentFor(oComponent) as AppComponent;
|
|
1794
1854
|
const oMetaModel = oAppComponent.getMetaModel();
|
|
@@ -1802,7 +1862,6 @@ function fnGetSemanticTargetsFromPageModel(oController: any, sPageModel: string)
|
|
|
1802
1862
|
let sCurrentHash = CommonUtils.getHash();
|
|
1803
1863
|
const aSemanticObjectsForGetLinks = [];
|
|
1804
1864
|
const aSemanticObjects: any[] = [];
|
|
1805
|
-
let sPath;
|
|
1806
1865
|
let _oSemanticObject;
|
|
1807
1866
|
|
|
1808
1867
|
if (sCurrentHash && sCurrentHash.indexOf("?") !== -1) {
|
|
@@ -1810,10 +1869,7 @@ function fnGetSemanticTargetsFromPageModel(oController: any, sPageModel: string)
|
|
|
1810
1869
|
sCurrentHash = sCurrentHash.split("?")[0];
|
|
1811
1870
|
}
|
|
1812
1871
|
|
|
1813
|
-
|
|
1814
|
-
sPath = aSemanticObjectsFound[i];
|
|
1815
|
-
aSemanticObjectsPromises.push(CommonUtils.getSemanticObjectPromise(oAppComponent, oView, oMetaModel, sPath));
|
|
1816
|
-
}
|
|
1872
|
+
fnPrepareSemanticObjectsPromises(oAppComponent, oView, oMetaModel, aSemanticObjectsFound, aSemanticObjectsPromises);
|
|
1817
1873
|
|
|
1818
1874
|
if (aSemanticObjectsPromises.length === 0) {
|
|
1819
1875
|
return Promise.resolve();
|
|
@@ -1828,7 +1884,7 @@ function fnGetSemanticTargetsFromPageModel(oController: any, sPageModel: string)
|
|
|
1828
1884
|
element.semanticObject.semanticObject &&
|
|
1829
1885
|
typeof element.semanticObject.semanticObject === "object"
|
|
1830
1886
|
) {
|
|
1831
|
-
sSemObjExpression =
|
|
1887
|
+
sSemObjExpression = compileExpression(pathInModel(element.semanticObject.semanticObject.$Path));
|
|
1832
1888
|
element.semanticObject.semanticObject = sSemObjExpression;
|
|
1833
1889
|
element.semanticObjectForGetLinks[0].semanticObject = sSemObjExpression;
|
|
1834
1890
|
return true;
|
|
@@ -1894,7 +1950,7 @@ function getFilterRestrictions(oFilterRestrictionsAnnotation: any, sRestriction:
|
|
|
1894
1950
|
function getFilterRestrictionsByPath(sEntitySetPath: any, oMetaModel: any) {
|
|
1895
1951
|
const oRet: any = {},
|
|
1896
1952
|
FilterRestrictions = CommonUtils.FilterRestrictions,
|
|
1897
|
-
oFilterRestrictions = sEntitySetPath ? oMetaModel.getObject(sEntitySetPath
|
|
1953
|
+
oFilterRestrictions = sEntitySetPath ? oMetaModel.getObject(`${sEntitySetPath}@Org.OData.Capabilities.V1.FilterRestrictions`) : {};
|
|
1898
1954
|
oRet[FilterRestrictions.REQUIRED_PROPERTIES] = getFilterRestrictions(oFilterRestrictions, FilterRestrictions.REQUIRED_PROPERTIES) || [];
|
|
1899
1955
|
oRet[FilterRestrictions.NON_FILTERABLE_PROPERTIES] =
|
|
1900
1956
|
getFilterRestrictions(oFilterRestrictions, FilterRestrictions.NON_FILTERABLE_PROPERTIES) || [];
|
|
@@ -1960,10 +2016,10 @@ function getSingletonPath(path: string, metaModel: ODataMetaModel): string | und
|
|
|
1960
2016
|
const parts = path.split("/").filter(Boolean),
|
|
1961
2017
|
propertyName = parts.pop(),
|
|
1962
2018
|
navigationPath = parts.join("/"),
|
|
1963
|
-
entitySet = navigationPath && metaModel.getObject(
|
|
2019
|
+
entitySet = navigationPath && metaModel.getObject(`/${navigationPath}`);
|
|
1964
2020
|
if (entitySet?.$kind === "Singleton") {
|
|
1965
2021
|
const singletonName = parts[parts.length - 1];
|
|
1966
|
-
return
|
|
2022
|
+
return `/${singletonName}/${propertyName}`;
|
|
1967
2023
|
}
|
|
1968
2024
|
return undefined;
|
|
1969
2025
|
}
|
|
@@ -2022,28 +2078,31 @@ function loadMacroLibrary() {
|
|
|
2022
2078
|
});
|
|
2023
2079
|
}
|
|
2024
2080
|
|
|
2025
|
-
function fnOnStrictHandlingFailed(sGroupId: string,
|
|
2026
|
-
const
|
|
2027
|
-
|
|
2028
|
-
sCancelButtonTxt =
|
|
2081
|
+
function fnOnStrictHandlingFailed(sGroupId: string, mParameters: any, oResourceBundle: any, aMessages: any[]) {
|
|
2082
|
+
const sActionName = mParameters.label,
|
|
2083
|
+
oModel = mParameters.model,
|
|
2084
|
+
sCancelButtonTxt = CommonUtils.getTranslatedText("C_COMMON_DIALOG_CANCEL", oResourceBundle);
|
|
2085
|
+
aMessages = aMessages.filter((oMessage) => oMessage.getTechnicalDetails() && oMessage.getTechnicalDetails().httpStatus === 412);
|
|
2029
2086
|
if (aMessages.length === 1) {
|
|
2030
|
-
const sMessage = aMessages[0].message
|
|
2031
|
-
|
|
2087
|
+
const sMessage = `${aMessages[0].message}\n${CommonUtils.getTranslatedText("PROCEED", oResourceBundle)}`;
|
|
2088
|
+
return new Promise(function (resolve) {
|
|
2032
2089
|
MessageBox.warning(sMessage, {
|
|
2033
|
-
title:
|
|
2090
|
+
title: CommonUtils.getTranslatedText("WARNING", oResourceBundle),
|
|
2034
2091
|
actions: [sActionName, sCancelButtonTxt],
|
|
2035
2092
|
emphasizedAction: sActionName,
|
|
2036
2093
|
onClose: function (sAction: string) {
|
|
2037
2094
|
if (sAction === sActionName) {
|
|
2038
2095
|
resolve(true);
|
|
2039
2096
|
oModel.submitBatch(sGroupId);
|
|
2097
|
+
if (mParameters.requestSideEffects) {
|
|
2098
|
+
mParameters.requestSideEffects();
|
|
2099
|
+
}
|
|
2040
2100
|
} else {
|
|
2041
2101
|
resolve(false);
|
|
2042
2102
|
}
|
|
2043
2103
|
}
|
|
2044
2104
|
});
|
|
2045
2105
|
});
|
|
2046
|
-
return dialogPromise;
|
|
2047
2106
|
}
|
|
2048
2107
|
return new Promise(function (resolve) {
|
|
2049
2108
|
const oMessageDialogModel = new JSONModel();
|
|
@@ -2067,16 +2126,18 @@ function fnOnStrictHandlingFailed(sGroupId: string, actionName: string, oModel:
|
|
|
2067
2126
|
press: function () {
|
|
2068
2127
|
resolve(true);
|
|
2069
2128
|
oModel.submitBatch(sGroupId);
|
|
2129
|
+
oMessageDialogModel.setData({});
|
|
2070
2130
|
oDialog.close();
|
|
2071
2131
|
},
|
|
2072
2132
|
type: "Emphasized",
|
|
2073
|
-
text:
|
|
2133
|
+
text: sActionName
|
|
2074
2134
|
})
|
|
2075
2135
|
);
|
|
2076
2136
|
oDialog.setEndButton(
|
|
2077
2137
|
new Button({
|
|
2078
2138
|
press: function () {
|
|
2079
2139
|
resolve(false);
|
|
2140
|
+
oMessageDialogModel.setData({});
|
|
2080
2141
|
oDialog.close();
|
|
2081
2142
|
},
|
|
2082
2143
|
text: sCancelButtonTxt
|
|
@@ -2091,9 +2152,9 @@ function getMessageColumn(oControl: any): string {
|
|
|
2091
2152
|
return "";
|
|
2092
2153
|
}
|
|
2093
2154
|
const headerInfoTitlePath = oControl.getParent().getTableDefinition().headerInfoTitle;
|
|
2094
|
-
const oMetaModel = oControl &&
|
|
2155
|
+
const oMetaModel = oControl && oControl.getModel().getMetaModel(),
|
|
2095
2156
|
sCurrentEntitySetName = oControl.data("metaPath");
|
|
2096
|
-
const aTechnicalKeys = oMetaModel.getObject(sCurrentEntitySetName
|
|
2157
|
+
const aTechnicalKeys = oMetaModel.getObject(`${sCurrentEntitySetName}/$Type/$Key`);
|
|
2097
2158
|
const aFilteredTechnicalKeys: string[] = [];
|
|
2098
2159
|
|
|
2099
2160
|
aTechnicalKeys.forEach(function (technicalKey: string) {
|
|
@@ -2126,44 +2187,38 @@ function getMessageColumn(oControl: any): string {
|
|
|
2126
2187
|
return subtitleColumn;
|
|
2127
2188
|
}
|
|
2128
2189
|
|
|
2129
|
-
function
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
if (aIgnoredLabels.length === 2 && bIsSearchIgnored && bIsDraftSupported) {
|
|
2146
|
-
sText = oResourceBundle.getText("C_LR_MULTIVIZ_CHART_IGNORED_FILTER_DRAFT_DATA_AND_SEARCH");
|
|
2147
|
-
} else if (aIgnoredLabels.length === 1 && bIsDraftSupported) {
|
|
2148
|
-
sText = oResourceBundle.getText("C_MULTIVIZ_CHART_IGNORED_FILTER_DRAFT_DATA");
|
|
2149
|
-
} else {
|
|
2150
|
-
const sResource =
|
|
2151
|
-
"C_LR_MULTIVIZ_CHART_" +
|
|
2152
|
-
(aIgnoredLabels.length === 1 ? "SINGLE" : "MULTI") +
|
|
2153
|
-
"_IGNORED_FILTER_" +
|
|
2154
|
-
(system.desktop ? "LARGE" : "SMALL");
|
|
2155
|
-
sText = oResourceBundle.getText(sResource, [aIgnoredLabels.join(", ")]);
|
|
2190
|
+
function getKeys(oMetaModel: any, sPath: string, sEntitySetName: string): string {
|
|
2191
|
+
const sMetaPath = oMetaModel.getMetaPath(sPath);
|
|
2192
|
+
const aTechnicalKeys = oMetaModel.getObject(`${sMetaPath}/$Type/$Key`);
|
|
2193
|
+
let sKey: string = "";
|
|
2194
|
+
const semanticKey = SemanticKeyHelper.getSemanticKeys(oMetaModel, sEntitySetName);
|
|
2195
|
+
if (semanticKey !== undefined && semanticKey.length === 1) {
|
|
2196
|
+
sKey = semanticKey[0].$PropertyPath;
|
|
2197
|
+
} else if (aTechnicalKeys) {
|
|
2198
|
+
const aFilteredTechnicalKeys: string[] = [];
|
|
2199
|
+
aTechnicalKeys.forEach(function (technicalKey: string) {
|
|
2200
|
+
if (technicalKey !== "IsActiveEntity") {
|
|
2201
|
+
aFilteredTechnicalKeys.push(technicalKey);
|
|
2202
|
+
}
|
|
2203
|
+
});
|
|
2204
|
+
if (aFilteredTechnicalKeys !== undefined && aFilteredTechnicalKeys.length === 1) {
|
|
2205
|
+
sKey = aFilteredTechnicalKeys[0];
|
|
2156
2206
|
}
|
|
2207
|
+
}
|
|
2208
|
+
return sKey;
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2211
|
+
// Get the path for action parameters that is needed to read the annotations
|
|
2212
|
+
function getParameterPath(sPath: any, sParameter: any) {
|
|
2213
|
+
let sContext;
|
|
2214
|
+
if (sPath.indexOf("@$ui5.overload") > -1) {
|
|
2215
|
+
sContext = sPath.split("@$ui5.overload")[0];
|
|
2157
2216
|
} else {
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
"_IGNORED_FILTER_" +
|
|
2162
|
-
(system.desktop ? "LARGE" : "SMALL"),
|
|
2163
|
-
sLocalizedTableTitle = fnGetLocalizedText(sTabTitle, oFilterBar);
|
|
2164
|
-
sText = oResourceBundle.getText(sResource, [aIgnoredLabels.join(", "), sLocalizedTableTitle]);
|
|
2217
|
+
// For Unbound Actions in Action Parameter Dialogs
|
|
2218
|
+
const aAction = sPath.split("/0")[0].split(".");
|
|
2219
|
+
sContext = `/${aAction[aAction.length - 1]}/`;
|
|
2165
2220
|
}
|
|
2166
|
-
return
|
|
2221
|
+
return sContext + sParameter;
|
|
2167
2222
|
}
|
|
2168
2223
|
|
|
2169
2224
|
const CommonUtils = {
|
|
@@ -2184,7 +2239,6 @@ const CommonUtils = {
|
|
|
2184
2239
|
getEntitySetName: getEntitySetName,
|
|
2185
2240
|
getActionPath: getActionPath,
|
|
2186
2241
|
computeDisplayMode: computeDisplayMode,
|
|
2187
|
-
setActionEnablement: setActionEnablement,
|
|
2188
2242
|
isStickyEditMode: isStickyEditMode,
|
|
2189
2243
|
getOperatorsForProperty: getOperatorsForProperty,
|
|
2190
2244
|
addSelectionVariantToConditions: addSelectionVariantToConditions,
|
|
@@ -2222,8 +2276,18 @@ const CommonUtils = {
|
|
|
2222
2276
|
normalizeSearchTerm: normalizeSearchTerm,
|
|
2223
2277
|
fnOnStrictHandlingFailed: fnOnStrictHandlingFailed,
|
|
2224
2278
|
getSingletonPath: getSingletonPath,
|
|
2225
|
-
|
|
2226
|
-
|
|
2279
|
+
getMessageColumn: getMessageColumn,
|
|
2280
|
+
getRequiredPropertiesFromUpdateRestrictions: getRequiredPropertiesFromUpdateRestrictions,
|
|
2281
|
+
getRequiredPropertiesFromInsertRestrictions: getRequiredPropertiesFromInsertRestrictions,
|
|
2282
|
+
hasRestrictedPropertiesInAnnotations: hasRestrictedPropertiesInAnnotations,
|
|
2283
|
+
getRequiredPropertiesFromAnnotations: getRequiredPropertiesFromAnnotations,
|
|
2284
|
+
getRequiredProperties: getRequiredProperties,
|
|
2285
|
+
getKeys: getKeys,
|
|
2286
|
+
checkIfResourceKeyExists: checkIfResourceKeyExists,
|
|
2287
|
+
setContextsBasedOnOperationAvailable: setContextsBasedOnOperationAvailable,
|
|
2288
|
+
setDynamicActionContexts: setDynamicActionContexts,
|
|
2289
|
+
requestProperty: requestProperty,
|
|
2290
|
+
getParameterPath: getParameterPath
|
|
2227
2291
|
};
|
|
2228
2292
|
|
|
2229
2293
|
export default CommonUtils;
|