@sapui5/sap.cux.home 1.138.0 → 1.139.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/AppsAdditionPanel.d.ts.map +1 -1
- package/src/sap/cux/home/AppsAdditionPanel.js +17 -10
- package/src/sap/cux/home/AppsAdditionPanel.js.map +1 -1
- package/src/sap/cux/home/AppsAdditionPanel.ts +19 -12
- package/src/sap/cux/home/AppsContainer.d.ts +0 -1
- package/src/sap/cux/home/AppsContainer.d.ts.map +1 -1
- package/src/sap/cux/home/AppsContainer.js +3 -6
- package/src/sap/cux/home/AppsContainer.js.map +1 -1
- package/src/sap/cux/home/AppsContainer.ts +2 -6
- package/src/sap/cux/home/BaseAppPanel.js +1 -1
- package/src/sap/cux/home/BaseAppPanel.js.map +1 -1
- package/src/sap/cux/home/BaseAppPanel.ts +1 -1
- package/src/sap/cux/home/BaseContainer.js +1 -1
- package/src/sap/cux/home/BaseContainer.js.map +1 -1
- package/src/sap/cux/home/BaseContainer.ts +1 -1
- package/src/sap/cux/home/BaseContainerRenderer.d.ts +4 -4
- package/src/sap/cux/home/BaseContainerRenderer.d.ts.map +1 -1
- package/src/sap/cux/home/BaseContainerRenderer.js +17 -19
- package/src/sap/cux/home/BaseContainerRenderer.js.map +1 -1
- package/src/sap/cux/home/BaseContainerRenderer.ts +21 -25
- package/src/sap/cux/home/BaseSettingsPanel.d.ts +1 -1
- package/src/sap/cux/home/BaseSettingsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/BaseSettingsPanel.js +2 -1
- package/src/sap/cux/home/BaseSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/BaseSettingsPanel.ts +4 -2
- package/src/sap/cux/home/CardsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/CardsPanel.js +2 -2
- package/src/sap/cux/home/CardsPanel.js.map +1 -1
- package/src/sap/cux/home/CardsPanel.ts +2 -5
- package/src/sap/cux/home/ContentAdditionDialog.js +1 -1
- package/src/sap/cux/home/ContentAdditionDialog.js.map +1 -1
- package/src/sap/cux/home/ContentAdditionDialog.ts +1 -1
- package/src/sap/cux/home/InsightsAdditionPanel.d.ts.map +1 -1
- package/src/sap/cux/home/InsightsAdditionPanel.js +4 -7
- package/src/sap/cux/home/InsightsAdditionPanel.js.map +1 -1
- package/src/sap/cux/home/InsightsAdditionPanel.ts +4 -8
- package/src/sap/cux/home/InsightsContainer.d.ts +0 -1
- package/src/sap/cux/home/InsightsContainer.d.ts.map +1 -1
- package/src/sap/cux/home/InsightsContainer.js +4 -4
- package/src/sap/cux/home/InsightsContainer.js.map +1 -1
- package/src/sap/cux/home/InsightsContainer.ts +11 -5
- package/src/sap/cux/home/KeyUserNewsPagesSettingsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/KeyUserNewsPagesSettingsPanel.js +5 -3
- package/src/sap/cux/home/KeyUserNewsPagesSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/KeyUserNewsPagesSettingsPanel.ts +4 -2
- package/src/sap/cux/home/KeyUserNewsSettingsPanel.d.ts +11 -5
- package/src/sap/cux/home/KeyUserNewsSettingsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/KeyUserNewsSettingsPanel.js +160 -82
- package/src/sap/cux/home/KeyUserNewsSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/KeyUserNewsSettingsPanel.ts +164 -82
- package/src/sap/cux/home/Layout.d.ts +0 -1
- package/src/sap/cux/home/Layout.d.ts.map +1 -1
- package/src/sap/cux/home/Layout.js +0 -1
- package/src/sap/cux/home/Layout.js.map +1 -1
- package/src/sap/cux/home/Layout.ts +0 -2
- package/src/sap/cux/home/NewsAndPagesContainer.d.ts +22 -1
- package/src/sap/cux/home/NewsAndPagesContainer.d.ts.map +1 -1
- package/src/sap/cux/home/NewsAndPagesContainer.js +47 -19
- package/src/sap/cux/home/NewsAndPagesContainer.js.map +1 -1
- package/src/sap/cux/home/NewsAndPagesContainer.ts +52 -19
- package/src/sap/cux/home/NewsGroup.d.ts.map +1 -1
- package/src/sap/cux/home/NewsGroup.js +11 -6
- package/src/sap/cux/home/NewsGroup.js.map +1 -1
- package/src/sap/cux/home/NewsGroup.ts +11 -8
- package/src/sap/cux/home/NewsPanel.d.ts +34 -5
- package/src/sap/cux/home/NewsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/NewsPanel.gen.d.ts +0 -91
- package/src/sap/cux/home/NewsPanel.js +279 -198
- package/src/sap/cux/home/NewsPanel.js.map +1 -1
- package/src/sap/cux/home/NewsPanel.ts +165 -99
- package/src/sap/cux/home/NewsSettingsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/NewsSettingsPanel.js +10 -6
- package/src/sap/cux/home/NewsSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/NewsSettingsPanel.ts +12 -6
- package/src/sap/cux/home/NoDataContainer.d.ts +0 -1
- package/src/sap/cux/home/NoDataContainer.d.ts.map +1 -1
- package/src/sap/cux/home/SpaceInsightsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/SpaceInsightsPanel.js +4 -1
- package/src/sap/cux/home/SpaceInsightsPanel.js.map +1 -1
- package/src/sap/cux/home/SpaceInsightsPanel.ts +4 -1
- package/src/sap/cux/home/TaskPanel.d.ts.map +1 -1
- package/src/sap/cux/home/TaskPanel.js +2 -9
- package/src/sap/cux/home/TaskPanel.js.map +1 -1
- package/src/sap/cux/home/TaskPanel.ts +3 -9
- package/src/sap/cux/home/TilesPanel.d.ts.map +1 -1
- package/src/sap/cux/home/TilesPanel.js +4 -4
- package/src/sap/cux/home/TilesPanel.js.map +1 -1
- package/src/sap/cux/home/TilesPanel.ts +4 -10
- package/src/sap/cux/home/ToDoPanel.d.ts.map +1 -1
- package/src/sap/cux/home/ToDoPanel.js +2 -17
- package/src/sap/cux/home/ToDoPanel.js.map +1 -1
- package/src/sap/cux/home/ToDoPanel.ts +2 -18
- package/src/sap/cux/home/ToDosContainer.d.ts +0 -1
- package/src/sap/cux/home/ToDosContainer.d.ts.map +1 -1
- package/src/sap/cux/home/ToDosContainer.js +2 -2
- package/src/sap/cux/home/ToDosContainer.js.map +1 -1
- package/src/sap/cux/home/ToDosContainer.ts +1 -1
- package/src/sap/cux/home/changeHandler/SetNewsFeedUrl.d.ts.map +1 -1
- package/src/sap/cux/home/changeHandler/SetNewsFeedUrl.js +1 -0
- package/src/sap/cux/home/changeHandler/SetNewsFeedUrl.js.map +1 -1
- package/src/sap/cux/home/changeHandler/SetNewsFeedUrl.ts +1 -0
- package/src/sap/cux/home/i18n/messagebundle.properties +17 -5
- package/src/sap/cux/home/i18n/messagebundle_ar.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_bg.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_ca.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_cnr.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_cs.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_cy.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_da.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_de.properties +15 -15
- package/src/sap/cux/home/i18n/messagebundle_el.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_en.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_en_GB.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_en_US_sappsd.properties +12 -6
- package/src/sap/cux/home/i18n/messagebundle_en_US_saprigi.properties +12 -6
- package/src/sap/cux/home/i18n/messagebundle_en_US_saptrc.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_es.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_es_MX.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_et.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_fi.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_fr.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_fr_CA.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_hi.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_hr.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_hu.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_id.properties +6 -6
- package/src/sap/cux/home/i18n/messagebundle_it.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_iw.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_ja.properties +9 -9
- package/src/sap/cux/home/i18n/messagebundle_kk.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_ko.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_lt.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_lv.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_mk.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_ms.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_nl.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_no.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_pl.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_pt.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_pt_PT.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_ro.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_ru.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_sh.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_sk.properties +6 -6
- package/src/sap/cux/home/i18n/messagebundle_sl.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_sr.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_sv.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_th.properties +7 -7
- package/src/sap/cux/home/i18n/messagebundle_tr.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_uk.properties +6 -6
- package/src/sap/cux/home/i18n/messagebundle_vi.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_zh_CN.properties +5 -5
- package/src/sap/cux/home/i18n/messagebundle_zh_TW.properties +5 -5
- package/src/sap/cux/home/interface/CardsInterface.d.ts +1 -5
- package/src/sap/cux/home/interface/CardsInterface.d.ts.map +1 -1
- package/src/sap/cux/home/interface/CardsInterface.js.map +1 -1
- package/src/sap/cux/home/interface/CardsInterface.ts +1 -1
- package/src/sap/cux/home/interface/KeyUserInterface.d.ts +2 -0
- package/src/sap/cux/home/interface/KeyUserInterface.d.ts.map +1 -1
- package/src/sap/cux/home/interface/KeyUserInterface.js.map +1 -1
- package/src/sap/cux/home/interface/KeyUserInterface.ts +2 -0
- package/src/sap/cux/home/library.d.ts +16 -9
- package/src/sap/cux/home/library.d.ts.map +1 -1
- package/src/sap/cux/home/library.js +16 -9
- package/src/sap/cux/home/library.js.map +1 -1
- package/src/sap/cux/home/library.ts +17 -9
- package/src/sap/cux/home/themes/base/ContentAdditionDialog.less +0 -8
- package/src/sap/cux/home/themes/base/NewsAndPagesContainer.less +4 -0
- package/src/sap/cux/home/themes/base/ToDosContainer.less +2 -1
- package/src/sap/cux/home/utils/CommonUtils.d.ts +1 -1
- package/src/sap/cux/home/utils/CommonUtils.d.ts.map +1 -1
- package/src/sap/cux/home/utils/CommonUtils.js.map +1 -1
- package/src/sap/cux/home/utils/CommonUtils.ts +5 -2
- package/src/sap/cux/home/utils/FeatureUtils.js +0 -2
- package/src/sap/cux/home/utils/FeatureUtils.js.map +1 -1
- package/src/sap/cux/home/utils/FeatureUtils.ts +3 -3
- package/src/sap/cux/home/utils/HttpHelper.js.map +1 -1
- package/src/sap/cux/home/utils/HttpHelper.ts +1 -1
- package/src/sap/cux/home/utils/KeyUserPersonalization.d.ts.map +1 -1
- package/src/sap/cux/home/utils/KeyUserPersonalization.js +0 -1
- package/src/sap/cux/home/utils/KeyUserPersonalization.js.map +1 -1
- package/src/sap/cux/home/utils/KeyUserPersonalization.ts +0 -1
- package/src/sap/cux/home/utils/fragment/appsAdditionContent.fragment.xml +9 -4
- package/src/sap/cux/home/{AppsContainerGenericPlaceholder.d.ts → utils/placeholder/AppsPlaceholder.d.ts} +2 -2
- package/src/sap/cux/home/utils/placeholder/AppsPlaceholder.d.ts.map +1 -0
- package/src/sap/cux/home/{AppsContainerGenericPlaceholder.js → utils/placeholder/AppsPlaceholder.js} +1 -1
- package/src/sap/cux/home/utils/placeholder/AppsPlaceholder.js.map +1 -0
- package/src/sap/cux/home/utils/placeholder/InsightsPlaceholder.d.ts +8 -0
- package/src/sap/cux/home/utils/placeholder/InsightsPlaceholder.d.ts.map +1 -0
- package/src/sap/cux/home/{InsightsContainerGenericPlaceholder.js → utils/placeholder/InsightsPlaceholder.js} +1 -1
- package/src/sap/cux/home/utils/placeholder/InsightsPlaceholder.js.map +1 -0
- package/src/sap/cux/home/{InsightsContainerGenericPlaceholder.d.ts → utils/placeholder/NewsAndPagesPlaceholder.d.ts} +3 -3
- package/src/sap/cux/home/utils/placeholder/NewsAndPagesPlaceholder.d.ts.map +1 -0
- package/src/sap/cux/home/{NewsAndPagesContainerGenericPlaceholder.js → utils/placeholder/NewsAndPagesPlaceholder.js} +1 -1
- package/src/sap/cux/home/utils/placeholder/NewsAndPagesPlaceholder.js.map +1 -0
- package/src/sap/cux/home/{ToDosContainerGenericPlaceholder.d.ts → utils/placeholder/ToDosPlaceholder.d.ts} +2 -2
- package/src/sap/cux/home/utils/placeholder/ToDosPlaceholder.d.ts.map +1 -0
- package/src/sap/cux/home/{ToDosContainerGenericPlaceholder.js → utils/placeholder/ToDosPlaceholder.js} +1 -1
- package/src/sap/cux/home/utils/placeholder/ToDosPlaceholder.js.map +1 -0
- package/src/sap/cux/home/AppsContainerGenericPlaceholder.d.ts.map +0 -1
- package/src/sap/cux/home/AppsContainerGenericPlaceholder.js.map +0 -1
- package/src/sap/cux/home/InsightsContainerGenericPlaceholder.d.ts.map +0 -1
- package/src/sap/cux/home/InsightsContainerGenericPlaceholder.js.map +0 -1
- package/src/sap/cux/home/NewsAndPagesContainerGenericPlaceholder.d.ts +0 -8
- package/src/sap/cux/home/NewsAndPagesContainerGenericPlaceholder.d.ts.map +0 -1
- package/src/sap/cux/home/NewsAndPagesContainerGenericPlaceholder.js.map +0 -1
- package/src/sap/cux/home/ToDosContainerGenericPlaceholder.d.ts.map +0 -1
- package/src/sap/cux/home/ToDosContainerGenericPlaceholder.js.map +0 -1
- /package/src/sap/cux/home/{AppsContainerGenericPlaceholder.ts → utils/placeholder/AppsPlaceholder.ts} +0 -0
- /package/src/sap/cux/home/{InsightsContainerGenericPlaceholder.ts → utils/placeholder/InsightsPlaceholder.ts} +0 -0
- /package/src/sap/cux/home/{NewsAndPagesContainerGenericPlaceholder.ts → utils/placeholder/NewsAndPagesPlaceholder.ts} +0 -0
- /package/src/sap/cux/home/{ToDosContainerGenericPlaceholder.ts → utils/placeholder/ToDosPlaceholder.ts} +0 -0
|
@@ -24,7 +24,7 @@ import NewsAndPagesContainer from "./NewsAndPagesContainer";
|
|
|
24
24
|
import NewsGroup from "./NewsGroup";
|
|
25
25
|
import NewsItem from "./NewsItem";
|
|
26
26
|
import { NewsType } from "./library";
|
|
27
|
-
import {
|
|
27
|
+
import { DEFAULT_NEWS_PLACEHOLDER, DEFAULT_NEWS_URL } from "./utils/Constants";
|
|
28
28
|
import { recycleId } from "./utils/DataFormatUtils";
|
|
29
29
|
import { DeviceType } from "./utils/Device";
|
|
30
30
|
import { addFESRId } from "./utils/FESRUtil";
|
|
@@ -132,6 +132,13 @@ const BASE_URL = "/sap/opu/odata4/ui2/insights_srv/srvd/ui2/",
|
|
|
132
132
|
NEWS_FEED_READ_API = BASE_URL + "insights_read_srv/0001/" + "NEWS_FEED",
|
|
133
133
|
NEWS_FEED_TRANSLATION_API = BASE_URL + "insights_read_srv/0001/" + "NewsFeedColumnTranslation",
|
|
134
134
|
DEFAULT_FEED_COUNT = 7,
|
|
135
|
+
NEWS_HEIGHT = {
|
|
136
|
+
LargeDesktop: "17rem",
|
|
137
|
+
XLargeDesktop: "17rem",
|
|
138
|
+
Desktop: "17rem",
|
|
139
|
+
Tablet: "14rem",
|
|
140
|
+
Mobile: "11rem"
|
|
141
|
+
},
|
|
135
142
|
fnImagePlaceholder = function (sPath: string, N: number) {
|
|
136
143
|
return Array.from({ length: N }, function (v, i) {
|
|
137
144
|
return sPath + "/" + (i + 1) + ".jpg";
|
|
@@ -201,6 +208,8 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
201
208
|
private _defaultNewsPromise: Promise<ODataResponse> | null = null;
|
|
202
209
|
private fetchedFeedUrl!: string;
|
|
203
210
|
private defaultUrl!: string;
|
|
211
|
+
private _noUpdatesNewsFeed: boolean = false; // flag to check if no updates news tile is shown or not
|
|
212
|
+
private _endUserResponse!: ODataResponse;
|
|
204
213
|
|
|
205
214
|
static readonly metadata: MetadataOptions = {
|
|
206
215
|
library: "sap.cux.home",
|
|
@@ -214,13 +223,13 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
214
223
|
/**
|
|
215
224
|
* Type of the news item.
|
|
216
225
|
*
|
|
217
|
-
* @
|
|
226
|
+
* @private
|
|
218
227
|
*/
|
|
219
228
|
type: {
|
|
220
229
|
type: "sap.cux.home.NewsType",
|
|
221
230
|
group: "Misc",
|
|
222
|
-
visibility: "
|
|
223
|
-
defaultValue: NewsType.
|
|
231
|
+
visibility: "hidden",
|
|
232
|
+
defaultValue: NewsType.Default
|
|
224
233
|
},
|
|
225
234
|
/**
|
|
226
235
|
* The key of custom news feed.
|
|
@@ -234,19 +243,6 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
234
243
|
* @private
|
|
235
244
|
*/
|
|
236
245
|
customFileName: { type: "string", group: "Misc", defaultValue: "" },
|
|
237
|
-
/**
|
|
238
|
-
* The flag for custom news feed is checked or not.
|
|
239
|
-
*
|
|
240
|
-
* @private
|
|
241
|
-
*/
|
|
242
|
-
showCustom: { type: "boolean", group: "Misc", defaultValue: false },
|
|
243
|
-
|
|
244
|
-
/**
|
|
245
|
-
* Property to set default News.
|
|
246
|
-
*
|
|
247
|
-
* @private
|
|
248
|
-
*/
|
|
249
|
-
showDefault: { type: "boolean", group: "Misc", defaultValue: false },
|
|
250
246
|
/**
|
|
251
247
|
* The flag to determine rss feed will load or not.
|
|
252
248
|
*
|
|
@@ -289,11 +285,12 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
289
285
|
*/
|
|
290
286
|
public init(): void {
|
|
291
287
|
super.init();
|
|
288
|
+
const deviceType = this.getDeviceType();
|
|
292
289
|
|
|
293
290
|
this.oNewsTile = new SlideTile(this.getId() + "--idNewsSlide", {
|
|
294
291
|
displayTime: 20000,
|
|
295
292
|
width: "100%",
|
|
296
|
-
height:
|
|
293
|
+
height: NEWS_HEIGHT[deviceType as keyof typeof NEWS_HEIGHT],
|
|
297
294
|
tiles: [
|
|
298
295
|
new GenericTile(this.getId() + "--placeholder", {
|
|
299
296
|
state: "Loading",
|
|
@@ -326,43 +323,58 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
326
323
|
*/
|
|
327
324
|
public async getData() {
|
|
328
325
|
let sUrl: string = this.getUrl();
|
|
329
|
-
let showCustom = this.getProperty("
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
this.setProperty("showDefault", true);
|
|
333
|
-
}
|
|
334
|
-
let showDefault = this.getProperty("showDefault") as boolean;
|
|
335
|
-
this.mandatoryNewsFeed = [];
|
|
326
|
+
let showCustom = this.getProperty("type") === NewsType.Custom;
|
|
327
|
+
let showDefault = this.getProperty("type") === NewsType.Default;
|
|
328
|
+
let showRssAtom = this.getProperty("type") === NewsType.NewsUrl;
|
|
336
329
|
|
|
330
|
+
this.mandatoryNewsFeed = [];
|
|
337
331
|
if (this.fetchedFeedUrl && this.fetchedFeedUrl === sUrl) {
|
|
338
332
|
return;
|
|
339
333
|
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
this.defaultUrl = sUrl && sUrl.includes(DEFAULT_NEWS_BASE_URL) ? sUrl : DEFAULT_NEWS_URL;
|
|
352
|
-
this.bNewsLoad = this.bNewsLoad || false;
|
|
353
|
-
await this.setDefaultNews(showDefault);
|
|
354
|
-
} else if (this.getProperty("showCustom")) {
|
|
355
|
-
//custom news scenario
|
|
356
|
-
this.bNewsLoad = this.bNewsLoad || false;
|
|
357
|
-
this.oManageMenuItem.setVisible(true);
|
|
358
|
-
const sCustomNewsFeedKey = this.getCustomFeedKey();
|
|
359
|
-
if (sCustomNewsFeedKey) {
|
|
360
|
-
await this.setCustomNewsFeed(sCustomNewsFeedKey);
|
|
334
|
+
const endUserChange = (this.getParent() as NewsAndPagesContainer).getIsEndUserChange();
|
|
335
|
+
if (endUserChange.isEndUser) {
|
|
336
|
+
//url scenario (developer side)
|
|
337
|
+
const response = await fetch(sUrl);
|
|
338
|
+
if (!response.ok) {
|
|
339
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
340
|
+
}
|
|
341
|
+
const contentType = response.headers.get("content-type");
|
|
342
|
+
if (contentType && contentType.includes("application/json")) {
|
|
343
|
+
this._endUserResponse = (await response.json()) as ODataResponse;
|
|
344
|
+
await this.setNewsFeedFromUrl(this._endUserResponse?.value);
|
|
361
345
|
} else {
|
|
362
|
-
|
|
346
|
+
endUserChange.newsType = NewsType.NewsUrl;
|
|
347
|
+
this.oNewsModel = await this.initializeXmlModel(sUrl);
|
|
348
|
+
this.oNewsTile.setModel(this.oNewsModel);
|
|
349
|
+
this.oManageMenuItem.setVisible(false);
|
|
363
350
|
}
|
|
364
351
|
} else {
|
|
365
|
-
|
|
352
|
+
//key user scenarios
|
|
353
|
+
if (!this.persDataNewsFeed) {
|
|
354
|
+
await this.setPersDataNewsFeed(showDefault);
|
|
355
|
+
}
|
|
356
|
+
if (showDefault) {
|
|
357
|
+
//default news scenario
|
|
358
|
+
this.bNewsLoad = this.bNewsLoad || false;
|
|
359
|
+
await this.setDefaultNews();
|
|
360
|
+
} else if (sUrl && showRssAtom) {
|
|
361
|
+
//rss feed scenario
|
|
362
|
+
this.oNewsModel = await this.initializeXmlModel(sUrl);
|
|
363
|
+
this.oNewsTile.setModel(this.oNewsModel);
|
|
364
|
+
this.oManageMenuItem.setVisible(false);
|
|
365
|
+
} else if (showCustom) {
|
|
366
|
+
//custom news scenario
|
|
367
|
+
this.bNewsLoad = this.bNewsLoad || false;
|
|
368
|
+
this.oManageMenuItem.setVisible(true);
|
|
369
|
+
const sCustomNewsFeedKey = this.getCustomFeedKey();
|
|
370
|
+
if (sCustomNewsFeedKey) {
|
|
371
|
+
await this.setCustomNewsFeed(sCustomNewsFeedKey);
|
|
372
|
+
} else {
|
|
373
|
+
this.handleFeedError();
|
|
374
|
+
}
|
|
375
|
+
} else {
|
|
376
|
+
this.handleFeedError();
|
|
377
|
+
}
|
|
366
378
|
}
|
|
367
379
|
this.fireEvent("loaded");
|
|
368
380
|
this.adjustLayout();
|
|
@@ -374,23 +386,16 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
374
386
|
* @param {boolean} [isKeyUserChange=false] - Indicates if the change is made by a key user.
|
|
375
387
|
* @private
|
|
376
388
|
*/
|
|
377
|
-
public async setDefaultNews(
|
|
378
|
-
// default news scenario, if url property is passed
|
|
379
|
-
// check if url contains default news base url
|
|
389
|
+
public async setDefaultNews() {
|
|
390
|
+
// default news scenario, if url property is passed or showDefault is true
|
|
380
391
|
|
|
381
392
|
let sUrl: string = this.getUrl();
|
|
382
|
-
|
|
393
|
+
const isEndUser = (this.getParent() as NewsAndPagesContainer).getIsEndUserChange().isEndUser;
|
|
394
|
+
this.defaultUrl = isEndUser ? sUrl : DEFAULT_NEWS_URL;
|
|
383
395
|
this.fetchedFeedUrl = this.defaultUrl;
|
|
384
|
-
this.setProperty("showDefault", showDefault);
|
|
385
396
|
|
|
386
397
|
//reset properties
|
|
387
|
-
this.setProperty("showCustom", false);
|
|
388
398
|
this.setProperty("newsAvailable", true);
|
|
389
|
-
// if user specifically set defaultNews true,
|
|
390
|
-
// then even though url is available in key user settings url input, preference goes to showDefault
|
|
391
|
-
if (isKeyUserChange) {
|
|
392
|
-
this.setProperty("url", "");
|
|
393
|
-
}
|
|
394
399
|
this.generateErrorMessage().setVisible(false);
|
|
395
400
|
(this.getNewsWrapper()?.getParent() as FlexBox).setVisible(true);
|
|
396
401
|
this.oManageMenuItem.setVisible(true);
|
|
@@ -432,15 +437,32 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
432
437
|
const newsGroups = this.getAggregation("newsGroup") as NewsGroup[] | undefined;
|
|
433
438
|
if (!Array.isArray(newsGroups)) return;
|
|
434
439
|
|
|
435
|
-
//
|
|
440
|
+
// Build groupDetailsMap for group details to avoid multiple iterations and clean up descriptions by removing inline styles if any
|
|
436
441
|
const groupDetailsMap: IGroupDetailsMap = {};
|
|
442
|
+
const groupHasDescription: Record<string, boolean> = {};
|
|
443
|
+
|
|
437
444
|
(this._defaultNewsResponse.value || []).forEach((group) => {
|
|
445
|
+
// Clean group description
|
|
446
|
+
if (group?.description && group.description.trim().length > 0) {
|
|
447
|
+
group.description = this.removeInlineStylesFromDescription(group.description);
|
|
448
|
+
}
|
|
438
449
|
if (group?.group_id) {
|
|
439
|
-
|
|
450
|
+
const articles = group._group_to_article || [];
|
|
451
|
+
// Clean article descriptions and check if any article has a valid description
|
|
452
|
+
let hasDescription = false;
|
|
453
|
+
articles.forEach((article: INewsFeed) => {
|
|
454
|
+
if (article?.description && article.description.trim().length > 0) {
|
|
455
|
+
article.description = this.removeInlineStylesFromDescription(article.description);
|
|
456
|
+
hasDescription = true;
|
|
457
|
+
}
|
|
458
|
+
});
|
|
459
|
+
groupDetailsMap[group.group_id] = articles;
|
|
460
|
+
groupHasDescription[group.group_id] = hasDescription;
|
|
440
461
|
}
|
|
441
462
|
});
|
|
442
463
|
|
|
443
464
|
const newsGroupMap: INewsGroupMap = {};
|
|
465
|
+
// Iterate through the news groups and map group IDs to NewsGroup instances
|
|
444
466
|
newsGroups
|
|
445
467
|
.filter((group) => group instanceof NewsGroup)
|
|
446
468
|
.forEach((group) => {
|
|
@@ -450,25 +472,26 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
450
472
|
}
|
|
451
473
|
});
|
|
452
474
|
|
|
453
|
-
//
|
|
475
|
+
// If no description is found in any of the articles within the group,
|
|
476
|
+
// disable the pressEnabled property for the news group to prevent user interaction.
|
|
454
477
|
feeds.forEach((feed) => {
|
|
455
478
|
if (!feed.group_id) return;
|
|
456
|
-
|
|
457
|
-
const groupArticles = groupDetailsMap[feed.group_id];
|
|
458
479
|
const newsGroup = newsGroupMap[feed.group_id];
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
const hasDescription = groupArticles.some((article) => !!article.description && article.description.length > 0);
|
|
462
|
-
|
|
463
|
-
// If no description is found in any of the articles within the group,
|
|
464
|
-
// disable the pressEnabled property for the news group to prevent user interaction.
|
|
465
|
-
if (!hasDescription) {
|
|
466
|
-
newsGroup.getTile()?.setProperty("pressEnabled", false);
|
|
467
|
-
}
|
|
480
|
+
if (newsGroup && !groupHasDescription[feed.group_id]) {
|
|
481
|
+
newsGroup.getTile()?.setProperty("pressEnabled", false);
|
|
468
482
|
}
|
|
469
483
|
});
|
|
470
484
|
}
|
|
471
485
|
|
|
486
|
+
/**
|
|
487
|
+
*
|
|
488
|
+
* @param description - The description from which inline styles need to be removed.
|
|
489
|
+
* @returns {string} The description with inline styles removed.
|
|
490
|
+
*/
|
|
491
|
+
private removeInlineStylesFromDescription(description: string): string {
|
|
492
|
+
return description.replace(/\s*style\s*=\s*(['"])[\s\S]*?\1/gi, "");
|
|
493
|
+
}
|
|
494
|
+
|
|
472
495
|
/**
|
|
473
496
|
* Retrieves the current news group data based on the provided id.
|
|
474
497
|
*
|
|
@@ -589,7 +612,7 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
589
612
|
* @returns {void}
|
|
590
613
|
*/
|
|
591
614
|
public handleFeedError(): void {
|
|
592
|
-
if (this.
|
|
615
|
+
if (this.getNewsType() === NewsType.Custom || this.getNewsType() === NewsType.Default) {
|
|
593
616
|
this.generateErrorMessage().setVisible(true);
|
|
594
617
|
if (!this.isParentBaseLayout()) {
|
|
595
618
|
this.setManageNewsButtonVisibility(false);
|
|
@@ -603,7 +626,7 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
603
626
|
}
|
|
604
627
|
|
|
605
628
|
public async setURL(url: string) {
|
|
606
|
-
this.setProperty("
|
|
629
|
+
this.setProperty("type", NewsType.NewsUrl);
|
|
607
630
|
this.setProperty("newsAvailable", true);
|
|
608
631
|
this.generateErrorMessage().setVisible(false);
|
|
609
632
|
(this.getNewsWrapper()?.getParent() as FlexBox).setVisible(true);
|
|
@@ -618,12 +641,13 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
618
641
|
* @private
|
|
619
642
|
*/
|
|
620
643
|
public adjustLayout() {
|
|
621
|
-
|
|
622
|
-
|
|
644
|
+
const deviceType = this.getDeviceType();
|
|
645
|
+
this.oNewsTile.setHeight(NEWS_HEIGHT[deviceType as keyof typeof NEWS_HEIGHT]);
|
|
646
|
+
|
|
647
|
+
if (deviceType === DeviceType.Mobile) {
|
|
623
648
|
this.generateErrorMessage().setWidth("100%");
|
|
624
649
|
this.oNewsTile.removeStyleClass("sapUiSmallMarginTop");
|
|
625
650
|
} else {
|
|
626
|
-
this.oNewsTile.setHeight("17rem");
|
|
627
651
|
this.oNewsTile.addStyleClass("sapUiSmallMarginTop");
|
|
628
652
|
(this.getNewsWrapper()?.getParent() as FlexBox).setWidth("100%");
|
|
629
653
|
}
|
|
@@ -736,6 +760,9 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
736
760
|
.catch(fnLoadPlaceholderImage);
|
|
737
761
|
}
|
|
738
762
|
|
|
763
|
+
public getNewsType(): NewsType {
|
|
764
|
+
return (this.getParent() as NewsAndPagesContainer)?.getIsEndUserChange?.()?.newsType || (this.getProperty("type") as NewsType);
|
|
765
|
+
}
|
|
739
766
|
/**
|
|
740
767
|
* Checks if the custom file format is CSV based on the custom file name.
|
|
741
768
|
*
|
|
@@ -760,6 +787,27 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
760
787
|
this.persDataNewsFeed = (defaultFeed ? persData?.defaultNewsFeed : persData?.favNewsFeed) as IPersDataNewsFeed;
|
|
761
788
|
}
|
|
762
789
|
|
|
790
|
+
/**
|
|
791
|
+
* Sets the news feed type (Default or Custom) based on the provided data structure.
|
|
792
|
+
*
|
|
793
|
+
* @param {INewsFeed[]} data - News feed data from the URL.
|
|
794
|
+
* @returns {Promise<void>} Resolves after setting the appropriate feed.
|
|
795
|
+
*/
|
|
796
|
+
public async setNewsFeedFromUrl(data: INewsFeed[]): Promise<void> {
|
|
797
|
+
const item = data?.[0];
|
|
798
|
+
|
|
799
|
+
if (item && "group_id" in item && "title" in item) {
|
|
800
|
+
(this.getParent() as NewsAndPagesContainer).getIsEndUserChange().newsType = NewsType.Default;
|
|
801
|
+
await this.setDefaultNews();
|
|
802
|
+
} else if (item && "LineOfBusiness" in item) {
|
|
803
|
+
(this.getParent() as NewsAndPagesContainer).getIsEndUserChange().newsType = NewsType.Custom;
|
|
804
|
+
this.oManageMenuItem.setVisible(true);
|
|
805
|
+
await this.setCustomNewsFeed("");
|
|
806
|
+
} else {
|
|
807
|
+
this.handleFeedError();
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
|
|
763
811
|
/**
|
|
764
812
|
* This method retrieves the count and feeds of the custom news feed asynchronously.
|
|
765
813
|
* If the count is not zero, it loads the custom news feed data and returns the feeds.
|
|
@@ -771,7 +819,8 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
771
819
|
try {
|
|
772
820
|
this.oNewsTile.setVisible(true);
|
|
773
821
|
this.generateErrorMessage().setVisible(false);
|
|
774
|
-
const
|
|
822
|
+
const feedType = this.getNewsType();
|
|
823
|
+
const isDefaultNews = feedType === NewsType.Default;
|
|
775
824
|
await this.setPersDataNewsFeed(isDefaultNews);
|
|
776
825
|
const customFileName = this.getProperty("customFileName") as string;
|
|
777
826
|
const showAllPrepRequired = this.isCSVFileFormat(customFileName)
|
|
@@ -782,7 +831,7 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
782
831
|
CUSTOM_NEWS_FEED.EXCLUDE_FIELDS.push("PreparationRequired");
|
|
783
832
|
}
|
|
784
833
|
const showPrep = isDefaultNews ? true : showAllPrepRequired;
|
|
785
|
-
let newsFeeds = await this.
|
|
834
|
+
let newsFeeds = await this.getCustomOrDefaultNewsFeed(sFeedId || "", showPrep);
|
|
786
835
|
|
|
787
836
|
if (newsFeeds.length === 0) {
|
|
788
837
|
throw new Error("Error: No news feed available");
|
|
@@ -893,12 +942,12 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
893
942
|
subTitle = feed.subTitle || feed.description || "";
|
|
894
943
|
defaultNews.push({
|
|
895
944
|
title: title,
|
|
896
|
-
footer: feed
|
|
945
|
+
footer: feed?.footer_text,
|
|
897
946
|
imageUrl: this.getDefaultFeedImage(feed),
|
|
898
947
|
group_id: feed.group_id,
|
|
899
948
|
subTitle: subTitle,
|
|
900
|
-
priority: feed
|
|
901
|
-
priorityText: feed
|
|
949
|
+
priority: feed?.priority == "1" ? Priority.Medium : Priority.None,
|
|
950
|
+
priorityText: feed?.priority == "1" ? this._i18nBundle.getText("criticalNews") : ""
|
|
902
951
|
});
|
|
903
952
|
defaultFeedDict[title] = title;
|
|
904
953
|
}
|
|
@@ -938,10 +987,10 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
938
987
|
|
|
939
988
|
/**
|
|
940
989
|
*
|
|
941
|
-
* @returns {ODataResponse} The placeholder news group with enriched titles and descriptions
|
|
990
|
+
* @returns {ODataResponse} The no update placeholder news group with enriched titles and descriptions to show when there are no updates
|
|
942
991
|
* @private
|
|
943
992
|
*/
|
|
944
|
-
private
|
|
993
|
+
private getNoUpdatesPlaceholder(): ODataResponse {
|
|
945
994
|
const placeholderTitle = this._i18nBundle.getText("placeholderNewsTitle") as string;
|
|
946
995
|
const placeholderDescription = this._i18nBundle.getText("placeholderNewsDescription");
|
|
947
996
|
|
|
@@ -954,13 +1003,22 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
954
1003
|
_group_to_article: group._group_to_article.map((article) => ({
|
|
955
1004
|
...article,
|
|
956
1005
|
title: placeholderTitle,
|
|
957
|
-
description:
|
|
1006
|
+
description: ""
|
|
958
1007
|
}))
|
|
959
1008
|
}))
|
|
960
1009
|
};
|
|
961
1010
|
return enrichedNewsPlaceholder;
|
|
962
1011
|
}
|
|
963
1012
|
|
|
1013
|
+
/**
|
|
1014
|
+
* Returns if its a no updates new feed group or not
|
|
1015
|
+
* This indicates whether the news feed is a static no updates placeholder news feed.
|
|
1016
|
+
* @private
|
|
1017
|
+
*/
|
|
1018
|
+
public isNoUpdatesNewsFeed(): boolean {
|
|
1019
|
+
return this._noUpdatesNewsFeed;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
964
1022
|
/**
|
|
965
1023
|
* Fetches the default news data from the server.
|
|
966
1024
|
* @returns {Promise<ODataResponse>} A promise that resolves to the fetched news data
|
|
@@ -979,16 +1037,21 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
979
1037
|
}
|
|
980
1038
|
]);
|
|
981
1039
|
if (supported) {
|
|
982
|
-
|
|
1040
|
+
if (this._endUserResponse) {
|
|
1041
|
+
this._defaultNewsResponse = this._endUserResponse;
|
|
1042
|
+
} else {
|
|
1043
|
+
const response = await fetch(this.defaultUrl || DEFAULT_NEWS_URL);
|
|
983
1044
|
|
|
984
|
-
|
|
985
|
-
|
|
1045
|
+
if (!response.ok) {
|
|
1046
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
1047
|
+
}
|
|
1048
|
+
this._defaultNewsResponse = (await response.json()) as ODataResponse;
|
|
986
1049
|
}
|
|
987
|
-
this._defaultNewsResponse = (await response.json()) as ODataResponse;
|
|
988
1050
|
}
|
|
989
1051
|
// If the response is not supported or empty, set the default news response to placeholder news
|
|
990
1052
|
if (!supported || !this._defaultNewsResponse?.value?.length) {
|
|
991
|
-
this._defaultNewsResponse = this.
|
|
1053
|
+
this._defaultNewsResponse = this.getNoUpdatesPlaceholder();
|
|
1054
|
+
this._noUpdatesNewsFeed = true;
|
|
992
1055
|
this.oManageMenuItem.setVisible(false);
|
|
993
1056
|
}
|
|
994
1057
|
|
|
@@ -1009,8 +1072,9 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
1009
1072
|
* @returns {Promise<INewsFeed[]>} A promise that resolves to an array of custom news feed items.
|
|
1010
1073
|
* @private
|
|
1011
1074
|
*/
|
|
1012
|
-
public async
|
|
1013
|
-
const
|
|
1075
|
+
public async getCustomOrDefaultNewsFeed(sFeedId: string, showAllPreparationRequired: boolean): Promise<INewsFeed[]> {
|
|
1076
|
+
const feedType = this.getNewsType();
|
|
1077
|
+
const isDefaultNews = feedType === NewsType.Default;
|
|
1014
1078
|
if (isDefaultNews) {
|
|
1015
1079
|
await this.getDefaultNewsResponse();
|
|
1016
1080
|
let aDefaultgroups = this.getDefaultNewsFeedDetails(this._defaultNewsResponse);
|
|
@@ -1030,7 +1094,9 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
1030
1094
|
*/
|
|
1031
1095
|
private async getCustomFeedData(sFeedId: string, showAllPreparationRequired: boolean): Promise<INewsFeed[]> {
|
|
1032
1096
|
try {
|
|
1033
|
-
|
|
1097
|
+
let newsDetailUrl;
|
|
1098
|
+
const isEnduser = (this.getParent() as NewsAndPagesContainer).getIsEndUserChange().isEndUser;
|
|
1099
|
+
newsDetailUrl = isEnduser ? this.getUrl() : this.getNewsFeedDetailsUrl({ changeId: sFeedId, showAllPreparationRequired });
|
|
1034
1100
|
if (!this.customNewsFeedCache.has(newsDetailUrl)) {
|
|
1035
1101
|
this.customNewsFeedCache.set(newsDetailUrl, this.getAuthNewsFeed(newsDetailUrl));
|
|
1036
1102
|
}
|
|
@@ -1043,7 +1109,7 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
1043
1109
|
if (!oFeedDict[title.value]) {
|
|
1044
1110
|
aFeeds.push({
|
|
1045
1111
|
title: title.value,
|
|
1046
|
-
footer: (oFeed[CUSTOM_NEWS_FEED.VALIDITY] as INewsLink)
|
|
1112
|
+
footer: (oFeed[CUSTOM_NEWS_FEED.VALIDITY] as INewsLink)?.value,
|
|
1047
1113
|
imageUrl: this.getCustomFeedImage(title.value)
|
|
1048
1114
|
});
|
|
1049
1115
|
oFeedDict[title.value] = title.value;
|
|
@@ -1171,7 +1237,7 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
1171
1237
|
|
|
1172
1238
|
const fnFormattedLabel = (sLabel: string) => sLabel.replace(/([a-z0-9])([A-Z])/g, "$1 $2");
|
|
1173
1239
|
const [newsResponse, translationResponse] = await Promise.all([
|
|
1174
|
-
HttpHelper.GetJSON(sUrl) as Promise<{ value: INewsFeed[] }
|
|
1240
|
+
this._endUserResponse ? Promise.resolve(this._endUserResponse) : (HttpHelper.GetJSON(sUrl) as Promise<{ value: INewsFeed[] }>),
|
|
1175
1241
|
this.getTranslatedText(this.getCustomFeedKey())
|
|
1176
1242
|
]);
|
|
1177
1243
|
let aNews: INewsFeed[] = JSON.parse(JSON.stringify((newsResponse as INewsResponse).value || [])) as INewsFeed[];
|
|
@@ -1328,12 +1394,12 @@ export default class NewsPanel extends BaseNewsPanel {
|
|
|
1328
1394
|
const random = Math.floor(Math.random() * 15) + 1;
|
|
1329
1395
|
return `${sPrefix}/${random}.jpg`;
|
|
1330
1396
|
};
|
|
1331
|
-
if (!groupImg || groupImg
|
|
1397
|
+
if (!groupImg || groupImg?.image_id !== imgId || !groupImg?.bg_image) {
|
|
1332
1398
|
return getRandomDefaultImage();
|
|
1333
1399
|
}
|
|
1334
1400
|
|
|
1335
|
-
let mimeType = groupImg
|
|
1336
|
-
const groupBgImg = groupImg
|
|
1401
|
+
let mimeType = groupImg?.mime_type;
|
|
1402
|
+
const groupBgImg = groupImg?.bg_image;
|
|
1337
1403
|
|
|
1338
1404
|
if (mimeType === "application/octet-stream") {
|
|
1339
1405
|
mimeType = "image/jpeg";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewsSettingsPanel.d.ts","sourceRoot":"../../../../..","sources":["src/sap/cux/home/NewsSettingsPanel.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,gCAAgC,CAAC;IAmBhD,OAAO,iBAAiB,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"NewsSettingsPanel.d.ts","sourceRoot":"../../../../..","sources":["src/sap/cux/home/NewsSettingsPanel.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,gCAAgC,CAAC;IAmBhD,OAAO,iBAAiB,MAAM,gCAAgC,CAAC;IAS/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;QAEtB;;;;;WAKG;QACI,IAAI,IAAI,IAAI;QAkBnB;;;;;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,WAAW;QA6CnB;;;;;WAKG;QACH,OAAO,CAAC,eAAe;QAIvB;;;;;WAKG;gBACW,oBAAoB;QA6ClC;;;;WAIG;QACH,OAAO,CAAC,iBAAiB;QAKzB;;;WAGG;QACH,OAAO,CAAC,QAAQ;QAgChB;;;;WAIG;gBACW,oBAAoB;QAyBlC;;;;;;;;;WASG;QACH,OAAO,CAAC,sBAAsB;QA4B9B;;;;;;;;;;WAUG;QACH,OAAO,CAAC,qBAAqB;QAyB7B;;;;WAIG;QACU,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;KAY5C;CAEA"}
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
3
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
4
4
|
*/
|
|
5
|
-
sap.ui.define(["sap/m/CheckBox", "sap/m/CustomListItem", "sap/m/HBox", "sap/m/Label", "sap/m/List", "sap/m/Switch", "sap/m/Text", "sap/m/Title", "sap/m/VBox", "sap/ui/core/CustomData", "./BaseSettingsPanel", "./utils/Accessibility", "./utils/Constants", "./utils/FESRUtil", "./utils/PersonalisationUtils", "./utils/UshellPersonalizer"], function (CheckBox, CustomListItem, HBox, Label, List, Switch, Text, Title, VBox, CustomData, __BaseSettingsPanel, ___utils_Accessibility, ___utils_Constants, ___utils_FESRUtil, __PersonalisationUtils, __UshellPersonalizer) {
|
|
5
|
+
sap.ui.define(["sap/m/CheckBox", "sap/m/CustomListItem", "sap/m/HBox", "sap/m/Label", "sap/m/List", "sap/m/Switch", "sap/m/Text", "sap/m/Title", "sap/m/VBox", "sap/ui/core/CustomData", "./BaseSettingsPanel", "./library", "./utils/Accessibility", "./utils/Constants", "./utils/FESRUtil", "./utils/PersonalisationUtils", "./utils/UshellPersonalizer"], function (CheckBox, CustomListItem, HBox, Label, List, Switch, Text, Title, VBox, CustomData, __BaseSettingsPanel, ___library, ___utils_Accessibility, ___utils_Constants, ___utils_FESRUtil, __PersonalisationUtils, __UshellPersonalizer) {
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
8
|
function _interopRequireDefault(obj) {
|
|
9
9
|
return obj && obj.__esModule && typeof obj.default !== "undefined" ? obj.default : obj;
|
|
10
10
|
}
|
|
11
11
|
const BaseSettingsPanel = _interopRequireDefault(__BaseSettingsPanel);
|
|
12
|
+
const NewsType = ___library["NewsType"];
|
|
12
13
|
const getInvisibleText = ___utils_Accessibility["getInvisibleText"];
|
|
13
14
|
const SETTINGS_PANELS_KEYS = ___utils_Constants["SETTINGS_PANELS_KEYS"];
|
|
14
15
|
const addFESRSemanticStepName = ___utils_FESRUtil["addFESRSemanticStepName"];
|
|
@@ -194,7 +195,8 @@ sap.ui.define(["sap/m/CheckBox", "sap/m/CustomListItem", "sap/m/HBox", "sap/m/La
|
|
|
194
195
|
const _this2 = this;
|
|
195
196
|
const selectedFeeds = [];
|
|
196
197
|
const deselectedDefaultFeeds = [];
|
|
197
|
-
const
|
|
198
|
+
const newsType = _this2.oNewsPanel?.getNewsType();
|
|
199
|
+
const showDefault = newsType === NewsType.Default;
|
|
198
200
|
const customFileName = _this2.oNewsPanel.getProperty("customFileName");
|
|
199
201
|
const feedKey = _this2.oNewsPanel.getCustomFeedKey();
|
|
200
202
|
_this2.oList.getItems().forEach(item => {
|
|
@@ -251,7 +253,8 @@ sap.ui.define(["sap/m/CheckBox", "sap/m/CustomListItem", "sap/m/HBox", "sap/m/La
|
|
|
251
253
|
*/
|
|
252
254
|
setItems: function _setItems(aItems) {
|
|
253
255
|
this.oList.destroyAggregation("items", true);
|
|
254
|
-
|
|
256
|
+
const newsType = this.oNewsPanel?.getNewsType();
|
|
257
|
+
let showDefault = newsType === NewsType.Default;
|
|
255
258
|
(aItems || []).forEach((oItem, i) => {
|
|
256
259
|
let oNewsListItemHbox = new HBox({
|
|
257
260
|
id: `${this.getId()}--idCustNewsFeedItemContent--${i}`,
|
|
@@ -291,7 +294,8 @@ sap.ui.define(["sap/m/CheckBox", "sap/m/CustomListItem", "sap/m/HBox", "sap/m/La
|
|
|
291
294
|
const _this3 = this;
|
|
292
295
|
_this3.oNewsPanel = _this3._getPanel();
|
|
293
296
|
const sFeedKey = _this3.oNewsPanel.getCustomFeedKey();
|
|
294
|
-
const
|
|
297
|
+
const newsType = _this3.oNewsPanel?.getNewsType();
|
|
298
|
+
const showDefaultNewsFeed = newsType === NewsType.Default;
|
|
295
299
|
const customFileName = _this3.oNewsPanel.getProperty("customFileName");
|
|
296
300
|
if (_this3.isCSVFileFormat(customFileName) || showDefaultNewsFeed) {
|
|
297
301
|
_this3.oCustNewsSwitchContainer.setVisible(false);
|
|
@@ -300,7 +304,7 @@ sap.ui.define(["sap/m/CheckBox", "sap/m/CustomListItem", "sap/m/HBox", "sap/m/La
|
|
|
300
304
|
return Promise.resolve(oPersonalizer.read()).then(function (oPersData) {
|
|
301
305
|
const aPersNewsFeed = showDefaultNewsFeed ? oPersData?.["defaultNewsFeed"] : oPersData?.["favNewsFeed"];
|
|
302
306
|
const showAllPreparationRequired = aPersNewsFeed?.showAllPreparationRequired ?? !aPersNewsFeed;
|
|
303
|
-
return Promise.resolve(_this3.oNewsPanel.
|
|
307
|
+
return Promise.resolve(_this3.oNewsPanel.getCustomOrDefaultNewsFeed(showDefaultNewsFeed ? "" : sFeedKey, false)).then(function (aNewsFeed) {
|
|
304
308
|
if (showDefaultNewsFeed) {
|
|
305
309
|
return _this3._handleDefaultNewsFeed(aNewsFeed, aPersNewsFeed);
|
|
306
310
|
} else {
|
|
@@ -386,7 +390,7 @@ sap.ui.define(["sap/m/CheckBox", "sap/m/CustomListItem", "sap/m/HBox", "sap/m/La
|
|
|
386
390
|
if (!newsPanel) {
|
|
387
391
|
return Promise.resolve(false);
|
|
388
392
|
}
|
|
389
|
-
return Promise.resolve(newsPanel.
|
|
393
|
+
return Promise.resolve((newsPanel.getNewsType() === NewsType.Custom || newsPanel.getNewsType() === NewsType.Default) && !newsPanel.isNoUpdatesNewsFeed());
|
|
390
394
|
} catch (e) {
|
|
391
395
|
return Promise.reject(e);
|
|
392
396
|
}
|