@sapui5/sap.fe.core 1.100.0 → 1.102.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 +4 -4
- package/src/sap/fe/core/.library +2 -3
- package/src/sap/fe/core/AppComponent.js +23 -30
- package/src/sap/fe/core/AppComponent.ts +35 -40
- package/src/sap/fe/core/AppStateHandler.js +8 -8
- package/src/sap/fe/core/AppStateHandler.ts +11 -11
- package/src/sap/fe/core/BaseController.js +9 -9
- package/src/sap/fe/core/BaseController.ts +3 -4
- package/src/sap/fe/core/CommonUtils.js +122 -101
- package/src/sap/fe/core/CommonUtils.ts +239 -193
- package/src/sap/fe/core/ExtensionAPI.js +12 -13
- package/src/sap/fe/core/ExtensionAPI.ts +21 -31
- package/src/sap/fe/core/PageController.js +19 -13
- package/src/sap/fe/core/PageController.ts +40 -34
- package/src/sap/fe/core/TemplateComponent.js +198 -123
- package/src/sap/fe/core/TemplateComponent.ts +109 -121
- package/src/sap/fe/core/TemplateModel.js +7 -9
- package/src/sap/fe/core/TemplateModel.ts +3 -3
- package/src/sap/fe/core/buildingBlocks/AttributeModel.js +60 -0
- package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +37 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +165 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +178 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +935 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +837 -0
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +436 -0
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +431 -0
- package/src/sap/fe/core/{BusyLocker.js → controllerextensions/BusyLocker.js} +1 -1
- package/src/sap/fe/core/{BusyLocker.ts → controllerextensions/BusyLocker.ts} +7 -7
- package/src/sap/fe/core/controllerextensions/EditFlow.js +660 -288
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +513 -331
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +11 -11
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +6 -7
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +43 -25
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +132 -103
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +16 -16
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +64 -55
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +166 -99
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +187 -149
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +14 -14
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +12 -11
- package/src/sap/fe/core/controllerextensions/MassEdit.js +13 -12
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +22 -22
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +14 -26
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +20 -30
- package/src/sap/fe/core/controllerextensions/PageReady.js +25 -23
- package/src/sap/fe/core/controllerextensions/PageReady.ts +49 -47
- package/src/sap/fe/core/controllerextensions/Paginator.js +24 -15
- package/src/sap/fe/core/controllerextensions/Paginator.ts +35 -20
- package/src/sap/fe/core/controllerextensions/Placeholder.js +10 -10
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
- package/src/sap/fe/core/controllerextensions/Routing.js +11 -11
- package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
- package/src/sap/fe/core/controllerextensions/Share.js +34 -16
- package/src/sap/fe/core/controllerextensions/Share.ts +50 -32
- package/src/sap/fe/core/controllerextensions/SideEffects.js +15 -15
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +64 -65
- package/src/sap/fe/core/controllerextensions/ViewState.js +27 -31
- package/src/sap/fe/core/controllerextensions/ViewState.ts +103 -102
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +105 -0
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +98 -0
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +360 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/ActivitySync.ts +90 -132
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +146 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/CollaborationCommon.ts +18 -8
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +264 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/Manage.ts +35 -33
- package/src/sap/fe/core/controllerextensions/collaboration/ManageDialog.fragment.xml +100 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/UserDetails.fragment.xml +5 -7
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +1584 -0
- package/src/sap/fe/core/{TransactionHelper.ts → controllerextensions/editFlow/TransactionHelper.ts} +190 -159
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +780 -0
- package/src/sap/fe/core/{actions → controllerextensions/editFlow}/draft.ts +329 -76
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js +1149 -0
- package/src/sap/fe/core/{actions → controllerextensions/editFlow}/operations.ts +169 -97
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +190 -0
- package/src/sap/fe/core/{actions → controllerextensions/editFlow}/sticky.ts +76 -12
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +592 -0
- package/src/sap/fe/core/{actions → controllerextensions/messageHandler}/messageHandling.ts +83 -60
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +940 -0
- package/src/sap/fe/core/{RouterProxy.ts → controllerextensions/routing/RouterProxy.ts} +52 -36
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +21 -18
- package/src/sap/fe/core/controls/Any.js +28 -0
- package/src/sap/fe/core/controls/Any.ts +30 -0
- package/src/sap/fe/core/controls/CommandExecution.js +50 -16
- package/src/sap/fe/core/controls/CommandExecution.ts +31 -22
- package/src/sap/fe/core/controls/ConditionalWrapper.js +136 -65
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +49 -58
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +371 -0
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +282 -0
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +74 -36
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +23 -32
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossDraft.fragment.xml +52 -5
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +127 -67
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +127 -67
- package/src/sap/fe/core/controls/FieldWrapper.js +171 -87
- package/src/sap/fe/core/controls/FieldWrapper.ts +69 -80
- package/src/sap/fe/core/controls/FileWrapper.js +360 -0
- package/src/sap/fe/core/controls/FileWrapper.ts +202 -0
- package/src/sap/fe/core/controls/FilterBar.js +154 -119
- package/src/sap/fe/core/controls/FilterBar.ts +128 -123
- package/src/sap/fe/core/controls/FormElementWrapper.js +102 -37
- package/src/sap/fe/core/controls/FormElementWrapper.ts +43 -35
- package/src/sap/fe/core/controls/MassEditSelect.js +33 -0
- package/src/sap/fe/core/controls/MassEditSelect.ts +45 -0
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +111 -89
- package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +86 -82
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +242 -193
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +211 -204
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +152 -116
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +105 -105
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +2 -2
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +23 -28
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +41 -81
- package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +107 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +550 -35
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +604 -35
- package/src/sap/fe/core/converters/ManifestSettings.js +3 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +9 -2
- package/src/sap/fe/core/converters/MetaModelConverter.js +11 -40
- package/src/sap/fe/core/converters/MetaModelConverter.ts +56 -84
- package/src/sap/fe/core/converters/annotations/DataField.js +20 -5
- package/src/sap/fe/core/converters/annotations/DataField.ts +27 -6
- package/src/sap/fe/core/converters/controls/Common/Action.js +14 -21
- package/src/sap/fe/core/converters/controls/Common/Action.ts +23 -28
- package/src/sap/fe/core/converters/controls/Common/Chart.js +17 -10
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +20 -14
- package/src/sap/fe/core/converters/controls/Common/Form.js +16 -18
- package/src/sap/fe/core/converters/controls/Common/Form.ts +20 -20
- package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +2 -3
- package/src/sap/fe/core/converters/controls/Common/Table.js +389 -173
- package/src/sap/fe/core/converters/controls/Common/Table.ts +440 -244
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +26 -16
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +27 -19
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +78 -47
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +146 -107
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +6 -6
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +20 -18
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +30 -25
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +39 -34
- package/src/sap/fe/core/converters/helpers/Aggregation.js +10 -2
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +18 -13
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +3 -2
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +6 -5
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +1 -1
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +0 -4
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +27 -24
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +49 -40
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +33 -22
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +77 -62
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +28 -28
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +38 -45
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +3 -3
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +8 -6
- package/src/sap/fe/core/formatters/KPIFormatter.js +3 -12
- package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -2
- package/src/sap/fe/core/formatters/TableFormatter.js +74 -13
- package/src/sap/fe/core/formatters/TableFormatter.ts +71 -16
- package/src/sap/fe/core/formatters/ValueFormatter.js +4 -4
- package/src/sap/fe/core/formatters/ValueFormatter.ts +4 -7
- package/src/sap/fe/core/fpm/Component.js +46 -17
- package/src/sap/fe/core/fpm/Component.ts +11 -16
- package/src/sap/fe/core/helpers/AppStartupHelper.js +4 -4
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +3 -3
- package/src/sap/fe/core/helpers/BindingExpression.js +10 -7
- package/src/sap/fe/core/helpers/BindingExpression.ts +37 -35
- package/src/sap/fe/core/helpers/ClassSupport.js +273 -256
- package/src/sap/fe/core/helpers/ClassSupport.ts +315 -237
- package/src/sap/fe/core/helpers/FPMHelper.js +3 -2
- package/src/sap/fe/core/helpers/FPMHelper.ts +9 -8
- package/src/sap/fe/core/helpers/MassEditHelper.js +522 -147
- package/src/sap/fe/core/helpers/MassEditHelper.ts +563 -236
- package/src/sap/fe/core/helpers/ModelHelper.js +29 -1
- package/src/sap/fe/core/helpers/ModelHelper.ts +39 -26
- package/src/sap/fe/core/helpers/PasteHelper.js +4 -4
- package/src/sap/fe/core/helpers/PasteHelper.ts +4 -3
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +3 -3
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +3 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +1 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +1 -1
- package/src/sap/fe/core/helpers/StableIdHelper.js +5 -7
- package/src/sap/fe/core/helpers/StableIdHelper.ts +8 -8
- package/src/sap/fe/core/{Synchronization.js → helpers/Synchronization.js} +1 -1
- package/src/sap/fe/core/{Synchronization.ts → helpers/Synchronization.ts} +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx.js +35 -5
- package/src/sap/fe/core/jsx-runtime/jsx.ts +22 -8
- package/src/sap/fe/core/library.js +13 -5
- package/src/sap/fe/core/library.ts +26 -17
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +1 -1
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +0 -3
- package/src/sap/fe/core/messagebundle.properties +135 -180
- package/src/sap/fe/core/messagebundle_ar.properties +31 -64
- package/src/sap/fe/core/messagebundle_bg.properties +31 -64
- package/src/sap/fe/core/messagebundle_ca.properties +31 -64
- package/src/sap/fe/core/messagebundle_cs.properties +31 -64
- package/src/sap/fe/core/messagebundle_cy.properties +32 -65
- package/src/sap/fe/core/messagebundle_da.properties +31 -64
- package/src/sap/fe/core/messagebundle_de.properties +29 -62
- package/src/sap/fe/core/messagebundle_el.properties +32 -65
- package/src/sap/fe/core/messagebundle_en.properties +32 -65
- package/src/sap/fe/core/messagebundle_en_GB.properties +29 -62
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +41 -74
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +32 -65
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +20 -6
- package/src/sap/fe/core/messagebundle_es.properties +31 -64
- package/src/sap/fe/core/messagebundle_es_MX.properties +31 -64
- package/src/sap/fe/core/messagebundle_et.properties +31 -64
- package/src/sap/fe/core/messagebundle_fi.properties +29 -62
- package/src/sap/fe/core/messagebundle_fr.properties +36 -69
- package/src/sap/fe/core/messagebundle_fr_CA.properties +33 -66
- package/src/sap/fe/core/messagebundle_hi.properties +29 -62
- package/src/sap/fe/core/messagebundle_hr.properties +32 -65
- package/src/sap/fe/core/messagebundle_hu.properties +30 -63
- package/src/sap/fe/core/messagebundle_id.properties +32 -65
- package/src/sap/fe/core/messagebundle_it.properties +31 -64
- package/src/sap/fe/core/messagebundle_iw.properties +31 -64
- package/src/sap/fe/core/messagebundle_ja.properties +29 -62
- package/src/sap/fe/core/messagebundle_kk.properties +31 -64
- package/src/sap/fe/core/messagebundle_ko.properties +31 -64
- package/src/sap/fe/core/messagebundle_lt.properties +31 -64
- package/src/sap/fe/core/messagebundle_lv.properties +32 -65
- package/src/sap/fe/core/messagebundle_ms.properties +31 -64
- package/src/sap/fe/core/messagebundle_nl.properties +31 -64
- package/src/sap/fe/core/messagebundle_no.properties +31 -64
- package/src/sap/fe/core/messagebundle_pl.properties +34 -67
- package/src/sap/fe/core/messagebundle_pt.properties +32 -65
- package/src/sap/fe/core/messagebundle_pt_PT.properties +31 -64
- package/src/sap/fe/core/messagebundle_ro.properties +33 -66
- package/src/sap/fe/core/messagebundle_ru.properties +33 -66
- package/src/sap/fe/core/messagebundle_sh.properties +31 -64
- package/src/sap/fe/core/messagebundle_sk.properties +31 -64
- package/src/sap/fe/core/messagebundle_sl.properties +29 -62
- package/src/sap/fe/core/messagebundle_sv.properties +30 -63
- package/src/sap/fe/core/messagebundle_th.properties +31 -64
- package/src/sap/fe/core/messagebundle_tr.properties +31 -64
- package/src/sap/fe/core/messagebundle_uk.properties +32 -65
- package/src/sap/fe/core/messagebundle_vi.properties +31 -64
- package/src/sap/fe/core/messagebundle_zh_CN.properties +32 -65
- package/src/sap/fe/core/messagebundle_zh_TW.properties +34 -67
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +4 -4
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +5 -5
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +1 -2
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +11 -8
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +15 -13
- package/src/sap/fe/core/services/NavigationServiceFactory.js +5 -5
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +9 -5
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +4 -4
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/RoutingServiceFactory.js +105 -66
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +59 -49
- package/src/sap/fe/core/services/ShellServicesFactory.js +104 -29
- package/src/sap/fe/core/services/ShellServicesFactory.ts +64 -30
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +4 -4
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +11 -10
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +38 -51
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +43 -5
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +6 -3
- package/src/sap/fe/core/support/CommonHelper.js +1 -1
- package/src/sap/fe/core/support/CommonHelper.ts +0 -3
- package/src/sap/fe/core/templating/DataModelPathHelper.js +2 -9
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +32 -38
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +23 -3
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +27 -6
- package/src/sap/fe/core/templating/EntitySetHelper.js +1 -9
- package/src/sap/fe/core/templating/EntitySetHelper.ts +11 -13
- package/src/sap/fe/core/templating/FilterHelper.js +4 -4
- package/src/sap/fe/core/templating/FilterHelper.ts +6 -5
- package/src/sap/fe/core/templating/PropertyHelper.js +70 -33
- package/src/sap/fe/core/templating/PropertyHelper.ts +49 -27
- package/src/sap/fe/core/templating/UIFormatters.js +133 -22
- package/src/sap/fe/core/templating/UIFormatters.ts +144 -50
- package/src/sap/fe/core/type/DateTimeWithTimezone.js +47 -0
- package/src/sap/fe/core/type/DateTimeWithTimezone.ts +23 -0
- package/src/sap/fe/core/type/Email.js +26 -8
- package/src/sap/fe/core/type/Email.ts +8 -7
- package/src/sap/fe/core/AnnotationHelper.js +0 -312
- package/src/sap/fe/core/AnnotationHelper.ts +0 -315
- package/src/sap/fe/core/RouterProxy.js +0 -926
- package/src/sap/fe/core/TransactionHelper.js +0 -1562
- package/src/sap/fe/core/actions/collaboration/ActivitySync.js +0 -392
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +0 -136
- package/src/sap/fe/core/actions/collaboration/Manage.js +0 -262
- package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +0 -103
- package/src/sap/fe/core/actions/draft.js +0 -523
- package/src/sap/fe/core/actions/messageHandling.js +0 -567
- package/src/sap/fe/core/actions/nonDraft.js +0 -20
- package/src/sap/fe/core/actions/nonDraft.ts +0 -12
- package/src/sap/fe/core/actions/operations.js +0 -1096
- package/src/sap/fe/core/actions/sticky.js +0 -130
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +0 -78
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.ts +0 -65
- package/src/sap/fe/core/formatters/CriticalityFormatter.js +0 -77
- package/src/sap/fe/core/formatters/CriticalityFormatter.ts +0 -58
|
@@ -1,36 +1,42 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Component from "sap/ui/core/Component";
|
|
3
|
-
import MessageBox from "sap/m/MessageBox";
|
|
1
|
+
import ResourceBundle from "sap/base/i18n/ResourceBundle";
|
|
4
2
|
import Log from "sap/base/Log";
|
|
5
|
-
import library from "sap/fe/core/library";
|
|
6
|
-
import ModelHelper from "sap/fe/core/helpers/ModelHelper";
|
|
7
|
-
import SemanticDateOperators from "sap/fe/core/helpers/SemanticDateOperators";
|
|
8
3
|
import mergeObjects from "sap/base/util/merge";
|
|
9
|
-
import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
|
|
10
|
-
import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
|
|
11
|
-
import Fragment from "sap/ui/core/Fragment";
|
|
12
|
-
import ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
|
|
13
|
-
import ResourceBundle from "sap/base/i18n/ResourceBundle";
|
|
14
|
-
import { bindingExpression, compileBinding, constant, transformRecursively } from "sap/fe/core/helpers/BindingExpression";
|
|
15
|
-
import { getConditions } from "./templating/FilterHelper";
|
|
16
4
|
import AppComponent from "sap/fe/core/AppComponent";
|
|
17
|
-
import
|
|
5
|
+
import { IssueCategory, IssueCategoryType, IssueSeverity } from "sap/fe/core/converters/helpers/IssueManager";
|
|
6
|
+
import {
|
|
7
|
+
BindingExpression,
|
|
8
|
+
bindingExpression,
|
|
9
|
+
compileBinding,
|
|
10
|
+
constant,
|
|
11
|
+
not,
|
|
12
|
+
transformRecursively
|
|
13
|
+
} from "sap/fe/core/helpers/BindingExpression";
|
|
14
|
+
import ModelHelper from "sap/fe/core/helpers/ModelHelper";
|
|
15
|
+
import SemanticDateOperators from "sap/fe/core/helpers/SemanticDateOperators";
|
|
18
16
|
import { generate } from "sap/fe/core/helpers/StableIdHelper";
|
|
19
|
-
import
|
|
17
|
+
import Bar from "sap/m/Bar";
|
|
18
|
+
import Button from "sap/m/Button";
|
|
19
|
+
import Dialog from "sap/m/Dialog";
|
|
20
|
+
import MessageBox from "sap/m/MessageBox";
|
|
21
|
+
import Title from "sap/m/Title";
|
|
22
|
+
import Component from "sap/ui/core/Component";
|
|
20
23
|
import Control from "sap/ui/core/Control";
|
|
24
|
+
import Core from "sap/ui/core/Core";
|
|
25
|
+
import Fragment from "sap/ui/core/Fragment";
|
|
26
|
+
import View from "sap/ui/core/mvc/View";
|
|
27
|
+
import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
|
|
28
|
+
import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
|
|
29
|
+
import { system } from "sap/ui/Device";
|
|
21
30
|
import FilterOperatorUtil from "sap/ui/mdc/condition/FilterOperatorUtil";
|
|
22
31
|
import TypeUtil from "sap/ui/mdc/odata/v4/TypeUtil";
|
|
23
|
-
import { IssueCategory, IssueSeverity, IssueCategoryType } from "sap/fe/core/converters/helpers/IssueManager";
|
|
24
|
-
import { isConnected, disconnect } from "sap/fe/core/actions/collaboration/ActivitySync";
|
|
25
32
|
import Context from "sap/ui/model/Context";
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
33
|
+
import JSONModel from "sap/ui/model/json/JSONModel";
|
|
34
|
+
import ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
|
|
35
|
+
import ODataModel from "sap/ui/model/odata/v4/ODataModel";
|
|
36
|
+
import { CoreEx } from "types/extension_types";
|
|
37
|
+
import messageHandling from "./controllerextensions/messageHandler/messageHandling";
|
|
38
|
+
import { getConditions } from "./templating/FilterHelper";
|
|
32
39
|
|
|
33
|
-
const ProgrammingModel = library.ProgrammingModel;
|
|
34
40
|
const aValidTypes = [
|
|
35
41
|
"Edm.Boolean",
|
|
36
42
|
"Edm.Byte",
|
|
@@ -59,7 +65,7 @@ function normalizeSearchTerm(sSearchTerm: string) {
|
|
|
59
65
|
return sSearchTerm
|
|
60
66
|
.replace(/"/g, " ")
|
|
61
67
|
.split(/\s+/)
|
|
62
|
-
.reduce(function(sNormalized: string | undefined, sCurrentWord: string) {
|
|
68
|
+
.reduce(function (sNormalized: string | undefined, sCurrentWord: string) {
|
|
63
69
|
if (sCurrentWord !== "") {
|
|
64
70
|
sNormalized = (sNormalized ? sNormalized + " " : "") + '"' + sCurrentWord + '"';
|
|
65
71
|
}
|
|
@@ -109,7 +115,7 @@ function getPropertyDataType(oNavigationContext: any) {
|
|
|
109
115
|
function fnHasTransientContexts(oListBinding: any) {
|
|
110
116
|
let bHasTransientContexts = false;
|
|
111
117
|
if (oListBinding) {
|
|
112
|
-
oListBinding.getCurrentContexts().forEach(function(oContext: any) {
|
|
118
|
+
oListBinding.getCurrentContexts().forEach(function (oContext: any) {
|
|
113
119
|
if (oContext && oContext.isTransient()) {
|
|
114
120
|
bHasTransientContexts = true;
|
|
115
121
|
}
|
|
@@ -134,7 +140,7 @@ function getNavigationRestrictions(oModel: any, sEntitySetPath: any, sNavigation
|
|
|
134
140
|
const aRestrictedProperties = oNavigationRestrictions && oNavigationRestrictions.RestrictedProperties;
|
|
135
141
|
return (
|
|
136
142
|
aRestrictedProperties &&
|
|
137
|
-
aRestrictedProperties.find(function(oRestrictedProperty: any) {
|
|
143
|
+
aRestrictedProperties.find(function (oRestrictedProperty: any) {
|
|
138
144
|
return (
|
|
139
145
|
oRestrictedProperty &&
|
|
140
146
|
oRestrictedProperty.NavigationProperty &&
|
|
@@ -147,7 +153,7 @@ function _isInNonFilterableProperties(oModel: any, sEntitySetPath: any, sContext
|
|
|
147
153
|
let bIsNotFilterable = false;
|
|
148
154
|
const oAnnotation = oModel.getObject(sEntitySetPath + "@Org.OData.Capabilities.V1.FilterRestrictions");
|
|
149
155
|
if (oAnnotation && oAnnotation.NonFilterableProperties) {
|
|
150
|
-
bIsNotFilterable = oAnnotation.NonFilterableProperties.some(function(property: any) {
|
|
156
|
+
bIsNotFilterable = oAnnotation.NonFilterableProperties.some(function (property: any) {
|
|
151
157
|
return property.$NavigationPropertyPath === sContextPath || property.$PropertyPath === sContextPath;
|
|
152
158
|
});
|
|
153
159
|
}
|
|
@@ -163,7 +169,7 @@ function _isContextPathFilterable(oModel: any, sEntitySetPath: any, sContexPath:
|
|
|
163
169
|
|
|
164
170
|
sEntitySetPath = aESParts.join("/");
|
|
165
171
|
|
|
166
|
-
bIsNotFilterable = aContext.some(function(item: string, index: number, array: string[]) {
|
|
172
|
+
bIsNotFilterable = aContext.some(function (item: string, index: number, array: string[]) {
|
|
167
173
|
if (sContext.length > 0) {
|
|
168
174
|
sContext += "/" + item;
|
|
169
175
|
} else {
|
|
@@ -177,7 +183,7 @@ function _isContextPathFilterable(oModel: any, sEntitySetPath: any, sContexPath:
|
|
|
177
183
|
const sTargetPropertyPath = array[array.length - 1];
|
|
178
184
|
if (
|
|
179
185
|
aNonFilterableProperties &&
|
|
180
|
-
aNonFilterableProperties.find(function(oPropertyPath: any) {
|
|
186
|
+
aNonFilterableProperties.find(function (oPropertyPath: any) {
|
|
181
187
|
return oPropertyPath.$PropertyPath === sTargetPropertyPath;
|
|
182
188
|
})
|
|
183
189
|
) {
|
|
@@ -199,7 +205,12 @@ function _isContextPathFilterable(oModel: any, sEntitySetPath: any, sContexPath:
|
|
|
199
205
|
return bIsNotFilterable;
|
|
200
206
|
}
|
|
201
207
|
// TODO check used places and rework this
|
|
202
|
-
function isPropertyFilterable(
|
|
208
|
+
function isPropertyFilterable(
|
|
209
|
+
oModel: ODataMetaModel,
|
|
210
|
+
sEntitySetPath: string,
|
|
211
|
+
sProperty: string,
|
|
212
|
+
bSkipHiddenFilter?: boolean
|
|
213
|
+
): boolean | BindingExpression<string> {
|
|
203
214
|
if (typeof sProperty !== "string") {
|
|
204
215
|
throw new Error("sProperty parameter must be a string");
|
|
205
216
|
}
|
|
@@ -212,8 +223,14 @@ function isPropertyFilterable(oModel: ODataMetaModel, sEntitySetPath: string, sP
|
|
|
212
223
|
|
|
213
224
|
const oNavigationContext = oModel.createBindingContext(sEntitySetPath + "/" + sProperty) as Context;
|
|
214
225
|
|
|
215
|
-
if (
|
|
216
|
-
|
|
226
|
+
if (bSkipHiddenFilter === undefined || !bSkipHiddenFilter) {
|
|
227
|
+
if (oNavigationContext.getProperty("@com.sap.vocabularies.UI.v1.Hidden") === true) {
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
const sHiddenPath = oNavigationContext.getProperty("@com.sap.vocabularies.UI.v1.Hidden/$Path");
|
|
231
|
+
if (sHiddenPath) {
|
|
232
|
+
return compileBinding(not(bindingExpression(sHiddenPath)));
|
|
233
|
+
}
|
|
217
234
|
}
|
|
218
235
|
|
|
219
236
|
if (!bSkipHiddenFilter && oNavigationContext.getProperty("@com.sap.vocabularies.UI.v1.HiddenFilter")) {
|
|
@@ -356,7 +373,7 @@ function updateRelateAppsModel(
|
|
|
356
373
|
aManifestSOItems
|
|
357
374
|
)
|
|
358
375
|
)
|
|
359
|
-
.catch(function(oError: any) {
|
|
376
|
+
.catch(function (oError: any) {
|
|
360
377
|
Log.error("Error while retrieving SO Intents", oError);
|
|
361
378
|
});
|
|
362
379
|
}
|
|
@@ -370,7 +387,7 @@ function updateRelateAppsModel(
|
|
|
370
387
|
}
|
|
371
388
|
|
|
372
389
|
fnGetParseShellHashAndGetLinks()
|
|
373
|
-
.then(function(aLinks: any) {
|
|
390
|
+
.then(function (aLinks: any) {
|
|
374
391
|
if (aLinks && aLinks.length > 0) {
|
|
375
392
|
const oTargetParams: any = {};
|
|
376
393
|
const aAnnotationsSOItems: any[] = [];
|
|
@@ -396,7 +413,7 @@ function updateRelateAppsModel(
|
|
|
396
413
|
oObjectPageLayout.getBindingContext("internal").setProperty("relatedApps/visibility", false);
|
|
397
414
|
}
|
|
398
415
|
})
|
|
399
|
-
.catch(function(oError: any) {
|
|
416
|
+
.catch(function (oError: any) {
|
|
400
417
|
Log.error("Cannot read links", oError);
|
|
401
418
|
});
|
|
402
419
|
return aRelatedAppsMenuItems;
|
|
@@ -445,10 +462,10 @@ function fnUpdateRelatedAppsDetails(oObjectPageLayout: any) {
|
|
|
445
462
|
if (!oEntry) {
|
|
446
463
|
oBindingContext
|
|
447
464
|
.requestObject()
|
|
448
|
-
.then(function(oEntry: any) {
|
|
465
|
+
.then(function (oEntry: any) {
|
|
449
466
|
return updateRelateAppsModel(oBindingContext, oEntry, oObjectPageLayout, aSemKeys, oMetaModel, oMetaPath);
|
|
450
467
|
})
|
|
451
|
-
.catch(function(oError: any) {
|
|
468
|
+
.catch(function (oError: any) {
|
|
452
469
|
Log.error("Cannot update the related app details", oError);
|
|
453
470
|
});
|
|
454
471
|
} else {
|
|
@@ -492,87 +509,7 @@ function getTargetView(oControl: any) {
|
|
|
492
509
|
}
|
|
493
510
|
return oControl;
|
|
494
511
|
}
|
|
495
|
-
/**
|
|
496
|
-
* @param fnProcessFunction
|
|
497
|
-
* @param fnCancelFunction
|
|
498
|
-
* @param oContext
|
|
499
|
-
* @param oController
|
|
500
|
-
* @param bSkipBindingToView
|
|
501
|
-
*/
|
|
502
|
-
function fnProcessDataLossOrDraftDiscardConfirmation(
|
|
503
|
-
fnProcessFunction: any,
|
|
504
|
-
fnCancelFunction: any,
|
|
505
|
-
oContext: any,
|
|
506
|
-
oController: any,
|
|
507
|
-
bSkipBindingToView?: boolean
|
|
508
|
-
) {
|
|
509
|
-
const oModel = oContext.getModel();
|
|
510
|
-
let _bIsModified = false;
|
|
511
|
-
const draftDataContext = oModel.bindContext(oContext.getPath() + "/DraftAdministrativeData").getBoundContext();
|
|
512
|
-
|
|
513
|
-
const collaborationConnected = isConnected(oController.getView());
|
|
514
|
-
const processFunctionForDrafts = !collaborationConnected
|
|
515
|
-
? fnProcessFunction
|
|
516
|
-
: function(...args: any[]) {
|
|
517
|
-
disconnect(oController.getView());
|
|
518
|
-
fnProcessFunction.apply(null, ...args);
|
|
519
|
-
};
|
|
520
|
-
|
|
521
|
-
if (
|
|
522
|
-
oContext &&
|
|
523
|
-
oContext.getObject() &&
|
|
524
|
-
(!oContext.getObject().DraftAdministrativeData || oContext.getObject().IsActiveEntity === true)
|
|
525
|
-
) {
|
|
526
|
-
fnProcessFunction();
|
|
527
|
-
} else {
|
|
528
|
-
draftDataContext
|
|
529
|
-
.requestObject()
|
|
530
|
-
.then(function(draftAdminData: any) {
|
|
531
|
-
if (draftAdminData) {
|
|
532
|
-
_bIsModified = !(draftAdminData.CreationDateTime === draftAdminData.LastChangeDateTime);
|
|
533
|
-
if (_bIsModified) {
|
|
534
|
-
performAfterDiscardorKeepDraft(processFunctionForDrafts, fnCancelFunction, oController, bSkipBindingToView);
|
|
535
|
-
} else {
|
|
536
|
-
processFunctionForDrafts();
|
|
537
|
-
}
|
|
538
|
-
} else {
|
|
539
|
-
fnProcessFunction();
|
|
540
|
-
}
|
|
541
|
-
})
|
|
542
|
-
.catch(function(oError: any) {
|
|
543
|
-
Log.error("Cannot retrieve draftDataContext information", oError);
|
|
544
|
-
});
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
function fnProcessDataLossConfirmation(fnProcess: Function, oControl: any, programmingModel: string) {
|
|
548
|
-
const bUIEditable = oControl.getModel("ui").getProperty("/isEditable"),
|
|
549
|
-
oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.fe.templates") as ResourceBundle,
|
|
550
|
-
sWarningMsg = oResourceBundle && oResourceBundle.getText("T_COMMON_UTILS_NAVIGATION_AWAY_MSG"),
|
|
551
|
-
sConfirmButtonTxt = oResourceBundle && oResourceBundle.getText("T_COMMON_UTILS_NAVIGATION_AWAY_CONFIRM_BUTTON"),
|
|
552
|
-
sCancelButtonTxt = oResourceBundle && oResourceBundle.getText("T_COMMON_UTILS_NAVIGATION_AWAY_CANCEL_BUTTON");
|
|
553
512
|
|
|
554
|
-
if (programmingModel === ProgrammingModel.Sticky && bUIEditable) {
|
|
555
|
-
return MessageBox.warning(sWarningMsg, {
|
|
556
|
-
actions: [sConfirmButtonTxt, sCancelButtonTxt],
|
|
557
|
-
onClose: function(sAction: any) {
|
|
558
|
-
if (sAction === sConfirmButtonTxt) {
|
|
559
|
-
const oInternalModel = oControl && oControl.getModel("internal");
|
|
560
|
-
|
|
561
|
-
Log.info("Navigation confirmed.");
|
|
562
|
-
if (oInternalModel) {
|
|
563
|
-
oInternalModel.setProperty("/sessionOn", false);
|
|
564
|
-
} else {
|
|
565
|
-
Log.warning("Local UIModel couldn't be found.");
|
|
566
|
-
}
|
|
567
|
-
fnProcess();
|
|
568
|
-
} else {
|
|
569
|
-
Log.info("Navigation rejected.");
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
});
|
|
573
|
-
}
|
|
574
|
-
return fnProcess();
|
|
575
|
-
}
|
|
576
513
|
function isFieldControlPathInapplicable(sFieldControlPath: string, oAttribute: any) {
|
|
577
514
|
let bInapplicable = false;
|
|
578
515
|
const aParts = sFieldControlPath.split("/");
|
|
@@ -655,7 +592,7 @@ function fnGetMandatoryFilterFields(oMetaModel: ODataMetaModel, sContextPath: st
|
|
|
655
592
|
function fnGetIBNActions(oControl: any, aIBNActions: any[]) {
|
|
656
593
|
const aActions = oControl && oControl.getActions();
|
|
657
594
|
if (aActions) {
|
|
658
|
-
aActions.forEach(function(oAction: any) {
|
|
595
|
+
aActions.forEach(function (oAction: any) {
|
|
659
596
|
if (oAction.isA("sap.ui.mdc.actiontoolbar.ActionToolbarAction")) {
|
|
660
597
|
oAction = oAction.getAction();
|
|
661
598
|
}
|
|
@@ -672,17 +609,17 @@ function fnGetIBNActions(oControl: any, aIBNActions: any[]) {
|
|
|
672
609
|
*/
|
|
673
610
|
function fnUpdateDataFieldForIBNButtonsVisibility(aIBNActions: any[], oView: View) {
|
|
674
611
|
const oParams: any = {};
|
|
675
|
-
const fnGetLinks = function(oData?: any) {
|
|
612
|
+
const fnGetLinks = function (oData?: any) {
|
|
676
613
|
if (oData) {
|
|
677
614
|
const aKeys = Object.keys(oData);
|
|
678
|
-
aKeys.forEach(function(sKey: string) {
|
|
615
|
+
aKeys.forEach(function (sKey: string) {
|
|
679
616
|
if (sKey.indexOf("_") !== 0 && sKey.indexOf("odata.context") === -1) {
|
|
680
617
|
oParams[sKey] = { value: oData[sKey] };
|
|
681
618
|
}
|
|
682
619
|
});
|
|
683
620
|
}
|
|
684
621
|
if (aIBNActions.length) {
|
|
685
|
-
aIBNActions.forEach(function(oIBNAction: any) {
|
|
622
|
+
aIBNActions.forEach(function (oIBNAction: any) {
|
|
686
623
|
const sSemanticObject = oIBNAction.data("IBNData").semanticObject;
|
|
687
624
|
const sAction = oIBNAction.data("IBNData").action;
|
|
688
625
|
CommonUtils.getShellServices(oView)
|
|
@@ -691,10 +628,10 @@ function fnUpdateDataFieldForIBNButtonsVisibility(aIBNActions: any[], oView: Vie
|
|
|
691
628
|
action: sAction,
|
|
692
629
|
params: oParams
|
|
693
630
|
})
|
|
694
|
-
.then(function(aLink: any) {
|
|
631
|
+
.then(function (aLink: any) {
|
|
695
632
|
oIBNAction.setVisible(oIBNAction.getVisible() && aLink && aLink.length === 1);
|
|
696
633
|
})
|
|
697
|
-
.catch(function(oError: any) {
|
|
634
|
+
.catch(function (oError: any) {
|
|
698
635
|
Log.error("Cannot retrieve the links from the shell service", oError);
|
|
699
636
|
});
|
|
700
637
|
});
|
|
@@ -703,10 +640,10 @@ function fnUpdateDataFieldForIBNButtonsVisibility(aIBNActions: any[], oView: Vie
|
|
|
703
640
|
if (oView && oView.getBindingContext()) {
|
|
704
641
|
(oView.getBindingContext() as any)
|
|
705
642
|
?.requestObject()
|
|
706
|
-
.then(function(oData: any) {
|
|
643
|
+
.then(function (oData: any) {
|
|
707
644
|
return fnGetLinks(oData);
|
|
708
645
|
})
|
|
709
|
-
.catch(function(oError: any) {
|
|
646
|
+
.catch(function (oError: any) {
|
|
710
647
|
Log.error("Cannot retrieve the links from the shell service", oError);
|
|
711
648
|
});
|
|
712
649
|
} else {
|
|
@@ -736,7 +673,7 @@ function getTranslatedText(sFrameworkKey: string, oResourceBundle: ResourceBundl
|
|
|
736
673
|
}
|
|
737
674
|
|
|
738
675
|
// do not allow override so get text from the internal bundle directly
|
|
739
|
-
oResourceBundle =
|
|
676
|
+
oResourceBundle = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core");
|
|
740
677
|
return oResourceBundle.getText(sResourceKey, oParams);
|
|
741
678
|
}
|
|
742
679
|
function _checkIfResourceKeyExists(aCustomBundles: any, sKey: any) {
|
|
@@ -834,7 +771,7 @@ function _requestProperty(oSelectedContext: any, sAction: any, sProperty: any, s
|
|
|
834
771
|
? requestSingletonProperty(sProperty, oSelectedContext.getModel())
|
|
835
772
|
: _requestObject(sAction, oSelectedContext, sProperty);
|
|
836
773
|
|
|
837
|
-
return oPromise.then(function(vPropertyValue: any) {
|
|
774
|
+
return oPromise.then(function (vPropertyValue: any) {
|
|
838
775
|
return Promise.resolve({
|
|
839
776
|
vPropertyValue: vPropertyValue,
|
|
840
777
|
oSelectedContext: oSelectedContext,
|
|
@@ -845,11 +782,11 @@ function _requestProperty(oSelectedContext: any, sAction: any, sProperty: any, s
|
|
|
845
782
|
}
|
|
846
783
|
function _setContextsBasedOnOperationAvailable(oInternalModelContext: any, aRequestPromises: any) {
|
|
847
784
|
return Promise.all(aRequestPromises)
|
|
848
|
-
.then(function(aResults: any[]) {
|
|
785
|
+
.then(function (aResults: any[]) {
|
|
849
786
|
if (aResults.length) {
|
|
850
787
|
const aApplicableContexts: any[] = [],
|
|
851
788
|
aNotApplicableContexts: any[] = [];
|
|
852
|
-
aResults.forEach(function(aResult: any) {
|
|
789
|
+
aResults.forEach(function (aResult: any) {
|
|
853
790
|
if (aResult) {
|
|
854
791
|
if (aResult.vPropertyValue) {
|
|
855
792
|
oInternalModelContext.getModel().setProperty(aResult.sDynamicActionEnabledPath, true);
|
|
@@ -862,7 +799,7 @@ function _setContextsBasedOnOperationAvailable(oInternalModelContext: any, aRequ
|
|
|
862
799
|
_setDynamicActionContexts(oInternalModelContext, aResults[0].sAction, aApplicableContexts, aNotApplicableContexts);
|
|
863
800
|
}
|
|
864
801
|
})
|
|
865
|
-
.catch(function(oError: any) {
|
|
802
|
+
.catch(function (oError: any) {
|
|
866
803
|
Log.trace("Cannot retrieve property value from path", oError);
|
|
867
804
|
});
|
|
868
805
|
}
|
|
@@ -904,7 +841,7 @@ function setActionEnablement(oInternalModelContext: any, oActionOperationAvailab
|
|
|
904
841
|
sProperty,
|
|
905
842
|
"Binding",
|
|
906
843
|
// eslint-disable-next-line no-loop-func
|
|
907
|
-
function(oBindingExpression: any) {
|
|
844
|
+
function (oBindingExpression: any) {
|
|
908
845
|
return constant(oContextData[oBindingExpression.path]);
|
|
909
846
|
},
|
|
910
847
|
true
|
|
@@ -944,16 +881,35 @@ function setActionEnablement(oInternalModelContext: any, oActionOperationAvailab
|
|
|
944
881
|
}
|
|
945
882
|
return Promise.all(aPromises);
|
|
946
883
|
}
|
|
947
|
-
|
|
884
|
+
|
|
885
|
+
function setObjectMappings(sSemanticObject: string, oParams: any, aSemanticObjectMappings: any) {
|
|
886
|
+
aSemanticObjectMappings.forEach(function (oItem: any) {
|
|
887
|
+
if (sSemanticObject === oItem.semanticObject) {
|
|
888
|
+
const oMappings = oItem.items;
|
|
889
|
+
for (let i = 0; i < oMappings.length; i++) {
|
|
890
|
+
const sLocalProperty = oMappings[i].key;
|
|
891
|
+
const sSemanticObjectProperty = oMappings[i].value;
|
|
892
|
+
if (oParams[sLocalProperty]) {
|
|
893
|
+
oParams[sSemanticObjectProperty] = oParams[sLocalProperty];
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
});
|
|
898
|
+
return oParams;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
function _getDefaultOperators(sPropertyType: string) {
|
|
948
902
|
// mdc defines the full set of operations that are meaningful for each Edm Type
|
|
949
|
-
|
|
950
|
-
const
|
|
903
|
+
// TODO Replace with model / internal way of retrieving the actual model type used for the property
|
|
904
|
+
const oDataClass = TypeUtil.getDataTypeClassName(sPropertyType);
|
|
905
|
+
// TODO need to pass proper formatOptions, constraints here
|
|
906
|
+
const oBaseType = TypeUtil.getBaseType(oDataClass, {}, {});
|
|
951
907
|
return FilterOperatorUtil.getOperatorsForType(oBaseType);
|
|
952
908
|
}
|
|
953
909
|
function _getRestrictions(aDefaultOps: any, aExpressionOps: any) {
|
|
954
910
|
// From the default set of Operators for the Base Type, select those that are defined in the Allowed Value.
|
|
955
911
|
// In case that no operators are found, return undefined so that the default set is used.
|
|
956
|
-
const aOperators = aDefaultOps.filter(function(sElement: any) {
|
|
912
|
+
const aOperators = aDefaultOps.filter(function (sElement: any) {
|
|
957
913
|
return aExpressionOps.indexOf(sElement) > -1;
|
|
958
914
|
});
|
|
959
915
|
return aOperators.toString() || undefined;
|
|
@@ -961,7 +917,7 @@ function _getRestrictions(aDefaultOps: any, aExpressionOps: any) {
|
|
|
961
917
|
function getSpecificAllowedExpression(aExpressions: any) {
|
|
962
918
|
const aAllowedExpressionsPriority = CommonUtils.AllowedExpressionsPrio;
|
|
963
919
|
|
|
964
|
-
aExpressions.sort(function(a: any, b: any) {
|
|
920
|
+
aExpressions.sort(function (a: any, b: any) {
|
|
965
921
|
return aAllowedExpressionsPriority.indexOf(a) - aAllowedExpressionsPriority.indexOf(b);
|
|
966
922
|
});
|
|
967
923
|
|
|
@@ -978,6 +934,7 @@ function getOperatorsForProperty(
|
|
|
978
934
|
const oFilterRestrictions = CommonUtils.getFilterRestrictionsByPath(sEntitySetPath, oContext);
|
|
979
935
|
const aEqualsOps = ["EQ"];
|
|
980
936
|
const aSingleRangeOps = ["EQ", "GE", "LE", "LT", "GT", "BT", "NOTLE", "NOTLT", "NOTGE", "NOTGT"];
|
|
937
|
+
const aSingleRangeDTBasicOps = ["EQ", "BT"];
|
|
981
938
|
const aSingleValueDateOps = [
|
|
982
939
|
"TODAY",
|
|
983
940
|
"TOMORROW",
|
|
@@ -992,6 +949,7 @@ function getOperatorsForProperty(
|
|
|
992
949
|
"FIRSTDAYYEAR",
|
|
993
950
|
"LASTDAYYEAR"
|
|
994
951
|
];
|
|
952
|
+
const aBasicDateTimeOps = ["EQ", "LE", "GE", "BT"];
|
|
995
953
|
const aMultiRangeOps = ["EQ", "GE", "LE", "LT", "GT", "BT", "NE", "NOTBT", "NOTLE", "NOTLT", "NOTGE", "NOTGT"];
|
|
996
954
|
const aSearchExpressionOps = ["Contains", "NotContains", "StartsWith", "NotStartsWith", "EndsWith", "NotEndsWith"];
|
|
997
955
|
const aSemanticDateOpsExt = SemanticDateOperators.getSupportedOperations();
|
|
@@ -1008,7 +966,9 @@ function getOperatorsForProperty(
|
|
|
1008
966
|
} else {
|
|
1009
967
|
aSemanticDateOps = SemanticDateOperators.getSemanticDateOperations();
|
|
1010
968
|
}
|
|
1011
|
-
|
|
969
|
+
const aSingleRangeDateTimeOps = aSemanticDateOps.filter(function (sOperator) {
|
|
970
|
+
return sOperator !== "DATE" && sOperator !== "DATERANGE" && sOperator !== "FROM" && sOperator !== "TO";
|
|
971
|
+
});
|
|
1012
972
|
// Get the default Operators for this Property Type
|
|
1013
973
|
let aDefaultOperators = _getDefaultOperators(sType);
|
|
1014
974
|
|
|
@@ -1018,7 +978,6 @@ function getOperatorsForProperty(
|
|
|
1018
978
|
if (bSemanticDateRange) {
|
|
1019
979
|
aDefaultOperators = aSemanticDateOpsExt.concat(aDefaultOperators);
|
|
1020
980
|
}
|
|
1021
|
-
|
|
1022
981
|
const sAllowedExpression = CommonUtils.getSpecificAllowedExpression(oFilterRestrictions.FilterAllowedExpressions[sProperty]);
|
|
1023
982
|
let sRestrictions;
|
|
1024
983
|
// In case more than one Allowed Expressions has been defined for a property
|
|
@@ -1034,10 +993,16 @@ function getOperatorsForProperty(
|
|
|
1034
993
|
sRestrictions = _getRestrictions(aDefaultOperators, aEqualsOps);
|
|
1035
994
|
break;
|
|
1036
995
|
case "SingleRange":
|
|
1037
|
-
const
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
996
|
+
const aExpressionOps = bSemanticDateRange
|
|
997
|
+
? sType === "Edm.Date"
|
|
998
|
+
? aSemanticDateOps
|
|
999
|
+
: sType === "Edm.DateTimeOffset"
|
|
1000
|
+
? aSingleRangeDateTimeOps.concat(aBasicDateTimeOps)
|
|
1001
|
+
: aSingleRangeOps
|
|
1002
|
+
: sType === "Edm.DateTimeOffset"
|
|
1003
|
+
? aSingleRangeDTBasicOps
|
|
1004
|
+
: aSingleRangeOps;
|
|
1005
|
+
const sOperators = _getRestrictions(aDefaultOperators, aExpressionOps);
|
|
1041
1006
|
sRestrictions = sOperators ? sOperators : "";
|
|
1042
1007
|
break;
|
|
1043
1008
|
case "MultiRange":
|
|
@@ -1060,7 +1025,7 @@ function getOperatorsForProperty(
|
|
|
1060
1025
|
// In case AllowedExpressions is not provided for type Edm.Date then all the default
|
|
1061
1026
|
// operators for the type should be returned excluding semantic operators from the list.
|
|
1062
1027
|
aSemanticDateOps = SemanticDateOperators.getSemanticDateOperations();
|
|
1063
|
-
const aOperators = aDefaultOperators.filter(function(sElement: any) {
|
|
1028
|
+
const aOperators = aDefaultOperators.filter(function (sElement: any) {
|
|
1064
1029
|
return aSemanticDateOps.indexOf(sElement) < 0;
|
|
1065
1030
|
});
|
|
1066
1031
|
return aOperators.toString();
|
|
@@ -1144,7 +1109,7 @@ function addSelectionVariantToConditions(oSelectionVariant: any, oConditions: ob
|
|
|
1144
1109
|
|
|
1145
1110
|
if (bHasParameters) {
|
|
1146
1111
|
const aMetadataParameters = Object.keys(oValidParameterProperties);
|
|
1147
|
-
aMetadataParameters.forEach(function(sMetadataParameter: string) {
|
|
1112
|
+
aMetadataParameters.forEach(function (sMetadataParameter: string) {
|
|
1148
1113
|
let sSelectOptionName;
|
|
1149
1114
|
if (aSelectOptionsPropertyNames.includes("$Parameter." + sMetadataParameter)) {
|
|
1150
1115
|
sSelectOptionName = "$Parameter." + sMetadataParameter;
|
|
@@ -1181,7 +1146,7 @@ function addSelectionVariantToConditions(oSelectionVariant: any, oConditions: ob
|
|
|
1181
1146
|
}
|
|
1182
1147
|
});
|
|
1183
1148
|
}
|
|
1184
|
-
aMetadatProperties.forEach(function(sMetadataProperty: string) {
|
|
1149
|
+
aMetadatProperties.forEach(function (sMetadataProperty: string) {
|
|
1185
1150
|
let sSelectOptionName;
|
|
1186
1151
|
if (aSelectOptionsPropertyNames.includes(sMetadataProperty)) {
|
|
1187
1152
|
sSelectOptionName = sMetadataProperty;
|
|
@@ -1208,7 +1173,7 @@ function addSelectionVariantToConditions(oSelectionVariant: any, oConditions: ob
|
|
|
1208
1173
|
}
|
|
1209
1174
|
});
|
|
1210
1175
|
|
|
1211
|
-
aSelectOptionsPropertyNames.forEach(function(sSelectOption: any) {
|
|
1176
|
+
aSelectOptionsPropertyNames.forEach(function (sSelectOption: any) {
|
|
1212
1177
|
if (sSelectOption.indexOf(".") > 0 && !sSelectOption.includes("$Parameter")) {
|
|
1213
1178
|
const sFullContextPath = ("/" + sSelectOption.replaceAll(".", "/")).startsWith(sContextPath)
|
|
1214
1179
|
? "/" + sSelectOption.replaceAll(".", "/")
|
|
@@ -1310,7 +1275,7 @@ function addExternalStateFiltersToSelectionVariant(oSelectionVariant: any, mFilt
|
|
|
1310
1275
|
let sFilter: any,
|
|
1311
1276
|
sLow = "",
|
|
1312
1277
|
sHigh = null;
|
|
1313
|
-
const fnGetSignAndOption = function(sOperator: any, sLowValue: any, sHighValue: any) {
|
|
1278
|
+
const fnGetSignAndOption = function (sOperator: any, sLowValue: any, sHighValue: any) {
|
|
1314
1279
|
const oSelectOptionState = {
|
|
1315
1280
|
option: "",
|
|
1316
1281
|
sign: "I",
|
|
@@ -1394,14 +1359,14 @@ function addExternalStateFiltersToSelectionVariant(oSelectionVariant: any, mFilt
|
|
|
1394
1359
|
const oFilterConditions = mFilters.filterConditions;
|
|
1395
1360
|
const oFiltersWithoutConflict = mFilters.filterConditionsWithoutConflict ? mFilters.filterConditionsWithoutConflict : {};
|
|
1396
1361
|
const oTablePropertiesWithoutConflict = oTargetInfo.propertiesWithoutConflict ? oTargetInfo.propertiesWithoutConflict : {};
|
|
1397
|
-
const addFiltersToSelectionVariant = function(oSelectionVariant: any, sFilterName: any, sPath?: any) {
|
|
1362
|
+
const addFiltersToSelectionVariant = function (oSelectionVariant: any, sFilterName: any, sPath?: any) {
|
|
1398
1363
|
const aFilters = oFilterConditions[sFilterName];
|
|
1399
1364
|
for (const item in aFilters) {
|
|
1400
1365
|
const oFilter = aFilters[item];
|
|
1401
1366
|
sLow = (oFilter.values[0] && oFilter.values[0].toString()) || "";
|
|
1402
1367
|
sHigh = (oFilter.values[1] && oFilter.values[1].toString()) || null;
|
|
1403
1368
|
if (oFilter.operator === "TODAY" || oFilter.operator === "DATE") {
|
|
1404
|
-
const aFilter = oFilterInfo[0].aFilters.filter(function(oFilter: any) {
|
|
1369
|
+
const aFilter = oFilterInfo[0].aFilters.filter(function (oFilter: any) {
|
|
1405
1370
|
return oFilter.sPath === sFilterName;
|
|
1406
1371
|
});
|
|
1407
1372
|
sLow = aFilter[0].oValue1 || "";
|
|
@@ -1518,12 +1483,12 @@ function setUserDefaults(
|
|
|
1518
1483
|
bIsCreate?: boolean,
|
|
1519
1484
|
oActionDefaultValues?: any
|
|
1520
1485
|
) {
|
|
1521
|
-
return new Promise(function(resolve: (value: any) => void) {
|
|
1486
|
+
return new Promise(function (resolve: (value: any) => void) {
|
|
1522
1487
|
const oComponentData = oAppComponent.getComponentData(),
|
|
1523
1488
|
oStartupParameters = (oComponentData && oComponentData.startupParameters) || {},
|
|
1524
1489
|
oShellServices = oAppComponent.getShellServices();
|
|
1525
1490
|
if (!oShellServices.hasUShell()) {
|
|
1526
|
-
aParameters.forEach(function(oParameter: any) {
|
|
1491
|
+
aParameters.forEach(function (oParameter: any) {
|
|
1527
1492
|
const sPropertyName = bIsAction
|
|
1528
1493
|
? "/" + oParameter.$Name
|
|
1529
1494
|
: oParameter.getPath().slice(oParameter.getPath().lastIndexOf("/") + 1);
|
|
@@ -1538,10 +1503,10 @@ function setUserDefaults(
|
|
|
1538
1503
|
});
|
|
1539
1504
|
return resolve(true);
|
|
1540
1505
|
}
|
|
1541
|
-
return oShellServices.getStartupAppState(oAppComponent).then(function(oStartupAppState: any) {
|
|
1506
|
+
return oShellServices.getStartupAppState(oAppComponent).then(function (oStartupAppState: any) {
|
|
1542
1507
|
const oData = oStartupAppState.getData() || {},
|
|
1543
1508
|
aExtendedParameters = (oData.selectionVariant && oData.selectionVariant.SelectOptions) || [];
|
|
1544
|
-
aParameters.forEach(function(oParameter: any) {
|
|
1509
|
+
aParameters.forEach(function (oParameter: any) {
|
|
1545
1510
|
const sPropertyName = bIsAction
|
|
1546
1511
|
? "/" + oParameter.$Name
|
|
1547
1512
|
: oParameter.getPath().slice(oParameter.getPath().lastIndexOf("/") + 1);
|
|
@@ -1556,7 +1521,9 @@ function setUserDefaults(
|
|
|
1556
1521
|
for (const i in aExtendedParameters) {
|
|
1557
1522
|
const oExtendedParameter = aExtendedParameters[i];
|
|
1558
1523
|
if (oExtendedParameter.PropertyName === sParameterName) {
|
|
1559
|
-
const oRange = oExtendedParameter.Ranges.length
|
|
1524
|
+
const oRange = oExtendedParameter.Ranges.length
|
|
1525
|
+
? oExtendedParameter.Ranges[oExtendedParameter.Ranges.length - 1]
|
|
1526
|
+
: undefined;
|
|
1560
1527
|
if (oRange && oRange.Sign === "I" && oRange.Option === "EQ") {
|
|
1561
1528
|
oModel.setProperty(sPropertyName, oRange.Low); // high is ignored when Option=EQ
|
|
1562
1529
|
}
|
|
@@ -1571,7 +1538,7 @@ function setUserDefaults(
|
|
|
1571
1538
|
function getAdditionalParamsForCreate(oStartupParameters: any, oInboundParameters: any) {
|
|
1572
1539
|
const oInbounds = oInboundParameters,
|
|
1573
1540
|
aCreateParameters = oInbounds
|
|
1574
|
-
? Object.keys(oInbounds).filter(function(sParameter: string) {
|
|
1541
|
+
? Object.keys(oInbounds).filter(function (sParameter: string) {
|
|
1575
1542
|
return oInbounds[sParameter].useForCreate;
|
|
1576
1543
|
})
|
|
1577
1544
|
: [];
|
|
@@ -1591,7 +1558,7 @@ function getSemanticObjectMapping(oOutbound: any) {
|
|
|
1591
1558
|
if (oOutbound.parameters) {
|
|
1592
1559
|
const aParameters = Object.keys(oOutbound.parameters) || [];
|
|
1593
1560
|
if (aParameters.length > 0) {
|
|
1594
|
-
aParameters.forEach(function(sParam: string) {
|
|
1561
|
+
aParameters.forEach(function (sParam: string) {
|
|
1595
1562
|
const oMapping = oOutbound.parameters[sParam];
|
|
1596
1563
|
if (oMapping.value && oMapping.value.value && oMapping.value.format === "binding") {
|
|
1597
1564
|
// using the format of UI.Mapping
|
|
@@ -1674,7 +1641,7 @@ function setSemanticObjectMappings(oSelectionVariant: any, vMappings: object) {
|
|
|
1674
1641
|
return oSelectionVariant;
|
|
1675
1642
|
}
|
|
1676
1643
|
function fnGetSemanticObjectsFromPath(oMetaModel: any, sPath: any) {
|
|
1677
|
-
return new Promise(function(resolve: (value: any) => void) {
|
|
1644
|
+
return new Promise(function (resolve: (value: any) => void) {
|
|
1678
1645
|
const sSemanticObject = oMetaModel.getObject(sPath + "@com.sap.vocabularies.Common.v1.SemanticObject");
|
|
1679
1646
|
const aSemanticObjectUnavailableActions = oMetaModel.getObject(
|
|
1680
1647
|
sPath + "@com.sap.vocabularies.Common.v1.SemanticObjectUnavailableActions"
|
|
@@ -1689,19 +1656,19 @@ function fnGetSemanticObjectsFromPath(oMetaModel: any, sPath: any) {
|
|
|
1689
1656
|
semanticObject: oSemanticObject,
|
|
1690
1657
|
unavailableActions: aSemanticObjectUnavailableActions
|
|
1691
1658
|
});
|
|
1692
|
-
}).catch(function(oError: any) {
|
|
1659
|
+
}).catch(function (oError: any) {
|
|
1693
1660
|
Log.error("Error in fnGetSemanticObjectsFromPath", oError);
|
|
1694
1661
|
});
|
|
1695
1662
|
}
|
|
1696
1663
|
function fnUpdateSemanticTargetsModel(aGetLinksPromises: any, aSemanticObjects: any, oInternalModelContext: any, sCurrentHash: any) {
|
|
1697
1664
|
return Promise.all(aGetLinksPromises)
|
|
1698
|
-
.then(function(aValues: any[]) {
|
|
1665
|
+
.then(function (aValues: any[]) {
|
|
1699
1666
|
let aLinks,
|
|
1700
1667
|
_oLink,
|
|
1701
1668
|
_sLinkIntentAction,
|
|
1702
1669
|
aFinalLinks: any[] = [];
|
|
1703
1670
|
let oFinalSemanticObjects: any = {};
|
|
1704
|
-
const bIntentHasActions = function(sIntent: any, aActions: any) {
|
|
1671
|
+
const bIntentHasActions = function (sIntent: any, aActions: any) {
|
|
1705
1672
|
for (const intent in aActions) {
|
|
1706
1673
|
if (intent === sIntent) {
|
|
1707
1674
|
return true;
|
|
@@ -1771,7 +1738,7 @@ function fnUpdateSemanticTargetsModel(aGetLinksPromises: any, aSemanticObjects:
|
|
|
1771
1738
|
return oFinalSemanticObjects;
|
|
1772
1739
|
}
|
|
1773
1740
|
})
|
|
1774
|
-
.catch(function(oError: any) {
|
|
1741
|
+
.catch(function (oError: any) {
|
|
1775
1742
|
Log.error("fnUpdateSemanticTargetsModel: Cannot read links", oError);
|
|
1776
1743
|
});
|
|
1777
1744
|
}
|
|
@@ -1779,7 +1746,7 @@ function fnGetSemanticObjectPromise(oAppComponent: any, oView: any, oMetaModel:
|
|
|
1779
1746
|
return CommonUtils.getSemanticObjectsFromPath(oMetaModel, sPath);
|
|
1780
1747
|
}
|
|
1781
1748
|
function fnGetSemanticTargetsFromPageModel(oController: any, sPageModel: string) {
|
|
1782
|
-
const _fnfindValuesHelper = function(obj: any, key: any, list: any) {
|
|
1749
|
+
const _fnfindValuesHelper = function (obj: any, key: any, list: any) {
|
|
1783
1750
|
if (!obj) {
|
|
1784
1751
|
return list;
|
|
1785
1752
|
}
|
|
@@ -1803,11 +1770,11 @@ function fnGetSemanticTargetsFromPageModel(oController: any, sPageModel: string)
|
|
|
1803
1770
|
}
|
|
1804
1771
|
return list;
|
|
1805
1772
|
};
|
|
1806
|
-
const _fnfindValues = function(obj: any, key: any) {
|
|
1773
|
+
const _fnfindValues = function (obj: any, key: any) {
|
|
1807
1774
|
return _fnfindValuesHelper(obj, key, []);
|
|
1808
1775
|
};
|
|
1809
|
-
const _fnDeleteDuplicateSemanticObjects = function(aSemanticObjectPath: any) {
|
|
1810
|
-
return aSemanticObjectPath.filter(function(value: any, index: any) {
|
|
1776
|
+
const _fnDeleteDuplicateSemanticObjects = function (aSemanticObjectPath: any) {
|
|
1777
|
+
return aSemanticObjectPath.filter(function (value: any, index: any) {
|
|
1811
1778
|
return aSemanticObjectPath.indexOf(value) === index;
|
|
1812
1779
|
});
|
|
1813
1780
|
};
|
|
@@ -1846,10 +1813,10 @@ function fnGetSemanticTargetsFromPageModel(oController: any, sPageModel: string)
|
|
|
1846
1813
|
return Promise.resolve();
|
|
1847
1814
|
} else {
|
|
1848
1815
|
Promise.all(aSemanticObjectsPromises)
|
|
1849
|
-
.then(function(aValues: any[]) {
|
|
1816
|
+
.then(function (aValues: any[]) {
|
|
1850
1817
|
const aGetLinksPromises = [];
|
|
1851
1818
|
let sSemObjExpression;
|
|
1852
|
-
const aSemanticObjectsResolved = aValues.filter(function(element: any) {
|
|
1819
|
+
const aSemanticObjectsResolved = aValues.filter(function (element: any) {
|
|
1853
1820
|
if (
|
|
1854
1821
|
element.semanticObject !== undefined &&
|
|
1855
1822
|
element.semanticObject.semanticObject &&
|
|
@@ -1883,7 +1850,7 @@ function fnGetSemanticTargetsFromPageModel(oController: any, sPageModel: string)
|
|
|
1883
1850
|
}
|
|
1884
1851
|
return CommonUtils.updateSemanticTargets(aGetLinksPromises, aSemanticObjects, oInternalModelContext, sCurrentHash);
|
|
1885
1852
|
})
|
|
1886
|
-
.catch(function(oError: any) {
|
|
1853
|
+
.catch(function (oError: any) {
|
|
1887
1854
|
Log.error("fnGetSemanticTargetsFromTable: Cannot get Semantic Objects", oError);
|
|
1888
1855
|
});
|
|
1889
1856
|
}
|
|
@@ -1896,7 +1863,7 @@ function getFilterRestrictions(oFilterRestrictionsAnnotation: any, sRestriction:
|
|
|
1896
1863
|
if (sRestriction === FilterRestrictions.REQUIRED_PROPERTIES || sRestriction === FilterRestrictions.NON_FILTERABLE_PROPERTIES) {
|
|
1897
1864
|
let aProps = [];
|
|
1898
1865
|
if (oFilterRestrictionsAnnotation && oFilterRestrictionsAnnotation[sRestriction]) {
|
|
1899
|
-
aProps = oFilterRestrictionsAnnotation[sRestriction].map(function(oProperty: any) {
|
|
1866
|
+
aProps = oFilterRestrictionsAnnotation[sRestriction].map(function (oProperty: any) {
|
|
1900
1867
|
return oProperty.$PropertyPath;
|
|
1901
1868
|
});
|
|
1902
1869
|
}
|
|
@@ -1904,7 +1871,7 @@ function getFilterRestrictions(oFilterRestrictionsAnnotation: any, sRestriction:
|
|
|
1904
1871
|
} else if (sRestriction === FilterRestrictions.ALLOWED_EXPRESSIONS) {
|
|
1905
1872
|
const mAllowedExpressions: any = {};
|
|
1906
1873
|
if (oFilterRestrictionsAnnotation && oFilterRestrictionsAnnotation.FilterExpressionRestrictions) {
|
|
1907
|
-
oFilterRestrictionsAnnotation.FilterExpressionRestrictions.forEach(function(oProperty: any) {
|
|
1874
|
+
oFilterRestrictionsAnnotation.FilterExpressionRestrictions.forEach(function (oProperty: any) {
|
|
1908
1875
|
//SingleValue | MultiValue | SingleRange | MultiRange | SearchExpression | MultiRangeOrSearchExpression
|
|
1909
1876
|
if (mAllowedExpressions[oProperty.Property.$PropertyPath]) {
|
|
1910
1877
|
mAllowedExpressions[oProperty.Property.$PropertyPath].push(oProperty.AllowedExpressions);
|
|
@@ -1957,20 +1924,20 @@ function getFilterRestrictionsByPath(sEntitySetPath: any, oMetaModel: any) {
|
|
|
1957
1924
|
function templateControlFragment(sFragmentName: any, oPreprocessorSettings: any, oOptions: any, oModifier?: any) {
|
|
1958
1925
|
oOptions = oOptions || {};
|
|
1959
1926
|
if (oModifier) {
|
|
1960
|
-
return oModifier.templateControlFragment(sFragmentName, oPreprocessorSettings, oOptions.view).then(function(oFragment: any) {
|
|
1927
|
+
return oModifier.templateControlFragment(sFragmentName, oPreprocessorSettings, oOptions.view).then(function (oFragment: any) {
|
|
1961
1928
|
// This is required as Flex returns an HTMLCollection as templating result in XML time.
|
|
1962
1929
|
return oModifier.targets === "xmlTree" && oFragment.length > 0 ? oFragment[0] : oFragment;
|
|
1963
1930
|
});
|
|
1964
1931
|
} else {
|
|
1965
1932
|
return loadMacroLibrary()
|
|
1966
|
-
.then(function() {
|
|
1933
|
+
.then(function () {
|
|
1967
1934
|
return XMLPreprocessor.process(
|
|
1968
1935
|
XMLTemplateProcessor.loadTemplate(sFragmentName, "fragment"),
|
|
1969
1936
|
{ name: sFragmentName },
|
|
1970
1937
|
oPreprocessorSettings
|
|
1971
1938
|
);
|
|
1972
1939
|
})
|
|
1973
|
-
.then(function(oFragment: any) {
|
|
1940
|
+
.then(function (oFragment: any) {
|
|
1974
1941
|
const oControl = oFragment.firstElementChild;
|
|
1975
1942
|
if (!!oOptions.isXML && oControl) {
|
|
1976
1943
|
return oControl;
|
|
@@ -2010,7 +1977,7 @@ function requestSingletonProperty(path: string, model: ODataModel) {
|
|
|
2010
1977
|
}
|
|
2011
1978
|
function addEventToBindingInfo(oControl: Control, sEventName: string, fHandler: Function) {
|
|
2012
1979
|
let oBindingInfo: any;
|
|
2013
|
-
const setBindingInfo = function() {
|
|
1980
|
+
const setBindingInfo = function () {
|
|
2014
1981
|
if (oBindingInfo) {
|
|
2015
1982
|
if (!oBindingInfo.events) {
|
|
2016
1983
|
oBindingInfo.events = {};
|
|
@@ -2019,7 +1986,7 @@ function addEventToBindingInfo(oControl: Control, sEventName: string, fHandler:
|
|
|
2019
1986
|
oBindingInfo.events[sEventName] = fHandler;
|
|
2020
1987
|
} else {
|
|
2021
1988
|
const fOriginalHandler = oBindingInfo.events[sEventName];
|
|
2022
|
-
oBindingInfo.events[sEventName] = function(...args: any[]) {
|
|
1989
|
+
oBindingInfo.events[sEventName] = function (...args: any[]) {
|
|
2023
1990
|
fHandler.apply(this, ...args);
|
|
2024
1991
|
fOriginalHandler.apply(this, ...args);
|
|
2025
1992
|
};
|
|
@@ -2029,14 +1996,11 @@ function addEventToBindingInfo(oControl: Control, sEventName: string, fHandler:
|
|
|
2029
1996
|
if (oControl.isA("sap.ui.mdc.Chart")) {
|
|
2030
1997
|
(oControl as any)
|
|
2031
1998
|
.innerChartBound()
|
|
2032
|
-
.then(function() {
|
|
2033
|
-
oBindingInfo = (oControl as any)
|
|
2034
|
-
.getControlDelegate()
|
|
2035
|
-
._getChart(oControl)
|
|
2036
|
-
.getBindingInfo("data");
|
|
1999
|
+
.then(function () {
|
|
2000
|
+
oBindingInfo = (oControl as any).getControlDelegate()._getChart(oControl).getBindingInfo("data");
|
|
2037
2001
|
setBindingInfo();
|
|
2038
2002
|
})
|
|
2039
|
-
.catch(function(sError: any) {
|
|
2003
|
+
.catch(function (sError: any) {
|
|
2040
2004
|
Log.error(sError);
|
|
2041
2005
|
});
|
|
2042
2006
|
} else {
|
|
@@ -2045,25 +2009,25 @@ function addEventToBindingInfo(oControl: Control, sEventName: string, fHandler:
|
|
|
2045
2009
|
}
|
|
2046
2010
|
}
|
|
2047
2011
|
function loadMacroLibrary() {
|
|
2048
|
-
return new Promise<void>(function(resolve) {
|
|
2049
|
-
sap.ui.require(["sap/fe/macros/macroLibrary"], function(/*macroLibrary*/) {
|
|
2012
|
+
return new Promise<void>(function (resolve) {
|
|
2013
|
+
sap.ui.require(["sap/fe/macros/macroLibrary"], function (/*macroLibrary*/) {
|
|
2050
2014
|
resolve();
|
|
2051
2015
|
});
|
|
2052
2016
|
});
|
|
2053
2017
|
}
|
|
2054
2018
|
|
|
2055
2019
|
function fnOnStrictHandlingFailed(sGroupId: string, actionName: string, oModel: ODataModel, aMessages: any[]) {
|
|
2056
|
-
const localI18nRef =
|
|
2020
|
+
const localI18nRef = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core"),
|
|
2057
2021
|
sActionName = actionName,
|
|
2058
2022
|
sCancelButtonTxt = localI18nRef.getText("CANCEL");
|
|
2059
2023
|
if (aMessages.length === 1) {
|
|
2060
2024
|
const sMessage = aMessages[0].message + "\n" + localI18nRef.getText("PROCEED");
|
|
2061
|
-
const dialogPromise = new Promise(function(resolve) {
|
|
2025
|
+
const dialogPromise = new Promise(function (resolve) {
|
|
2062
2026
|
MessageBox.warning(sMessage, {
|
|
2063
2027
|
title: localI18nRef.getText("WARNING"),
|
|
2064
2028
|
actions: [sActionName, sCancelButtonTxt],
|
|
2065
2029
|
emphasizedAction: sActionName,
|
|
2066
|
-
onClose: function(sAction: string) {
|
|
2030
|
+
onClose: function (sAction: string) {
|
|
2067
2031
|
if (sAction === sActionName) {
|
|
2068
2032
|
resolve(true);
|
|
2069
2033
|
oModel.submitBatch(sGroupId);
|
|
@@ -2075,7 +2039,7 @@ function fnOnStrictHandlingFailed(sGroupId: string, actionName: string, oModel:
|
|
|
2075
2039
|
});
|
|
2076
2040
|
return dialogPromise;
|
|
2077
2041
|
}
|
|
2078
|
-
return new Promise(function(resolve) {
|
|
2042
|
+
return new Promise(function (resolve) {
|
|
2079
2043
|
const oMessageDialogModel = new JSONModel();
|
|
2080
2044
|
oMessageDialogModel.setData(aMessages);
|
|
2081
2045
|
const bStrictHandlingFlow = true;
|
|
@@ -2094,7 +2058,7 @@ function fnOnStrictHandlingFailed(sGroupId: string, actionName: string, oModel:
|
|
|
2094
2058
|
});
|
|
2095
2059
|
oDialog.setBeginButton(
|
|
2096
2060
|
new Button({
|
|
2097
|
-
press: function() {
|
|
2061
|
+
press: function () {
|
|
2098
2062
|
resolve(true);
|
|
2099
2063
|
oModel.submitBatch(sGroupId);
|
|
2100
2064
|
oDialog.close();
|
|
@@ -2105,7 +2069,7 @@ function fnOnStrictHandlingFailed(sGroupId: string, actionName: string, oModel:
|
|
|
2105
2069
|
);
|
|
2106
2070
|
oDialog.setEndButton(
|
|
2107
2071
|
new Button({
|
|
2108
|
-
press: function() {
|
|
2072
|
+
press: function () {
|
|
2109
2073
|
resolve(false);
|
|
2110
2074
|
oDialog.close();
|
|
2111
2075
|
},
|
|
@@ -2115,6 +2079,87 @@ function fnOnStrictHandlingFailed(sGroupId: string, actionName: string, oModel:
|
|
|
2115
2079
|
oDialog.open();
|
|
2116
2080
|
});
|
|
2117
2081
|
}
|
|
2082
|
+
|
|
2083
|
+
function getMessageColumn(oControl: any): string {
|
|
2084
|
+
if (!oControl || oControl.isA("sap.ui.core.mvc.XMLView")) {
|
|
2085
|
+
return "";
|
|
2086
|
+
}
|
|
2087
|
+
const headerInfoTitlePath = oControl.getParent().getTableDefinition().headerInfoTitle;
|
|
2088
|
+
const oMetaModel = oControl && (oControl.getModel().getMetaModel() as any),
|
|
2089
|
+
sCurrentEntitySetName = oControl.data("metaPath");
|
|
2090
|
+
const aTechnicalKeys = oMetaModel.getObject(sCurrentEntitySetName + "/$Type/$Key");
|
|
2091
|
+
const aFilteredTechnicalKeys: string[] = [];
|
|
2092
|
+
|
|
2093
|
+
aTechnicalKeys.forEach(function (technicalKey: string) {
|
|
2094
|
+
if (technicalKey !== "IsActiveEntity") {
|
|
2095
|
+
aFilteredTechnicalKeys.push(technicalKey);
|
|
2096
|
+
}
|
|
2097
|
+
});
|
|
2098
|
+
const semanticKeyColumns = oControl.getParent().getTableDefinition().semanticKeys;
|
|
2099
|
+
|
|
2100
|
+
const aVisibleColumns: any = [];
|
|
2101
|
+
const aTableColumns = oControl.getColumns();
|
|
2102
|
+
aTableColumns.forEach(function (oColumn: any) {
|
|
2103
|
+
const columnPathSplit = oColumn.getId().split("::");
|
|
2104
|
+
aVisibleColumns.push(columnPathSplit[columnPathSplit.length - 1]);
|
|
2105
|
+
});
|
|
2106
|
+
let subtitleColumn: string = ""; //set the corressponding subtitle column
|
|
2107
|
+
if (headerInfoTitlePath !== undefined && aVisibleColumns.indexOf(headerInfoTitlePath) !== -1) {
|
|
2108
|
+
subtitleColumn = headerInfoTitlePath;
|
|
2109
|
+
} else if (
|
|
2110
|
+
semanticKeyColumns !== undefined &&
|
|
2111
|
+
semanticKeyColumns.length === 1 &&
|
|
2112
|
+
aVisibleColumns.indexOf(semanticKeyColumns[0]) !== -1
|
|
2113
|
+
) {
|
|
2114
|
+
subtitleColumn = semanticKeyColumns[0];
|
|
2115
|
+
}
|
|
2116
|
+
// set correct context to correct message in message model
|
|
2117
|
+
else if (aFilteredTechnicalKeys !== undefined && aFilteredTechnicalKeys.length === 1) {
|
|
2118
|
+
subtitleColumn = aFilteredTechnicalKeys[0];
|
|
2119
|
+
}
|
|
2120
|
+
return subtitleColumn;
|
|
2121
|
+
}
|
|
2122
|
+
|
|
2123
|
+
function getMessageStripText(
|
|
2124
|
+
view: any,
|
|
2125
|
+
aIgnoredLabels: any,
|
|
2126
|
+
oFilterBar: any,
|
|
2127
|
+
bIsChart: any,
|
|
2128
|
+
bIsSearchIgnored: any,
|
|
2129
|
+
sTabTitle: any,
|
|
2130
|
+
oResourceBundle: any,
|
|
2131
|
+
fnGetLocalizedText: any
|
|
2132
|
+
): string {
|
|
2133
|
+
let sText = "";
|
|
2134
|
+
if (bIsChart) {
|
|
2135
|
+
const oChart = view.getController().getChartControl();
|
|
2136
|
+
const bIsDraftSupported = oChart.data("draftSupported") === "true";
|
|
2137
|
+
const oMacroResourceBundle = Core.getLibraryResourceBundle("sap.fe.macros") as ResourceBundle;
|
|
2138
|
+
bIsSearchIgnored = bIsSearchIgnored && aIgnoredLabels.includes(oMacroResourceBundle.getText("M_FILTERBAR_SEARCH"));
|
|
2139
|
+
if (aIgnoredLabels.length === 2 && bIsSearchIgnored && bIsDraftSupported) {
|
|
2140
|
+
sText = oResourceBundle.getText("C_LR_MULTIVIZ_CHART_IGNORED_FILTER_DRAFT_DATA_AND_SEARCH");
|
|
2141
|
+
} else if (aIgnoredLabels.length === 1 && bIsDraftSupported) {
|
|
2142
|
+
sText = oResourceBundle.getText("C_MULTIVIZ_CHART_IGNORED_FILTER_DRAFT_DATA");
|
|
2143
|
+
} else {
|
|
2144
|
+
const sResource =
|
|
2145
|
+
"C_LR_MULTIVIZ_CHART_" +
|
|
2146
|
+
(aIgnoredLabels.length === 1 ? "SINGLE" : "MULTI") +
|
|
2147
|
+
"_IGNORED_FILTER_" +
|
|
2148
|
+
(system.desktop ? "LARGE" : "SMALL");
|
|
2149
|
+
sText = oResourceBundle.getText(sResource, [aIgnoredLabels.join(", ")]);
|
|
2150
|
+
}
|
|
2151
|
+
} else {
|
|
2152
|
+
const sResource =
|
|
2153
|
+
"C_LR_MULTITABLES_" +
|
|
2154
|
+
(aIgnoredLabels.length === 1 ? "SINGLE" : "MULTI") +
|
|
2155
|
+
"_IGNORED_FILTER_" +
|
|
2156
|
+
(system.desktop ? "LARGE" : "SMALL"),
|
|
2157
|
+
sLocalizedTableTitle = fnGetLocalizedText(sTabTitle, oFilterBar);
|
|
2158
|
+
sText = oResourceBundle.getText(sResource, [aIgnoredLabels.join(", "), sLocalizedTableTitle]);
|
|
2159
|
+
}
|
|
2160
|
+
return sText;
|
|
2161
|
+
}
|
|
2162
|
+
|
|
2118
2163
|
const CommonUtils = {
|
|
2119
2164
|
isPropertyFilterable: isPropertyFilterable,
|
|
2120
2165
|
isFieldControlPathInapplicable: isFieldControlPathInapplicable,
|
|
@@ -2125,7 +2170,6 @@ const CommonUtils = {
|
|
|
2125
2170
|
updateRelatedAppsDetails: fnUpdateRelatedAppsDetails,
|
|
2126
2171
|
resolveStringtoBoolean: fnResolveStringtoBoolean,
|
|
2127
2172
|
getAppComponent: getAppComponent,
|
|
2128
|
-
processDataLossConfirmation: fnProcessDataLossConfirmation,
|
|
2129
2173
|
getMandatoryFilterFields: fnGetMandatoryFilterFields,
|
|
2130
2174
|
getContextPathProperties: fnGetContextPathProperties,
|
|
2131
2175
|
getParameterInfo: getParameterInfo,
|
|
@@ -2162,16 +2206,18 @@ const CommonUtils = {
|
|
|
2162
2206
|
requestSingletonProperty: requestSingletonProperty,
|
|
2163
2207
|
templateControlFragment: templateControlFragment,
|
|
2164
2208
|
addEventToBindingInfo: addEventToBindingInfo,
|
|
2209
|
+
setObjectMappings: setObjectMappings,
|
|
2165
2210
|
FilterRestrictions: {
|
|
2166
2211
|
REQUIRED_PROPERTIES: "RequiredProperties",
|
|
2167
2212
|
NON_FILTERABLE_PROPERTIES: "NonFilterableProperties",
|
|
2168
2213
|
ALLOWED_EXPRESSIONS: "FilterAllowedExpressions"
|
|
2169
2214
|
},
|
|
2170
2215
|
AllowedExpressionsPrio: ["SingleValue", "MultiValue", "SingleRange", "MultiRange", "SearchExpression", "MultiRangeOrSearchExpression"],
|
|
2171
|
-
fnProcessDataLossOrDraftDiscardConfirmation: fnProcessDataLossOrDraftDiscardConfirmation,
|
|
2172
2216
|
normalizeSearchTerm: normalizeSearchTerm,
|
|
2173
2217
|
fnOnStrictHandlingFailed: fnOnStrictHandlingFailed,
|
|
2174
|
-
getSingletonPath: getSingletonPath
|
|
2218
|
+
getSingletonPath: getSingletonPath,
|
|
2219
|
+
getMessageStripText: getMessageStripText,
|
|
2220
|
+
getMessageColumn: getMessageColumn
|
|
2175
2221
|
};
|
|
2176
2222
|
|
|
2177
2223
|
export default CommonUtils;
|