@sapui5/sap.cux.home 1.130.0 → 1.131.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/BaseAppPersPanel-dbg.js +11 -6
- package/src/sap/cux/home/BaseAppPersPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/BaseAppPersPanel.d.ts +1 -1
- package/src/sap/cux/home/BaseAppPersPanel.d.ts.map +1 -1
- package/src/sap/cux/home/BaseAppPersPanel.js +1 -1
- package/src/sap/cux/home/BaseAppPersPanel.js.map +1 -1
- package/src/sap/cux/home/BaseAppPersPanel.ts +6 -4
- package/src/sap/cux/home/BaseLayoutRenderer-dbg.js +9 -2
- package/src/sap/cux/home/BaseLayoutRenderer-dbg.js.map +1 -1
- package/src/sap/cux/home/BaseLayoutRenderer.d.ts.map +1 -1
- package/src/sap/cux/home/BaseLayoutRenderer.js +1 -1
- package/src/sap/cux/home/BaseLayoutRenderer.js.map +1 -1
- package/src/sap/cux/home/BaseLayoutRenderer.ts +11 -2
- package/src/sap/cux/home/FavAppPanel-dbg.js +14 -13
- package/src/sap/cux/home/FavAppPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/FavAppPanel.d.ts.map +1 -1
- package/src/sap/cux/home/FavAppPanel.js +1 -1
- package/src/sap/cux/home/FavAppPanel.js.map +1 -1
- package/src/sap/cux/home/FavAppPanel.ts +13 -14
- package/src/sap/cux/home/KeyUserLayoutSettingsPanel-dbg.js +1 -2
- package/src/sap/cux/home/KeyUserLayoutSettingsPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/KeyUserLayoutSettingsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/KeyUserLayoutSettingsPanel.js +1 -1
- package/src/sap/cux/home/KeyUserLayoutSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/KeyUserLayoutSettingsPanel.ts +1 -2
- package/src/sap/cux/home/KeyUserNewsSettingsPanel-dbg.js +2 -2
- package/src/sap/cux/home/KeyUserNewsSettingsPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/KeyUserNewsSettingsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/KeyUserNewsSettingsPanel.js +1 -1
- package/src/sap/cux/home/KeyUserNewsSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/KeyUserNewsSettingsPanel.ts +1 -4
- package/src/sap/cux/home/KeyUserPagesSettingsPanel-dbg.js +7 -3
- package/src/sap/cux/home/KeyUserPagesSettingsPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/KeyUserPagesSettingsPanel.js +1 -1
- package/src/sap/cux/home/KeyUserPagesSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/KeyUserPagesSettingsPanel.ts +3 -3
- package/src/sap/cux/home/LayoutSettingsPanel-dbg.js +1 -2
- package/src/sap/cux/home/LayoutSettingsPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/LayoutSettingsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/LayoutSettingsPanel.js +1 -1
- package/src/sap/cux/home/LayoutSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/LayoutSettingsPanel.ts +1 -2
- package/src/sap/cux/home/TilesPanel-dbg.js +29 -14
- package/src/sap/cux/home/TilesPanel-dbg.js.map +1 -1
- package/src/sap/cux/home/TilesPanel.d.ts +7 -0
- package/src/sap/cux/home/TilesPanel.d.ts.map +1 -1
- package/src/sap/cux/home/TilesPanel.js +1 -1
- package/src/sap/cux/home/TilesPanel.js.map +1 -1
- package/src/sap/cux/home/TilesPanel.ts +33 -14
- package/src/sap/cux/home/i18n/messagebundle.properties +7 -4
- package/src/sap/cux/home/i18n/messagebundle_ar.properties +21 -5
- package/src/sap/cux/home/i18n/messagebundle_bg.properties +20 -4
- package/src/sap/cux/home/i18n/messagebundle_ca.properties +20 -4
- package/src/sap/cux/home/i18n/messagebundle_cnr.properties +20 -4
- package/src/sap/cux/home/i18n/messagebundle_cs.properties +18 -2
- package/src/sap/cux/home/i18n/messagebundle_cy.properties +21 -5
- package/src/sap/cux/home/i18n/messagebundle_da.properties +20 -4
- package/src/sap/cux/home/i18n/messagebundle_de.properties +20 -4
- package/src/sap/cux/home/i18n/messagebundle_el.properties +21 -5
- package/src/sap/cux/home/i18n/messagebundle_en.properties +21 -5
- package/src/sap/cux/home/i18n/messagebundle_en_GB.properties +21 -5
- package/src/sap/cux/home/i18n/messagebundle_en_US_sappsd.properties +21 -5
- package/src/sap/cux/home/i18n/messagebundle_en_US_saprigi.properties +21 -5
- package/src/sap/cux/home/i18n/messagebundle_en_US_saptrc.properties +21 -5
- package/src/sap/cux/home/i18n/messagebundle_es.properties +21 -5
- package/src/sap/cux/home/i18n/messagebundle_es_MX.properties +21 -5
- package/src/sap/cux/home/i18n/messagebundle_et.properties +20 -4
- package/src/sap/cux/home/i18n/messagebundle_fi.properties +19 -3
- package/src/sap/cux/home/i18n/messagebundle_fr.properties +20 -4
- package/src/sap/cux/home/i18n/messagebundle_fr_CA.properties +19 -3
- package/src/sap/cux/home/i18n/messagebundle_hi.properties +19 -3
- package/src/sap/cux/home/i18n/messagebundle_hr.properties +32 -16
- package/src/sap/cux/home/i18n/messagebundle_hu.properties +19 -3
- package/src/sap/cux/home/i18n/messagebundle_id.properties +21 -5
- package/src/sap/cux/home/i18n/messagebundle_it.properties +20 -4
- package/src/sap/cux/home/i18n/messagebundle_iw.properties +19 -3
- package/src/sap/cux/home/i18n/messagebundle_ja.properties +20 -4
- package/src/sap/cux/home/i18n/messagebundle_kk.properties +21 -5
- package/src/sap/cux/home/i18n/messagebundle_ko.properties +18 -2
- package/src/sap/cux/home/i18n/messagebundle_lt.properties +18 -2
- package/src/sap/cux/home/i18n/messagebundle_lv.properties +20 -4
- package/src/sap/cux/home/i18n/messagebundle_mk.properties +21 -5
- package/src/sap/cux/home/i18n/messagebundle_ms.properties +21 -5
- package/src/sap/cux/home/i18n/messagebundle_nl.properties +22 -6
- package/src/sap/cux/home/i18n/messagebundle_no.properties +21 -5
- package/src/sap/cux/home/i18n/messagebundle_pl.properties +21 -5
- package/src/sap/cux/home/i18n/messagebundle_pt.properties +20 -4
- package/src/sap/cux/home/i18n/messagebundle_pt_PT.properties +20 -4
- package/src/sap/cux/home/i18n/messagebundle_ro.properties +25 -9
- package/src/sap/cux/home/i18n/messagebundle_ru.properties +19 -3
- package/src/sap/cux/home/i18n/messagebundle_sh.properties +20 -4
- package/src/sap/cux/home/i18n/messagebundle_sk.properties +19 -3
- package/src/sap/cux/home/i18n/messagebundle_sl.properties +21 -5
- package/src/sap/cux/home/i18n/messagebundle_sr.properties +20 -4
- package/src/sap/cux/home/i18n/messagebundle_sv.properties +25 -9
- package/src/sap/cux/home/i18n/messagebundle_th.properties +31 -15
- package/src/sap/cux/home/i18n/messagebundle_tr.properties +18 -2
- package/src/sap/cux/home/i18n/messagebundle_uk.properties +24 -8
- package/src/sap/cux/home/i18n/messagebundle_vi.properties +21 -5
- package/src/sap/cux/home/i18n/messagebundle_zh_CN.properties +19 -3
- package/src/sap/cux/home/i18n/messagebundle_zh_TW.properties +19 -3
- package/src/sap/cux/home/interface/AppsInterface-dbg.js.map +1 -1
- package/src/sap/cux/home/interface/AppsInterface.d.ts +1 -0
- package/src/sap/cux/home/interface/AppsInterface.d.ts.map +1 -1
- package/src/sap/cux/home/interface/AppsInterface.ts +1 -0
- package/src/sap/cux/home/library-dbg.js +1 -0
- package/src/sap/cux/home/library-dbg.js.map +1 -1
- package/src/sap/cux/home/library-preload.js +11 -11
- package/src/sap/cux/home/library-preload.js.map +1 -1
- package/src/sap/cux/home/library.d.ts.map +1 -1
- package/src/sap/cux/home/library.js +1 -1
- package/src/sap/cux/home/library.js.map +1 -1
- package/src/sap/cux/home/library.ts +1 -0
- package/src/sap/cux/home/manifest.json +4 -9
- package/src/sap/cux/home/themes/base/AppsContainer.less +11 -5
- package/src/sap/cux/home/themes/base/library-RTL.css +1 -1
- package/src/sap/cux/home/themes/base/library.css +1 -1
- package/src/sap/cux/home/themes/sap_fiori_3/library-RTL.css +1 -1
- package/src/sap/cux/home/themes/sap_fiori_3/library.css +1 -1
- package/src/sap/cux/home/themes/sap_fiori_3_dark/library-RTL.css +1 -1
- package/src/sap/cux/home/themes/sap_fiori_3_dark/library.css +1 -1
- package/src/sap/cux/home/themes/sap_fiori_3_hcb/library-RTL.css +1 -1
- package/src/sap/cux/home/themes/sap_fiori_3_hcb/library.css +1 -1
- package/src/sap/cux/home/themes/sap_fiori_3_hcw/library-RTL.css +1 -1
- package/src/sap/cux/home/themes/sap_fiori_3_hcw/library.css +1 -1
- package/src/sap/cux/home/themes/sap_horizon/library-RTL.css +1 -1
- package/src/sap/cux/home/themes/sap_horizon/library.css +1 -1
- package/src/sap/cux/home/themes/sap_horizon_dark/library-RTL.css +1 -1
- package/src/sap/cux/home/themes/sap_horizon_dark/library.css +1 -1
- package/src/sap/cux/home/themes/sap_horizon_hcb/library-RTL.css +1 -1
- package/src/sap/cux/home/themes/sap_horizon_hcb/library.css +1 -1
- package/src/sap/cux/home/themes/sap_horizon_hcw/library-RTL.css +1 -1
- package/src/sap/cux/home/themes/sap_horizon_hcw/library.css +1 -1
- package/src/sap/cux/home/utils/AppManager-dbg.js +2 -2
- package/src/sap/cux/home/utils/AppManager-dbg.js.map +1 -1
- package/src/sap/cux/home/utils/AppManager.d.ts.map +1 -1
- package/src/sap/cux/home/utils/AppManager.js +1 -1
- package/src/sap/cux/home/utils/AppManager.js.map +1 -1
- package/src/sap/cux/home/utils/AppManager.ts +3 -3
- package/src/sap/cux/home/utils/FESRUtil.d.ts +1 -1
- package/ui5.yaml +0 -2
- package/src/sap/cux/home/themes/sap_belize/library-RTL.css +0 -4
- package/src/sap/cux/home/themes/sap_belize/library-parameters.json +0 -1
- package/src/sap/cux/home/themes/sap_belize/library.css +0 -4
- package/src/sap/cux/home/themes/sap_belize/library.source.less +0 -11
- package/src/sap/cux/home/themes/sap_belize_base/AppsContainer.less +0 -23
- package/src/sap/cux/home/themes/sap_belize_base/BaseContainer.less +0 -31
- package/src/sap/cux/home/themes/sap_belize_base/BaseLayout.less +0 -57
- package/src/sap/cux/home/themes/sap_belize_base/InsightsContainer.less +0 -9
- package/src/sap/cux/home/themes/sap_belize_base/KeyUserSettingsDialog.less +0 -39
- package/src/sap/cux/home/themes/sap_belize_base/Layout.less +0 -7
- package/src/sap/cux/home/themes/sap_belize_base/NewsAndPagesContainer.less +0 -69
- package/src/sap/cux/home/themes/sap_belize_base/SettingsDialog.less +0 -3
- package/src/sap/cux/home/themes/sap_belize_base/ToDosContainer.less +0 -74
- package/src/sap/cux/home/themes/sap_belize_base/library-RTL.css +0 -3
- package/src/sap/cux/home/themes/sap_belize_base/library-parameters.json +0 -1
- package/src/sap/cux/home/themes/sap_belize_base/library.css +0 -3
- package/src/sap/cux/home/themes/sap_belize_base/library.source.less +0 -12
- package/src/sap/cux/home/themes/sap_belize_hcb/library-RTL.css +0 -3
- package/src/sap/cux/home/themes/sap_belize_hcb/library-parameters.json +0 -1
- package/src/sap/cux/home/themes/sap_belize_hcb/library.css +0 -3
- package/src/sap/cux/home/themes/sap_belize_hcb/library.source.less +0 -11
- package/src/sap/cux/home/themes/sap_belize_hcw/library-RTL.css +0 -3
- package/src/sap/cux/home/themes/sap_belize_hcw/library-parameters.json +0 -1
- package/src/sap/cux/home/themes/sap_belize_hcw/library.css +0 -3
- package/src/sap/cux/home/themes/sap_belize_hcw/library.source.less +0 -11
- package/src/sap/cux/home/themes/sap_belize_plus/library-RTL.css +0 -4
- package/src/sap/cux/home/themes/sap_belize_plus/library-parameters.json +0 -1
- package/src/sap/cux/home/themes/sap_belize_plus/library.css +0 -4
- package/src/sap/cux/home/themes/sap_belize_plus/library.source.less +0 -3
package/package.json
CHANGED
|
@@ -140,7 +140,7 @@ sap.ui.define(["sap/base/Log", "sap/ui/core/EventBus", "sap/ushell/Container", "
|
|
|
140
140
|
},
|
|
141
141
|
/**
|
|
142
142
|
* Sets the personalization data.
|
|
143
|
-
* @param {
|
|
143
|
+
* @param {IAppPersonalization[]} appsPersonalization - Personalization data for favorite apps.
|
|
144
144
|
* @returns {Promise<void>} A promise that resolves when the personalization data is set.
|
|
145
145
|
* @private
|
|
146
146
|
*/
|
|
@@ -148,8 +148,13 @@ sap.ui.define(["sap/base/Log", "sap/ui/core/EventBus", "sap/ushell/Container", "
|
|
|
148
148
|
try {
|
|
149
149
|
const _this5 = this;
|
|
150
150
|
return Promise.resolve(_this5.getPersonalization()).then(function (personalization) {
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
const _temp = function () {
|
|
152
|
+
if (personalization) {
|
|
153
|
+
personalization.favoriteApps = appsPersonalization;
|
|
154
|
+
return Promise.resolve(_this5.setPersonalization(personalization)).then(function () {});
|
|
155
|
+
}
|
|
156
|
+
}();
|
|
157
|
+
if (_temp && _temp.then) return _temp.then(function () {});
|
|
153
158
|
});
|
|
154
159
|
} catch (e) {
|
|
155
160
|
return Promise.reject(e);
|
|
@@ -293,10 +298,10 @@ sap.ui.define(["sap/base/Log", "sap/ui/core/EventBus", "sap/ushell/Container", "
|
|
|
293
298
|
let _exit = false;
|
|
294
299
|
const _this9 = this;
|
|
295
300
|
return Promise.resolve(_catch(function () {
|
|
296
|
-
function
|
|
301
|
+
function _temp3(_result) {
|
|
297
302
|
return _exit ? _result : [];
|
|
298
303
|
}
|
|
299
|
-
const
|
|
304
|
+
const _temp2 = function () {
|
|
300
305
|
if (pages) {
|
|
301
306
|
_this9._favPageVisualizations = _this9._favPageVisualizations || [];
|
|
302
307
|
//Check to ensure that missing visualization data is loaded, if any
|
|
@@ -322,7 +327,7 @@ sap.ui.define(["sap/base/Log", "sap/ui/core/EventBus", "sap/ushell/Container", "
|
|
|
322
327
|
}
|
|
323
328
|
}
|
|
324
329
|
}();
|
|
325
|
-
return
|
|
330
|
+
return _temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2);
|
|
326
331
|
}, function (error) {
|
|
327
332
|
Log.error(error);
|
|
328
333
|
return [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseAppPersPanel-dbg.js","names":["sap","ui","define","Log","EventBus","Container","__BaseAppPanel","___utils_Constants","__DataFormatUtils","__PageManager","__PersonalisationUtils","__UshellPersonalizer","_interopRequireDefault","obj","__esModule","default","_catch","body","recover","result","e","then","BaseAppPanel","DEFAULT_APP_ICON","DEFAULT_BG_COLOR","FALLBACK_ICON","MYHOME_PAGE_ID","DataFormatUtils","PageManager","PersonalisationUtils","UshellPersonalizer","BaseAppPersPanel","extend","metadata","library","properties","persContainerId","type","group","defaultValue","visibility","constructor","_constructor","id","settings","BaseAppPanel.prototype.constructor.call","_favPageVisualizations","init","_init","BaseAppPanel.prototype.init.call","setProperty","getPersContainerId","_pageManagerInstance","getInstance","getOwnerComponent","_eventBus","subscribe","applyPersonalization","_getPersonalizer","_this","getProperty","Error","Promise","resolve","reject","getPersonalization","_getPersonalization","_this2","personalizer","read","setPersonalization","_setPersonalization","persData","_this3","write","_getAppPersonalization","_this4","personalization","favoriteApps","setFavAppsPersonalization","_setFavAppsPersonalization","appsPersonalization","_this5","_applyPersonalization","_this6","tiles","fetchTileVisualization","_applyTilesPersonalization","groupId","shouldReload","arguments","length","undefined","_this7","all","_getFavPages","_ref","personalizations","favPages","_getAllFavPageApps","favPageVisualizations","groups","getAggregation","apps","_getGroup","getApps","tile","item","_getItem","color","icon","_getItemPersonalization","setBackgroundColor","setTileIcon","tileGroupId","data","find","oGroup","getGroupId","oApp","getLeanURL","getUrl","isA","isSection","sectionId","BGColor","app","appIds","oldAppId","push","vizId","getVizId","appId","includes","oPersonalization","isRecentlyAddedApp","favPageVisualization","oVisualization","key","_getFavAppIcon","getAppIcon","_this8","getFavoritePages","aFavPages","concat","pageId","pages","_exit","_this9","_temp2","_result","_temp","loadedPages","reduce","pageIDs","visualization","pageIds","map","page","shouldLoadMissingApps","every","_this9$_favPageVisual","_loadAllPageVisualizations","_this9$_loadAllPageVi","_this9$_favPageVisual2","error","shouldFetchDistinctApps","getBgColor","getServiceAsync","spaceContentService","getPages","oPage","pageData","aPages","Object","values","sections","section","visualizations","targetURL","some","oVizApp","_getAppIcon","favPageIcon","getIcon"],"sources":["BaseAppPersPanel.ts"],"sourcesContent":["/*!\n * SAP UI development toolkit for HTML5 (SAPUI5)\n * * (c) Copyright 2009-2024 SAP SE. All rights reserved\n */\n\nimport Log from \"sap/base/Log\";\nimport GenericTile from \"sap/m/GenericTile\";\nimport Component from \"sap/ui/core/Component\";\nimport type { MetadataOptions } from \"sap/ui/core/Element\";\nimport EventBus from \"sap/ui/core/EventBus\";\nimport Container from \"sap/ushell/Container\";\nimport SpaceContent from \"sap/ushell/services/SpaceContent\";\nimport App from \"./App\";\nimport BaseAppPanel from \"./BaseAppPanel\";\nimport { $BaseAppPersPanelSettings } from \"./BaseAppPersPanel\";\nimport Group from \"./Group\";\nimport { IAppPersonalization, ICustomVisualization, IItemPersonalization } from \"./interface/AppsInterface\";\nimport { IPage } from \"./interface/PageSpaceInterface\";\nimport { DEFAULT_APP_ICON, DEFAULT_BG_COLOR, FALLBACK_ICON, MYHOME_PAGE_ID } from \"./utils/Constants\";\nimport DataFormatUtils from \"./utils/DataFormatUtils\";\nimport PageManager from \"./utils/PageManager\";\nimport PersonalisationUtils from \"./utils/PersonalisationUtils\";\nimport UshellPersonalizer, { IPersonalizationData } from \"./utils/UshellPersonalizer\";\n\n/**\n *\n * Provides the BaseAppPersPanel Class which is BaseAppPanel with personalisation.\n *\n * @extends sap.cux.home.BaseAppPanel\n *\n * @author SAP SE\n * @version 0.0.1\n * @since 1.121.0\n *\n * @abstract\n * @internal\n * @experimental Since 1.121\n * @private\n *\n * @alias sap.cux.home.BaseAppPersPanel\n */\nexport default abstract class BaseAppPersPanel extends BaseAppPanel {\n\tprivate _pageManagerInstance!: PageManager;\n\tprivate _favPageVisualizations: ICustomVisualization[] = [];\n\tprivate _eventBus!: EventBus;\n\n\tconstructor(idOrSettings?: string | $BaseAppPersPanelSettings);\n\tconstructor(id?: string, settings?: $BaseAppPersPanelSettings);\n\tconstructor(id?: string, settings?: $BaseAppPersPanelSettings) {\n\t\tsuper(id, settings);\n\t}\n\n\tstatic readonly metadata: MetadataOptions = {\n\t\tlibrary: \"sap.cux.home\",\n\t\tproperties: {\n\t\t\tpersContainerId: { type: \"string\", group: \"Misc\", defaultValue: \"\", visibility: \"hidden\" }\n\t\t}\n\t};\n\n\tpublic init() {\n\t\tsuper.init();\n\t\tthis.setProperty(\"persContainerId\", PersonalisationUtils.getPersContainerId(this));\n\t\tthis._pageManagerInstance = PageManager.getInstance(\n\t\t\tPersonalisationUtils.getPersContainerId(this),\n\t\t\tPersonalisationUtils.getOwnerComponent(this) as Component\n\t\t);\n\t\tthis._eventBus = EventBus.getInstance();\n\n\t\t//apply personalization on page update\n\t\tthis._eventBus.subscribe(\n\t\t\t\"pageChannel\",\n\t\t\t\"pageUpdated\",\n\t\t\t() => {\n\t\t\t\tvoid this.applyPersonalization();\n\t\t\t},\n\t\t\tthis\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves the personalizer instance.\n\t * @returns {Promise<sap.cux.home.UshellPersonalizer>} A promise resolving to the personalizer instance.\n\t * @throws {Error} Throws an error if no container ID is provided for personalization.\n\t * @private\n\t */\n\tprivate async _getPersonalizer() {\n\t\tconst persContainerId = this.getProperty(\"persContainerId\") as string;\n\t\tif (!persContainerId) {\n\t\t\tthrow new Error(\"No Container ID Provided for personalisation!\");\n\t\t}\n\t\tconst personalizer = await UshellPersonalizer?.getInstance(\n\t\t\tpersContainerId,\n\t\t\tPersonalisationUtils.getOwnerComponent(this) as Component\n\t\t);\n\t\treturn personalizer;\n\t}\n\n\t/**\n\t * Retrieves personalization data.\n\t * @returns {Promise<IPersonalizationData>} A promise that resolves with the personalization data.\n\t * @private\n\t */\n\tprotected async getPersonalization() {\n\t\tconst personalizer = await this._getPersonalizer();\n\t\tconst persData = await personalizer?.read();\n\t\treturn persData;\n\t}\n\n\t/**\n\t * Sets the personalization data.\n\t * @param {IPersonalizationData} persData - The personalization data to set.\n\t * @returns {Promise<void>} A promise that resolves when the personalization data is set.\n\t * @private\n\t */\n\tprotected async setPersonalization(persData: IPersonalizationData) {\n\t\tconst personalizer = await this._getPersonalizer();\n\t\tawait personalizer.write(persData);\n\t}\n\n\t/**\n\t * Returns array of personalized favorite apps\n\t *\n\t * @returns {Promise} resolves to return array of personalized favorite apps\n\t */\n\tprotected async _getAppPersonalization() {\n\t\tconst personalization = await this.getPersonalization();\n\t\treturn personalization?.favoriteApps || ([] as IAppPersonalization[]);\n\t}\n\n\t/**\n\t * Sets the personalization data.\n\t * @param {Array} appsPersonalization - Personalization data for favorite apps.\n\t * @returns {Promise<void>} A promise that resolves when the personalization data is set.\n\t * @private\n\t */\n\tprotected async setFavAppsPersonalization(appsPersonalization: IAppPersonalization[]) {\n\t\tlet personalization = await this.getPersonalization();\n\t\tpersonalization.favoriteApps = appsPersonalization;\n\t\tawait this.setPersonalization(personalization);\n\t}\n\n\t/**\n\t * Applies personalization settings to the tiles.\n\t * Retrieves tiles from the generated apps wrapper and applies personalization settings to each tile.\n\t * Personalization settings include background color and icon customization.\n\t * @private\n\t * @async\n\t */\n\tpublic async applyPersonalization() {\n\t\tlet tiles: GenericTile[] = [];\n\t\ttiles = this.fetchTileVisualization(tiles);\n\t\treturn await this._applyTilesPersonalization(tiles);\n\t}\n\n\t/**\n\t * Applies personalization settings to the provided tiles.\n\t * @param {Array} tiles - An array of tiles to apply personalization settings to.\n\t * @param {string} [groupId] - Optional group ID for filtering personalization settings.\n\t * @param {boolean} [shouldReload=true] - A flag indicating whether to reload page visualizations.\n\t * @returns {Promise<void>} A promise that resolves when personalization settings are applied to the tiles.\n\t * @private\n\t */\n\tprotected async _applyTilesPersonalization(tiles: GenericTile[], groupId?: string, shouldReload = true) {\n\t\tconst [personalizations, favPages] = await Promise.all([this._getAppPersonalization(), this._getFavPages()]);\n\t\tconst favPageVisualizations = await this._getAllFavPageApps(favPages, shouldReload);\n\t\tconst groups = (this.getAggregation(\"groups\") || []) as Group[];\n\t\tconst apps = groupId ? this._getGroup(groupId)?.getApps() || [] : this.getApps() || [];\n\t\tfor (const tile of tiles) {\n\t\t\tconst item = this._getItem(tile, groups, apps);\n\t\t\tconst { color, icon } = this._getItemPersonalization(item, personalizations, favPageVisualizations, groupId);\n\n\t\t\tif (color) {\n\t\t\t\titem?.setProperty(\"bgColor\", color, true);\n\t\t\t\ttile.setBackgroundColor(color);\n\t\t\t}\n\n\t\t\tif (icon) {\n\t\t\t\titem?.setProperty(\"icon\", icon, true);\n\t\t\t\ttile.setTileIcon(icon);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the corresponding App or Group object associated with the given tile.\n\t * @param {GenericTile} tile - The tile for which to retrieve the corresponding item.\n\t * @param {Group[]} groups - An array of Group objects.\n\t * @param {App[]} apps - An array of App objects.\n\t * @returns {App | Group | undefined} The corresponding App or Group object, or undefined if not found.\n\t * @private\n\t */\n\tprivate _getItem(tile: GenericTile, groups: Group[], apps: App[]): App | Group | undefined {\n\t\tconst tileGroupId = tile.data(\"groupId\") as string | undefined;\n\t\tif (tileGroupId) {\n\t\t\treturn groups.find((oGroup) => oGroup.getGroupId() === tileGroupId);\n\t\t} else {\n\t\t\treturn apps.find((oApp) => DataFormatUtils.getLeanURL(oApp.getUrl()) === tile.getUrl());\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the color and icon associated with the specified item based on personalizations.\n\t * @param {App | Group | undefined} item - The App or Group object for which to retrieve personalization data.\n\t * @param {IAppPersonalization[] | undefined} personalizations - An array of personalization objects.\n\t * @param {ICustomVisualization[]} favPageVisualizations - An array of favorite page visualizations.\n\t * @param {string | undefined} groupId - The ID of the group to which the item belongs.\n\t * @returns {IItemPersonalization} An object containing the color and icon associated with the item.\n\t * @private\n\t */\n\tprivate _getItemPersonalization(\n\t\titem: App | Group | undefined,\n\t\tpersonalizations: IAppPersonalization[] | undefined,\n\t\tfavPageVisualizations: ICustomVisualization[],\n\t\tgroupId?: string\n\t): IItemPersonalization {\n\t\tlet color: string = \"\";\n\t\tlet icon: string = \"\";\n\n\t\tif (!item) return { color, icon };\n\n\t\tif (item.isA(\"sap.cux.home.Group\")) {\n\t\t\tconst personalization = personalizations?.find(\n\t\t\t\t(personalization) => personalization.isSection && personalization.sectionId === (item as Group).getGroupId()\n\t\t\t);\n\t\t\tcolor = personalization?.BGColor as string;\n\t\t} else {\n\t\t\tconst app = item as App;\n\t\t\tconst appIds = [app.getUrl()];\n\t\t\tconst oldAppId = app.data(\"oldAppId\") as string | undefined;\n\t\t\tif (oldAppId) {\n\t\t\t\tappIds.push(oldAppId);\n\t\t\t}\n\t\t\tconst vizId = app.getVizId();\n\t\t\tconst personalization = groupId\n\t\t\t\t? personalizations?.find(\n\t\t\t\t\t\t(personalization) =>\n\t\t\t\t\t\t\t!personalization.isSection &&\n\t\t\t\t\t\t\tpersonalization.sectionId === groupId &&\n\t\t\t\t\t\t\tpersonalization.appId &&\n\t\t\t\t\t\t\tappIds.includes(personalization.appId)\n\t\t\t\t\t)\n\t\t\t\t: personalizations?.find(\n\t\t\t\t\t\t(oPersonalization) =>\n\t\t\t\t\t\t\toPersonalization.isRecentlyAddedApp && oPersonalization.appId && appIds.includes(oPersonalization.appId)\n\t\t\t\t\t);\n\t\t\tconst favPageVisualization = favPageVisualizations.find(\n\t\t\t\t(oVisualization) => oVisualization.vizId === vizId || (oVisualization.appId && appIds.includes(oVisualization.appId))\n\t\t\t);\n\t\t\tcolor = personalization?.BGColor || favPageVisualization?.BGColor || DEFAULT_BG_COLOR().key;\n\t\t\ticon = this?.isA(\"sap.cux.home.FavAppPanel\") ? this._getFavAppIcon(app, favPageVisualization?.icon) : this.getAppIcon();\n\t\t}\n\n\t\treturn { color, icon };\n\t}\n\n\t/**\n\t * Retrieves favorite pages.\n\t * @returns {Promise<Array>} A promise that resolves with an array of favorite pages.\n\t * @private\n\t */\n\tprivate async _getFavPages() {\n\t\tconst aFavPages = await this._pageManagerInstance.getFavoritePages();\n\t\treturn aFavPages.concat({\n\t\t\tpageId: MYHOME_PAGE_ID,\n\t\t\tBGColor: DEFAULT_BG_COLOR().key\n\t\t});\n\t}\n\n\t/**\n\t * Retrieves visualizations for all favorite pages based on the provided parameters.\n\t * @param {Array} pages - An array of favorite pages.\n\t * @param {boolean} shouldReload - A flag indicating whether to reload page visualizations.\n\t * @returns {Promise<Array>} A promise that resolves with an array of favorite page visualizations.\n\t * @private\n\t */\n\tprivate async _getAllFavPageApps(pages: IPage[], shouldReload?: boolean) {\n\t\ttry {\n\t\t\tif (pages) {\n\t\t\t\tthis._favPageVisualizations = this._favPageVisualizations || [];\n\t\t\t\t//Check to ensure that missing visualization data is loaded, if any\n\t\t\t\tconst loadedPages = this._favPageVisualizations.reduce((pageIDs: string[], visualization) => {\n\t\t\t\t\tif (visualization.pageId && !pageIDs.includes(visualization.pageId)) {\n\t\t\t\t\t\tpageIDs.push(visualization.pageId);\n\t\t\t\t\t}\n\t\t\t\t\treturn pageIDs;\n\t\t\t\t}, []);\n\t\t\t\tconst pageIds = pages.map((page) => page.pageId);\n\t\t\t\tconst shouldLoadMissingApps = loadedPages.length === 0 || !loadedPages.every((pageId) => pageIds.includes(pageId));\n\t\t\t\tif (!shouldReload && !shouldLoadMissingApps) {\n\t\t\t\t\treturn this._favPageVisualizations;\n\t\t\t\t} else {\n\t\t\t\t\tthis._favPageVisualizations = await this._loadAllPageVisualizations(pages);\n\t\t\t\t\treturn this._favPageVisualizations;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn [];\n\t\t} catch (error) {\n\t\t\tLog.error(error as string);\n\t\t\treturn [];\n\t\t}\n\t}\n\n\t/**\n\t * Loads visualizations for all specified pages.\n\t * @param {Array} pages - An array of pages.\n\t * @param {boolean} [shouldFetchDistinctApps=false] - A flag indicating whether to fetch distinct pages.\n\t * @returns {Promise<Array>} A promise that resolves with an array of page visualizations.\n\t * @private\n\t */\n\tprivate async _loadAllPageVisualizations(pages: IPage[], shouldFetchDistinctApps = false) {\n\t\tconst getBgColor = (pageId: string | undefined) => {\n\t\t\treturn pages.find((page) => page.pageId === pageId)?.BGColor ?? DEFAULT_BG_COLOR().key;\n\t\t};\n\n\t\ttry {\n\t\t\tconst favPageVisualizations: ICustomVisualization[] = [];\n\t\t\tconst spaceContentService = await Container.getServiceAsync<SpaceContent>(\"SpaceContent\");\n\t\t\tconst pageData = await spaceContentService.getPages(pages.map((oPage) => oPage.pageId) as string[]);\n\t\t\tconst aPages = Object.values(pageData);\n\n\t\t\tfor (const page of aPages) {\n\t\t\t\tconst sections = page.sections || [];\n\t\t\t\tfor (const section of sections) {\n\t\t\t\t\tconst visualizations = section.visualizations || [];\n\t\t\t\t\tfor (const visualization of visualizations) {\n\t\t\t\t\t\tconst app = {\n\t\t\t\t\t\t\tappId: visualization.targetURL,\n\t\t\t\t\t\t\tvizId: visualization.vizId,\n\t\t\t\t\t\t\ticon: visualization.icon,\n\t\t\t\t\t\t\tBGColor: getBgColor(page.id) as string,\n\t\t\t\t\t\t\tpageId: page.id\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (!shouldFetchDistinctApps || !favPageVisualizations.some((oVizApp) => oVizApp.appId === app.appId)) {\n\t\t\t\t\t\t\tfavPageVisualizations.push(app);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn favPageVisualizations;\n\t\t} catch (error) {\n\t\t\tLog.error(error as string);\n\t\t\treturn [];\n\t\t}\n\t}\n\n\t/**\n\t * Returns default app icon.\n\t * @returns {string} The icon URL for the app.\n\t * @private\n\t */\n\tprotected getAppIcon(): string {\n\t\treturn DEFAULT_APP_ICON;\n\t}\n\n\t/**\n\t * Retrieves the icon for the specified app, prioritizing the favorite page icon if available.\n\t * @param {sap.cux.home.App} app - The app object.\n\t * @param {string} favPageIcon - The icon for the app from the favorite page.\n\t * @returns {string} The icon URL for the app.\n\t * @private\n\t */\n\tprivate _getFavAppIcon(app?: App, favPageIcon?: string): string {\n\t\treturn favPageIcon || app?.getIc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AAA;IAED;AACD;AACA;AACA;AACA;IACWwH,UAAU,WAAA0C,YAAA,EAAW;MAC9B,OAAO/J,gBAAgB;IACxB,CAAC;IAED;AACD;AACA;AACA;AACA;AACA;AACA;IACSoH,cAAc,WAAAA,eAACb,GAAS,EAAEyD,WAAoB,EAAU;MAC/D,OAAOA,WAAW,IAAIzD,GAAG,EAAE0D,OAAO,CAAC,CAAC,IAAI/J,aAAa;IACtD;EAAC;EAAA,OAlU4BM,gBAAgB;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"BaseAppPersPanel-dbg.js","names":["sap","ui","define","Log","EventBus","Container","__BaseAppPanel","___utils_Constants","__DataFormatUtils","__PageManager","__PersonalisationUtils","__UshellPersonalizer","_interopRequireDefault","obj","__esModule","default","_catch","body","recover","result","e","then","BaseAppPanel","DEFAULT_APP_ICON","DEFAULT_BG_COLOR","FALLBACK_ICON","MYHOME_PAGE_ID","DataFormatUtils","PageManager","PersonalisationUtils","UshellPersonalizer","BaseAppPersPanel","extend","metadata","library","properties","persContainerId","type","group","defaultValue","visibility","constructor","_constructor","id","settings","BaseAppPanel.prototype.constructor.call","_favPageVisualizations","init","_init","BaseAppPanel.prototype.init.call","setProperty","getPersContainerId","_pageManagerInstance","getInstance","getOwnerComponent","_eventBus","subscribe","applyPersonalization","_getPersonalizer","_this","getProperty","Error","Promise","resolve","reject","getPersonalization","_getPersonalization","_this2","personalizer","read","setPersonalization","_setPersonalization","persData","_this3","write","_getAppPersonalization","_this4","personalization","favoriteApps","setFavAppsPersonalization","_setFavAppsPersonalization","appsPersonalization","_this5","_temp","_applyPersonalization","_this6","tiles","fetchTileVisualization","_applyTilesPersonalization","groupId","shouldReload","arguments","length","undefined","_this7","all","_getFavPages","_ref","personalizations","favPages","_getAllFavPageApps","favPageVisualizations","groups","getAggregation","apps","_getGroup","getApps","tile","item","_getItem","color","icon","_getItemPersonalization","setBackgroundColor","setTileIcon","tileGroupId","data","find","oGroup","getGroupId","oApp","getLeanURL","getUrl","isA","isSection","sectionId","BGColor","app","appIds","oldAppId","push","vizId","getVizId","appId","includes","oPersonalization","isRecentlyAddedApp","favPageVisualization","oVisualization","key","_getFavAppIcon","getAppIcon","_this8","getFavoritePages","aFavPages","concat","pageId","pages","_exit","_this9","_temp3","_result","_temp2","loadedPages","reduce","pageIDs","visualization","pageIds","map","page","shouldLoadMissingApps","every","_this9$_favPageVisual","_loadAllPageVisualizations","_this9$_loadAllPageVi","_this9$_favPageVisual2","error","shouldFetchDistinctApps","getBgColor","getServiceAsync","spaceContentService","getPages","oPage","pageData","aPages","Object","values","sections","section","visualizations","targetURL","some","oVizApp","_getAppIcon","favPageIcon","getIcon"],"sources":["BaseAppPersPanel.ts"],"sourcesContent":["/*!\n * SAP UI development toolkit for HTML5 (SAPUI5)\n * * (c) Copyright 2009-2024 SAP SE. All rights reserved\n */\n\nimport Log from \"sap/base/Log\";\nimport GenericTile from \"sap/m/GenericTile\";\nimport Component from \"sap/ui/core/Component\";\nimport type { MetadataOptions } from \"sap/ui/core/Element\";\nimport EventBus from \"sap/ui/core/EventBus\";\nimport Container from \"sap/ushell/Container\";\nimport SpaceContent from \"sap/ushell/services/SpaceContent\";\nimport App from \"./App\";\nimport BaseAppPanel from \"./BaseAppPanel\";\nimport { $BaseAppPersPanelSettings } from \"./BaseAppPersPanel\";\nimport Group from \"./Group\";\nimport { IAppPersonalization, ICustomVisualization, IItemPersonalization } from \"./interface/AppsInterface\";\nimport { IPage } from \"./interface/PageSpaceInterface\";\nimport { DEFAULT_APP_ICON, DEFAULT_BG_COLOR, FALLBACK_ICON, MYHOME_PAGE_ID } from \"./utils/Constants\";\nimport DataFormatUtils from \"./utils/DataFormatUtils\";\nimport PageManager from \"./utils/PageManager\";\nimport PersonalisationUtils from \"./utils/PersonalisationUtils\";\nimport UshellPersonalizer, { IPersonalizationData } from \"./utils/UshellPersonalizer\";\n\n/**\n *\n * Provides the BaseAppPersPanel Class which is BaseAppPanel with personalisation.\n *\n * @extends sap.cux.home.BaseAppPanel\n *\n * @author SAP SE\n * @version 0.0.1\n * @since 1.121.0\n *\n * @abstract\n * @internal\n * @experimental Since 1.121\n * @private\n *\n * @alias sap.cux.home.BaseAppPersPanel\n */\nexport default abstract class BaseAppPersPanel extends BaseAppPanel {\n\tprivate _pageManagerInstance!: PageManager;\n\tprivate _favPageVisualizations: ICustomVisualization[] = [];\n\tprivate _eventBus!: EventBus;\n\n\tconstructor(idOrSettings?: string | $BaseAppPersPanelSettings);\n\tconstructor(id?: string, settings?: $BaseAppPersPanelSettings);\n\tconstructor(id?: string, settings?: $BaseAppPersPanelSettings) {\n\t\tsuper(id, settings);\n\t}\n\n\tstatic readonly metadata: MetadataOptions = {\n\t\tlibrary: \"sap.cux.home\",\n\t\tproperties: {\n\t\t\tpersContainerId: { type: \"string\", group: \"Misc\", defaultValue: \"\", visibility: \"hidden\" }\n\t\t}\n\t};\n\n\tpublic init() {\n\t\tsuper.init();\n\t\tthis.setProperty(\"persContainerId\", PersonalisationUtils.getPersContainerId(this));\n\t\tthis._pageManagerInstance = PageManager.getInstance(\n\t\t\tPersonalisationUtils.getPersContainerId(this),\n\t\t\tPersonalisationUtils.getOwnerComponent(this) as Component\n\t\t);\n\t\tthis._eventBus = EventBus.getInstance();\n\n\t\t//apply personalization on page update\n\t\tthis._eventBus.subscribe(\n\t\t\t\"pageChannel\",\n\t\t\t\"pageUpdated\",\n\t\t\t() => {\n\t\t\t\tvoid this.applyPersonalization();\n\t\t\t},\n\t\t\tthis\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves the personalizer instance.\n\t * @returns {Promise<sap.cux.home.UshellPersonalizer>} A promise resolving to the personalizer instance.\n\t * @throws {Error} Throws an error if no container ID is provided for personalization.\n\t * @private\n\t */\n\tprivate async _getPersonalizer() {\n\t\tconst persContainerId = this.getProperty(\"persContainerId\") as string;\n\t\tif (!persContainerId) {\n\t\t\tthrow new Error(\"No Container ID Provided for personalisation!\");\n\t\t}\n\t\tconst personalizer = await UshellPersonalizer?.getInstance(\n\t\t\tpersContainerId,\n\t\t\tPersonalisationUtils.getOwnerComponent(this) as Component\n\t\t);\n\t\treturn personalizer;\n\t}\n\n\t/**\n\t * Retrieves personalization data.\n\t * @returns {Promise<IPersonalizationData>} A promise that resolves with the personalization data.\n\t * @private\n\t */\n\tprotected async getPersonalization() {\n\t\tconst personalizer = await this._getPersonalizer();\n\t\tconst persData = await personalizer?.read();\n\t\treturn persData;\n\t}\n\n\t/**\n\t * Sets the personalization data.\n\t * @param {IPersonalizationData} persData - The personalization data to set.\n\t * @returns {Promise<void>} A promise that resolves when the personalization data is set.\n\t * @private\n\t */\n\tprotected async setPersonalization(persData: IPersonalizationData) {\n\t\tconst personalizer = await this._getPersonalizer();\n\t\tawait personalizer.write(persData);\n\t}\n\n\t/**\n\t * Returns array of personalized favorite apps\n\t *\n\t * @returns {Promise} resolves to return array of personalized favorite apps\n\t */\n\tprotected async _getAppPersonalization() {\n\t\tconst personalization = await this.getPersonalization();\n\t\treturn personalization?.favoriteApps || ([] as IAppPersonalization[]);\n\t}\n\n\t/**\n\t * Sets the personalization data.\n\t * @param {IAppPersonalization[]} appsPersonalization - Personalization data for favorite apps.\n\t * @returns {Promise<void>} A promise that resolves when the personalization data is set.\n\t * @private\n\t */\n\tprotected async setFavAppsPersonalization(appsPersonalization: IAppPersonalization[]): Promise<void> {\n\t\tlet personalization = await this.getPersonalization();\n\t\tif (personalization) {\n\t\t\tpersonalization.favoriteApps = appsPersonalization;\n\t\t\tawait this.setPersonalization(personalization);\n\t\t}\n\t}\n\n\t/**\n\t * Applies personalization settings to the tiles.\n\t * Retrieves tiles from the generated apps wrapper and applies personalization settings to each tile.\n\t * Personalization settings include background color and icon customization.\n\t * @private\n\t * @async\n\t */\n\tpublic async applyPersonalization() {\n\t\tlet tiles: GenericTile[] = [];\n\t\ttiles = this.fetchTileVisualization(tiles);\n\t\treturn await this._applyTilesPersonalization(tiles);\n\t}\n\n\t/**\n\t * Applies personalization settings to the provided tiles.\n\t * @param {Array} tiles - An array of tiles to apply personalization settings to.\n\t * @param {string} [groupId] - Optional group ID for filtering personalization settings.\n\t * @param {boolean} [shouldReload=true] - A flag indicating whether to reload page visualizations.\n\t * @returns {Promise<void>} A promise that resolves when personalization settings are applied to the tiles.\n\t * @private\n\t */\n\tprotected async _applyTilesPersonalization(tiles: GenericTile[], groupId?: string, shouldReload = true) {\n\t\tconst [personalizations, favPages] = await Promise.all([this._getAppPersonalization(), this._getFavPages()]);\n\t\tconst favPageVisualizations = await this._getAllFavPageApps(favPages, shouldReload);\n\t\tconst groups = (this.getAggregation(\"groups\") || []) as Group[];\n\t\tconst apps = groupId ? this._getGroup(groupId)?.getApps() || [] : this.getApps() || [];\n\t\tfor (const tile of tiles) {\n\t\t\tconst item = this._getItem(tile, groups, apps);\n\t\t\tconst { color, icon } = this._getItemPersonalization(item, personalizations, favPageVisualizations, groupId);\n\n\t\t\tif (color) {\n\t\t\t\titem?.setProperty(\"bgColor\", color, true);\n\t\t\t\ttile.setBackgroundColor(color);\n\t\t\t}\n\n\t\t\tif (icon) {\n\t\t\t\titem?.setProperty(\"icon\", icon, true);\n\t\t\t\ttile.setTileIcon(icon);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the corresponding App or Group object associated with the given tile.\n\t * @param {GenericTile} tile - The tile for which to retrieve the corresponding item.\n\t * @param {Group[]} groups - An array of Group objects.\n\t * @param {App[]} apps - An array of App objects.\n\t * @returns {App | Group | undefined} The corresponding App or Group object, or undefined if not found.\n\t * @private\n\t */\n\tprivate _getItem(tile: GenericTile, groups: Group[], apps: App[]): App | Group | undefined {\n\t\tconst tileGroupId = tile.data(\"groupId\") as string | undefined;\n\t\tif (tileGroupId) {\n\t\t\treturn groups.find((oGroup) => oGroup.getGroupId() === tileGroupId);\n\t\t} else {\n\t\t\treturn apps.find((oApp) => DataFormatUtils.getLeanURL(oApp.getUrl()) === tile.getUrl());\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the color and icon associated with the specified item based on personalizations.\n\t * @param {App | Group | undefined} item - The App or Group object for which to retrieve personalization data.\n\t * @param {IAppPersonalization[] | undefined} personalizations - An array of personalization objects.\n\t * @param {ICustomVisualization[]} favPageVisualizations - An array of favorite page visualizations.\n\t * @param {string | undefined} groupId - The ID of the group to which the item belongs.\n\t * @returns {IItemPersonalization} An object containing the color and icon associated with the item.\n\t * @private\n\t */\n\tprivate _getItemPersonalization(\n\t\titem: App | Group | undefined,\n\t\tpersonalizations: IAppPersonalization[] | undefined,\n\t\tfavPageVisualizations: ICustomVisualization[],\n\t\tgroupId?: string\n\t): IItemPersonalization {\n\t\tlet color: string = \"\";\n\t\tlet icon: string = \"\";\n\n\t\tif (!item) return { color, icon };\n\n\t\tif (item.isA(\"sap.cux.home.Group\")) {\n\t\t\tconst personalization = personalizations?.find(\n\t\t\t\t(personalization) => personalization.isSection && personalization.sectionId === (item as Group).getGroupId()\n\t\t\t);\n\t\t\tcolor = personalization?.BGColor as string;\n\t\t} else {\n\t\t\tconst app = item as App;\n\t\t\tconst appIds = [app.getUrl()];\n\t\t\tconst oldAppId = app.data(\"oldAppId\") as string | undefined;\n\t\t\tif (oldAppId) {\n\t\t\t\tappIds.push(oldAppId);\n\t\t\t}\n\t\t\tconst vizId = app.getVizId();\n\t\t\tconst personalization = groupId\n\t\t\t\t? personalizations?.find(\n\t\t\t\t\t\t(personalization) =>\n\t\t\t\t\t\t\t!personalization.isSection &&\n\t\t\t\t\t\t\tpersonalization.sectionId === groupId &&\n\t\t\t\t\t\t\tpersonalization.appId &&\n\t\t\t\t\t\t\tappIds.includes(personalization.appId)\n\t\t\t\t\t)\n\t\t\t\t: personalizations?.find(\n\t\t\t\t\t\t(oPersonalization) =>\n\t\t\t\t\t\t\toPersonalization.isRecentlyAddedApp && oPersonalization.appId && appIds.includes(oPersonalization.appId)\n\t\t\t\t\t);\n\t\t\tconst favPageVisualization = favPageVisualizations.find(\n\t\t\t\t(oVisualization) => oVisualization.vizId === vizId || (oVisualization.appId && appIds.includes(oVisualization.appId))\n\t\t\t);\n\t\t\tcolor = personalization?.BGColor || favPageVisualization?.BGColor || DEFAULT_BG_COLOR().key;\n\t\t\ticon = this?.isA(\"sap.cux.home.FavAppPanel\") ? this._getFavAppIcon(app, favPageVisualization?.icon) : this.getAppIcon();\n\t\t}\n\n\t\treturn { color, icon };\n\t}\n\n\t/**\n\t * Retrieves favorite pages.\n\t * @returns {Promise<Array>} A promise that resolves with an array of favorite pages.\n\t * @private\n\t */\n\tprivate async _getFavPages() {\n\t\tconst aFavPages = await this._pageManagerInstance.getFavoritePages();\n\t\treturn aFavPages.concat({\n\t\t\tpageId: MYHOME_PAGE_ID,\n\t\t\tBGColor: DEFAULT_BG_COLOR().key\n\t\t});\n\t}\n\n\t/**\n\t * Retrieves visualizations for all favorite pages based on the provided parameters.\n\t * @param {Array} pages - An array of favorite pages.\n\t * @param {boolean} shouldReload - A flag indicating whether to reload page visualizations.\n\t * @returns {Promise<Array>} A promise that resolves with an array of favorite page visualizations.\n\t * @private\n\t */\n\tprivate async _getAllFavPageApps(pages: IPage[], shouldReload?: boolean) {\n\t\ttry {\n\t\t\tif (pages) {\n\t\t\t\tthis._favPageVisualizations = this._favPageVisualizations || [];\n\t\t\t\t//Check to ensure that missing visualization data is loaded, if any\n\t\t\t\tconst loadedPages = this._favPageVisualizations.reduce((pageIDs: string[], visualization) => {\n\t\t\t\t\tif (visualization.pageId && !pageIDs.includes(visualization.pageId)) {\n\t\t\t\t\t\tpageIDs.push(visualization.pageId);\n\t\t\t\t\t}\n\t\t\t\t\treturn pageIDs;\n\t\t\t\t}, []);\n\t\t\t\tconst pageIds = pages.map((page) => page.pageId);\n\t\t\t\tconst shouldLoadMissingApps = loadedPages.length === 0 || !loadedPages.every((pageId) => pageIds.includes(pageId));\n\t\t\t\tif (!shouldReload && !shouldLoadMissingApps) {\n\t\t\t\t\treturn this._favPageVisualizations;\n\t\t\t\t} else {\n\t\t\t\t\tthis._favPageVisualizations = await this._loadAllPageVisualizations(pages);\n\t\t\t\t\treturn this._favPageVisualizations;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn [];\n\t\t} catch (error) {\n\t\t\tLog.error(error as string);\n\t\t\treturn [];\n\t\t}\n\t}\n\n\t/**\n\t * Loads visualizations for all specified pages.\n\t * @param {Array} pages - An array of pages.\n\t * @param {boolean} [shouldFetchDistinctApps=false] - A flag indicating whether to fetch distinct pages.\n\t * @returns {Promise<Array>} A promise that resolves with an array of page visualizations.\n\t * @private\n\t */\n\tprivate async _loadAllPageVisualizations(pages: IPage[], shouldFetchDistinctApps = false) {\n\t\tconst getBgColor = (pageId: string | undefined) => {\n\t\t\treturn pages.find((page) => page.pageId === pageId)?.BGColor ?? DEFAULT_BG_COLOR().key;\n\t\t};\n\n\t\ttry {\n\t\t\tconst favPageVisualizations: ICustomVisualization[] = [];\n\t\t\tconst spaceContentService = await Container.getServiceAsync<SpaceContent>(\"SpaceContent\");\n\t\t\tconst pageData = await spaceContentService.getPages(pages.map((oPage) => oPage.pageId) as string[]);\n\t\t\tconst aPages = Object.values(pageData);\n\n\t\t\tfor (const page of aPages) {\n\t\t\t\tconst sections = page.sections || [];\n\t\t\t\tfor (const section of sections) {\n\t\t\t\t\tconst visualizations = section.visualizations || [];\n\t\t\t\t\tfor (const visualization of visualizations) {\n\t\t\t\t\t\tconst app = {\n\t\t\t\t\t\t\tappId: visualization.targetURL,\n\t\t\t\t\t\t\tvizId: visualization.vizId,\n\t\t\t\t\t\t\ticon: visualization.icon,\n\t\t\t\t\t\t\tBGColor: getBgColor(page.id) as string,\n\t\t\t\t\t\t\tpageId: page.id\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (!shouldFetchDistinctApps || !favPageVisualizations.some((oVizApp) => oVizApp.appId === app.appId)) {\n\t\t\t\t\t\t\tfavPageVisualizations.push(app);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn favPageVisualizations;\n\t\t} catch (error) {\n\t\t\tLog.error(error as string);\n\t\t\treturn [];\n\t\t}\n\t}\n\n\t/**\n\t * Returns default app icon.\n\t * @returns {string} The icon URL for the app.\n\t * @private\n\t */\n\tprotected getAppIcon(): string {\n\t\treturn DEFAULT_APP_ICON;\n\t}\n\n\t/**\n\t * Retrieves the icon for the specified app, prioritizing the favorite page icon if available.\n\t * @param {sap.cux.home.App} app - The app object.\n\t * @param {string} favPageIcon - The icon for the app from the favorite page.\n\t * @returns {string} The icon URL for the app.\n\t * @private\n\t */\n\tprivate _getFavAppIcon(app?: App, favPageIcon?: string): string {\n\t\treturn favPageIcon || app?.getIcon() || FALLBACK_ICON;\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AAHA;;AAAAA,GAAA,CAAAC,EAAA,CAAAC,MAAA,oOAAAC,GAAA,EAAAC,QAAA,EAAAC,SAAA,EAAAC,cAAA,EAAAC,kBAAA,EAAAC,iBAAA,EAAAC,aAAA,EAAAC,sBAAA,EAAAC,oBAAA;EAAA;;EAAA,SAAAC,uBAAAC,GAAA;IAAA,OAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,CAAAE,OAAA,mBAAAF,GAAA,CAAAE,OAAA,GAAAF,GAAA;EAAA;EAkjBO,SAAAG,OAAgBC,IAAI,EAAEC,OAAO,EAAE;IACrC,IAAI;MACH,IAAIC,MAAM,GAAGF,IAAI,CAAC,CAAC;IACpB,CAAC,CAAC,OAAMG,CAAC,EAAE;MACV,OAAOF,OAAO,CAACE,CAAC,CAAC;IAClB;IACA,IAAID,MAAM,IAAIA,MAAM,CAACE,IAAI,EAAE;MAC1B,OAAOF,MAAM,CAACE,IAAI,CAAC,KAAK,CAAC,EAAEH,OAAO,CAAC;IACpC;IACA,OAAOC,MAAM;EACd;EAAC,MA/iBMG,YAAY,GAAAV,sBAAA,CAAAN,cAAA;EAAA,MAKViB,gBAAgB,GAAAhB,kBAAA;EAAA,MAAEiB,gBAAgB,GAAAjB,kBAAA;EAAA,MAAEkB,a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AAE,CAAW;sBACtCuG,MAAM,EAAEa,IAAI,CAACpH;oBACd,CAAC;oBACD,IAAI,CAAC4H,uBAAuB,IAAI,CAAClE,qBAAqB,CAACgF,IAAI,CAAEC,OAAO,IAAKA,OAAO,CAACjD,KAAK,KAAKN,GAAG,CAACM,KAAK,CAAC,EAAE;sBACtGhC,qBAAqB,CAAC6B,IAAI,CAACH,GAAG,CAAC;oBAChC;kBACD;gBACD;cACD;cACA,OAAO1B,qBAAqB;YAAC;UAAA;QAC9B,CAAC,YAAQiE,KAAK,EAAE;UACfnK,GAAG,CAACmK,KAAK,CAACA,KAAe,CAAC;UAC1B,OAAO,EAAE;QACV,CAAC;MACF,CAAC,QAAAlJ,CAAA;QAAA,OAAA0C,OAAA,CAAAE,MAAA,CAAA5C,CAAA;MAAA;IAAA;IAED;AACD;AACA;AACA;AACA;IACWyH,UAAU,WAAA0C,YAAA,EAAW;MAC9B,OAAOhK,gBAAgB;IACxB,CAAC;IAED;AACD;AACA;AACA;AACA;AACA;AACA;IACSqH,cAAc,WAAAA,eAACb,GAAS,EAAEyD,WAAoB,EAAU;MAC/D,OAAOA,WAAW,IAAIzD,GAAG,EAAE0D,OAAO,CAAC,CAAC,IAAIhK,aAAa;IACtD;EAAC;EAAA,OApU4BM,gBAAgB;AAAA","ignoreList":[]}
|
|
@@ -58,7 +58,7 @@ declare module "sap/cux/home/BaseAppPersPanel" {
|
|
|
58
58
|
protected _getAppPersonalization(): Promise<IAppPersonalization[]>;
|
|
59
59
|
/**
|
|
60
60
|
* Sets the personalization data.
|
|
61
|
-
* @param {
|
|
61
|
+
* @param {IAppPersonalization[]} appsPersonalization - Personalization data for favorite apps.
|
|
62
62
|
* @returns {Promise<void>} A promise that resolves when the personalization data is set.
|
|
63
63
|
* @private
|
|
64
64
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseAppPersPanel.d.ts","sourceRoot":"../../../../..","sources":["src/sap/cux/home/BaseAppPersPanel.ts"],"names":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}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
3
|
* * (c) Copyright 2009-2024 SAP SE. All rights reserved
|
|
4
4
|
*/
|
|
5
|
-
"use strict";sap.ui.define(["sap/base/Log","sap/ui/core/EventBus","sap/ushell/Container","./BaseAppPanel","./utils/Constants","./utils/DataFormatUtils","./utils/PageManager","./utils/PersonalisationUtils","./utils/UshellPersonalizer"],function(e,t,n,o,r,s,
|
|
5
|
+
"use strict";sap.ui.define(["sap/base/Log","sap/ui/core/EventBus","sap/ushell/Container","./BaseAppPanel","./utils/Constants","./utils/DataFormatUtils","./utils/PageManager","./utils/PersonalisationUtils","./utils/UshellPersonalizer"],function(e,t,n,o,r,i,s,a,c){"use strict";function u(e){return e&&e.__esModule&&typeof e.default!=="undefined"?e.default:e}function l(e,t){try{var n=e()}catch(e){return t(e)}if(n&&n.then){return n.then(void 0,t)}return n}const p=u(o);const f=r["DEFAULT_APP_ICON"];const g=r["DEFAULT_BG_COLOR"];const d=r["FALLBACK_ICON"];const P=r["MYHOME_PAGE_ID"];const h=u(i);const I=u(s);const v=u(a);const m=u(c);const _=p.extend("sap.cux.home.BaseAppPersPanel",{metadata:{library:"sap.cux.home",properties:{persContainerId:{type:"string",group:"Misc",defaultValue:"",visibility:"hidden"}}},constructor:function e(t,n){p.prototype.constructor.call(this,t,n);this._favPageVisualizations=[]},init:function e(){p.prototype.init.call(this);this.setProperty("persContainerId",v.getPersContainerId(this));this._pageManagerInstance=I.getInstance(v.getPersContainerId(this),v.getOwnerComponent(this));this._eventBus=t.getInstance();this._eventBus.subscribe("pageChannel","pageUpdated",()=>{void this.applyPersonalization()},this)},_getPersonalizer:function e(){try{const e=this;const t=e.getProperty("persContainerId");if(!t){throw new Error("No Container ID Provided for personalisation!")}return Promise.resolve(m?.getInstance(t,v.getOwnerComponent(e)))}catch(e){return Promise.reject(e)}},getPersonalization:function e(){try{const e=this;return Promise.resolve(e._getPersonalizer()).then(function(e){return Promise.resolve(e?.read())})}catch(e){return Promise.reject(e)}},setPersonalization:function e(t){try{const e=this;return Promise.resolve(e._getPersonalizer()).then(function(e){return Promise.resolve(e.write(t)).then(function(){})})}catch(e){return Promise.reject(e)}},_getAppPersonalization:function e(){try{const e=this;return Promise.resolve(e.getPersonalization()).then(function(e){return e?.favoriteApps||[]})}catch(e){return Promise.reject(e)}},setFavAppsPersonalization:function e(t){try{const e=this;return Promise.resolve(e.getPersonalization()).then(function(n){const o=function(){if(n){n.favoriteApps=t;return Promise.resolve(e.setPersonalization(n)).then(function(){})}}();if(o&&o.then)return o.then(function(){})})}catch(e){return Promise.reject(e)}},applyPersonalization:function e(){try{const e=this;let t=[];t=e.fetchTileVisualization(t);return Promise.resolve(e._applyTilesPersonalization(t))}catch(e){return Promise.reject(e)}},_applyTilesPersonalization:function e(t,n){let o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;try{const e=this;return Promise.resolve(Promise.all([e._getAppPersonalization(),e._getFavPages()])).then(function(r){let[i,s]=r;return Promise.resolve(e._getAllFavPageApps(s,o)).then(function(o){const r=e.getAggregation("groups")||[];const s=n?e._getGroup(n)?.getApps()||[]:e.getApps()||[];for(const a of t){const t=e._getItem(a,r,s);const{color:c,icon:u}=e._getItemPersonalization(t,i,o,n);if(c){t?.setProperty("bgColor",c,true);a.setBackgroundColor(c)}if(u){t?.setProperty("icon",u,true);a.setTileIcon(u)}}})})}catch(e){return Promise.reject(e)}},_getItem:function e(t,n,o){const r=t.data("groupId");if(r){return n.find(e=>e.getGroupId()===r)}else{return o.find(e=>h.getLeanURL(e.getUrl())===t.getUrl())}},_getItemPersonalization:function e(t,n,o,r){let i="";let s="";if(!t)return{color:i,icon:s};if(t.isA("sap.cux.home.Group")){const e=n?.find(e=>e.isSection&&e.sectionId===t.getGroupId());i=e?.BGColor}else{const e=t;const a=[e.getUrl()];const c=e.data("oldAppId");if(c){a.push(c)}const u=e.getVizId();const l=r?n?.find(e=>!e.isSection&&e.sectionId===r&&e.appId&&a.includes(e.appId)):n?.find(e=>e.isRecentlyAddedApp&&e.appId&&a.includes(e.appId));const p=o.find(e=>e.vizId===u||e.appId&&a.includes(e.appId));i=l?.BGColor||p?.BGColor||g().key;s=this?.isA("sap.cux.home.FavAppPanel")?this._getFavAppIcon(e,p?.icon):this.getAppIcon()}return{color:i,icon:s}},_getFavPages:function e(){try{const e=this;return Promise.resolve(e._pageManagerInstance.getFavoritePages()).then(function(e){return e.concat({pageId:P,BGColor:g().key})})}catch(e){return Promise.reject(e)}},_getAllFavPageApps:function t(n,o){try{let t=false;const r=this;return Promise.resolve(l(function(){function e(e){return t?e:[]}const i=function(){if(n){r._favPageVisualizations=r._favPageVisualizations||[];const e=r._favPageVisualizations.reduce((e,t)=>{if(t.pageId&&!e.includes(t.pageId)){e.push(t.pageId)}return e},[]);const i=n.map(e=>e.pageId);const s=e.length===0||!e.every(e=>i.includes(e));if(!o&&!s){const e=r._favPageVisualizations;t=true;return e}else{return Promise.resolve(r._loadAllPageVisualizations(n)).then(function(e){r._favPageVisualizations=e;const n=r._favPageVisualizations;t=true;return n})}}}();return i&&i.then?i.then(e):e(i)},function(t){e.error(t);return[]}))}catch(e){return Promise.reject(e)}},_loadAllPageVisualizations:function t(o){let r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;try{const t=e=>o.find(t=>t.pageId===e)?.BGColor??g().key;return Promise.resolve(l(function(){const e=[];return Promise.resolve(n.getServiceAsync("SpaceContent")).then(function(n){return Promise.resolve(n.getPages(o.map(e=>e.pageId))).then(function(n){const o=Object.values(n);for(const n of o){const o=n.sections||[];for(const i of o){const o=i.visualizations||[];for(const i of o){const o={appId:i.targetURL,vizId:i.vizId,icon:i.icon,BGColor:t(n.id),pageId:n.id};if(!r||!e.some(e=>e.appId===o.appId)){e.push(o)}}}}return e})})},function(t){e.error(t);return[]}))}catch(e){return Promise.reject(e)}},getAppIcon:function e(){return f},_getFavAppIcon:function e(t,n){return n||t?.getIcon()||d}});return _});
|
|
6
6
|
//# sourceMappingURL=BaseAppPersPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseAppPersPanel.js","names":["sap","ui","define","Log","EventBus","Container","__BaseAppPanel","___utils_Constants","__DataFormatUtils","__PageManager","__PersonalisationUtils","__UshellPersonalizer","_interopRequireDefault","obj","__esModule","default","_catch","body","recover","result","e","then","BaseAppPanel","DEFAULT_APP_ICON","DEFAULT_BG_COLOR","FALLBACK_ICON","MYHOME_PAGE_ID","DataFormatUtils","PageManager","PersonalisationUtils","UshellPersonalizer","BaseAppPersPanel","extend","metadata","library","properties","persContainerId","type","group","defaultValue","visibility","constructor","_constructor","id","settings","BaseAppPanel.prototype.constructor.call","this","_favPageVisualizations","init","_init","BaseAppPanel.prototype.init.call","setProperty","getPersContainerId","_pageManagerInstance","getInstance","getOwnerComponent","_eventBus","subscribe","applyPersonalization","_getPersonalizer","_this","getProperty","Error","Promise","resolve","reject","getPersonalization","_getPersonalization","_this2","personalizer","read","setPersonalization","_setPersonalization","persData","_this3","write","_getAppPersonalization","_this4","personalization","favoriteApps","setFavAppsPersonalization","_setFavAppsPersonalization","appsPersonalization","_this5","_applyPersonalization","_this6","tiles","fetchTileVisualization","_applyTilesPersonalization","groupId","shouldReload","arguments","length","undefined","_this7","all","_getFavPages","_ref","personalizations","favPages","_getAllFavPageApps","favPageVisualizations","groups","getAggregation","apps","_getGroup","getApps","tile","item","_getItem","color","icon","_getItemPersonalization","setBackgroundColor","setTileIcon","tileGroupId","data","find","oGroup","getGroupId","oApp","getLeanURL","getUrl","isA","isSection","sectionId","BGColor","app","appIds","oldAppId","push","vizId","getVizId","appId","includes","oPersonalization","isRecentlyAddedApp","favPageVisualization","oVisualization","key","_getFavAppIcon","getAppIcon","_this8","getFavoritePages","aFavPages","concat","pageId","pages","_exit","_this9","_temp2","_result","_temp","loadedPages","reduce","pageIDs","visualization","pageIds","map","page","shouldLoadMissingApps","every","_this9$_favPageVisual","_loadAllPageVisualizations","_this9$_loadAllPageVi","_this9$_favPageVisual2","error","shouldFetchDistinctApps","getBgColor","getServiceAsync","spaceContentService","getPages","oPage","pageData","aPages","Object","values","sections","section","visualizations","targetURL","some","oVizApp","_getAppIcon","favPageIcon","getIcon"],"sources":["BaseAppPersPanel.ts"],"sourcesContent":["/*!\n * SAP UI development toolkit for HTML5 (SAPUI5)\n * * (c) Copyright 2009-2024 SAP SE. All rights reserved\n */\n\nimport Log from \"sap/base/Log\";\nimport GenericTile from \"sap/m/GenericTile\";\nimport Component from \"sap/ui/core/Component\";\nimport type { MetadataOptions } from \"sap/ui/core/Element\";\nimport EventBus from \"sap/ui/core/EventBus\";\nimport Container from \"sap/ushell/Container\";\nimport SpaceContent from \"sap/ushell/services/SpaceContent\";\nimport App from \"./App\";\nimport BaseAppPanel from \"./BaseAppPanel\";\nimport { $BaseAppPersPanelSettings } from \"./BaseAppPersPanel\";\nimport Group from \"./Group\";\nimport { IAppPersonalization, ICustomVisualization, IItemPersonalization } from \"./interface/AppsInterface\";\nimport { IPage } from \"./interface/PageSpaceInterface\";\nimport { DEFAULT_APP_ICON, DEFAULT_BG_COLOR, FALLBACK_ICON, MYHOME_PAGE_ID } from \"./utils/Constants\";\nimport DataFormatUtils from \"./utils/DataFormatUtils\";\nimport PageManager from \"./utils/PageManager\";\nimport PersonalisationUtils from \"./utils/PersonalisationUtils\";\nimport UshellPersonalizer, { IPersonalizationData } from \"./utils/UshellPersonalizer\";\n\n/**\n *\n * Provides the BaseAppPersPanel Class which is BaseAppPanel with personalisation.\n *\n * @extends sap.cux.home.BaseAppPanel\n *\n * @author SAP SE\n * @version 0.0.1\n * @since 1.121.0\n *\n * @abstract\n * @internal\n * @experimental Since 1.121\n * @private\n *\n * @alias sap.cux.home.BaseAppPersPanel\n */\nexport default abstract class BaseAppPersPanel extends BaseAppPanel {\n\tprivate _pageManagerInstance!: PageManager;\n\tprivate _favPageVisualizations: ICustomVisualization[] = [];\n\tprivate _eventBus!: EventBus;\n\n\tconstructor(idOrSettings?: string | $BaseAppPersPanelSettings);\n\tconstructor(id?: string, settings?: $BaseAppPersPanelSettings);\n\tconstructor(id?: string, settings?: $BaseAppPersPanelSettings) {\n\t\tsuper(id, settings);\n\t}\n\n\tstatic readonly metadata: MetadataOptions = {\n\t\tlibrary: \"sap.cux.home\",\n\t\tproperties: {\n\t\t\tpersContainerId: { type: \"string\", group: \"Misc\", defaultValue: \"\", visibility: \"hidden\" }\n\t\t}\n\t};\n\n\tpublic init() {\n\t\tsuper.init();\n\t\tthis.setProperty(\"persContainerId\", PersonalisationUtils.getPersContainerId(this));\n\t\tthis._pageManagerInstance = PageManager.getInstance(\n\t\t\tPersonalisationUtils.getPersContainerId(this),\n\t\t\tPersonalisationUtils.getOwnerComponent(this) as Component\n\t\t);\n\t\tthis._eventBus = EventBus.getInstance();\n\n\t\t//apply personalization on page update\n\t\tthis._eventBus.subscribe(\n\t\t\t\"pageChannel\",\n\t\t\t\"pageUpdated\",\n\t\t\t() => {\n\t\t\t\tvoid this.applyPersonalization();\n\t\t\t},\n\t\t\tthis\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves the personalizer instance.\n\t * @returns {Promise<sap.cux.home.UshellPersonalizer>} A promise resolving to the personalizer instance.\n\t * @throws {Error} Throws an error if no container ID is provided for personalization.\n\t * @private\n\t */\n\tprivate async _getPersonalizer() {\n\t\tconst persContainerId = this.getProperty(\"persContainerId\") as string;\n\t\tif (!persContainerId) {\n\t\t\tthrow new Error(\"No Container ID Provided for personalisation!\");\n\t\t}\n\t\tconst personalizer = await UshellPersonalizer?.getInstance(\n\t\t\tpersContainerId,\n\t\t\tPersonalisationUtils.getOwnerComponent(this) as Component\n\t\t);\n\t\treturn personalizer;\n\t}\n\n\t/**\n\t * Retrieves personalization data.\n\t * @returns {Promise<IPersonalizationData>} A promise that resolves with the personalization data.\n\t * @private\n\t */\n\tprotected async getPersonalization() {\n\t\tconst personalizer = await this._getPersonalizer();\n\t\tconst persData = await personalizer?.read();\n\t\treturn persData;\n\t}\n\n\t/**\n\t * Sets the personalization data.\n\t * @param {IPersonalizationData} persData - The personalization data to set.\n\t * @returns {Promise<void>} A promise that resolves when the personalization data is set.\n\t * @private\n\t */\n\tprotected async setPersonalization(persData: IPersonalizationData) {\n\t\tconst personalizer = await this._getPersonalizer();\n\t\tawait personalizer.write(persData);\n\t}\n\n\t/**\n\t * Returns array of personalized favorite apps\n\t *\n\t * @returns {Promise} resolves to return array of personalized favorite apps\n\t */\n\tprotected async _getAppPersonalization() {\n\t\tconst personalization = await this.getPersonalization();\n\t\treturn personalization?.favoriteApps || ([] as IAppPersonalization[]);\n\t}\n\n\t/**\n\t * Sets the personalization data.\n\t * @param {Array} appsPersonalization - Personalization data for favorite apps.\n\t * @returns {Promise<void>} A promise that resolves when the personalization data is set.\n\t * @private\n\t */\n\tprotected async setFavAppsPersonalization(appsPersonalization: IAppPersonalization[]) {\n\t\tlet personalization = await this.getPersonalization();\n\t\tpersonalization.favoriteApps = appsPersonalization;\n\t\tawait this.setPersonalization(personalization);\n\t}\n\n\t/**\n\t * Applies personalization settings to the tiles.\n\t * Retrieves tiles from the generated apps wrapper and applies personalization settings to each tile.\n\t * Personalization settings include background color and icon customization.\n\t * @private\n\t * @async\n\t */\n\tpublic async applyPersonalization() {\n\t\tlet tiles: GenericTile[] = [];\n\t\ttiles = this.fetchTileVisualization(tiles);\n\t\treturn await this._applyTilesPersonalization(tiles);\n\t}\n\n\t/**\n\t * Applies personalization settings to the provided tiles.\n\t * @param {Array} tiles - An array of tiles to apply personalization settings to.\n\t * @param {string} [groupId] - Optional group ID for filtering personalization settings.\n\t * @param {boolean} [shouldReload=true] - A flag indicating whether to reload page visualizations.\n\t * @returns {Promise<void>} A promise that resolves when personalization settings are applied to the tiles.\n\t * @private\n\t */\n\tprotected async _applyTilesPersonalization(tiles: GenericTile[], groupId?: string, shouldReload = true) {\n\t\tconst [personalizations, favPages] = await Promise.all([this._getAppPersonalization(), this._getFavPages()]);\n\t\tconst favPageVisualizations = await this._getAllFavPageApps(favPages, shouldReload);\n\t\tconst groups = (this.getAggregation(\"groups\") || []) as Group[];\n\t\tconst apps = groupId ? this._getGroup(groupId)?.getApps() || [] : this.getApps() || [];\n\t\tfor (const tile of tiles) {\n\t\t\tconst item = this._getItem(tile, groups, apps);\n\t\t\tconst { color, icon } = this._getItemPersonalization(item, personalizations, favPageVisualizations, groupId);\n\n\t\t\tif (color) {\n\t\t\t\titem?.setProperty(\"bgColor\", color, true);\n\t\t\t\ttile.setBackgroundColor(color);\n\t\t\t}\n\n\t\t\tif (icon) {\n\t\t\t\titem?.setProperty(\"icon\", icon, true);\n\t\t\t\ttile.setTileIcon(icon);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the corresponding App or Group object associated with the given tile.\n\t * @param {GenericTile} tile - The tile for which to retrieve the corresponding item.\n\t * @param {Group[]} groups - An array of Group objects.\n\t * @param {App[]} apps - An array of App objects.\n\t * @returns {App | Group | undefined} The corresponding App or Group object, or undefined if not found.\n\t * @private\n\t */\n\tprivate _getItem(tile: GenericTile, groups: Group[], apps: App[]): App | Group | undefined {\n\t\tconst tileGroupId = tile.data(\"groupId\") as string | undefined;\n\t\tif (tileGroupId) {\n\t\t\treturn groups.find((oGroup) => oGroup.getGroupId() === tileGroupId);\n\t\t} else {\n\t\t\treturn apps.find((oApp) => DataFormatUtils.getLeanURL(oApp.getUrl()) === tile.getUrl());\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the color and icon associated with the specified item based on personalizations.\n\t * @param {App | Group | undefined} item - The App or Group object for which to retrieve personalization data.\n\t * @param {IAppPersonalization[] | undefined} personalizations - An array of personalization objects.\n\t * @param {ICustomVisualization[]} favPageVisualizations - An array of favorite page visualizations.\n\t * @param {string | undefined} groupId - The ID of the group to which the item belongs.\n\t * @returns {IItemPersonalization} An object containing the color and icon associated with the item.\n\t * @private\n\t */\n\tprivate _getItemPersonalization(\n\t\titem: App | Group | undefined,\n\t\tpersonalizations: IAppPersonalization[] | undefined,\n\t\tfavPageVisualizations: ICustomVisualization[],\n\t\tgroupId?: string\n\t): IItemPersonalization {\n\t\tlet color: string = \"\";\n\t\tlet icon: string = \"\";\n\n\t\tif (!item) return { color, icon };\n\n\t\tif (item.isA(\"sap.cux.home.Group\")) {\n\t\t\tconst personalization = personalizations?.find(\n\t\t\t\t(personalization) => personalization.isSection && personalization.sectionId === (item as Group).getGroupId()\n\t\t\t);\n\t\t\tcolor = personalization?.BGColor as string;\n\t\t} else {\n\t\t\tconst app = item as App;\n\t\t\tconst appIds = [app.getUrl()];\n\t\t\tconst oldAppId = app.data(\"oldAppId\") as string | undefined;\n\t\t\tif (oldAppId) {\n\t\t\t\tappIds.push(oldAppId);\n\t\t\t}\n\t\t\tconst vizId = app.getVizId();\n\t\t\tconst personalization = groupId\n\t\t\t\t? personalizations?.find(\n\t\t\t\t\t\t(personalization) =>\n\t\t\t\t\t\t\t!personalization.isSection &&\n\t\t\t\t\t\t\tpersonalization.sectionId === groupId &&\n\t\t\t\t\t\t\tpersonalization.appId &&\n\t\t\t\t\t\t\tappIds.includes(personalization.appId)\n\t\t\t\t\t)\n\t\t\t\t: personalizations?.find(\n\t\t\t\t\t\t(oPersonalization) =>\n\t\t\t\t\t\t\toPersonalization.isRecentlyAddedApp && oPersonalization.appId && appIds.includes(oPersonalization.appId)\n\t\t\t\t\t);\n\t\t\tconst favPageVisualization = favPageVisualizations.find(\n\t\t\t\t(oVisualization) => oVisualization.vizId === vizId || (oVisualization.appId && appIds.includes(oVisualization.appId))\n\t\t\t);\n\t\t\tcolor = personalization?.BGColor || favPageVisualization?.BGColor || DEFAULT_BG_COLOR().key;\n\t\t\ticon = this?.isA(\"sap.cux.home.FavAppPanel\") ? this._getFavAppIcon(app, favPageVisualization?.icon) : this.getAppIcon();\n\t\t}\n\n\t\treturn { color, icon };\n\t}\n\n\t/**\n\t * Retrieves favorite pages.\n\t * @returns {Promise<Array>} A promise that resolves with an array of favorite pages.\n\t * @private\n\t */\n\tprivate async _getFavPages() {\n\t\tconst aFavPages = await this._pageManagerInstance.getFavoritePages();\n\t\treturn aFavPages.concat({\n\t\t\tpageId: MYHOME_PAGE_ID,\n\t\t\tBGColor: DEFAULT_BG_COLOR().key\n\t\t});\n\t}\n\n\t/**\n\t * Retrieves visualizations for all favorite pages based on the provided parameters.\n\t * @param {Array} pages - An array of favorite pages.\n\t * @param {boolean} shouldReload - A flag indicating whether to reload page visualizations.\n\t * @returns {Promise<Array>} A promise that resolves with an array of favorite page visualizations.\n\t * @private\n\t */\n\tprivate async _getAllFavPageApps(pages: IPage[], shouldReload?: boolean) {\n\t\ttry {\n\t\t\tif (pages) {\n\t\t\t\tthis._favPageVisualizations = this._favPageVisualizations || [];\n\t\t\t\t//Check to ensure that missing visualization data is loaded, if any\n\t\t\t\tconst loadedPages = this._favPageVisualizations.reduce((pageIDs: string[], visualization) => {\n\t\t\t\t\tif (visualization.pageId && !pageIDs.includes(visualization.pageId)) {\n\t\t\t\t\t\tpageIDs.push(visualization.pageId);\n\t\t\t\t\t}\n\t\t\t\t\treturn pageIDs;\n\t\t\t\t}, []);\n\t\t\t\tconst pageIds = pages.map((page) => page.pageId);\n\t\t\t\tconst shouldLoadMissingApps = loadedPages.length === 0 || !loadedPages.every((pageId) => pageIds.includes(pageId));\n\t\t\t\tif (!shouldReload && !shouldLoadMissingApps) {\n\t\t\t\t\treturn this._favPageVisualizations;\n\t\t\t\t} else {\n\t\t\t\t\tthis._favPageVisualizations = await this._loadAllPageVisualizations(pages);\n\t\t\t\t\treturn this._favPageVisualizations;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn [];\n\t\t} catch (error) {\n\t\t\tLog.error(error as string);\n\t\t\treturn [];\n\t\t}\n\t}\n\n\t/**\n\t * Loads visualizations for all specified pages.\n\t * @param {Array} pages - An array of pages.\n\t * @param {boolean} [shouldFetchDistinctApps=false] - A flag indicating whether to fetch distinct pages.\n\t * @returns {Promise<Array>} A promise that resolves with an array of page visualizations.\n\t * @private\n\t */\n\tprivate async _loadAllPageVisualizations(pages: IPage[], shouldFetchDistinctApps = false) {\n\t\tconst getBgColor = (pageId: string | undefined) => {\n\t\t\treturn pages.find((page) => page.pageId === pageId)?.BGColor ?? DEFAULT_BG_COLOR().key;\n\t\t};\n\n\t\ttry {\n\t\t\tconst favPageVisualizations: ICustomVisualization[] = [];\n\t\t\tconst spaceContentService = await Container.getServiceAsync<SpaceContent>(\"SpaceContent\");\n\t\t\tconst pageData = await spaceContentService.getPages(pages.map((oPage) => oPage.pageId) as string[]);\n\t\t\tconst aPages = Object.values(pageData);\n\n\t\t\tfor (const page of aPages) {\n\t\t\t\tconst sections = page.sections || [];\n\t\t\t\tfor (const section of sections) {\n\t\t\t\t\tconst visualizations = section.visualizations || [];\n\t\t\t\t\tfor (const visualization of visualizations) {\n\t\t\t\t\t\tconst app = {\n\t\t\t\t\t\t\tappId: visualization.targetURL,\n\t\t\t\t\t\t\tvizId: visualization.vizId,\n\t\t\t\t\t\t\ticon: visualization.icon,\n\t\t\t\t\t\t\tBGColor: getBgColor(page.id) as string,\n\t\t\t\t\t\t\tpageId: page.id\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (!shouldFetchDistinctApps || !favPageVisualizations.some((oVizApp) => oVizApp.appId === app.appId)) {\n\t\t\t\t\t\t\tfavPageVisualizations.push(app);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn favPageVisualizations;\n\t\t} catch (error) {\n\t\t\tLog.error(error as string);\n\t\t\treturn [];\n\t\t}\n\t}\n\n\t/**\n\t * Returns default app icon.\n\t * @returns {string} The icon URL for the app.\n\t * @private\n\t */\n\tprotected getAppIcon(): string {\n\t\treturn DEFAULT_APP_ICON;\n\t}\n\n\t/**\n\t * Retrieves the icon for the specified app, prioritizing the favorite page icon if available.\n\t * @param {sap.cux.home.App} app - The app object.\n\t * @param {string} favPageIcon - The icon for the app from the favorite page.\n\t * @returns {string} The icon URL for the app.\n\t * @private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EAAKb,SAAWA,IAASpB,SAAWtG,IAAmBmH,IAClF,OAAA5E,QAAAC,QAAAhD,EAAA,WAGD,MAAMqF,EAAgD,GAAG,OAAAtC,QAAAC,QACvB3D,EAAUoK,gBAA8B,iBAAepJ,KAAA,SAAnFqJ,GAAmB,OAAA3G,QAAAC,QACF0G,EAAoBC,SAASxB,EAAMW,IAAKc,GAAUA,EAAM1B,UAAoB7H,KAAA,SAA7FwJ,GACN,MAAMC,EAASC,OAAOC,OAAOH,GAE7B,IAAK,MAAMd,KAAQe,EAAQ,CAC1B,MAAMG,EAAWlB,EAAKkB,UAAY,GAClC,IAAK,MAAMC,KAAWD,EAAU,CAC/B,MAAME,EAAiBD,EAAQC,gBAAkB,GACjD,IAAK,MAAMvB,KAAiBuB,EAAgB,CAC3C,MAAMpD,EAAM,CACXM,MAAOuB,EAAcwB,UACrBjD,MAAOyB,EAAczB,MACrBpB,KAAM6C,EAAc7C,KACpBe,QAAS0C,EAAWT,EAAKpH,IACzBuG,OAAQa,EAAKpH,IAEd,IAAK4H,IAA4BlE,EAAsBgF,KAAMC,GAAYA,EAAQjD,QAAUN,EAAIM,OAAQ,CACtGhC,EAAsB6B,KAAKH,EAC5B,CACD,CACD,CACD,CACA,OAAO1B,CAAsB,IAC9B,EAAC,SAAQiE,GACRnK,EAAImK,MAAMA,GACV,MAAO,EACR,GACD,CAAC,MAAAlJ,GAAA,OAAA2C,QAAAE,OAAA7C,EAAA,GAOSyH,WAAU,SAAA0C,IACnB,OAAOhK,CACR,EASQqH,eAAc,SAAAA,EAACb,EAAWyD,GACjC,OAAOA,GAAezD,GAAK0D,WAAahK,CACzC,IAAC,OAlU4BM,CAAgB"}
|
|
1
|
+
{"version":3,"file":"BaseAppPersPanel.js","names":["sap","ui","define","Log","EventBus","Container","__BaseAppPanel","___utils_Constants","__DataFormatUtils","__PageManager","__PersonalisationUtils","__UshellPersonalizer","_interopRequireDefault","obj","__esModule","default","_catch","body","recover","result","e","then","BaseAppPanel","DEFAULT_APP_ICON","DEFAULT_BG_COLOR","FALLBACK_ICON","MYHOME_PAGE_ID","DataFormatUtils","PageManager","PersonalisationUtils","UshellPersonalizer","BaseAppPersPanel","extend","metadata","library","properties","persContainerId","type","group","defaultValue","visibility","constructor","_constructor","id","settings","BaseAppPanel.prototype.constructor.call","this","_favPageVisualizations","init","_init","BaseAppPanel.prototype.init.call","setProperty","getPersContainerId","_pageManagerInstance","getInstance","getOwnerComponent","_eventBus","subscribe","applyPersonalization","_getPersonalizer","_this","getProperty","Error","Promise","resolve","reject","getPersonalization","_getPersonalization","_this2","personalizer","read","setPersonalization","_setPersonalization","persData","_this3","write","_getAppPersonalization","_this4","personalization","favoriteApps","setFavAppsPersonalization","_setFavAppsPersonalization","appsPersonalization","_this5","_temp","_applyPersonalization","_this6","tiles","fetchTileVisualization","_applyTilesPersonalization","groupId","shouldReload","arguments","length","undefined","_this7","all","_getFavPages","_ref","personalizations","favPages","_getAllFavPageApps","favPageVisualizations","groups","getAggregation","apps","_getGroup","getApps","tile","item","_getItem","color","icon","_getItemPersonalization","setBackgroundColor","setTileIcon","tileGroupId","data","find","oGroup","getGroupId","oApp","getLeanURL","getUrl","isA","isSection","sectionId","BGColor","app","appIds","oldAppId","push","vizId","getVizId","appId","includes","oPersonalization","isRecentlyAddedApp","favPageVisualization","oVisualization","key","_getFavAppIcon","getAppIcon","_this8","getFavoritePages","aFavPages","concat","pageId","pages","_exit","_this9","_temp3","_result","_temp2","loadedPages","reduce","pageIDs","visualization","pageIds","map","page","shouldLoadMissingApps","every","_this9$_favPageVisual","_loadAllPageVisualizations","_this9$_loadAllPageVi","_this9$_favPageVisual2","error","shouldFetchDistinctApps","getBgColor","getServiceAsync","spaceContentService","getPages","oPage","pageData","aPages","Object","values","sections","section","visualizations","targetURL","some","oVizApp","_getAppIcon","favPageIcon","getIcon"],"sources":["BaseAppPersPanel.ts"],"sourcesContent":["/*!\n * SAP UI development toolkit for HTML5 (SAPUI5)\n * * (c) Copyright 2009-2024 SAP SE. All rights reserved\n */\n\nimport Log from \"sap/base/Log\";\nimport GenericTile from \"sap/m/GenericTile\";\nimport Component from \"sap/ui/core/Component\";\nimport type { MetadataOptions } from \"sap/ui/core/Element\";\nimport EventBus from \"sap/ui/core/EventBus\";\nimport Container from \"sap/ushell/Container\";\nimport SpaceContent from \"sap/ushell/services/SpaceContent\";\nimport App from \"./App\";\nimport BaseAppPanel from \"./BaseAppPanel\";\nimport { $BaseAppPersPanelSettings } from \"./BaseAppPersPanel\";\nimport Group from \"./Group\";\nimport { IAppPersonalization, ICustomVisualization, IItemPersonalization } from \"./interface/AppsInterface\";\nimport { IPage } from \"./interface/PageSpaceInterface\";\nimport { DEFAULT_APP_ICON, DEFAULT_BG_COLOR, FALLBACK_ICON, MYHOME_PAGE_ID } from \"./utils/Constants\";\nimport DataFormatUtils from \"./utils/DataFormatUtils\";\nimport PageManager from \"./utils/PageManager\";\nimport PersonalisationUtils from \"./utils/PersonalisationUtils\";\nimport UshellPersonalizer, { IPersonalizationData } from \"./utils/UshellPersonalizer\";\n\n/**\n *\n * Provides the BaseAppPersPanel Class which is BaseAppPanel with personalisation.\n *\n * @extends sap.cux.home.BaseAppPanel\n *\n * @author SAP SE\n * @version 0.0.1\n * @since 1.121.0\n *\n * @abstract\n * @internal\n * @experimental Since 1.121\n * @private\n *\n * @alias sap.cux.home.BaseAppPersPanel\n */\nexport default abstract class BaseAppPersPanel extends BaseAppPanel {\n\tprivate _pageManagerInstance!: PageManager;\n\tprivate _favPageVisualizations: ICustomVisualization[] = [];\n\tprivate _eventBus!: EventBus;\n\n\tconstructor(idOrSettings?: string | $BaseAppPersPanelSettings);\n\tconstructor(id?: string, settings?: $BaseAppPersPanelSettings);\n\tconstructor(id?: string, settings?: $BaseAppPersPanelSettings) {\n\t\tsuper(id, settings);\n\t}\n\n\tstatic readonly metadata: MetadataOptions = {\n\t\tlibrary: \"sap.cux.home\",\n\t\tproperties: {\n\t\t\tpersContainerId: { type: \"string\", group: \"Misc\", defaultValue: \"\", visibility: \"hidden\" }\n\t\t}\n\t};\n\n\tpublic init() {\n\t\tsuper.init();\n\t\tthis.setProperty(\"persContainerId\", PersonalisationUtils.getPersContainerId(this));\n\t\tthis._pageManagerInstance = PageManager.getInstance(\n\t\t\tPersonalisationUtils.getPersContainerId(this),\n\t\t\tPersonalisationUtils.getOwnerComponent(this) as Component\n\t\t);\n\t\tthis._eventBus = EventBus.getInstance();\n\n\t\t//apply personalization on page update\n\t\tthis._eventBus.subscribe(\n\t\t\t\"pageChannel\",\n\t\t\t\"pageUpdated\",\n\t\t\t() => {\n\t\t\t\tvoid this.applyPersonalization();\n\t\t\t},\n\t\t\tthis\n\t\t);\n\t}\n\n\t/**\n\t * Retrieves the personalizer instance.\n\t * @returns {Promise<sap.cux.home.UshellPersonalizer>} A promise resolving to the personalizer instance.\n\t * @throws {Error} Throws an error if no container ID is provided for personalization.\n\t * @private\n\t */\n\tprivate async _getPersonalizer() {\n\t\tconst persContainerId = this.getProperty(\"persContainerId\") as string;\n\t\tif (!persContainerId) {\n\t\t\tthrow new Error(\"No Container ID Provided for personalisation!\");\n\t\t}\n\t\tconst personalizer = await UshellPersonalizer?.getInstance(\n\t\t\tpersContainerId,\n\t\t\tPersonalisationUtils.getOwnerComponent(this) as Component\n\t\t);\n\t\treturn personalizer;\n\t}\n\n\t/**\n\t * Retrieves personalization data.\n\t * @returns {Promise<IPersonalizationData>} A promise that resolves with the personalization data.\n\t * @private\n\t */\n\tprotected async getPersonalization() {\n\t\tconst personalizer = await this._getPersonalizer();\n\t\tconst persData = await personalizer?.read();\n\t\treturn persData;\n\t}\n\n\t/**\n\t * Sets the personalization data.\n\t * @param {IPersonalizationData} persData - The personalization data to set.\n\t * @returns {Promise<void>} A promise that resolves when the personalization data is set.\n\t * @private\n\t */\n\tprotected async setPersonalization(persData: IPersonalizationData) {\n\t\tconst personalizer = await this._getPersonalizer();\n\t\tawait personalizer.write(persData);\n\t}\n\n\t/**\n\t * Returns array of personalized favorite apps\n\t *\n\t * @returns {Promise} resolves to return array of personalized favorite apps\n\t */\n\tprotected async _getAppPersonalization() {\n\t\tconst personalization = await this.getPersonalization();\n\t\treturn personalization?.favoriteApps || ([] as IAppPersonalization[]);\n\t}\n\n\t/**\n\t * Sets the personalization data.\n\t * @param {IAppPersonalization[]} appsPersonalization - Personalization data for favorite apps.\n\t * @returns {Promise<void>} A promise that resolves when the personalization data is set.\n\t * @private\n\t */\n\tprotected async setFavAppsPersonalization(appsPersonalization: IAppPersonalization[]): Promise<void> {\n\t\tlet personalization = await this.getPersonalization();\n\t\tif (personalization) {\n\t\t\tpersonalization.favoriteApps = appsPersonalization;\n\t\t\tawait this.setPersonalization(personalization);\n\t\t}\n\t}\n\n\t/**\n\t * Applies personalization settings to the tiles.\n\t * Retrieves tiles from the generated apps wrapper and applies personalization settings to each tile.\n\t * Personalization settings include background color and icon customization.\n\t * @private\n\t * @async\n\t */\n\tpublic async applyPersonalization() {\n\t\tlet tiles: GenericTile[] = [];\n\t\ttiles = this.fetchTileVisualization(tiles);\n\t\treturn await this._applyTilesPersonalization(tiles);\n\t}\n\n\t/**\n\t * Applies personalization settings to the provided tiles.\n\t * @param {Array} tiles - An array of tiles to apply personalization settings to.\n\t * @param {string} [groupId] - Optional group ID for filtering personalization settings.\n\t * @param {boolean} [shouldReload=true] - A flag indicating whether to reload page visualizations.\n\t * @returns {Promise<void>} A promise that resolves when personalization settings are applied to the tiles.\n\t * @private\n\t */\n\tprotected async _applyTilesPersonalization(tiles: GenericTile[], groupId?: string, shouldReload = true) {\n\t\tconst [personalizations, favPages] = await Promise.all([this._getAppPersonalization(), this._getFavPages()]);\n\t\tconst favPageVisualizations = await this._getAllFavPageApps(favPages, shouldReload);\n\t\tconst groups = (this.getAggregation(\"groups\") || []) as Group[];\n\t\tconst apps = groupId ? this._getGroup(groupId)?.getApps() || [] : this.getApps() || [];\n\t\tfor (const tile of tiles) {\n\t\t\tconst item = this._getItem(tile, groups, apps);\n\t\t\tconst { color, icon } = this._getItemPersonalization(item, personalizations, favPageVisualizations, groupId);\n\n\t\t\tif (color) {\n\t\t\t\titem?.setProperty(\"bgColor\", color, true);\n\t\t\t\ttile.setBackgroundColor(color);\n\t\t\t}\n\n\t\t\tif (icon) {\n\t\t\t\titem?.setProperty(\"icon\", icon, true);\n\t\t\t\ttile.setTileIcon(icon);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the corresponding App or Group object associated with the given tile.\n\t * @param {GenericTile} tile - The tile for which to retrieve the corresponding item.\n\t * @param {Group[]} groups - An array of Group objects.\n\t * @param {App[]} apps - An array of App objects.\n\t * @returns {App | Group | undefined} The corresponding App or Group object, or undefined if not found.\n\t * @private\n\t */\n\tprivate _getItem(tile: GenericTile, groups: Group[], apps: App[]): App | Group | undefined {\n\t\tconst tileGroupId = tile.data(\"groupId\") as string | undefined;\n\t\tif (tileGroupId) {\n\t\t\treturn groups.find((oGroup) => oGroup.getGroupId() === tileGroupId);\n\t\t} else {\n\t\t\treturn apps.find((oApp) => DataFormatUtils.getLeanURL(oApp.getUrl()) === tile.getUrl());\n\t\t}\n\t}\n\n\t/**\n\t * Retrieves the color and icon associated with the specified item based on personalizations.\n\t * @param {App | Group | undefined} item - The App or Group object for which to retrieve personalization data.\n\t * @param {IAppPersonalization[] | undefined} personalizations - An array of personalization objects.\n\t * @param {ICustomVisualization[]} favPageVisualizations - An array of favorite page visualizations.\n\t * @param {string | undefined} groupId - The ID of the group to which the item belongs.\n\t * @returns {IItemPersonalization} An object containing the color and icon associated with the item.\n\t * @private\n\t */\n\tprivate _getItemPersonalization(\n\t\titem: App | Group | undefined,\n\t\tpersonalizations: IAppPersonalization[] | undefined,\n\t\tfavPageVisualizations: ICustomVisualization[],\n\t\tgroupId?: string\n\t): IItemPersonalization {\n\t\tlet color: string = \"\";\n\t\tlet icon: string = \"\";\n\n\t\tif (!item) return { color, icon };\n\n\t\tif (item.isA(\"sap.cux.home.Group\")) {\n\t\t\tconst personalization = personalizations?.find(\n\t\t\t\t(personalization) => personalization.isSection && personalization.sectionId === (item as Group).getGroupId()\n\t\t\t);\n\t\t\tcolor = personalization?.BGColor as string;\n\t\t} else {\n\t\t\tconst app = item as App;\n\t\t\tconst appIds = [app.getUrl()];\n\t\t\tconst oldAppId = app.data(\"oldAppId\") as string | undefined;\n\t\t\tif (oldAppId) {\n\t\t\t\tappIds.push(oldAppId);\n\t\t\t}\n\t\t\tconst vizId = app.getVizId();\n\t\t\tconst personalization = groupId\n\t\t\t\t? personalizations?.find(\n\t\t\t\t\t\t(personalization) =>\n\t\t\t\t\t\t\t!personalization.isSection &&\n\t\t\t\t\t\t\tpersonalization.sectionId === groupId &&\n\t\t\t\t\t\t\tpersonalization.appId &&\n\t\t\t\t\t\t\tappIds.includes(personalization.appId)\n\t\t\t\t\t)\n\t\t\t\t: personalizations?.find(\n\t\t\t\t\t\t(oPersonalization) =>\n\t\t\t\t\t\t\toPersonalization.isRecentlyAddedApp && oPersonalization.appId && appIds.includes(oPersonalization.appId)\n\t\t\t\t\t);\n\t\t\tconst favPageVisualization = favPageVisualizations.find(\n\t\t\t\t(oVisualization) => oVisualization.vizId === vizId || (oVisualization.appId && appIds.includes(oVisualization.appId))\n\t\t\t);\n\t\t\tcolor = personalization?.BGColor || favPageVisualization?.BGColor || DEFAULT_BG_COLOR().key;\n\t\t\ticon = this?.isA(\"sap.cux.home.FavAppPanel\") ? this._getFavAppIcon(app, favPageVisualization?.icon) : this.getAppIcon();\n\t\t}\n\n\t\treturn { color, icon };\n\t}\n\n\t/**\n\t * Retrieves favorite pages.\n\t * @returns {Promise<Array>} A promise that resolves with an array of favorite pages.\n\t * @private\n\t */\n\tprivate async _getFavPages() {\n\t\tconst aFavPages = await this._pageManagerInstance.getFavoritePages();\n\t\treturn aFavPages.concat({\n\t\t\tpageId: MYHOME_PAGE_ID,\n\t\t\tBGColor: DEFAULT_BG_COLOR().key\n\t\t});\n\t}\n\n\t/**\n\t * Retrieves visualizations for all favorite pages based on the provided parameters.\n\t * @param {Array} pages - An array of favorite pages.\n\t * @param {boolean} shouldReload - A flag indicating whether to reload page visualizations.\n\t * @returns {Promise<Array>} A promise that resolves with an array of favorite page visualizations.\n\t * @private\n\t */\n\tprivate async _getAllFavPageApps(pages: IPage[], shouldReload?: boolean) {\n\t\ttry {\n\t\t\tif (pages) {\n\t\t\t\tthis._favPageVisualizations = this._favPageVisualizations || [];\n\t\t\t\t//Check to ensure that missing visualization data is loaded, if any\n\t\t\t\tconst loadedPages = this._favPageVisualizations.reduce((pageIDs: string[], visualization) => {\n\t\t\t\t\tif (visualization.pageId && !pageIDs.includes(visualization.pageId)) {\n\t\t\t\t\t\tpageIDs.push(visualization.pageId);\n\t\t\t\t\t}\n\t\t\t\t\treturn pageIDs;\n\t\t\t\t}, []);\n\t\t\t\tconst pageIds = pages.map((page) => page.pageId);\n\t\t\t\tconst shouldLoadMissingApps = loadedPages.length === 0 || !loadedPages.every((pageId) => pageIds.includes(pageId));\n\t\t\t\tif (!shouldReload && !shouldLoadMissingApps) {\n\t\t\t\t\treturn this._favPageVisualizations;\n\t\t\t\t} else {\n\t\t\t\t\tthis._favPageVisualizations = await this._loadAllPageVisualizations(pages);\n\t\t\t\t\treturn this._favPageVisualizations;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn [];\n\t\t} catch (error) {\n\t\t\tLog.error(error as string);\n\t\t\treturn [];\n\t\t}\n\t}\n\n\t/**\n\t * Loads visualizations for all specified pages.\n\t * @param {Array} pages - An array of pages.\n\t * @param {boolean} [shouldFetchDistinctApps=false] - A flag indicating whether to fetch distinct pages.\n\t * @returns {Promise<Array>} A promise that resolves with an array of page visualizations.\n\t * @private\n\t */\n\tprivate async _loadAllPageVisualizations(pages: IPage[], shouldFetchDistinctApps = false) {\n\t\tconst getBgColor = (pageId: string | undefined) => {\n\t\t\treturn pages.find((page) => page.pageId === pageId)?.BGColor ?? DEFAULT_BG_COLOR().key;\n\t\t};\n\n\t\ttry {\n\t\t\tconst favPageVisualizations: ICustomVisualization[] = [];\n\t\t\tconst spaceContentService = await Container.getServiceAsync<SpaceContent>(\"SpaceContent\");\n\t\t\tconst pageData = await spaceContentService.getPages(pages.map((oPage) => oPage.pageId) as string[]);\n\t\t\tconst aPages = Object.values(pageData);\n\n\t\t\tfor (const page of aPages) {\n\t\t\t\tconst sections = page.sections || [];\n\t\t\t\tfor (const section of sections) {\n\t\t\t\t\tconst visualizations = section.visualizations || [];\n\t\t\t\t\tfor (const visualization of visualizations) {\n\t\t\t\t\t\tconst app = {\n\t\t\t\t\t\t\tappId: visualization.targetURL,\n\t\t\t\t\t\t\tvizId: visualization.vizId,\n\t\t\t\t\t\t\ticon: visualization.icon,\n\t\t\t\t\t\t\tBGColor: getBgColor(page.id) as string,\n\t\t\t\t\t\t\tpageId: page.id\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (!shouldFetchDistinctApps || !favPageVisualizations.some((oVizApp) => oVizApp.appId === app.appId)) {\n\t\t\t\t\t\t\tfavPageVisualizations.push(app);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn favPageVisualizations;\n\t\t} catch (error) {\n\t\t\tLog.error(error as string);\n\t\t\treturn [];\n\t\t}\n\t}\n\n\t/**\n\t * Returns default app icon.\n\t * @returns {string} The icon URL for the app.\n\t * @private\n\t */\n\tprotected getAppIcon(): string {\n\t\treturn DEFAULT_APP_ICON;\n\t}\n\n\t/**\n\t * Retrieves the icon for the specified app, prioritizing the favorite page icon if available.\n\t * @param {sap.cux.home.App} app - The app object.\n\t * @param {string} favPageIcon - The icon for the app from the favorite page.\n\t * @returns {string} The icon URL for the app.\n\t * @private\n\t */\n\tprivate _getFavAppIcon(app?: App, favPageIcon?: string): string {\n\t\treturn favPageIcon || app?.getIcon() || FALLBACK_ICON;\n\t}\n}\n"],"mappings":";;;;AAAA,aAAAA,IAAAC,GAAAC,OAAA,yNAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,E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AC,QACvB3D,EAAUqK,gBAA8B,iBAAerJ,KAAA,SAAnFsJ,GAAmB,OAAA5G,QAAAC,QACF2G,EAAoBC,SAASxB,EAAMW,IAAKc,GAAUA,EAAM1B,UAAoB9H,KAAA,SAA7FyJ,GACN,MAAMC,EAASC,OAAOC,OAAOH,GAE7B,IAAK,MAAMd,KAAQe,EAAQ,CAC1B,MAAMG,EAAWlB,EAAKkB,UAAY,GAClC,IAAK,MAAMC,KAAWD,EAAU,CAC/B,MAAME,EAAiBD,EAAQC,gBAAkB,GACjD,IAAK,MAAMvB,KAAiBuB,EAAgB,CAC3C,MAAMpD,EAAM,CACXM,MAAOuB,EAAcwB,UACrBjD,MAAOyB,EAAczB,MACrBpB,KAAM6C,EAAc7C,KACpBe,QAAS0C,EAAWT,EAAKrH,IACzBwG,OAAQa,EAAKrH,IAEd,IAAK6H,IAA4BlE,EAAsBgF,KAAMC,GAAYA,EAAQjD,QAAUN,EAAIM,OAAQ,CACtGhC,EAAsB6B,KAAKH,EAC5B,CACD,CACD,CACD,CACA,OAAO1B,CAAsB,IAC9B,EAAC,SAAQiE,GACRpK,EAAIoK,MAAMA,GACV,MAAO,EACR,GACD,CAAC,MAAAnJ,GAAA,OAAA2C,QAAAE,OAAA7C,EAAA,GAOS0H,WAAU,SAAA0C,IACnB,OAAOjK,CACR,EASQsH,eAAc,SAAAA,EAACb,EAAWyD,GACjC,OAAOA,GAAezD,GAAK0D,WAAajK,CACzC,IAAC,OApU4BM,CAAgB"}
|
|
@@ -129,14 +129,16 @@ export default abstract class BaseAppPersPanel extends BaseAppPanel {
|
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
131
|
* Sets the personalization data.
|
|
132
|
-
* @param {
|
|
132
|
+
* @param {IAppPersonalization[]} appsPersonalization - Personalization data for favorite apps.
|
|
133
133
|
* @returns {Promise<void>} A promise that resolves when the personalization data is set.
|
|
134
134
|
* @private
|
|
135
135
|
*/
|
|
136
|
-
protected async setFavAppsPersonalization(appsPersonalization: IAppPersonalization[]) {
|
|
136
|
+
protected async setFavAppsPersonalization(appsPersonalization: IAppPersonalization[]): Promise<void> {
|
|
137
137
|
let personalization = await this.getPersonalization();
|
|
138
|
-
personalization
|
|
139
|
-
|
|
138
|
+
if (personalization) {
|
|
139
|
+
personalization.favoriteApps = appsPersonalization;
|
|
140
|
+
await this.setPersonalization(personalization);
|
|
141
|
+
}
|
|
140
142
|
}
|
|
141
143
|
|
|
142
144
|
/**
|
|
@@ -24,13 +24,20 @@ sap.ui.define(["sap/m/PageRenderer"], function (PageRenderer) {
|
|
|
24
24
|
* we render a simple div container and manage the transition from
|
|
25
25
|
* one page to another using CSS.
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
const containerId = `${control.getId()}-layout-container`;
|
|
28
|
+
const isContainerRenderedOnce = document.getElementById(containerId);
|
|
29
|
+
if (!isContainerRenderedOnce) {
|
|
30
|
+
rm.openStart("div", containerId).openEnd();
|
|
31
|
+
}
|
|
32
|
+
|
|
28
33
|
//render main container
|
|
29
34
|
PageRenderer.render(rm, control);
|
|
30
35
|
|
|
31
36
|
//render full-screen container
|
|
32
37
|
rm.renderControl(control.getAggregation("fullScreenContainer"));
|
|
33
|
-
|
|
38
|
+
if (!isContainerRenderedOnce) {
|
|
39
|
+
rm.close("div");
|
|
40
|
+
}
|
|
34
41
|
}
|
|
35
42
|
};
|
|
36
43
|
return __exports;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseLayoutRenderer-dbg.js","names":["sap","ui","define","PageRenderer","__exports","apiVersion","render","rm","control","
|
|
1
|
+
{"version":3,"file":"BaseLayoutRenderer-dbg.js","names":["sap","ui","define","PageRenderer","__exports","apiVersion","render","rm","control","containerId","getId","isContainerRenderedOnce","document","getElementById","openStart","openEnd","renderControl","getAggregation","close"],"sources":["BaseLayoutRenderer.ts"],"sourcesContent":["/*!\n * SAP UI development toolkit for HTML5 (SAPUI5)\n * * (c) Copyright 2009-2024 SAP SE. All rights reserved\n */\n\nimport Page from \"sap/m/Page\";\nimport PageRenderer from \"sap/m/PageRenderer\";\nimport RenderManager from \"sap/ui/core/RenderManager\";\nimport BaseLayout from \"./BaseLayout\";\n\nexport default {\n\tapiVersion: 2,\n\n\t/**\n\t * Renders the control.\n\t *\n\t * @public\n\t * @override\n\t * @param {RenderManager} rm - The RenderManager object.\n\t * @param {BaseLayout} control - The BaseLayout control to be rendered.\n\t */\n\trender: function (rm: RenderManager, control: BaseLayout) {\n\t\t/*\n\t\t * Existing controls like NavContainer will not allow for control\n\t\t * over the duration of the transition. To overcome this limitation,\n\t\t * we render a simple div container and manage the transition from\n\t\t * one page to another using CSS.\n\t\t */\n\t\tconst containerId = `${control.getId()}-layout-container`;\n\t\tconst isContainerRenderedOnce = document.getElementById(containerId);\n\n\t\tif (!isContainerRenderedOnce) {\n\t\t\trm.openStart(\"div\", containerId).openEnd();\n\t\t}\n\n\t\t//render main container\n\t\tPageRenderer.render(rm, control);\n\n\t\t//render full-screen container\n\t\trm.renderControl(control.getAggregation(\"fullScreenContainer\") as Page);\n\n\t\tif (!isContainerRenderedOnce) {\n\t\t\trm.close(\"div\");\n\t\t}\n\t}\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AAHA;;AAAAA,GAAA,CAAAC,EAAA,CAAAC,MAAA,mCAAAC,YAAA;EAAA;;EAAA,IAAAC,SAAA,GAUe;IACdC,UAAU,EAAE,CAAC;IAEb;AACD;AACA;AACA;AACA;AACA;AACA;AACA;IACCC,MAAM,EAAE,SAAAA,CAAUC,EAAiB,EAAEC,OAAmB,EAAE;MACzD;AACF;AACA;AACA;AACA;AACA;MACE,MAAMC,WAAW,GAAG,GAAGD,OAAO,CAACE,KAAK,CAAC,CAAC,mBAAmB;MACzD,MAAMC,uBAAuB,GAAGC,QAAQ,CAACC,cAAc,CAACJ,WAAW,CAAC;MAEpE,IAAI,CAACE,uBAAuB,EAAE;QAC7BJ,EAAE,CAACO,SAAS,CAAC,KAAK,EAAEL,WAAW,CAAC,CAACM,OAAO,CAAC,CAAC;MAC3C;;MAEA;MACAZ,YAAY,CAACG,MAAM,CAACC,EAAE,EAAEC,OAAO,CAAC;;MAEhC;MACAD,EAAE,CAACS,aAAa,CAACR,OAAO,CAACS,cAAc,CAAC,qBAAqB,CAAS,CAAC;MAEvE,IAAI,CAACN,uBAAuB,EAAE;QAC7BJ,EAAE,CAACW,KAAK,CAAC,KAAK,CAAC;MAChB;IACD;EACD,CAAC;EAAA,OAAAd,SAAA;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseLayoutRenderer.d.ts","sourceRoot":"../../../../..","sources":["src/sap/cux/home/BaseLayoutRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,iCAAiC,CAAC;IAQjD,OAAO,aAAa,MAAM,2BAA2B,CAAC;IACtD,OAAO,UAAU,MAAM,yBAAyB,CAAC;;;QAKhD;;;;;;;WAOG;qBACmB,aAAa,WAAW,UAAU;;IAXzD,
|
|
1
|
+
{"version":3,"file":"BaseLayoutRenderer.d.ts","sourceRoot":"../../../../..","sources":["src/sap/cux/home/BaseLayoutRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,iCAAiC,CAAC;IAQjD,OAAO,aAAa,MAAM,2BAA2B,CAAC;IACtD,OAAO,UAAU,MAAM,yBAAyB,CAAC;;;QAKhD;;;;;;;WAOG;qBACmB,aAAa,WAAW,UAAU;;IAXzD,wBAmCE;CAED"}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
3
|
* * (c) Copyright 2009-2024 SAP SE. All rights reserved
|
|
4
4
|
*/
|
|
5
|
-
"use strict";sap.ui.define(["sap/m/PageRenderer"],function(e){"use strict";var n={apiVersion:2,render:function(n,
|
|
5
|
+
"use strict";sap.ui.define(["sap/m/PageRenderer"],function(e){"use strict";var n={apiVersion:2,render:function(n,t){const r=`${t.getId()}-layout-container`;const i=document.getElementById(r);if(!i){n.openStart("div",r).openEnd()}e.render(n,t);n.renderControl(t.getAggregation("fullScreenContainer"));if(!i){n.close("div")}}};return n});
|
|
6
6
|
//# sourceMappingURL=BaseLayoutRenderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseLayoutRenderer.js","names":["sap","ui","define","PageRenderer","__exports","apiVersion","render","rm","control","
|
|
1
|
+
{"version":3,"file":"BaseLayoutRenderer.js","names":["sap","ui","define","PageRenderer","__exports","apiVersion","render","rm","control","containerId","getId","isContainerRenderedOnce","document","getElementById","openStart","openEnd","renderControl","getAggregation","close"],"sources":["BaseLayoutRenderer.ts"],"sourcesContent":["/*!\n * SAP UI development toolkit for HTML5 (SAPUI5)\n * * (c) Copyright 2009-2024 SAP SE. All rights reserved\n */\n\nimport Page from \"sap/m/Page\";\nimport PageRenderer from \"sap/m/PageRenderer\";\nimport RenderManager from \"sap/ui/core/RenderManager\";\nimport BaseLayout from \"./BaseLayout\";\n\nexport default {\n\tapiVersion: 2,\n\n\t/**\n\t * Renders the control.\n\t *\n\t * @public\n\t * @override\n\t * @param {RenderManager} rm - The RenderManager object.\n\t * @param {BaseLayout} control - The BaseLayout control to be rendered.\n\t */\n\trender: function (rm: RenderManager, control: BaseLayout) {\n\t\t/*\n\t\t * Existing controls like NavContainer will not allow for control\n\t\t * over the duration of the transition. To overcome this limitation,\n\t\t * we render a simple div container and manage the transition from\n\t\t * one page to another using CSS.\n\t\t */\n\t\tconst containerId = `${control.getId()}-layout-container`;\n\t\tconst isContainerRenderedOnce = document.getElementById(containerId);\n\n\t\tif (!isContainerRenderedOnce) {\n\t\t\trm.openStart(\"div\", containerId).openEnd();\n\t\t}\n\n\t\t//render main container\n\t\tPageRenderer.render(rm, control);\n\n\t\t//render full-screen container\n\t\trm.renderControl(control.getAggregation(\"fullScreenContainer\") as Page);\n\n\t\tif (!isContainerRenderedOnce) {\n\t\t\trm.close(\"div\");\n\t\t}\n\t}\n};\n"],"mappings":";;;;AAAA,aAAAA,IAAAC,GAAAC,OAAA,gCAAAC,GAAA,iBAAAC,EAUe,CACdC,WAAY,EAUZC,OAAQ,SAAUC,EAAmBC,GAOpC,MAAMC,EAAc,GAAGD,EAAQE,2BAC/B,MAAMC,EAA0BC,SAASC,eAAeJ,GAExD,IAAKE,EAAyB,CAC7BJ,EAAGO,UAAU,MAAOL,GAAaM,SAClC,CAGAZ,EAAaG,OAAOC,EAAIC,GAGxBD,EAAGS,cAAcR,EAAQS,eAAe,wBAExC,IAAKN,EAAyB,CAC7BJ,EAAGW,MAAM,MACV,CACD,GACA,OAAAd,CAAA"}
|
|
@@ -26,12 +26,21 @@ export default {
|
|
|
26
26
|
* we render a simple div container and manage the transition from
|
|
27
27
|
* one page to another using CSS.
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
const containerId = `${control.getId()}-layout-container`;
|
|
30
|
+
const isContainerRenderedOnce = document.getElementById(containerId);
|
|
31
|
+
|
|
32
|
+
if (!isContainerRenderedOnce) {
|
|
33
|
+
rm.openStart("div", containerId).openEnd();
|
|
34
|
+
}
|
|
35
|
+
|
|
30
36
|
//render main container
|
|
31
37
|
PageRenderer.render(rm, control);
|
|
32
38
|
|
|
33
39
|
//render full-screen container
|
|
34
40
|
rm.renderControl(control.getAggregation("fullScreenContainer") as Page);
|
|
35
|
-
|
|
41
|
+
|
|
42
|
+
if (!isContainerRenderedOnce) {
|
|
43
|
+
rm.close("div");
|
|
44
|
+
}
|
|
36
45
|
}
|
|
37
46
|
};
|
|
@@ -490,25 +490,25 @@ sap.ui.define(["sap/base/Log", "sap/f/GridContainer", "sap/f/GridContainerSettin
|
|
|
490
490
|
* @returns {sap.cux.home.MenuItem[]} - An array of menu items representing available actions for the group.
|
|
491
491
|
*/
|
|
492
492
|
_getGroupActions: function _getGroupActions(group) {
|
|
493
|
-
const renameGroupMenuItem = new MenuItem(
|
|
493
|
+
const renameGroupMenuItem = new MenuItem(`id-${group.id}-renameGroup`, {
|
|
494
494
|
title: this._i18nBundle.getText("renameGroup"),
|
|
495
495
|
press: this._onRenameGroup.bind(this)
|
|
496
496
|
});
|
|
497
497
|
addFESRId(renameGroupMenuItem, "renameGroup");
|
|
498
|
-
const selectColorMenuItem = new MenuItem(
|
|
498
|
+
const selectColorMenuItem = new MenuItem(`id-${group.id}-selectColor`, {
|
|
499
499
|
title: this._i18nBundle.getText("selectColor"),
|
|
500
500
|
type: ListType.Navigation,
|
|
501
501
|
press: this._openColorPopover.bind(this)
|
|
502
502
|
});
|
|
503
503
|
addFESRId(selectColorMenuItem, "changeColor");
|
|
504
|
-
const removeAllAppsMenuItem = new MenuItem(
|
|
504
|
+
const removeAllAppsMenuItem = new MenuItem(`id-${group.id}-removeAllApps`, {
|
|
505
505
|
title: this._i18nBundle.getText("removeAllApps"),
|
|
506
506
|
press: this._handleUngroupApps.bind(this, group)
|
|
507
507
|
});
|
|
508
508
|
addFESRId(removeAllAppsMenuItem, "removeAllApps");
|
|
509
509
|
const groupActions = [renameGroupMenuItem, selectColorMenuItem, removeAllAppsMenuItem];
|
|
510
510
|
if (!group.isPresetSection) {
|
|
511
|
-
const deleteGroupMenuItem = new MenuItem(
|
|
511
|
+
const deleteGroupMenuItem = new MenuItem(`id-${group.id}-delete`, {
|
|
512
512
|
title: this._i18nBundle.getText("delete"),
|
|
513
513
|
press: this._onDeleteGroup.bind(this)
|
|
514
514
|
});
|
|
@@ -2022,7 +2022,9 @@ sap.ui.define(["sap/base/Log", "sap/f/GridContainer", "sap/f/GridContainerSettin
|
|
|
2022
2022
|
const dialog = _this22._generateGroupDetailDialog();
|
|
2023
2023
|
//set group icon
|
|
2024
2024
|
const groupIconControl = _this22._controlMap.get(`${_this22.getId()}-detailDialog-toolbar-color`);
|
|
2025
|
-
groupIconControl.setColor(Parameters.get(
|
|
2025
|
+
groupIconControl.setColor(Parameters.get({
|
|
2026
|
+
name: group.getBgColor()
|
|
2027
|
+
}));
|
|
2026
2028
|
//set group apps
|
|
2027
2029
|
return Promise.resolve(_this22._setGroupDetailDialogApps(groupId)).then(function () {
|
|
2028
2030
|
dialog.open();
|
|
@@ -2294,7 +2296,7 @@ sap.ui.define(["sap/base/Log", "sap/f/GridContainer", "sap/f/GridContainerSettin
|
|
|
2294
2296
|
this._controlMap.set(`${id}-list`, new List({
|
|
2295
2297
|
id: `${id}-list`,
|
|
2296
2298
|
mode: "MultiSelect",
|
|
2297
|
-
|
|
2299
|
+
selectionChange: setAddBtnEnabled
|
|
2298
2300
|
}));
|
|
2299
2301
|
this._controlMap.set(`${id}-addBtn`, new Button({
|
|
2300
2302
|
id: `${id}-addBtn`,
|
|
@@ -2312,8 +2314,7 @@ sap.ui.define(["sap/base/Log", "sap/f/GridContainer", "sap/f/GridContainerSettin
|
|
|
2312
2314
|
illustrationSize: "Spot",
|
|
2313
2315
|
illustrationType: "sapIllus-AddColumn",
|
|
2314
2316
|
title: this._i18nBundle.getText("noAppsTitle"),
|
|
2315
|
-
description: this._i18nBundle.getText("
|
|
2316
|
-
additionalContent: [getAppFinderBtn(`${id}-errorMessage-addAppsBtn`, ButtonType.Emphasized)],
|
|
2317
|
+
description: this._i18nBundle.getText("noDataMsgInsightTiles"),
|
|
2317
2318
|
visible: true
|
|
2318
2319
|
}).addStyleClass("sapUiLargeMarginTop"));
|
|
2319
2320
|
this._controlMap.set(id, new Dialog(id, {
|
|
@@ -2329,8 +2330,8 @@ sap.ui.define(["sap/base/Log", "sap/f/GridContainer", "sap/f/GridContainerSettin
|
|
|
2329
2330
|
items: [new Title({
|
|
2330
2331
|
id: `${id}-text`,
|
|
2331
2332
|
text: this._i18nBundle.getText("addFromInsightsDialogTitle")
|
|
2332
|
-
})
|
|
2333
|
-
}).addStyleClass("sapUiTinyMarginTop dialogHeader"), this._controlMap.get(`${id}-list`), this._controlMap.get(`${id}-errorMessage`)],
|
|
2333
|
+
}), getAppFinderBtn(`${id}-addAppsBtn`, ButtonType.Transparent)]
|
|
2334
|
+
}).addStyleClass("sapUiTinyMarginTop dialogHeader sapUiSmallMarginBeginEnd"), this._controlMap.get(`${id}-list`), this._controlMap.get(`${id}-errorMessage`)],
|
|
2334
2335
|
contentWidth: "42.75rem",
|
|
2335
2336
|
contentHeight: "32.5rem",
|
|
2336
2337
|
endButton: new Button({
|
|
@@ -2339,11 +2340,11 @@ sap.ui.define(["sap/base/Log", "sap/f/GridContainer", "sap/f/GridContainerSettin
|
|
|
2339
2340
|
}),
|
|
2340
2341
|
escapeHandler: this._closeAddFromInsightsDialog.bind(this),
|
|
2341
2342
|
buttons: [this._controlMap.get(`${id}-addBtn`), new Button({
|
|
2342
|
-
id: `${id}-
|
|
2343
|
-
text: this._i18nBundle.getText("
|
|
2343
|
+
id: `${id}-cancelBtn`,
|
|
2344
|
+
text: this._i18nBundle.getText("cancelBtn"),
|
|
2344
2345
|
press: this._closeAddFromInsightsDialog.bind(this)
|
|
2345
2346
|
})]
|
|
2346
|
-
}).addStyleClass("sapContrastPlus"));
|
|
2347
|
+
}).addStyleClass("sapContrastPlus sapCuxAddFromInsightsDialog"));
|
|
2347
2348
|
}
|
|
2348
2349
|
setAddBtnEnabled();
|
|
2349
2350
|
return this._controlMap.get(id);
|