@sapui5/sap.cux.home 1.140.0 → 1.142.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 +1 -1
- package/src/sap/cux/home/.library +1 -1
- package/src/sap/cux/home/AdvancedSettingsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/AdvancedSettingsPanel.js +3 -1
- package/src/sap/cux/home/AdvancedSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/AdvancedSettingsPanel.ts +3 -1
- package/src/sap/cux/home/App.d.ts.map +1 -1
- package/src/sap/cux/home/App.js +6 -1
- package/src/sap/cux/home/App.js.map +1 -1
- package/src/sap/cux/home/App.ts +7 -1
- package/src/sap/cux/home/AppsAdditionPanel.d.ts +1 -0
- package/src/sap/cux/home/AppsAdditionPanel.d.ts.map +1 -1
- package/src/sap/cux/home/AppsAdditionPanel.js +64 -59
- package/src/sap/cux/home/AppsAdditionPanel.js.map +1 -1
- package/src/sap/cux/home/AppsAdditionPanel.ts +44 -34
- package/src/sap/cux/home/AppsContainer.d.ts +5 -1
- package/src/sap/cux/home/AppsContainer.d.ts.map +1 -1
- package/src/sap/cux/home/AppsContainer.js +44 -37
- package/src/sap/cux/home/AppsContainer.js.map +1 -1
- package/src/sap/cux/home/AppsContainer.ts +43 -33
- package/src/sap/cux/home/BaseAppPanel.d.ts +2 -1
- package/src/sap/cux/home/BaseAppPanel.d.ts.map +1 -1
- package/src/sap/cux/home/BaseAppPanel.js +3 -1
- package/src/sap/cux/home/BaseAppPanel.js.map +1 -1
- package/src/sap/cux/home/BaseAppPanel.ts +5 -2
- package/src/sap/cux/home/BaseContainer.d.ts +8 -0
- package/src/sap/cux/home/BaseContainer.d.ts.map +1 -1
- package/src/sap/cux/home/BaseContainer.js +26 -4
- package/src/sap/cux/home/BaseContainer.js.map +1 -1
- package/src/sap/cux/home/BaseContainer.ts +26 -3
- package/src/sap/cux/home/BaseContainerRenderer.d.ts.map +1 -1
- package/src/sap/cux/home/BaseContainerRenderer.js.map +1 -1
- package/src/sap/cux/home/BaseContainerRenderer.ts +1 -1
- package/src/sap/cux/home/BaseNewsPanel.js +1 -1
- package/src/sap/cux/home/BaseNewsPanel.js.map +1 -1
- package/src/sap/cux/home/BaseNewsPanel.ts +2 -2
- package/src/sap/cux/home/BasePanel.d.ts +7 -0
- package/src/sap/cux/home/BasePanel.d.ts.map +1 -1
- package/src/sap/cux/home/BasePanel.js +20 -0
- package/src/sap/cux/home/BasePanel.js.map +1 -1
- package/src/sap/cux/home/BasePanel.ts +16 -0
- package/src/sap/cux/home/BaseSettingsPanel.d.ts +9 -0
- package/src/sap/cux/home/BaseSettingsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/BaseSettingsPanel.js +13 -0
- package/src/sap/cux/home/BaseSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/BaseSettingsPanel.ts +15 -0
- package/src/sap/cux/home/CardsPanel.d.ts +7 -0
- package/src/sap/cux/home/CardsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/CardsPanel.js +132 -113
- package/src/sap/cux/home/CardsPanel.js.map +1 -1
- package/src/sap/cux/home/CardsPanel.ts +19 -8
- package/src/sap/cux/home/ContentAdditionDialog.d.ts.map +1 -1
- package/src/sap/cux/home/ContentAdditionDialog.js +6 -2
- package/src/sap/cux/home/ContentAdditionDialog.js.map +1 -1
- package/src/sap/cux/home/ContentAdditionDialog.ts +5 -1
- package/src/sap/cux/home/ErrorPanel.js +2 -2
- package/src/sap/cux/home/ErrorPanel.js.map +1 -1
- package/src/sap/cux/home/ErrorPanel.ts +2 -2
- package/src/sap/cux/home/FavAppPanel.d.ts +4 -10
- package/src/sap/cux/home/FavAppPanel.d.ts.map +1 -1
- package/src/sap/cux/home/FavAppPanel.js +432 -446
- package/src/sap/cux/home/FavAppPanel.js.map +1 -1
- package/src/sap/cux/home/FavAppPanel.ts +56 -84
- package/src/sap/cux/home/FrequentAppPanel.d.ts.map +1 -1
- package/src/sap/cux/home/FrequentAppPanel.js +5 -1
- package/src/sap/cux/home/FrequentAppPanel.js.map +1 -1
- package/src/sap/cux/home/FrequentAppPanel.ts +4 -0
- package/src/sap/cux/home/InsightsAdditionPanel.d.ts.map +1 -1
- package/src/sap/cux/home/InsightsAdditionPanel.js +3 -1
- package/src/sap/cux/home/InsightsAdditionPanel.js.map +1 -1
- package/src/sap/cux/home/InsightsAdditionPanel.ts +2 -0
- package/src/sap/cux/home/InsightsContainer.d.ts.map +1 -1
- package/src/sap/cux/home/InsightsContainer.js +2 -2
- package/src/sap/cux/home/InsightsContainer.js.map +1 -1
- package/src/sap/cux/home/InsightsContainer.ts +1 -1
- package/src/sap/cux/home/NewsAndPagesContainer.d.ts +0 -4
- package/src/sap/cux/home/NewsAndPagesContainer.d.ts.map +1 -1
- package/src/sap/cux/home/NewsAndPagesContainer.js +2 -2
- package/src/sap/cux/home/NewsAndPagesContainer.js.map +1 -1
- package/src/sap/cux/home/NewsAndPagesContainer.ts +4 -4
- package/src/sap/cux/home/NewsPanel.d.ts +17 -0
- package/src/sap/cux/home/NewsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/NewsPanel.js +100 -68
- package/src/sap/cux/home/NewsPanel.js.map +1 -1
- package/src/sap/cux/home/NewsPanel.ts +60 -33
- package/src/sap/cux/home/NewsSettingsPanel.d.ts +42 -6
- package/src/sap/cux/home/NewsSettingsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/NewsSettingsPanel.js +219 -81
- package/src/sap/cux/home/NewsSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/NewsSettingsPanel.ts +215 -80
- package/src/sap/cux/home/Page.d.ts.map +1 -1
- package/src/sap/cux/home/Page.js +4 -1
- package/src/sap/cux/home/Page.js.map +1 -1
- package/src/sap/cux/home/Page.ts +2 -0
- package/src/sap/cux/home/PagePanel.d.ts.map +1 -1
- package/src/sap/cux/home/PagePanel.js +5 -2
- package/src/sap/cux/home/PagePanel.js.map +1 -1
- package/src/sap/cux/home/PagePanel.ts +8 -8
- package/src/sap/cux/home/PageSettingsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/PageSettingsPanel.js +6 -3
- package/src/sap/cux/home/PageSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/PageSettingsPanel.ts +2 -2
- package/src/sap/cux/home/RecentAppPanel.d.ts.map +1 -1
- package/src/sap/cux/home/RecentAppPanel.js +6 -0
- package/src/sap/cux/home/RecentAppPanel.js.map +1 -1
- package/src/sap/cux/home/RecentAppPanel.ts +5 -1
- package/src/sap/cux/home/RecommendedAppPanel.d.ts.map +1 -1
- package/src/sap/cux/home/RecommendedAppPanel.js +7 -0
- package/src/sap/cux/home/RecommendedAppPanel.js.map +1 -1
- package/src/sap/cux/home/RecommendedAppPanel.ts +6 -1
- package/src/sap/cux/home/SettingsDialog.d.ts +1 -0
- package/src/sap/cux/home/SettingsDialog.d.ts.map +1 -1
- package/src/sap/cux/home/SettingsDialog.js +13 -6
- package/src/sap/cux/home/SettingsDialog.js.map +1 -1
- package/src/sap/cux/home/SettingsDialog.ts +14 -6
- package/src/sap/cux/home/SideBySideIconTabFilter.d.ts +10 -0
- package/src/sap/cux/home/SideBySideIconTabFilter.d.ts.map +1 -1
- package/src/sap/cux/home/SideBySideIconTabFilter.js +12 -1
- package/src/sap/cux/home/SideBySideIconTabFilter.js.map +1 -1
- package/src/sap/cux/home/SideBySideIconTabFilter.ts +13 -1
- package/src/sap/cux/home/SituationPanel.d.ts.map +1 -1
- package/src/sap/cux/home/SituationPanel.js +7 -2
- package/src/sap/cux/home/SituationPanel.js.map +1 -1
- package/src/sap/cux/home/SituationPanel.ts +2 -0
- package/src/sap/cux/home/SpaceInsightsPanel.js +1 -1
- package/src/sap/cux/home/SpaceInsightsPanel.js.map +1 -1
- package/src/sap/cux/home/SpaceInsightsPanel.ts +1 -1
- package/src/sap/cux/home/TaskPanel.d.ts.map +1 -1
- package/src/sap/cux/home/TaskPanel.js +3 -0
- package/src/sap/cux/home/TaskPanel.js.map +1 -1
- package/src/sap/cux/home/TaskPanel.ts +2 -1
- package/src/sap/cux/home/TilesPanel.d.ts.map +1 -1
- package/src/sap/cux/home/TilesPanel.js +10 -3
- package/src/sap/cux/home/TilesPanel.js.map +1 -1
- package/src/sap/cux/home/TilesPanel.ts +7 -3
- package/src/sap/cux/home/ToDoPanel.d.ts.map +1 -1
- package/src/sap/cux/home/ToDoPanel.js +29 -8
- package/src/sap/cux/home/ToDoPanel.js.map +1 -1
- package/src/sap/cux/home/ToDoPanel.ts +19 -8
- package/src/sap/cux/home/ToDosContainer.js +3 -3
- package/src/sap/cux/home/ToDosContainer.js.map +1 -1
- package/src/sap/cux/home/ToDosContainer.ts +1 -1
- package/src/sap/cux/home/i18n/messagebundle.properties +13 -7
- package/src/sap/cux/home/i18n/messagebundle_ar.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_bg.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_ca.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_cnr.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_cs.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_cy.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_da.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_de.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_el.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_en.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_en_GB.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_en_US_sappsd.properties +1 -3
- package/src/sap/cux/home/i18n/messagebundle_en_US_saprigi.properties +1 -3
- package/src/sap/cux/home/i18n/messagebundle_en_US_saptrc.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_es.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_es_MX.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_et.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_fi.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_fr.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_fr_CA.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_hi.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_hr.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_hu.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_id.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_it.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_iw.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_ja.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_kk.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_ko.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_lt.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_lv.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_mk.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_ms.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_nl.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_no.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_pl.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_pt.properties +1 -3
- package/src/sap/cux/home/i18n/messagebundle_pt_PT.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_ro.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_ru.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_sh.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_sk.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_sl.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_sr.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_sv.properties +1 -3
- package/src/sap/cux/home/i18n/messagebundle_th.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_tr.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_uk.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_vi.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_zh_CN.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_zh_TW.properties +0 -2
- package/src/sap/cux/home/interface/AppsInterface.d.ts +5 -0
- package/src/sap/cux/home/interface/AppsInterface.d.ts.map +1 -1
- package/src/sap/cux/home/interface/AppsInterface.js.map +1 -1
- package/src/sap/cux/home/interface/AppsInterface.ts +6 -0
- package/src/sap/cux/home/library.d.ts.map +1 -1
- package/src/sap/cux/home/library.js +1 -0
- package/src/sap/cux/home/library.js.map +1 -1
- package/src/sap/cux/home/library.ts +1 -0
- package/src/sap/cux/home/themes/base/AppsContainer.less +12 -1
- package/src/sap/cux/home/themes/base/BaseLayout.less +11 -0
- package/src/sap/cux/home/themes/base/InsightsContainer.less +4 -0
- package/src/sap/cux/home/themes/base/ToDosContainer.less +4 -0
- package/src/sap/cux/home/utils/AppManager.d.ts +7 -6
- package/src/sap/cux/home/utils/AppManager.d.ts.map +1 -1
- package/src/sap/cux/home/utils/AppManager.js +1 -1
- package/src/sap/cux/home/utils/AppManager.js.map +1 -1
- package/src/sap/cux/home/utils/AppManager.ts +9 -10
- package/src/sap/cux/home/utils/BatchHelper.d.ts.map +1 -1
- package/src/sap/cux/home/utils/BatchHelper.js +1 -1
- package/src/sap/cux/home/utils/BatchHelper.js.map +1 -1
- package/src/sap/cux/home/utils/BatchHelper.ts +4 -1
- package/src/sap/cux/home/utils/FESRUtil.d.ts +30 -0
- package/src/sap/cux/home/utils/FESRUtil.d.ts.map +1 -1
- package/src/sap/cux/home/utils/FESRUtil.js +36 -1
- package/src/sap/cux/home/utils/FESRUtil.js.map +1 -1
- package/src/sap/cux/home/utils/FESRUtil.ts +36 -0
- package/src/sap/cux/home/utils/PXFeedback.d.ts +4 -0
- package/src/sap/cux/home/utils/PXFeedback.d.ts.map +1 -0
- package/src/sap/cux/home/utils/PXFeedback.js +28 -0
- package/src/sap/cux/home/utils/PXFeedback.js.map +1 -0
- package/src/sap/cux/home/utils/PXFeedback.ts +19 -0
- package/src/sap/cux/home/utils/PageManager.d.ts +0 -4
- package/src/sap/cux/home/utils/PageManager.d.ts.map +1 -1
- package/src/sap/cux/home/utils/PageManager.js +6 -6
- package/src/sap/cux/home/utils/PageManager.js.map +1 -1
- package/src/sap/cux/home/utils/PageManager.ts +6 -5
- package/src/sap/cux/home/utils/UshellPersonalizer.js +1 -1
- package/src/sap/cux/home/utils/UshellPersonalizer.js.map +1 -1
- package/src/sap/cux/home/utils/UshellPersonalizer.ts +1 -1
- package/src/sap/cux/home/utils/fragment/appsAdditionContent.fragment.xml +1 -1
|
@@ -767,7 +767,6 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
767
767
|
this.oNewsTile.removeStyleClass("sapUiSmallMarginTop");
|
|
768
768
|
} else {
|
|
769
769
|
this.oNewsTile.addStyleClass("sapUiSmallMarginTop");
|
|
770
|
-
this.getNewsWrapper().setWidth("100%");
|
|
771
770
|
}
|
|
772
771
|
},
|
|
773
772
|
/**
|
|
@@ -786,11 +785,11 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
786
785
|
let oTile;
|
|
787
786
|
if (newsInfo.getElementsByTagName("link").length > 0) {
|
|
788
787
|
oTile = new NewsItem(recycleId(`${sId}-news-item`), {
|
|
789
|
-
url: String(this.getPropertyValue(newsInfo, "link")),
|
|
790
|
-
title: String(this.getPropertyValue(newsInfo, "title")),
|
|
791
|
-
subTitle: String(this.getPropertyValue(newsInfo, "description")),
|
|
792
|
-
imageUrl: String(this.getPropertyValue(newsInfo, "imageUrl")),
|
|
793
|
-
footer: this.formatDate(String(this.getPropertyValue(newsInfo, "pubDate")))
|
|
788
|
+
url: String(this.getPropertyValue(newsInfo, "link") ?? ""),
|
|
789
|
+
title: String(this.getPropertyValue(newsInfo, "title") ?? ""),
|
|
790
|
+
subTitle: String(this.getPropertyValue(newsInfo, "description") ?? ""),
|
|
791
|
+
imageUrl: String(this.getPropertyValue(newsInfo, "imageUrl") ?? ""),
|
|
792
|
+
footer: this.formatDate(String(this.getPropertyValue(newsInfo, "pubDate") ?? ""))
|
|
794
793
|
});
|
|
795
794
|
this.addAggregation("newsItems", oTile, true);
|
|
796
795
|
} else {
|
|
@@ -798,12 +797,12 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
798
797
|
let newsId = sGroupId && sGroupId.trim() ? `${sId}-newsgroup-${sGroupId}` : `${sId}-newsgroup`;
|
|
799
798
|
let subTitleNews = this.getPropertyValue(newsInfo, "subTitle") ?? "";
|
|
800
799
|
oTile = new NewsGroup(recycleId(newsId), {
|
|
801
|
-
title: String(this.getPropertyValue(newsInfo, "title")),
|
|
800
|
+
title: String(this.getPropertyValue(newsInfo, "title") ?? ""),
|
|
802
801
|
subTitle: subTitleNews || this._i18nBundle.getText("newsFeedDescription"),
|
|
803
|
-
imageUrl: String(this.getPropertyValue(newsInfo, "imageUrl")),
|
|
804
|
-
footer: String(this.getPropertyValue(newsInfo, "footer")),
|
|
802
|
+
imageUrl: String(this.getPropertyValue(newsInfo, "imageUrl") ?? ""),
|
|
803
|
+
footer: String(this.getPropertyValue(newsInfo, "footer") ?? ""),
|
|
805
804
|
priority: this.getPropertyValue(newsInfo, "priority"),
|
|
806
|
-
priorityText: String(this.getPropertyValue(newsInfo, "priorityText"))
|
|
805
|
+
priorityText: String(this.getPropertyValue(newsInfo, "priorityText") ?? "")
|
|
807
806
|
});
|
|
808
807
|
this.addAggregation("newsGroup", oTile, true);
|
|
809
808
|
}
|
|
@@ -830,7 +829,7 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
830
829
|
return i++;
|
|
831
830
|
}, function () {
|
|
832
831
|
const oItemElement = oDocument?.getElementsByTagName("item")[i];
|
|
833
|
-
return Promise.resolve(_this6.extractImage(String(oItemElement.getElementsByTagName("link")[0].textContent))).then(function (sUrl) {
|
|
832
|
+
return Promise.resolve(_this6.extractImage(String(oItemElement.getElementsByTagName("link")[0].textContent ?? ""))).then(function (sUrl) {
|
|
834
833
|
const oImageUrl = oDocument.createElement("imageUrl");
|
|
835
834
|
oImageUrl.textContent = sUrl;
|
|
836
835
|
oItemElement.appendChild(oImageUrl);
|
|
@@ -1067,29 +1066,42 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1067
1066
|
* @private
|
|
1068
1067
|
*/
|
|
1069
1068
|
getDefaultNewsFeedDetails: function _getDefaultNewsFeedDetails(newsResponse) {
|
|
1070
|
-
|
|
1071
|
-
const defaultNews = [];
|
|
1072
|
-
const defaultFeedDict = {};
|
|
1069
|
+
const newsFeedItems = JSON.parse(JSON.stringify(newsResponse.value || []));
|
|
1073
1070
|
this.mandatoryNewsFeed = [];
|
|
1074
1071
|
if (newsFeedItems?.length > 0) {
|
|
1075
1072
|
this.mandatoryNewsFeed = this.filterMandatoryNews(newsFeedItems).map(oFeed => oFeed.group_id || "");
|
|
1076
1073
|
this.markGroupsWithCriticalArticles(newsFeedItems);
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1074
|
+
}
|
|
1075
|
+
return newsFeedItems;
|
|
1076
|
+
},
|
|
1077
|
+
/**
|
|
1078
|
+
* Removes expired article groups from the provided news feed items.
|
|
1079
|
+
* An article group is considered expired if it has no associated articles in _group_to_article
|
|
1080
|
+
*
|
|
1081
|
+
* @param {INewsFeed[]} newsFeedItems - An array of news feed items to filter.
|
|
1082
|
+
* @returns {INewsFeed[]} An array of news feed items that have associated articles.
|
|
1083
|
+
* @private
|
|
1084
|
+
*/
|
|
1085
|
+
removeExpiredArticleGroup: function _removeExpiredArticleGroup(newsFeedItems) {
|
|
1086
|
+
const defaultNews = [];
|
|
1087
|
+
const defaultFeedSet = new Set();
|
|
1088
|
+
for (const feed of newsFeedItems) {
|
|
1089
|
+
const title = feed.title;
|
|
1090
|
+
const group_id = feed.group_id;
|
|
1091
|
+
let subTitle = "";
|
|
1092
|
+
const hasArticles = (feed._group_to_article?.length ?? 0) > 0;
|
|
1093
|
+
if (group_id && !defaultFeedSet.has(group_id) && hasArticles) {
|
|
1094
|
+
subTitle = feed.subTitle || feed.description || "";
|
|
1095
|
+
defaultNews.push({
|
|
1096
|
+
title: title,
|
|
1097
|
+
footer: feed?.footer_text,
|
|
1098
|
+
imageUrl: this.getDefaultFeedImage(feed),
|
|
1099
|
+
group_id: feed.group_id,
|
|
1100
|
+
subTitle: subTitle,
|
|
1101
|
+
priority: feed?.priority == "1" ? Priority.Medium : Priority.None,
|
|
1102
|
+
priorityText: feed?.priority == "1" ? this._i18nBundle.getText("criticalNews") : ""
|
|
1103
|
+
});
|
|
1104
|
+
defaultFeedSet.add(group_id);
|
|
1093
1105
|
}
|
|
1094
1106
|
}
|
|
1095
1107
|
return defaultNews;
|
|
@@ -1225,10 +1237,11 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1225
1237
|
const feedType = _this1.getNewsType();
|
|
1226
1238
|
const isDefaultNews = feedType === NewsType.Default;
|
|
1227
1239
|
if (isDefaultNews) {
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1240
|
+
function _temp15(aDefaultNewsItems) {
|
|
1241
|
+
return _this1.removeExpiredArticleGroup(aDefaultNewsItems);
|
|
1242
|
+
}
|
|
1243
|
+
let _this1$defaultNewsIte = _this1.defaultNewsItems;
|
|
1244
|
+
return Promise.resolve(_this1$defaultNewsIte ? Promise.resolve(_this1.getDefaultNewsData()).then(_temp15) : _temp15(_this1$defaultNewsIte));
|
|
1232
1245
|
} else {
|
|
1233
1246
|
return Promise.resolve(_this1.getCustomFeedData(sFeedId, showAllPreparationRequired));
|
|
1234
1247
|
}
|
|
@@ -1236,6 +1249,25 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1236
1249
|
return Promise.reject(e);
|
|
1237
1250
|
}
|
|
1238
1251
|
},
|
|
1252
|
+
/**
|
|
1253
|
+
* Get the default news feed items.
|
|
1254
|
+
* This method fetches the default news response and processes it to extract the news feed details.
|
|
1255
|
+
* @returns {Promise<INewsFeed[]>} A promise that resolves to an array of default news feed items.
|
|
1256
|
+
* @private
|
|
1257
|
+
*/
|
|
1258
|
+
getDefaultNewsData: function _getDefaultNewsData() {
|
|
1259
|
+
try {
|
|
1260
|
+
const _this10 = this;
|
|
1261
|
+
return Promise.resolve(_this10.getDefaultNewsResponse()).then(function () {
|
|
1262
|
+
if (!_this10.defaultNewsItems) {
|
|
1263
|
+
_this10.defaultNewsItems = _this10.getDefaultNewsFeedDetails(_this10._defaultNewsResponse);
|
|
1264
|
+
}
|
|
1265
|
+
return _this10.defaultNewsItems;
|
|
1266
|
+
});
|
|
1267
|
+
} catch (e) {
|
|
1268
|
+
return Promise.reject(e);
|
|
1269
|
+
}
|
|
1270
|
+
},
|
|
1239
1271
|
/**
|
|
1240
1272
|
* Retrieves custom news feed items identified by the provided feed ID and settings.
|
|
1241
1273
|
* It processes the response data and returns an array of custom news feed items.
|
|
@@ -1246,19 +1278,19 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1246
1278
|
*/
|
|
1247
1279
|
getCustomFeedData: function _getCustomFeedData(sFeedId, showAllPreparationRequired) {
|
|
1248
1280
|
try {
|
|
1249
|
-
const
|
|
1281
|
+
const _this11 = this;
|
|
1250
1282
|
return Promise.resolve(_catch(function () {
|
|
1251
1283
|
let newsDetailUrl;
|
|
1252
|
-
const isEnduser =
|
|
1253
|
-
newsDetailUrl = isEnduser ?
|
|
1284
|
+
const isEnduser = _this11.getParent().getIsEndUserChange().isEndUser;
|
|
1285
|
+
newsDetailUrl = isEnduser ? _this11.getUrl() : _this11.getNewsFeedDetailsUrl({
|
|
1254
1286
|
changeId: sFeedId,
|
|
1255
1287
|
showAllPreparationRequired
|
|
1256
1288
|
});
|
|
1257
|
-
if (!
|
|
1258
|
-
|
|
1289
|
+
if (!_this11.customNewsFeedCache.has(newsDetailUrl)) {
|
|
1290
|
+
_this11.customNewsFeedCache.set(newsDetailUrl, _this11.getAuthNewsFeed(newsDetailUrl));
|
|
1259
1291
|
}
|
|
1260
|
-
return Promise.resolve(
|
|
1261
|
-
const authorizedNewsFeeds =
|
|
1292
|
+
return Promise.resolve(_this11.customNewsFeedCache.get(newsDetailUrl)).then(function (_this11$customNewsFee) {
|
|
1293
|
+
const authorizedNewsFeeds = _this11$customNewsFee;
|
|
1262
1294
|
const oFeedDict = {};
|
|
1263
1295
|
const aFeeds = [];
|
|
1264
1296
|
if (authorizedNewsFeeds?.length > 0) {
|
|
@@ -1268,7 +1300,7 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1268
1300
|
aFeeds.push({
|
|
1269
1301
|
title: title.value,
|
|
1270
1302
|
footer: oFeed[CUSTOM_NEWS_FEED.VALIDITY]?.value,
|
|
1271
|
-
imageUrl:
|
|
1303
|
+
imageUrl: _this11.getCustomFeedImage(title.value)
|
|
1272
1304
|
});
|
|
1273
1305
|
oFeedDict[title.value] = title.value;
|
|
1274
1306
|
}
|
|
@@ -1307,10 +1339,10 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1307
1339
|
*/
|
|
1308
1340
|
getAuthNewsFeed: function _getAuthNewsFeed(sNewsUrl, newsTitle) {
|
|
1309
1341
|
try {
|
|
1310
|
-
const
|
|
1342
|
+
const _this12 = this;
|
|
1311
1343
|
return Promise.resolve(_catch(function () {
|
|
1312
|
-
return Promise.resolve(Promise.all([
|
|
1313
|
-
return aAvailableApps.length === 0 ? aNewsFeed :
|
|
1344
|
+
return Promise.resolve(Promise.all([_this12.getAllAvailableApps(), _this12.getNewsFeedDetails(sNewsUrl, newsTitle)])).then(function ([aAvailableApps, aNewsFeed]) {
|
|
1345
|
+
return aAvailableApps.length === 0 ? aNewsFeed : _this12.arrangeNewsFeeds(aNewsFeed, aAvailableApps);
|
|
1314
1346
|
});
|
|
1315
1347
|
}, function (err) {
|
|
1316
1348
|
Log.error(err);
|
|
@@ -1392,14 +1424,14 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1392
1424
|
getNewsFeedDetails: function _getNewsFeedDetails(sUrl, newsTitle) {
|
|
1393
1425
|
try {
|
|
1394
1426
|
let _exit3 = false;
|
|
1395
|
-
const
|
|
1396
|
-
function
|
|
1427
|
+
const _this13 = this;
|
|
1428
|
+
function _temp17(_result6) {
|
|
1397
1429
|
if (_exit3) return _result6;
|
|
1398
1430
|
const fnFormattedLabel = sLabel => sLabel.replace(/([a-z0-9])([A-Z])/g, "$1 $2");
|
|
1399
|
-
return Promise.resolve(Promise.all([
|
|
1431
|
+
return Promise.resolve(Promise.all([_this13._endUserResponse ? Promise.resolve(_this13._endUserResponse) : HttpHelper.GetJSON(sUrl), _this13.getTranslatedText(_this13.getCustomFeedKey())])).then(function ([newsResponse, translationResponse]) {
|
|
1400
1432
|
let aNews = JSON.parse(JSON.stringify(newsResponse.value || []));
|
|
1401
1433
|
const aTranslation = JSON.parse(JSON.stringify(translationResponse.value || []));
|
|
1402
|
-
aNews =
|
|
1434
|
+
aNews = _this13.filterNewsOnTitle(aNews, newsTitle);
|
|
1403
1435
|
return aNews.map(oNews => {
|
|
1404
1436
|
const aFields = Object.keys(oNews);
|
|
1405
1437
|
const aExpandFields = [];
|
|
@@ -1415,7 +1447,7 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1415
1447
|
}
|
|
1416
1448
|
});
|
|
1417
1449
|
oNews.Link = {
|
|
1418
|
-
label:
|
|
1450
|
+
label: _this13._i18nBundle.getText("readMoreLink"),
|
|
1419
1451
|
value: oNews[CUSTOM_NEWS_FEED.LINK],
|
|
1420
1452
|
text: "Link"
|
|
1421
1453
|
};
|
|
@@ -1425,16 +1457,16 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1425
1457
|
});
|
|
1426
1458
|
});
|
|
1427
1459
|
}
|
|
1428
|
-
const
|
|
1429
|
-
if (
|
|
1430
|
-
return Promise.resolve(
|
|
1431
|
-
const
|
|
1460
|
+
const _temp16 = function () {
|
|
1461
|
+
if (_this13.customNewsFeedCache.has(sUrl)) {
|
|
1462
|
+
return Promise.resolve(_this13.customNewsFeedCache.get(sUrl)).then(function (newsFeedDetails) {
|
|
1463
|
+
const _this13$filterNewsOnT = _this13.filterNewsOnTitle(newsFeedDetails, newsTitle);
|
|
1432
1464
|
_exit3 = true;
|
|
1433
|
-
return
|
|
1465
|
+
return _this13$filterNewsOnT;
|
|
1434
1466
|
});
|
|
1435
1467
|
}
|
|
1436
1468
|
}();
|
|
1437
|
-
return Promise.resolve(
|
|
1469
|
+
return Promise.resolve(_temp16 && _temp16.then ? _temp16.then(_temp17) : _temp17(_temp16));
|
|
1438
1470
|
} catch (e) {
|
|
1439
1471
|
return Promise.reject(e);
|
|
1440
1472
|
}
|
|
@@ -1480,25 +1512,25 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1480
1512
|
*/
|
|
1481
1513
|
loadCustomNewsFeed: function _loadCustomNewsFeed(feeds, feedType) {
|
|
1482
1514
|
try {
|
|
1483
|
-
const
|
|
1484
|
-
const oXMLResponse =
|
|
1485
|
-
const oParent =
|
|
1486
|
-
if (!
|
|
1487
|
-
|
|
1488
|
-
if (!
|
|
1515
|
+
const _this14 = this;
|
|
1516
|
+
const oXMLResponse = _this14.parseJsonToXml(JSON.parse(JSON.stringify(feeds)), feedType);
|
|
1517
|
+
const oParent = _this14.getParent();
|
|
1518
|
+
if (!_this14.oNewsModel) {
|
|
1519
|
+
_this14.oNewsModel = new XMLModel(oXMLResponse);
|
|
1520
|
+
if (!_this14.bNewsLoad) {
|
|
1489
1521
|
oParent?.panelLoadedFn("News", {
|
|
1490
1522
|
loaded: true,
|
|
1491
1523
|
count: DEFAULT_FEED_COUNT
|
|
1492
1524
|
});
|
|
1493
|
-
|
|
1525
|
+
_this14.bNewsLoad = true;
|
|
1494
1526
|
}
|
|
1495
|
-
|
|
1527
|
+
_this14.oNewsTile.setModel(_this14.oNewsModel);
|
|
1496
1528
|
} else {
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1529
|
+
_this14.oNewsTile.unbindAggregation("tiles", false); // Unbind the bound aggregation
|
|
1530
|
+
_this14.oNewsTile.destroyAggregation("tiles"); // Removes old tiles
|
|
1531
|
+
_this14.oNewsModel.setData(oXMLResponse);
|
|
1500
1532
|
}
|
|
1501
|
-
return Promise.resolve(
|
|
1533
|
+
return Promise.resolve(_this14.loadNewsFeed(oXMLResponse, feeds.length)).then(function () {});
|
|
1502
1534
|
} catch (e) {
|
|
1503
1535
|
return Promise.reject(e);
|
|
1504
1536
|
}
|