@sapui5/sap.fe.core 1.97.0 → 1.99.1
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 -4
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AnnotationHelper.js +377 -405
- package/src/sap/fe/core/AnnotationHelper.ts +385 -0
- package/src/sap/fe/core/AppComponent.js +6 -3
- package/src/sap/fe/core/AppStateHandler.js +229 -181
- package/src/sap/fe/core/AppStateHandler.ts +171 -0
- package/src/sap/fe/core/BaseController.js +3 -2
- package/src/sap/fe/core/BusyLocker.js +105 -121
- package/src/sap/fe/core/BusyLocker.ts +98 -0
- package/src/sap/fe/core/CommonUtils.js +2073 -2379
- package/src/sap/fe/core/CommonUtils.ts +2078 -0
- package/src/sap/fe/core/ExtensionAPI.js +16 -7
- package/src/sap/fe/core/PageController.js +84 -119
- package/src/sap/fe/core/PageController.ts +101 -0
- package/src/sap/fe/core/RouterProxy.js +986 -807
- package/src/sap/fe/core/RouterProxy.ts +838 -0
- package/src/sap/fe/core/Synchronization.js +51 -35
- package/src/sap/fe/core/Synchronization.ts +29 -0
- package/src/sap/fe/core/TemplateComponent.js +173 -155
- package/src/sap/fe/core/TemplateComponent.ts +166 -0
- package/src/sap/fe/core/TemplateModel.js +97 -54
- package/src/sap/fe/core/TemplateModel.ts +64 -0
- package/src/sap/fe/core/TransactionHelper.js +1576 -1579
- package/src/sap/fe/core/TransactionHelper.ts +1706 -0
- package/src/sap/fe/core/actions/draft.js +560 -581
- package/src/sap/fe/core/actions/draft.ts +594 -0
- package/src/sap/fe/core/actions/messageHandling.js +545 -511
- package/src/sap/fe/core/actions/messageHandling.ts +532 -0
- package/src/sap/fe/core/actions/nonDraft.js +17 -19
- package/src/sap/fe/core/actions/nonDraft.ts +12 -0
- package/src/sap/fe/core/actions/operations.js +1074 -1211
- package/src/sap/fe/core/actions/operations.ts +1162 -0
- package/src/sap/fe/core/actions/sticky.js +102 -105
- package/src/sap/fe/core/actions/sticky.ts +102 -0
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +3 -2
- package/src/sap/fe/core/controllerextensions/EditFlow.js +229 -260
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +3 -2
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +288 -13
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +27 -23
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +82 -46
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +113 -25
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +135 -44
- package/src/sap/fe/core/controllerextensions/MassEdit.js +172 -0
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +22 -9
- package/src/sap/fe/core/controllerextensions/PageReady.js +3 -3
- package/src/sap/fe/core/controllerextensions/PageReady.ts +12 -8
- package/src/sap/fe/core/controllerextensions/Paginator.js +37 -9
- package/src/sap/fe/core/controllerextensions/Placeholder.js +8 -4
- package/src/sap/fe/core/controllerextensions/Routing.js +25 -5
- package/src/sap/fe/core/controllerextensions/RoutingListener.js +3 -2
- package/src/sap/fe/core/controllerextensions/Share.js +22 -8
- package/src/sap/fe/core/controllerextensions/SideEffects.js +9 -9
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +22 -21
- package/src/sap/fe/core/controllerextensions/ViewState.js +3 -2
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +2 -1
- package/src/sap/fe/core/controls/CommandExecution.js +3 -2
- package/src/sap/fe/core/controls/ConditionalWrapper.js +3 -2
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +3 -2
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +9 -5
- package/src/sap/fe/core/controls/FieldWrapper.js +18 -23
- package/src/sap/fe/core/controls/FilterBar.js +3 -2
- package/src/sap/fe/core/controls/FormElementWrapper.js +3 -7
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +3 -2
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +2 -1
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +3 -2
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +5 -4
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -2
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +3 -2
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +106 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +79 -0
- package/src/sap/fe/core/converters/ConverterContext.js +14 -2
- package/src/sap/fe/core/converters/ConverterContext.ts +14 -3
- package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +4 -0
- package/src/sap/fe/core/converters/ManifestWrapper.js +56 -32
- package/src/sap/fe/core/converters/ManifestWrapper.ts +24 -6
- package/src/sap/fe/core/converters/MetaModelConverter.js +67 -6
- package/src/sap/fe/core/converters/MetaModelConverter.ts +70 -14
- package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
- package/src/sap/fe/core/converters/TemplateConverter.ts +2 -2
- package/src/sap/fe/core/converters/annotations/DataField.js +3 -3
- package/src/sap/fe/core/converters/annotations/DataField.ts +1 -1
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +33 -21
- package/src/sap/fe/core/converters/controls/Common/Action.js +11 -2
- package/src/sap/fe/core/converters/controls/Common/Action.ts +8 -2
- package/src/sap/fe/core/converters/controls/Common/Chart.js +5 -3
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +11 -3
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +3 -3
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +2 -2
- package/src/sap/fe/core/converters/controls/Common/Form.js +20 -10
- package/src/sap/fe/core/converters/controls/Common/Form.ts +24 -4
- package/src/sap/fe/core/converters/controls/Common/KPI.js +69 -4
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +72 -0
- package/src/sap/fe/core/converters/controls/Common/Table.js +390 -398
- package/src/sap/fe/core/converters/controls/Common/Table.ts +497 -484
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +527 -0
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +655 -0
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +489 -37
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +506 -58
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +2 -2
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +1 -1
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +17 -9
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +24 -9
- package/src/sap/fe/core/converters/helpers/Aggregation.js +18 -3
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +28 -5
- package/src/sap/fe/core/converters/helpers/IssueManager.js +7 -1
- package/src/sap/fe/core/converters/helpers/IssueManager.ts +6 -0
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +4 -4
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +3 -3
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +13 -6
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +26 -15
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +11 -2
- package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
- package/src/sap/fe/core/formatters/CriticalityFormatter.ts +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.ts +4 -10
- package/src/sap/fe/core/formatters/KPIFormatter.js +1 -1
- package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -1
- package/src/sap/fe/core/formatters/TableFormatter.js +39 -28
- package/src/sap/fe/core/formatters/TableFormatter.ts +43 -28
- package/src/sap/fe/core/formatters/ValueFormatter.js +30 -5
- package/src/sap/fe/core/formatters/ValueFormatter.ts +30 -7
- package/src/sap/fe/core/fpm/Component.js +3 -2
- package/src/sap/fe/core/helpers/AppStartupHelper.js +359 -0
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +391 -0
- package/src/sap/fe/core/helpers/BindingExpression.js +484 -437
- package/src/sap/fe/core/helpers/BindingExpression.ts +480 -463
- package/src/sap/fe/core/helpers/ClassSupport.js +27 -15
- package/src/sap/fe/core/helpers/ClassSupport.ts +31 -20
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +63 -59
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +56 -0
- package/src/sap/fe/core/helpers/EditState.js +81 -84
- package/src/sap/fe/core/helpers/EditState.ts +81 -0
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +62 -48
- package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +49 -0
- package/src/sap/fe/core/helpers/FPMHelper.js +52 -56
- package/src/sap/fe/core/helpers/FPMHelper.ts +62 -0
- package/src/sap/fe/core/helpers/KeepAliveHelper.js +4 -5
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +10 -10
- package/src/sap/fe/core/helpers/MassEditHelper.js +687 -0
- package/src/sap/fe/core/helpers/ModelHelper.js +229 -225
- package/src/sap/fe/core/helpers/ModelHelper.ts +227 -0
- package/src/sap/fe/core/helpers/PasteHelper.js +210 -132
- package/src/sap/fe/core/helpers/PasteHelper.ts +196 -0
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +332 -313
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +330 -0
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +66 -67
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +73 -0
- package/src/sap/fe/core/helpers/StableIdHelper.js +4 -7
- package/src/sap/fe/core/helpers/StableIdHelper.ts +2 -6
- package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx.ts +1 -1
- package/src/sap/fe/core/library.js +30 -3
- package/src/sap/fe/core/library.support.js +12 -5
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +62 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +66 -0
- package/src/sap/fe/core/messagebundle.properties +61 -13
- package/src/sap/fe/core/messagebundle_ar.properties +33 -2
- package/src/sap/fe/core/messagebundle_bg.properties +33 -2
- package/src/sap/fe/core/messagebundle_ca.properties +33 -2
- package/src/sap/fe/core/messagebundle_cs.properties +34 -3
- package/src/sap/fe/core/messagebundle_cy.properties +33 -2
- package/src/sap/fe/core/messagebundle_da.properties +33 -2
- package/src/sap/fe/core/messagebundle_de.properties +33 -2
- package/src/sap/fe/core/messagebundle_el.properties +33 -2
- package/src/sap/fe/core/messagebundle_en.properties +32 -1
- package/src/sap/fe/core/messagebundle_en_GB.properties +32 -1
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +36 -1
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +33 -2
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +33 -2
- package/src/sap/fe/core/messagebundle_es.properties +33 -2
- package/src/sap/fe/core/messagebundle_es_MX.properties +33 -2
- package/src/sap/fe/core/messagebundle_et.properties +33 -2
- package/src/sap/fe/core/messagebundle_fi.properties +34 -3
- package/src/sap/fe/core/messagebundle_fr.properties +38 -7
- package/src/sap/fe/core/messagebundle_fr_CA.properties +33 -2
- package/src/sap/fe/core/messagebundle_hi.properties +33 -2
- package/src/sap/fe/core/messagebundle_hr.properties +33 -2
- package/src/sap/fe/core/messagebundle_hu.properties +34 -3
- package/src/sap/fe/core/messagebundle_id.properties +36 -5
- package/src/sap/fe/core/messagebundle_it.properties +33 -2
- package/src/sap/fe/core/messagebundle_iw.properties +33 -2
- package/src/sap/fe/core/messagebundle_ja.properties +33 -2
- package/src/sap/fe/core/messagebundle_kk.properties +33 -2
- package/src/sap/fe/core/messagebundle_ko.properties +33 -2
- package/src/sap/fe/core/messagebundle_lt.properties +33 -2
- package/src/sap/fe/core/messagebundle_lv.properties +33 -2
- package/src/sap/fe/core/messagebundle_ms.properties +33 -2
- package/src/sap/fe/core/messagebundle_nl.properties +33 -2
- package/src/sap/fe/core/messagebundle_no.properties +33 -2
- package/src/sap/fe/core/messagebundle_pl.properties +33 -2
- package/src/sap/fe/core/messagebundle_pt.properties +34 -3
- package/src/sap/fe/core/messagebundle_pt_PT.properties +33 -2
- package/src/sap/fe/core/messagebundle_ro.properties +33 -2
- package/src/sap/fe/core/messagebundle_ru.properties +33 -2
- package/src/sap/fe/core/messagebundle_sh.properties +33 -2
- package/src/sap/fe/core/messagebundle_sk.properties +33 -2
- package/src/sap/fe/core/messagebundle_sl.properties +33 -2
- package/src/sap/fe/core/messagebundle_sv.properties +34 -3
- package/src/sap/fe/core/messagebundle_th.properties +33 -2
- package/src/sap/fe/core/messagebundle_tr.properties +33 -2
- package/src/sap/fe/core/messagebundle_uk.properties +33 -2
- package/src/sap/fe/core/messagebundle_vi.properties +33 -2
- package/src/sap/fe/core/messagebundle_zh_CN.properties +33 -2
- package/src/sap/fe/core/messagebundle_zh_TW.properties +33 -2
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +269 -202
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +212 -0
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +4 -3
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +9 -5
- package/src/sap/fe/core/services/NavigationServiceFactory.js +406 -300
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +316 -0
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +149 -81
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +80 -0
- package/src/sap/fe/core/services/RoutingServiceFactory.js +987 -1152
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +898 -0
- package/src/sap/fe/core/services/ShellServicesFactory.js +31 -2
- package/src/sap/fe/core/services/ShellServicesFactory.ts +45 -11
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +42 -85
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +57 -100
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +461 -478
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +453 -0
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +10 -8
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +8 -0
- package/src/sap/fe/core/support/AnnotationIssue.support.js +15 -3
- package/src/sap/fe/core/support/AnnotationIssue.support.ts +16 -2
- package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -2
- package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.ts +1 -1
- package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.js +38 -0
- package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.ts +18 -0
- package/src/sap/fe/core/templating/DataModelPathHelper.js +10 -48
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +14 -46
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +114 -0
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +86 -0
- package/src/sap/fe/core/templating/FieldControlHelper.js +8 -8
- package/src/sap/fe/core/templating/FieldControlHelper.ts +25 -7
- package/src/sap/fe/core/templating/FilterHelper.js +139 -70
- package/src/sap/fe/core/templating/FilterHelper.ts +140 -70
- 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 +45 -110
- package/src/sap/fe/core/templating/UIFormatters.ts +39 -75
- package/src/sap/fe/core/type/Email.js +1 -1
- package/src/sap/fe/core/type/Email.ts +4 -6
- package/ui5.yaml +0 -3
- package/src/sap/fe/core/controls/filterbar.d.js +0 -8
- package/src/sap/fe/core/controls/filterbar.d.ts +0 -0
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
import MessageToast from "sap/m/MessageToast";
|
|
2
|
+
import MessageItem from "sap/m/MessageItem";
|
|
3
|
+
import MessageView from "sap/m/MessageView";
|
|
4
|
+
import Button from "sap/m/Button";
|
|
5
|
+
import Dialog from "sap/m/Dialog";
|
|
6
|
+
import Text from "sap/m/Text";
|
|
7
|
+
import CoreLib from "sap/ui/core/library";
|
|
8
|
+
import Filter from "sap/ui/model/Filter";
|
|
9
|
+
import FilterOperator from "sap/ui/model/FilterOperator";
|
|
10
|
+
import Message from "sap/ui/core/message/Message";
|
|
11
|
+
import IconPool from "sap/ui/core/IconPool";
|
|
12
|
+
import JSONModel from "sap/ui/model/json/JSONModel";
|
|
13
|
+
import DateFormat from "sap/ui/core/format/DateFormat";
|
|
14
|
+
import ResourceBundle from "sap/base/i18n/ResourceBundle";
|
|
15
|
+
import Control from "sap/ui/mdc/Control";
|
|
16
|
+
import ManagedObject from "sap/ui/base/ManagedObject";
|
|
17
|
+
import Bar from "sap/m/Bar";
|
|
18
|
+
import MessageBox from "sap/m/MessageBox";
|
|
19
|
+
import FormattedText from "sap/m/FormattedText";
|
|
20
|
+
|
|
21
|
+
const MessageType = CoreLib.MessageType;
|
|
22
|
+
let aMessageList: any[] = [];
|
|
23
|
+
let aMessageDataList: any[] = [];
|
|
24
|
+
let aResolveFunctions: any[] = [];
|
|
25
|
+
let oDialog: Dialog;
|
|
26
|
+
let oBackButton: Button;
|
|
27
|
+
let oMessageTemplate: MessageItem;
|
|
28
|
+
let oMessageView: MessageView;
|
|
29
|
+
|
|
30
|
+
export type messageHandlingType = {
|
|
31
|
+
getMessages: (bBoundMessages?: any, bTransitionOnly?: any) => any[];
|
|
32
|
+
showUnboundMessages: (
|
|
33
|
+
aCustomMessages?: any[],
|
|
34
|
+
oContext?: any,
|
|
35
|
+
bHasEtagMessage?: boolean,
|
|
36
|
+
bShowBoundTransition?: boolean
|
|
37
|
+
) => Promise<any>;
|
|
38
|
+
removeUnboundTransitionMessages: () => void;
|
|
39
|
+
removeBoundTransitionMessages: () => void;
|
|
40
|
+
modifyETagMessagesOnly: (oMessageManager: any, oResourceBundle: any) => boolean;
|
|
41
|
+
getRetryAfterMessage: (oMessage: any, bMessageDialog?: any) => any;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
function fnFormatTechnicalDetails() {
|
|
45
|
+
let sPreviousGroupName: string;
|
|
46
|
+
|
|
47
|
+
// Insert technical detail if it exists
|
|
48
|
+
function insertDetail(oProperty: any) {
|
|
49
|
+
return oProperty.property
|
|
50
|
+
? "( ${" +
|
|
51
|
+
oProperty.property +
|
|
52
|
+
'} ? ("<p>' +
|
|
53
|
+
oProperty.property.substr(Math.max(oProperty.property.lastIndexOf("/"), oProperty.property.lastIndexOf(".")) + 1) +
|
|
54
|
+
' : " + ' +
|
|
55
|
+
"${" +
|
|
56
|
+
oProperty.property +
|
|
57
|
+
'} + "</p>") : "" )'
|
|
58
|
+
: "";
|
|
59
|
+
}
|
|
60
|
+
// Insert groupname if it exists
|
|
61
|
+
function insertGroupName(oProperty: any) {
|
|
62
|
+
let sHTML = "";
|
|
63
|
+
if (oProperty.groupName && oProperty.property && oProperty.groupName !== sPreviousGroupName) {
|
|
64
|
+
sHTML += "( ${" + oProperty.property + '} ? "<br><h3>' + oProperty.groupName + '</h3>" : "" ) + ';
|
|
65
|
+
sPreviousGroupName = oProperty.groupName;
|
|
66
|
+
}
|
|
67
|
+
return sHTML;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// List of technical details to be shown
|
|
71
|
+
function getPaths() {
|
|
72
|
+
const sTD = "technicalDetails"; // name of property in message model data for technical details
|
|
73
|
+
return [
|
|
74
|
+
{ "groupName": "", "property": sTD + "/status" },
|
|
75
|
+
{ "groupName": "", "property": sTD + "/statusText" },
|
|
76
|
+
{ "groupName": "Application", "property": sTD + "/error/@SAP__common.Application/ComponentId" },
|
|
77
|
+
{ "groupName": "Application", "property": sTD + "/error/@SAP__common.Application/ServiceId" },
|
|
78
|
+
{ "groupName": "Application", "property": sTD + "/error/@SAP__common.Application/ServiceRepository" },
|
|
79
|
+
{ "groupName": "Application", "property": sTD + "/error/@SAP__common.Application/ServiceVersion" },
|
|
80
|
+
{ "groupName": "ErrorResolution", "property": sTD + "/error/@SAP__common.ErrorResolution/Analysis" },
|
|
81
|
+
{ "groupName": "ErrorResolution", "property": sTD + "/error/@SAP__common.ErrorResolution/Note" },
|
|
82
|
+
{ "groupName": "ErrorResolution", "property": sTD + "/error/@SAP__common.ErrorResolution/DetailedNote" },
|
|
83
|
+
{ "groupName": "ErrorResolution", "property": sTD + "/error/@SAP__common.ExceptionCategory" },
|
|
84
|
+
{ "groupName": "ErrorResolution", "property": sTD + "/error/@SAP__common.TimeStamp" },
|
|
85
|
+
{ "groupName": "ErrorResolution", "property": sTD + "/error/@SAP__common.TransactionId" },
|
|
86
|
+
{ "groupName": "Messages", "property": sTD + "/error/code" },
|
|
87
|
+
{ "groupName": "Messages", "property": sTD + "/error/message" }
|
|
88
|
+
];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
let sHTML = "Object.keys(" + "${technicalDetails}" + ').length > 0 ? "<h2>Technical Details</h2>" : "" ';
|
|
92
|
+
getPaths().forEach(function(oProperty: { groupName: string; property: string }) {
|
|
93
|
+
sHTML = sHTML + insertGroupName(oProperty) + "" + insertDetail(oProperty) + " + ";
|
|
94
|
+
});
|
|
95
|
+
return sHTML;
|
|
96
|
+
}
|
|
97
|
+
function fnFormatDescription() {
|
|
98
|
+
const sHTML = "(${" + 'description} ? ("<h2>Description</h2>" + ${' + 'description}) : "")';
|
|
99
|
+
return sHTML;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Calculates the highest priority message type(Error/Warning/Success/Information) from the available messages.
|
|
103
|
+
|
|
104
|
+
* @function
|
|
105
|
+
* @name sap.fe.core.actions.messageHandling.fnGetHighestMessagePriority
|
|
106
|
+
* @memberof sap.fe.core.actions.messageHandling
|
|
107
|
+
* @param {Array} [aMessages] Messages list
|
|
108
|
+
* @returns {string} Highest priority message from the available messages
|
|
109
|
+
* @private
|
|
110
|
+
* @ui5-restricted
|
|
111
|
+
*/
|
|
112
|
+
function fnGetHighestMessagePriority(aMessages: any[]) {
|
|
113
|
+
let sMessagePriority = MessageType.None;
|
|
114
|
+
const iLength = aMessages.length;
|
|
115
|
+
const oMessageCount: any = { Error: 0, Warning: 0, Success: 0, Information: 0 };
|
|
116
|
+
|
|
117
|
+
for (let i = 0; i < iLength; i++) {
|
|
118
|
+
++oMessageCount[aMessages[i].getType()];
|
|
119
|
+
}
|
|
120
|
+
if (oMessageCount[MessageType.Error] > 0) {
|
|
121
|
+
sMessagePriority = MessageType.Error;
|
|
122
|
+
} else if (oMessageCount[MessageType.Warning] > 0) {
|
|
123
|
+
sMessagePriority = MessageType.Warning;
|
|
124
|
+
} else if (oMessageCount[MessageType.Success] > 0) {
|
|
125
|
+
sMessagePriority = MessageType.Success;
|
|
126
|
+
} else if (oMessageCount[MessageType.Information] > 0) {
|
|
127
|
+
sMessagePriority = MessageType.Information;
|
|
128
|
+
}
|
|
129
|
+
return sMessagePriority;
|
|
130
|
+
}
|
|
131
|
+
// function which modify e-Tag messages only.
|
|
132
|
+
// returns : true, if any e-Tag message is modified, otherwise false.
|
|
133
|
+
function fnModifyETagMessagesOnly(oMessageManager: any, oResourceBundle: any) {
|
|
134
|
+
const aMessages = oMessageManager.getMessageModel().getObject("/");
|
|
135
|
+
let bMessagesModified = false;
|
|
136
|
+
let sEtagMessage = "";
|
|
137
|
+
aMessages.forEach(function(oMessage: any, i: any) {
|
|
138
|
+
const oTechnicalDetails = oMessage.getTechnicalDetails();
|
|
139
|
+
if (oTechnicalDetails && oTechnicalDetails.httpStatus === 412) {
|
|
140
|
+
sEtagMessage = sEtagMessage || oResourceBundle.getText("C_APP_COMPONENT_SAPFE_ETAG_TECHNICAL_ISSUES");
|
|
141
|
+
oMessageManager.removeMessages(aMessages[i]);
|
|
142
|
+
oMessage.setMessage(sEtagMessage);
|
|
143
|
+
oMessage.target = "";
|
|
144
|
+
oMessageManager.addMessages(oMessage);
|
|
145
|
+
bMessagesModified = true;
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
return bMessagesModified;
|
|
149
|
+
}
|
|
150
|
+
// Dialog close Handling
|
|
151
|
+
function dialogCloseHandler() {
|
|
152
|
+
oDialog.close();
|
|
153
|
+
oBackButton.setVisible(false);
|
|
154
|
+
aMessageList = [];
|
|
155
|
+
removeUnboundTransitionMessages();
|
|
156
|
+
}
|
|
157
|
+
function getRetryAfterMessage(oMessage: any, bMessageDialog: any) {
|
|
158
|
+
const dNow = new Date();
|
|
159
|
+
const oTechnicalDetails = oMessage.getTechnicalDetails();
|
|
160
|
+
const oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.fe.core") as ResourceBundle;
|
|
161
|
+
let sRetryAfterMessage;
|
|
162
|
+
if (oTechnicalDetails && oTechnicalDetails.httpStatus === 503 && oTechnicalDetails.retryAfter) {
|
|
163
|
+
const dRetryAfter = oTechnicalDetails.retryAfter;
|
|
164
|
+
let oDateFormat;
|
|
165
|
+
if (dNow.getFullYear() !== dRetryAfter.getFullYear()) {
|
|
166
|
+
//different years
|
|
167
|
+
oDateFormat = DateFormat.getDateTimeInstance({
|
|
168
|
+
pattern: "MMMM dd, yyyy 'at' hh:mm a"
|
|
169
|
+
});
|
|
170
|
+
sRetryAfterMessage = oResourceBundle.getText("C_MESSAGE_HANDLING_SAPFE_503_ERROR", [oDateFormat.format(dRetryAfter)]);
|
|
171
|
+
} else if (dNow.getFullYear() == dRetryAfter.getFullYear()) {
|
|
172
|
+
//same year
|
|
173
|
+
if (bMessageDialog) {
|
|
174
|
+
//less than 2 min
|
|
175
|
+
sRetryAfterMessage =
|
|
176
|
+
oResourceBundle.getText("C_MESSAGE_HANDLING_SAPFE_503_TITLE") +
|
|
177
|
+
" " +
|
|
178
|
+
oResourceBundle.getText("C_MESSAGE_HANDLING_SAPFE_503_DESC");
|
|
179
|
+
} else if (dNow.getMonth() !== dRetryAfter.getMonth() || dNow.getDate() !== dRetryAfter.getDate()) {
|
|
180
|
+
oDateFormat = DateFormat.getDateTimeInstance({
|
|
181
|
+
pattern: "MMMM dd 'at' hh:mm a"
|
|
182
|
+
}); //different months or different days of same month
|
|
183
|
+
sRetryAfterMessage = oResourceBundle.getText("C_MESSAGE_HANDLING_SAPFE_503_ERROR", [oDateFormat.format(dRetryAfter)]);
|
|
184
|
+
} else {
|
|
185
|
+
//same day
|
|
186
|
+
oDateFormat = DateFormat.getDateTimeInstance({
|
|
187
|
+
pattern: "hh:mm a"
|
|
188
|
+
});
|
|
189
|
+
sRetryAfterMessage = oResourceBundle.getText("C_MESSAGE_HANDLING_SAPFE_503_ERROR_DAY", [oDateFormat.format(dRetryAfter)]);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (oTechnicalDetails && oTechnicalDetails.httpStatus === 503 && !oTechnicalDetails.retryAfter) {
|
|
195
|
+
sRetryAfterMessage = oResourceBundle.getText("C_MESSAGE_HANDLING_SAPFE_503_ERROR_NO_RETRY_AFTER");
|
|
196
|
+
}
|
|
197
|
+
return sRetryAfterMessage;
|
|
198
|
+
}
|
|
199
|
+
function showUnboundMessages(
|
|
200
|
+
this: messageHandlingType,
|
|
201
|
+
aCustomMessages?: any[],
|
|
202
|
+
oContext?: any,
|
|
203
|
+
bHasEtagMessage?: boolean,
|
|
204
|
+
bShowBoundTransition?: boolean
|
|
205
|
+
) {
|
|
206
|
+
let aUnboundMessages = this.getMessages();
|
|
207
|
+
const oMessageManager = (sap.ui.getCore() as any).getMessageManager();
|
|
208
|
+
let sHighestPriority;
|
|
209
|
+
let sHighestPriorityText;
|
|
210
|
+
const aFilters = [
|
|
211
|
+
new Filter({ path: "code", operator: FilterOperator.NE, value1: null }),
|
|
212
|
+
new Filter({ path: "persistent", operator: FilterOperator.NE, value1: false })
|
|
213
|
+
];
|
|
214
|
+
let showMessageDialog = false,
|
|
215
|
+
showMessageBox = false;
|
|
216
|
+
|
|
217
|
+
if (bShowBoundTransition) {
|
|
218
|
+
aUnboundMessages = aUnboundMessages.concat(getMessages(true, true));
|
|
219
|
+
// we only want to show bound transition messages not bound state messages hence add a filter for the same
|
|
220
|
+
aFilters.push(new Filter({ path: "persistent", operator: FilterOperator.EQ, value1: true }));
|
|
221
|
+
const fnCheckControlIdInDialog = function(aControlIds: any) {
|
|
222
|
+
let index = Infinity,
|
|
223
|
+
oControl = sap.ui.getCore().byId(aControlIds[0]) as ManagedObject;
|
|
224
|
+
const errorFieldControl = sap.ui.getCore().byId(aControlIds[0]) as Control;
|
|
225
|
+
while (oControl) {
|
|
226
|
+
const fieldRankinDialog =
|
|
227
|
+
oControl instanceof Dialog
|
|
228
|
+
? (errorFieldControl.getParent() as any).findElements(true).indexOf(errorFieldControl)
|
|
229
|
+
: Infinity;
|
|
230
|
+
if (oControl instanceof Dialog) {
|
|
231
|
+
if (index > fieldRankinDialog) {
|
|
232
|
+
index = fieldRankinDialog;
|
|
233
|
+
// Set the focus to the dialog's control
|
|
234
|
+
errorFieldControl.focus();
|
|
235
|
+
}
|
|
236
|
+
// messages with target inside sap.m.Dialog should not bring up the message dialog
|
|
237
|
+
return false;
|
|
238
|
+
}
|
|
239
|
+
oControl = oControl.getParent();
|
|
240
|
+
}
|
|
241
|
+
return true;
|
|
242
|
+
};
|
|
243
|
+
aFilters.push(
|
|
244
|
+
new Filter({
|
|
245
|
+
path: "controlIds",
|
|
246
|
+
test: fnCheckControlIdInDialog,
|
|
247
|
+
caseSensitive: true
|
|
248
|
+
})
|
|
249
|
+
);
|
|
250
|
+
} else {
|
|
251
|
+
// only unbound messages have to be shown so add filter accordingly
|
|
252
|
+
aFilters.push(new Filter({ path: "target", operator: FilterOperator.EQ, value1: "" }));
|
|
253
|
+
}
|
|
254
|
+
if (aCustomMessages && aCustomMessages.length) {
|
|
255
|
+
aCustomMessages.forEach(function(oMessage: any) {
|
|
256
|
+
const messageCode = oMessage.code ? oMessage.code : "";
|
|
257
|
+
oMessageManager.addMessages(
|
|
258
|
+
new Message({
|
|
259
|
+
message: oMessage.text,
|
|
260
|
+
type: oMessage.type,
|
|
261
|
+
target: "",
|
|
262
|
+
persistent: true,
|
|
263
|
+
code: messageCode
|
|
264
|
+
})
|
|
265
|
+
);
|
|
266
|
+
//The target and persistent properties of the message are hardcoded as "" and true because the function deals with only unbound messages.
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
const oMessageDialogModel = new JSONModel();
|
|
270
|
+
if (aUnboundMessages.length === 1 && aUnboundMessages[0].getCode() === "503") {
|
|
271
|
+
showMessageBox = true;
|
|
272
|
+
} else {
|
|
273
|
+
const oListBinding = oMessageManager.getMessageModel().bindList("/", undefined, undefined, aFilters),
|
|
274
|
+
aCurrentContexts = oListBinding.getCurrentContexts();
|
|
275
|
+
if (aCurrentContexts && aCurrentContexts.length > 0) {
|
|
276
|
+
// Don't show dialog incase there are no errors to show
|
|
277
|
+
showMessageDialog = true;
|
|
278
|
+
// As fitering has already happened here hence
|
|
279
|
+
// using the message model again for the message dialog view and then filtering on that binding again is unnecessary.
|
|
280
|
+
// So we create new json model to use for the message dialog view.
|
|
281
|
+
const aMessages: any[] = [];
|
|
282
|
+
aCurrentContexts.forEach(function(oContext: any) {
|
|
283
|
+
let oMessage;
|
|
284
|
+
if (
|
|
285
|
+
oContext.getObject().technicalDetails &&
|
|
286
|
+
aMessageList.indexOf(oContext.getObject().technicalDetails.originalMessage.message) === -1
|
|
287
|
+
) {
|
|
288
|
+
aMessageList.push(oContext.getObject().technicalDetails.originalMessage.message);
|
|
289
|
+
oMessage = oContext.getObject();
|
|
290
|
+
aMessages.push(oMessage);
|
|
291
|
+
aMessageDataList = aMessages;
|
|
292
|
+
} else if (!oContext.getObject().technicalDetails) {
|
|
293
|
+
oMessage = oContext.getObject();
|
|
294
|
+
aMessages.push(oMessage);
|
|
295
|
+
aMessageDataList = aMessages;
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
// if(aMessages.length === 0 && aMessageList.length) {
|
|
299
|
+
// oMessageDialogModel.setData(aMessages);
|
|
300
|
+
// }
|
|
301
|
+
oMessageDialogModel.setData(aMessageDataList);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
if (aUnboundMessages.length === 0 && !aCustomMessages && !bHasEtagMessage) {
|
|
305
|
+
// Don't show the popup if there are no transient messages
|
|
306
|
+
return Promise.resolve(true);
|
|
307
|
+
} else if (aUnboundMessages.length === 1 && aUnboundMessages[0].getType() === MessageType.Success && !aCustomMessages) {
|
|
308
|
+
return new Promise<void>(resolve => {
|
|
309
|
+
MessageToast.show(aUnboundMessages[0].message);
|
|
310
|
+
oMessageManager.removeMessages(aUnboundMessages);
|
|
311
|
+
resolve();
|
|
312
|
+
});
|
|
313
|
+
} else if (showMessageDialog) {
|
|
314
|
+
aResolveFunctions = aResolveFunctions || [];
|
|
315
|
+
return new Promise(function(resolve: (value: any) => void, reject: (reason?: any) => void) {
|
|
316
|
+
aResolveFunctions.push(resolve);
|
|
317
|
+
(sap.ui.getCore().getLibraryResourceBundle("sap.fe.core", true) as Promise<ResourceBundle>)
|
|
318
|
+
.then(function(oResourceBundle: any) {
|
|
319
|
+
oMessageTemplate =
|
|
320
|
+
oMessageTemplate ||
|
|
321
|
+
new MessageItem(undefined, {
|
|
322
|
+
counter: { path: "counter" },
|
|
323
|
+
title: "{message}",
|
|
324
|
+
subtitle: "{additionalText}",
|
|
325
|
+
longtextUrl: "{descriptionUrl}",
|
|
326
|
+
type: { path: "type" },
|
|
327
|
+
description:
|
|
328
|
+
"{= ${" +
|
|
329
|
+
"description} || ${technicalDetails} ? " +
|
|
330
|
+
'"<html><body>" + ' +
|
|
331
|
+
fnFormatDescription() +
|
|
332
|
+
" + " +
|
|
333
|
+
fnFormatTechnicalDetails() +
|
|
334
|
+
'"</body></html>"' +
|
|
335
|
+
' : "" }',
|
|
336
|
+
markupDescription: true
|
|
337
|
+
});
|
|
338
|
+
oMessageView =
|
|
339
|
+
oMessageView ||
|
|
340
|
+
new MessageView({
|
|
341
|
+
showDetailsPageHeader: false,
|
|
342
|
+
itemSelect: function() {
|
|
343
|
+
oBackButton.setVisible(true);
|
|
344
|
+
},
|
|
345
|
+
items: {
|
|
346
|
+
path: "/",
|
|
347
|
+
template: oMessageTemplate
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
oBackButton =
|
|
351
|
+
oBackButton ||
|
|
352
|
+
new Button({
|
|
353
|
+
icon: IconPool.getIconURI("nav-back"),
|
|
354
|
+
visible: false,
|
|
355
|
+
press: function(this: Button) {
|
|
356
|
+
oMessageView.navigateBack();
|
|
357
|
+
this.setVisible(false);
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
// Update proper ETag Mismatch error
|
|
361
|
+
const bHasEtagMessage = fnModifyETagMessagesOnly(oMessageManager, oResourceBundle);
|
|
362
|
+
oMessageView.setModel(oMessageDialogModel);
|
|
363
|
+
oDialog =
|
|
364
|
+
oDialog ||
|
|
365
|
+
new Dialog({
|
|
366
|
+
resizable: true,
|
|
367
|
+
content: oMessageView,
|
|
368
|
+
endButton: new Button({
|
|
369
|
+
press: function() {
|
|
370
|
+
dialogCloseHandler();
|
|
371
|
+
// also remove bound transition messages if we were showing them
|
|
372
|
+
if (bShowBoundTransition) {
|
|
373
|
+
removeBoundTransitionMessages();
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
text: oResourceBundle.getText("C_COMMON_SAPFE_CLOSE")
|
|
377
|
+
}),
|
|
378
|
+
customHeader: new Bar({
|
|
379
|
+
contentMiddle: [
|
|
380
|
+
new Text({
|
|
381
|
+
text: oResourceBundle.getText("C_MESSAGE_HANDLING_SAPFE_ERROR_MESSAGES_PAGE_TITLE")
|
|
382
|
+
})
|
|
383
|
+
],
|
|
384
|
+
contentLeft: [oBackButton]
|
|
385
|
+
}),
|
|
386
|
+
contentWidth: "37.5em",
|
|
387
|
+
contentHeight: "21.5em",
|
|
388
|
+
verticalScrolling: false,
|
|
389
|
+
afterClose: function() {
|
|
390
|
+
for (let i = 0; i < aResolveFunctions.length; i++) {
|
|
391
|
+
aResolveFunctions[i].call();
|
|
392
|
+
}
|
|
393
|
+
aResolveFunctions = [];
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
if (bHasEtagMessage) {
|
|
398
|
+
sap.ui.require(["sap/m/ButtonType"], function(ButtonType: any) {
|
|
399
|
+
oDialog.setBeginButton(
|
|
400
|
+
new Button({
|
|
401
|
+
press: function() {
|
|
402
|
+
dialogCloseHandler();
|
|
403
|
+
if (oContext.hasPendingChanges()) {
|
|
404
|
+
oContext.getBinding().resetChanges();
|
|
405
|
+
}
|
|
406
|
+
oContext.refresh();
|
|
407
|
+
},
|
|
408
|
+
text: oResourceBundle.getText("C_COMMON_SAPFE_REFRESH"),
|
|
409
|
+
type: ButtonType.Emphasized
|
|
410
|
+
})
|
|
411
|
+
);
|
|
412
|
+
});
|
|
413
|
+
} else {
|
|
414
|
+
oDialog.destroyBeginButton();
|
|
415
|
+
}
|
|
416
|
+
sHighestPriority = fnGetHighestMessagePriority(oMessageView.getItems());
|
|
417
|
+
sHighestPriorityText = getTranslatedTextForMessageDialog(sHighestPriority);
|
|
418
|
+
oDialog.setState(sHighestPriority);
|
|
419
|
+
(oDialog.getCustomHeader() as any).getContentMiddle()[0].setText(sHighestPriorityText);
|
|
420
|
+
oMessageView.navigateBack();
|
|
421
|
+
oDialog.open();
|
|
422
|
+
})
|
|
423
|
+
.catch(reject);
|
|
424
|
+
});
|
|
425
|
+
} else if (showMessageBox) {
|
|
426
|
+
return new Promise(function(resolve) {
|
|
427
|
+
const oMessage = aUnboundMessages[0];
|
|
428
|
+
if (oMessage.technicalDetails && aMessageList.indexOf(oMessage.technicalDetails.originalMessage.message) === -1) {
|
|
429
|
+
aMessageList.push(oMessage.technicalDetails.originalMessage.message);
|
|
430
|
+
let formattedTextString = "<html><body>";
|
|
431
|
+
const retryAfterMessage = getRetryAfterMessage(oMessage, true);
|
|
432
|
+
if (retryAfterMessage) {
|
|
433
|
+
formattedTextString = "<h6>" + retryAfterMessage + "</h6><br>";
|
|
434
|
+
}
|
|
435
|
+
formattedTextString = formattedTextString + oMessage.getMessage() + "</html></body>";
|
|
436
|
+
const formattedText: any = new FormattedText({
|
|
437
|
+
htmlText: formattedTextString
|
|
438
|
+
});
|
|
439
|
+
MessageBox.error(formattedText, {
|
|
440
|
+
onClose: function() {
|
|
441
|
+
aMessageList = [];
|
|
442
|
+
if (bShowBoundTransition) {
|
|
443
|
+
removeBoundTransitionMessages();
|
|
444
|
+
}
|
|
445
|
+
removeUnboundTransitionMessages();
|
|
446
|
+
resolve(true);
|
|
447
|
+
}
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
} else {
|
|
452
|
+
return Promise.resolve(true);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
function getTranslatedTextForMessageDialog(sHighestPriority: any) {
|
|
456
|
+
const oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.fe.core") as ResourceBundle;
|
|
457
|
+
switch (sHighestPriority) {
|
|
458
|
+
case "Error":
|
|
459
|
+
return oResourceBundle.getText("C_COMMON_SAPFE_ERROR_MESSAGES_PAGE_TITLE_ERROR");
|
|
460
|
+
case "Information":
|
|
461
|
+
return oResourceBundle.getText("C_MESSAGE_HANDLING_SAPFE_ERROR_MESSAGES_PAGE_TITLE_INFO");
|
|
462
|
+
case "Success":
|
|
463
|
+
return oResourceBundle.getText("C_MESSAGE_HANDLING_SAPFE_ERROR_MESSAGES_PAGE_TITLE_SUCCESS");
|
|
464
|
+
case "Warning":
|
|
465
|
+
return oResourceBundle.getText("C_MESSAGE_HANDLING_SAPFE_ERROR_MESSAGES_PAGE_TITLE_WARNING");
|
|
466
|
+
default:
|
|
467
|
+
return oResourceBundle.getText("C_MESSAGE_HANDLING_SAPFE_ERROR_MESSAGES_PAGE_TITLE");
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
function removeUnboundTransitionMessages() {
|
|
471
|
+
removeTransitionMessages(false);
|
|
472
|
+
}
|
|
473
|
+
function removeBoundTransitionMessages() {
|
|
474
|
+
removeTransitionMessages(true);
|
|
475
|
+
}
|
|
476
|
+
function getMessages(bBoundMessages: boolean = false, bTransitionOnly: boolean = false) {
|
|
477
|
+
let i;
|
|
478
|
+
const oMessageManager = (sap.ui.getCore() as any).getMessageManager(),
|
|
479
|
+
oMessageModel = oMessageManager.getMessageModel(),
|
|
480
|
+
aMessages = oMessageModel.getObject("/"),
|
|
481
|
+
oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.fe.core") as ResourceBundle,
|
|
482
|
+
aTransitionMessages = [];
|
|
483
|
+
|
|
484
|
+
for (i = 0; i < aMessages.length; i++) {
|
|
485
|
+
if (
|
|
486
|
+
(!bTransitionOnly || aMessages[i].persistent) &&
|
|
487
|
+
((bBoundMessages && aMessages[i].target !== "") || (!bBoundMessages && (!aMessages[i].target || aMessages[i].target === ""))) &&
|
|
488
|
+
aMessages[i].code
|
|
489
|
+
) {
|
|
490
|
+
aTransitionMessages.push(aMessages[i]);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
for (i = 0; i < aTransitionMessages.length; i++) {
|
|
495
|
+
if (
|
|
496
|
+
aTransitionMessages[i].code === "503" &&
|
|
497
|
+
aTransitionMessages[i].message !== "" &&
|
|
498
|
+
aTransitionMessages[i].message.indexOf(oResourceBundle.getText("C_MESSAGE_HANDLING_SAPFE_503_BACKEND_PREFIX")) === -1
|
|
499
|
+
) {
|
|
500
|
+
aTransitionMessages[i].message =
|
|
501
|
+
"\n" + oResourceBundle.getText("C_MESSAGE_HANDLING_SAPFE_503_BACKEND_PREFIX") + aTransitionMessages[i].message;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
return aTransitionMessages;
|
|
505
|
+
}
|
|
506
|
+
function removeTransitionMessages(bBoundMessages: any) {
|
|
507
|
+
const aMessagesToBeDeleted = getMessages(bBoundMessages, true);
|
|
508
|
+
|
|
509
|
+
if (aMessagesToBeDeleted.length > 0) {
|
|
510
|
+
(sap.ui.getCore() as any).getMessageManager().removeMessages(aMessagesToBeDeleted);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Static functions for Fiori Message Handling
|
|
516
|
+
*
|
|
517
|
+
* @namespace
|
|
518
|
+
* @alias sap.fe.core.actions.messageHandling
|
|
519
|
+
* @private
|
|
520
|
+
* @experimental This module is only for experimental use! <br/><b>This is only a POC and maybe deleted</b>
|
|
521
|
+
* @since 1.56.0
|
|
522
|
+
*/
|
|
523
|
+
const messageHandling: messageHandlingType = {
|
|
524
|
+
getMessages: getMessages,
|
|
525
|
+
showUnboundMessages: showUnboundMessages,
|
|
526
|
+
removeUnboundTransitionMessages: removeUnboundTransitionMessages,
|
|
527
|
+
removeBoundTransitionMessages: removeBoundTransitionMessages,
|
|
528
|
+
modifyETagMessagesOnly: fnModifyETagMessagesOnly,
|
|
529
|
+
getRetryAfterMessage: getRetryAfterMessage
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
export default messageHandling;
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SAPUI5
|
|
3
|
-
*
|
|
2
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
* (c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
4
|
*/
|
|
5
|
+
sap.ui.define([], function () {
|
|
6
|
+
"use strict";
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var nonDraft = {};
|
|
20
|
-
|
|
21
|
-
return nonDraft;
|
|
22
|
-
});
|
|
8
|
+
/**
|
|
9
|
+
* Static functions for the non-draft programming model
|
|
10
|
+
*
|
|
11
|
+
* @namespace
|
|
12
|
+
* @alias sap.fe.core.actions.nonDraft
|
|
13
|
+
* @private
|
|
14
|
+
* @experimental This module is only for experimental use! <br/><b>This is only a POC and maybe deleted</b>
|
|
15
|
+
* @since 1.54.0
|
|
16
|
+
*/
|
|
17
|
+
var nonDraft = {};
|
|
18
|
+
return nonDraft;
|
|
19
|
+
}, false);
|
|
20
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vbkRyYWZ0LnRzIl0sIm5hbWVzIjpbIm5vbkRyYWZ0Il0sIm1hcHBpbmdzIjoiO0FBQUE7QUFDQTtBQUNBOzs7O0FBRkE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsTUFBTUEsUUFBUSxHQUFHLEVBQWpCO1NBRWVBLFEiLCJzb3VyY2VSb290IjoiLiIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogU3RhdGljIGZ1bmN0aW9ucyBmb3IgdGhlIG5vbi1kcmFmdCBwcm9ncmFtbWluZyBtb2RlbFxuICpcbiAqIEBuYW1lc3BhY2VcbiAqIEBhbGlhcyBzYXAuZmUuY29yZS5hY3Rpb25zLm5vbkRyYWZ0XG4gKiBAcHJpdmF0ZVxuICogQGV4cGVyaW1lbnRhbCBUaGlzIG1vZHVsZSBpcyBvbmx5IGZvciBleHBlcmltZW50YWwgdXNlISA8YnIvPjxiPlRoaXMgaXMgb25seSBhIFBPQyBhbmQgbWF5YmUgZGVsZXRlZDwvYj5cbiAqIEBzaW5jZSAxLjU0LjBcbiAqL1xuY29uc3Qgbm9uRHJhZnQgPSB7fTtcblxuZXhwb3J0IGRlZmF1bHQgbm9uRHJhZnQ7XG4iXX0=
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static functions for the non-draft programming model
|
|
3
|
+
*
|
|
4
|
+
* @namespace
|
|
5
|
+
* @alias sap.fe.core.actions.nonDraft
|
|
6
|
+
* @private
|
|
7
|
+
* @experimental This module is only for experimental use! <br/><b>This is only a POC and maybe deleted</b>
|
|
8
|
+
* @since 1.54.0
|
|
9
|
+
*/
|
|
10
|
+
const nonDraft = {};
|
|
11
|
+
|
|
12
|
+
export default nonDraft;
|