@sapui5/sap.fe.core 1.99.0 → 1.100.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -2
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AnnotationHelper.js +1 -69
- package/src/sap/fe/core/AnnotationHelper.ts +0 -70
- package/src/sap/fe/core/AppComponent.js +388 -399
- package/src/sap/fe/core/AppComponent.ts +403 -0
- package/src/sap/fe/core/AppStateHandler.js +127 -158
- package/src/sap/fe/core/BaseController.js +82 -58
- package/src/sap/fe/core/BaseController.ts +68 -0
- package/src/sap/fe/core/CommonUtils.js +111 -20
- package/src/sap/fe/core/CommonUtils.ts +131 -32
- package/src/sap/fe/core/ExtensionAPI.js +278 -274
- package/src/sap/fe/core/ExtensionAPI.ts +250 -0
- package/src/sap/fe/core/PageController.js +157 -29
- package/src/sap/fe/core/PageController.ts +60 -32
- package/src/sap/fe/core/RouterProxy.js +694 -756
- package/src/sap/fe/core/RouterProxy.ts +11 -9
- package/src/sap/fe/core/Synchronization.js +21 -31
- package/src/sap/fe/core/TemplateComponent.js +1 -1
- package/src/sap/fe/core/TemplateComponent.ts +10 -3
- package/src/sap/fe/core/TemplateModel.js +20 -38
- package/src/sap/fe/core/TemplateModel.ts +1 -1
- package/src/sap/fe/core/TransactionHelper.js +1354 -1370
- package/src/sap/fe/core/TransactionHelper.ts +33 -22
- package/src/sap/fe/core/actions/collaboration/ActivitySync.js +392 -0
- package/src/sap/fe/core/actions/collaboration/ActivitySync.ts +355 -0
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +136 -0
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.ts +119 -0
- package/src/sap/fe/core/actions/collaboration/Manage.js +262 -0
- package/src/sap/fe/core/actions/collaboration/Manage.ts +244 -0
- package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +103 -0
- package/src/sap/fe/core/actions/collaboration/UserDetails.fragment.xml +13 -0
- package/src/sap/fe/core/actions/draft.js +30 -68
- package/src/sap/fe/core/actions/draft.ts +44 -71
- package/src/sap/fe/core/actions/messageHandling.js +55 -36
- package/src/sap/fe/core/actions/messageHandling.ts +66 -46
- package/src/sap/fe/core/actions/operations.js +34 -15
- package/src/sap/fe/core/actions/operations.ts +48 -18
- package/src/sap/fe/core/actions/sticky.js +17 -4
- package/src/sap/fe/core/actions/sticky.ts +21 -4
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +69 -66
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.ts +65 -0
- package/src/sap/fe/core/controllerextensions/EditFlow.js +1593 -1669
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +1672 -0
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +79 -54
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +61 -0
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +718 -779
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +783 -0
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +796 -816
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +803 -0
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +1004 -1005
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +978 -0
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +487 -521
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +2 -2
- package/src/sap/fe/core/controllerextensions/MassEdit.js +141 -169
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +156 -0
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +233 -244
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +225 -0
- package/src/sap/fe/core/controllerextensions/PageReady.js +301 -336
- package/src/sap/fe/core/controllerextensions/PageReady.ts +12 -10
- package/src/sap/fe/core/controllerextensions/Paginator.js +188 -175
- package/src/sap/fe/core/controllerextensions/Paginator.ts +163 -0
- package/src/sap/fe/core/controllerextensions/Placeholder.js +157 -149
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +151 -0
- package/src/sap/fe/core/controllerextensions/Routing.js +144 -125
- package/src/sap/fe/core/controllerextensions/Routing.ts +132 -0
- package/src/sap/fe/core/controllerextensions/RoutingListener.js +7 -6
- package/src/sap/fe/core/controllerextensions/RoutingListener.ts +3 -0
- package/src/sap/fe/core/controllerextensions/Share.js +230 -268
- package/src/sap/fe/core/controllerextensions/Share.ts +231 -0
- package/src/sap/fe/core/controllerextensions/SideEffects.js +592 -633
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +8 -7
- package/src/sap/fe/core/controllerextensions/ViewState.js +788 -806
- package/src/sap/fe/core/controllerextensions/ViewState.ts +805 -0
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +2 -2
- package/src/sap/fe/core/controls/ActionPartial.fragment.xml +2 -2
- package/src/sap/fe/core/controls/CommandExecution.js +67 -66
- package/src/sap/fe/core/controls/CommandExecution.ts +72 -0
- package/src/sap/fe/core/controls/ConditionalWrapper.js +90 -75
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +83 -0
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +130 -125
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +126 -0
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +103 -112
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +101 -0
- package/src/sap/fe/core/controls/FieldWrapper.js +122 -135
- package/src/sap/fe/core/controls/FieldWrapper.ts +115 -0
- package/src/sap/fe/core/controls/FilterBar.js +162 -159
- package/src/sap/fe/core/controls/FilterBar.ts +143 -0
- package/src/sap/fe/core/controls/FormElementWrapper.js +45 -39
- package/src/sap/fe/core/controls/FormElementWrapper.ts +40 -0
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +37 -42
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.ts +31 -0
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +126 -116
- package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +98 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +241 -255
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +245 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +150 -141
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +125 -0
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +335 -322
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +337 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +74 -74
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +70 -0
- package/src/sap/fe/core/converters/ConverterContext.js +348 -379
- package/src/sap/fe/core/converters/ConverterContext.ts +19 -16
- package/src/sap/fe/core/converters/ManifestSettings.js +12 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +12 -1
- package/src/sap/fe/core/converters/ManifestWrapper.js +354 -378
- package/src/sap/fe/core/converters/ManifestWrapper.ts +10 -0
- package/src/sap/fe/core/converters/MetaModelConverter.js +6 -4
- package/src/sap/fe/core/converters/MetaModelConverter.ts +5 -2
- package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
- package/src/sap/fe/core/converters/TemplateConverter.ts +2 -1
- package/src/sap/fe/core/converters/annotations/DataField.js +26 -12
- package/src/sap/fe/core/converters/annotations/DataField.ts +37 -13
- package/src/sap/fe/core/converters/controls/Common/Form.js +2 -2
- package/src/sap/fe/core/converters/controls/Common/Form.ts +4 -2
- package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +3 -2
- package/src/sap/fe/core/converters/controls/Common/Table.js +130 -23
- package/src/sap/fe/core/converters/controls/Common/Table.ts +134 -29
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +118 -53
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +156 -93
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +161 -207
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +148 -206
- package/src/sap/fe/core/converters/helpers/Aggregation.js +115 -133
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +20 -6
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +16 -4
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +12 -1
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +11 -0
- package/src/sap/fe/core/converters/helpers/Key.js +42 -57
- package/src/sap/fe/core/converters/helpers/Key.ts +1 -1
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +25 -4
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +20 -3
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +10 -4
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +15 -4
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +7 -5
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +5 -1
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +92 -98
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +91 -0
- package/src/sap/fe/core/formatters/CollaborationFormatter.js +104 -0
- package/src/sap/fe/core/formatters/CollaborationFormatter.ts +60 -0
- package/src/sap/fe/core/formatters/TableFormatter.js +53 -2
- package/src/sap/fe/core/formatters/TableFormatter.ts +51 -0
- package/src/sap/fe/core/fpm/Component.js +50 -54
- package/src/sap/fe/core/fpm/Component.ts +48 -0
- package/src/sap/fe/core/helpers/AppStartupHelper.js +323 -309
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +363 -337
- package/src/sap/fe/core/helpers/BindingExpression.js +7 -7
- package/src/sap/fe/core/helpers/BindingExpression.ts +7 -7
- package/src/sap/fe/core/helpers/ClassSupport.js +186 -62
- package/src/sap/fe/core/helpers/ClassSupport.ts +168 -52
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +5 -4
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +1 -5
- package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
- package/src/sap/fe/core/helpers/FPMHelper.ts +1 -1
- package/src/sap/fe/core/helpers/MassEditHelper.js +601 -684
- package/src/sap/fe/core/helpers/MassEditHelper.ts +699 -0
- package/src/sap/fe/core/helpers/ModelHelper.js +25 -1
- package/src/sap/fe/core/helpers/ModelHelper.ts +23 -0
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +5 -1
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +4 -0
- package/src/sap/fe/core/library.js +426 -451
- package/src/sap/fe/core/library.support.js +22 -33
- package/src/sap/fe/core/library.support.ts +23 -0
- package/src/sap/fe/core/library.ts +420 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +5 -3
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +4 -1
- package/src/sap/fe/core/messagebundle.properties +22 -5
- package/src/sap/fe/core/messagebundle_ar.properties +27 -7
- package/src/sap/fe/core/messagebundle_bg.properties +27 -7
- package/src/sap/fe/core/messagebundle_ca.properties +27 -7
- package/src/sap/fe/core/messagebundle_cs.properties +27 -7
- package/src/sap/fe/core/messagebundle_cy.properties +27 -7
- package/src/sap/fe/core/messagebundle_da.properties +27 -7
- package/src/sap/fe/core/messagebundle_de.properties +27 -7
- package/src/sap/fe/core/messagebundle_el.properties +27 -7
- package/src/sap/fe/core/messagebundle_en.properties +27 -7
- package/src/sap/fe/core/messagebundle_en_GB.properties +27 -7
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +27 -7
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +27 -7
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +27 -7
- package/src/sap/fe/core/messagebundle_es.properties +27 -7
- package/src/sap/fe/core/messagebundle_es_MX.properties +27 -7
- package/src/sap/fe/core/messagebundle_et.properties +27 -7
- package/src/sap/fe/core/messagebundle_fi.properties +28 -8
- package/src/sap/fe/core/messagebundle_fr.properties +28 -8
- package/src/sap/fe/core/messagebundle_fr_CA.properties +29 -9
- package/src/sap/fe/core/messagebundle_hi.properties +27 -7
- package/src/sap/fe/core/messagebundle_hr.properties +27 -7
- package/src/sap/fe/core/messagebundle_hu.properties +27 -7
- package/src/sap/fe/core/messagebundle_id.properties +27 -7
- package/src/sap/fe/core/messagebundle_it.properties +27 -7
- package/src/sap/fe/core/messagebundle_iw.properties +27 -7
- package/src/sap/fe/core/messagebundle_ja.properties +26 -6
- package/src/sap/fe/core/messagebundle_kk.properties +27 -7
- package/src/sap/fe/core/messagebundle_ko.properties +27 -7
- package/src/sap/fe/core/messagebundle_lt.properties +27 -7
- package/src/sap/fe/core/messagebundle_lv.properties +28 -8
- package/src/sap/fe/core/messagebundle_ms.properties +27 -7
- package/src/sap/fe/core/messagebundle_nl.properties +27 -7
- package/src/sap/fe/core/messagebundle_no.properties +27 -7
- package/src/sap/fe/core/messagebundle_pl.properties +27 -7
- package/src/sap/fe/core/messagebundle_pt.properties +28 -8
- package/src/sap/fe/core/messagebundle_pt_PT.properties +27 -7
- package/src/sap/fe/core/messagebundle_ro.properties +27 -7
- package/src/sap/fe/core/messagebundle_ru.properties +27 -7
- package/src/sap/fe/core/messagebundle_sh.properties +27 -7
- package/src/sap/fe/core/messagebundle_sk.properties +27 -7
- package/src/sap/fe/core/messagebundle_sl.properties +27 -7
- package/src/sap/fe/core/messagebundle_sv.properties +27 -7
- package/src/sap/fe/core/messagebundle_th.properties +26 -6
- package/src/sap/fe/core/messagebundle_tr.properties +30 -10
- package/src/sap/fe/core/messagebundle_uk.properties +27 -7
- package/src/sap/fe/core/messagebundle_vi.properties +27 -7
- package/src/sap/fe/core/messagebundle_zh_CN.properties +27 -7
- package/src/sap/fe/core/messagebundle_zh_TW.properties +27 -7
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +45 -71
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +154 -192
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +4 -4
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +66 -92
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/NavigationServiceFactory.js +284 -339
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +10 -13
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +67 -102
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +5 -2
- package/src/sap/fe/core/services/RoutingServiceFactory.js +754 -814
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +13 -13
- package/src/sap/fe/core/services/ShellServicesFactory.js +649 -736
- package/src/sap/fe/core/services/ShellServicesFactory.ts +7 -4
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +567 -592
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +22 -3
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +354 -386
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +21 -14
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +1 -1
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +1 -1
- package/src/sap/fe/core/support/CommonHelper.js +1 -1
- package/src/sap/fe/core/support/CommonHelper.ts +1 -1
- package/src/sap/fe/core/support/Diagnostics.js +36 -48
- package/src/sap/fe/core/templating/DataModelPathHelper.js +93 -85
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +104 -95
- package/src/sap/fe/core/templating/FilterHelper.js +25 -32
- package/src/sap/fe/core/templating/FilterHelper.ts +36 -35
- package/src/sap/fe/core/templating/PropertyHelper.js +2 -2
- package/src/sap/fe/core/templating/PropertyHelper.ts +1 -1
- package/src/sap/fe/core/templating/UIFormatters.js +32 -26
- package/src/sap/fe/core/templating/UIFormatters.ts +37 -24
|
@@ -6,7 +6,6 @@ import library from "sap/fe/core/library";
|
|
|
6
6
|
import ModelHelper from "sap/fe/core/helpers/ModelHelper";
|
|
7
7
|
import SemanticDateOperators from "sap/fe/core/helpers/SemanticDateOperators";
|
|
8
8
|
import mergeObjects from "sap/base/util/merge";
|
|
9
|
-
import DataLossOrDraftDiscardHandler from "sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler";
|
|
10
9
|
import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
|
|
11
10
|
import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
|
|
12
11
|
import Fragment from "sap/ui/core/Fragment";
|
|
@@ -14,7 +13,7 @@ import ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
|
|
|
14
13
|
import ResourceBundle from "sap/base/i18n/ResourceBundle";
|
|
15
14
|
import { bindingExpression, compileBinding, constant, transformRecursively } from "sap/fe/core/helpers/BindingExpression";
|
|
16
15
|
import { getConditions } from "./templating/FilterHelper";
|
|
17
|
-
import
|
|
16
|
+
import AppComponent from "sap/fe/core/AppComponent";
|
|
18
17
|
import JSONModel from "sap/ui/model/json/JSONModel";
|
|
19
18
|
import { generate } from "sap/fe/core/helpers/StableIdHelper";
|
|
20
19
|
import ODataModel from "sap/ui/model/odata/v4/ODataModel";
|
|
@@ -22,6 +21,14 @@ import Control from "sap/ui/core/Control";
|
|
|
22
21
|
import FilterOperatorUtil from "sap/ui/mdc/condition/FilterOperatorUtil";
|
|
23
22
|
import TypeUtil from "sap/ui/mdc/odata/v4/TypeUtil";
|
|
24
23
|
import { IssueCategory, IssueSeverity, IssueCategoryType } from "sap/fe/core/converters/helpers/IssueManager";
|
|
24
|
+
import { isConnected, disconnect } from "sap/fe/core/actions/collaboration/ActivitySync";
|
|
25
|
+
import Context from "sap/ui/model/Context";
|
|
26
|
+
import { performAfterDiscardorKeepDraft } from "./controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler";
|
|
27
|
+
import Button from "sap/m/Button";
|
|
28
|
+
import Dialog from "sap/m/Dialog";
|
|
29
|
+
import Bar from "sap/m/Bar";
|
|
30
|
+
import Title from "sap/m/Title";
|
|
31
|
+
import messageHandling from "./actions/messageHandling";
|
|
25
32
|
|
|
26
33
|
const ProgrammingModel = library.ProgrammingModel;
|
|
27
34
|
const aValidTypes = [
|
|
@@ -43,6 +50,7 @@ const aValidTypes = [
|
|
|
43
50
|
"Edm.Time",
|
|
44
51
|
"Edm.TimeOfDay"
|
|
45
52
|
];
|
|
53
|
+
|
|
46
54
|
function normalizeSearchTerm(sSearchTerm: string) {
|
|
47
55
|
if (!sSearchTerm) {
|
|
48
56
|
return undefined;
|
|
@@ -72,6 +80,8 @@ function getPropertyDataType(oNavigationContext: any) {
|
|
|
72
80
|
case "com.sap.vocabularies.UI.v1.DataField":
|
|
73
81
|
case "com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath":
|
|
74
82
|
case "com.sap.vocabularies.UI.v1.DataFieldWithUrl":
|
|
83
|
+
case "com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation":
|
|
84
|
+
case "com.sap.vocabularies.UI.v1.DataFieldWithAction":
|
|
75
85
|
sDataType = oNavigationContext.getProperty("Value/$Path/$Type");
|
|
76
86
|
break;
|
|
77
87
|
|
|
@@ -196,11 +206,11 @@ function isPropertyFilterable(oModel: ODataMetaModel, sEntitySetPath: string, sP
|
|
|
196
206
|
let bIsFilterable;
|
|
197
207
|
|
|
198
208
|
// Parameters should be rendered as filterfields
|
|
199
|
-
if (oModel.
|
|
209
|
+
if (oModel.getObject(sEntitySetPath + "/@com.sap.vocabularies.Common.v1.ResultContext") === true) {
|
|
200
210
|
return true;
|
|
201
211
|
}
|
|
202
212
|
|
|
203
|
-
const oNavigationContext = oModel.createBindingContext(sEntitySetPath + "/" + sProperty);
|
|
213
|
+
const oNavigationContext = oModel.createBindingContext(sEntitySetPath + "/" + sProperty) as Context;
|
|
204
214
|
|
|
205
215
|
if (oNavigationContext.getProperty("@com.sap.vocabularies.UI.v1.Hidden") === true) {
|
|
206
216
|
return false;
|
|
@@ -494,11 +504,20 @@ function fnProcessDataLossOrDraftDiscardConfirmation(
|
|
|
494
504
|
fnCancelFunction: any,
|
|
495
505
|
oContext: any,
|
|
496
506
|
oController: any,
|
|
497
|
-
bSkipBindingToView
|
|
507
|
+
bSkipBindingToView?: boolean
|
|
498
508
|
) {
|
|
499
509
|
const oModel = oContext.getModel();
|
|
500
510
|
let _bIsModified = false;
|
|
501
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
|
+
|
|
502
521
|
if (
|
|
503
522
|
oContext &&
|
|
504
523
|
oContext.getObject() &&
|
|
@@ -512,14 +531,9 @@ function fnProcessDataLossOrDraftDiscardConfirmation(
|
|
|
512
531
|
if (draftAdminData) {
|
|
513
532
|
_bIsModified = !(draftAdminData.CreationDateTime === draftAdminData.LastChangeDateTime);
|
|
514
533
|
if (_bIsModified) {
|
|
515
|
-
|
|
516
|
-
fnProcessFunction,
|
|
517
|
-
fnCancelFunction,
|
|
518
|
-
oController,
|
|
519
|
-
bSkipBindingToView
|
|
520
|
-
);
|
|
534
|
+
performAfterDiscardorKeepDraft(processFunctionForDrafts, fnCancelFunction, oController, bSkipBindingToView);
|
|
521
535
|
} else {
|
|
522
|
-
|
|
536
|
+
processFunctionForDrafts();
|
|
523
537
|
}
|
|
524
538
|
} else {
|
|
525
539
|
fnProcessFunction();
|
|
@@ -767,7 +781,7 @@ function getEntitySetName(oMetaModel: any, sEntityType: any) {
|
|
|
767
781
|
}
|
|
768
782
|
}
|
|
769
783
|
}
|
|
770
|
-
function computeDisplayMode(oPropertyAnnotations: any, oCollectionAnnotations
|
|
784
|
+
function computeDisplayMode(oPropertyAnnotations: any, oCollectionAnnotations?: any) {
|
|
771
785
|
const oTextAnnotation = oPropertyAnnotations["@com.sap.vocabularies.Common.v1.Text"],
|
|
772
786
|
oTextArrangementAnnotation =
|
|
773
787
|
oTextAnnotation &&
|
|
@@ -831,7 +845,7 @@ function _requestProperty(oSelectedContext: any, sAction: any, sProperty: any, s
|
|
|
831
845
|
}
|
|
832
846
|
function _setContextsBasedOnOperationAvailable(oInternalModelContext: any, aRequestPromises: any) {
|
|
833
847
|
return Promise.all(aRequestPromises)
|
|
834
|
-
.then(function(aResults: [
|
|
848
|
+
.then(function(aResults: any[]) {
|
|
835
849
|
if (aResults.length) {
|
|
836
850
|
const aApplicableContexts: any[] = [],
|
|
837
851
|
aNotApplicableContexts: any[] = [];
|
|
@@ -964,7 +978,20 @@ function getOperatorsForProperty(
|
|
|
964
978
|
const oFilterRestrictions = CommonUtils.getFilterRestrictionsByPath(sEntitySetPath, oContext);
|
|
965
979
|
const aEqualsOps = ["EQ"];
|
|
966
980
|
const aSingleRangeOps = ["EQ", "GE", "LE", "LT", "GT", "BT", "NOTLE", "NOTLT", "NOTGE", "NOTGT"];
|
|
967
|
-
const aSingleValueDateOps = [
|
|
981
|
+
const aSingleValueDateOps = [
|
|
982
|
+
"TODAY",
|
|
983
|
+
"TOMORROW",
|
|
984
|
+
"YESTERDAY",
|
|
985
|
+
"DATE",
|
|
986
|
+
"FIRSTDAYWEEK",
|
|
987
|
+
"LASTDAYWEEK",
|
|
988
|
+
"FIRSTDAYMONTH",
|
|
989
|
+
"LASTDAYMONTH",
|
|
990
|
+
"FIRSTDAYQUARTER",
|
|
991
|
+
"LASTDAYQUARTER",
|
|
992
|
+
"FIRSTDAYYEAR",
|
|
993
|
+
"LASTDAYYEAR"
|
|
994
|
+
];
|
|
968
995
|
const aMultiRangeOps = ["EQ", "GE", "LE", "LT", "GT", "BT", "NE", "NOTBT", "NOTLE", "NOTLT", "NOTGE", "NOTGT"];
|
|
969
996
|
const aSearchExpressionOps = ["Contains", "NotContains", "StartsWith", "NotStartsWith", "EndsWith", "NotEndsWith"];
|
|
970
997
|
const aSemanticDateOpsExt = SemanticDateOperators.getSupportedOperations();
|
|
@@ -1279,7 +1306,7 @@ function addPageContextToSelectionVariant(oSelectionVariant: any, mPageContext:
|
|
|
1279
1306
|
const oNavigationService = oAppComponent.getNavigationService();
|
|
1280
1307
|
return oNavigationService.mixAttributesAndSelectionVariant(mPageContext, oSelectionVariant.toJSONString());
|
|
1281
1308
|
}
|
|
1282
|
-
function addExternalStateFiltersToSelectionVariant(oSelectionVariant: any, mFilters: any, oTargetInfo: any, oFilterInfo
|
|
1309
|
+
function addExternalStateFiltersToSelectionVariant(oSelectionVariant: any, mFilters: any, oTargetInfo: any, oFilterInfo?: any) {
|
|
1283
1310
|
let sFilter: any,
|
|
1284
1311
|
sLow = "",
|
|
1285
1312
|
sHigh = null;
|
|
@@ -1444,7 +1471,7 @@ function addDefaultDisplayCurrency(aMandatoryFilterFields: any[], oSelectionVari
|
|
|
1444
1471
|
}
|
|
1445
1472
|
}
|
|
1446
1473
|
}
|
|
1447
|
-
function getNonComputedVisibleFields(oMetaModel: ODataMetaModel, sPath: any, oView
|
|
1474
|
+
function getNonComputedVisibleFields(oMetaModel: ODataMetaModel, sPath: any, oView?: any) {
|
|
1448
1475
|
const aTechnicalKeys = oMetaModel.getObject(sPath + "/").$Key;
|
|
1449
1476
|
const aNonComputedVisibleFields = [];
|
|
1450
1477
|
const oEntityType = oMetaModel.getObject(sPath + "/");
|
|
@@ -1668,7 +1695,7 @@ function fnGetSemanticObjectsFromPath(oMetaModel: any, sPath: any) {
|
|
|
1668
1695
|
}
|
|
1669
1696
|
function fnUpdateSemanticTargetsModel(aGetLinksPromises: any, aSemanticObjects: any, oInternalModelContext: any, sCurrentHash: any) {
|
|
1670
1697
|
return Promise.all(aGetLinksPromises)
|
|
1671
|
-
.then(function(aValues: [
|
|
1698
|
+
.then(function(aValues: any[]) {
|
|
1672
1699
|
let aLinks,
|
|
1673
1700
|
_oLink,
|
|
1674
1701
|
_sLinkIntentAction,
|
|
@@ -1927,7 +1954,7 @@ function getFilterRestrictionsByPath(sEntitySetPath: any, oMetaModel: any) {
|
|
|
1927
1954
|
|
|
1928
1955
|
return oRet;
|
|
1929
1956
|
}
|
|
1930
|
-
function templateControlFragment(sFragmentName: any, oPreprocessorSettings: any, oOptions: any, oModifier
|
|
1957
|
+
function templateControlFragment(sFragmentName: any, oPreprocessorSettings: any, oOptions: any, oModifier?: any) {
|
|
1931
1958
|
oOptions = oOptions || {};
|
|
1932
1959
|
if (oModifier) {
|
|
1933
1960
|
return oModifier.templateControlFragment(sFragmentName, oPreprocessorSettings, oOptions.view).then(function(oFragment: any) {
|
|
@@ -1956,21 +1983,27 @@ function templateControlFragment(sFragmentName: any, oPreprocessorSettings: any,
|
|
|
1956
1983
|
});
|
|
1957
1984
|
}
|
|
1958
1985
|
}
|
|
1959
|
-
function
|
|
1960
|
-
|
|
1986
|
+
function getSingletonPath(path: string, metaModel: ODataMetaModel): string | undefined {
|
|
1987
|
+
const parts = path.split("/").filter(Boolean),
|
|
1988
|
+
propertyName = parts.pop(),
|
|
1989
|
+
navigationPath = parts.join("/"),
|
|
1990
|
+
entitySet = navigationPath && metaModel.getObject("/" + navigationPath);
|
|
1991
|
+
if (entitySet?.$kind === "Singleton") {
|
|
1992
|
+
const singletonName = parts[parts.length - 1];
|
|
1993
|
+
return "/" + singletonName + "/" + propertyName;
|
|
1994
|
+
}
|
|
1995
|
+
return undefined;
|
|
1996
|
+
}
|
|
1997
|
+
function requestSingletonProperty(path: string, model: ODataModel) {
|
|
1998
|
+
if (!path || !model) {
|
|
1961
1999
|
return Promise.resolve(null);
|
|
1962
2000
|
}
|
|
1963
|
-
|
|
1964
|
-
const oMetaModel = oModel.getMetaModel();
|
|
2001
|
+
const metaModel = model.getMetaModel();
|
|
1965
2002
|
// Find the underlying entity set from the property path and check whether it is a singleton.
|
|
1966
|
-
const
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
if (oEntitySet && oEntitySet.$kind === "Singleton") {
|
|
1971
|
-
const sSingletonName = aParts[aParts.length - 1],
|
|
1972
|
-
oPropertyBinding = oModel.bindProperty("/" + sSingletonName + "/" + sPropertyName);
|
|
1973
|
-
return oPropertyBinding.requestValue();
|
|
2003
|
+
const resolvedPath = getSingletonPath(path, metaModel);
|
|
2004
|
+
if (resolvedPath) {
|
|
2005
|
+
const propertyBinding = model.bindProperty(resolvedPath);
|
|
2006
|
+
return propertyBinding.requestValue();
|
|
1974
2007
|
}
|
|
1975
2008
|
|
|
1976
2009
|
return Promise.resolve(null);
|
|
@@ -2018,6 +2051,70 @@ function loadMacroLibrary() {
|
|
|
2018
2051
|
});
|
|
2019
2052
|
});
|
|
2020
2053
|
}
|
|
2054
|
+
|
|
2055
|
+
function fnOnStrictHandlingFailed(sGroupId: string, actionName: string, oModel: ODataModel, aMessages: any[]) {
|
|
2056
|
+
const localI18nRef = sap.ui.getCore().getLibraryResourceBundle("sap.fe.core") as ResourceBundle,
|
|
2057
|
+
sActionName = actionName,
|
|
2058
|
+
sCancelButtonTxt = localI18nRef.getText("CANCEL");
|
|
2059
|
+
if (aMessages.length === 1) {
|
|
2060
|
+
const sMessage = aMessages[0].message + "\n" + localI18nRef.getText("PROCEED");
|
|
2061
|
+
const dialogPromise = new Promise(function(resolve) {
|
|
2062
|
+
MessageBox.warning(sMessage, {
|
|
2063
|
+
title: localI18nRef.getText("WARNING"),
|
|
2064
|
+
actions: [sActionName, sCancelButtonTxt],
|
|
2065
|
+
emphasizedAction: sActionName,
|
|
2066
|
+
onClose: function(sAction: string) {
|
|
2067
|
+
if (sAction === sActionName) {
|
|
2068
|
+
resolve(true);
|
|
2069
|
+
oModel.submitBatch(sGroupId);
|
|
2070
|
+
} else {
|
|
2071
|
+
resolve(false);
|
|
2072
|
+
}
|
|
2073
|
+
}
|
|
2074
|
+
});
|
|
2075
|
+
});
|
|
2076
|
+
return dialogPromise;
|
|
2077
|
+
}
|
|
2078
|
+
return new Promise(function(resolve) {
|
|
2079
|
+
const oMessageDialogModel = new JSONModel();
|
|
2080
|
+
oMessageDialogModel.setData(aMessages);
|
|
2081
|
+
const bStrictHandlingFlow = true;
|
|
2082
|
+
const oMessageObject = messageHandling.prepareMessageViewForDialog(oMessageDialogModel, bStrictHandlingFlow);
|
|
2083
|
+
const oDialog = new Dialog({
|
|
2084
|
+
resizable: true,
|
|
2085
|
+
content: oMessageObject.oMessageView,
|
|
2086
|
+
state: "Warning",
|
|
2087
|
+
customHeader: new Bar({
|
|
2088
|
+
contentLeft: [oMessageObject.oBackButton],
|
|
2089
|
+
contentMiddle: [new Title({ text: "Warning" })]
|
|
2090
|
+
}),
|
|
2091
|
+
contentHeight: "50%",
|
|
2092
|
+
contentWidth: "50%",
|
|
2093
|
+
verticalScrolling: false
|
|
2094
|
+
});
|
|
2095
|
+
oDialog.setBeginButton(
|
|
2096
|
+
new Button({
|
|
2097
|
+
press: function() {
|
|
2098
|
+
resolve(true);
|
|
2099
|
+
oModel.submitBatch(sGroupId);
|
|
2100
|
+
oDialog.close();
|
|
2101
|
+
},
|
|
2102
|
+
type: "Emphasized",
|
|
2103
|
+
text: getTranslatedText("IGNORE", localI18nRef, sActionName)
|
|
2104
|
+
})
|
|
2105
|
+
);
|
|
2106
|
+
oDialog.setEndButton(
|
|
2107
|
+
new Button({
|
|
2108
|
+
press: function() {
|
|
2109
|
+
resolve(false);
|
|
2110
|
+
oDialog.close();
|
|
2111
|
+
},
|
|
2112
|
+
text: sCancelButtonTxt
|
|
2113
|
+
})
|
|
2114
|
+
);
|
|
2115
|
+
oDialog.open();
|
|
2116
|
+
});
|
|
2117
|
+
}
|
|
2021
2118
|
const CommonUtils = {
|
|
2022
2119
|
isPropertyFilterable: isPropertyFilterable,
|
|
2023
2120
|
isFieldControlPathInapplicable: isFieldControlPathInapplicable,
|
|
@@ -2072,7 +2169,9 @@ const CommonUtils = {
|
|
|
2072
2169
|
},
|
|
2073
2170
|
AllowedExpressionsPrio: ["SingleValue", "MultiValue", "SingleRange", "MultiRange", "SearchExpression", "MultiRangeOrSearchExpression"],
|
|
2074
2171
|
fnProcessDataLossOrDraftDiscardConfirmation: fnProcessDataLossOrDraftDiscardConfirmation,
|
|
2075
|
-
normalizeSearchTerm: normalizeSearchTerm
|
|
2172
|
+
normalizeSearchTerm: normalizeSearchTerm,
|
|
2173
|
+
fnOnStrictHandlingFailed: fnOnStrictHandlingFailed,
|
|
2174
|
+
getSingletonPath: getSingletonPath
|
|
2076
2175
|
};
|
|
2077
2176
|
|
|
2078
2177
|
export default CommonUtils;
|