@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
|
@@ -175,7 +175,6 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
175
175
|
const NewsGroup = _interopRequireDefault(__NewsGroup);
|
|
176
176
|
const NewsItem = _interopRequireDefault(__NewsItem);
|
|
177
177
|
const NewsType = ___library["NewsType"];
|
|
178
|
-
const DEFAULT_NEWS_BASE_URL = ___utils_Constants["DEFAULT_NEWS_BASE_URL"];
|
|
179
178
|
const DEFAULT_NEWS_PLACEHOLDER = ___utils_Constants["DEFAULT_NEWS_PLACEHOLDER"];
|
|
180
179
|
const DEFAULT_NEWS_URL = ___utils_Constants["DEFAULT_NEWS_URL"];
|
|
181
180
|
const recycleId = ___utils_DataFormatUtils["recycleId"];
|
|
@@ -188,6 +187,13 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
188
187
|
NEWS_FEED_READ_API = BASE_URL + "insights_read_srv/0001/" + "NEWS_FEED",
|
|
189
188
|
NEWS_FEED_TRANSLATION_API = BASE_URL + "insights_read_srv/0001/" + "NewsFeedColumnTranslation",
|
|
190
189
|
DEFAULT_FEED_COUNT = 7,
|
|
190
|
+
NEWS_HEIGHT = {
|
|
191
|
+
LargeDesktop: "17rem",
|
|
192
|
+
XLargeDesktop: "17rem",
|
|
193
|
+
Desktop: "17rem",
|
|
194
|
+
Tablet: "14rem",
|
|
195
|
+
Mobile: "11rem"
|
|
196
|
+
},
|
|
191
197
|
fnImagePlaceholder = function (sPath, N) {
|
|
192
198
|
return Array.from({
|
|
193
199
|
length: N
|
|
@@ -251,13 +257,13 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
251
257
|
/**
|
|
252
258
|
* Type of the news item.
|
|
253
259
|
*
|
|
254
|
-
* @
|
|
260
|
+
* @private
|
|
255
261
|
*/
|
|
256
262
|
type: {
|
|
257
263
|
type: "sap.cux.home.NewsType",
|
|
258
264
|
group: "Misc",
|
|
259
|
-
visibility: "
|
|
260
|
-
defaultValue: NewsType.
|
|
265
|
+
visibility: "hidden",
|
|
266
|
+
defaultValue: NewsType.Default
|
|
261
267
|
},
|
|
262
268
|
/**
|
|
263
269
|
* The key of custom news feed.
|
|
@@ -280,26 +286,6 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
280
286
|
group: "Misc",
|
|
281
287
|
defaultValue: ""
|
|
282
288
|
},
|
|
283
|
-
/**
|
|
284
|
-
* The flag for custom news feed is checked or not.
|
|
285
|
-
*
|
|
286
|
-
* @private
|
|
287
|
-
*/
|
|
288
|
-
showCustom: {
|
|
289
|
-
type: "boolean",
|
|
290
|
-
group: "Misc",
|
|
291
|
-
defaultValue: false
|
|
292
|
-
},
|
|
293
|
-
/**
|
|
294
|
-
* Property to set default News.
|
|
295
|
-
*
|
|
296
|
-
* @private
|
|
297
|
-
*/
|
|
298
|
-
showDefault: {
|
|
299
|
-
type: "boolean",
|
|
300
|
-
group: "Misc",
|
|
301
|
-
defaultValue: false
|
|
302
|
-
},
|
|
303
289
|
/**
|
|
304
290
|
* The flag to determine rss feed will load or not.
|
|
305
291
|
*
|
|
@@ -344,6 +330,7 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
344
330
|
constructor: function _constructor(id, settings) {
|
|
345
331
|
BaseNewsPanel.prototype.constructor.call(this, id, settings);
|
|
346
332
|
this._defaultNewsPromise = null;
|
|
333
|
+
this._noUpdatesNewsFeed = false;
|
|
347
334
|
this.customNewsFeedCache = new Map();
|
|
348
335
|
},
|
|
349
336
|
/**
|
|
@@ -354,10 +341,11 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
354
341
|
*/
|
|
355
342
|
init: function _init() {
|
|
356
343
|
BaseNewsPanel.prototype.init.call(this);
|
|
344
|
+
const deviceType = this.getDeviceType();
|
|
357
345
|
this.oNewsTile = new SlideTile(this.getId() + "--idNewsSlide", {
|
|
358
346
|
displayTime: 20000,
|
|
359
347
|
width: "100%",
|
|
360
|
-
height:
|
|
348
|
+
height: NEWS_HEIGHT[deviceType],
|
|
361
349
|
tiles: [new GenericTile(this.getId() + "--placeholder", {
|
|
362
350
|
state: "Loading",
|
|
363
351
|
mode: "ArticleMode",
|
|
@@ -386,72 +374,100 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
386
374
|
*/
|
|
387
375
|
getData: function _getData() {
|
|
388
376
|
try {
|
|
377
|
+
let _exit = false;
|
|
389
378
|
const _this = this;
|
|
390
|
-
function
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
379
|
+
function _temp9(_result) {
|
|
380
|
+
if (_exit) return _result;
|
|
381
|
+
_this.fireEvent("loaded");
|
|
382
|
+
_this.adjustLayout();
|
|
383
|
+
}
|
|
384
|
+
let sUrl = _this.getUrl();
|
|
385
|
+
let showCustom = _this.getProperty("type") === NewsType.Custom;
|
|
386
|
+
let showDefault = _this.getProperty("type") === NewsType.Default;
|
|
387
|
+
let showRssAtom = _this.getProperty("type") === NewsType.NewsUrl;
|
|
388
|
+
_this.mandatoryNewsFeed = [];
|
|
389
|
+
if (_this.fetchedFeedUrl && _this.fetchedFeedUrl === sUrl) {
|
|
390
|
+
return Promise.resolve();
|
|
391
|
+
}
|
|
392
|
+
const endUserChange = _this.getParent().getIsEndUserChange();
|
|
393
|
+
const _temp8 = function () {
|
|
394
|
+
if (endUserChange.isEndUser) {
|
|
395
|
+
//url scenario (developer side)
|
|
396
|
+
return Promise.resolve(fetch(sUrl)).then(function (response) {
|
|
397
|
+
if (!response.ok) {
|
|
398
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
399
|
+
}
|
|
400
|
+
const contentType = response.headers.get("content-type");
|
|
401
|
+
const _temp = function () {
|
|
402
|
+
if (contentType && contentType.includes("application/json")) {
|
|
403
|
+
return Promise.resolve(response.json()).then(function (_response$json) {
|
|
404
|
+
_this._endUserResponse = _response$json;
|
|
405
|
+
return Promise.resolve(_this.setNewsFeedFromUrl(_this._endUserResponse?.value)).then(function () {});
|
|
406
|
+
});
|
|
407
|
+
} else {
|
|
408
|
+
endUserChange.newsType = NewsType.NewsUrl;
|
|
409
|
+
return Promise.resolve(_this.initializeXmlModel(sUrl)).then(function (_this$initializeXmlMo) {
|
|
410
|
+
_this.oNewsModel = _this$initializeXmlMo;
|
|
411
|
+
_this.oNewsTile.setModel(_this.oNewsModel);
|
|
412
|
+
_this.oManageMenuItem.setVisible(false);
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
}();
|
|
416
|
+
if (_temp && _temp.then) return _temp.then(function () {});
|
|
417
|
+
});
|
|
418
|
+
} else {
|
|
419
|
+
function _temp7() {
|
|
420
|
+
const _temp5 = function () {
|
|
421
|
+
if (showDefault) {
|
|
422
|
+
//default news scenario
|
|
409
423
|
_this.bNewsLoad = _this.bNewsLoad || false;
|
|
410
|
-
return Promise.resolve(_this.setDefaultNews(
|
|
424
|
+
return Promise.resolve(_this.setDefaultNews()).then(function () {});
|
|
411
425
|
} else {
|
|
412
|
-
const
|
|
413
|
-
if (
|
|
414
|
-
//
|
|
415
|
-
_this.
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
426
|
+
const _temp4 = function () {
|
|
427
|
+
if (sUrl && showRssAtom) {
|
|
428
|
+
//rss feed scenario
|
|
429
|
+
return Promise.resolve(_this.initializeXmlModel(sUrl)).then(function (_this$initializeXmlMo2) {
|
|
430
|
+
_this.oNewsModel = _this$initializeXmlMo2;
|
|
431
|
+
_this.oNewsTile.setModel(_this.oNewsModel);
|
|
432
|
+
_this.oManageMenuItem.setVisible(false);
|
|
433
|
+
});
|
|
434
|
+
} else {
|
|
435
|
+
const _temp3 = function () {
|
|
436
|
+
if (showCustom) {
|
|
437
|
+
//custom news scenario
|
|
438
|
+
_this.bNewsLoad = _this.bNewsLoad || false;
|
|
439
|
+
_this.oManageMenuItem.setVisible(true);
|
|
440
|
+
const sCustomNewsFeedKey = _this.getCustomFeedKey();
|
|
441
|
+
const _temp2 = function () {
|
|
442
|
+
if (sCustomNewsFeedKey) {
|
|
443
|
+
return Promise.resolve(_this.setCustomNewsFeed(sCustomNewsFeedKey)).then(function () {});
|
|
444
|
+
} else {
|
|
445
|
+
_this.handleFeedError();
|
|
446
|
+
}
|
|
447
|
+
}();
|
|
448
|
+
if (_temp2 && _temp2.then) return _temp2.then(function () {});
|
|
421
449
|
} else {
|
|
422
450
|
_this.handleFeedError();
|
|
423
451
|
}
|
|
424
452
|
}();
|
|
425
|
-
if (
|
|
426
|
-
} else {
|
|
427
|
-
_this.handleFeedError();
|
|
453
|
+
if (_temp3 && _temp3.then) return _temp3.then(function () {});
|
|
428
454
|
}
|
|
429
455
|
}();
|
|
430
|
-
if (
|
|
456
|
+
if (_temp4 && _temp4.then) return _temp4.then(function () {});
|
|
431
457
|
}
|
|
432
458
|
}();
|
|
433
|
-
if (
|
|
459
|
+
if (_temp5 && _temp5.then) return _temp5.then(function () {});
|
|
434
460
|
}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
_this.setProperty("showDefault", true);
|
|
443
|
-
}
|
|
444
|
-
let showDefault = _this.getProperty("showDefault");
|
|
445
|
-
_this.mandatoryNewsFeed = [];
|
|
446
|
-
if (_this.fetchedFeedUrl && _this.fetchedFeedUrl === sUrl) {
|
|
447
|
-
return Promise.resolve();
|
|
448
|
-
}
|
|
449
|
-
const _temp6 = function () {
|
|
450
|
-
if (!_this.persDataNewsFeed) {
|
|
451
|
-
return Promise.resolve(_this.setPersDataNewsFeed(showDefault)).then(function () {});
|
|
461
|
+
const _temp6 = function () {
|
|
462
|
+
if (!_this.persDataNewsFeed) {
|
|
463
|
+
return Promise.resolve(_this.setPersDataNewsFeed(showDefault)).then(function () {});
|
|
464
|
+
}
|
|
465
|
+
}();
|
|
466
|
+
//key user scenarios
|
|
467
|
+
return _temp6 && _temp6.then ? _temp6.then(_temp7) : _temp7(_temp6);
|
|
452
468
|
}
|
|
453
469
|
}();
|
|
454
|
-
return Promise.resolve(
|
|
470
|
+
return Promise.resolve(_temp8 && _temp8.then ? _temp8.then(_temp9) : _temp9(_temp8));
|
|
455
471
|
} catch (e) {
|
|
456
472
|
return Promise.reject(e);
|
|
457
473
|
}
|
|
@@ -462,25 +478,18 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
462
478
|
* @param {boolean} [isKeyUserChange=false] - Indicates if the change is made by a key user.
|
|
463
479
|
* @private
|
|
464
480
|
*/
|
|
465
|
-
setDefaultNews: function _setDefaultNews(
|
|
481
|
+
setDefaultNews: function _setDefaultNews() {
|
|
466
482
|
try {
|
|
467
483
|
const _this2 = this;
|
|
468
|
-
// default news scenario, if url property is passed
|
|
469
|
-
// check if url contains default news base url
|
|
484
|
+
// default news scenario, if url property is passed or showDefault is true
|
|
470
485
|
|
|
471
486
|
let sUrl = _this2.getUrl();
|
|
472
|
-
|
|
487
|
+
const isEndUser = _this2.getParent().getIsEndUserChange().isEndUser;
|
|
488
|
+
_this2.defaultUrl = isEndUser ? sUrl : DEFAULT_NEWS_URL;
|
|
473
489
|
_this2.fetchedFeedUrl = _this2.defaultUrl;
|
|
474
|
-
_this2.setProperty("showDefault", showDefault);
|
|
475
490
|
|
|
476
491
|
//reset properties
|
|
477
|
-
_this2.setProperty("showCustom", false);
|
|
478
492
|
_this2.setProperty("newsAvailable", true);
|
|
479
|
-
// if user specifically set defaultNews true,
|
|
480
|
-
// then even though url is available in key user settings url input, preference goes to showDefault
|
|
481
|
-
if (isKeyUserChange) {
|
|
482
|
-
_this2.setProperty("url", "");
|
|
483
|
-
}
|
|
484
493
|
_this2.generateErrorMessage().setVisible(false);
|
|
485
494
|
(_this2.getNewsWrapper()?.getParent()).setVisible(true);
|
|
486
495
|
_this2.oManageMenuItem.setVisible(true);
|
|
@@ -522,14 +531,30 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
522
531
|
const newsGroups = this.getAggregation("newsGroup");
|
|
523
532
|
if (!Array.isArray(newsGroups)) return;
|
|
524
533
|
|
|
525
|
-
//
|
|
534
|
+
// Build groupDetailsMap for group details to avoid multiple iterations and clean up descriptions by removing inline styles if any
|
|
526
535
|
const groupDetailsMap = {};
|
|
536
|
+
const groupHasDescription = {};
|
|
527
537
|
(this._defaultNewsResponse.value || []).forEach(group => {
|
|
538
|
+
// Clean group description
|
|
539
|
+
if (group?.description && group.description.trim().length > 0) {
|
|
540
|
+
group.description = this.removeInlineStylesFromDescription(group.description);
|
|
541
|
+
}
|
|
528
542
|
if (group?.group_id) {
|
|
529
|
-
|
|
543
|
+
const articles = group._group_to_article || [];
|
|
544
|
+
// Clean article descriptions and check if any article has a valid description
|
|
545
|
+
let hasDescription = false;
|
|
546
|
+
articles.forEach(article => {
|
|
547
|
+
if (article?.description && article.description.trim().length > 0) {
|
|
548
|
+
article.description = this.removeInlineStylesFromDescription(article.description);
|
|
549
|
+
hasDescription = true;
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
groupDetailsMap[group.group_id] = articles;
|
|
553
|
+
groupHasDescription[group.group_id] = hasDescription;
|
|
530
554
|
}
|
|
531
555
|
});
|
|
532
556
|
const newsGroupMap = {};
|
|
557
|
+
// Iterate through the news groups and map group IDs to NewsGroup instances
|
|
533
558
|
newsGroups.filter(group => group instanceof NewsGroup).forEach(group => {
|
|
534
559
|
const groupId = this.getCurrentNewsGroup(group.getId())?.group_id;
|
|
535
560
|
if (groupId) {
|
|
@@ -537,22 +562,24 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
537
562
|
}
|
|
538
563
|
});
|
|
539
564
|
|
|
540
|
-
//
|
|
565
|
+
// If no description is found in any of the articles within the group,
|
|
566
|
+
// disable the pressEnabled property for the news group to prevent user interaction.
|
|
541
567
|
feeds.forEach(feed => {
|
|
542
568
|
if (!feed.group_id) return;
|
|
543
|
-
const groupArticles = groupDetailsMap[feed.group_id];
|
|
544
569
|
const newsGroup = newsGroupMap[feed.group_id];
|
|
545
|
-
if (
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
// If no description is found in any of the articles within the group,
|
|
549
|
-
// disable the pressEnabled property for the news group to prevent user interaction.
|
|
550
|
-
if (!hasDescription) {
|
|
551
|
-
newsGroup.getTile()?.setProperty("pressEnabled", false);
|
|
552
|
-
}
|
|
570
|
+
if (newsGroup && !groupHasDescription[feed.group_id]) {
|
|
571
|
+
newsGroup.getTile()?.setProperty("pressEnabled", false);
|
|
553
572
|
}
|
|
554
573
|
});
|
|
555
574
|
},
|
|
575
|
+
/**
|
|
576
|
+
*
|
|
577
|
+
* @param description - The description from which inline styles need to be removed.
|
|
578
|
+
* @returns {string} The description with inline styles removed.
|
|
579
|
+
*/
|
|
580
|
+
removeInlineStylesFromDescription: function _removeInlineStylesFromDescription(description) {
|
|
581
|
+
return description.replace(/\s*style\s*=\s*(['"])[\s\S]*?\1/gi, "");
|
|
582
|
+
},
|
|
556
583
|
/**
|
|
557
584
|
* Retrieves the current news group data based on the provided id.
|
|
558
585
|
*
|
|
@@ -654,7 +681,7 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
654
681
|
loadNewsFeed: function _loadNewsFeed(oDocument, noOfFeeds) {
|
|
655
682
|
try {
|
|
656
683
|
const _this4 = this;
|
|
657
|
-
function
|
|
684
|
+
function _temp1() {
|
|
658
685
|
if (!!oDocument?.querySelector("rss") && !!oDocument?.querySelector("item")) {
|
|
659
686
|
oBindingInfo = {
|
|
660
687
|
path: "/channel/item/",
|
|
@@ -678,12 +705,12 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
678
705
|
_this4.bindNewsTile(_this4.oNewsTile, oBindingInfo);
|
|
679
706
|
}
|
|
680
707
|
let oBindingInfo;
|
|
681
|
-
const
|
|
708
|
+
const _temp0 = function () {
|
|
682
709
|
if (!oDocument?.querySelector("customFeed") && !oDocument?.querySelector("defaultFeed")) {
|
|
683
710
|
return Promise.resolve(_this4.extractAllImageUrls(oDocument, noOfFeeds || DEFAULT_FEED_COUNT)).then(function () {});
|
|
684
711
|
}
|
|
685
712
|
}();
|
|
686
|
-
return Promise.resolve(
|
|
713
|
+
return Promise.resolve(_temp0 && _temp0.then ? _temp0.then(_temp1) : _temp1(_temp0));
|
|
687
714
|
} catch (e) {
|
|
688
715
|
return Promise.reject(e);
|
|
689
716
|
}
|
|
@@ -693,7 +720,7 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
693
720
|
* @returns {void}
|
|
694
721
|
*/
|
|
695
722
|
handleFeedError: function _handleFeedError() {
|
|
696
|
-
if (this.
|
|
723
|
+
if (this.getNewsType() === NewsType.Custom || this.getNewsType() === NewsType.Default) {
|
|
697
724
|
this.generateErrorMessage().setVisible(true);
|
|
698
725
|
if (!this.isParentBaseLayout()) {
|
|
699
726
|
this.setManageNewsButtonVisibility(false);
|
|
@@ -708,7 +735,7 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
708
735
|
setURL: function _setURL(url) {
|
|
709
736
|
try {
|
|
710
737
|
const _this5 = this;
|
|
711
|
-
_this5.setProperty("
|
|
738
|
+
_this5.setProperty("type", NewsType.NewsUrl);
|
|
712
739
|
_this5.setProperty("newsAvailable", true);
|
|
713
740
|
_this5.generateErrorMessage().setVisible(false);
|
|
714
741
|
(_this5.getNewsWrapper()?.getParent()).setVisible(true);
|
|
@@ -725,12 +752,12 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
725
752
|
* @private
|
|
726
753
|
*/
|
|
727
754
|
adjustLayout: function _adjustLayout() {
|
|
728
|
-
|
|
729
|
-
|
|
755
|
+
const deviceType = this.getDeviceType();
|
|
756
|
+
this.oNewsTile.setHeight(NEWS_HEIGHT[deviceType]);
|
|
757
|
+
if (deviceType === DeviceType.Mobile) {
|
|
730
758
|
this.generateErrorMessage().setWidth("100%");
|
|
731
759
|
this.oNewsTile.removeStyleClass("sapUiSmallMarginTop");
|
|
732
760
|
} else {
|
|
733
|
-
this.oNewsTile.setHeight("17rem");
|
|
734
761
|
this.oNewsTile.addStyleClass("sapUiSmallMarginTop");
|
|
735
762
|
(this.getNewsWrapper()?.getParent()).setWidth("100%");
|
|
736
763
|
}
|
|
@@ -789,7 +816,7 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
789
816
|
try {
|
|
790
817
|
const _this6 = this;
|
|
791
818
|
let i = 0;
|
|
792
|
-
const
|
|
819
|
+
const _temp10 = _for(function () {
|
|
793
820
|
return i < noOfFeeds;
|
|
794
821
|
}, function () {
|
|
795
822
|
return i++;
|
|
@@ -801,7 +828,7 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
801
828
|
oItemElement.appendChild(oImageUrl);
|
|
802
829
|
});
|
|
803
830
|
});
|
|
804
|
-
return Promise.resolve(
|
|
831
|
+
return Promise.resolve(_temp10 && _temp10.then ? _temp10.then(function () {}) : void 0);
|
|
805
832
|
} catch (e) {
|
|
806
833
|
return Promise.reject(e);
|
|
807
834
|
}
|
|
@@ -844,6 +871,9 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
844
871
|
return Array.isArray(aMatches) && aMatches[1] ? aMatches[1] : fnLoadPlaceholderImage();
|
|
845
872
|
}).catch(fnLoadPlaceholderImage);
|
|
846
873
|
},
|
|
874
|
+
getNewsType: function _getNewsType() {
|
|
875
|
+
return this.getParent()?.getIsEndUserChange?.()?.newsType || this.getProperty("type");
|
|
876
|
+
},
|
|
847
877
|
/**
|
|
848
878
|
* Checks if the custom file format is CSV based on the custom file name.
|
|
849
879
|
*
|
|
@@ -874,6 +904,38 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
874
904
|
return Promise.reject(e);
|
|
875
905
|
}
|
|
876
906
|
},
|
|
907
|
+
/**
|
|
908
|
+
* Sets the news feed type (Default or Custom) based on the provided data structure.
|
|
909
|
+
*
|
|
910
|
+
* @param {INewsFeed[]} data - News feed data from the URL.
|
|
911
|
+
* @returns {Promise<void>} Resolves after setting the appropriate feed.
|
|
912
|
+
*/
|
|
913
|
+
setNewsFeedFromUrl: function _setNewsFeedFromUrl(data) {
|
|
914
|
+
try {
|
|
915
|
+
const _this8 = this;
|
|
916
|
+
const item = data?.[0];
|
|
917
|
+
const _temp12 = function () {
|
|
918
|
+
if (item && "group_id" in item && "title" in item) {
|
|
919
|
+
_this8.getParent().getIsEndUserChange().newsType = NewsType.Default;
|
|
920
|
+
return Promise.resolve(_this8.setDefaultNews()).then(function () {});
|
|
921
|
+
} else {
|
|
922
|
+
const _temp11 = function () {
|
|
923
|
+
if (item && "LineOfBusiness" in item) {
|
|
924
|
+
_this8.getParent().getIsEndUserChange().newsType = NewsType.Custom;
|
|
925
|
+
_this8.oManageMenuItem.setVisible(true);
|
|
926
|
+
return Promise.resolve(_this8.setCustomNewsFeed("")).then(function () {});
|
|
927
|
+
} else {
|
|
928
|
+
_this8.handleFeedError();
|
|
929
|
+
}
|
|
930
|
+
}();
|
|
931
|
+
if (_temp11 && _temp11.then) return _temp11.then(function () {});
|
|
932
|
+
}
|
|
933
|
+
}();
|
|
934
|
+
return Promise.resolve(_temp12 && _temp12.then ? _temp12.then(function () {}) : void 0);
|
|
935
|
+
} catch (e) {
|
|
936
|
+
return Promise.reject(e);
|
|
937
|
+
}
|
|
938
|
+
},
|
|
877
939
|
/**
|
|
878
940
|
* This method retrieves the count and feeds of the custom news feed asynchronously.
|
|
879
941
|
* If the count is not zero, it loads the custom news feed data and returns the feeds.
|
|
@@ -883,29 +945,30 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
883
945
|
*/
|
|
884
946
|
setCustomNewsFeed: function _setCustomNewsFeed(sFeedId) {
|
|
885
947
|
try {
|
|
886
|
-
const
|
|
948
|
+
const _this9 = this;
|
|
887
949
|
return Promise.resolve(_catch(function () {
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
const
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
const
|
|
894
|
-
|
|
950
|
+
_this9.oNewsTile.setVisible(true);
|
|
951
|
+
_this9.generateErrorMessage().setVisible(false);
|
|
952
|
+
const feedType = _this9.getNewsType();
|
|
953
|
+
const isDefaultNews = feedType === NewsType.Default;
|
|
954
|
+
return Promise.resolve(_this9.setPersDataNewsFeed(isDefaultNews)).then(function () {
|
|
955
|
+
const customFileName = _this9.getProperty("customFileName");
|
|
956
|
+
const showAllPrepRequired = _this9.isCSVFileFormat(customFileName) ? false : _this9.persDataNewsFeed?.showAllPreparationRequired ?? true;
|
|
957
|
+
if (_this9.isCSVFileFormat(customFileName)) {
|
|
895
958
|
CUSTOM_NEWS_FEED.EXCLUDE_FIELDS.push("PreparationRequired");
|
|
896
959
|
}
|
|
897
960
|
const showPrep = isDefaultNews ? true : showAllPrepRequired;
|
|
898
|
-
return Promise.resolve(
|
|
961
|
+
return Promise.resolve(_this9.getCustomOrDefaultNewsFeed(sFeedId || "", showPrep)).then(function (newsFeeds) {
|
|
899
962
|
if (newsFeeds.length === 0) {
|
|
900
963
|
throw new Error("Error: No news feed available");
|
|
901
964
|
}
|
|
902
|
-
const selectedItems =
|
|
965
|
+
const selectedItems = _this9.persDataNewsFeed?.items;
|
|
903
966
|
|
|
904
967
|
// Handle no favorite feed case
|
|
905
968
|
// Filter feeds based on personalization
|
|
906
969
|
const isSelectedEmpty = selectedItems?.length === 0;
|
|
907
970
|
if (!isDefaultNews && isSelectedEmpty) {
|
|
908
|
-
|
|
971
|
+
_this9.getParent()?.panelLoadedFn("News", {
|
|
909
972
|
loaded: true,
|
|
910
973
|
count: 0
|
|
911
974
|
});
|
|
@@ -916,34 +979,34 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
916
979
|
// if its defaultNews then we show everything except the group ids present inside persDataNewsFeed items
|
|
917
980
|
// if the group id is mandatory then we show it
|
|
918
981
|
if (isDefaultNews) {
|
|
919
|
-
return !selectedItems.includes(feed.group_id) ||
|
|
982
|
+
return !selectedItems.includes(feed.group_id) || _this9.mandatoryNewsFeed.includes(feed.group_id);
|
|
920
983
|
} else {
|
|
921
984
|
// if its customNews we show only the groups that is present in persDataNewsFeed items
|
|
922
985
|
return selectedItems.includes(feed.title);
|
|
923
986
|
}
|
|
924
987
|
});
|
|
925
988
|
if (newsFeeds.length === 0) {
|
|
926
|
-
|
|
989
|
+
_this9.getParent()?.panelLoadedFn("News", {
|
|
927
990
|
loaded: true,
|
|
928
991
|
count: 0
|
|
929
992
|
});
|
|
930
993
|
throw new Error("Error: No news feed available after filtering");
|
|
931
994
|
}
|
|
932
995
|
}
|
|
933
|
-
return Promise.resolve(
|
|
996
|
+
return Promise.resolve(_this9.loadCustomNewsFeed(newsFeeds, sFeedId ? "customFeed" : "defaultFeed")).then(function () {
|
|
934
997
|
if (isDefaultNews) {
|
|
935
|
-
|
|
998
|
+
_this9.fetchedFeedUrl = _this9.defaultUrl;
|
|
936
999
|
// If no description is found in any of the articles within a group, the pressEnabled property is set to false
|
|
937
|
-
|
|
1000
|
+
_this9.setPressEnabledForNewsGroup(newsFeeds);
|
|
938
1001
|
} else {
|
|
939
|
-
|
|
1002
|
+
_this9.fetchedFeedUrl = "";
|
|
940
1003
|
}
|
|
941
1004
|
});
|
|
942
1005
|
});
|
|
943
1006
|
});
|
|
944
1007
|
}, function (err) {
|
|
945
1008
|
Log.error(err);
|
|
946
|
-
|
|
1009
|
+
_this9.handleFeedError();
|
|
947
1010
|
}));
|
|
948
1011
|
} catch (e) {
|
|
949
1012
|
return Promise.reject(e);
|
|
@@ -1010,12 +1073,12 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1010
1073
|
subTitle = feed.subTitle || feed.description || "";
|
|
1011
1074
|
defaultNews.push({
|
|
1012
1075
|
title: title,
|
|
1013
|
-
footer: feed
|
|
1076
|
+
footer: feed?.footer_text,
|
|
1014
1077
|
imageUrl: this.getDefaultFeedImage(feed),
|
|
1015
1078
|
group_id: feed.group_id,
|
|
1016
1079
|
subTitle: subTitle,
|
|
1017
|
-
priority: feed
|
|
1018
|
-
priorityText: feed
|
|
1080
|
+
priority: feed?.priority == "1" ? Priority.Medium : Priority.None,
|
|
1081
|
+
priorityText: feed?.priority == "1" ? this._i18nBundle.getText("criticalNews") : ""
|
|
1019
1082
|
});
|
|
1020
1083
|
defaultFeedDict[title] = title;
|
|
1021
1084
|
}
|
|
@@ -1050,10 +1113,10 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1050
1113
|
},
|
|
1051
1114
|
/**
|
|
1052
1115
|
*
|
|
1053
|
-
* @returns {ODataResponse} The placeholder news group with enriched titles and descriptions
|
|
1116
|
+
* @returns {ODataResponse} The no update placeholder news group with enriched titles and descriptions to show when there are no updates
|
|
1054
1117
|
* @private
|
|
1055
1118
|
*/
|
|
1056
|
-
|
|
1119
|
+
getNoUpdatesPlaceholder: function _getNoUpdatesPlaceholder() {
|
|
1057
1120
|
const placeholderTitle = this._i18nBundle.getText("placeholderNewsTitle");
|
|
1058
1121
|
const placeholderDescription = this._i18nBundle.getText("placeholderNewsDescription");
|
|
1059
1122
|
const enrichedNewsPlaceholder = {
|
|
@@ -1065,12 +1128,20 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1065
1128
|
_group_to_article: group._group_to_article.map(article => ({
|
|
1066
1129
|
...article,
|
|
1067
1130
|
title: placeholderTitle,
|
|
1068
|
-
description:
|
|
1131
|
+
description: ""
|
|
1069
1132
|
}))
|
|
1070
1133
|
}))
|
|
1071
1134
|
};
|
|
1072
1135
|
return enrichedNewsPlaceholder;
|
|
1073
1136
|
},
|
|
1137
|
+
/**
|
|
1138
|
+
* Returns if its a no updates new feed group or not
|
|
1139
|
+
* This indicates whether the news feed is a static no updates placeholder news feed.
|
|
1140
|
+
* @private
|
|
1141
|
+
*/
|
|
1142
|
+
isNoUpdatesNewsFeed: function _isNoUpdatesNewsFeed() {
|
|
1143
|
+
return this._noUpdatesNewsFeed;
|
|
1144
|
+
},
|
|
1074
1145
|
/**
|
|
1075
1146
|
* Fetches the default news data from the server.
|
|
1076
1147
|
* @returns {Promise<ODataResponse>} A promise that resolves to the fetched news data
|
|
@@ -1079,7 +1150,7 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1079
1150
|
*/
|
|
1080
1151
|
fetchDefaultNews: function _fetchDefaultNews() {
|
|
1081
1152
|
try {
|
|
1082
|
-
const
|
|
1153
|
+
const _this0 = this;
|
|
1083
1154
|
return Promise.resolve(_catch(function () {
|
|
1084
1155
|
return Promise.resolve(Container.getServiceAsync("Navigation")).then(function (navigationService) {
|
|
1085
1156
|
return Promise.resolve(navigationService.isNavigationSupported([{
|
|
@@ -1090,33 +1161,40 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1090
1161
|
}])).then(function ([{
|
|
1091
1162
|
supported
|
|
1092
1163
|
}]) {
|
|
1093
|
-
let
|
|
1094
|
-
function
|
|
1095
|
-
if (
|
|
1164
|
+
let _exit2 = false;
|
|
1165
|
+
function _temp14(_result4) {
|
|
1166
|
+
if (_exit2) return _result4;
|
|
1096
1167
|
// If the response is not supported or empty, set the default news response to placeholder news
|
|
1097
|
-
if (!supported || !
|
|
1098
|
-
|
|
1099
|
-
|
|
1168
|
+
if (!supported || !_this0._defaultNewsResponse?.value?.length) {
|
|
1169
|
+
_this0._defaultNewsResponse = _this0.getNoUpdatesPlaceholder();
|
|
1170
|
+
_this0._noUpdatesNewsFeed = true;
|
|
1171
|
+
_this0.oManageMenuItem.setVisible(false);
|
|
1100
1172
|
}
|
|
1101
|
-
return
|
|
1173
|
+
return _this0._defaultNewsResponse;
|
|
1102
1174
|
}
|
|
1103
|
-
const
|
|
1175
|
+
const _temp13 = function () {
|
|
1104
1176
|
if (supported) {
|
|
1105
|
-
return
|
|
1106
|
-
if (
|
|
1107
|
-
|
|
1177
|
+
return function () {
|
|
1178
|
+
if (_this0._endUserResponse) {
|
|
1179
|
+
_this0._defaultNewsResponse = _this0._endUserResponse;
|
|
1180
|
+
} else {
|
|
1181
|
+
return Promise.resolve(fetch(_this0.defaultUrl || DEFAULT_NEWS_URL)).then(function (response) {
|
|
1182
|
+
if (!response.ok) {
|
|
1183
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
1184
|
+
}
|
|
1185
|
+
return Promise.resolve(response.json()).then(function (_response$json2) {
|
|
1186
|
+
_this0._defaultNewsResponse = _response$json2;
|
|
1187
|
+
});
|
|
1188
|
+
});
|
|
1108
1189
|
}
|
|
1109
|
-
|
|
1110
|
-
_this9._defaultNewsResponse = _response$json;
|
|
1111
|
-
});
|
|
1112
|
-
});
|
|
1190
|
+
}();
|
|
1113
1191
|
}
|
|
1114
1192
|
}();
|
|
1115
|
-
return
|
|
1193
|
+
return _temp13 && _temp13.then ? _temp13.then(_temp14) : _temp14(_temp13);
|
|
1116
1194
|
});
|
|
1117
1195
|
});
|
|
1118
1196
|
}, function (error) {
|
|
1119
|
-
|
|
1197
|
+
_this0._defaultNewsPromise = null;
|
|
1120
1198
|
Log.error(error);
|
|
1121
1199
|
throw error;
|
|
1122
1200
|
}));
|
|
@@ -1133,17 +1211,18 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1133
1211
|
* @returns {Promise<INewsFeed[]>} A promise that resolves to an array of custom news feed items.
|
|
1134
1212
|
* @private
|
|
1135
1213
|
*/
|
|
1136
|
-
|
|
1214
|
+
getCustomOrDefaultNewsFeed: function _getCustomOrDefaultNewsFeed(sFeedId, showAllPreparationRequired) {
|
|
1137
1215
|
try {
|
|
1138
|
-
const
|
|
1139
|
-
const
|
|
1216
|
+
const _this1 = this;
|
|
1217
|
+
const feedType = _this1.getNewsType();
|
|
1218
|
+
const isDefaultNews = feedType === NewsType.Default;
|
|
1140
1219
|
if (isDefaultNews) {
|
|
1141
|
-
return Promise.resolve(
|
|
1142
|
-
let aDefaultgroups =
|
|
1220
|
+
return Promise.resolve(_this1.getDefaultNewsResponse()).then(function () {
|
|
1221
|
+
let aDefaultgroups = _this1.getDefaultNewsFeedDetails(_this1._defaultNewsResponse);
|
|
1143
1222
|
return aDefaultgroups;
|
|
1144
1223
|
});
|
|
1145
1224
|
} else {
|
|
1146
|
-
return Promise.resolve(
|
|
1225
|
+
return Promise.resolve(_this1.getCustomFeedData(sFeedId, showAllPreparationRequired));
|
|
1147
1226
|
}
|
|
1148
1227
|
} catch (e) {
|
|
1149
1228
|
return Promise.reject(e);
|
|
@@ -1159,17 +1238,19 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1159
1238
|
*/
|
|
1160
1239
|
getCustomFeedData: function _getCustomFeedData(sFeedId, showAllPreparationRequired) {
|
|
1161
1240
|
try {
|
|
1162
|
-
const
|
|
1241
|
+
const _this10 = this;
|
|
1163
1242
|
return Promise.resolve(_catch(function () {
|
|
1164
|
-
|
|
1243
|
+
let newsDetailUrl;
|
|
1244
|
+
const isEnduser = _this10.getParent().getIsEndUserChange().isEndUser;
|
|
1245
|
+
newsDetailUrl = isEnduser ? _this10.getUrl() : _this10.getNewsFeedDetailsUrl({
|
|
1165
1246
|
changeId: sFeedId,
|
|
1166
1247
|
showAllPreparationRequired
|
|
1167
1248
|
});
|
|
1168
|
-
if (!
|
|
1169
|
-
|
|
1249
|
+
if (!_this10.customNewsFeedCache.has(newsDetailUrl)) {
|
|
1250
|
+
_this10.customNewsFeedCache.set(newsDetailUrl, _this10.getAuthNewsFeed(newsDetailUrl));
|
|
1170
1251
|
}
|
|
1171
|
-
return Promise.resolve(
|
|
1172
|
-
const authorizedNewsFeeds =
|
|
1252
|
+
return Promise.resolve(_this10.customNewsFeedCache.get(newsDetailUrl)).then(function (_this10$customNewsFee) {
|
|
1253
|
+
const authorizedNewsFeeds = _this10$customNewsFee;
|
|
1173
1254
|
const oFeedDict = {};
|
|
1174
1255
|
const aFeeds = [];
|
|
1175
1256
|
if (authorizedNewsFeeds?.length > 0) {
|
|
@@ -1178,8 +1259,8 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1178
1259
|
if (!oFeedDict[title.value]) {
|
|
1179
1260
|
aFeeds.push({
|
|
1180
1261
|
title: title.value,
|
|
1181
|
-
footer: oFeed[CUSTOM_NEWS_FEED.VALIDITY]
|
|
1182
|
-
imageUrl:
|
|
1262
|
+
footer: oFeed[CUSTOM_NEWS_FEED.VALIDITY]?.value,
|
|
1263
|
+
imageUrl: _this10.getCustomFeedImage(title.value)
|
|
1183
1264
|
});
|
|
1184
1265
|
oFeedDict[title.value] = title.value;
|
|
1185
1266
|
}
|
|
@@ -1218,10 +1299,10 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1218
1299
|
*/
|
|
1219
1300
|
getAuthNewsFeed: function _getAuthNewsFeed(sNewsUrl, newsTitle) {
|
|
1220
1301
|
try {
|
|
1221
|
-
const
|
|
1302
|
+
const _this11 = this;
|
|
1222
1303
|
return Promise.resolve(_catch(function () {
|
|
1223
|
-
return Promise.resolve(Promise.all([
|
|
1224
|
-
return aAvailableApps.length === 0 ? aNewsFeed :
|
|
1304
|
+
return Promise.resolve(Promise.all([_this11.getAllAvailableApps(), _this11.getNewsFeedDetails(sNewsUrl, newsTitle)])).then(function ([aAvailableApps, aNewsFeed]) {
|
|
1305
|
+
return aAvailableApps.length === 0 ? aNewsFeed : _this11.arrangeNewsFeeds(aNewsFeed, aAvailableApps);
|
|
1225
1306
|
});
|
|
1226
1307
|
}, function (err) {
|
|
1227
1308
|
Log.error(err);
|
|
@@ -1302,15 +1383,15 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1302
1383
|
*/
|
|
1303
1384
|
getNewsFeedDetails: function _getNewsFeedDetails(sUrl, newsTitle) {
|
|
1304
1385
|
try {
|
|
1305
|
-
let
|
|
1306
|
-
const
|
|
1307
|
-
function
|
|
1308
|
-
if (
|
|
1386
|
+
let _exit3 = false;
|
|
1387
|
+
const _this12 = this;
|
|
1388
|
+
function _temp16(_result6) {
|
|
1389
|
+
if (_exit3) return _result6;
|
|
1309
1390
|
const fnFormattedLabel = sLabel => sLabel.replace(/([a-z0-9])([A-Z])/g, "$1 $2");
|
|
1310
|
-
return Promise.resolve(Promise.all([HttpHelper.GetJSON(sUrl),
|
|
1391
|
+
return Promise.resolve(Promise.all([_this12._endUserResponse ? Promise.resolve(_this12._endUserResponse) : HttpHelper.GetJSON(sUrl), _this12.getTranslatedText(_this12.getCustomFeedKey())])).then(function ([newsResponse, translationResponse]) {
|
|
1311
1392
|
let aNews = JSON.parse(JSON.stringify(newsResponse.value || []));
|
|
1312
1393
|
const aTranslation = JSON.parse(JSON.stringify(translationResponse.value || []));
|
|
1313
|
-
aNews =
|
|
1394
|
+
aNews = _this12.filterNewsOnTitle(aNews, newsTitle);
|
|
1314
1395
|
return aNews.map(oNews => {
|
|
1315
1396
|
const aFields = Object.keys(oNews);
|
|
1316
1397
|
const aExpandFields = [];
|
|
@@ -1326,7 +1407,7 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1326
1407
|
}
|
|
1327
1408
|
});
|
|
1328
1409
|
oNews.Link = {
|
|
1329
|
-
label:
|
|
1410
|
+
label: _this12._i18nBundle.getText("readMoreLink"),
|
|
1330
1411
|
value: oNews[CUSTOM_NEWS_FEED.LINK],
|
|
1331
1412
|
text: "Link"
|
|
1332
1413
|
};
|
|
@@ -1336,16 +1417,16 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1336
1417
|
});
|
|
1337
1418
|
});
|
|
1338
1419
|
}
|
|
1339
|
-
const
|
|
1340
|
-
if (
|
|
1341
|
-
return Promise.resolve(
|
|
1342
|
-
const
|
|
1343
|
-
|
|
1344
|
-
return
|
|
1420
|
+
const _temp15 = function () {
|
|
1421
|
+
if (_this12.customNewsFeedCache.has(sUrl)) {
|
|
1422
|
+
return Promise.resolve(_this12.customNewsFeedCache.get(sUrl)).then(function (newsFeedDetails) {
|
|
1423
|
+
const _this12$filterNewsOnT = _this12.filterNewsOnTitle(newsFeedDetails, newsTitle);
|
|
1424
|
+
_exit3 = true;
|
|
1425
|
+
return _this12$filterNewsOnT;
|
|
1345
1426
|
});
|
|
1346
1427
|
}
|
|
1347
1428
|
}();
|
|
1348
|
-
return Promise.resolve(
|
|
1429
|
+
return Promise.resolve(_temp15 && _temp15.then ? _temp15.then(_temp16) : _temp16(_temp15));
|
|
1349
1430
|
} catch (e) {
|
|
1350
1431
|
return Promise.reject(e);
|
|
1351
1432
|
}
|
|
@@ -1391,25 +1472,25 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1391
1472
|
*/
|
|
1392
1473
|
loadCustomNewsFeed: function _loadCustomNewsFeed(feeds, feedType) {
|
|
1393
1474
|
try {
|
|
1394
|
-
const
|
|
1395
|
-
const oXMLResponse =
|
|
1396
|
-
const oParent =
|
|
1397
|
-
if (!
|
|
1398
|
-
|
|
1399
|
-
if (!
|
|
1475
|
+
const _this13 = this;
|
|
1476
|
+
const oXMLResponse = _this13.parseJsonToXml(JSON.parse(JSON.stringify(feeds)), feedType);
|
|
1477
|
+
const oParent = _this13.getParent();
|
|
1478
|
+
if (!_this13.oNewsModel) {
|
|
1479
|
+
_this13.oNewsModel = new XMLModel(oXMLResponse);
|
|
1480
|
+
if (!_this13.bNewsLoad) {
|
|
1400
1481
|
oParent?.panelLoadedFn("News", {
|
|
1401
1482
|
loaded: true,
|
|
1402
1483
|
count: DEFAULT_FEED_COUNT
|
|
1403
1484
|
});
|
|
1404
|
-
|
|
1485
|
+
_this13.bNewsLoad = true;
|
|
1405
1486
|
}
|
|
1406
|
-
|
|
1487
|
+
_this13.oNewsTile.setModel(_this13.oNewsModel);
|
|
1407
1488
|
} else {
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1489
|
+
_this13.oNewsTile.unbindAggregation("tiles", false); // Unbind the bound aggregation
|
|
1490
|
+
_this13.oNewsTile.destroyAggregation("tiles"); // Removes old tiles
|
|
1491
|
+
_this13.oNewsModel.setData(oXMLResponse);
|
|
1411
1492
|
}
|
|
1412
|
-
return Promise.resolve(
|
|
1493
|
+
return Promise.resolve(_this13.loadNewsFeed(oXMLResponse, feeds.length)).then(function () {});
|
|
1413
1494
|
} catch (e) {
|
|
1414
1495
|
return Promise.reject(e);
|
|
1415
1496
|
}
|
|
@@ -1482,11 +1563,11 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/SlideTile", "sap/m/li
|
|
|
1482
1563
|
const random = Math.floor(Math.random() * 15) + 1;
|
|
1483
1564
|
return `${sPrefix}/${random}.jpg`;
|
|
1484
1565
|
};
|
|
1485
|
-
if (!groupImg || groupImg
|
|
1566
|
+
if (!groupImg || groupImg?.image_id !== imgId || !groupImg?.bg_image) {
|
|
1486
1567
|
return getRandomDefaultImage();
|
|
1487
1568
|
}
|
|
1488
|
-
let mimeType = groupImg
|
|
1489
|
-
const groupBgImg = groupImg
|
|
1569
|
+
let mimeType = groupImg?.mime_type;
|
|
1570
|
+
const groupBgImg = groupImg?.bg_image;
|
|
1490
1571
|
if (mimeType === "application/octet-stream") {
|
|
1491
1572
|
mimeType = "image/jpeg";
|
|
1492
1573
|
}
|