@sapui5/sap.fe.core 1.97.0 → 1.100.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 +7 -4
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AnnotationHelper.js +309 -405
- package/src/sap/fe/core/AnnotationHelper.ts +315 -0
- package/src/sap/fe/core/AppComponent.js +389 -397
- package/src/sap/fe/core/AppComponent.ts +403 -0
- package/src/sap/fe/core/AppStateHandler.js +198 -181
- package/src/sap/fe/core/AppStateHandler.ts +171 -0
- package/src/sap/fe/core/BaseController.js +83 -58
- package/src/sap/fe/core/BaseController.ts +68 -0
- package/src/sap/fe/core/BusyLocker.js +105 -121
- package/src/sap/fe/core/BusyLocker.ts +98 -0
- package/src/sap/fe/core/CommonUtils.js +2164 -2379
- package/src/sap/fe/core/CommonUtils.ts +2177 -0
- package/src/sap/fe/core/ExtensionAPI.js +279 -266
- package/src/sap/fe/core/ExtensionAPI.ts +250 -0
- package/src/sap/fe/core/PageController.js +218 -125
- package/src/sap/fe/core/PageController.ts +129 -0
- package/src/sap/fe/core/RouterProxy.js +924 -807
- package/src/sap/fe/core/RouterProxy.ts +840 -0
- package/src/sap/fe/core/Synchronization.js +41 -35
- package/src/sap/fe/core/Synchronization.ts +29 -0
- package/src/sap/fe/core/TemplateComponent.js +173 -155
- package/src/sap/fe/core/TemplateComponent.ts +173 -0
- package/src/sap/fe/core/TemplateModel.js +79 -54
- package/src/sap/fe/core/TemplateModel.ts +63 -0
- package/src/sap/fe/core/TransactionHelper.js +1560 -1579
- package/src/sap/fe/core/TransactionHelper.ts +1717 -0
- package/src/sap/fe/core/actions/collaboration/ActivitySync.js +392 -0
- package/src/sap/fe/core/actions/collaboration/ActivitySync.ts +355 -0
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +136 -0
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.ts +119 -0
- package/src/sap/fe/core/actions/collaboration/Manage.js +262 -0
- package/src/sap/fe/core/actions/collaboration/Manage.ts +244 -0
- package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +103 -0
- package/src/sap/fe/core/actions/collaboration/UserDetails.fragment.xml +13 -0
- package/src/sap/fe/core/actions/draft.js +521 -581
- package/src/sap/fe/core/actions/draft.ts +566 -0
- package/src/sap/fe/core/actions/messageHandling.js +564 -511
- package/src/sap/fe/core/actions/messageHandling.ts +552 -0
- package/src/sap/fe/core/actions/nonDraft.js +17 -19
- package/src/sap/fe/core/actions/nonDraft.ts +12 -0
- package/src/sap/fe/core/actions/operations.js +1093 -1211
- package/src/sap/fe/core/actions/operations.ts +1192 -0
- package/src/sap/fe/core/actions/sticky.js +114 -104
- package/src/sap/fe/core/actions/sticky.ts +119 -0
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +70 -66
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.ts +65 -0
- package/src/sap/fe/core/controllerextensions/EditFlow.js +1594 -1701
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +1672 -0
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +80 -54
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +61 -0
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +719 -505
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +783 -0
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +797 -813
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +803 -0
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +1005 -973
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +978 -0
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +530 -476
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +137 -46
- package/src/sap/fe/core/controllerextensions/MassEdit.js +144 -0
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +156 -0
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +234 -232
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +225 -0
- package/src/sap/fe/core/controllerextensions/PageReady.js +302 -337
- package/src/sap/fe/core/controllerextensions/PageReady.ts +23 -17
- package/src/sap/fe/core/controllerextensions/Paginator.js +189 -148
- package/src/sap/fe/core/controllerextensions/Paginator.ts +163 -0
- package/src/sap/fe/core/controllerextensions/Placeholder.js +158 -146
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +151 -0
- package/src/sap/fe/core/controllerextensions/Routing.js +145 -106
- package/src/sap/fe/core/controllerextensions/Routing.ts +132 -0
- package/src/sap/fe/core/controllerextensions/RoutingListener.js +8 -6
- package/src/sap/fe/core/controllerextensions/RoutingListener.ts +3 -0
- package/src/sap/fe/core/controllerextensions/Share.js +220 -244
- package/src/sap/fe/core/controllerextensions/Share.ts +231 -0
- package/src/sap/fe/core/controllerextensions/SideEffects.js +593 -634
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +29 -27
- package/src/sap/fe/core/controllerextensions/ViewState.js +789 -806
- package/src/sap/fe/core/controllerextensions/ViewState.ts +805 -0
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +4 -3
- package/src/sap/fe/core/controls/ActionPartial.fragment.xml +2 -2
- package/src/sap/fe/core/controls/CommandExecution.js +68 -66
- package/src/sap/fe/core/controls/CommandExecution.ts +72 -0
- package/src/sap/fe/core/controls/ConditionalWrapper.js +91 -75
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +83 -0
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +131 -125
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +126 -0
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +105 -110
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +101 -0
- package/src/sap/fe/core/controls/FieldWrapper.js +122 -140
- package/src/sap/fe/core/controls/FieldWrapper.ts +115 -0
- package/src/sap/fe/core/controls/FilterBar.js +163 -159
- package/src/sap/fe/core/controls/FilterBar.ts +143 -0
- package/src/sap/fe/core/controls/FormElementWrapper.js +46 -44
- package/src/sap/fe/core/controls/FormElementWrapper.ts +40 -0
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +38 -42
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.ts +31 -0
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +2 -1
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +127 -116
- package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +98 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +242 -255
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +245 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +151 -141
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +125 -0
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +336 -322
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +337 -0
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +106 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +79 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +70 -0
- package/src/sap/fe/core/converters/ConverterContext.js +348 -367
- package/src/sap/fe/core/converters/ConverterContext.ts +33 -19
- package/src/sap/fe/core/converters/ManifestSettings.js +12 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +16 -1
- package/src/sap/fe/core/converters/ManifestWrapper.js +354 -354
- package/src/sap/fe/core/converters/ManifestWrapper.ts +34 -6
- package/src/sap/fe/core/converters/MetaModelConverter.js +72 -9
- package/src/sap/fe/core/converters/MetaModelConverter.ts +75 -16
- package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
- package/src/sap/fe/core/converters/TemplateConverter.ts +4 -3
- package/src/sap/fe/core/converters/annotations/DataField.js +28 -14
- package/src/sap/fe/core/converters/annotations/DataField.ts +38 -14
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +33 -21
- package/src/sap/fe/core/converters/controls/Common/Action.js +11 -2
- package/src/sap/fe/core/converters/controls/Common/Action.ts +8 -2
- package/src/sap/fe/core/converters/controls/Common/Chart.js +5 -3
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +11 -3
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +3 -3
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +2 -2
- package/src/sap/fe/core/converters/controls/Common/Form.js +21 -11
- package/src/sap/fe/core/converters/controls/Common/Form.ts +28 -6
- package/src/sap/fe/core/converters/controls/Common/KPI.js +69 -4
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +75 -2
- package/src/sap/fe/core/converters/controls/Common/Table.js +507 -408
- package/src/sap/fe/core/converters/controls/Common/Table.ts +618 -500
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +592 -0
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +718 -0
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +465 -59
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +462 -72
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +2 -2
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +1 -1
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +17 -9
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +24 -9
- package/src/sap/fe/core/converters/helpers/Aggregation.js +118 -121
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +28 -5
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +20 -6
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +16 -4
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +12 -1
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +11 -0
- package/src/sap/fe/core/converters/helpers/IssueManager.js +7 -1
- package/src/sap/fe/core/converters/helpers/IssueManager.ts +6 -0
- package/src/sap/fe/core/converters/helpers/Key.js +42 -57
- package/src/sap/fe/core/converters/helpers/Key.ts +1 -1
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +28 -7
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +23 -6
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +20 -7
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +36 -14
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +7 -5
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +5 -1
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +93 -90
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +91 -0
- package/src/sap/fe/core/formatters/CollaborationFormatter.js +104 -0
- package/src/sap/fe/core/formatters/CollaborationFormatter.ts +60 -0
- package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
- package/src/sap/fe/core/formatters/CriticalityFormatter.ts +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.ts +4 -10
- package/src/sap/fe/core/formatters/KPIFormatter.js +1 -1
- package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -1
- package/src/sap/fe/core/formatters/TableFormatter.js +91 -29
- package/src/sap/fe/core/formatters/TableFormatter.ts +94 -28
- package/src/sap/fe/core/formatters/ValueFormatter.js +30 -5
- package/src/sap/fe/core/formatters/ValueFormatter.ts +30 -7
- package/src/sap/fe/core/fpm/Component.js +51 -54
- package/src/sap/fe/core/fpm/Component.ts +48 -0
- package/src/sap/fe/core/helpers/AppStartupHelper.js +373 -0
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +417 -0
- package/src/sap/fe/core/helpers/BindingExpression.js +489 -442
- package/src/sap/fe/core/helpers/BindingExpression.ts +486 -469
- package/src/sap/fe/core/helpers/ClassSupport.js +212 -76
- package/src/sap/fe/core/helpers/ClassSupport.ts +198 -71
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +64 -59
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +52 -0
- package/src/sap/fe/core/helpers/EditState.js +81 -84
- package/src/sap/fe/core/helpers/EditState.ts +81 -0
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +62 -48
- package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +49 -0
- package/src/sap/fe/core/helpers/FPMHelper.js +52 -56
- package/src/sap/fe/core/helpers/FPMHelper.ts +62 -0
- package/src/sap/fe/core/helpers/KeepAliveHelper.js +4 -5
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +10 -10
- package/src/sap/fe/core/helpers/MassEditHelper.js +604 -0
- package/src/sap/fe/core/helpers/MassEditHelper.ts +699 -0
- package/src/sap/fe/core/helpers/ModelHelper.js +253 -225
- package/src/sap/fe/core/helpers/ModelHelper.ts +250 -0
- package/src/sap/fe/core/helpers/PasteHelper.js +210 -132
- package/src/sap/fe/core/helpers/PasteHelper.ts +196 -0
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +336 -313
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +334 -0
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +66 -67
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +73 -0
- package/src/sap/fe/core/helpers/StableIdHelper.js +4 -7
- package/src/sap/fe/core/helpers/StableIdHelper.ts +2 -6
- package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx.ts +1 -1
- package/src/sap/fe/core/library.js +427 -425
- package/src/sap/fe/core/library.support.js +23 -27
- package/src/sap/fe/core/library.support.ts +23 -0
- package/src/sap/fe/core/library.ts +420 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +64 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +69 -0
- package/src/sap/fe/core/messagebundle.properties +78 -13
- package/src/sap/fe/core/messagebundle_ar.properties +58 -7
- package/src/sap/fe/core/messagebundle_bg.properties +58 -7
- package/src/sap/fe/core/messagebundle_ca.properties +58 -7
- package/src/sap/fe/core/messagebundle_cs.properties +59 -8
- package/src/sap/fe/core/messagebundle_cy.properties +58 -7
- package/src/sap/fe/core/messagebundle_da.properties +58 -7
- package/src/sap/fe/core/messagebundle_de.properties +58 -7
- package/src/sap/fe/core/messagebundle_el.properties +58 -7
- package/src/sap/fe/core/messagebundle_en.properties +57 -6
- package/src/sap/fe/core/messagebundle_en_GB.properties +57 -6
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +61 -6
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +58 -7
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +58 -7
- package/src/sap/fe/core/messagebundle_es.properties +58 -7
- package/src/sap/fe/core/messagebundle_es_MX.properties +58 -7
- package/src/sap/fe/core/messagebundle_et.properties +58 -7
- package/src/sap/fe/core/messagebundle_fi.properties +60 -9
- package/src/sap/fe/core/messagebundle_fr.properties +64 -13
- package/src/sap/fe/core/messagebundle_fr_CA.properties +59 -8
- package/src/sap/fe/core/messagebundle_hi.properties +58 -7
- package/src/sap/fe/core/messagebundle_hr.properties +58 -7
- package/src/sap/fe/core/messagebundle_hu.properties +59 -8
- package/src/sap/fe/core/messagebundle_id.properties +61 -10
- package/src/sap/fe/core/messagebundle_it.properties +58 -7
- package/src/sap/fe/core/messagebundle_iw.properties +58 -7
- package/src/sap/fe/core/messagebundle_ja.properties +58 -7
- package/src/sap/fe/core/messagebundle_kk.properties +58 -7
- package/src/sap/fe/core/messagebundle_ko.properties +58 -7
- package/src/sap/fe/core/messagebundle_lt.properties +58 -7
- package/src/sap/fe/core/messagebundle_lv.properties +59 -8
- package/src/sap/fe/core/messagebundle_ms.properties +58 -7
- package/src/sap/fe/core/messagebundle_nl.properties +58 -7
- package/src/sap/fe/core/messagebundle_no.properties +58 -7
- package/src/sap/fe/core/messagebundle_pl.properties +58 -7
- package/src/sap/fe/core/messagebundle_pt.properties +59 -8
- package/src/sap/fe/core/messagebundle_pt_PT.properties +58 -7
- package/src/sap/fe/core/messagebundle_ro.properties +58 -7
- package/src/sap/fe/core/messagebundle_ru.properties +58 -7
- package/src/sap/fe/core/messagebundle_sh.properties +58 -7
- package/src/sap/fe/core/messagebundle_sk.properties +58 -7
- package/src/sap/fe/core/messagebundle_sl.properties +58 -7
- package/src/sap/fe/core/messagebundle_sv.properties +59 -8
- package/src/sap/fe/core/messagebundle_th.properties +58 -7
- package/src/sap/fe/core/messagebundle_tr.properties +60 -9
- package/src/sap/fe/core/messagebundle_uk.properties +58 -7
- package/src/sap/fe/core/messagebundle_vi.properties +58 -7
- package/src/sap/fe/core/messagebundle_zh_CN.properties +58 -7
- package/src/sap/fe/core/messagebundle_zh_TW.properties +58 -7
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +45 -71
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +231 -202
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +212 -0
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +67 -92
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +10 -6
- package/src/sap/fe/core/services/NavigationServiceFactory.js +351 -300
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +313 -0
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +114 -81
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +83 -0
- package/src/sap/fe/core/services/RoutingServiceFactory.js +927 -1152
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +898 -0
- package/src/sap/fe/core/services/ShellServicesFactory.js +649 -707
- package/src/sap/fe/core/services/ShellServicesFactory.ts +52 -15
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +569 -637
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +78 -102
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +429 -478
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +460 -0
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +10 -8
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +8 -0
- package/src/sap/fe/core/support/AnnotationIssue.support.js +15 -3
- package/src/sap/fe/core/support/AnnotationIssue.support.ts +16 -2
- package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -2
- package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.ts +1 -1
- package/src/sap/fe/core/support/CommonHelper.js +1 -1
- package/src/sap/fe/core/support/CommonHelper.ts +1 -1
- package/src/sap/fe/core/support/Diagnostics.js +36 -48
- package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.js +38 -0
- package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.ts +18 -0
- package/src/sap/fe/core/templating/DataModelPathHelper.js +97 -127
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +112 -135
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +114 -0
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +86 -0
- package/src/sap/fe/core/templating/FieldControlHelper.js +8 -8
- package/src/sap/fe/core/templating/FieldControlHelper.ts +25 -7
- package/src/sap/fe/core/templating/FilterHelper.js +140 -78
- package/src/sap/fe/core/templating/FilterHelper.ts +149 -78
- package/src/sap/fe/core/templating/PropertyHelper.js +3 -3
- package/src/sap/fe/core/templating/PropertyHelper.ts +2 -2
- package/src/sap/fe/core/templating/UIFormatters.js +76 -135
- package/src/sap/fe/core/templating/UIFormatters.ts +76 -99
- package/src/sap/fe/core/type/Email.js +1 -1
- package/src/sap/fe/core/type/Email.ts +4 -6
- package/ui5.yaml +0 -3
- package/src/sap/fe/core/controls/filterbar.d.js +0 -8
- package/src/sap/fe/core/controls/filterbar.d.ts +0 -0
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import ServiceFactory from "sap/ui/core/service/ServiceFactory";
|
|
2
|
+
import Service from "sap/ui/core/service/Service";
|
|
3
|
+
import { ServiceContext } from "sap/ui/core/service";
|
|
4
|
+
import { ComplexType, ConverterOutput, EntityType, NavigationProperty, Property } from "@sap-ux/annotation-converter";
|
|
5
|
+
import Context from "sap/ui/model/odata/v4/Context";
|
|
6
|
+
import ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
|
|
4
7
|
import { convertTypes, EnvironmentCapabilities } from "sap/fe/core/converters/MetaModelConverter";
|
|
5
8
|
import { CommonAnnotationTypes, QualifiedName } from "@sap-ux/vocabularies-types/dist/generated/Common";
|
|
6
9
|
import { Action, NavigationPropertyPath, PropertyPath } from "@sap-ux/vocabularies-types";
|
|
7
|
-
import
|
|
10
|
+
import Log from "sap/base/Log";
|
|
8
11
|
|
|
9
12
|
type SideEffectsSettings = {};
|
|
10
13
|
|
|
11
14
|
type SideEffectsTargetEntityType = {
|
|
12
15
|
$NavigationPropertyPath: string;
|
|
16
|
+
$PropertyPath?: string;
|
|
13
17
|
};
|
|
14
18
|
type SideEffectsTarget = SideEffectsTargetEntityType | string;
|
|
15
19
|
|
|
@@ -28,7 +32,7 @@ type BaseSideEffectsType = {
|
|
|
28
32
|
fullyQualifiedName: string;
|
|
29
33
|
} & SideEffectsTargetType;
|
|
30
34
|
|
|
31
|
-
type ActionSideEffectsType = {
|
|
35
|
+
export type ActionSideEffectsType = {
|
|
32
36
|
pathExpressions: SideEffectsTarget[];
|
|
33
37
|
triggerActions?: QualifiedName[];
|
|
34
38
|
};
|
|
@@ -70,11 +74,11 @@ type ExtractorPropertyInfo = {
|
|
|
70
74
|
navigationPath?: string;
|
|
71
75
|
};
|
|
72
76
|
|
|
73
|
-
class SideEffectsService extends Service<SideEffectsSettings> {
|
|
77
|
+
export class SideEffectsService extends Service<SideEffectsSettings> {
|
|
74
78
|
initPromise!: Promise<any>;
|
|
75
79
|
_oSideEffectsType!: SideEffectsOriginRegistry;
|
|
76
80
|
_oCapabilities!: EnvironmentCapabilities | undefined;
|
|
77
|
-
_bInitialized!:
|
|
81
|
+
_bInitialized!: boolean;
|
|
78
82
|
// !: means that we know it will be assigned before usage
|
|
79
83
|
init() {
|
|
80
84
|
this._oSideEffectsType = {
|
|
@@ -122,10 +126,11 @@ class SideEffectsService extends Service<SideEffectsSettings> {
|
|
|
122
126
|
* @param {string} sTriggerAction Name of the action
|
|
123
127
|
* @param {object} oContext Context
|
|
124
128
|
* @param {string} sGroupId The group ID to be used for the request
|
|
129
|
+
* @returns {Promise} A promise that is resolved without data or with a return value context when the action call succeeded
|
|
125
130
|
*/
|
|
126
|
-
public executeAction(sTriggerAction:
|
|
131
|
+
public executeAction(sTriggerAction: string, oContext: Context, sGroupId?: string): Promise<any> {
|
|
127
132
|
const oTriggerAction: any = oContext.getModel().bindContext(sTriggerAction + "(...)", oContext);
|
|
128
|
-
oTriggerAction.execute(sGroupId || (oContext as any).getBinding().getUpdateGroupId());
|
|
133
|
+
return oTriggerAction.execute(sGroupId || (oContext as any).getBinding().getUpdateGroupId());
|
|
129
134
|
}
|
|
130
135
|
|
|
131
136
|
/**
|
|
@@ -247,6 +252,24 @@ class SideEffectsService extends Service<SideEffectsSettings> {
|
|
|
247
252
|
return oPromise;
|
|
248
253
|
}
|
|
249
254
|
|
|
255
|
+
public requestSideEffectsForODataAction(sideEffects: ActionSideEffectsType, oContext: Context): Promise<any> {
|
|
256
|
+
let aPromises: Promise<any>[];
|
|
257
|
+
|
|
258
|
+
if (sideEffects.triggerActions?.length) {
|
|
259
|
+
aPromises = sideEffects.triggerActions.map((sTriggerActionName: String) => {
|
|
260
|
+
return this.executeAction(sTriggerActionName as string, oContext);
|
|
261
|
+
});
|
|
262
|
+
} else {
|
|
263
|
+
aPromises = [];
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
if (sideEffects.pathExpressions?.length) {
|
|
267
|
+
aPromises.push(this.requestSideEffects(sideEffects.pathExpressions, oContext));
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
return aPromises.length ? Promise.all(aPromises) : Promise.resolve();
|
|
271
|
+
}
|
|
272
|
+
|
|
250
273
|
/**
|
|
251
274
|
* Request SideEffects for a navigation property on a specific context.
|
|
252
275
|
*
|
|
@@ -259,6 +282,7 @@ class SideEffectsService extends Service<SideEffectsSettings> {
|
|
|
259
282
|
public requestSideEffectsForNavigationProperty(sNavigationProperty: string, oContext: Context): Promise<any> {
|
|
260
283
|
const sBaseEntityType = this.getEntityTypeFromContext(oContext);
|
|
261
284
|
if (sBaseEntityType) {
|
|
285
|
+
const sNavigationPath = sNavigationProperty + "/";
|
|
262
286
|
const aSideEffects = this.getODataEntitySideEffects(sBaseEntityType);
|
|
263
287
|
let aTargets: SideEffectsTarget[] = [];
|
|
264
288
|
Object.keys(aSideEffects)
|
|
@@ -267,9 +291,13 @@ class SideEffectsService extends Service<SideEffectsSettings> {
|
|
|
267
291
|
sAnnotationName => {
|
|
268
292
|
const oSideEffects: ODataSideEffectsType = aSideEffects[sAnnotationName];
|
|
269
293
|
return (
|
|
270
|
-
(oSideEffects.SourceProperties || []).some(
|
|
271
|
-
|
|
272
|
-
|
|
294
|
+
(oSideEffects.SourceProperties || []).some(oPropertyPath => {
|
|
295
|
+
const sPropertyPath = oPropertyPath.value;
|
|
296
|
+
return (
|
|
297
|
+
sPropertyPath.startsWith(sNavigationPath) &&
|
|
298
|
+
sPropertyPath.replace(sNavigationPath, "").indexOf("/") === -1
|
|
299
|
+
);
|
|
300
|
+
}) ||
|
|
273
301
|
(oSideEffects.SourceEntities || []).some(
|
|
274
302
|
oNavigationPropertyPath => oNavigationPropertyPath.value === sNavigationProperty
|
|
275
303
|
)
|
|
@@ -279,7 +307,7 @@ class SideEffectsService extends Service<SideEffectsSettings> {
|
|
|
279
307
|
.forEach(sAnnotationName => {
|
|
280
308
|
const oSideEffects: ODataSideEffectsType = aSideEffects[sAnnotationName];
|
|
281
309
|
if (oSideEffects.TriggerAction) {
|
|
282
|
-
this.executeAction(oSideEffects.TriggerAction, oContext);
|
|
310
|
+
this.executeAction(oSideEffects.TriggerAction as string, oContext);
|
|
283
311
|
}
|
|
284
312
|
((oSideEffects.TargetEntities as any[]) || [])
|
|
285
313
|
.concat((oSideEffects.TargetProperties as any[]) || [])
|
|
@@ -310,7 +338,7 @@ class SideEffectsService extends Service<SideEffectsSettings> {
|
|
|
310
338
|
|
|
311
339
|
/**
|
|
312
340
|
* Adds the text properties required for SideEffects
|
|
313
|
-
* If a property has an associated text then this text needs to be added as targetProperties.
|
|
341
|
+
* If a property has an associated text then this text needs to be added as targetProperties or targetEntities.
|
|
314
342
|
*
|
|
315
343
|
* @private
|
|
316
344
|
* @ui5-restricted
|
|
@@ -319,7 +347,7 @@ class SideEffectsService extends Service<SideEffectsSettings> {
|
|
|
319
347
|
* @returns {object} SideEffects definition with added text properties
|
|
320
348
|
*/
|
|
321
349
|
private _addRequiredTextProperties(oSideEffect: BaseSideEffectsType, mEntityType: EntityType): BaseSideEffectsType {
|
|
322
|
-
const aInitialProperties: string[] =
|
|
350
|
+
const aInitialProperties: string[] = oSideEffect.TargetProperties || [],
|
|
323
351
|
aEntitiesRequested: string[] = (oSideEffect.TargetEntities || []).map(navigation => navigation.$NavigationPropertyPath);
|
|
324
352
|
let aDerivedProperties: ExtractorPropertyInfo[] = [];
|
|
325
353
|
|
|
@@ -333,22 +361,20 @@ class SideEffectsService extends Service<SideEffectsSettings> {
|
|
|
333
361
|
// mTarget can be an entity type, navigationProperty or or a complexType
|
|
334
362
|
const aTargetEntityProperties: Property[] =
|
|
335
363
|
(mTarget as EntityType).entityProperties ||
|
|
336
|
-
(mTarget as Property).targetType?.properties ||
|
|
364
|
+
((mTarget as Property).targetType as ComplexType)?.properties ||
|
|
337
365
|
(mTarget as NavigationProperty).targetType.entityProperties;
|
|
338
366
|
if (aTargetEntityProperties) {
|
|
339
367
|
if (bIsStarProperty) {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
);
|
|
351
|
-
}
|
|
368
|
+
// Add all required properties behind the *
|
|
369
|
+
aEntitiesRequested.push(sNavigationPropertyPath);
|
|
370
|
+
aDerivedProperties = aDerivedProperties.concat(
|
|
371
|
+
aTargetEntityProperties.map(mProperty => {
|
|
372
|
+
return {
|
|
373
|
+
navigationPath: sRelativePath,
|
|
374
|
+
property: mProperty
|
|
375
|
+
};
|
|
376
|
+
})
|
|
377
|
+
);
|
|
352
378
|
} else {
|
|
353
379
|
aDerivedProperties.push({
|
|
354
380
|
property: aTargetEntityProperties.find(
|
|
@@ -368,7 +394,8 @@ class SideEffectsService extends Service<SideEffectsSettings> {
|
|
|
368
394
|
aDerivedProperties.forEach(mPropertyInfo => {
|
|
369
395
|
if (mPropertyInfo.property) {
|
|
370
396
|
const sTargetTextPath = (mPropertyInfo.property.annotations?.Common?.Text as any)?.path,
|
|
371
|
-
sTextPathFromInitialEntity = mPropertyInfo.navigationPath + sTargetTextPath
|
|
397
|
+
sTextPathFromInitialEntity = mPropertyInfo.navigationPath + sTargetTextPath,
|
|
398
|
+
sTargetCollectionPath = sTextPathFromInitialEntity.substring(0, sTextPathFromInitialEntity.lastIndexOf("/"));
|
|
372
399
|
/**
|
|
373
400
|
* The property Text must be added only if the property is
|
|
374
401
|
* - not part of a star property (.i.e '*' or 'navigation/*') or a targeted Entity
|
|
@@ -378,11 +405,20 @@ class SideEffectsService extends Service<SideEffectsSettings> {
|
|
|
378
405
|
|
|
379
406
|
if (
|
|
380
407
|
sTargetTextPath &&
|
|
381
|
-
aEntitiesRequested.indexOf(
|
|
382
|
-
-1 &&
|
|
408
|
+
aEntitiesRequested.indexOf(sTargetCollectionPath) === -1 &&
|
|
383
409
|
aInitialProperties.indexOf(sTextPathFromInitialEntity) === -1
|
|
384
410
|
) {
|
|
385
|
-
|
|
411
|
+
// The Text association is added as TargetEntities if it's contained on a different entitySet and not a complexType
|
|
412
|
+
// Otherwise it's added as targetProperties
|
|
413
|
+
if (
|
|
414
|
+
sTargetTextPath.lastIndexOf("/") > -1 &&
|
|
415
|
+
mEntityType.resolvePath(sTargetCollectionPath)?._type === "NavigationProperty"
|
|
416
|
+
) {
|
|
417
|
+
oSideEffect.TargetEntities.push({ $NavigationPropertyPath: sTargetCollectionPath });
|
|
418
|
+
aEntitiesRequested.push(sTargetCollectionPath);
|
|
419
|
+
} else {
|
|
420
|
+
oSideEffect.TargetProperties.push(sTextPathFromInitialEntity);
|
|
421
|
+
}
|
|
386
422
|
}
|
|
387
423
|
}
|
|
388
424
|
});
|
|
@@ -399,22 +435,17 @@ class SideEffectsService extends Service<SideEffectsSettings> {
|
|
|
399
435
|
* @private
|
|
400
436
|
* @ui5-restricted
|
|
401
437
|
* @param {object} oSideEffects SideEffects definition
|
|
402
|
-
* @param {
|
|
438
|
+
* @param {object} mEntityType Entity type
|
|
403
439
|
* @param {string} sBindingParameter Name of the binding parameter
|
|
404
440
|
* @returns {object} SideEffects definition
|
|
405
441
|
*/
|
|
406
442
|
private _convertSideEffects(
|
|
407
443
|
oSideEffects: BaseSideEffectsType | BaseAnnotationSideEffectsType,
|
|
408
|
-
|
|
444
|
+
mEntityType: EntityType,
|
|
409
445
|
sBindingParameter?: string
|
|
410
446
|
): ODataSideEffectsType {
|
|
411
|
-
const mEntityType = (this.getConvertedMetaModel() as ConverterOutput).entityTypes.find(oEntityType => {
|
|
412
|
-
return oEntityType.fullyQualifiedName === sEntityType;
|
|
413
|
-
});
|
|
414
447
|
const oTempSideEffects = this._removeBindingParameter(this._convertTargetsFormat(oSideEffects), sBindingParameter);
|
|
415
|
-
return mEntityType
|
|
416
|
-
? this._replaceReferencedProperties(this._addRequiredTextProperties(oTempSideEffects, mEntityType), mEntityType)
|
|
417
|
-
: oTempSideEffects;
|
|
448
|
+
return this._addRequiredTextProperties(oTempSideEffects, mEntityType);
|
|
418
449
|
}
|
|
419
450
|
|
|
420
451
|
/**
|
|
@@ -466,15 +497,13 @@ class SideEffectsService extends Service<SideEffectsSettings> {
|
|
|
466
497
|
if (mEntityType) {
|
|
467
498
|
const mCommonAnnotation: any = oSource.annotations?.Common || {};
|
|
468
499
|
const mBindingParameter = ((oSource as Action).parameters || []).find(
|
|
469
|
-
mParameter => mParameter.type ===
|
|
500
|
+
mParameter => mParameter.type === mEntityType.fullyQualifiedName
|
|
470
501
|
);
|
|
471
502
|
const sBindingParameter = mBindingParameter ? mBindingParameter.fullyQualifiedName.split("/")[1] : "";
|
|
472
503
|
Object.keys(mCommonAnnotation)
|
|
473
504
|
.filter(sAnnotationName => mCommonAnnotation[sAnnotationName].$Type === CommonAnnotationTypes.SideEffectsType)
|
|
474
505
|
.forEach(sAnnotationName => {
|
|
475
|
-
aSideEffects.push(
|
|
476
|
-
this._convertSideEffects(mCommonAnnotation[sAnnotationName], mEntityType.fullyQualifiedName, sBindingParameter)
|
|
477
|
-
);
|
|
506
|
+
aSideEffects.push(this._convertSideEffects(mCommonAnnotation[sAnnotationName], mEntityType, sBindingParameter));
|
|
478
507
|
});
|
|
479
508
|
}
|
|
480
509
|
}
|
|
@@ -514,7 +543,7 @@ class SideEffectsService extends Service<SideEffectsSettings> {
|
|
|
514
543
|
mTarget = mTarget.map((mProperty: any) => {
|
|
515
544
|
const bNavigationPropertyPath = mProperty.$NavigationPropertyPath !== undefined; // Need to test with undefined since mProperty.$NavigationPropertyPath could be "" (empty string)
|
|
516
545
|
const sValue = (bNavigationPropertyPath ? mProperty.$NavigationPropertyPath : mProperty).replace(
|
|
517
|
-
new RegExp("^" + sBindingParameterName + "
|
|
546
|
+
new RegExp("^" + sBindingParameterName + "/?"),
|
|
518
547
|
""
|
|
519
548
|
);
|
|
520
549
|
return bNavigationPropertyPath ? { $NavigationPropertyPath: sValue } : sValue;
|
|
@@ -546,59 +575,6 @@ class SideEffectsService extends Service<SideEffectsSettings> {
|
|
|
546
575
|
);
|
|
547
576
|
}
|
|
548
577
|
|
|
549
|
-
/**
|
|
550
|
-
* Replaces TargetProperties having reference to Source Properties for a SideEffects
|
|
551
|
-
* If a SideEffects Source Property is an navigation entity reference, the SideEffects Target Properties cannot be a property of this navigation entity.
|
|
552
|
-
* Indeed this configuration leads to error into the OData V4 Model since response cannot be processed because this would mean that we merge properties of the new target into the old target of the navigation property.
|
|
553
|
-
* In order to request new value of these target properties the SideEffects will request for the entire Entity instead of just a set of properties.
|
|
554
|
-
* For the first version, we remove all navigation properties and replace them by targetEntities. This change could be improved in next version.
|
|
555
|
-
*
|
|
556
|
-
* @private
|
|
557
|
-
* @ui5-restricted
|
|
558
|
-
* @param {object} oSideEffect SideEffects definition
|
|
559
|
-
* @param {object} mEntityType Entity type
|
|
560
|
-
* @returns {object} SideEffects definition without referenced target properties
|
|
561
|
-
*/
|
|
562
|
-
private _replaceReferencedProperties(oSideEffect: BaseSideEffectsType, mEntityType: EntityType): BaseSideEffectsType {
|
|
563
|
-
let bSideEffectsChanged: boolean = false;
|
|
564
|
-
const aEntities: string[] =
|
|
565
|
-
(oSideEffect.TargetEntities || []).map(mNavigation => {
|
|
566
|
-
return mNavigation.$NavigationPropertyPath;
|
|
567
|
-
}) || [],
|
|
568
|
-
aProperties: string[] = [];
|
|
569
|
-
|
|
570
|
-
oSideEffect.TargetProperties.forEach(sPropertyPath => {
|
|
571
|
-
let bTargetChanged = false;
|
|
572
|
-
const iLastPathSeparatorIndex = sPropertyPath.lastIndexOf("/");
|
|
573
|
-
if (iLastPathSeparatorIndex !== -1) {
|
|
574
|
-
const sNavigationPath = sPropertyPath.substring(0, iLastPathSeparatorIndex);
|
|
575
|
-
const oTarget = mEntityType.resolvePath(sNavigationPath);
|
|
576
|
-
if (oTarget && oTarget._type === "NavigationProperty") {
|
|
577
|
-
//Test if it's not a property bound on complexType (_ComplexType/MyProperty)
|
|
578
|
-
bSideEffectsChanged = true;
|
|
579
|
-
bTargetChanged = true;
|
|
580
|
-
if (!aEntities.includes(sNavigationPath)) {
|
|
581
|
-
aEntities.push(sNavigationPath);
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
if (!bTargetChanged) {
|
|
586
|
-
aProperties.push(sPropertyPath);
|
|
587
|
-
}
|
|
588
|
-
});
|
|
589
|
-
|
|
590
|
-
if (bSideEffectsChanged) {
|
|
591
|
-
oSideEffect.TargetProperties = aProperties;
|
|
592
|
-
oSideEffect.TargetEntities = aEntities.map(sNavigationPath => {
|
|
593
|
-
return {
|
|
594
|
-
$NavigationPropertyPath: sNavigationPath
|
|
595
|
-
};
|
|
596
|
-
});
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
return oSideEffect;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
578
|
/**
|
|
603
579
|
* Gets SideEffects action type that come from an OData Service
|
|
604
580
|
* Internal routine to get, from converted oData metaModel, SideEffects on actions
|
|
@@ -616,15 +592,15 @@ class SideEffectsService extends Service<SideEffectsSettings> {
|
|
|
616
592
|
if (aActions) {
|
|
617
593
|
Object.keys(aActions).forEach(sActionName => {
|
|
618
594
|
const oAction = mEntityType.actions[sActionName];
|
|
619
|
-
const triggerActions:
|
|
595
|
+
const triggerActions: string[] = [];
|
|
620
596
|
let pathExpressions: SideEffectsTarget[] = [];
|
|
621
597
|
let aTargets: SideEffectsTarget[] = [];
|
|
622
598
|
|
|
623
599
|
this._getSideEffectsFromSource(oAction).forEach(oSideEffect => {
|
|
624
600
|
const sTriggerAction = oSideEffect.TriggerAction;
|
|
625
601
|
aTargets = aTargets.concat(oSideEffect.TargetEntities || []).concat((oSideEffect.TargetProperties as any[]) || []);
|
|
626
|
-
if (sTriggerAction && triggerActions.indexOf(sTriggerAction) === -1) {
|
|
627
|
-
triggerActions.push(sTriggerAction);
|
|
602
|
+
if (sTriggerAction && triggerActions.indexOf(sTriggerAction as string) === -1) {
|
|
603
|
+
triggerActions.push(sTriggerAction as string);
|
|
628
604
|
}
|
|
629
605
|
});
|
|
630
606
|
pathExpressions = this._removeDuplicateTargets(aTargets);
|
|
@@ -659,7 +635,7 @@ class SideEffectsService extends Service<SideEffectsSettings> {
|
|
|
659
635
|
}
|
|
660
636
|
|
|
661
637
|
class SideEffectsServiceFactory extends ServiceFactory<SideEffectsSettings> {
|
|
662
|
-
createInstance(oServiceContext: ServiceContext<SideEffectsSettings>) {
|
|
638
|
+
createInstance(oServiceContext: ServiceContext<SideEffectsSettings>): Promise<any> {
|
|
663
639
|
const SideEffectsServiceService = new SideEffectsService(oServiceContext);
|
|
664
640
|
return SideEffectsServiceService.initPromise;
|
|
665
641
|
}
|