@sapui5/sap.suite.ui.generic.template 1.129.1 → 1.130.2
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 -3
- package/src/sap/suite/ui/generic/template/.library +5 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/Component.js +1 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/controller/VisualFilterDialogController.js +1 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/Canvas/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/Component.js +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/controller/ControllerImplementation.js +22 -11
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_bg.properties +3 -3
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_hu.properties +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_th.properties +2 -2
- package/src/sap/suite/ui/generic/template/ListReport/manifest.json +5 -2
- package/src/sap/suite/ui/generic/template/ListReport/view/fragments/DefaultVariant.fragment.xml +7 -8
- package/src/sap/suite/ui/generic/template/ListReport/view/fragments/MultipleViewsSingleTableMode.fragment.xml +4 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/Component.js +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/controller/RelatedAppsHandler.js +21 -9
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_es.properties +2 -2
- package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/templateSpecificPreparationHelper.js +90 -42
- package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/MultipleViewsSingleTableMode.fragment.xml +3 -0
- package/src/sap/suite/ui/generic/template/QuickCreate/i18n/i18n_fr_CA.properties +1 -1
- package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/designtime/controls/SmartTable.designtime.js +379 -0
- package/src/sap/suite/ui/generic/template/designtime/{AnalyticalListPage.designtime.js → floorplans/AnalyticalListPage.designtime.js} +4 -4
- package/src/sap/suite/ui/generic/template/designtime/{ListReport.designtime.js → floorplans/ListReport.designtime.js} +4 -4
- package/src/sap/suite/ui/generic/template/designtime/{ObjectPage.designtime.js → floorplans/ObjectPage.designtime.js} +4 -5
- package/src/sap/suite/ui/generic/template/designtime/utils/designtimeHelper.js +119 -96
- package/src/sap/suite/ui/generic/template/designtime/utils/designtimeUtils.js +395 -0
- package/src/sap/suite/ui/generic/template/detailTemplates/i18n/i18n_es.properties +1 -1
- package/src/sap/suite/ui/generic/template/fragments/EasyFilter.fragment.xml +12 -17
- package/src/sap/suite/ui/generic/template/fragments/MessagePage.controller.js +16 -0
- package/src/sap/suite/ui/generic/template/fragments/MessagePopover.fragment.xml +16 -2
- package/src/sap/suite/ui/generic/template/fragments/SmartFormDataField.fragment.xml +2 -0
- package/src/sap/suite/ui/generic/template/genericUtilities/Link.js +9 -2
- package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartTableChartCommon.js +1 -1
- package/src/sap/suite/ui/generic/template/js/AnnotationHelper.js +8 -4
- package/src/sap/suite/ui/generic/template/lib/AppComponent.js +10 -3
- package/src/sap/suite/ui/generic/template/lib/CommonEventHandlers.js +0 -42
- package/src/sap/suite/ui/generic/template/lib/CommonUtils.js +6 -1
- package/src/sap/suite/ui/generic/template/lib/MessageButtonHelper.js +11 -7
- package/src/sap/suite/ui/generic/template/lib/RetryAfterHandler.js +249 -0
- package/src/sap/suite/ui/generic/template/lib/ShareUtils.js +1 -1
- package/src/sap/suite/ui/generic/template/lib/SideEffectUtil.js +64 -3
- package/src/sap/suite/ui/generic/template/lib/StableIdDefinition.js +7 -0
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFilterBarHandler.js +206 -74
- package/src/sap/suite/ui/generic/template/lib/ai/ErrorExplanationHelper.js +47 -0
- package/src/sap/suite/ui/generic/template/lib/ai/FioriAIHandler.js +10 -3
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n.properties +31 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ar.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_bg.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ca.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cnr.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cs.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cy.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_da.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_de.properties +22 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_el.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_GB.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_US_saprigi.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_es.properties +23 -2
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_es_MX.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_et.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fi.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fr.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fr_CA.properties +23 -2
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hi.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hr.properties +22 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hu.properties +23 -2
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_id.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_it.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_iw.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ja.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_kk.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ko.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_lt.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_lv.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_mk.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ms.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_nl.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_no.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pl.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pt.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pt_PT.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ro.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ru.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sh.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sk.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sl.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sr.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sv.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_th.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_tr.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_uk.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_vi.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_zh_CN.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_zh_TW.properties +21 -0
- package/src/sap/suite/ui/generic/template/lib/insights/InsightsCardHelper.js +39 -23
- package/src/sap/suite/ui/generic/template/lib/multipleViews/MultipleTablesModeHelper.js +2 -1
- package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +5 -3
- package/src/sap/suite/ui/generic/template/library.js +3 -1
- package/src/sap/suite/ui/generic/template/listTemplates/fragments/MultipleViewsSingleTableMode.fragment.xml +6 -2
- package/src/sap/suite/ui/generic/template/manifestMerger/ChangePageConfiguration.js +28 -23
- package/src/sap/suite/ui/generic/template/manifestMerger/MergerUtil.js +6 -6
- package/src/sap/suite/ui/generic/template/themes/base/base.less +0 -4
- package/ui5.yaml +1 -0
|
@@ -2692,47 +2692,6 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
2692
2692
|
oController.onBeforeExportTableExtension(oExportParams);
|
|
2693
2693
|
}
|
|
2694
2694
|
|
|
2695
|
-
/**
|
|
2696
|
-
* This method is called when the user interacts with EasyFilter field (Enter on the input field or Go button press).
|
|
2697
|
-
* The AI easy filter is triggered and the result filters are applied to the SmartFilterBar.
|
|
2698
|
-
* @param {object} oEasyFilterInputField - The EasyFilter input field which has the value entered by the user
|
|
2699
|
-
* @param {object} oState - oState of the component
|
|
2700
|
-
*/
|
|
2701
|
-
function fnHandleEasyFilterChange(oEasyFilterInputField, oState) {
|
|
2702
|
-
|
|
2703
|
-
var oSmartFilterbar = oState.oSmartFilterbar;
|
|
2704
|
-
FESRHelper.setSemanticStepname(oEasyFilterInputField, "press", "fe2:ai:search");
|
|
2705
|
-
var oAIFilterQueryHandlerPromise = oState.oEasyFilterBarHandler.triggerEasyFilterQuery(oEasyFilterInputField, oSmartFilterbar);
|
|
2706
|
-
|
|
2707
|
-
oAIFilterQueryHandlerPromise.then(function(oFiltersFromAI) {
|
|
2708
|
-
|
|
2709
|
-
var sSmartFilterBarId = oSmartFilterbar.getId();
|
|
2710
|
-
var oSmartFilterBarWrapper = oCommonUtils.getControlStateWrapperById(sSmartFilterBarId, "SmartFilterBar");
|
|
2711
|
-
var oSmartFilterBarVariant = oSmartFilterBarWrapper.getState();
|
|
2712
|
-
var oVariantDataFromAI = oState.oEasyFilterBarHandler.getSFBVariantData(oFiltersFromAI);
|
|
2713
|
-
|
|
2714
|
-
// restore the custom filters to the initial state for now
|
|
2715
|
-
// To check if other objects in oSmartFilterBarVariant needs to be modified
|
|
2716
|
-
var aAppExtension = Object.keys(oSmartFilterBarVariant.customFilters.appExtension);
|
|
2717
|
-
if ( aAppExtension.length > 0 ) {
|
|
2718
|
-
aAppExtension.forEach(function(sKey) {
|
|
2719
|
-
oSmartFilterBarVariant.customFilters.appExtension[sKey] = "";
|
|
2720
|
-
});
|
|
2721
|
-
}
|
|
2722
|
-
oSmartFilterBarVariant.selectOptions = oVariantDataFromAI.aSelectOptions;
|
|
2723
|
-
if (oComponentUtils.isDraftEnabled()) {
|
|
2724
|
-
oSmartFilterBarVariant.customFilters.editState = oVariantDataFromAI.oEditStateFilter;
|
|
2725
|
-
}
|
|
2726
|
-
|
|
2727
|
-
oSmartFilterBarWrapper.setState(oSmartFilterBarVariant);
|
|
2728
|
-
oSmartFilterbar.getSmartVariant() && oSmartFilterbar.getSmartVariant().currentVariantSetModified(true);
|
|
2729
|
-
oSmartFilterbar.search();
|
|
2730
|
-
}, function(oError) {
|
|
2731
|
-
oLogger.error("Error occurred while applying the AI filters", oError);
|
|
2732
|
-
});
|
|
2733
|
-
oComponentUtils.getBusyHelper().setBusy(oAIFilterQueryHandlerPromise);
|
|
2734
|
-
}
|
|
2735
|
-
|
|
2736
2695
|
/**
|
|
2737
2696
|
* Performs intent based navigation and opens the given line item context in a new tab.
|
|
2738
2697
|
*
|
|
@@ -2814,7 +2773,6 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
2814
2773
|
onSmartFieldModeToggled: onSmartFieldModeToggled,
|
|
2815
2774
|
onRenderTeamsContactCollabOptions: fnRenderTeamsContactCollabOptions,
|
|
2816
2775
|
hideTableCells: fnHideTableCells,
|
|
2817
|
-
onEasyFilterChange: fnHandleEasyFilterChange,
|
|
2818
2776
|
navigateIntentOnNewTab: fnNavigateIntentOnNewTab
|
|
2819
2777
|
};
|
|
2820
2778
|
}
|
|
@@ -854,7 +854,8 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
854
854
|
// oResponse is never going to have the value for oDatafield.name in the encoded format, hence the transformation into encodedURI.
|
|
855
855
|
// It may happen that the oResponse[oDatafield.name] contains some special characters (for ex: space) but in a decoded manner.
|
|
856
856
|
// but the route for Context Navigation requires the route string in the encoded way.
|
|
857
|
-
var
|
|
857
|
+
var sFieldValueFromODataResponse = oResponse[oDatafield.name];
|
|
858
|
+
var sEncodedFieldValueFromODataResponse = encodeURIComponent(sFieldValueFromODataResponse);
|
|
858
859
|
switch (oDatafield.type) {
|
|
859
860
|
case "Edm.Guid":
|
|
860
861
|
if (oResponse.DraftAdministrativeData && oResponse.DraftAdministrativeData.DraftIsCreatedByMe) {
|
|
@@ -881,6 +882,10 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
881
882
|
var sFormattedvalue = ODataUtils.formatValue(sEncodedFieldValueFromODataResponse, oDatafield.type);
|
|
882
883
|
sRoute += sKeySeparator + oDatafield.name + "=" + sFormattedvalue;
|
|
883
884
|
break;
|
|
885
|
+
case "Edm.DateTime":
|
|
886
|
+
var sFormattedvalue = ODataUtils.formatValue(sFieldValueFromODataResponse, oDatafield.type);
|
|
887
|
+
sRoute += sKeySeparator + oDatafield.name + "=" + encodeURIComponent(sFormattedvalue);
|
|
888
|
+
break;
|
|
884
889
|
default:
|
|
885
890
|
if (typeof sEncodedFieldValueFromODataResponse === "string") {
|
|
886
891
|
sRoute += sKeySeparator + oDatafield.name + "=" + "'" + sEncodedFieldValueFromODataResponse + "'";
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
sap.ui.define([
|
|
2
2
|
"sap/ui/base/Object",
|
|
3
|
-
"sap/m/MessagePopover",
|
|
4
|
-
"sap/m/MessagePopoverItem",
|
|
5
3
|
"sap/ui/model/Filter",
|
|
6
4
|
"sap/ui/model/FilterOperator",
|
|
7
5
|
"sap/ui/model/json/JSONModel",
|
|
8
6
|
"sap/suite/ui/generic/template/lib/MessageUtils",
|
|
9
7
|
"sap/suite/ui/generic/template/genericUtilities/testableHelper",
|
|
10
|
-
"sap/ui/core/Element",
|
|
11
8
|
"sap/base/util/extend",
|
|
12
|
-
"sap/suite/ui/generic/template/genericUtilities/oDataModelHelper"
|
|
13
|
-
|
|
9
|
+
"sap/suite/ui/generic/template/genericUtilities/oDataModelHelper",
|
|
10
|
+
"sap/suite/ui/generic/template/lib/ai/ErrorExplanationHelper"
|
|
11
|
+
], function (BaseObject, Filter, FilterOperator, JSONModel, MessageUtils, testableHelper, extend, oDataModelHelper, ErrorExplanationHelper) {
|
|
14
12
|
"use strict";
|
|
15
13
|
|
|
16
14
|
Filter = testableHelper.observableConstructor(Filter, true);
|
|
@@ -51,8 +49,10 @@ sap.ui.define([
|
|
|
51
49
|
var oUiModel = oComponent.getModel("ui");
|
|
52
50
|
var oHelperModel = new JSONModel({
|
|
53
51
|
isPopoverOpen: false,
|
|
54
|
-
messageToGroupName: Object.create(null)
|
|
52
|
+
messageToGroupName: Object.create(null),
|
|
53
|
+
isAIErrorExplanationEnabled : false
|
|
55
54
|
});
|
|
55
|
+
//getLink();
|
|
56
56
|
var oMessageButton = oController.byId("showMessages");
|
|
57
57
|
var bIsDraftEnabled = oTemplateUtils.oComponentUtils.isDraftEnabled();
|
|
58
58
|
|
|
@@ -76,7 +76,7 @@ sap.ui.define([
|
|
|
76
76
|
(fnUpdateSorting || Function.prototype)();
|
|
77
77
|
return bRet;
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
|
|
80
80
|
function getSubtitle(sMsgId, aControlIds, sAdditionalText, bIsPopoverOpen){
|
|
81
81
|
var sRet = (bIsPopoverOpen && sMsgId && aControlIds && oCurrentMessageSupportFunctions) ? oCurrentMessageSupportFunctions.getSubtitle(sMsgId, sAdditionalText) : sAdditionalText;
|
|
82
82
|
return sRet;
|
|
@@ -97,6 +97,9 @@ sap.ui.define([
|
|
|
97
97
|
oHelperModel.setProperty("/isPopoverOpen", true);
|
|
98
98
|
},
|
|
99
99
|
isPositionable: isPositionable,
|
|
100
|
+
generateErrorExplanation: function(oEvent) {
|
|
101
|
+
ErrorExplanationHelper.generateErrorExplanation(oEvent, oController, oTemplateUtils);
|
|
102
|
+
},
|
|
100
103
|
getSubtitle: getSubtitle,
|
|
101
104
|
titlePressed: function (oEvent) { // the user wants to navigate from the message to the corresponding control
|
|
102
105
|
MessageUtils.navigateFromMessageTitleEvent(oTemplateUtils, oEvent, oComponent, bIsDraftEnabled, sCurrentBindingPath);
|
|
@@ -108,6 +111,7 @@ sap.ui.define([
|
|
|
108
111
|
oItemBinding = oMessagePopover.getBinding("items");
|
|
109
112
|
oItemBinding.filter(oCurrentFilter);
|
|
110
113
|
|
|
114
|
+
oHelperModel.setProperty("/isAIErrorExplanationEnabled", ErrorExplanationHelper.isErrorExplanationEnabled(oTemplateUtils));
|
|
111
115
|
var oTemplatePrivate = oTemplateUtils.oComponentUtils.getTemplatePrivateModel();
|
|
112
116
|
oTemplatePrivate.setProperty("/generic/messageButtonInfo", {
|
|
113
117
|
count: 0,
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
sap.ui.define(["sap/ui/base/Object",
|
|
2
|
+
"sap/base/util/extend",
|
|
3
|
+
"sap/base/i18n/Formatting",
|
|
4
|
+
"sap/m/Button",
|
|
5
|
+
"sap/m/Dialog",
|
|
6
|
+
"sap/m/ProgressIndicator",
|
|
7
|
+
"sap/m/Text",
|
|
8
|
+
"sap/m/library",
|
|
9
|
+
"sap/ui/core/format/DateFormat",
|
|
10
|
+
"sap/ui/core/library"
|
|
11
|
+
], function (BaseObject, extend, Formatting, Button, Dialog, ProgressIndicator, Text, mobileLibrary, DateFormat, coreLibrary) {
|
|
12
|
+
"use strict";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* This class handles the 503 error (service unavailable) response which includes "retry-after" header.
|
|
16
|
+
*
|
|
17
|
+
* Whenever the server throws 503 error, it adds "retry-after" (minimum number of seconds need to be waited before the next server call)
|
|
18
|
+
* to the response header. The model intercepts the error and invokes the error handler registered on "setRetryAfterHandler" method.
|
|
19
|
+
* Model takes care of converting the "retry-after" value to the Date value.
|
|
20
|
+
*
|
|
21
|
+
* Here the code flow starts with "fnRegisterRetryAfterHandler". It sets the retry after handler to the model.
|
|
22
|
+
* Whenever 503 error is thrown, the "fnRetryAfterHandler" method is invoked.
|
|
23
|
+
* The method should always return a promise. The model waits for the promise to be resolved.
|
|
24
|
+
* - If the promise is resolved, the model retries the batch call.
|
|
25
|
+
* - If the promise is rejected, it aborts the batch call.
|
|
26
|
+
*
|
|
27
|
+
* Cases handled here.
|
|
28
|
+
* 1. When the retry after time is <= 600 seconds
|
|
29
|
+
* Opens up dialog with progress indicator. Once the retry after time is reached, the dialog is automatically closed and the action is retried.
|
|
30
|
+
* 2. When the retry after time is same day as today, navigate to message page
|
|
31
|
+
* (Message shown: We expect it to be available again at 7:00 AM)
|
|
32
|
+
* 3. When the retry after time is some other day in the same year, navigate to message page
|
|
33
|
+
* (Message shown: We expect it to be available again on October 1 at 7:00 AM)
|
|
34
|
+
* 4. When the retry after time is in different year (Possibly Jan 01 of next year), navigate to message page
|
|
35
|
+
* (Message shown: We expect it to be available again on January 1, 2022 at 12:00 PM)
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
function getMethods(oTemplateContract, oAppComponent) {
|
|
39
|
+
// Shortcut for sap.m.ButtonType
|
|
40
|
+
var ButtonType = mobileLibrary.ButtonType;
|
|
41
|
+
// Shortcut for sap.m.DialogType
|
|
42
|
+
var DialogType = mobileLibrary.DialogType;
|
|
43
|
+
// Shortcut for sap.m.IllustratedMessageType
|
|
44
|
+
var IllustratedMessageType = mobileLibrary.IllustratedMessageType;
|
|
45
|
+
// Shortcut for sap.ui.core.ValueState
|
|
46
|
+
var ValueState = coreLibrary.ValueState;
|
|
47
|
+
// Shortcut for getting i18n text
|
|
48
|
+
var getText = oTemplateContract.getText;
|
|
49
|
+
|
|
50
|
+
// Get user's time pattern. If no pattern available on user's settings, use "HH:mm a"
|
|
51
|
+
var sTimePattern = Formatting.getTimePattern("short") || "HH:mm a";
|
|
52
|
+
|
|
53
|
+
function fnRetryAfterHandler (oError) {
|
|
54
|
+
var sErrorMessage = oError.message;
|
|
55
|
+
var sAdditionalMessage;
|
|
56
|
+
if (sErrorMessage) {
|
|
57
|
+
//Add prefix to the error message
|
|
58
|
+
sAdditionalMessage = getText("ST_GENERIC_503_SOURCE_MESSAGE") + " " + sErrorMessage;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
var oRetryAfterDate = oError.retryAfter;
|
|
62
|
+
var oNow = new Date();
|
|
63
|
+
var iDifferenceInMilliSeconds = oRetryAfterDate.getTime() - oNow.getTime();
|
|
64
|
+
var iDifferenceInSeconds = Math.ceil(iDifferenceInMilliSeconds / 1000);
|
|
65
|
+
|
|
66
|
+
return new Promise((fnResolve, fnReject) => {
|
|
67
|
+
var sMessagePageText = null,
|
|
68
|
+
sMessagePageDescription = null;
|
|
69
|
+
if (iDifferenceInSeconds <= 600) {
|
|
70
|
+
fnOpenAutoRetryDialog(oRetryAfterDate.getTime(), iDifferenceInSeconds, fnResolve, fnReject);
|
|
71
|
+
} else {
|
|
72
|
+
sMessagePageText = getText("ST_GENERIC_503_SERVICE_UNAVAILABLE");
|
|
73
|
+
sMessagePageDescription = fnGetErrorMessageWithTime(oNow, oRetryAfterDate);
|
|
74
|
+
fnNavigateToMessagePage(sMessagePageText, sMessagePageDescription, sAdditionalMessage);
|
|
75
|
+
fnReject();
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Opens the auto retry dialog. Dialog contains
|
|
82
|
+
* - a text containing the number of seconds remaining to retry the action
|
|
83
|
+
* - a progress indicator which shows the progress to reach the retry after time
|
|
84
|
+
* - a "Cancel" button
|
|
85
|
+
*
|
|
86
|
+
* If the user doesn't do anything, this function will wait until the retry after time and resolves the promise to retry
|
|
87
|
+
* and closes the dialog.
|
|
88
|
+
*
|
|
89
|
+
* If the user presses "Cancel" button, it opens a new confirmation dialog which does the following:
|
|
90
|
+
* - if user presses "Retry" button, it closes the confirmation dialog and opens the auto retry dialog.
|
|
91
|
+
* - if user presses "Cancel" button, it rejects the promise for retry (Retry operation will be aborted)
|
|
92
|
+
*
|
|
93
|
+
* @param {number} iRetryAfterTimeInMillis Retry after time in milliseconds
|
|
94
|
+
* @param {number} iSecondsToRetryAfter Number of seconds to reach the retry-after time from now
|
|
95
|
+
* @param {function} fnResolve Resolve function for retry promise
|
|
96
|
+
* @param {function} fnReject Reject function for retry promise
|
|
97
|
+
*/
|
|
98
|
+
function fnOpenAutoRetryDialog (iRetryAfterTimeInMillis, iSecondsToRetryAfter, fnResolve, fnReject) {
|
|
99
|
+
var oAutoRetryDialog = null;
|
|
100
|
+
var oConfirmRetryDialog = null;
|
|
101
|
+
var oAutoRetryProgressIndicator = null;
|
|
102
|
+
var oAutoRetryText = null;
|
|
103
|
+
|
|
104
|
+
function getAutoRetryText (iSeconds) {
|
|
105
|
+
return getText("ST_GENERIC_503_SERVICE_UNAVAILABLE") + " " + getText("ST_GENERIC_503_AUTO_RETRY_MSG", [iSeconds]);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function updateAutoRetryStatus (iLapsedSeconds) {
|
|
109
|
+
var iSecondsUntilRetryAfter = iSecondsToRetryAfter - iLapsedSeconds;
|
|
110
|
+
oAutoRetryProgressIndicator.setPercentValue(iLapsedSeconds / iSecondsToRetryAfter * 100);
|
|
111
|
+
oAutoRetryText.setText( getAutoRetryText(iSecondsUntilRetryAfter) );
|
|
112
|
+
|
|
113
|
+
// Updating the progress indicator state every second
|
|
114
|
+
if (iRetryAfterTimeInMillis > new Date().getTime()) {
|
|
115
|
+
setTimeout(() => {
|
|
116
|
+
updateAutoRetryStatus(iLapsedSeconds + 1);
|
|
117
|
+
}, 1000);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
oAutoRetryText = new Text({
|
|
122
|
+
text: getAutoRetryText(iSecondsToRetryAfter)
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
oAutoRetryProgressIndicator = new ProgressIndicator({
|
|
126
|
+
percentValue : 0,
|
|
127
|
+
state : ValueState.None
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
oAutoRetryDialog = new Dialog({
|
|
131
|
+
type : DialogType.Message,
|
|
132
|
+
state : ValueState.Warning,
|
|
133
|
+
title: getText("ST_MESSAGES_DIALOG_TITLE_WARNING"),
|
|
134
|
+
content: [oAutoRetryText, oAutoRetryProgressIndicator],
|
|
135
|
+
buttons: [
|
|
136
|
+
new Button({
|
|
137
|
+
type: ButtonType.Emphasized,
|
|
138
|
+
text: getText("CANCEL"),
|
|
139
|
+
press: function () {
|
|
140
|
+
// Close the current dialog and open the confirmation dialog
|
|
141
|
+
oAutoRetryDialog.close();
|
|
142
|
+
oConfirmRetryDialog.open();
|
|
143
|
+
}
|
|
144
|
+
})
|
|
145
|
+
]
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
oConfirmRetryDialog = new Dialog({
|
|
149
|
+
type : DialogType.Message,
|
|
150
|
+
state : ValueState.Warning,
|
|
151
|
+
title: getText("ST_MESSAGES_DIALOG_TITLE_WARNING"),
|
|
152
|
+
content: [
|
|
153
|
+
new Text({ text: getText("ST_GENERIC_503_CANCEL_RETRY") })
|
|
154
|
+
],
|
|
155
|
+
buttons: [
|
|
156
|
+
new Button({
|
|
157
|
+
type: ButtonType.Emphasized,
|
|
158
|
+
text: getText("RETRY"),
|
|
159
|
+
press: function () {
|
|
160
|
+
// As the user wants to retry, close the current dialog and reopen the auto retry dialog which contains progress indicator
|
|
161
|
+
oConfirmRetryDialog.close();
|
|
162
|
+
oAutoRetryDialog.open();
|
|
163
|
+
}
|
|
164
|
+
}),
|
|
165
|
+
new Button({
|
|
166
|
+
text: getText("CANCEL"),
|
|
167
|
+
press: function () {
|
|
168
|
+
// Abort retry and close the confirmation dialog
|
|
169
|
+
fnReject(new Error("Request(s) canceled by user"));
|
|
170
|
+
oConfirmRetryDialog.close();
|
|
171
|
+
}
|
|
172
|
+
})
|
|
173
|
+
]
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
//Start the progress indicator and open the auto-retry dialog
|
|
177
|
+
updateAutoRetryStatus(0);
|
|
178
|
+
oAutoRetryDialog.open();
|
|
179
|
+
// Once the retry time is reached, resolve the promise which will trigger retry
|
|
180
|
+
// and close the dialog.
|
|
181
|
+
setTimeout(function () {
|
|
182
|
+
fnResolve();
|
|
183
|
+
oAutoRetryDialog.close();
|
|
184
|
+
}, iSecondsToRetryAfter * 1000);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function fnNavigateToMessagePage (sText, sDescription, sAdditionalMessage) {
|
|
188
|
+
var aAdditionalContent = [];
|
|
189
|
+
if (sAdditionalMessage) {
|
|
190
|
+
aAdditionalContent.push(new Text({text: sAdditionalMessage}));
|
|
191
|
+
}
|
|
192
|
+
oTemplateContract.oNavigationControllerProxy.navigateToMessagePage({
|
|
193
|
+
title: getText("ST_GENERIC_ERROR_TITLE"),
|
|
194
|
+
text: sText,
|
|
195
|
+
messageType: IllustratedMessageType.UnableToLoad,
|
|
196
|
+
description: sDescription,
|
|
197
|
+
additionalContent: aAdditionalContent
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function fnGetErrorMessageWithTime (oNow, oRetryAfterDate) {
|
|
202
|
+
var sResultMessage = null;
|
|
203
|
+
// Date format varies from case to case
|
|
204
|
+
var oDateFormat = null;
|
|
205
|
+
var sFormattedDate = null;
|
|
206
|
+
//Time format remains same
|
|
207
|
+
var oTimeFormat = DateFormat.getTimeInstance({
|
|
208
|
+
pattern: sTimePattern
|
|
209
|
+
});
|
|
210
|
+
var sFormattedTime = oTimeFormat.format(oRetryAfterDate);
|
|
211
|
+
|
|
212
|
+
if (oNow.getYear() !== oRetryAfterDate.getYear()) {
|
|
213
|
+
// Different year
|
|
214
|
+
oDateFormat = DateFormat.getDateInstance({
|
|
215
|
+
pattern: "MMMM dd, yyyy"
|
|
216
|
+
});
|
|
217
|
+
sFormattedDate = oDateFormat.format(oRetryAfterDate);
|
|
218
|
+
sResultMessage = getText("ST_GENERIC_503_RETRY_MSG_OTHER_DAY", [sFormattedDate, sFormattedTime]);
|
|
219
|
+
} else if (oNow.getMonth() !== oRetryAfterDate.getMonth() || oNow.getDate() !== oRetryAfterDate.getDate()) {
|
|
220
|
+
// Different day
|
|
221
|
+
oDateFormat = DateFormat.getDateInstance({
|
|
222
|
+
pattern: "MMMM dd"
|
|
223
|
+
});
|
|
224
|
+
sFormattedDate = oDateFormat.format(oRetryAfterDate);
|
|
225
|
+
sResultMessage = getText("ST_GENERIC_503_RETRY_MSG_OTHER_DAY", [sFormattedDate, sFormattedTime]);
|
|
226
|
+
} else {
|
|
227
|
+
// Same day (only time is required)
|
|
228
|
+
sResultMessage = getText("ST_GENERIC_503_RETRY_MSG_SAME_DAY", [sFormattedTime]);
|
|
229
|
+
}
|
|
230
|
+
return sResultMessage;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function fnRegisterRetryAfterHandler() {
|
|
234
|
+
// Registering the retry after handler to model
|
|
235
|
+
var oModel = oAppComponent.getModel();
|
|
236
|
+
oModel.setRetryAfterHandler(fnRetryAfterHandler);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return {
|
|
240
|
+
registerRetryAfterHandler: fnRegisterRetryAfterHandler
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
return BaseObject.extend("sap.suite.ui.generic.template.lib.RetryAfterHandler", {
|
|
245
|
+
constructor: function (oTemplateContract, oAppComponent) {
|
|
246
|
+
extend(this, getMethods(oTemplateContract, oAppComponent));
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
});
|
|
@@ -175,7 +175,7 @@ sap.ui.define(["sap/base/util/ObjectPath", "sap/ushell/ui/footerbar/AddBookmarkB
|
|
|
175
175
|
ShareUtils.CollaborationButtonPress = function (fnCallBackHandler, oShareModel) {
|
|
176
176
|
var sCurrentURLPromise = getCurrentUrl();
|
|
177
177
|
sCurrentURLPromise.then(function (sCurrentURL) {
|
|
178
|
-
var sAppTitle = oShareModel && oShareModel.getProperty("/
|
|
178
|
+
var sAppTitle = oShareModel && oShareModel.getProperty("/shellTitle");
|
|
179
179
|
fnCallBackHandler(sAppTitle, sCurrentURL);
|
|
180
180
|
});
|
|
181
181
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
sap.ui.define(["sap/suite/ui/generic/template/js/AnnotationHelper",
|
|
2
2
|
"sap/suite/ui/generic/template/genericUtilities/metadataAnalyser",
|
|
3
|
-
"sap/base/util/deepExtend"
|
|
4
|
-
|
|
3
|
+
"sap/base/util/deepExtend",
|
|
4
|
+
"sap/ui/comp/util/SharedUtil"
|
|
5
|
+
], function(AnnotationHelper, metadataAnalyser, deepExtend, SharedUtil) {
|
|
5
6
|
"use strict";
|
|
6
7
|
var SideEffectSourcePropertyType = {
|
|
7
8
|
SINGLE_SOURCE_ONLY : "OnlySingleSource",
|
|
@@ -133,8 +134,68 @@ sap.ui.define(["sap/suite/ui/generic/template/js/AnnotationHelper",
|
|
|
133
134
|
});
|
|
134
135
|
}
|
|
135
136
|
|
|
137
|
+
/**
|
|
138
|
+
* Returns the EntitySet name, EntityType name, PropertyName for a given link field
|
|
139
|
+
* @param {sap.ui.model.odata.ODataMetaModel.EntitySet} oEntitySet
|
|
140
|
+
* @param {object} oTarget
|
|
141
|
+
*/
|
|
142
|
+
function fnGetPropsForLinkFields (oEntitySet, oTarget) {
|
|
143
|
+
var sLinkProperty = oTarget && oTarget.Value && oTarget.Value.Path;
|
|
144
|
+
if (!sLinkProperty) {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
var oCustomData = {
|
|
148
|
+
"sEntitySetName": oEntitySet.name,
|
|
149
|
+
"sEntityTypeName": oEntitySet.entityType,
|
|
150
|
+
"sLinkProperty": sLinkProperty
|
|
151
|
+
};
|
|
152
|
+
return JSON.stringify(oCustomData);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Calculate and assign fieldGroup Id(s) for the link field
|
|
157
|
+
* The following logic is executed in the onAfterRendering event of the control because
|
|
158
|
+
* 1. We need the binding context to be available for the control
|
|
159
|
+
* 2. Avoid unnecessary strain on the rendering of the application during templating
|
|
160
|
+
* @param {sap.suite.ui.generic.template.genericUtilities.Link} oLink
|
|
161
|
+
*/
|
|
162
|
+
function fnAssignFieldGroupIdsToLinkField (oLink) {
|
|
163
|
+
var aCustomData = oLink.getCustomData();
|
|
164
|
+
var oMetaModel = oLink.getModel().getMetaModel();
|
|
165
|
+
var oCustomData = aCustomData.find((oCustomData) => oCustomData.getKey() === "SideEffects" && oCustomData.getValue());
|
|
166
|
+
if (oLink.getBindingContext() && oCustomData){
|
|
167
|
+
var oCustomDataValue = oCustomData.getValue();
|
|
168
|
+
var sEntitySetName = oCustomDataValue.sEntitySetName;
|
|
169
|
+
var sEntityTypeName = oCustomDataValue.sEntityTypeName;
|
|
170
|
+
var sLinkProperty = oCustomDataValue.sLinkProperty;
|
|
171
|
+
var sSideEffectType = metadataAnalyser.getFieldSourcePropertiesType(sLinkProperty, oMetaModel, sEntityTypeName);
|
|
172
|
+
|
|
173
|
+
if (sSideEffectType === "NoSideEffect"){
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
var oEntityType = oMetaModel.getODataEntityType(sEntityTypeName);
|
|
178
|
+
var oEntitySet = oMetaModel.getODataEntitySet(sEntitySetName);
|
|
179
|
+
var oProperty = metadataAnalyser.getPropertyMetadata(oMetaModel, sEntityTypeName, sLinkProperty);
|
|
180
|
+
var oMetaData = {
|
|
181
|
+
entitySet: oEntitySet,
|
|
182
|
+
entityType: oEntityType,
|
|
183
|
+
path: sLinkProperty,
|
|
184
|
+
property: {
|
|
185
|
+
property: oProperty
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
//The method SharedUtil.applyFieldGroupIDs takes in the control and its metadata, reads the Side Effect annotations configured for it
|
|
190
|
+
//and assigns the fieldGroupID accordingly.
|
|
191
|
+
SharedUtil.applyFieldGroupIDs(oLink, oMetaData);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
136
195
|
return {
|
|
137
196
|
handleSideEffectForField : fnHandleSideEffectForField,
|
|
138
|
-
assignFieldGroupIds: fnAssignFieldGroupIds
|
|
197
|
+
assignFieldGroupIds: fnAssignFieldGroupIds,
|
|
198
|
+
getPropsForLinkFields: fnGetPropsForLinkFields,
|
|
199
|
+
assignFieldGroupIdsToLinkField: fnAssignFieldGroupIdsToLinkField
|
|
139
200
|
};
|
|
140
201
|
});
|
|
@@ -212,6 +212,9 @@ sap.ui.define(["sap/suite/ui/generic/template/genericUtilities/FeError"],functio
|
|
|
212
212
|
},
|
|
213
213
|
VariantSelect: {
|
|
214
214
|
value: "template::VariantSelect"
|
|
215
|
+
},
|
|
216
|
+
InvisibleText: {
|
|
217
|
+
value: "template::ContentSwitch"
|
|
215
218
|
}
|
|
216
219
|
},
|
|
217
220
|
ALPTable: {
|
|
@@ -507,6 +510,10 @@ sap.ui.define(["sap/suite/ui/generic/template/genericUtilities/FeError"],functio
|
|
|
507
510
|
},
|
|
508
511
|
VariantSelectionItem: {
|
|
509
512
|
parameters: ["sFacet", "sQuickVariantKey"]
|
|
513
|
+
},
|
|
514
|
+
InvisibleText: {
|
|
515
|
+
parameters: ["sFacet"],
|
|
516
|
+
value: function(oParams){return "template:::ObjectPageTable:::ContentSwitch:::sFacet::" + oParams.sFacet;}
|
|
510
517
|
}
|
|
511
518
|
},
|
|
512
519
|
SmartControl: {
|