@sapui5/sap.fe.core 1.101.0 → 1.103.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AppComponent.js +66 -30
- package/src/sap/fe/core/AppComponent.ts +68 -51
- package/src/sap/fe/core/AppStateHandler.js +13 -13
- package/src/sap/fe/core/AppStateHandler.ts +18 -18
- package/src/sap/fe/core/BaseController.js +11 -9
- package/src/sap/fe/core/BaseController.ts +15 -13
- package/src/sap/fe/core/CommonUtils.js +279 -188
- package/src/sap/fe/core/CommonUtils.ts +306 -215
- package/src/sap/fe/core/ExtensionAPI.js +25 -30
- package/src/sap/fe/core/ExtensionAPI.ts +37 -41
- package/src/sap/fe/core/PageController.js +12 -7
- package/src/sap/fe/core/PageController.ts +10 -5
- package/src/sap/fe/core/TemplateComponent.js +6 -6
- package/src/sap/fe/core/TemplateComponent.ts +11 -11
- package/src/sap/fe/core/TemplateModel.js +2 -2
- package/src/sap/fe/core/TemplateModel.ts +3 -3
- package/src/sap/fe/core/buildingBlocks/AttributeModel.js +1 -1
- package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +1 -1
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +306 -78
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +280 -70
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +27 -27
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +28 -26
- package/src/sap/fe/core/{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 +351 -229
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +321 -246
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +9 -9
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +10 -10
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +59 -34
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +71 -45
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +72 -72
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +82 -80
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +152 -131
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +171 -152
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +66 -68
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +106 -123
- package/src/sap/fe/core/controllerextensions/MassEdit.js +11 -10
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +31 -37
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +21 -13
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +30 -15
- package/src/sap/fe/core/controllerextensions/PageReady.js +97 -25
- package/src/sap/fe/core/controllerextensions/PageReady.ts +94 -34
- package/src/sap/fe/core/controllerextensions/Paginator.js +19 -11
- package/src/sap/fe/core/controllerextensions/Paginator.ts +22 -14
- package/src/sap/fe/core/controllerextensions/Placeholder.js +4 -6
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
- package/src/sap/fe/core/controllerextensions/Routing.js +10 -11
- package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
- package/src/sap/fe/core/controllerextensions/Share.js +39 -21
- package/src/sap/fe/core/controllerextensions/Share.ts +45 -26
- package/src/sap/fe/core/controllerextensions/SideEffects.js +47 -51
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +58 -62
- package/src/sap/fe/core/controllerextensions/ViewState.js +75 -62
- package/src/sap/fe/core/controllerextensions/ViewState.ts +78 -63
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +105 -0
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +99 -0
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +360 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/ActivitySync.ts +58 -112
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/CollaborationCommon.js +2 -2
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/CollaborationCommon.ts +7 -7
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +262 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/Manage.ts +20 -21
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/ManageDialog.fragment.xml +0 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/UserDetails.fragment.xml +5 -7
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +1631 -0
- package/src/sap/fe/core/{TransactionHelper.ts → controllerextensions/editFlow/TransactionHelper.ts} +270 -211
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +772 -0
- package/src/sap/fe/core/{actions → controllerextensions/editFlow}/draft.ts +240 -100
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js +1199 -0
- package/src/sap/fe/core/{actions → controllerextensions/editFlow}/operations.ts +364 -229
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +188 -0
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +185 -0
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +626 -0
- package/src/sap/fe/core/{actions → controllerextensions/messageHandler}/messageHandling.ts +112 -69
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +937 -0
- package/src/sap/fe/core/{RouterProxy.ts → controllerextensions/routing/RouterProxy.ts} +72 -73
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +21 -18
- package/src/sap/fe/core/controls/Any.js +9 -5
- package/src/sap/fe/core/controls/Any.ts +10 -4
- package/src/sap/fe/core/controls/CommandExecution.js +21 -24
- package/src/sap/fe/core/controls/CommandExecution.ts +19 -24
- package/src/sap/fe/core/controls/ConditionalWrapper.js +2 -2
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +3 -3
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +48 -43
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +51 -46
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +3 -2
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +3 -2
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossDraft.fragment.xml +11 -3
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +19 -9
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +14 -8
- package/src/sap/fe/core/controls/FieldWrapper.js +2 -2
- package/src/sap/fe/core/controls/FieldWrapper.ts +3 -3
- package/src/sap/fe/core/controls/FileWrapper.js +50 -3
- package/src/sap/fe/core/controls/FileWrapper.ts +45 -12
- package/src/sap/fe/core/controls/FilterBar.js +6 -2
- package/src/sap/fe/core/controls/FilterBar.ts +13 -9
- package/src/sap/fe/core/controls/FormElementWrapper.js +12 -2
- package/src/sap/fe/core/controls/FormElementWrapper.ts +14 -3
- package/src/sap/fe/core/controls/MassEditSelect.js +33 -0
- package/src/sap/fe/core/controls/MassEditSelect.ts +41 -0
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +3 -3
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +16 -12
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +20 -22
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -3
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +8 -8
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +48 -48
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +71 -76
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +36 -65
- package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +107 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +551 -36
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +605 -36
- package/src/sap/fe/core/converters/ConverterContext.js +26 -33
- package/src/sap/fe/core/converters/ConverterContext.ts +51 -60
- package/src/sap/fe/core/converters/ManifestSettings.js +2 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +17 -14
- package/src/sap/fe/core/converters/ManifestWrapper.js +59 -45
- package/src/sap/fe/core/converters/ManifestWrapper.ts +55 -45
- package/src/sap/fe/core/converters/MetaModelConverter.js +56 -67
- package/src/sap/fe/core/converters/MetaModelConverter.ts +183 -193
- package/src/sap/fe/core/converters/TemplateConverter.js +21 -20
- package/src/sap/fe/core/converters/TemplateConverter.ts +27 -24
- package/src/sap/fe/core/converters/annotations/DataField.js +73 -37
- package/src/sap/fe/core/converters/annotations/DataField.ts +121 -77
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +1911 -1495
- package/src/sap/fe/core/converters/controls/Common/Action.js +51 -49
- package/src/sap/fe/core/converters/controls/Common/Action.ts +58 -54
- package/src/sap/fe/core/converters/controls/Common/Chart.js +22 -15
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +29 -27
- package/src/sap/fe/core/converters/controls/Common/Criticality.js +3 -3
- package/src/sap/fe/core/converters/controls/Common/Criticality.ts +4 -4
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +28 -28
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +40 -36
- package/src/sap/fe/core/converters/controls/Common/Form.js +30 -34
- package/src/sap/fe/core/converters/controls/Common/Form.ts +48 -58
- package/src/sap/fe/core/converters/controls/Common/KPI.js +11 -11
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +35 -39
- package/src/sap/fe/core/converters/controls/Common/Table.js +318 -244
- package/src/sap/fe/core/converters/controls/Common/Table.ts +368 -297
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +135 -125
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +162 -148
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +51 -45
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +79 -67
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +28 -26
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +46 -43
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.js +9 -9
- package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.ts +14 -13
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +67 -64
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +69 -66
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +92 -89
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +124 -120
- package/src/sap/fe/core/converters/helpers/Aggregation.js +11 -5
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +25 -23
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +31 -30
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +31 -29
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +4 -4
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +9 -9
- package/src/sap/fe/core/converters/helpers/ID.js +46 -46
- package/src/sap/fe/core/converters/helpers/ID.ts +25 -25
- package/src/sap/fe/core/converters/helpers/Key.js +7 -7
- package/src/sap/fe/core/converters/helpers/Key.ts +7 -7
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.js +1 -1
- package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.ts +4 -4
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +6 -6
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +10 -10
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +46 -62
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +54 -82
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +30 -29
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +40 -40
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +56 -55
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +65 -77
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +6 -6
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +10 -8
- package/src/sap/fe/core/formatters/CollaborationFormatter.js +2 -2
- package/src/sap/fe/core/formatters/CollaborationFormatter.ts +3 -3
- package/src/sap/fe/core/formatters/FPMFormatter.js +5 -5
- package/src/sap/fe/core/formatters/FPMFormatter.ts +10 -10
- package/src/sap/fe/core/formatters/KPIFormatter.js +7 -7
- package/src/sap/fe/core/formatters/KPIFormatter.ts +10 -10
- package/src/sap/fe/core/formatters/StandardFormatter.js +89 -0
- package/src/sap/fe/core/formatters/StandardFormatter.ts +64 -0
- package/src/sap/fe/core/formatters/TableFormatter.js +83 -22
- package/src/sap/fe/core/formatters/TableFormatter.ts +80 -25
- package/src/sap/fe/core/formatters/ValueFormatter.js +8 -8
- package/src/sap/fe/core/formatters/ValueFormatter.ts +9 -9
- package/src/sap/fe/core/fpm/Component.js +2 -2
- package/src/sap/fe/core/fpm/Component.ts +1 -1
- package/src/sap/fe/core/helpers/AppStartupHelper.js +15 -15
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +37 -40
- package/src/sap/fe/core/helpers/BindingToolkit.js +1809 -0
- package/src/sap/fe/core/helpers/{BindingExpression.ts → BindingToolkit.ts} +388 -285
- package/src/sap/fe/core/helpers/ClassSupport.js +20 -11
- package/src/sap/fe/core/helpers/ClassSupport.ts +15 -10
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +2 -2
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +1 -1
- package/src/sap/fe/core/helpers/EditState.js +1 -6
- package/src/sap/fe/core/helpers/EditState.ts +5 -10
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +2 -2
- package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +4 -4
- package/src/sap/fe/core/helpers/FPMHelper.js +3 -2
- package/src/sap/fe/core/helpers/FPMHelper.ts +10 -9
- package/src/sap/fe/core/helpers/KeepAliveHelper.js +31 -31
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +52 -56
- package/src/sap/fe/core/helpers/MassEditHelper.js +532 -264
- package/src/sap/fe/core/helpers/MassEditHelper.ts +560 -289
- package/src/sap/fe/core/helpers/ModelHelper.js +25 -25
- package/src/sap/fe/core/helpers/ModelHelper.ts +50 -58
- package/src/sap/fe/core/helpers/PasteHelper.js +3 -10
- package/src/sap/fe/core/helpers/PasteHelper.ts +20 -25
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +1 -1
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +11 -11
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +3 -3
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +8 -8
- package/src/sap/fe/core/helpers/StableIdHelper.js +16 -12
- package/src/sap/fe/core/helpers/StableIdHelper.ts +20 -16
- 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 +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx.ts +8 -8
- package/src/sap/fe/core/library.js +51 -3
- package/src/sap/fe/core/library.ts +47 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +3 -3
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +2 -2
- package/src/sap/fe/core/messagebundle.properties +151 -197
- package/src/sap/fe/core/messagebundle_ar.properties +36 -63
- package/src/sap/fe/core/messagebundle_bg.properties +36 -63
- package/src/sap/fe/core/messagebundle_ca.properties +36 -63
- package/src/sap/fe/core/messagebundle_cs.properties +36 -63
- package/src/sap/fe/core/messagebundle_cy.properties +36 -63
- package/src/sap/fe/core/messagebundle_da.properties +37 -64
- package/src/sap/fe/core/messagebundle_de.properties +36 -63
- package/src/sap/fe/core/messagebundle_el.properties +38 -65
- package/src/sap/fe/core/messagebundle_en.properties +37 -64
- package/src/sap/fe/core/messagebundle_en_GB.properties +37 -64
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +44 -73
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +37 -64
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +52 -81
- package/src/sap/fe/core/messagebundle_es.properties +36 -63
- package/src/sap/fe/core/messagebundle_es_MX.properties +36 -63
- package/src/sap/fe/core/messagebundle_et.properties +36 -63
- package/src/sap/fe/core/messagebundle_fi.properties +36 -63
- package/src/sap/fe/core/messagebundle_fr.properties +39 -66
- package/src/sap/fe/core/messagebundle_fr_CA.properties +36 -63
- package/src/sap/fe/core/messagebundle_hi.properties +36 -63
- package/src/sap/fe/core/messagebundle_hr.properties +36 -63
- package/src/sap/fe/core/messagebundle_hu.properties +35 -62
- package/src/sap/fe/core/messagebundle_id.properties +37 -64
- package/src/sap/fe/core/messagebundle_it.properties +54 -81
- package/src/sap/fe/core/messagebundle_iw.properties +36 -63
- package/src/sap/fe/core/messagebundle_ja.properties +36 -63
- package/src/sap/fe/core/messagebundle_kk.properties +36 -63
- package/src/sap/fe/core/messagebundle_ko.properties +36 -63
- package/src/sap/fe/core/messagebundle_lt.properties +36 -63
- package/src/sap/fe/core/messagebundle_lv.properties +36 -63
- package/src/sap/fe/core/messagebundle_ms.properties +37 -64
- package/src/sap/fe/core/messagebundle_nl.properties +37 -64
- package/src/sap/fe/core/messagebundle_no.properties +36 -63
- package/src/sap/fe/core/messagebundle_pl.properties +37 -64
- package/src/sap/fe/core/messagebundle_pt.properties +37 -64
- package/src/sap/fe/core/messagebundle_pt_PT.properties +36 -63
- package/src/sap/fe/core/messagebundle_ro.properties +36 -63
- package/src/sap/fe/core/messagebundle_ru.properties +36 -63
- package/src/sap/fe/core/messagebundle_sh.properties +36 -63
- package/src/sap/fe/core/messagebundle_sk.properties +36 -63
- package/src/sap/fe/core/messagebundle_sl.properties +38 -65
- package/src/sap/fe/core/messagebundle_sv.properties +36 -63
- package/src/sap/fe/core/messagebundle_th.properties +36 -63
- package/src/sap/fe/core/messagebundle_tr.properties +36 -63
- package/src/sap/fe/core/messagebundle_uk.properties +37 -64
- package/src/sap/fe/core/messagebundle_vi.properties +37 -64
- package/src/sap/fe/core/messagebundle_zh_CN.properties +36 -63
- package/src/sap/fe/core/messagebundle_zh_TW.properties +37 -64
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +5 -5
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +2 -2
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +14 -14
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +6 -3
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +12 -10
- package/src/sap/fe/core/services/NavigationServiceFactory.js +54 -45
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +61 -49
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +2 -2
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +4 -4
- package/src/sap/fe/core/services/RoutingServiceFactory.js +63 -60
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +76 -73
- package/src/sap/fe/core/services/ShellServicesFactory.js +102 -71
- package/src/sap/fe/core/services/ShellServicesFactory.ts +109 -78
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +61 -61
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +102 -92
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +24 -18
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +53 -50
- package/src/sap/fe/core/support/CommonHelper.js +3 -2
- package/src/sap/fe/core/support/CommonHelper.ts +9 -13
- package/src/sap/fe/core/support/Diagnostics.js +1 -1
- package/src/sap/fe/core/support/Diagnostics.ts +5 -5
- package/src/sap/fe/core/templating/CommonFormatters.js +84 -0
- package/src/sap/fe/core/templating/CommonFormatters.ts +86 -0
- package/src/sap/fe/core/templating/CriticalityFormatters.js +31 -31
- package/src/sap/fe/core/templating/CriticalityFormatters.ts +42 -40
- package/src/sap/fe/core/templating/DataFieldFormatters.js +8 -8
- package/src/sap/fe/core/templating/DataFieldFormatters.ts +13 -10
- package/src/sap/fe/core/templating/DataModelPathHelper.js +16 -15
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +42 -32
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +1 -1
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +3 -4
- package/src/sap/fe/core/templating/EntitySetHelper.js +7 -15
- package/src/sap/fe/core/templating/EntitySetHelper.ts +14 -18
- package/src/sap/fe/core/templating/FieldControlHelper.js +35 -34
- package/src/sap/fe/core/templating/FieldControlHelper.ts +29 -46
- package/src/sap/fe/core/templating/FilterHelper.js +12 -11
- package/src/sap/fe/core/templating/FilterHelper.ts +17 -16
- package/src/sap/fe/core/templating/FilterTemplating.js +1 -1
- package/src/sap/fe/core/templating/FilterTemplating.ts +3 -3
- package/src/sap/fe/core/templating/PropertyFormatters.js +7 -7
- package/src/sap/fe/core/templating/PropertyFormatters.ts +21 -19
- package/src/sap/fe/core/templating/PropertyHelper.js +79 -56
- package/src/sap/fe/core/templating/PropertyHelper.ts +41 -27
- package/src/sap/fe/core/templating/UIFormatters.js +163 -97
- package/src/sap/fe/core/templating/UIFormatters.ts +210 -129
- 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 +2 -2
- package/src/sap/fe/core/type/Email.ts +2 -2
- package/src/sap/fe/core/AnnotationHelper.js +0 -331
- package/src/sap/fe/core/AnnotationHelper.ts +0 -321
- package/src/sap/fe/core/RouterProxy.js +0 -938
- package/src/sap/fe/core/TransactionHelper.js +0 -1577
- package/src/sap/fe/core/actions/collaboration/ActivitySync.js +0 -406
- package/src/sap/fe/core/actions/collaboration/Manage.js +0 -264
- package/src/sap/fe/core/actions/draft.js +0 -665
- package/src/sap/fe/core/actions/messageHandling.js +0 -579
- 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/actions/sticky.ts +0 -119
- package/src/sap/fe/core/formatters/CriticalityFormatter.js +0 -77
- package/src/sap/fe/core/formatters/CriticalityFormatter.ts +0 -58
- package/src/sap/fe/core/helpers/BindingExpression.js +0 -1729
|
@@ -1,26 +1,48 @@
|
|
|
1
1
|
import Log from "sap/base/Log";
|
|
2
2
|
import CommonUtils from "sap/fe/core/CommonUtils";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import {
|
|
4
|
+
BindingToolkitExpression,
|
|
5
|
+
CompiledBindingToolkitExpression,
|
|
6
|
+
compileExpression,
|
|
7
|
+
constant,
|
|
8
|
+
ifElse,
|
|
9
|
+
not,
|
|
10
|
+
or,
|
|
11
|
+
pathInModel
|
|
12
|
+
} from "sap/fe/core/helpers/BindingToolkit";
|
|
13
|
+
import FELibrary from "sap/fe/core/library";
|
|
14
|
+
import type PageController from "sap/fe/core/PageController";
|
|
15
|
+
import type { DataModelObjectPath } from "sap/fe/core/templating/DataModelPathHelper";
|
|
16
|
+
import { enhanceDataModelPath } from "sap/fe/core/templating/DataModelPathHelper";
|
|
17
|
+
import {
|
|
18
|
+
getAssociatedUnitProperty,
|
|
19
|
+
getAssociatedUnitPropertyPath,
|
|
20
|
+
hasCurrency,
|
|
21
|
+
hasUnit,
|
|
22
|
+
hasValueHelp,
|
|
23
|
+
hasValueHelpWithFixedValues
|
|
24
|
+
} from "sap/fe/core/templating/PropertyHelper";
|
|
8
25
|
import { getTextBinding, setEditStyleProperties } from "sap/fe/macros/field/FieldTemplating";
|
|
26
|
+
import type { FieldProperties } from "sap/fe/macros/internal/Field.metadata";
|
|
9
27
|
import Button from "sap/m/Button";
|
|
10
28
|
import Dialog from "sap/m/Dialog";
|
|
29
|
+
import MessageToast from "sap/m/MessageToast";
|
|
11
30
|
import Core from "sap/ui/core/Core";
|
|
12
31
|
import Fragment from "sap/ui/core/Fragment";
|
|
13
32
|
import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
|
|
14
33
|
import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
|
|
15
34
|
import EditMode from "sap/ui/mdc/enum/EditMode";
|
|
16
|
-
import Table from "sap/ui/mdc/Table";
|
|
35
|
+
import type Table from "sap/ui/mdc/Table";
|
|
17
36
|
import JSONModel from "sap/ui/model/json/JSONModel";
|
|
18
|
-
import Context from "sap/ui/model/odata/v4/Context";
|
|
19
|
-
import
|
|
20
|
-
import
|
|
37
|
+
import type Context from "sap/ui/model/odata/v4/Context";
|
|
38
|
+
import type ODataListBinding from "sap/ui/model/odata/v4/ODataListBinding";
|
|
39
|
+
import type { CoreEx } from "types/extension_types";
|
|
40
|
+
import type { AnyType } from "../controls/Any";
|
|
41
|
+
import Any from "../controls/Any";
|
|
21
42
|
import { convertMetaModelContext, getInvolvedDataModelObjects } from "../converters/MetaModelConverter";
|
|
22
43
|
import { isReadOnlyExpression } from "../templating/FieldControlHelper";
|
|
23
44
|
import { getEditMode, getRequiredExpression, isCollectionField } from "../templating/UIFormatters";
|
|
45
|
+
import type { InternalModelContext } from "./ModelHelper";
|
|
24
46
|
|
|
25
47
|
/* This class contains helpers to be used for mass edit functionality */
|
|
26
48
|
type TextArrangementInfo = {
|
|
@@ -32,16 +54,22 @@ type TextArrangementInfo = {
|
|
|
32
54
|
fullText: string;
|
|
33
55
|
};
|
|
34
56
|
|
|
57
|
+
type BindingInfo = {
|
|
58
|
+
path?: string;
|
|
59
|
+
model?: string | object;
|
|
60
|
+
parameters?: Array<BindingInfo>;
|
|
61
|
+
};
|
|
62
|
+
|
|
35
63
|
const MassEditHelper = {
|
|
36
64
|
/**
|
|
37
65
|
* Initializes the value at final or deepest level path with a blank array.
|
|
38
66
|
* Return an empty array pointing to the final or deepest level path.
|
|
39
67
|
*
|
|
40
|
-
* @param
|
|
41
|
-
* @param
|
|
42
|
-
* @returns
|
|
68
|
+
* @param sPath Property path
|
|
69
|
+
* @param aValues Array instance where the default data needs to be added
|
|
70
|
+
* @returns The final path
|
|
43
71
|
*/
|
|
44
|
-
initLastLevelOfPropertyPath: function (sPath: string, aValues: any) {
|
|
72
|
+
initLastLevelOfPropertyPath: function (sPath: string, aValues: any /*, transCtx: Context */) {
|
|
45
73
|
let aFinalPath: any;
|
|
46
74
|
let index = 0;
|
|
47
75
|
const aPaths = sPath.split("/");
|
|
@@ -53,7 +81,7 @@ const MassEditHelper = {
|
|
|
53
81
|
sFullPath = sFullPath + sPropertyPath;
|
|
54
82
|
index++;
|
|
55
83
|
} else if (!aFinalPath[sPropertyPath]) {
|
|
56
|
-
sFullPath = sFullPath
|
|
84
|
+
sFullPath = `${sFullPath}/${sPropertyPath}`;
|
|
57
85
|
if (sFullPath !== sPath) {
|
|
58
86
|
aFinalPath[sPropertyPath] = {};
|
|
59
87
|
aFinalPath = aFinalPath[sPropertyPath];
|
|
@@ -68,13 +96,13 @@ const MassEditHelper = {
|
|
|
68
96
|
/**
|
|
69
97
|
* Method to get unique values for given array values.
|
|
70
98
|
*
|
|
71
|
-
* @param
|
|
72
|
-
* @param
|
|
73
|
-
* @param
|
|
74
|
-
* @returns
|
|
99
|
+
* @param sValue Property value
|
|
100
|
+
* @param index Index of the property value
|
|
101
|
+
* @param self Instance of the array
|
|
102
|
+
* @returns The unique value
|
|
75
103
|
*/
|
|
76
104
|
getUniqueValues: function (sValue: string, index: number, self: any[]) {
|
|
77
|
-
if (sValue) {
|
|
105
|
+
if (sValue != undefined && sValue != null) {
|
|
78
106
|
return self.indexOf(sValue) === index;
|
|
79
107
|
}
|
|
80
108
|
},
|
|
@@ -83,9 +111,9 @@ const MassEditHelper = {
|
|
|
83
111
|
* Gets the property value for a multi-level path (for example: _Materials/Material_Details gets the value of Material_Details under _Materials Object).
|
|
84
112
|
* Returns the propertyValue, which can be of any type (string, number, etc..).
|
|
85
113
|
*
|
|
86
|
-
* @param
|
|
87
|
-
* @param
|
|
88
|
-
* @returns
|
|
114
|
+
* @param sDataPropertyPath Property path
|
|
115
|
+
* @param oValues Object of property values
|
|
116
|
+
* @returns The property value
|
|
89
117
|
*/
|
|
90
118
|
getValueForMultiLevelPath: function (sDataPropertyPath: string, oValues: any) {
|
|
91
119
|
if (sDataPropertyPath && sDataPropertyPath.indexOf("/") > 0) {
|
|
@@ -105,9 +133,9 @@ const MassEditHelper = {
|
|
|
105
133
|
* => If propertyValue for all selected contexts is empty, then < Leave Blank > is preselected.
|
|
106
134
|
*
|
|
107
135
|
*
|
|
108
|
-
* @param
|
|
109
|
-
* @param
|
|
110
|
-
* @returns
|
|
136
|
+
* @param aContexts Contexts for mass edit
|
|
137
|
+
* @param sDataPropertyPath Data property path
|
|
138
|
+
* @returns The key path
|
|
111
139
|
*/
|
|
112
140
|
getDefaultSelectionPathComboBox: function (aContexts: any[], sDataPropertyPath: string) {
|
|
113
141
|
if (sDataPropertyPath && aContexts.length > 0) {
|
|
@@ -123,11 +151,11 @@ const MassEditHelper = {
|
|
|
123
151
|
});
|
|
124
152
|
const aUniquePropertyValues = aPropertyValues.filter(MassEditHelper.getUniqueValues);
|
|
125
153
|
if (aUniquePropertyValues.length > 1) {
|
|
126
|
-
return
|
|
154
|
+
return `Default/${sDataPropertyPath}`;
|
|
127
155
|
} else if (aUniquePropertyValues.length === 0) {
|
|
128
|
-
return
|
|
156
|
+
return `Empty/${sDataPropertyPath}`;
|
|
129
157
|
} else if (aUniquePropertyValues.length === 1) {
|
|
130
|
-
return sDataPropertyPath
|
|
158
|
+
return `${sDataPropertyPath}/${aUniquePropertyValues[0]}`;
|
|
131
159
|
}
|
|
132
160
|
}
|
|
133
161
|
},
|
|
@@ -135,9 +163,9 @@ const MassEditHelper = {
|
|
|
135
163
|
/**
|
|
136
164
|
* Checks hidden annotation value [both static and path based] for table's selected context.
|
|
137
165
|
*
|
|
138
|
-
* @param
|
|
139
|
-
* @param
|
|
140
|
-
* @returns
|
|
166
|
+
* @param hiddenValue Hidden annotation value / path for field
|
|
167
|
+
* @param aContexts Contexts for mass edit
|
|
168
|
+
* @returns The hidden annotation value
|
|
141
169
|
*/
|
|
142
170
|
getHiddenValueForContexts: function (hiddenValue: any, aContexts: any[]) {
|
|
143
171
|
if (hiddenValue && hiddenValue.$Path) {
|
|
@@ -174,19 +202,43 @@ const MassEditHelper = {
|
|
|
174
202
|
);
|
|
175
203
|
},
|
|
176
204
|
|
|
205
|
+
/**
|
|
206
|
+
* Get text path for the mass edit field.
|
|
207
|
+
*
|
|
208
|
+
* @param property Property path
|
|
209
|
+
* @param textBinding Text Binding Info
|
|
210
|
+
* @param displayMode Display mode
|
|
211
|
+
* @returns Text Property Path if it exists
|
|
212
|
+
*/
|
|
213
|
+
getTextPath: function (property: string, textBinding: any, displayMode: string): string | undefined {
|
|
214
|
+
let descriptionPath;
|
|
215
|
+
if (textBinding && (textBinding.path || (textBinding.parameters && textBinding.parameters.length)) && property) {
|
|
216
|
+
if (textBinding.path && displayMode === "Description") {
|
|
217
|
+
descriptionPath = textBinding.path;
|
|
218
|
+
} else if (textBinding.parameters) {
|
|
219
|
+
textBinding.parameters.forEach(function (props: BindingInfo) {
|
|
220
|
+
if (props.path && props.path !== property) {
|
|
221
|
+
descriptionPath = props.path;
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return descriptionPath;
|
|
227
|
+
},
|
|
228
|
+
|
|
177
229
|
/**
|
|
178
230
|
* Initializes a JSON Model for properties of dialog fields [label, visiblity, dataproperty, etc.].
|
|
179
231
|
*
|
|
180
|
-
* @param
|
|
181
|
-
* @param
|
|
182
|
-
* @param
|
|
183
|
-
* @returns
|
|
232
|
+
* @param oTable Instance of Table
|
|
233
|
+
* @param aContexts Contexts for mass edit
|
|
234
|
+
* @param aDataArray Array containing data related to the dialog used by both the static and the runtime model
|
|
235
|
+
* @returns The model
|
|
184
236
|
*/
|
|
185
237
|
prepareDataForDialog: function (oTable: Table, aContexts: any[], aDataArray: any[]) {
|
|
186
238
|
const oMetaModel = oTable && (oTable.getModel().getMetaModel() as any),
|
|
187
239
|
sCurrentEntitySetName = oTable.data("metaPath"),
|
|
188
240
|
aTableFields = MassEditHelper.getTableFields(oTable),
|
|
189
|
-
oEntityTypeContext = oMetaModel.getContext(sCurrentEntitySetName
|
|
241
|
+
oEntityTypeContext = oMetaModel.getContext(`${sCurrentEntitySetName}/@`),
|
|
190
242
|
oEntitySetContext = oMetaModel.getContext(sCurrentEntitySetName),
|
|
191
243
|
oDataModelObjectPath = getInvolvedDataModelObjects(oEntityTypeContext);
|
|
192
244
|
|
|
@@ -201,25 +253,12 @@ const MassEditHelper = {
|
|
|
201
253
|
aTableFields.forEach(function (oColumnInfo: any) {
|
|
202
254
|
const sDataPropertyPath = oColumnInfo.dataProperty;
|
|
203
255
|
if (sDataPropertyPath) {
|
|
204
|
-
let oPropertyInfo = sDataPropertyPath && oMetaModel.getObject(sCurrentEntitySetName
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
];
|
|
211
|
-
sUnitPropertyPath =
|
|
212
|
-
(oPropertyInfo && oPropertyInfo["@Org.OData.Measures.V1.Unit"] && oPropertyInfo["@Org.OData.Measures.V1.Unit"].$Path) ||
|
|
213
|
-
(oPropertyInfo &&
|
|
214
|
-
oPropertyInfo["@Org.OData.Measures.V1.ISOCurrency"] &&
|
|
215
|
-
oPropertyInfo["@Org.OData.Measures.V1.ISOCurrency"].$Path);
|
|
216
|
-
sLabelText = oColumnInfo.label || (oPropertyInfo && oPropertyInfo["@com.sap.vocabularies.Common.v1.Label"]);
|
|
217
|
-
bValueHelpEnabledForUnit =
|
|
218
|
-
sUnitPropertyPath &&
|
|
219
|
-
oMetaModel.getObject(sCurrentEntitySetName + "/" + sUnitPropertyPath + "@") &&
|
|
220
|
-
oMetaModel.getObject(sCurrentEntitySetName + "/" + sUnitPropertyPath + "@")[
|
|
221
|
-
"@com.sap.vocabularies.Common.v1.ValueList"
|
|
222
|
-
];
|
|
256
|
+
let oPropertyInfo = sDataPropertyPath && oMetaModel.getObject(`${sCurrentEntitySetName}/${sDataPropertyPath}@`);
|
|
257
|
+
sLabelText =
|
|
258
|
+
oColumnInfo.label ||
|
|
259
|
+
(oPropertyInfo && oPropertyInfo["@com.sap.vocabularies.Common.v1.Label"]) ||
|
|
260
|
+
oColumnInfo.dataProperty;
|
|
261
|
+
|
|
223
262
|
if (oDataModelObjectPath) {
|
|
224
263
|
oDataModelObjectPath.targetObject = oDataModelObjectPath.targetEntityType.entityProperties.filter(function (
|
|
225
264
|
oProperty: any
|
|
@@ -231,7 +270,7 @@ const MassEditHelper = {
|
|
|
231
270
|
oTextBinding = getTextBinding(oDataModelObjectPath, {}, true) || {};
|
|
232
271
|
const oFieldContext = oMetaModel.getContext(oColumnInfo.annotationPath),
|
|
233
272
|
oDataFieldConverted = convertMetaModelContext(oFieldContext),
|
|
234
|
-
oPropertyContext = oMetaModel.getContext(sCurrentEntitySetName
|
|
273
|
+
oPropertyContext = oMetaModel.getContext(`${sCurrentEntitySetName}/${sDataPropertyPath}@`),
|
|
235
274
|
oInterface = oPropertyContext && oPropertyContext.getInterface();
|
|
236
275
|
|
|
237
276
|
let oDataModelPath = getInvolvedDataModelObjects(oFieldContext, oEntitySetContext);
|
|
@@ -250,12 +289,14 @@ const MassEditHelper = {
|
|
|
250
289
|
return oInterface.getModel();
|
|
251
290
|
},
|
|
252
291
|
getPath: function () {
|
|
253
|
-
return sCurrentEntitySetName
|
|
292
|
+
return `${sCurrentEntitySetName}/${sDataPropertyPath}`;
|
|
254
293
|
}
|
|
255
294
|
};
|
|
256
295
|
oPropertyInfo =
|
|
257
|
-
|
|
258
|
-
|
|
296
|
+
oDataFieldConverted._type === "Property"
|
|
297
|
+
? oDataFieldConverted
|
|
298
|
+
: (oDataFieldConverted && oDataFieldConverted.Value && oDataFieldConverted.Value.$target) ||
|
|
299
|
+
(oDataFieldConverted && oDataFieldConverted.Target && oDataFieldConverted.Target.$target);
|
|
259
300
|
// Datafield is not included in the FieldControl calculation, needs to be implemented
|
|
260
301
|
|
|
261
302
|
const chartProperty = oPropertyInfo && oPropertyInfo.term && oPropertyInfo.term === "com.sap.vocabularies.UI.v1.Chart";
|
|
@@ -266,9 +307,16 @@ const MassEditHelper = {
|
|
|
266
307
|
return;
|
|
267
308
|
}
|
|
268
309
|
|
|
310
|
+
// ValueHelp properties
|
|
311
|
+
bValueHelpEnabled = hasValueHelp(oPropertyInfo);
|
|
312
|
+
sUnitPropertyPath =
|
|
313
|
+
((hasCurrency(oPropertyInfo) || hasUnit(oPropertyInfo)) && getAssociatedUnitPropertyPath(oPropertyInfo)) || "";
|
|
314
|
+
const unitPropertyInfo = sUnitPropertyPath && getAssociatedUnitProperty(oPropertyInfo);
|
|
315
|
+
bValueHelpEnabledForUnit = unitPropertyInfo && hasValueHelp(unitPropertyInfo);
|
|
316
|
+
|
|
269
317
|
// EditMode and InputType
|
|
270
318
|
const propertyForFieldControl = oPropertyInfo && oPropertyInfo.Value ? oPropertyInfo.Value : oPropertyInfo;
|
|
271
|
-
const expBinding = getEditMode(propertyForFieldControl, oDataModelPath, false, false, oDataFieldConverted, true);
|
|
319
|
+
const expBinding = getEditMode(propertyForFieldControl, oDataModelPath, false, false, oDataFieldConverted, constant(true));
|
|
272
320
|
const editModeValues = Object.keys(EditMode);
|
|
273
321
|
const editModeIsStatic = !!expBinding && editModeValues.includes(expBinding as EditMode);
|
|
274
322
|
const editable = !!expBinding && ((editModeIsStatic && expBinding === EditMode.Editable) || !editModeIsStatic);
|
|
@@ -281,15 +329,16 @@ const MassEditHelper = {
|
|
|
281
329
|
|
|
282
330
|
if (inputType) {
|
|
283
331
|
const isReadOnly = isReadOnlyExpression(oPropertyInfo);
|
|
284
|
-
|
|
332
|
+
const displayMode = CommonUtils.computeDisplayMode(oPropertyContext.getObject());
|
|
285
333
|
oResult = {
|
|
286
|
-
"label": sLabelText
|
|
334
|
+
"label": sLabelText,
|
|
287
335
|
"dataProperty": sDataPropertyPath,
|
|
288
336
|
"isValueHelpEnabled": bValueHelpEnabled ? bValueHelpEnabled : false,
|
|
289
|
-
"unitProperty": sUnitPropertyPath ? sUnitPropertyPath : false,
|
|
290
|
-
"isValueHelpEnabledForUnit":
|
|
291
|
-
|
|
292
|
-
"
|
|
337
|
+
"unitProperty": sUnitPropertyPath && !sDataPropertyPath.includes("/") ? sUnitPropertyPath : false,
|
|
338
|
+
"isValueHelpEnabledForUnit":
|
|
339
|
+
bValueHelpEnabledForUnit && !sUnitPropertyPath.includes("/") ? bValueHelpEnabledForUnit : false,
|
|
340
|
+
"propertyPathForValueHelp": `${sCurrentEntitySetName}/${sDataPropertyPath}`,
|
|
341
|
+
"propertyPathForValueHelpUnit": sUnitPropertyPath && `${sCurrentEntitySetName}/${sUnitPropertyPath}`,
|
|
293
342
|
"isFieldRequired": getRequiredExpression(oPropertyInfo, oDataFieldConverted, true),
|
|
294
343
|
"defaultSelectionPath": sDataPropertyPath
|
|
295
344
|
? MassEditHelper.getDefaultSelectionPathComboBox(aContexts, sDataPropertyPath)
|
|
@@ -298,11 +347,14 @@ const MassEditHelper = {
|
|
|
298
347
|
? MassEditHelper.getDefaultSelectionPathComboBox(aContexts, sUnitPropertyPath)
|
|
299
348
|
: false,
|
|
300
349
|
"entitySet": sCurrentEntitySetName,
|
|
301
|
-
"
|
|
350
|
+
"display": displayMode,
|
|
351
|
+
"descriptionPath": MassEditHelper.getTextPath(sDataPropertyPath, oTextBinding, displayMode),
|
|
302
352
|
"nullable": oPropertyInfo.nullable !== undefined ? oPropertyInfo.nullable : true,
|
|
303
353
|
"isPropertyReadOnly": isReadOnly !== undefined ? isReadOnly : false,
|
|
304
354
|
"inputType": inputType,
|
|
305
|
-
"editMode": editable ? expBinding : undefined
|
|
355
|
+
"editMode": editable ? expBinding : undefined,
|
|
356
|
+
"unitDataPath": sUnitPropertyPath && "fieldsInfo>/unitData/",
|
|
357
|
+
"valuesPath": "fieldsInfo>/values/"
|
|
306
358
|
};
|
|
307
359
|
aDataArray.push(oResult);
|
|
308
360
|
}
|
|
@@ -342,113 +394,147 @@ const MassEditHelper = {
|
|
|
342
394
|
"applyButtonText": bDisplayMode
|
|
343
395
|
? oResourceBundle.getText("C_MASS_EDIT_SAVE_BUTTON_TEXT")
|
|
344
396
|
: oResourceBundle.getText("C_MASS_EDIT_APPLY_BUTTON_TEXT"),
|
|
345
|
-
"
|
|
397
|
+
"useValueHelpValue": "< Use Value Help >",
|
|
398
|
+
"cancelButtonText": oResourceBundle.getText("C_MASS_EDIT_CANCEL_BUTTON_TEXT"),
|
|
399
|
+
"noFields": oResourceBundle.getText("C_MASS_EDIT_NO_EDITABLE_FIELDS"),
|
|
400
|
+
"okButtonText": oResourceBundle.getText("C_COMMON_DIALOG_OK")
|
|
346
401
|
};
|
|
347
402
|
},
|
|
348
403
|
|
|
349
404
|
/**
|
|
350
405
|
* Adds a suffix to the 'keep existing' property of the comboBox.
|
|
351
406
|
*
|
|
352
|
-
* @param
|
|
353
|
-
* @returns
|
|
407
|
+
* @param sInputType InputType of the field
|
|
408
|
+
* @returns The modified string
|
|
354
409
|
*/
|
|
355
|
-
getSuffixForKeepExisiting: function (sInputType: string) {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
}
|
|
410
|
+
// getSuffixForKeepExisiting: function (sInputType: string) {
|
|
411
|
+
// let sResult = "Values";
|
|
412
|
+
|
|
413
|
+
// switch (sInputType) {
|
|
414
|
+
// //TODO - Add for other control types as well (Radio Button, Email, Input, MDC Fields, Image etc.)
|
|
415
|
+
// case "DatePicker":
|
|
416
|
+
// sResult = "Dates";
|
|
417
|
+
// break;
|
|
418
|
+
// case "CheckBox":
|
|
419
|
+
// sResult = "Settings";
|
|
420
|
+
// break;
|
|
421
|
+
// default:
|
|
422
|
+
// sResult = "Values";
|
|
423
|
+
// }
|
|
424
|
+
// return sResult;
|
|
425
|
+
// },
|
|
369
426
|
|
|
370
427
|
/**
|
|
371
428
|
* Adds default values to the model [Keep Existing Values, Leave Blank].
|
|
372
429
|
*
|
|
373
|
-
* @param
|
|
374
|
-
* @param
|
|
375
|
-
* @param
|
|
376
|
-
* @param
|
|
377
|
-
* @param {boolean} bUOMField
|
|
430
|
+
* @param aValues Array instance where the default data needs to be added
|
|
431
|
+
* @param oDefaultValues Default values from Application Manifest
|
|
432
|
+
* @param oPropertyInfo Property information
|
|
433
|
+
* @param bUOMField
|
|
378
434
|
*/
|
|
379
|
-
setDefaultValuesToDialog: function (aValues: any
|
|
435
|
+
setDefaultValuesToDialog: function (aValues: any, oDefaultValues: any, oPropertyInfo: any, bUOMField?: boolean) {
|
|
380
436
|
const sPropertyPath = bUOMField ? oPropertyInfo.unitProperty : oPropertyInfo.dataProperty,
|
|
381
437
|
sInputType = oPropertyInfo.inputType,
|
|
382
438
|
bPropertyRequired = oPropertyInfo.isFieldRequired;
|
|
383
|
-
const sSuffixForKeepExisting = MassEditHelper.getSuffixForKeepExisiting(sInputType);
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
439
|
+
// const sSuffixForKeepExisting = MassEditHelper.getSuffixForKeepExisiting(sInputType);
|
|
440
|
+
const sSuffixForKeepExisting = "Values";
|
|
441
|
+
aValues.defaultOptions = aValues.defaultOptions || [];
|
|
442
|
+
const selectOptionsExist = aValues.selectOptions && aValues.selectOptions.length > 0;
|
|
443
|
+
const keepEntry = {
|
|
444
|
+
text: `${oDefaultValues.keepExistingPrefix} ${sSuffixForKeepExisting} >`,
|
|
445
|
+
key: `Default/${sPropertyPath}`
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
if (sInputType === "CheckBox") {
|
|
449
|
+
const falseEntry = { text: "No", key: `${sPropertyPath}/false`, textInfo: { value: false } };
|
|
450
|
+
const truthyEntry = { text: "Yes", key: `${sPropertyPath}/true`, textInfo: { value: true } };
|
|
451
|
+
aValues.unshift(falseEntry);
|
|
452
|
+
aValues.defaultOptions.unshift(falseEntry);
|
|
453
|
+
aValues.unshift(truthyEntry);
|
|
454
|
+
aValues.defaultOptions.unshift(truthyEntry);
|
|
455
|
+
aValues.unshift(keepEntry);
|
|
456
|
+
aValues.defaultOptions.unshift(keepEntry);
|
|
393
457
|
} else {
|
|
394
|
-
|
|
458
|
+
if (oPropertyInfo.isValueHelpEnabled || (oPropertyInfo.isValueHelpEnabledForUnit && bUOMField)) {
|
|
459
|
+
const vhdEntry = { text: oDefaultValues.useValueHelpValue, key: `UseValueHelpValue/${sPropertyPath}` };
|
|
460
|
+
aValues.unshift(vhdEntry);
|
|
461
|
+
aValues.defaultOptions.unshift(vhdEntry);
|
|
462
|
+
}
|
|
463
|
+
if (selectOptionsExist) {
|
|
464
|
+
if (bPropertyRequired !== "true" && !bUOMField) {
|
|
465
|
+
const clearEntry = { text: oDefaultValues.clearFieldValue, key: `ClearFieldValue/${sPropertyPath}` };
|
|
466
|
+
aValues.unshift(clearEntry);
|
|
467
|
+
aValues.defaultOptions.unshift(clearEntry);
|
|
468
|
+
}
|
|
469
|
+
aValues.unshift(keepEntry);
|
|
470
|
+
aValues.defaultOptions.unshift(keepEntry);
|
|
471
|
+
} else {
|
|
472
|
+
const emptyEntry = { text: oDefaultValues.leaveBlankValue, key: `Default/${sPropertyPath}` };
|
|
473
|
+
aValues.unshift(emptyEntry);
|
|
474
|
+
aValues.defaultOptions.unshift(emptyEntry);
|
|
475
|
+
}
|
|
395
476
|
}
|
|
396
|
-
aValues.unshift({
|
|
397
|
-
text: oDefaultValues.keepExistingPrefix + " " + sSuffixForKeepExisting + " >",
|
|
398
|
-
key: "Default/" + sPropertyPath
|
|
399
|
-
});
|
|
400
477
|
},
|
|
401
478
|
|
|
479
|
+
/**
|
|
480
|
+
* Get text arrangement info for a context property.
|
|
481
|
+
*
|
|
482
|
+
* @param property Property Path
|
|
483
|
+
* @param descriptionPath Path to text association of the property
|
|
484
|
+
* @param displayMode Display mode of the property and text association
|
|
485
|
+
* @param selectedContext Context to find the full text
|
|
486
|
+
* @returns The text arrangement
|
|
487
|
+
*/
|
|
402
488
|
getTextArrangementInfo: function (
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
): TextArrangementInfo
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
if (
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
489
|
+
property: string,
|
|
490
|
+
descriptionPath: string,
|
|
491
|
+
displayMode: string,
|
|
492
|
+
selectedContext: Context
|
|
493
|
+
): TextArrangementInfo {
|
|
494
|
+
let value = selectedContext.getObject(property),
|
|
495
|
+
descriptionValue,
|
|
496
|
+
fullText;
|
|
497
|
+
if (descriptionPath && property) {
|
|
498
|
+
switch (displayMode) {
|
|
499
|
+
case "Description":
|
|
500
|
+
descriptionValue = selectedContext.getObject(descriptionPath) || "";
|
|
501
|
+
fullText = descriptionValue;
|
|
502
|
+
break;
|
|
503
|
+
case "Value":
|
|
504
|
+
value = selectedContext.getObject(property) || "";
|
|
505
|
+
fullText = value;
|
|
506
|
+
break;
|
|
507
|
+
case "ValueDescription":
|
|
508
|
+
value = selectedContext.getObject(property) || "";
|
|
509
|
+
descriptionValue = selectedContext.getObject(descriptionPath) || "";
|
|
510
|
+
fullText = descriptionValue ? `${value} (${descriptionValue})` : value;
|
|
511
|
+
break;
|
|
512
|
+
case "DescriptionValue":
|
|
513
|
+
value = selectedContext.getObject(property) || "";
|
|
514
|
+
descriptionValue = selectedContext.getObject(descriptionPath) || "";
|
|
515
|
+
fullText = descriptionValue ? `${descriptionValue} (${value})` : value;
|
|
516
|
+
break;
|
|
517
|
+
default:
|
|
518
|
+
Log.info(`Display Property not applicable: ${property}`);
|
|
519
|
+
break;
|
|
434
520
|
}
|
|
435
|
-
return {
|
|
436
|
-
"textArrangement": sDisplayMode,
|
|
437
|
-
"valuePath": sProperty,
|
|
438
|
-
"descriptionPath": sDescriptionPath,
|
|
439
|
-
"value": sValue,
|
|
440
|
-
"description": sDescriptionValue,
|
|
441
|
-
"fullText": sFullText
|
|
442
|
-
};
|
|
443
521
|
}
|
|
444
|
-
|
|
522
|
+
|
|
523
|
+
return {
|
|
524
|
+
"textArrangement": displayMode,
|
|
525
|
+
"valuePath": property,
|
|
526
|
+
"descriptionPath": descriptionPath,
|
|
527
|
+
"value": value,
|
|
528
|
+
"description": descriptionValue,
|
|
529
|
+
"fullText": fullText
|
|
530
|
+
};
|
|
445
531
|
},
|
|
446
532
|
|
|
447
533
|
/**
|
|
448
534
|
* Return the visibility valuue for the ManagedObject Any.
|
|
449
535
|
*
|
|
450
|
-
* @param
|
|
451
|
-
* @returns
|
|
536
|
+
* @param any The ManagedObject Any to be used to calculate the visible value of the binding.
|
|
537
|
+
* @returns Returns true if the mass edit field is editable.
|
|
452
538
|
*/
|
|
453
539
|
isEditable: function (any: AnyType): boolean {
|
|
454
540
|
const binding = any.getBinding("any");
|
|
@@ -459,25 +545,25 @@ const MassEditHelper = {
|
|
|
459
545
|
/**
|
|
460
546
|
* Calculate and update the visibility of mass edit field on change of the ManagedObject Any binding.
|
|
461
547
|
*
|
|
462
|
-
* @param
|
|
463
|
-
* @param
|
|
548
|
+
* @param oDialogDataModel Model to be used runtime.
|
|
549
|
+
* @param dataProperty Field name.
|
|
464
550
|
*/
|
|
465
551
|
onContextEditableChange: function (oDialogDataModel: JSONModel, dataProperty: string): void {
|
|
466
|
-
const objectsForVisibility = oDialogDataModel.getProperty(
|
|
552
|
+
const objectsForVisibility = oDialogDataModel.getProperty(`/values/${dataProperty}/objectsForVisibility`) || [];
|
|
467
553
|
const editable = objectsForVisibility.some(MassEditHelper.isEditable);
|
|
468
554
|
|
|
469
555
|
if (editable) {
|
|
470
|
-
oDialogDataModel.setProperty(
|
|
556
|
+
oDialogDataModel.setProperty(`/values/${dataProperty}/visible`, editable);
|
|
471
557
|
}
|
|
472
558
|
},
|
|
473
559
|
|
|
474
560
|
/**
|
|
475
561
|
* Update Managed Object Any for visibility of the mass edit fields.
|
|
476
562
|
*
|
|
477
|
-
* @param
|
|
478
|
-
* @param
|
|
479
|
-
* @param
|
|
480
|
-
* @param
|
|
563
|
+
* @param mOToUse The ManagedObject Any to be used to calculate the visible value of the binding.
|
|
564
|
+
* @param oDialogDataModel Model to be used runtime.
|
|
565
|
+
* @param dataProperty Field name.
|
|
566
|
+
* @param values Values of the field.
|
|
481
567
|
*/
|
|
482
568
|
updateOnContextChange: function (mOToUse: AnyType, oDialogDataModel: JSONModel, dataProperty: string, values: any) {
|
|
483
569
|
const binding = mOToUse.getBinding("any");
|
|
@@ -491,11 +577,11 @@ const MassEditHelper = {
|
|
|
491
577
|
/**
|
|
492
578
|
* Get bound object to calculate the visibility of contexts.
|
|
493
579
|
*
|
|
494
|
-
* @param
|
|
495
|
-
* @param
|
|
496
|
-
* @returns
|
|
580
|
+
* @param expBinding Binding String object.
|
|
581
|
+
* @param context Context the binding value.
|
|
582
|
+
* @returns The ManagedObject Any to be used to calculate the visible value of the binding.
|
|
497
583
|
*/
|
|
498
|
-
getBoundObject: function (expBinding:
|
|
584
|
+
getBoundObject: function (expBinding: CompiledBindingToolkitExpression, context: Context): AnyType {
|
|
499
585
|
const mOToUse = new Any({ any: expBinding });
|
|
500
586
|
const model = context.getModel();
|
|
501
587
|
mOToUse.setModel(model);
|
|
@@ -507,15 +593,15 @@ const MassEditHelper = {
|
|
|
507
593
|
/**
|
|
508
594
|
* Get the visibility of the field.
|
|
509
595
|
*
|
|
510
|
-
* @param
|
|
511
|
-
* @param
|
|
512
|
-
* @param
|
|
513
|
-
* @param
|
|
514
|
-
* @param
|
|
515
|
-
* @returns
|
|
596
|
+
* @param expBinding Binding String object.
|
|
597
|
+
* @param oDialogDataModel Model to be used runtime.
|
|
598
|
+
* @param dataProperty Field name.
|
|
599
|
+
* @param values Values of the field.
|
|
600
|
+
* @param context Context the binding value.
|
|
601
|
+
* @returns Returns true if the mass edit field is editable.
|
|
516
602
|
*/
|
|
517
603
|
getFieldVisiblity: function (
|
|
518
|
-
expBinding:
|
|
604
|
+
expBinding: CompiledBindingToolkitExpression,
|
|
519
605
|
oDialogDataModel: JSONModel,
|
|
520
606
|
dataProperty: string,
|
|
521
607
|
values: any,
|
|
@@ -535,165 +621,261 @@ const MassEditHelper = {
|
|
|
535
621
|
* => The model consists of values shown in the comboBox of the dialog (Leave Blank, Keep Existing Values, or any property value for the selected context, etc.)
|
|
536
622
|
* => The model will capture runtime changes in the results property (the value entered in the comboBox).
|
|
537
623
|
*
|
|
538
|
-
* @param
|
|
539
|
-
* @param
|
|
540
|
-
* @param
|
|
541
|
-
* @
|
|
624
|
+
* @param aContexts Contexts for mass edit
|
|
625
|
+
* @param aDataArray Array containing data related to the dialog used by both the static and the runtime model
|
|
626
|
+
* @param oDefaultValues Default values from i18n
|
|
627
|
+
* @param dialogContext Transient context for mass edit dialog.
|
|
628
|
+
* @returns The runtime model
|
|
542
629
|
*/
|
|
543
|
-
setRuntimeModelOnDialog: function (aContexts: any[], aDataArray: any[], oDefaultValues: any) {
|
|
630
|
+
setRuntimeModelOnDialog: function (aContexts: any[], aDataArray: any[], oDefaultValues: any, dialogContext: Context) {
|
|
544
631
|
const aValues: any[] = [];
|
|
545
632
|
const aUnitData: any[] = [];
|
|
546
633
|
const aResults: any[] = [];
|
|
547
634
|
const aReadOnlyFieldInfo: any[] = [];
|
|
548
|
-
const
|
|
549
|
-
|
|
635
|
+
const oData = {
|
|
636
|
+
"values": aValues,
|
|
637
|
+
"unitData": aUnitData,
|
|
638
|
+
"results": aResults,
|
|
639
|
+
"readablePropertyData": aReadOnlyFieldInfo,
|
|
640
|
+
"selectedKey": undefined,
|
|
641
|
+
"noFields": oDefaultValues.noFields
|
|
642
|
+
};
|
|
550
643
|
const oDialogDataModel = new JSONModel(oData);
|
|
551
|
-
|
|
552
|
-
aDataArray.forEach(function (oData: any) {
|
|
644
|
+
aDataArray.forEach(function (oInData: any) {
|
|
553
645
|
let oTextInfo;
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
646
|
+
let sPropertyKey;
|
|
647
|
+
let sUnitPropertyName;
|
|
648
|
+
const oDistinctValueMap: any = {};
|
|
649
|
+
const oDistinctUnitMap: any = {};
|
|
650
|
+
if (oInData.dataProperty && oInData.dataProperty.indexOf("/") > -1) {
|
|
651
|
+
const aFinalPath = MassEditHelper.initLastLevelOfPropertyPath(oInData.dataProperty, aValues /*, dialogContext */);
|
|
652
|
+
const aPropertyPaths = oInData.dataProperty.split("/");
|
|
653
|
+
|
|
654
|
+
for (const context of aContexts) {
|
|
655
|
+
const sMultiLevelPathValue = context.getObject(oInData.dataProperty);
|
|
656
|
+
sPropertyKey = `${oInData.dataProperty}/${sMultiLevelPathValue}`;
|
|
561
657
|
if (!oDistinctValueMap[sPropertyKey] && aFinalPath[aPropertyPaths[aPropertyPaths.length - 1]]) {
|
|
562
658
|
oTextInfo = MassEditHelper.getTextArrangementInfo(
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
659
|
+
oInData.dataProperty,
|
|
660
|
+
oInData.descriptionPath,
|
|
661
|
+
oInData.display,
|
|
662
|
+
context
|
|
567
663
|
);
|
|
568
664
|
aFinalPath[aPropertyPaths[aPropertyPaths.length - 1]].push({
|
|
569
665
|
"text": (oTextInfo && oTextInfo.fullText) || sMultiLevelPathValue,
|
|
570
|
-
"key":
|
|
666
|
+
"key": sPropertyKey,
|
|
571
667
|
"textInfo": oTextInfo
|
|
572
668
|
});
|
|
573
669
|
oDistinctValueMap[sPropertyKey] = sMultiLevelPathValue;
|
|
574
670
|
}
|
|
575
671
|
}
|
|
672
|
+
// if (Object.keys(oDistinctValueMap).length === 1) {
|
|
673
|
+
// dialogContext.setProperty(oData.dataProperty, sPropertyKey && oDistinctValueMap[sPropertyKey]);
|
|
674
|
+
// }
|
|
675
|
+
|
|
676
|
+
aFinalPath[aPropertyPaths[aPropertyPaths.length - 1]].textInfo = {
|
|
677
|
+
descriptionPath: oInData.descriptionPath,
|
|
678
|
+
valuePath: oInData.dataProperty,
|
|
679
|
+
displayMode: oInData.display
|
|
680
|
+
};
|
|
576
681
|
} else {
|
|
577
|
-
aValues[
|
|
578
|
-
|
|
579
|
-
|
|
682
|
+
aValues[oInData.dataProperty] = aValues[oInData.dataProperty] || [];
|
|
683
|
+
aValues[oInData.dataProperty]["selectOptions"] = aValues[oInData.dataProperty]["selectOptions"] || [];
|
|
684
|
+
if (oInData.unitProperty) {
|
|
685
|
+
aUnitData[oInData.unitProperty] = aUnitData[oInData.unitProperty] || [];
|
|
686
|
+
aUnitData[oInData.unitProperty]["selectOptions"] = aUnitData[oInData.unitProperty]["selectOptions"] || [];
|
|
580
687
|
}
|
|
581
|
-
for (
|
|
582
|
-
const oDataObject =
|
|
583
|
-
|
|
584
|
-
if (
|
|
585
|
-
|
|
586
|
-
oData.dataProperty,
|
|
587
|
-
oData.textBinding,
|
|
588
|
-
oData.entitySet,
|
|
589
|
-
aContexts[i]
|
|
590
|
-
);
|
|
591
|
-
aValues[oData.dataProperty].push({
|
|
592
|
-
"text": (oTextInfo && oTextInfo.fullText) || oDataObject[oData.dataProperty],
|
|
593
|
-
"key": oData.dataProperty,
|
|
594
|
-
"textInfo": oTextInfo
|
|
595
|
-
});
|
|
596
|
-
oDistinctValueMap[sPropertyName] = oDataObject[oData.dataProperty];
|
|
597
|
-
}
|
|
598
|
-
if (oData.unitProperty && oDataObject[oData.unitProperty]) {
|
|
599
|
-
sPropertyName = oData.unitProperty + "/" + oDataObject[oData.unitProperty];
|
|
600
|
-
if (!oDistinctValueMap[sPropertyName]) {
|
|
688
|
+
for (const context of aContexts) {
|
|
689
|
+
const oDataObject = context.getObject();
|
|
690
|
+
sPropertyKey = `${oInData.dataProperty}/${oDataObject[oInData.dataProperty]}`;
|
|
691
|
+
if (oInData.dataProperty && oDataObject[oInData.dataProperty] && !oDistinctValueMap[sPropertyKey]) {
|
|
692
|
+
if (oInData.inputType != "CheckBox") {
|
|
601
693
|
oTextInfo = MassEditHelper.getTextArrangementInfo(
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
694
|
+
oInData.dataProperty,
|
|
695
|
+
oInData.descriptionPath,
|
|
696
|
+
oInData.display,
|
|
697
|
+
context
|
|
606
698
|
);
|
|
607
|
-
|
|
608
|
-
"text": (oTextInfo && oTextInfo.fullText) || oDataObject[
|
|
609
|
-
"key":
|
|
699
|
+
const entry = {
|
|
700
|
+
"text": (oTextInfo && oTextInfo.fullText) || oDataObject[oInData.dataProperty],
|
|
701
|
+
"key": sPropertyKey,
|
|
610
702
|
"textInfo": oTextInfo
|
|
611
|
-
}
|
|
612
|
-
|
|
703
|
+
};
|
|
704
|
+
aValues[oInData.dataProperty].push(entry);
|
|
705
|
+
aValues[oInData.dataProperty]["selectOptions"].push(entry);
|
|
706
|
+
}
|
|
707
|
+
oDistinctValueMap[sPropertyKey] = oDataObject[oInData.dataProperty];
|
|
708
|
+
}
|
|
709
|
+
if (oInData.unitProperty && oDataObject[oInData.unitProperty]) {
|
|
710
|
+
sUnitPropertyName = `${oInData.unitProperty}/${oDataObject[oInData.unitProperty]}`;
|
|
711
|
+
if (!oDistinctUnitMap[sUnitPropertyName]) {
|
|
712
|
+
if (oInData.inputType != "CheckBox") {
|
|
713
|
+
oTextInfo = MassEditHelper.getTextArrangementInfo(
|
|
714
|
+
oInData.unitProperty,
|
|
715
|
+
oInData.descriptionPath,
|
|
716
|
+
oInData.display,
|
|
717
|
+
context
|
|
718
|
+
);
|
|
719
|
+
const unitEntry = {
|
|
720
|
+
"text": (oTextInfo && oTextInfo.fullText) || oDataObject[oInData.unitProperty],
|
|
721
|
+
"key": sUnitPropertyName,
|
|
722
|
+
"textInfo": oTextInfo
|
|
723
|
+
};
|
|
724
|
+
aUnitData[oInData.unitProperty].push(unitEntry);
|
|
725
|
+
aUnitData[oInData.unitProperty]["selectOptions"].push(unitEntry);
|
|
726
|
+
}
|
|
727
|
+
oDistinctUnitMap[sUnitPropertyName] = oDataObject[oInData.unitProperty];
|
|
613
728
|
}
|
|
614
729
|
}
|
|
615
730
|
}
|
|
731
|
+
aValues[oInData.dataProperty].textInfo = {
|
|
732
|
+
descriptionPath: oInData.descriptionPath,
|
|
733
|
+
valuePath: oInData.dataProperty,
|
|
734
|
+
displayMode: oInData.display
|
|
735
|
+
};
|
|
736
|
+
if (Object.keys(oDistinctValueMap).length === 1) {
|
|
737
|
+
dialogContext.setProperty(oInData.dataProperty, sPropertyKey && oDistinctValueMap[sPropertyKey]);
|
|
738
|
+
}
|
|
739
|
+
if (Object.keys(oDistinctUnitMap).length === 1) {
|
|
740
|
+
dialogContext.setProperty(oInData.unitProperty, sUnitPropertyName && oDistinctUnitMap[sUnitPropertyName]);
|
|
741
|
+
}
|
|
616
742
|
}
|
|
617
743
|
});
|
|
618
|
-
aDataArray.forEach(function (
|
|
619
|
-
let values: any;
|
|
620
|
-
if (
|
|
621
|
-
const sMultiLevelPropPathValue = MassEditHelper.getValueForMultiLevelPath(
|
|
744
|
+
aDataArray.forEach(function (oInData: any) {
|
|
745
|
+
let values: any = {};
|
|
746
|
+
if (oInData.dataProperty.indexOf("/") > -1) {
|
|
747
|
+
const sMultiLevelPropPathValue = MassEditHelper.getValueForMultiLevelPath(oInData.dataProperty, aValues);
|
|
622
748
|
if (!sMultiLevelPropPathValue) {
|
|
623
|
-
sMultiLevelPropPathValue.push({ text: oDefaultValues.leaveBlankValue, key:
|
|
749
|
+
sMultiLevelPropPathValue.push({ text: oDefaultValues.leaveBlankValue, key: `Empty/${oInData.dataProperty}` });
|
|
624
750
|
} else {
|
|
625
|
-
MassEditHelper.setDefaultValuesToDialog(sMultiLevelPropPathValue,
|
|
751
|
+
MassEditHelper.setDefaultValuesToDialog(sMultiLevelPropPathValue, oDefaultValues, oInData);
|
|
626
752
|
}
|
|
627
753
|
values = sMultiLevelPropPathValue;
|
|
628
|
-
} else if (aValues[
|
|
629
|
-
|
|
630
|
-
|
|
754
|
+
} else if (aValues[oInData.dataProperty]) {
|
|
755
|
+
aValues[oInData.dataProperty] = aValues[oInData.dataProperty] || [];
|
|
756
|
+
MassEditHelper.setDefaultValuesToDialog(aValues[oInData.dataProperty], oDefaultValues, oInData);
|
|
757
|
+
values = aValues[oInData.dataProperty];
|
|
631
758
|
}
|
|
632
|
-
|
|
633
|
-
|
|
759
|
+
|
|
760
|
+
if (aUnitData[oInData.unitProperty] && aUnitData[oInData.unitProperty].length) {
|
|
761
|
+
MassEditHelper.setDefaultValuesToDialog(aUnitData[oInData.unitProperty], oDefaultValues, oInData, true);
|
|
762
|
+
aUnitData[oInData.unitProperty].textInfo = {};
|
|
763
|
+
aUnitData[oInData.unitProperty].selectedKey = MassEditHelper.getDefaultSelectionPathComboBox(
|
|
764
|
+
aContexts,
|
|
765
|
+
oInData.unitProperty
|
|
766
|
+
);
|
|
767
|
+
aUnitData[oInData.unitProperty].inputType = oInData.inputType;
|
|
634
768
|
} else if (
|
|
635
|
-
(
|
|
636
|
-
(
|
|
769
|
+
(oInData.dataProperty && aValues[oInData.dataProperty] && !aValues[oInData.dataProperty].length) ||
|
|
770
|
+
(oInData.unitProperty && aUnitData[oInData.unitProperty] && !aUnitData[oInData.unitProperty].length)
|
|
637
771
|
) {
|
|
638
772
|
const bClearFieldOrBlankValueExists =
|
|
639
|
-
aValues[
|
|
640
|
-
aValues[
|
|
773
|
+
aValues[oInData.dataProperty] &&
|
|
774
|
+
aValues[oInData.dataProperty].some(function (obj: any) {
|
|
641
775
|
return obj.text === "< Clear Values >" || obj.text === "< Leave Blank >";
|
|
642
776
|
});
|
|
643
|
-
if (
|
|
644
|
-
aValues[
|
|
777
|
+
if (oInData.dataProperty && !bClearFieldOrBlankValueExists) {
|
|
778
|
+
aValues[oInData.dataProperty].push({ text: oDefaultValues.leaveBlankValue, key: `Empty/${oInData.dataProperty}` });
|
|
645
779
|
}
|
|
646
780
|
const bClearFieldOrBlankUnitValueExists =
|
|
647
|
-
aUnitData[
|
|
648
|
-
aUnitData[
|
|
781
|
+
aUnitData[oInData.unitProperty] &&
|
|
782
|
+
aUnitData[oInData.unitProperty].some(function (obj: any) {
|
|
649
783
|
return obj.text === "< Clear Values >" || obj.text === "< Leave Blank >";
|
|
650
784
|
});
|
|
651
|
-
if (
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
785
|
+
if (oInData.unitProperty) {
|
|
786
|
+
if (!bClearFieldOrBlankUnitValueExists) {
|
|
787
|
+
aUnitData[oInData.unitProperty].push({
|
|
788
|
+
text: oDefaultValues.leaveBlankValue,
|
|
789
|
+
key: `Empty/${oInData.unitProperty}`
|
|
790
|
+
});
|
|
791
|
+
}
|
|
792
|
+
aUnitData[oInData.unitProperty].textInfo = {};
|
|
793
|
+
aUnitData[oInData.unitProperty].selectedKey = MassEditHelper.getDefaultSelectionPathComboBox(
|
|
794
|
+
aContexts,
|
|
795
|
+
oInData.unitProperty
|
|
796
|
+
);
|
|
797
|
+
aUnitData[oInData.unitProperty].inputType = oInData.inputType;
|
|
656
798
|
}
|
|
657
799
|
}
|
|
658
|
-
if (
|
|
659
|
-
aReadOnlyFieldInfo.push({ "property":
|
|
800
|
+
if (oInData.isPropertyReadOnly && typeof oInData.isPropertyReadOnly === "boolean") {
|
|
801
|
+
aReadOnlyFieldInfo.push({ "property": oInData.dataProperty, value: oInData.isPropertyReadOnly, type: "Default" });
|
|
660
802
|
} else if (
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
803
|
+
oInData.isPropertyReadOnly &&
|
|
804
|
+
oInData.isPropertyReadOnly.operands &&
|
|
805
|
+
oInData.isPropertyReadOnly.operands[0] &&
|
|
806
|
+
oInData.isPropertyReadOnly.operands[0].operand1 &&
|
|
807
|
+
oInData.isPropertyReadOnly.operands[0].operand2
|
|
666
808
|
) {
|
|
667
809
|
// This needs to be refactored in accordance with the ReadOnlyExpression change
|
|
668
810
|
aReadOnlyFieldInfo.push({
|
|
669
|
-
"property":
|
|
670
|
-
propertyPath:
|
|
671
|
-
propertyValue:
|
|
811
|
+
"property": oInData.dataProperty,
|
|
812
|
+
propertyPath: oInData.isPropertyReadOnly.operands[0].operand1.path,
|
|
813
|
+
propertyValue: oInData.isPropertyReadOnly.operands[0].operand2.value,
|
|
672
814
|
type: "Path"
|
|
673
815
|
});
|
|
674
816
|
}
|
|
675
817
|
|
|
676
818
|
// Setting visbility of the mass edit field.
|
|
677
|
-
if (
|
|
819
|
+
if (oInData.editMode) {
|
|
678
820
|
values.visible =
|
|
679
|
-
|
|
821
|
+
oInData.editMode === EditMode.Editable ||
|
|
680
822
|
aContexts.some(
|
|
681
|
-
MassEditHelper.getFieldVisiblity.bind(
|
|
823
|
+
MassEditHelper.getFieldVisiblity.bind(
|
|
824
|
+
MassEditHelper,
|
|
825
|
+
oInData.editMode,
|
|
826
|
+
oDialogDataModel,
|
|
827
|
+
oInData.dataProperty,
|
|
828
|
+
values
|
|
829
|
+
)
|
|
682
830
|
);
|
|
683
831
|
} else {
|
|
684
832
|
values.visible = true;
|
|
685
833
|
}
|
|
834
|
+
values.selectedKey = MassEditHelper.getDefaultSelectionPathComboBox(aContexts, oInData.dataProperty);
|
|
835
|
+
values.inputType = oInData.inputType;
|
|
836
|
+
values.unitProperty = oInData.unitProperty;
|
|
686
837
|
});
|
|
838
|
+
|
|
687
839
|
return oDialogDataModel;
|
|
688
840
|
},
|
|
841
|
+
/**
|
|
842
|
+
* Gets transient context for dialog.
|
|
843
|
+
*
|
|
844
|
+
* @param table Instance of Table.
|
|
845
|
+
* @param dialog Mass Edit Dialog.
|
|
846
|
+
* @returns Promise returning instance of dialog.
|
|
847
|
+
*/
|
|
848
|
+
getDialogContext: function (table: Table, dialog?: Dialog): Context {
|
|
849
|
+
let transCtx: Context = (dialog && dialog.getBindingContext()) as Context;
|
|
850
|
+
|
|
851
|
+
if (!transCtx) {
|
|
852
|
+
const model = table.getModel();
|
|
853
|
+
const listBinding = table.getRowBinding();
|
|
854
|
+
const transientListBinding = model.bindList(listBinding.getPath(), listBinding.getContext(), [], [], {
|
|
855
|
+
$$updateGroupId: "submitLater"
|
|
856
|
+
}) as ODataListBinding;
|
|
857
|
+
(transientListBinding as any).refreshInternal = function () {
|
|
858
|
+
/* */
|
|
859
|
+
};
|
|
860
|
+
transCtx = transientListBinding.create({}, true);
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
return transCtx;
|
|
864
|
+
},
|
|
865
|
+
|
|
866
|
+
onDialogOpen: function (event: any): void {
|
|
867
|
+
const source = event.getSource();
|
|
868
|
+
const fieldsInfoModel = source.getModel("fieldsInfo");
|
|
869
|
+
fieldsInfoModel.setProperty("/isOpen", true);
|
|
870
|
+
},
|
|
689
871
|
|
|
690
872
|
/**
|
|
691
873
|
* Create the mass edit dialog.
|
|
692
874
|
*
|
|
693
|
-
* @param
|
|
694
|
-
* @param
|
|
695
|
-
* @param
|
|
696
|
-
* @returns
|
|
875
|
+
* @param oTable Instance of Table
|
|
876
|
+
* @param aContexts Contexts for mass edit
|
|
877
|
+
* @param oController Controller for the view
|
|
878
|
+
* @returns Promise returning instance of dialog.
|
|
697
879
|
*/
|
|
698
880
|
createDialog: function (oTable: Table, aContexts: any[], oController: PageController) {
|
|
699
881
|
const sFragmentName = "sap/fe/core/controls/massEdit/MassEditDialog",
|
|
@@ -701,7 +883,8 @@ const MassEditHelper = {
|
|
|
701
883
|
oResourceBundle = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core"),
|
|
702
884
|
oDefaultValues = MassEditHelper.getDefaultTextsForDialog(oResourceBundle, aContexts.length, oTable),
|
|
703
885
|
oDataFieldModel = MassEditHelper.prepareDataForDialog(oTable, aContexts, aDataArray),
|
|
704
|
-
|
|
886
|
+
dialogContext = MassEditHelper.getDialogContext(oTable),
|
|
887
|
+
oDialogDataModel = MassEditHelper.setRuntimeModelOnDialog(aContexts, aDataArray, oDefaultValues, dialogContext);
|
|
705
888
|
|
|
706
889
|
return new Promise(function (resolve: (value: any) => void, reject: (reason?: any) => void) {
|
|
707
890
|
const oFragment = XMLTemplateProcessor.loadTemplate(sFragmentName, "fragment");
|
|
@@ -719,24 +902,32 @@ const MassEditHelper = {
|
|
|
719
902
|
}
|
|
720
903
|
)
|
|
721
904
|
)
|
|
722
|
-
.then(function (
|
|
723
|
-
return Fragment.load({ definition:
|
|
905
|
+
.then(function (oCreatedFragment: any) {
|
|
906
|
+
return Fragment.load({ definition: oCreatedFragment }).then(function (oDialogContent: any) {
|
|
907
|
+
const DraftStatus = FELibrary.DraftStatus;
|
|
724
908
|
const oDialog = new Dialog({
|
|
909
|
+
resizable: true,
|
|
725
910
|
title: oDefaultValues.massEditTitle,
|
|
726
911
|
content: [oDialogContent],
|
|
912
|
+
afterOpen: MassEditHelper.onDialogOpen,
|
|
727
913
|
beginButton: new Button({
|
|
728
|
-
text: oDefaultValues.
|
|
914
|
+
text: MassEditHelper.helpers.getExpBindingForApplyButtonTxt(oDefaultValues, oDataFieldModel.getObject("/")),
|
|
729
915
|
type: "Emphasized",
|
|
730
916
|
press: function (oEvent: any) {
|
|
731
|
-
|
|
732
|
-
|
|
917
|
+
(oController.getView()?.getBindingContext("internal") as InternalModelContext)?.setProperty(
|
|
918
|
+
"skipPatchHandlers",
|
|
919
|
+
true
|
|
920
|
+
);
|
|
921
|
+
const oInDialog = oEvent.getSource().getParent();
|
|
922
|
+
const oModel = oInDialog.getModel("fieldsInfo");
|
|
733
923
|
const aResults = oModel.getProperty("/results");
|
|
734
924
|
const aPropertyReadableInfo = oModel.getProperty("/readablePropertyData");
|
|
735
925
|
const changePromise: any[] = [];
|
|
736
926
|
let bReadOnlyField = false;
|
|
737
927
|
let groupId;
|
|
738
|
-
let index = 0;
|
|
739
|
-
|
|
928
|
+
//let index = 0;
|
|
929
|
+
const errorValues: any[] = [];
|
|
930
|
+
aContexts.forEach(function (oSelectedContext: any, idx: number) {
|
|
740
931
|
aResults.forEach(function (oResult: any) {
|
|
741
932
|
//TODO - Add save implementation for Value Help.
|
|
742
933
|
if (aPropertyReadableInfo) {
|
|
@@ -757,46 +948,126 @@ const MassEditHelper = {
|
|
|
757
948
|
}
|
|
758
949
|
});
|
|
759
950
|
}
|
|
760
|
-
groupId =
|
|
761
|
-
index += 1;
|
|
951
|
+
groupId = `$auto.${idx}`;
|
|
952
|
+
//index += 1;
|
|
953
|
+
oController._editFlow.setDraftStatus(DraftStatus.Saving);
|
|
954
|
+
//let promiseCount = 0;
|
|
762
955
|
if (oResult.keyValue && oResult.value !== "Default" && !bReadOnlyField) {
|
|
763
|
-
changePromise.push(
|
|
956
|
+
changePromise.push(
|
|
957
|
+
oSelectedContext
|
|
958
|
+
.setProperty(oResult.keyValue, oResult.value, groupId)
|
|
959
|
+
.then(function () {
|
|
960
|
+
return oSelectedContext;
|
|
961
|
+
})
|
|
962
|
+
.catch(function (oError: any) {
|
|
963
|
+
errorValues.push(oSelectedContext.getObject());
|
|
964
|
+
Log.error("Mass Edit: Something went wrong in updating entries.", oError);
|
|
965
|
+
})
|
|
966
|
+
);
|
|
764
967
|
}
|
|
765
968
|
});
|
|
766
969
|
});
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
970
|
+
|
|
971
|
+
// eslint-disable-next-line promise/catch-or-return
|
|
972
|
+
(Promise as any).allSettled(changePromise).then(function () {
|
|
973
|
+
const oListBinding = oTable.getRowBinding();
|
|
974
|
+
const oExtensionAPI = oController && (oController.getExtensionAPI() as any);
|
|
975
|
+
return oExtensionAPI.refresh(oListBinding.getPath()).then(function () {
|
|
976
|
+
const subtitleColumn = CommonUtils.getMessageColumn(oTable);
|
|
977
|
+
const messages = sap.ui.getCore().getMessageManager().getMessageModel().getData();
|
|
978
|
+
const boundTransitionErrorContexts = [] as any;
|
|
979
|
+
messages.forEach(function (message: any) {
|
|
980
|
+
const messageTargets = message.getTargets();
|
|
981
|
+
if (
|
|
982
|
+
messageTargets &&
|
|
983
|
+
messageTargets.length === 1 &&
|
|
984
|
+
messageTargets[0].length &&
|
|
985
|
+
message.persistent === true
|
|
986
|
+
) {
|
|
987
|
+
const boundTransitionErrorContext = aContexts.find(function (oContext: any) {
|
|
988
|
+
return message.getTarget().indexOf(oContext.getPath()) !== -1;
|
|
989
|
+
});
|
|
990
|
+
boundTransitionErrorContexts.push(boundTransitionErrorContext);
|
|
991
|
+
message.additionalText = boundTransitionErrorContext
|
|
992
|
+
? boundTransitionErrorContext.getObject()[subtitleColumn]
|
|
993
|
+
: undefined;
|
|
994
|
+
}
|
|
775
995
|
});
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
996
|
+
if (
|
|
997
|
+
aResults.length > 0 &&
|
|
998
|
+
boundTransitionErrorContexts.length === 0 &&
|
|
999
|
+
errorValues.length === 0
|
|
1000
|
+
) {
|
|
1001
|
+
oController._editFlow.setDraftStatus(DraftStatus.Saved);
|
|
1002
|
+
const successToast = oResourceBundle.getText("C_MASS_EDIT_SUCCESS_TOAST");
|
|
1003
|
+
MessageToast.show(successToast);
|
|
1004
|
+
} else if (
|
|
1005
|
+
errorValues.length + boundTransitionErrorContexts.length <
|
|
1006
|
+
(oTable as any).getSelectedContexts().length
|
|
1007
|
+
) {
|
|
1008
|
+
oController._editFlow.setDraftStatus(DraftStatus.Saved);
|
|
1009
|
+
} else if (
|
|
1010
|
+
errorValues.length + boundTransitionErrorContexts.length ===
|
|
1011
|
+
(oTable as any).getSelectedContexts().length
|
|
1012
|
+
) {
|
|
1013
|
+
oController._editFlow.setDraftStatus(DraftStatus.Clear);
|
|
1014
|
+
}
|
|
1015
|
+
oController._editFlow.getMessageHandler().showMessages();
|
|
1016
|
+
if (oInDialog.isOpen()) {
|
|
1017
|
+
oInDialog.close();
|
|
1018
|
+
oInDialog.destroy();
|
|
1019
|
+
(oController.getView()?.getBindingContext("internal") as InternalModelContext)?.setProperty(
|
|
1020
|
+
"skipPatchHandlers",
|
|
1021
|
+
false
|
|
1022
|
+
);
|
|
1023
|
+
}
|
|
782
1024
|
});
|
|
1025
|
+
});
|
|
783
1026
|
}
|
|
784
1027
|
}),
|
|
785
1028
|
endButton: new Button({
|
|
786
1029
|
text: oDefaultValues.cancelButtonText,
|
|
1030
|
+
visible: MassEditHelper.helpers.hasEditableFieldsBinding(oDataFieldModel.getObject("/"), true) as any,
|
|
787
1031
|
press: function (oEvent: any) {
|
|
788
|
-
const
|
|
789
|
-
|
|
790
|
-
|
|
1032
|
+
const oInDialog = oEvent.getSource().getParent();
|
|
1033
|
+
oInDialog.close();
|
|
1034
|
+
oInDialog.destroy();
|
|
791
1035
|
}
|
|
792
1036
|
})
|
|
793
1037
|
});
|
|
1038
|
+
const model = oTable.getModel();
|
|
794
1039
|
oDialog.setModel(oDialogDataModel, "fieldsInfo");
|
|
1040
|
+
oDialog.setModel(model);
|
|
1041
|
+
oDialog.setBindingContext(dialogContext);
|
|
795
1042
|
resolve(oDialog);
|
|
796
1043
|
});
|
|
797
1044
|
})
|
|
798
1045
|
.catch(reject);
|
|
799
1046
|
});
|
|
1047
|
+
},
|
|
1048
|
+
|
|
1049
|
+
helpers: {
|
|
1050
|
+
getBindingExpForHasEditableFields: (fields: any, editable: boolean) => {
|
|
1051
|
+
const totalExp = fields.reduce(
|
|
1052
|
+
(expression: any, field: any) =>
|
|
1053
|
+
or(
|
|
1054
|
+
expression,
|
|
1055
|
+
pathInModel("/values/" + field.dataProperty + "/visible", "fieldsInfo") as BindingToolkitExpression<boolean>
|
|
1056
|
+
),
|
|
1057
|
+
constant(false)
|
|
1058
|
+
);
|
|
1059
|
+
return editable ? totalExp : not(totalExp);
|
|
1060
|
+
},
|
|
1061
|
+
|
|
1062
|
+
getExpBindingForApplyButtonTxt: (defaultValues: any, fields: boolean) => {
|
|
1063
|
+
const editableExp = MassEditHelper.helpers.getBindingExpForHasEditableFields(fields, true);
|
|
1064
|
+
const totalExp = ifElse(editableExp, constant(defaultValues.applyButtonText), constant(defaultValues.okButtonText));
|
|
1065
|
+
return compileExpression(totalExp);
|
|
1066
|
+
},
|
|
1067
|
+
|
|
1068
|
+
hasEditableFieldsBinding: (fields: any, editable: boolean) => {
|
|
1069
|
+
return compileExpression(MassEditHelper.helpers.getBindingExpForHasEditableFields(fields, editable));
|
|
1070
|
+
}
|
|
800
1071
|
}
|
|
801
1072
|
};
|
|
802
1073
|
|