@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
|
@@ -209,6 +209,7 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
209
209
|
private defaultUrl!: string;
|
|
210
210
|
private _noUpdatesNewsFeed: boolean = false; // flag to check if no updates news tile is shown or not
|
|
211
211
|
private _endUserResponse!: ODataResponse;
|
|
212
|
+
private defaultNewsItems?: INewsFeed[] | null;
|
|
212
213
|
|
|
213
214
|
static readonly metadata: MetadataOptions = {
|
|
214
215
|
library: "sap.cux.home",
|
|
@@ -656,7 +657,6 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
656
657
|
this.oNewsTile.removeStyleClass("sapUiSmallMarginTop");
|
|
657
658
|
} else {
|
|
658
659
|
this.oNewsTile.addStyleClass("sapUiSmallMarginTop");
|
|
659
|
-
this.getNewsWrapper().setWidth("100%");
|
|
660
660
|
}
|
|
661
661
|
}
|
|
662
662
|
|
|
@@ -676,11 +676,11 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
676
676
|
let oTile;
|
|
677
677
|
if (newsInfo.getElementsByTagName("link").length > 0) {
|
|
678
678
|
oTile = new NewsItem(recycleId(`${sId}-news-item`), {
|
|
679
|
-
url: String(this.getPropertyValue(newsInfo, "link")),
|
|
680
|
-
title: String(this.getPropertyValue(newsInfo, "title")),
|
|
681
|
-
subTitle: String(this.getPropertyValue(newsInfo, "description")),
|
|
682
|
-
imageUrl: String(this.getPropertyValue(newsInfo, "imageUrl")),
|
|
683
|
-
footer: this.formatDate(String(this.getPropertyValue(newsInfo, "pubDate")))
|
|
679
|
+
url: String(this.getPropertyValue(newsInfo, "link") ?? ""),
|
|
680
|
+
title: String(this.getPropertyValue(newsInfo, "title") ?? ""),
|
|
681
|
+
subTitle: String(this.getPropertyValue(newsInfo, "description") ?? ""),
|
|
682
|
+
imageUrl: String(this.getPropertyValue(newsInfo, "imageUrl") ?? ""),
|
|
683
|
+
footer: this.formatDate(String(this.getPropertyValue(newsInfo, "pubDate") ?? ""))
|
|
684
684
|
});
|
|
685
685
|
this.addAggregation("newsItems", oTile, true);
|
|
686
686
|
} else {
|
|
@@ -688,12 +688,12 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
688
688
|
let newsId = sGroupId && sGroupId.trim() ? `${sId}-newsgroup-${sGroupId}` : `${sId}-newsgroup`;
|
|
689
689
|
let subTitleNews = this.getPropertyValue(newsInfo, "subTitle") ?? "";
|
|
690
690
|
oTile = new NewsGroup(recycleId(newsId), {
|
|
691
|
-
title: String(this.getPropertyValue(newsInfo, "title")),
|
|
691
|
+
title: String(this.getPropertyValue(newsInfo, "title") ?? ""),
|
|
692
692
|
subTitle: subTitleNews || this._i18nBundle.getText("newsFeedDescription"),
|
|
693
|
-
imageUrl: String(this.getPropertyValue(newsInfo, "imageUrl")),
|
|
694
|
-
footer: String(this.getPropertyValue(newsInfo, "footer")),
|
|
693
|
+
imageUrl: String(this.getPropertyValue(newsInfo, "imageUrl") ?? ""),
|
|
694
|
+
footer: String(this.getPropertyValue(newsInfo, "footer") ?? ""),
|
|
695
695
|
priority: this.getPropertyValue(newsInfo, "priority") as Priority,
|
|
696
|
-
priorityText: String(this.getPropertyValue(newsInfo, "priorityText"))
|
|
696
|
+
priorityText: String(this.getPropertyValue(newsInfo, "priorityText") ?? "")
|
|
697
697
|
});
|
|
698
698
|
this.addAggregation("newsGroup", oTile, true);
|
|
699
699
|
}
|
|
@@ -715,7 +715,7 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
715
715
|
private async extractAllImageUrls(oDocument: Document, noOfFeeds: number) {
|
|
716
716
|
for (let i = 0; i < noOfFeeds; i++) {
|
|
717
717
|
const oItemElement = oDocument?.getElementsByTagName("item")[i];
|
|
718
|
-
const sUrl: string = await this.extractImage(String(oItemElement.getElementsByTagName("link")[0].textContent));
|
|
718
|
+
const sUrl: string = await this.extractImage(String(oItemElement.getElementsByTagName("link")[0].textContent ?? ""));
|
|
719
719
|
const oImageUrl = oDocument.createElement("imageUrl");
|
|
720
720
|
oImageUrl.textContent = sUrl;
|
|
721
721
|
oItemElement.appendChild(oImageUrl);
|
|
@@ -934,30 +934,43 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
934
934
|
* @private
|
|
935
935
|
*/
|
|
936
936
|
private getDefaultNewsFeedDetails(newsResponse: ODataResponse) {
|
|
937
|
-
|
|
938
|
-
const defaultNews: INewsFeed[] = [];
|
|
939
|
-
const defaultFeedDict = {} as Record<string, string>;
|
|
937
|
+
const newsFeedItems: INewsFeed[] = JSON.parse(JSON.stringify(newsResponse.value || [])) as INewsFeed[];
|
|
940
938
|
this.mandatoryNewsFeed = [];
|
|
941
939
|
if (newsFeedItems?.length > 0) {
|
|
942
940
|
this.mandatoryNewsFeed = this.filterMandatoryNews(newsFeedItems).map((oFeed) => oFeed.group_id || "");
|
|
943
941
|
this.markGroupsWithCriticalArticles(newsFeedItems);
|
|
942
|
+
}
|
|
943
|
+
return newsFeedItems;
|
|
944
|
+
}
|
|
944
945
|
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
946
|
+
/**
|
|
947
|
+
* Removes expired article groups from the provided news feed items.
|
|
948
|
+
* An article group is considered expired if it has no associated articles in _group_to_article
|
|
949
|
+
*
|
|
950
|
+
* @param {INewsFeed[]} newsFeedItems - An array of news feed items to filter.
|
|
951
|
+
* @returns {INewsFeed[]} An array of news feed items that have associated articles.
|
|
952
|
+
* @private
|
|
953
|
+
*/
|
|
954
|
+
private removeExpiredArticleGroup(newsFeedItems: INewsFeed[]): INewsFeed[] {
|
|
955
|
+
const defaultNews: INewsFeed[] = [];
|
|
956
|
+
const defaultFeedSet = new Set<string>();
|
|
957
|
+
for (const feed of newsFeedItems) {
|
|
958
|
+
const title = feed.title;
|
|
959
|
+
const group_id = feed.group_id;
|
|
960
|
+
let subTitle = "";
|
|
961
|
+
const hasArticles = (feed._group_to_article?.length ?? 0) > 0;
|
|
962
|
+
if (group_id && !defaultFeedSet.has(group_id) && hasArticles) {
|
|
963
|
+
subTitle = feed.subTitle || feed.description || "";
|
|
964
|
+
defaultNews.push({
|
|
965
|
+
title: title,
|
|
966
|
+
footer: feed?.footer_text,
|
|
967
|
+
imageUrl: this.getDefaultFeedImage(feed),
|
|
968
|
+
group_id: feed.group_id,
|
|
969
|
+
subTitle: subTitle,
|
|
970
|
+
priority: feed?.priority == "1" ? Priority.Medium : Priority.None,
|
|
971
|
+
priorityText: feed?.priority == "1" ? this._i18nBundle.getText("criticalNews") : ""
|
|
972
|
+
});
|
|
973
|
+
defaultFeedSet.add(group_id);
|
|
961
974
|
}
|
|
962
975
|
}
|
|
963
976
|
return defaultNews;
|
|
@@ -1043,6 +1056,7 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
1043
1056
|
}
|
|
1044
1057
|
}
|
|
1045
1058
|
]);
|
|
1059
|
+
|
|
1046
1060
|
if (supported) {
|
|
1047
1061
|
if (this._endUserResponse) {
|
|
1048
1062
|
this._defaultNewsResponse = this._endUserResponse;
|
|
@@ -1083,14 +1097,27 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
1083
1097
|
const feedType = this.getNewsType();
|
|
1084
1098
|
const isDefaultNews = feedType === NewsType.Default;
|
|
1085
1099
|
if (isDefaultNews) {
|
|
1086
|
-
await this.
|
|
1087
|
-
|
|
1088
|
-
return aDefaultgroups;
|
|
1100
|
+
let aDefaultNewsItems = this.defaultNewsItems ?? (await this.getDefaultNewsData());
|
|
1101
|
+
return this.removeExpiredArticleGroup(aDefaultNewsItems);
|
|
1089
1102
|
} else {
|
|
1090
1103
|
return this.getCustomFeedData(sFeedId, showAllPreparationRequired);
|
|
1091
1104
|
}
|
|
1092
1105
|
}
|
|
1093
1106
|
|
|
1107
|
+
/**
|
|
1108
|
+
* Get the default news feed items.
|
|
1109
|
+
* This method fetches the default news response and processes it to extract the news feed details.
|
|
1110
|
+
* @returns {Promise<INewsFeed[]>} A promise that resolves to an array of default news feed items.
|
|
1111
|
+
* @private
|
|
1112
|
+
*/
|
|
1113
|
+
public async getDefaultNewsData(): Promise<INewsFeed[]> {
|
|
1114
|
+
await this.getDefaultNewsResponse();
|
|
1115
|
+
if (!this.defaultNewsItems) {
|
|
1116
|
+
this.defaultNewsItems = this.getDefaultNewsFeedDetails(this._defaultNewsResponse);
|
|
1117
|
+
}
|
|
1118
|
+
return this.defaultNewsItems;
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1094
1121
|
/**
|
|
1095
1122
|
* Retrieves custom news feed items identified by the provided feed ID and settings.
|
|
1096
1123
|
* It processes the response data and returns an array of custom news feed items.
|
|
@@ -27,6 +27,9 @@ declare module "sap/cux/home/NewsSettingsPanel" {
|
|
|
27
27
|
private deselectedDefaultFeeds;
|
|
28
28
|
private headerText;
|
|
29
29
|
private title;
|
|
30
|
+
private groupTable;
|
|
31
|
+
private newsListVBox;
|
|
32
|
+
private _resetActionButton;
|
|
30
33
|
/**
|
|
31
34
|
* Init lifecycle method
|
|
32
35
|
*
|
|
@@ -60,12 +63,18 @@ declare module "sap/cux/home/NewsSettingsPanel" {
|
|
|
60
63
|
*/
|
|
61
64
|
private setTitleMessage;
|
|
62
65
|
/**
|
|
63
|
-
* Returns the content for the news List
|
|
66
|
+
* Returns the content for the news List for custom news feed
|
|
64
67
|
*
|
|
65
68
|
* @private
|
|
66
69
|
* @returns {sap.ui.core.Control} The control containing the News Settings Panel's List
|
|
67
70
|
*/
|
|
68
|
-
private
|
|
71
|
+
private createCustomNewsList;
|
|
72
|
+
/**
|
|
73
|
+
* Creates and returns a table for managing default news group settings.
|
|
74
|
+
* @returns {Table} Table for news groups for default manage news feed
|
|
75
|
+
* @private
|
|
76
|
+
*/
|
|
77
|
+
private createNewsGroupTable;
|
|
69
78
|
/**
|
|
70
79
|
* Checks if the custom file format is CSV based on the custom file name.
|
|
71
80
|
*
|
|
@@ -80,17 +89,31 @@ declare module "sap/cux/home/NewsSettingsPanel" {
|
|
|
80
89
|
* @private
|
|
81
90
|
*/
|
|
82
91
|
private saveNewsFeedSettings;
|
|
83
|
-
/**
|
|
84
|
-
*
|
|
92
|
+
/**
|
|
93
|
+
* Collect selected custom feed titles from the list
|
|
94
|
+
* @returns {string[]} Array of selected custom feed titles
|
|
95
|
+
* @private
|
|
96
|
+
*/
|
|
97
|
+
private collectSelectedCustomFeedTitles;
|
|
98
|
+
/**
|
|
99
|
+
* Collect deselected default group IDs from the table
|
|
100
|
+
* @returns {string[]} Array of deselected default group IDs from the table
|
|
101
|
+
* @private
|
|
102
|
+
*/
|
|
103
|
+
private collectDeselectedDefaultGroupIds;
|
|
104
|
+
/**
|
|
105
|
+
* Get groupId info for the default NewsList
|
|
106
|
+
* @param {HBox | ColumnListItem} contentBox, content Hbox or ColumnListItem
|
|
85
107
|
* @returns {string} groupId
|
|
86
108
|
* @private
|
|
87
109
|
*/
|
|
88
110
|
private getDefaultGroupId;
|
|
89
|
-
/**
|
|
111
|
+
/**
|
|
112
|
+
* Set items for the NewsList for custom news feed
|
|
90
113
|
* @param {Array} [aItems] news items to be set as items aggregation
|
|
91
114
|
* @private
|
|
92
115
|
*/
|
|
93
|
-
private
|
|
116
|
+
private setCustomNewsItems;
|
|
94
117
|
/**
|
|
95
118
|
* Loads news feed settings
|
|
96
119
|
*
|
|
@@ -108,6 +131,12 @@ declare module "sap/cux/home/NewsSettingsPanel" {
|
|
|
108
131
|
* If no news feed is provided, it returns undefined.
|
|
109
132
|
*/
|
|
110
133
|
private _handleDefaultNewsFeed;
|
|
134
|
+
/**
|
|
135
|
+
* This method populates the column list items in the group table for the default news feed settings.
|
|
136
|
+
* @param aItems Array of news feed items
|
|
137
|
+
* @private
|
|
138
|
+
*/
|
|
139
|
+
private setColumnListItems;
|
|
111
140
|
/**
|
|
112
141
|
* @param {INewsFeed[]} aNewsFeed
|
|
113
142
|
* @param aPersNewsFeed
|
|
@@ -120,6 +149,13 @@ declare module "sap/cux/home/NewsSettingsPanel" {
|
|
|
120
149
|
* It also sets the state of the show switch based on the `showAllPreparationRequired` parameter.
|
|
121
150
|
*/
|
|
122
151
|
private _handleCustomNewsFeed;
|
|
152
|
+
/**
|
|
153
|
+
* Resets the default manage news' news settings to default by clearing
|
|
154
|
+
* the personalization data and updating the news panel.
|
|
155
|
+
* @private
|
|
156
|
+
* @returns {Promise<INewsFeed[] | undefined>} A promise that resolves to the updated news feed items or undefined.
|
|
157
|
+
*/
|
|
158
|
+
private resetDefaultNewsSettings;
|
|
123
159
|
/**
|
|
124
160
|
* Checks if the News Settings Panel is supported based on the properties of the News Panel.
|
|
125
161
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewsSettingsPanel.d.ts","sourceRoot":"../../../../..","sources":["src/sap/cux/home/NewsSettingsPanel.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"NewsSettingsPanel.d.ts","sourceRoot":"../../../../..","sources":["src/sap/cux/home/NewsSettingsPanel.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,gCAAgC,CAAC;IAsBhD,OAAO,iBAAiB,MAAM,gCAAgC,CAAC;IAU/D,UAAU,YAAY;QACrB,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,0BAA0B,CAAC,EAAE,OAAO,CAAC;KACrC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,iBAAiB;QAC/D,OAAO,CAAC,WAAW,CAAU;QAC7B,OAAO,CAAC,wBAAwB,CAAQ;QACxC,OAAO,CAAC,KAAK,CAAQ;QACrB,OAAO,CAAC,aAAa,CAAsB;QAC3C,OAAO,CAAC,UAAU,CAAa;QAC/B,OAAO,CAAC,YAAY,CAA0B;QAC9C,OAAO,CAAC,sBAAsB,CAAY;QAC1C,OAAO,CAAC,UAAU,CAAQ;QAC1B,OAAO,CAAC,KAAK,CAAS;QACtB,OAAO,CAAC,UAAU,CAAS;QAC3B,OAAO,CAAC,YAAY,CAAQ;QAC5B,OAAO,CAAC,kBAAkB,CAAU;QAEpC;;;;;WAKG;QACI,IAAI,IAAI,IAAI;QA2BnB;;;;;WAKG;QACH,OAAO,CAAC,UAAU;QAWlB;;WAEG;gBACW,kBAAkB;QAUhC;;;;;WAKG;QACH,OAAO,CAAC,SAAS;QAYjB;;;;;WAKG;QACH,OAAO,CAAC,eAAe;QAkBvB;;;;;WAKG;QACH,OAAO,CAAC,oBAAoB;QA8C5B;;;;WAIG;QACH,OAAO,CAAC,oBAAoB;QA8B5B;;;;;WAKG;QACH,OAAO,CAAC,eAAe;QAIvB;;;;;WAKG;gBACW,oBAAoB;QAoClC;;;;WAIG;QACH,OAAO,CAAC,+BAA+B;QAYvC;;;;WAIG;QACH,OAAO,CAAC,gCAAgC;QAYxC;;;;;WAKG;QACH,OAAO,CAAC,iBAAiB;QAKzB;;;;WAIG;QACH,OAAO,CAAC,kBAAkB;QA2B1B;;;;WAIG;gBACW,oBAAoB;QA6BlC;;;;;;;;;WASG;QACH,OAAO,CAAC,sBAAsB;QAkC9B;;;;WAIG;QACH,OAAO,CAAC,kBAAkB;QA2B1B;;;;;;;;;;WAUG;QACH,OAAO,CAAC,qBAAqB;QA4B7B;;;;;WAKG;gBACW,wBAAwB;QAWtC;;;;WAIG;QACU,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;KAW5C;CAEA"}
|