@sapui5/sap.cux.home 1.140.0 → 1.142.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/sap/cux/home/.library +1 -1
- package/src/sap/cux/home/AdvancedSettingsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/AdvancedSettingsPanel.js +3 -1
- package/src/sap/cux/home/AdvancedSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/AdvancedSettingsPanel.ts +3 -1
- package/src/sap/cux/home/App.d.ts.map +1 -1
- package/src/sap/cux/home/App.js +6 -1
- package/src/sap/cux/home/App.js.map +1 -1
- package/src/sap/cux/home/App.ts +7 -1
- package/src/sap/cux/home/AppsAdditionPanel.d.ts +1 -0
- package/src/sap/cux/home/AppsAdditionPanel.d.ts.map +1 -1
- package/src/sap/cux/home/AppsAdditionPanel.js +64 -59
- package/src/sap/cux/home/AppsAdditionPanel.js.map +1 -1
- package/src/sap/cux/home/AppsAdditionPanel.ts +44 -34
- package/src/sap/cux/home/AppsContainer.d.ts +5 -1
- package/src/sap/cux/home/AppsContainer.d.ts.map +1 -1
- package/src/sap/cux/home/AppsContainer.js +44 -37
- package/src/sap/cux/home/AppsContainer.js.map +1 -1
- package/src/sap/cux/home/AppsContainer.ts +43 -33
- package/src/sap/cux/home/BaseAppPanel.d.ts +2 -1
- package/src/sap/cux/home/BaseAppPanel.d.ts.map +1 -1
- package/src/sap/cux/home/BaseAppPanel.js +3 -1
- package/src/sap/cux/home/BaseAppPanel.js.map +1 -1
- package/src/sap/cux/home/BaseAppPanel.ts +5 -2
- package/src/sap/cux/home/BaseContainer.d.ts +8 -0
- package/src/sap/cux/home/BaseContainer.d.ts.map +1 -1
- package/src/sap/cux/home/BaseContainer.js +26 -4
- package/src/sap/cux/home/BaseContainer.js.map +1 -1
- package/src/sap/cux/home/BaseContainer.ts +26 -3
- package/src/sap/cux/home/BaseContainerRenderer.d.ts.map +1 -1
- package/src/sap/cux/home/BaseContainerRenderer.js.map +1 -1
- package/src/sap/cux/home/BaseContainerRenderer.ts +1 -1
- package/src/sap/cux/home/BaseNewsPanel.js +1 -1
- package/src/sap/cux/home/BaseNewsPanel.js.map +1 -1
- package/src/sap/cux/home/BaseNewsPanel.ts +2 -2
- package/src/sap/cux/home/BasePanel.d.ts +7 -0
- package/src/sap/cux/home/BasePanel.d.ts.map +1 -1
- package/src/sap/cux/home/BasePanel.js +20 -0
- package/src/sap/cux/home/BasePanel.js.map +1 -1
- package/src/sap/cux/home/BasePanel.ts +16 -0
- package/src/sap/cux/home/BaseSettingsPanel.d.ts +9 -0
- package/src/sap/cux/home/BaseSettingsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/BaseSettingsPanel.js +13 -0
- package/src/sap/cux/home/BaseSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/BaseSettingsPanel.ts +15 -0
- package/src/sap/cux/home/CardsPanel.d.ts +7 -0
- package/src/sap/cux/home/CardsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/CardsPanel.js +132 -113
- package/src/sap/cux/home/CardsPanel.js.map +1 -1
- package/src/sap/cux/home/CardsPanel.ts +19 -8
- package/src/sap/cux/home/ContentAdditionDialog.d.ts.map +1 -1
- package/src/sap/cux/home/ContentAdditionDialog.js +6 -2
- package/src/sap/cux/home/ContentAdditionDialog.js.map +1 -1
- package/src/sap/cux/home/ContentAdditionDialog.ts +5 -1
- package/src/sap/cux/home/ErrorPanel.js +2 -2
- package/src/sap/cux/home/ErrorPanel.js.map +1 -1
- package/src/sap/cux/home/ErrorPanel.ts +2 -2
- package/src/sap/cux/home/FavAppPanel.d.ts +4 -10
- package/src/sap/cux/home/FavAppPanel.d.ts.map +1 -1
- package/src/sap/cux/home/FavAppPanel.js +432 -446
- package/src/sap/cux/home/FavAppPanel.js.map +1 -1
- package/src/sap/cux/home/FavAppPanel.ts +56 -84
- package/src/sap/cux/home/FrequentAppPanel.d.ts.map +1 -1
- package/src/sap/cux/home/FrequentAppPanel.js +5 -1
- package/src/sap/cux/home/FrequentAppPanel.js.map +1 -1
- package/src/sap/cux/home/FrequentAppPanel.ts +4 -0
- package/src/sap/cux/home/InsightsAdditionPanel.d.ts.map +1 -1
- package/src/sap/cux/home/InsightsAdditionPanel.js +3 -1
- package/src/sap/cux/home/InsightsAdditionPanel.js.map +1 -1
- package/src/sap/cux/home/InsightsAdditionPanel.ts +2 -0
- package/src/sap/cux/home/InsightsContainer.d.ts.map +1 -1
- package/src/sap/cux/home/InsightsContainer.js +2 -2
- package/src/sap/cux/home/InsightsContainer.js.map +1 -1
- package/src/sap/cux/home/InsightsContainer.ts +1 -1
- package/src/sap/cux/home/NewsAndPagesContainer.d.ts +0 -4
- package/src/sap/cux/home/NewsAndPagesContainer.d.ts.map +1 -1
- package/src/sap/cux/home/NewsAndPagesContainer.js +2 -2
- package/src/sap/cux/home/NewsAndPagesContainer.js.map +1 -1
- package/src/sap/cux/home/NewsAndPagesContainer.ts +4 -4
- package/src/sap/cux/home/NewsPanel.d.ts +17 -0
- package/src/sap/cux/home/NewsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/NewsPanel.js +100 -68
- package/src/sap/cux/home/NewsPanel.js.map +1 -1
- package/src/sap/cux/home/NewsPanel.ts +60 -33
- package/src/sap/cux/home/NewsSettingsPanel.d.ts +42 -6
- package/src/sap/cux/home/NewsSettingsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/NewsSettingsPanel.js +219 -81
- package/src/sap/cux/home/NewsSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/NewsSettingsPanel.ts +215 -80
- package/src/sap/cux/home/Page.d.ts.map +1 -1
- package/src/sap/cux/home/Page.js +4 -1
- package/src/sap/cux/home/Page.js.map +1 -1
- package/src/sap/cux/home/Page.ts +2 -0
- package/src/sap/cux/home/PagePanel.d.ts.map +1 -1
- package/src/sap/cux/home/PagePanel.js +5 -2
- package/src/sap/cux/home/PagePanel.js.map +1 -1
- package/src/sap/cux/home/PagePanel.ts +8 -8
- package/src/sap/cux/home/PageSettingsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/PageSettingsPanel.js +6 -3
- package/src/sap/cux/home/PageSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/PageSettingsPanel.ts +2 -2
- package/src/sap/cux/home/RecentAppPanel.d.ts.map +1 -1
- package/src/sap/cux/home/RecentAppPanel.js +6 -0
- package/src/sap/cux/home/RecentAppPanel.js.map +1 -1
- package/src/sap/cux/home/RecentAppPanel.ts +5 -1
- package/src/sap/cux/home/RecommendedAppPanel.d.ts.map +1 -1
- package/src/sap/cux/home/RecommendedAppPanel.js +7 -0
- package/src/sap/cux/home/RecommendedAppPanel.js.map +1 -1
- package/src/sap/cux/home/RecommendedAppPanel.ts +6 -1
- package/src/sap/cux/home/SettingsDialog.d.ts +1 -0
- package/src/sap/cux/home/SettingsDialog.d.ts.map +1 -1
- package/src/sap/cux/home/SettingsDialog.js +13 -6
- package/src/sap/cux/home/SettingsDialog.js.map +1 -1
- package/src/sap/cux/home/SettingsDialog.ts +14 -6
- package/src/sap/cux/home/SideBySideIconTabFilter.d.ts +10 -0
- package/src/sap/cux/home/SideBySideIconTabFilter.d.ts.map +1 -1
- package/src/sap/cux/home/SideBySideIconTabFilter.js +12 -1
- package/src/sap/cux/home/SideBySideIconTabFilter.js.map +1 -1
- package/src/sap/cux/home/SideBySideIconTabFilter.ts +13 -1
- package/src/sap/cux/home/SituationPanel.d.ts.map +1 -1
- package/src/sap/cux/home/SituationPanel.js +7 -2
- package/src/sap/cux/home/SituationPanel.js.map +1 -1
- package/src/sap/cux/home/SituationPanel.ts +2 -0
- package/src/sap/cux/home/SpaceInsightsPanel.js +1 -1
- package/src/sap/cux/home/SpaceInsightsPanel.js.map +1 -1
- package/src/sap/cux/home/SpaceInsightsPanel.ts +1 -1
- package/src/sap/cux/home/TaskPanel.d.ts.map +1 -1
- package/src/sap/cux/home/TaskPanel.js +3 -0
- package/src/sap/cux/home/TaskPanel.js.map +1 -1
- package/src/sap/cux/home/TaskPanel.ts +2 -1
- package/src/sap/cux/home/TilesPanel.d.ts.map +1 -1
- package/src/sap/cux/home/TilesPanel.js +10 -3
- package/src/sap/cux/home/TilesPanel.js.map +1 -1
- package/src/sap/cux/home/TilesPanel.ts +7 -3
- package/src/sap/cux/home/ToDoPanel.d.ts.map +1 -1
- package/src/sap/cux/home/ToDoPanel.js +29 -8
- package/src/sap/cux/home/ToDoPanel.js.map +1 -1
- package/src/sap/cux/home/ToDoPanel.ts +19 -8
- package/src/sap/cux/home/ToDosContainer.js +3 -3
- package/src/sap/cux/home/ToDosContainer.js.map +1 -1
- package/src/sap/cux/home/ToDosContainer.ts +1 -1
- package/src/sap/cux/home/i18n/messagebundle.properties +13 -7
- package/src/sap/cux/home/i18n/messagebundle_ar.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_bg.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_ca.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_cnr.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_cs.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_cy.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_da.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_de.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_el.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_en.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_en_GB.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_en_US_sappsd.properties +1 -3
- package/src/sap/cux/home/i18n/messagebundle_en_US_saprigi.properties +1 -3
- package/src/sap/cux/home/i18n/messagebundle_en_US_saptrc.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_es.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_es_MX.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_et.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_fi.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_fr.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_fr_CA.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_hi.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_hr.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_hu.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_id.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_it.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_iw.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_ja.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_kk.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_ko.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_lt.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_lv.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_mk.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_ms.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_nl.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_no.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_pl.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_pt.properties +1 -3
- package/src/sap/cux/home/i18n/messagebundle_pt_PT.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_ro.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_ru.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_sh.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_sk.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_sl.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_sr.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_sv.properties +1 -3
- package/src/sap/cux/home/i18n/messagebundle_th.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_tr.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_uk.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_vi.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_zh_CN.properties +0 -2
- package/src/sap/cux/home/i18n/messagebundle_zh_TW.properties +0 -2
- package/src/sap/cux/home/interface/AppsInterface.d.ts +5 -0
- package/src/sap/cux/home/interface/AppsInterface.d.ts.map +1 -1
- package/src/sap/cux/home/interface/AppsInterface.js.map +1 -1
- package/src/sap/cux/home/interface/AppsInterface.ts +6 -0
- package/src/sap/cux/home/library.d.ts.map +1 -1
- package/src/sap/cux/home/library.js +1 -0
- package/src/sap/cux/home/library.js.map +1 -1
- package/src/sap/cux/home/library.ts +1 -0
- package/src/sap/cux/home/themes/base/AppsContainer.less +12 -1
- package/src/sap/cux/home/themes/base/BaseLayout.less +11 -0
- package/src/sap/cux/home/themes/base/InsightsContainer.less +4 -0
- package/src/sap/cux/home/themes/base/ToDosContainer.less +4 -0
- package/src/sap/cux/home/utils/AppManager.d.ts +7 -6
- package/src/sap/cux/home/utils/AppManager.d.ts.map +1 -1
- package/src/sap/cux/home/utils/AppManager.js +1 -1
- package/src/sap/cux/home/utils/AppManager.js.map +1 -1
- package/src/sap/cux/home/utils/AppManager.ts +9 -10
- package/src/sap/cux/home/utils/BatchHelper.d.ts.map +1 -1
- package/src/sap/cux/home/utils/BatchHelper.js +1 -1
- package/src/sap/cux/home/utils/BatchHelper.js.map +1 -1
- package/src/sap/cux/home/utils/BatchHelper.ts +4 -1
- package/src/sap/cux/home/utils/FESRUtil.d.ts +30 -0
- package/src/sap/cux/home/utils/FESRUtil.d.ts.map +1 -1
- package/src/sap/cux/home/utils/FESRUtil.js +36 -1
- package/src/sap/cux/home/utils/FESRUtil.js.map +1 -1
- package/src/sap/cux/home/utils/FESRUtil.ts +36 -0
- package/src/sap/cux/home/utils/PXFeedback.d.ts +4 -0
- package/src/sap/cux/home/utils/PXFeedback.d.ts.map +1 -0
- package/src/sap/cux/home/utils/PXFeedback.js +28 -0
- package/src/sap/cux/home/utils/PXFeedback.js.map +1 -0
- package/src/sap/cux/home/utils/PXFeedback.ts +19 -0
- package/src/sap/cux/home/utils/PageManager.d.ts +0 -4
- package/src/sap/cux/home/utils/PageManager.d.ts.map +1 -1
- package/src/sap/cux/home/utils/PageManager.js +6 -6
- package/src/sap/cux/home/utils/PageManager.js.map +1 -1
- package/src/sap/cux/home/utils/PageManager.ts +6 -5
- package/src/sap/cux/home/utils/UshellPersonalizer.js +1 -1
- package/src/sap/cux/home/utils/UshellPersonalizer.js.map +1 -1
- package/src/sap/cux/home/utils/UshellPersonalizer.ts +1 -1
- package/src/sap/cux/home/utils/fragment/appsAdditionContent.fragment.xml +1 -1
|
@@ -50,8 +50,6 @@ import SimpleForm from "sap/ui/layout/form/SimpleForm";
|
|
|
50
50
|
import { form } from "sap/ui/layout/library";
|
|
51
51
|
import Config from "sap/ushell/Config";
|
|
52
52
|
import Container from "sap/ushell/Container";
|
|
53
|
-
import MyHomeImport from "sap/ushell/components/pages/MyHomeImport";
|
|
54
|
-
import PageRuntime from "sap/ushell/components/pages/controller/PageRuntime.controller";
|
|
55
53
|
import Navigation from "sap/ushell/services/Navigation";
|
|
56
54
|
import Pages from "sap/ushell/services/Pages";
|
|
57
55
|
import { IExportData } from "./AdvancedSettingsPanel";
|
|
@@ -76,9 +74,11 @@ import {
|
|
|
76
74
|
IVisualization
|
|
77
75
|
} from "./interface/AppsInterface";
|
|
78
76
|
import { checkPanelExists, getInvisibleText } from "./utils/Accessibility";
|
|
77
|
+
import { IMoveConfig } from "./utils/AppManager";
|
|
79
78
|
import { DEFAULT_BG_COLOR, END_USER_COLORS, MYAPPS_SECTION_ID, MYHOME_PAGE_ID } from "./utils/Constants";
|
|
80
79
|
import { getLeanURL, recycleId } from "./utils/DataFormatUtils";
|
|
81
|
-
import {
|
|
80
|
+
import { DeviceType } from "./utils/Device";
|
|
81
|
+
import { addFESRId, addFESRNavigationSource, addFESRSemanticStepName, FESRNavigationSource } from "./utils/FESRUtil";
|
|
82
82
|
import { sortMenuItems } from "./utils/InsightsUtils";
|
|
83
83
|
const _showAddApps = () => {
|
|
84
84
|
return (Config.last("/core/shell/enablePersonalization") || Config.last("/core/catalog/enabled")) as boolean;
|
|
@@ -121,7 +121,6 @@ export default class FavAppPanel extends BaseAppPersPanel {
|
|
|
121
121
|
private _currentItem!: App | Group;
|
|
122
122
|
private _cutApp: GenericTile | undefined;
|
|
123
123
|
private oEventBus!: EventBus;
|
|
124
|
-
private _importButton!: Button;
|
|
125
124
|
private _createGroupMenuItem!: MenuItem;
|
|
126
125
|
private _isInitialLoad = true;
|
|
127
126
|
|
|
@@ -157,7 +156,7 @@ export default class FavAppPanel extends BaseAppPersPanel {
|
|
|
157
156
|
this.setProperty("title", this._i18nBundle.getText("favoritesTab"));
|
|
158
157
|
this.setProperty("tooltip", this._i18nBundle.getText("favAppsInfo"));
|
|
159
158
|
//Setup Action Buttons
|
|
160
|
-
|
|
159
|
+
this._createActionButtons();
|
|
161
160
|
//Setup Menu Items
|
|
162
161
|
this._createHeaderMenuItems();
|
|
163
162
|
//add drag and drop config
|
|
@@ -186,14 +185,6 @@ export default class FavAppPanel extends BaseAppPersPanel {
|
|
|
186
185
|
},
|
|
187
186
|
this
|
|
188
187
|
);
|
|
189
|
-
this.oEventBus.subscribe(
|
|
190
|
-
"importChannel",
|
|
191
|
-
"resetImported",
|
|
192
|
-
async () => {
|
|
193
|
-
await this.setImportButtonVisibility(true);
|
|
194
|
-
},
|
|
195
|
-
this
|
|
196
|
-
);
|
|
197
188
|
this.attachPersistDialog(() => {
|
|
198
189
|
// if while navigating to different page, a group detail dialog was open, then while navigating back group detail dialog should be in open state.
|
|
199
190
|
if (this._selectedGroupId) {
|
|
@@ -203,6 +194,9 @@ export default class FavAppPanel extends BaseAppPersPanel {
|
|
|
203
194
|
|
|
204
195
|
document.addEventListener("click", (event) => this._resetCutElement(event));
|
|
205
196
|
document.addEventListener("keydown", (event) => this._resetCutElement(event));
|
|
197
|
+
this.additionalInfo = {
|
|
198
|
+
fesrSource: FESRNavigationSource.Favorite
|
|
199
|
+
};
|
|
206
200
|
}
|
|
207
201
|
|
|
208
202
|
private _importdone() {
|
|
@@ -218,40 +212,37 @@ export default class FavAppPanel extends BaseAppPersPanel {
|
|
|
218
212
|
let aPromise: (() => Promise<void>)[] = [];
|
|
219
213
|
let aPersonalization = await this._getAppPersonalization();
|
|
220
214
|
|
|
221
|
-
const pagesService = await Container.getServiceAsync<Pages>("Pages");
|
|
222
215
|
for (const section of sections) {
|
|
223
216
|
const sectionViz = section.visualizations as IVisualization[];
|
|
224
217
|
if (sectionViz?.length) {
|
|
225
218
|
if (section.default || section.id === MYAPPS_SECTION_ID) {
|
|
226
|
-
const filteredPersonalizations = this.filterPersonalizations(importedPersonalizations, section);
|
|
227
|
-
aPersonalization = aPersonalization.concat(filteredPersonalizations);
|
|
228
219
|
aPromise.push(() => {
|
|
229
220
|
return section.default ? this.addSectionViz(sectionViz) : this.addSectionViz(sectionViz, MYAPPS_SECTION_ID);
|
|
230
221
|
});
|
|
231
222
|
} else {
|
|
232
223
|
const sections = await this.appManagerInstance._getSections(true);
|
|
233
|
-
//
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
aPromise.push(() => {
|
|
240
|
-
return this.appManagerInstance.addSection({
|
|
241
|
-
sectionIndex: sections.length,
|
|
242
|
-
sectionProperties: {
|
|
243
|
-
id: sNewSectionId,
|
|
244
|
-
title: section.title,
|
|
245
|
-
visible: true,
|
|
246
|
-
visualizations: sectionViz?.map((oViz) => {
|
|
247
|
-
//check if this generate id can be replaced with any exposed method
|
|
248
|
-
oViz.id = pagesService._generateId(MYHOME_PAGE_ID);
|
|
249
|
-
return oViz;
|
|
250
|
-
})
|
|
251
|
-
}
|
|
224
|
+
// If Section exists, add visualization to existing section else create a new section with same sectionId
|
|
225
|
+
const sectionIndex = sections.findIndex((n) => n.id === section.id);
|
|
226
|
+
if (sectionIndex > -1) {
|
|
227
|
+
aPromise.push(() => {
|
|
228
|
+
return this.addSectionViz(sectionViz, section.id);
|
|
252
229
|
});
|
|
253
|
-
}
|
|
230
|
+
} else {
|
|
231
|
+
aPromise.push(() => {
|
|
232
|
+
return this.appManagerInstance.addSection({
|
|
233
|
+
sectionIndex: sections.length,
|
|
234
|
+
sectionProperties: {
|
|
235
|
+
id: section.id,
|
|
236
|
+
title: section.title,
|
|
237
|
+
visible: true,
|
|
238
|
+
visualizations: sectionViz
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
}
|
|
254
243
|
}
|
|
244
|
+
const filteredPersonalizations = this.filterPersonalizations(importedPersonalizations, section);
|
|
245
|
+
aPersonalization = aPersonalization.concat(filteredPersonalizations);
|
|
255
246
|
}
|
|
256
247
|
}
|
|
257
248
|
|
|
@@ -321,11 +312,27 @@ export default class FavAppPanel extends BaseAppPersPanel {
|
|
|
321
312
|
*
|
|
322
313
|
* @param {Array} sectionsViz - array of section visualizations
|
|
323
314
|
* @param {String} sSectionId - section id for which visualizations needs to be added
|
|
315
|
+
* @param {Array} sections - array of sections
|
|
324
316
|
* @returns {String} resolves to visualizations being added to given section
|
|
325
317
|
*/
|
|
326
318
|
public async addSectionViz(sectionsViz: IVisualization[], sSectionId?: string) {
|
|
327
319
|
return sectionsViz.reduce((promiseChain, oViz: IVisualization) => {
|
|
328
|
-
return promiseChain.then(() => {
|
|
320
|
+
return promiseChain.then(async () => {
|
|
321
|
+
// in case of bookmark, move the viz to target section
|
|
322
|
+
if (oViz.isBookmark && sSectionId) {
|
|
323
|
+
const sections = await this.appManagerInstance._getSections();
|
|
324
|
+
const defaultSection = sections.find((section) => section.default);
|
|
325
|
+
const targetSection = sections.find((section) => section.id === sSectionId);
|
|
326
|
+
if (defaultSection && targetSection) {
|
|
327
|
+
const moveConfig = {
|
|
328
|
+
sourceSectionIndex: sections.indexOf(defaultSection),
|
|
329
|
+
sourceVisualizationIndex: defaultSection.visualizations!.length,
|
|
330
|
+
targetSectionIndex: sections.indexOf(targetSection),
|
|
331
|
+
targetVisualizationIndex: targetSection.visualizations!.length
|
|
332
|
+
} as IMoveConfig;
|
|
333
|
+
return this._addVisualization({ visualization: oViz } as ICustomVisualization, sSectionId, moveConfig);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
329
336
|
return this._addVisualization({ visualization: oViz } as ICustomVisualization, sSectionId);
|
|
330
337
|
});
|
|
331
338
|
}, Promise.resolve());
|
|
@@ -337,6 +344,7 @@ export default class FavAppPanel extends BaseAppPersPanel {
|
|
|
337
344
|
*/
|
|
338
345
|
public async loadApps() {
|
|
339
346
|
const favoriteVisualizations = await this.appManagerInstance.fetchFavVizs(true, false);
|
|
347
|
+
const isPhone = this.getDeviceType() === DeviceType.Mobile;
|
|
340
348
|
//Create groups
|
|
341
349
|
this.destroyAggregation("groups", true);
|
|
342
350
|
const groupVisualizations = favoriteVisualizations
|
|
@@ -367,7 +375,9 @@ export default class FavAppPanel extends BaseAppPersPanel {
|
|
|
367
375
|
}
|
|
368
376
|
const container = this.getParent() as BaseContainer;
|
|
369
377
|
container.toggleMenuListItem(this._createGroupMenuItem, this.getApps().length > 0);
|
|
370
|
-
|
|
378
|
+
if (!isPhone) {
|
|
379
|
+
await this._switchToRecommendedIfNoFavApps(apps, groups);
|
|
380
|
+
}
|
|
371
381
|
if (checkPanelExists(container, insightsConatinerlName, tilesPanelName)) {
|
|
372
382
|
this._createAddFromInsTilesMenuItem(favouritesMenuItems.ADD_FROM_INSIGHTS);
|
|
373
383
|
}
|
|
@@ -387,7 +397,7 @@ export default class FavAppPanel extends BaseAppPersPanel {
|
|
|
387
397
|
const container = this.getParent() as AppsContainer;
|
|
388
398
|
const panels = container.getContent() as BaseAppPanel[];
|
|
389
399
|
const recommendedPanel = panels ? panels.find((panel) => panel instanceof RecommendedAppPanel) : null;
|
|
390
|
-
if (this._isInitialLoad && [...apps, ...groups].length === 0 && recommendedPanel) {
|
|
400
|
+
if (this._isInitialLoad && [...apps, ...groups].length === 0 && recommendedPanel?.isSupported()) {
|
|
391
401
|
container.setProperty?.("selectedKey", "recommendedApps");
|
|
392
402
|
await container.refreshPanel(recommendedPanel);
|
|
393
403
|
}
|
|
@@ -591,7 +601,7 @@ export default class FavAppPanel extends BaseAppPersPanel {
|
|
|
591
601
|
* Creates actions buttons for panel.
|
|
592
602
|
* @private
|
|
593
603
|
*/
|
|
594
|
-
private
|
|
604
|
+
private _createActionButtons() {
|
|
595
605
|
if (!this._actionButtons) {
|
|
596
606
|
this._actionButtons = [];
|
|
597
607
|
if (_showAddApps()) {
|
|
@@ -610,29 +620,6 @@ export default class FavAppPanel extends BaseAppPersPanel {
|
|
|
610
620
|
this._actionButtons.forEach((actionButton) => {
|
|
611
621
|
this.addAggregation("actionButtons", actionButton);
|
|
612
622
|
});
|
|
613
|
-
const isImportEnabled = await this._validateAppsMigration();
|
|
614
|
-
if (isImportEnabled) {
|
|
615
|
-
this._createImportButton();
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
private _createImportButton(): Button {
|
|
620
|
-
if (!this._importButton) {
|
|
621
|
-
this._importButton = new Button(`${this.getId()}-importAppsBtn`, {
|
|
622
|
-
tooltip: this._i18nBundle.getText("importAppsNow"),
|
|
623
|
-
text: this._i18nBundle.getText("importAppsNow"),
|
|
624
|
-
press: this._openImportAppsDialog.bind(this)
|
|
625
|
-
});
|
|
626
|
-
addFESRId(this._importButton, "importAppsDialog");
|
|
627
|
-
this._actionButtons.push(this._importButton);
|
|
628
|
-
this.insertAggregation("actionButtons", this._importButton, 0);
|
|
629
|
-
}
|
|
630
|
-
return this._importButton;
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
private async setImportButtonVisibility(bVisible: boolean): Promise<void> {
|
|
634
|
-
await MyHomeImport.setImportEnabled(bVisible);
|
|
635
|
-
this._createImportButton().setVisible(bVisible);
|
|
636
623
|
}
|
|
637
624
|
|
|
638
625
|
/**
|
|
@@ -909,25 +896,7 @@ export default class FavAppPanel extends BaseAppPersPanel {
|
|
|
909
896
|
shellHash: `Shell-appfinder?&/catalog/${JSON.stringify(navigationObject)}`
|
|
910
897
|
}
|
|
911
898
|
});
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
/**
|
|
915
|
-
* Validates if import apps is enabled
|
|
916
|
-
*
|
|
917
|
-
*@returns {Promise} - resolves to boolean value (import is enabled/disabled)
|
|
918
|
-
*/
|
|
919
|
-
private async _validateAppsMigration() {
|
|
920
|
-
try {
|
|
921
|
-
return await MyHomeImport.isImportEnabled();
|
|
922
|
-
} catch (error: unknown) {
|
|
923
|
-
Log.warning(error instanceof Error ? error.message : "Error while checking if import apps is enabled");
|
|
924
|
-
return false;
|
|
925
|
-
}
|
|
926
|
-
}
|
|
927
|
-
|
|
928
|
-
private _openImportAppsDialog() {
|
|
929
|
-
const pageRuntime = new PageRuntime();
|
|
930
|
-
pageRuntime.onImportDialogPress();
|
|
899
|
+
addFESRNavigationSource(FESRNavigationSource.AppFinder);
|
|
931
900
|
}
|
|
932
901
|
|
|
933
902
|
/**
|
|
@@ -2677,13 +2646,16 @@ export default class FavAppPanel extends BaseAppPersPanel {
|
|
|
2677
2646
|
* @param {object} oViz.visualization - The visualization object.
|
|
2678
2647
|
* @param {boolean} [oViz.visualization.isBookmark=false] - Indicates if the visualization is a bookmark.
|
|
2679
2648
|
* @param {string} [oViz.visualization.vizId] - The ID of the visualization if it's not a bookmark.
|
|
2649
|
+
* @param {string} [sSectionId] - The ID of the section (group) to which the visualization should be added.
|
|
2650
|
+
* If not provided, the visualization will be added to the default section.
|
|
2651
|
+
* @param {IMoveConfig} [moveConfig] - Configuration for moving the visualization.
|
|
2680
2652
|
* @returns {Promise<void>} A promise that resolves to void after the visualization is added.
|
|
2681
2653
|
* @private
|
|
2682
2654
|
*/
|
|
2683
|
-
private _addVisualization(viz: ICustomVisualization, sSectionId?: string) {
|
|
2655
|
+
private _addVisualization(viz: ICustomVisualization, sSectionId?: string, moveConfig?: IMoveConfig) {
|
|
2684
2656
|
if (viz.visualization) {
|
|
2685
2657
|
return viz.visualization.isBookmark
|
|
2686
|
-
? this.appManagerInstance.addBookMark(viz.visualization)
|
|
2658
|
+
? this.appManagerInstance.addBookMark(viz.visualization, moveConfig)
|
|
2687
2659
|
: this.appManagerInstance.addVisualization(viz.visualization.vizId, sSectionId);
|
|
2688
2660
|
}
|
|
2689
2661
|
return Promise.reject(new Error("No visualization provided to add"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrequentAppPanel.d.ts","sourceRoot":"../../../../..","sources":["src/sap/cux/home/FrequentAppPanel.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,+BAA+B,CAAC;IAO/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;IAM3D,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;IAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"FrequentAppPanel.d.ts","sourceRoot":"../../../../..","sources":["src/sap/cux/home/FrequentAppPanel.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,+BAA+B,CAAC;IAO/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;IAM3D,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;IAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;IAMjE;;;;;;;;;;;;;;OAcG;IAEH,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,gBAAgB;QAC7D,OAAO,CAAC,SAAS,CAAY;QAC7B,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,eAAe,CASvC;QAEF;;;;;WAKG;oBACgB,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,kBAAkB;QAKtD,IAAI;QA0BX;;;WAGG;QACU,QAAQ;QAcrB;;;;WAIG;gBACW,0BAA0B;QAaxC;;;;;WAKG;QACH,OAAO,CAAC,WAAW;QAgBnB;;;;;WAKG;QACH,SAAS,CAAC,0BAA0B;KAMpC;CAEA"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
3
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
4
4
|
*/
|
|
5
|
-
sap.ui.define(["sap/base/Log", "sap/ui/core/EventBus", "sap/ushell/Container", "sap/ushell/EventHub", "./BaseAppPersPanel", "./MenuItem"], function (Log, EventBus, Container, EventHub, __BaseAppPersPanel, __MenuItem) {
|
|
5
|
+
sap.ui.define(["sap/base/Log", "sap/ui/core/EventBus", "sap/ushell/Container", "sap/ushell/EventHub", "./BaseAppPersPanel", "./MenuItem", "./utils/FESRUtil"], function (Log, EventBus, Container, EventHub, __BaseAppPersPanel, __MenuItem, ___utils_FESRUtil) {
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
8
|
function _interopRequireDefault(obj) {
|
|
@@ -21,6 +21,7 @@ sap.ui.define(["sap/base/Log", "sap/ui/core/EventBus", "sap/ushell/Container", "
|
|
|
21
21
|
}
|
|
22
22
|
const BaseAppPersPanel = _interopRequireDefault(__BaseAppPersPanel);
|
|
23
23
|
const MenuItem = _interopRequireDefault(__MenuItem);
|
|
24
|
+
const FESRNavigationSource = ___utils_FESRUtil["FESRNavigationSource"];
|
|
24
25
|
/**
|
|
25
26
|
*
|
|
26
27
|
* Provides the class for managing frequent apps.
|
|
@@ -80,6 +81,9 @@ sap.ui.define(["sap/base/Log", "sap/ui/core/EventBus", "sap/ushell/Container", "
|
|
|
80
81
|
//update color of the app in most used apps
|
|
81
82
|
this._applyUngroupedTileColor(item, color);
|
|
82
83
|
}, this);
|
|
84
|
+
this.additionalInfo = {
|
|
85
|
+
fesrSource: FESRNavigationSource.FrequentlyUsed
|
|
86
|
+
};
|
|
83
87
|
},
|
|
84
88
|
/**
|
|
85
89
|
* Fetch frequent apps and set apps aggregation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrequentAppPanel.js","names":["sap","ui","define","Log","EventBus","Container","EventHub","__BaseAppPersPanel","__MenuItem","_interopRequireDefault","obj","__esModule","default","_catch","body","recover","result","e","then","BaseAppPersPanel","MenuItem","FrequentAppPanel","extend","metadata","library","defaultAggregation","aggregations","apps","type","singularName","multiple","visibility","constructor","_constructor","id","settings","BaseAppPersPanel.prototype.constructor.call","setSupported","init","_init","BaseAppPersPanel.prototype.init.call","setProperty","_i18nBundle","getText","_attachUserActivityTracking","on","do","refresh","oEventBus","getInstance","subscribe","channelId","eventId","data","item","color","_applyUngroupedTileColor","loadApps","_loadApps","_this","Promise","resolve","_getFrequentVisualizations","frequentVisualizations","destroyAggregation","map","visualization","index","menuItems","_getActions","addedInFavorites","frequentApps","generateApps","setApps","reject","_this2","getServiceAsync","UserRecentsService","getFrequentActivity","frequentActivities","convertActivitiesToVisualizations","error","isAppAddedInFavorite","action","push","getKey","title","icon","press","event","_addAppToFavorites","generateIllustratedMessage","_generateIllustratedMessage","illustratedMessage","BaseAppPersPanel.prototype.generateIllustratedMessage.call","setDescription"],"sources":["FrequentAppPanel.ts"],"sourcesContent":["/*!\n * SAP UI development toolkit for HTML5 (SAPUI5)\n * * (c) Copyright 2009-2025 SAP SE. All rights reserved\n */\n\nimport Log from \"sap/base/Log\";\nimport type { MetadataOptions } from \"sap/ui/core/Element\";\nimport EventBus from \"sap/ui/core/EventBus\";\nimport Container from \"sap/ushell/Container\";\nimport EventHub from \"sap/ushell/EventHub\";\nimport UserRecents from \"sap/ushell/services/UserRecents\";\nimport App from \"./App\";\nimport BaseAppPersPanel from \"./BaseAppPersPanel\";\nimport type { $BasePanelSettings } from \"./BasePanel\";\nimport Group from \"./Group\";\nimport { IActivity } from \"./interface/AppsInterface\";\nimport MenuItem from \"./MenuItem\";\n\n/**\n *\n * Provides the class for managing frequent apps.\n *\n * @extends sap.cux.home.BaseAppPersPanel\n *\n * @author SAP SE\n * @version 0.0.1\n * @since 1.121.0\n *\n * @private\n * @ui5-restricted ux.eng.s4producthomes1\n *\n * @alias sap.cux.home.FrequentAppPanel\n */\n\nexport default class FrequentAppPanel extends BaseAppPersPanel {\n\tprivate oEventBus!: EventBus;\n\tstatic readonly metadata: MetadataOptions = {\n\t\tlibrary: \"sap.cux.home\",\n\t\tdefaultAggregation: \"apps\",\n\t\taggregations: {\n\t\t\t/**\n\t\t\t * Apps aggregation for Frequent apps\n\t\t\t */\n\t\t\tapps: { type: \"sap.cux.home.App\", singularName: \"app\", multiple: true, visibility: \"hidden\" }\n\t\t}\n\t};\n\n\t/**\n\t * Constructor for a new frequent app panel.\n\t *\n\t * @param {string} [id] ID for the new control, generated automatically if an ID is not provided\n\t * @param {object} [settings] Initial settings for the new control\n\t */\n\tpublic constructor(id?: string, settings?: $BasePanelSettings) {\n\t\tsuper(id, settings);\n\t\tthis.setSupported(false);\n\t}\n\n\tpublic init() {\n\t\tsuper.init();\n\t\tthis.setProperty(\"key\", \"frequentApps\");\n\t\tthis.setProperty(\"title\", this._i18nBundle.getText(\"frequentlyUsedTab\"));\n\t\tthis.setProperty(\"tooltip\", this._i18nBundle.getText(\"frequentlyUsedTabInfo\"));\n\t\tthis._attachUserActivityTracking();\n\t\tEventHub.on(\"userRecentsCleared\").do(() => {\n\t\t\tvoid this.refresh();\n\t\t});\n\n\t\tthis.oEventBus = EventBus.getInstance();\n\t\tthis.oEventBus.subscribe(\n\t\t\t\"appsChannel\",\n\t\t\t\"favAppColorChanged\",\n\t\t\t(channelId?: string, eventId?: string, data?) => {\n\t\t\t\tconst { item, color } = data as { item: App | Group; color: string };\n\t\t\t\t//update color of the app in most used apps\n\t\t\t\tthis._applyUngroupedTileColor(item, color);\n\t\t\t},\n\t\t\tthis\n\t\t);\n\t}\n\n\t/**\n\t * Fetch frequent apps and set apps aggregation\n\t * @private\n\t */\n\tpublic async loadApps() {\n\t\tlet frequentVisualizations = await this._getFrequentVisualizations();\n\t\tthis.destroyAggregation(\"apps\", true);\n\t\tfrequentVisualizations = frequentVisualizations.map((visualization, index) => {\n\t\t\treturn {\n\t\t\t\t...visualization,\n\t\t\t\tmenuItems: this._getActions(visualization.addedInFavorites, index)\n\t\t\t};\n\t\t});\n\t\t//convert apps objects array to apps instances\n\t\tconst frequentApps = this.generateApps(frequentVisualizations);\n\t\tthis.setApps(frequentApps);\n\t}\n\n\t/**\n\t * Returns list of frequent apps\n\t * @private\n\t * @returns {object[]} - Array of frequent apps.\n\t */\n\tprivate async _getFrequentVisualizations() {\n\t\ttry {\n\t\t\tconst UserRecentsService = await Container.getServiceAsync<UserRecents>(\"UserRecents\");\n\t\t\tconst frequentActivities: IActivity[] = (await UserRecentsService?.getFrequentActivity()) || [];\n\t\t\t//convert activity to apps\n\t\t\tconst frequentVisualizations = await this.convertActivitiesToVisualizations(frequentActivities);\n\t\t\treturn frequentVisualizations;\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 list of actions available for selected app\n\t * @private\n\t * @param {boolean} isAppAddedInFavorite - true if app is already present in favorite, false otherwise.\n\t * @returns {sap.cux.home.MenuItem[]} - Array of list items.\n\t */\n\tprivate _getActions(isAppAddedInFavorite: boolean = false, index?: number) {\n\t\tconst action = [];\n\t\tif (!isAppAddedInFavorite) {\n\t\t\taction.push(\n\t\t\t\tnew MenuItem(`${this.getKey()}--addToFavorites--${index}`, {\n\t\t\t\t\ttitle: this._i18nBundle.getText(\"addToFavorites\"),\n\t\t\t\t\ticon: \"sap-icon://add-favorite\",\n\t\t\t\t\tpress: (event) => {\n\t\t\t\t\t\tvoid this._addAppToFavorites(event);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\t\treturn action;\n\t}\n\n\t/**\n\t * Generates illustrated message for frequent apps panel.\n\t * @private\n\t * @override\n\t * @returns {sap.m.IllustratedMessage} Illustrated error message.\n\t */\n\tprotected generateIllustratedMessage() {\n\t\tconst illustratedMessage = super.generateIllustratedMessage();\n\t\t//override the default description\n\t\tillustratedMessage.setDescription(this._i18nBundle.getText(\"noFreqAppsDescription\"));\n\t\treturn illustratedMessage;\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AAHAA,GAAA,CAAAC,EAAA,CAAAC,MAAA,wIAAAC,GAAA,EAAAC,QAAA,EAAAC,SAAA,EAAAC,QAAA,EAAAC,kBAAA,EAAAC,UAAA;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,MAhjBMG,gBAAgB,GAAAV,sBAAA,CAAAF,kBAAA;EAAA,MAIhBa,QAAQ,GAAAX,sBAAA,CAAAD,UAAA;EAEf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAdA,MAgBqBa,gBAAgB,GAASF,gBAAgB,CAAAG,MAAA;IAE7CC,QAAQ,EAAoB;MAC3CC,OAAO,EAAE,cAAc;MACvBC,kBAAkB,EAAE,MAAM;MAC1BC,YAAY,EAAE;QACb;AACH;AACA;QACGC,IAAI,EAAE;UAAEC,IAAI,EAAE,kBAAkB;UAAEC,YAAY,EAAE,KAAK;UAAEC,QAAQ,EAAE,IAAI;UAAEC,UAAU,EAAE;QAAS;MAC7F;IACD,CAAC;IAED;AACD;AACA;AACA;AACA;AACA;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,oBAAoB,EAAE;QAC1BC,MAAM,CAACC,IAAI,CACV,IAAIhE,QAAQ,CAAC,GAAG,IAAI,CAACiE,MAAM,CAAC,CAAC,qBAAqBlB,KAAK,EAAE,EAAE;UAC1DmB,KAAK,EAAE,IAAI,CAAC5C,WAAW,CAACC,OAAO,CAAC,gBAAgB,CAAC;UACjD4C,IAAI,EAAE,yBAAyB;UAC/BC,KAAK,EAAGC,KAAK,IAAK;YACjB,KAAK,IAAI,CAACC,kBAAkB,CAACD,KAAK,CAAC;UACpC;QACD,CAAC,CACF,CAAC;MACF;MACA,OAAON,MAAM;IACd,CAAC;IAED;AACD;AACA;AACA;AACA;AACA;IACWQ,0BAA0B,WAAAC,4BAAA,EAAG;MACtC,MAAMC,kBAAkB,GAAAC,0DAAA,MAAqC;MAC7D;MACAD,kBAAkB,CAACE,cAAc,CAAC,IAAI,CAACrD,WAAW,CAACC,OAAO,CAAC,uBAAuB,CAAC,CAAC;MACpF,OAAOkD,kBAAkB;IAC1B;EAAC;EAAA,OApHmBxE,gBAAgB;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"FrequentAppPanel.js","names":["sap","ui","define","Log","EventBus","Container","EventHub","__BaseAppPersPanel","__MenuItem","___utils_FESRUtil","_interopRequireDefault","obj","__esModule","default","_catch","body","recover","result","e","then","BaseAppPersPanel","MenuItem","FESRNavigationSource","FrequentAppPanel","extend","metadata","library","defaultAggregation","aggregations","apps","type","singularName","multiple","visibility","constructor","_constructor","id","settings","BaseAppPersPanel.prototype.constructor.call","setSupported","init","_init","BaseAppPersPanel.prototype.init.call","setProperty","_i18nBundle","getText","_attachUserActivityTracking","on","do","refresh","oEventBus","getInstance","subscribe","channelId","eventId","data","item","color","_applyUngroupedTileColor","additionalInfo","fesrSource","FrequentlyUsed","loadApps","_loadApps","_this","Promise","resolve","_getFrequentVisualizations","frequentVisualizations","destroyAggregation","map","visualization","index","menuItems","_getActions","addedInFavorites","frequentApps","generateApps","setApps","reject","_this2","getServiceAsync","UserRecentsService","getFrequentActivity","frequentActivities","convertActivitiesToVisualizations","error","isAppAddedInFavorite","action","push","getKey","title","icon","press","event","_addAppToFavorites","generateIllustratedMessage","_generateIllustratedMessage","illustratedMessage","BaseAppPersPanel.prototype.generateIllustratedMessage.call","setDescription"],"sources":["FrequentAppPanel.ts"],"sourcesContent":["/*!\n * SAP UI development toolkit for HTML5 (SAPUI5)\n * * (c) Copyright 2009-2025 SAP SE. All rights reserved\n */\n\nimport Log from \"sap/base/Log\";\nimport type { MetadataOptions } from \"sap/ui/core/Element\";\nimport EventBus from \"sap/ui/core/EventBus\";\nimport Container from \"sap/ushell/Container\";\nimport EventHub from \"sap/ushell/EventHub\";\nimport UserRecents from \"sap/ushell/services/UserRecents\";\nimport App from \"./App\";\nimport BaseAppPersPanel from \"./BaseAppPersPanel\";\nimport type { $BasePanelSettings } from \"./BasePanel\";\nimport Group from \"./Group\";\nimport { IActivity } from \"./interface/AppsInterface\";\nimport MenuItem from \"./MenuItem\";\nimport { FESRNavigationSource } from \"./utils/FESRUtil\";\n\n/**\n *\n * Provides the class for managing frequent apps.\n *\n * @extends sap.cux.home.BaseAppPersPanel\n *\n * @author SAP SE\n * @version 0.0.1\n * @since 1.121.0\n *\n * @private\n * @ui5-restricted ux.eng.s4producthomes1\n *\n * @alias sap.cux.home.FrequentAppPanel\n */\n\nexport default class FrequentAppPanel extends BaseAppPersPanel {\n\tprivate oEventBus!: EventBus;\n\tstatic readonly metadata: MetadataOptions = {\n\t\tlibrary: \"sap.cux.home\",\n\t\tdefaultAggregation: \"apps\",\n\t\taggregations: {\n\t\t\t/**\n\t\t\t * Apps aggregation for Frequent apps\n\t\t\t */\n\t\t\tapps: { type: \"sap.cux.home.App\", singularName: \"app\", multiple: true, visibility: \"hidden\" }\n\t\t}\n\t};\n\n\t/**\n\t * Constructor for a new frequent app panel.\n\t *\n\t * @param {string} [id] ID for the new control, generated automatically if an ID is not provided\n\t * @param {object} [settings] Initial settings for the new control\n\t */\n\tpublic constructor(id?: string, settings?: $BasePanelSettings) {\n\t\tsuper(id, settings);\n\t\tthis.setSupported(false);\n\t}\n\n\tpublic init() {\n\t\tsuper.init();\n\t\tthis.setProperty(\"key\", \"frequentApps\");\n\t\tthis.setProperty(\"title\", this._i18nBundle.getText(\"frequentlyUsedTab\"));\n\t\tthis.setProperty(\"tooltip\", this._i18nBundle.getText(\"frequentlyUsedTabInfo\"));\n\t\tthis._attachUserActivityTracking();\n\t\tEventHub.on(\"userRecentsCleared\").do(() => {\n\t\t\tvoid this.refresh();\n\t\t});\n\n\t\tthis.oEventBus = EventBus.getInstance();\n\t\tthis.oEventBus.subscribe(\n\t\t\t\"appsChannel\",\n\t\t\t\"favAppColorChanged\",\n\t\t\t(channelId?: string, eventId?: string, data?) => {\n\t\t\t\tconst { item, color } = data as { item: App | Group; color: string };\n\t\t\t\t//update color of the app in most used apps\n\t\t\t\tthis._applyUngroupedTileColor(item, color);\n\t\t\t},\n\t\t\tthis\n\t\t);\n\t\tthis.additionalInfo = {\n\t\t\tfesrSource: FESRNavigationSource.FrequentlyUsed\n\t\t};\n\t}\n\n\t/**\n\t * Fetch frequent apps and set apps aggregation\n\t * @private\n\t */\n\tpublic async loadApps() {\n\t\tlet frequentVisualizations = await this._getFrequentVisualizations();\n\t\tthis.destroyAggregation(\"apps\", true);\n\t\tfrequentVisualizations = frequentVisualizations.map((visualization, index) => {\n\t\t\treturn {\n\t\t\t\t...visualization,\n\t\t\t\tmenuItems: this._getActions(visualization.addedInFavorites, index)\n\t\t\t};\n\t\t});\n\t\t//convert apps objects array to apps instances\n\t\tconst frequentApps = this.generateApps(frequentVisualizations);\n\t\tthis.setApps(frequentApps);\n\t}\n\n\t/**\n\t * Returns list of frequent apps\n\t * @private\n\t * @returns {object[]} - Array of frequent apps.\n\t */\n\tprivate async _getFrequentVisualizations() {\n\t\ttry {\n\t\t\tconst UserRecentsService = await Container.getServiceAsync<UserRecents>(\"UserRecents\");\n\t\t\tconst frequentActivities: IActivity[] = (await UserRecentsService?.getFrequentActivity()) || [];\n\t\t\t//convert activity to apps\n\t\t\tconst frequentVisualizations = await this.convertActivitiesToVisualizations(frequentActivities);\n\t\t\treturn frequentVisualizations;\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 list of actions available for selected app\n\t * @private\n\t * @param {boolean} isAppAddedInFavorite - true if app is already present in favorite, false otherwise.\n\t * @returns {sap.cux.home.MenuItem[]} - Array of list items.\n\t */\n\tprivate _getActions(isAppAddedInFavorite: boolean = false, index?: number) {\n\t\tconst action = [];\n\t\tif (!isAppAddedInFavorite) {\n\t\t\taction.push(\n\t\t\t\tnew MenuItem(`${this.getKey()}--addToFavorites--${index}`, {\n\t\t\t\t\ttitle: this._i18nBundle.getText(\"addToFavorites\"),\n\t\t\t\t\ticon: \"sap-icon://add-favorite\",\n\t\t\t\t\tpress: (event) => {\n\t\t\t\t\t\tvoid this._addAppToFavorites(event);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\t\treturn action;\n\t}\n\n\t/**\n\t * Generates illustrated message for frequent apps panel.\n\t * @private\n\t * @override\n\t * @returns {sap.m.IllustratedMessage} Illustrated error message.\n\t */\n\tprotected generateIllustratedMessage() {\n\t\tconst illustratedMessage = super.generateIllustratedMessage();\n\t\t//override the default description\n\t\tillustratedMessage.setDescription(this._i18nBundle.getText(\"noFreqAppsDescription\"));\n\t\treturn illustratedMessage;\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AAHAA,GAAA,CAAAC,EAAA,CAAAC,MAAA,4JAAAC,GAAA,EAAAC,QAAA,EAAAC,SAAA,EAAAC,QAAA,EAAAC,kBAAA,EAAAC,UAAA,EAAAC,iBAAA;EAAA;;EAAA,SAAAC,uBAAAC,GAAA;IAAA,OAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,CAAAE,OAAA,mBAAAF,GAAA,CAAAE,OAAA,G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AK,IAAK;YACjB,KAAK,IAAI,CAACC,kBAAkB,CAACD,KAAK,CAAC;UACpC;QACD,CAAC,CACF,CAAC;MACF;MACA,OAAON,MAAM;IACd,CAAC;IAED;AACD;AACA;AACA;AACA;AACA;IACWQ,0BAA0B,WAAAC,4BAAA,EAAG;MACtC,MAAMC,kBAAkB,GAAAC,0DAAA,MAAqC;MAC7D;MACAD,kBAAkB,CAACE,cAAc,CAAC,IAAI,CAACxD,WAAW,CAACC,OAAO,CAAC,uBAAuB,CAAC,CAAC;MACpF,OAAOqD,kBAAkB;IAC1B;EAAC;EAAA,OAvHmB3E,gBAAgB;AAAA","ignoreList":[]}
|
|
@@ -15,6 +15,7 @@ import type { $BasePanelSettings } from "./BasePanel";
|
|
|
15
15
|
import Group from "./Group";
|
|
16
16
|
import { IActivity } from "./interface/AppsInterface";
|
|
17
17
|
import MenuItem from "./MenuItem";
|
|
18
|
+
import { FESRNavigationSource } from "./utils/FESRUtil";
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
*
|
|
@@ -77,6 +78,9 @@ export default class FrequentAppPanel extends BaseAppPersPanel {
|
|
|
77
78
|
},
|
|
78
79
|
this
|
|
79
80
|
);
|
|
81
|
+
this.additionalInfo = {
|
|
82
|
+
fesrSource: FESRNavigationSource.FrequentlyUsed
|
|
83
|
+
};
|
|
80
84
|
}
|
|
81
85
|
|
|
82
86
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsightsAdditionPanel.d.ts","sourceRoot":"../../../../..","sources":["src/sap/cux/home/InsightsAdditionPanel.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,oCAAoC,CAAC;IAgBpD,OAAO,iBAAiB,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"InsightsAdditionPanel.d.ts","sourceRoot":"../../../../..","sources":["src/sap/cux/home/InsightsAdditionPanel.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,oCAAoC,CAAC;IAgBpD,OAAO,iBAAiB,MAAM,gCAAgC,CAAC;IAU/D;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,iBAAiB;QACnE,OAAO,CAAC,cAAc,CAAU;QAChC,OAAO,CAAC,kBAAkB,CAAuB;QACjD,OAAO,CAAC,gBAAgB,CAAW;QACnC,OAAO,CAAC,wBAAwB,CAAiB;QACjD;;;;;WAKG;QACI,IAAI;QAqBX;;;;WAIG;QACH,OAAO,CAAC,eAAe;QAIvB;;;;;;;;;WASG;gBACW,aAAa;QAgB3B;;;;;;WAMG;gBACW,0BAA0B;QASxC;;;;;WAKG;QACH,OAAO,CAAC,oBAAoB;QAK5B;;;;;;WAMG;QACU,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;QAqB5C;;;;;WAKG;QACH,OAAO,CAAC,gBAAgB;QAMxB;;;;;;;;;;WAUG;gBACW,eAAe;QAyB7B;;;;;WAKG;QACH,OAAO,CAAC,wBAAwB;KAIhC;CAEA"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
3
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
4
4
|
*/
|
|
5
|
-
sap.ui.define(["sap/base/Log", "sap/insights/CardHelper", "sap/m/Button", "sap/m/library", "sap/m/MessageBox", "sap/m/MessageToast", "sap/m/VBox", "./BaseSettingsPanel", "./CardsPanel", "./InsightsContainer", "./utils/Constants", "./utils/FeatureUtils", "./utils/FESRUtil"], function (Log, CardHelper, Button, sap_m_library, MessageBox, MessageToast, VBox, __BaseSettingsPanel, __CardsPanel, __InsightsContainer, ___utils_Constants, ___utils_FeatureUtils, ___utils_FESRUtil) {
|
|
5
|
+
sap.ui.define(["sap/base/Log", "sap/insights/CardHelper", "sap/m/Button", "sap/m/library", "sap/m/MessageBox", "sap/m/MessageToast", "sap/m/VBox", "./BaseSettingsPanel", "./CardsPanel", "./InsightsContainer", "./utils/Constants", "./utils/FeatureUtils", "./utils/FESRUtil", "./utils/PXFeedback"], function (Log, CardHelper, Button, sap_m_library, MessageBox, MessageToast, VBox, __BaseSettingsPanel, __CardsPanel, __InsightsContainer, ___utils_Constants, ___utils_FeatureUtils, ___utils_FESRUtil, ___utils_PXFeedback) {
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
8
|
function _interopRequireDefault(obj) {
|
|
@@ -41,6 +41,7 @@ sap.ui.define(["sap/base/Log", "sap/insights/CardHelper", "sap/m/Button", "sap/m
|
|
|
41
41
|
const isNavigationSupportedForFeature = ___utils_FeatureUtils["isNavigationSupportedForFeature"];
|
|
42
42
|
const addFESRSemanticStepName = ___utils_FESRUtil["addFESRSemanticStepName"];
|
|
43
43
|
const FESR_EVENTS = ___utils_FESRUtil["FESR_EVENTS"];
|
|
44
|
+
const triggerPXIntegration = ___utils_PXFeedback["triggerPXIntegration"];
|
|
44
45
|
/**
|
|
45
46
|
*
|
|
46
47
|
* Class for Apps Addition Panel in MyHome.
|
|
@@ -215,6 +216,7 @@ sap.ui.define(["sap/base/Log", "sap/insights/CardHelper", "sap/m/Button", "sap/m
|
|
|
215
216
|
onPressAddCards: function _onPressAddCards() {
|
|
216
217
|
try {
|
|
217
218
|
const _this4 = this;
|
|
219
|
+
triggerPXIntegration("addCardsButton");
|
|
218
220
|
const addContentDialog = _this4.getParent();
|
|
219
221
|
const _temp4 = _finallyRethrows(function () {
|
|
220
222
|
return _catch(function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsightsAdditionPanel.js","names":["sap","ui","define","Log","CardHelper","Button","sap_m_library","MessageBox","MessageToast","VBox","__BaseSettingsPanel","__CardsPanel","__InsightsContainer","___utils_Constants","___utils_FeatureUtils","___utils_FESRUtil","_interopRequireDefault","obj","__esModule","default","_catch","body","recover","result","e","then","BackgroundDesign","_finallyRethrows","finalizer","bind","ButtonType","BaseSettingsPanel","CardsPanel","InsightsContainer","CONTENT_ADDITION_PANEL_TYPES","FEATURE_TOGGLES","FESR_IDS","isNavigationSupportedForFeature","addFESRSemanticStepName","FESR_EVENTS","InsightsAdditionPanel","extend","init","_init","BaseSettingsPanel.prototype.init.call","setProperty","AI_INSIGHTS_CARDS","_i18nBundle","getText","addCardsButton","getId","text","type","Emphasized","enabled","press","onPressAddCards","PRESS","ADD_AI_CARD","addActionButton","_setupContent","attachEvent","resetAddCardInnerContent","enableAddButton","_enableAddButton","action","setEnabled","_this","_temp","Promise","resolve","_fetchAddCardDialogContent","dialogContent","wrapperVBox","items","backgroundDesign","Solid","height","addAggregation","error","message","reject","_this2","getServiceAsync","_getServiceAsync","cardHelperInstance","fetchAddCardInnerContent","event","_latestGeneratedManifest","getParameters","isValidManifest","Object","keys","length","getInsightsContainer","_getInsightsContainer","layout","getParent","getContent","find","container","isSupported","_isSupported","_this3","_temp3","isPanelSupported","removeActionButton","contentAdditionDialog","removePanel","updateActionButtons","insightsCardIntent","target","semanticObject","_temp2","undefined","AI_GENERATED_CARD","_isNavigationSupporte","_fetchCardsPanel","panel","_onPressAddCards","_this4","addContentDialog","_temp4","setBusy","_createCard","createdCardResponse","cardTitle","header","title","show","close","visible","information","styleClass","cardsPanel","refreshData","_wasThrown","_result","_resetAddCardInnerContent"],"sources":["InsightsAdditionPanel.ts"],"sourcesContent":["/*!\n * SAP UI development toolkit for HTML5 (SAPUI5)\n * * (c) Copyright 2009-2025 SAP SE. All rights reserved\n */\n\nimport Log from \"sap/base/Log\";\nimport CardHelper from \"sap/insights/CardHelper\";\nimport Button from \"sap/m/Button\";\nimport { BackgroundDesign, ButtonType } from \"sap/m/library\";\nimport MessageBox from \"sap/m/MessageBox\";\nimport MessageToast from \"sap/m/MessageToast\";\nimport VBox from \"sap/m/VBox\";\nimport Control from \"sap/ui/core/Control\";\nimport { Target } from \"sap/ushell/services/Navigation\";\nimport BaseLayout from \"./BaseLayout\";\nimport BaseSettingsPanel from \"./BaseSettingsPanel\";\nimport CardsPanel from \"./CardsPanel\";\nimport ContentAdditionDialog from \"./ContentAdditionDialog\";\nimport InsightsContainer from \"./InsightsContainer\";\nimport { ICardHelper, ICardHelperInstance, ICardManifest } from \"./interface/CardsInterface\";\nimport { CONTENT_ADDITION_PANEL_TYPES, FEATURE_TOGGLES, FESR_IDS } from \"./utils/Constants\";\nimport { isNavigationSupportedForFeature } from \"./utils/FeatureUtils\";\nimport { addFESRSemanticStepName, FESR_EVENTS } from \"./utils/FESRUtil\";\n\n/**\n *\n * Class for Apps Addition Panel in MyHome.\n *\n * @extends BaseSettingsPanel\n *\n * @author SAP SE\n * @version 0.0.1\n * @since 1.136\n * @private\n *\n * @alias sap.cux.home.InsightsAdditionPanel\n */\nexport default class InsightsAdditionPanel extends BaseSettingsPanel {\n\tprivate addCardsButton!: Button;\n\tprivate cardHelperInstance!: ICardHelperInstance;\n\tprivate isPanelSupported!: boolean;\n\tprivate _latestGeneratedManifest!: ICardManifest;\n\t/**\n\t * Init lifecycle method\n\t *\n\t * @public\n\t * @override\n\t */\n\tpublic init() {\n\t\tsuper.init();\n\n\t\t//setup panel\n\t\tthis.setProperty(\"key\", CONTENT_ADDITION_PANEL_TYPES.AI_INSIGHTS_CARDS);\n\t\tthis.setProperty(\"title\", this._i18nBundle.getText(\"insightsCards\"));\n\n\t\t//setup actions\n\t\tthis.addCardsButton = new Button(`${this.getId()}-add-cards-btn`, {\n\t\t\ttext: this._i18nBundle.getText(\"addFromInsightsDialogBtn\"),\n\t\t\ttype: ButtonType.Emphasized,\n\t\t\tenabled: false,\n\t\t\tpress: this.onPressAddCards.bind(this)\n\t\t});\n\t\taddFESRSemanticStepName(this.addCardsButton, FESR_EVENTS.PRESS, FESR_IDS.ADD_AI_CARD);\n\t\tthis.addActionButton(this.addCardsButton);\n\t\t//setup content\n\t\tvoid this._setupContent();\n\t\tthis.attachEvent(\"onDialogClose\", this.resetAddCardInnerContent.bind(this));\n\t}\n\n\t/**\n\t * Enables or disables the \"Add Cards\" button.\n\t *\n\t * @param {boolean} action - If true, the button is enabled; if false, it is disabled.\n\t */\n\tprivate enableAddButton(action: boolean) {\n\t\tthis.addCardsButton.setEnabled(action);\n\t}\n\n\t/**\n\t * It sets up the content for the \"Insights card\" dialog.\n\t * It fetches the inner dialog content for adding a card.\n\t * Adds the VBox to the panel's content aggregation.\n\t *\n\t * This also enables the \"Add\" button once content is fetched.\n\t *\n\t * @private\n\t * @returns {Promise<void>} A promise that resolves when setup is complete.\n\t */\n\tprivate async _setupContent(): Promise<void> {\n\t\ttry {\n\t\t\tconst dialogContent = await this._fetchAddCardDialogContent();\n\t\t\tif (dialogContent) {\n\t\t\t\tconst wrapperVBox = new VBox(`${this.getId()}-wrapperVBox`, {\n\t\t\t\t\titems: dialogContent,\n\t\t\t\t\tbackgroundDesign: BackgroundDesign.Solid,\n\t\t\t\t\theight: \"100%\"\n\t\t\t\t});\n\t\t\t\tthis.addAggregation(\"content\", wrapperVBox);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tLog.error((error as Error).message);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the dialog content for adding a new card and sets up the callback\n\t * to handle the card generation event, storing the generated manifest and enabling the add button.\n\t *\n\t * @private\n\t * @returns {Promise<Control[]>} A promise that resolves with an array of dialog content controls.\n\t */\n\tprivate async _fetchAddCardDialogContent(): Promise<Control[]> {\n\t\tthis.cardHelperInstance = await (CardHelper as ICardHelper).getServiceAsync();\n\t\treturn this.cardHelperInstance.fetchAddCardInnerContent((event) => {\n\t\t\tthis._latestGeneratedManifest = event.getParameters();\n\t\t\tconst isValidManifest = Object.keys(this._latestGeneratedManifest).length > 1;\n\t\t\tthis.enableAddButton(isValidManifest);\n\t\t});\n\t}\n\n\t/**\n\t * Retrieves the InsightsContainer instance from the parent layout.\n\t *\n\t * @private\n\t * @returns {InsightsContainer | undefined} The InsightsContainer instance or undefined if not found.\n\t */\n\tprivate getInsightsContainer(): InsightsContainer | undefined {\n\t\tconst layout = this.getParent()?.getParent() as BaseLayout;\n\t\treturn layout.getContent().find((container) => container instanceof InsightsContainer);\n\t}\n\n\t/**\n\t * Checks if the Insights Addition Panel is supported.\n\t *\n\t * @public\n\t * @async\n\t * @returns {Promise<boolean>} A promise that resolves to true if supported.\n\t */\n\tpublic async isSupported(): Promise<boolean> {\n\t\tconst insightsCardIntent: Target = {\n\t\t\ttarget: {\n\t\t\t\tsemanticObject: \"IntelligentPrompt\",\n\t\t\t\taction: \"personalize\"\n\t\t\t}\n\t\t};\n\t\tif (this.isPanelSupported === undefined) {\n\t\t\tthis.isPanelSupported = false;\n\t\t\tthis.isPanelSupported = await isNavigationSupportedForFeature(FEATURE_TOGGLES.AI_GENERATED_CARD, insightsCardIntent);\n\t\t}\n\t\t//remove panel if it's not supported\n\t\tif (!this.isPanelSupported) {\n\t\t\tthis.removeActionButton(this.addCardsButton);\n\t\t\tconst contentAdditionDialog = this.getParent() as ContentAdditionDialog;\n\t\t\tcontentAdditionDialog.removePanel(this);\n\t\t\tcontentAdditionDialog.updateActionButtons();\n\t\t}\n\t\treturn this.isPanelSupported;\n\t}\n\n\t/**\n\t * Retrieves the `CardsPanel` instance from the `InsightsContainer`.\n\t *\n\t * @private\n\t * @returns {CardsPanel | undefined} The found `CardsPanel` instance, or `undefined` if not found.\n\t */\n\tprivate _fetchCardsPanel(): CardsPanel | undefined {\n\t\treturn this.getInsightsContainer()\n\t\t\t?.getContent()\n\t\t\t.find((panel): panel is CardsPanel => panel instanceof CardsPanel);\n\t}\n\n\t/**\n\t * Handles the logic for creating and adding a new insight card to cards Panel.\n\t *\n\t * - Sets the dialog to busy while the card creation is in progress.\n\t * - It adds a new card using the latest generated manifest.\n\t * - On success, shows a message toast and closes the dialog.\n\t * - Refreshes the insights cards panel data.\n\t *\n\t * @private\n\t * @returns {Promise<void>} A promise that resolves when the card creation flow completes.\n\t */\n\tprivate async onPressAddCards() {\n\t\tconst addContentDialog = this.getParent() as ContentAdditionDialog;\n\t\ttry {\n\t\t\taddContentDialog.setBusy(true);\n\n\t\t\tconst createdCardResponse = await this.cardHelperInstance._createCard(this._latestGeneratedManifest);\n\t\t\tconst cardTitle = createdCardResponse[\"sap.card\"]?.header?.title;\n\t\t\tMessageToast.show(this._i18nBundle.getText(\"Card_Created\", [cardTitle]) as string);\n\t\t\taddContentDialog.close();\n\t\t\tif (!createdCardResponse?.[\"sap.insights\"]?.visible) {\n\t\t\t\tMessageBox.information(this._i18nBundle.getText(\"INT_CARD_LIMIT_MESSAGEBOX\") as string, {\n\t\t\t\t\tstyleClass: \"msgBoxAlign\"\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst cardsPanel = this._fetchCardsPanel();\n\t\t\tawait cardsPanel?.refreshData();\n\t\t} catch (error) {\n\t\t\tLog.error((error as Error).message);\n\t\t} finally {\n\t\t\taddContentDialog.setBusy(false);\n\t\t}\n\t}\n\n\t/**\n\t * Resets the internal content related to card addition.\n\t * Disables the \"Add\" button.\n\t *\n\t * @private\n\t */\n\tprivate resetAddCardInnerContent() {\n\t\tthis.cardHelperInstance?.resetAddCardInnerContent();\n\t\tthis.enableAddButton(false);\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AAHAA,GAAA,CAAAC,EAAA,CAAAC,MAAA,gRAAAC,GAAA,EAAAC,UAAA,EAAAC,MAAA,EAAAC,aAAA,EAAAC,UAAA,EAAAC,YAAA,EAAAC,IAAA,EAAAC,mBAAA,EAAAC,YAAA,EAAAC,mBAAA,EAAAC,kBAAA,EAAAC,qBAAA,EAAAC,iBAAA;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;IACl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H;cAEA,MAAMC,UAAU,GAAGd,MAAA,CAAKH,gBAAgB,CAAC,CAAC;cAAC,OAAAhD,OAAA,CAAAC,OAAA,CACrCgE,UAAU,EAAEC,WAAW,CAAC,CAAC,EAAA9G,IAAA;YAAA;UAChC,CAAC,YAAQsD,KAAK,EAAE;YACf5E,GAAG,CAAC4E,KAAK,CAAEA,KAAK,CAAWC,OAAO,CAAC;UACpC,CAAC;QAAA,aAAAwD,UAAA,EAAAC,OAAA;UACAhB,gBAAgB,CAACE,OAAO,CAAC,KAAK,CAAC;UAAC,IAAAa,UAAA,QAAAC,OAAA;UAAA,OAAAA,OAAA;QAAA;QAAA,OAAApE,OAAA,CAAAC,OAAA,CAAAoD,MAAA,IAAAA,MAAA,CAAAjG,IAAA,GAAAiG,MAAA,CAAAjG,IAAA;MAElC,CAAC,QAAAD,CAAA;QAAA,OAAA6C,OAAA,CAAAY,MAAA,CAAAzD,CAAA;MAAA;IAAA;IAED;AACD;AACA;AACA;AACA;AACA;IACSsC,wBAAwB,WAAA4E,0BAAA,EAAG;MAClC,IAAI,CAACrD,kBAAkB,EAAEvB,wBAAwB,CAAC,CAAC;MACnD,IAAI,CAACC,eAAe,CAAC,KAAK,CAAC;IAC5B;EAAC;EAAA,OAlLmBvB,qBAAqB;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"InsightsAdditionPanel.js","names":["sap","ui","define","Log","CardHelper","Button","sap_m_library","MessageBox","MessageToast","VBox","__BaseSettingsPanel","__CardsPanel","__InsightsContainer","___utils_Constants","___utils_FeatureUtils","___utils_FESRUtil","___utils_PXFeedback","_interopRequireDefault","obj","__esModule","default","_catch","body","recover","result","e","then","BackgroundDesign","_finallyRethrows","finalizer","bind","ButtonType","BaseSettingsPanel","CardsPanel","InsightsContainer","CONTENT_ADDITION_PANEL_TYPES","FEATURE_TOGGLES","FESR_IDS","isNavigationSupportedForFeature","addFESRSemanticStepName","FESR_EVENTS","triggerPXIntegration","InsightsAdditionPanel","extend","init","_init","BaseSettingsPanel.prototype.init.call","setProperty","AI_INSIGHTS_CARDS","_i18nBundle","getText","addCardsButton","getId","text","type","Emphasized","enabled","press","onPressAddCards","PRESS","ADD_AI_CARD","addActionButton","_setupContent","attachEvent","resetAddCardInnerContent","enableAddButton","_enableAddButton","action","setEnabled","_this","_temp","Promise","resolve","_fetchAddCardDialogContent","dialogContent","wrapperVBox","items","backgroundDesign","Solid","height","addAggregation","error","message","reject","_this2","getServiceAsync","_getServiceAsync","cardHelperInstance","fetchAddCardInnerContent","event","_latestGeneratedManifest","getParameters","isValidManifest","Object","keys","length","getInsightsContainer","_getInsightsContainer","layout","getParent","getContent","find","container","isSupported","_isSupported","_this3","_temp3","isPanelSupported","removeActionButton","contentAdditionDialog","removePanel","updateActionButtons","insightsCardIntent","target","semanticObject","_temp2","undefined","AI_GENERATED_CARD","_isNavigationSupporte","_fetchCardsPanel","panel","_onPressAddCards","_this4","addContentDialog","_temp4","setBusy","_createCard","createdCardResponse","cardTitle","header","title","show","close","visible","information","styleClass","cardsPanel","refreshData","_wasThrown","_result","_resetAddCardInnerContent"],"sources":["InsightsAdditionPanel.ts"],"sourcesContent":["/*!\n * SAP UI development toolkit for HTML5 (SAPUI5)\n * * (c) Copyright 2009-2025 SAP SE. All rights reserved\n */\n\nimport Log from \"sap/base/Log\";\nimport CardHelper from \"sap/insights/CardHelper\";\nimport Button from \"sap/m/Button\";\nimport { BackgroundDesign, ButtonType } from \"sap/m/library\";\nimport MessageBox from \"sap/m/MessageBox\";\nimport MessageToast from \"sap/m/MessageToast\";\nimport VBox from \"sap/m/VBox\";\nimport Control from \"sap/ui/core/Control\";\nimport { Target } from \"sap/ushell/services/Navigation\";\nimport BaseLayout from \"./BaseLayout\";\nimport BaseSettingsPanel from \"./BaseSettingsPanel\";\nimport CardsPanel from \"./CardsPanel\";\nimport ContentAdditionDialog from \"./ContentAdditionDialog\";\nimport InsightsContainer from \"./InsightsContainer\";\nimport { ICardHelper, ICardHelperInstance, ICardManifest } from \"./interface/CardsInterface\";\nimport { CONTENT_ADDITION_PANEL_TYPES, FEATURE_TOGGLES, FESR_IDS } from \"./utils/Constants\";\nimport { isNavigationSupportedForFeature } from \"./utils/FeatureUtils\";\nimport { addFESRSemanticStepName, FESR_EVENTS } from \"./utils/FESRUtil\";\nimport { triggerPXIntegration } from \"./utils/PXFeedback\";\n\n/**\n *\n * Class for Apps Addition Panel in MyHome.\n *\n * @extends BaseSettingsPanel\n *\n * @author SAP SE\n * @version 0.0.1\n * @since 1.136\n * @private\n *\n * @alias sap.cux.home.InsightsAdditionPanel\n */\nexport default class InsightsAdditionPanel extends BaseSettingsPanel {\n\tprivate addCardsButton!: Button;\n\tprivate cardHelperInstance!: ICardHelperInstance;\n\tprivate isPanelSupported!: boolean;\n\tprivate _latestGeneratedManifest!: ICardManifest;\n\t/**\n\t * Init lifecycle method\n\t *\n\t * @public\n\t * @override\n\t */\n\tpublic init() {\n\t\tsuper.init();\n\n\t\t//setup panel\n\t\tthis.setProperty(\"key\", CONTENT_ADDITION_PANEL_TYPES.AI_INSIGHTS_CARDS);\n\t\tthis.setProperty(\"title\", this._i18nBundle.getText(\"insightsCards\"));\n\n\t\t//setup actions\n\t\tthis.addCardsButton = new Button(`${this.getId()}-add-cards-btn`, {\n\t\t\ttext: this._i18nBundle.getText(\"addFromInsightsDialogBtn\"),\n\t\t\ttype: ButtonType.Emphasized,\n\t\t\tenabled: false,\n\t\t\tpress: this.onPressAddCards.bind(this)\n\t\t});\n\t\taddFESRSemanticStepName(this.addCardsButton, FESR_EVENTS.PRESS, FESR_IDS.ADD_AI_CARD);\n\t\tthis.addActionButton(this.addCardsButton);\n\t\t//setup content\n\t\tvoid this._setupContent();\n\t\tthis.attachEvent(\"onDialogClose\", this.resetAddCardInnerContent.bind(this));\n\t}\n\n\t/**\n\t * Enables or disables the \"Add Cards\" button.\n\t *\n\t * @param {boolean} action - If true, the button is enabled; if false, it is disabled.\n\t */\n\tprivate enableAddButton(action: boolean) {\n\t\tthis.addCardsButton.setEnabled(action);\n\t}\n\n\t/**\n\t * It sets up the content for the \"Insights card\" dialog.\n\t * It fetches the inner dialog content for adding a card.\n\t * Adds the VBox to the panel's content aggregation.\n\t *\n\t * This also enables the \"Add\" button once content is fetched.\n\t *\n\t * @private\n\t * @returns {Promise<void>} A promise that resolves when setup is complete.\n\t */\n\tprivate async _setupContent(): Promise<void> {\n\t\ttry {\n\t\t\tconst dialogContent = await this._fetchAddCardDialogContent();\n\t\t\tif (dialogContent) {\n\t\t\t\tconst wrapperVBox = new VBox(`${this.getId()}-wrapperVBox`, {\n\t\t\t\t\titems: dialogContent,\n\t\t\t\t\tbackgroundDesign: BackgroundDesign.Solid,\n\t\t\t\t\theight: \"100%\"\n\t\t\t\t});\n\t\t\t\tthis.addAggregation(\"content\", wrapperVBox);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tLog.error((error as Error).message);\n\t\t}\n\t}\n\n\t/**\n\t * Fetches the dialog content for adding a new card and sets up the callback\n\t * to handle the card generation event, storing the generated manifest and enabling the add button.\n\t *\n\t * @private\n\t * @returns {Promise<Control[]>} A promise that resolves with an array of dialog content controls.\n\t */\n\tprivate async _fetchAddCardDialogContent(): Promise<Control[]> {\n\t\tthis.cardHelperInstance = await (CardHelper as ICardHelper).getServiceAsync();\n\t\treturn this.cardHelperInstance.fetchAddCardInnerContent((event) => {\n\t\t\tthis._latestGeneratedManifest = event.getParameters();\n\t\t\tconst isValidManifest = Object.keys(this._latestGeneratedManifest).length > 1;\n\t\t\tthis.enableAddButton(isValidManifest);\n\t\t});\n\t}\n\n\t/**\n\t * Retrieves the InsightsContainer instance from the parent layout.\n\t *\n\t * @private\n\t * @returns {InsightsContainer | undefined} The InsightsContainer instance or undefined if not found.\n\t */\n\tprivate getInsightsContainer(): InsightsContainer | undefined {\n\t\tconst layout = this.getParent()?.getParent() as BaseLayout;\n\t\treturn layout.getContent().find((container) => container instanceof InsightsContainer);\n\t}\n\n\t/**\n\t * Checks if the Insights Addition Panel is supported.\n\t *\n\t * @public\n\t * @async\n\t * @returns {Promise<boolean>} A promise that resolves to true if supported.\n\t */\n\tpublic async isSupported(): Promise<boolean> {\n\t\tconst insightsCardIntent: Target = {\n\t\t\ttarget: {\n\t\t\t\tsemanticObject: \"IntelligentPrompt\",\n\t\t\t\taction: \"personalize\"\n\t\t\t}\n\t\t};\n\t\tif (this.isPanelSupported === undefined) {\n\t\t\tthis.isPanelSupported = false;\n\t\t\tthis.isPanelSupported = await isNavigationSupportedForFeature(FEATURE_TOGGLES.AI_GENERATED_CARD, insightsCardIntent);\n\t\t}\n\t\t//remove panel if it's not supported\n\t\tif (!this.isPanelSupported) {\n\t\t\tthis.removeActionButton(this.addCardsButton);\n\t\t\tconst contentAdditionDialog = this.getParent() as ContentAdditionDialog;\n\t\t\tcontentAdditionDialog.removePanel(this);\n\t\t\tcontentAdditionDialog.updateActionButtons();\n\t\t}\n\t\treturn this.isPanelSupported;\n\t}\n\n\t/**\n\t * Retrieves the `CardsPanel` instance from the `InsightsContainer`.\n\t *\n\t * @private\n\t * @returns {CardsPanel | undefined} The found `CardsPanel` instance, or `undefined` if not found.\n\t */\n\tprivate _fetchCardsPanel(): CardsPanel | undefined {\n\t\treturn this.getInsightsContainer()\n\t\t\t?.getContent()\n\t\t\t.find((panel): panel is CardsPanel => panel instanceof CardsPanel);\n\t}\n\n\t/**\n\t * Handles the logic for creating and adding a new insight card to cards Panel.\n\t *\n\t * - Sets the dialog to busy while the card creation is in progress.\n\t * - It adds a new card using the latest generated manifest.\n\t * - On success, shows a message toast and closes the dialog.\n\t * - Refreshes the insights cards panel data.\n\t *\n\t * @private\n\t * @returns {Promise<void>} A promise that resolves when the card creation flow completes.\n\t */\n\tprivate async onPressAddCards() {\n\t\ttriggerPXIntegration(\"addCardsButton\");\n\t\tconst addContentDialog = this.getParent() as ContentAdditionDialog;\n\t\ttry {\n\t\t\taddContentDialog.setBusy(true);\n\n\t\t\tconst createdCardResponse = await this.cardHelperInstance._createCard(this._latestGeneratedManifest);\n\t\t\tconst cardTitle = createdCardResponse[\"sap.card\"]?.header?.title;\n\t\t\tMessageToast.show(this._i18nBundle.getText(\"Card_Created\", [cardTitle]) as string);\n\t\t\taddContentDialog.close();\n\t\t\tif (!createdCardResponse?.[\"sap.insights\"]?.visible) {\n\t\t\t\tMessageBox.information(this._i18nBundle.getText(\"INT_CARD_LIMIT_MESSAGEBOX\") as string, {\n\t\t\t\t\tstyleClass: \"msgBoxAlign\"\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst cardsPanel = this._fetchCardsPanel();\n\t\t\tawait cardsPanel?.refreshData();\n\t\t} catch (error) {\n\t\t\tLog.error((error as Error).message);\n\t\t} finally {\n\t\t\taddContentDialog.setBusy(false);\n\t\t}\n\t}\n\n\t/**\n\t * Resets the internal content related to card addition.\n\t * Disables the \"Add\" button.\n\t *\n\t * @private\n\t */\n\tprivate resetAddCardInnerContent() {\n\t\tthis.cardHelperInstance?.resetAddCardInnerContent();\n\t\tthis.enableAddButton(false);\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AAHAA,GAAA,CAAAC,EAAA,CAAAC,MAAA,sSAAAC,GAAA,EAAAC,UAAA,EAAAC,MAAA,EAAAC,aAAA,EAAAC,UAAA,EAAAC,YAAA,EAAAC,IAAA,EAAAC,mBAAA,EAAAC,YAAA,EAAAC,mBAAA,EAAAC,kBAAA,EAAAC,qBAAA,EAAAC,iBAAA,EAAAC,mBAAA;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;IACl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AW,CAACC,OAAO,CAAC,2BAA2B,CAAC,EAAY;kBACvFqF,UAAU,EAAE;gBACb,CAAC,CAAC;cACH;cAEA,MAAMC,UAAU,GAAGd,MAAA,CAAKH,gBAAgB,CAAC,CAAC;cAAC,OAAAhD,OAAA,CAAAC,OAAA,CACrCgE,UAAU,EAAEC,WAAW,CAAC,CAAC,EAAA/G,IAAA;YAAA;UAChC,CAAC,YAAQuD,KAAK,EAAE;YACf9E,GAAG,CAAC8E,KAAK,CAAEA,KAAK,CAAWC,OAAO,CAAC;UACpC,CAAC;QAAA,aAAAwD,UAAA,EAAAC,OAAA;UACAhB,gBAAgB,CAACE,OAAO,CAAC,KAAK,CAAC;UAAC,IAAAa,UAAA,QAAAC,OAAA;UAAA,OAAAA,OAAA;QAAA;QAAA,OAAApE,OAAA,CAAAC,OAAA,CAAAoD,MAAA,IAAAA,MAAA,CAAAlG,IAAA,GAAAkG,MAAA,CAAAlG,IAAA;MAElC,CAAC,QAAAD,CAAA;QAAA,OAAA8C,OAAA,CAAAY,MAAA,CAAA1D,CAAA;MAAA;IAAA;IAED;AACD;AACA;AACA;AACA;AACA;IACSuC,wBAAwB,WAAA4E,0BAAA,EAAG;MAClC,IAAI,CAACrD,kBAAkB,EAAEvB,wBAAwB,CAAC,CAAC;MACnD,IAAI,CAACC,eAAe,CAAC,KAAK,CAAC;IAC5B;EAAC;EAAA,OAnLmBvB,qBAAqB;AAAA","ignoreList":[]}
|
|
@@ -21,6 +21,7 @@ import { ICardHelper, ICardHelperInstance, ICardManifest } from "./interface/Car
|
|
|
21
21
|
import { CONTENT_ADDITION_PANEL_TYPES, FEATURE_TOGGLES, FESR_IDS } from "./utils/Constants";
|
|
22
22
|
import { isNavigationSupportedForFeature } from "./utils/FeatureUtils";
|
|
23
23
|
import { addFESRSemanticStepName, FESR_EVENTS } from "./utils/FESRUtil";
|
|
24
|
+
import { triggerPXIntegration } from "./utils/PXFeedback";
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
27
|
*
|
|
@@ -181,6 +182,7 @@ export default class InsightsAdditionPanel extends BaseSettingsPanel {
|
|
|
181
182
|
* @returns {Promise<void>} A promise that resolves when the card creation flow completes.
|
|
182
183
|
*/
|
|
183
184
|
private async onPressAddCards() {
|
|
185
|
+
triggerPXIntegration("addCardsButton");
|
|
184
186
|
const addContentDialog = this.getParent() as ContentAdditionDialog;
|
|
185
187
|
try {
|
|
186
188
|
addContentDialog.setBusy(true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsightsContainer.d.ts","sourceRoot":"../../../../..","sources":["src/sap/cux/home/InsightsContainer.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,gCAAgC,CAAC;IAChD;;;OAGG;IAEH,OAAO,MAAM,MAAM,cAAc,CAAC;IAClC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;IACzE,OAAO,aAAa,MAAM,4BAA4B,CAAC;IACvD,OAAO,SAAS,MAAM,wBAAwB,CAAC;IAC/C,OAAO,UAAU,EAAE,EAA+B,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"InsightsContainer.d.ts","sourceRoot":"../../../../..","sources":["src/sap/cux/home/InsightsContainer.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,gCAAgC,CAAC;IAChD;;;OAGG;IAEH,OAAO,MAAM,MAAM,cAAc,CAAC;IAClC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;IACzE,OAAO,aAAa,MAAM,4BAA4B,CAAC;IACvD,OAAO,SAAS,MAAM,wBAAwB,CAAC;IAC/C,OAAO,UAAU,EAAE,EAA+B,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;IAE3G,OAAO,QAAQ,MAAM,uBAAuB,CAAC;IAE7C,OAAO,UAAU,EAAE,EAA+B,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;IAK3G,MAAM,cAAc,EAAE,MAAkC,CAAC;IACzD,MAA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B;QAU7B;;;;;WAKG;QACI,YAAY;QAoBnB;;;;WAIG;QACI,kBAAkB,CAAC,SAAS,GAAE,QAAQ,EAAO;QAMpD;;;;WAIG;QACI,sBAAsB,CAAC,aAAa,GAAE,MAAM,EAAO;QAI1D;;;;;;;WAOG;QACI,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE;YAAE,MAAM,EAAE,OAAO,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE;QAQlF;;;;;;WAMG;QACI,kBAAkB,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM;QAQjF;;;;;;WAMG;QACI,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM;QAQ3E;;;;;WAKG;QACH,OAAO,CAAC,oBAAoB;QAI5B;;;;;WAKG;QACH,OAAO,CAAC,yBAAyB;QAGjC;;;;;WAKG;QACH,OAAO,CAAC,cAAc;QAOtB;;;;WAIG;QACH,SAAS,CAAC,4BAA4B,IAAI,MAAM;QAIhD;;;;;WAKG;QACU,WAAW,CAAC,GAAG,EAAE,MAAM;KAIpC;CAEA"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
3
|
* * (c) Copyright 2009-2025 SAP SE. All rights reserved
|
|
4
4
|
*/
|
|
5
|
-
sap.ui.define(["./BaseContainer", "./CardsPanel", "./ErrorPanel", "./
|
|
5
|
+
sap.ui.define(["./BaseContainer", "./CardsPanel", "./ErrorPanel", "./SpaceInsightsPanel", "./TilesPanel", "./utils/Device", "./utils/InsightsUtils", "./utils/placeholder/InsightsPlaceholder"], function (__BaseContainer, __CardsPanel, __ErrorPanel, __SpaceInsightsPanel, __TilesPanel, ___utils_Device, ___utils_InsightsUtils, ___utils_placeholder_InsightsPlaceholder) {
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
8
|
function _interopRequireDefault(obj) {
|
|
@@ -13,13 +13,13 @@ sap.ui.define(["./BaseContainer", "./CardsPanel", "./ErrorPanel", "./utils/place
|
|
|
13
13
|
const cardsContainerActionButtons = __CardsPanel["cardsContainerActionButtons"];
|
|
14
14
|
const cardsContainerMenuItems = __CardsPanel["cardsContainerMenuItems"];
|
|
15
15
|
const ErrorPanel = _interopRequireDefault(__ErrorPanel);
|
|
16
|
-
const getInsightsPlaceholder = ___utils_placeholder_InsightsPlaceholder["getInsightsPlaceholder"];
|
|
17
16
|
const SpaceInsightsPanel = _interopRequireDefault(__SpaceInsightsPanel);
|
|
18
17
|
const TilesPanel = _interopRequireDefault(__TilesPanel);
|
|
19
18
|
const tilesContainerActionButtons = __TilesPanel["tilesContainerActionButtons"];
|
|
20
19
|
const tilesContainerMenuItems = __TilesPanel["tilesContainerMenuItems"];
|
|
21
20
|
const DeviceType = ___utils_Device["DeviceType"];
|
|
22
21
|
const sortMenuItems = ___utils_InsightsUtils["sortMenuItems"];
|
|
22
|
+
const getInsightsPlaceholder = ___utils_placeholder_InsightsPlaceholder["getInsightsPlaceholder"];
|
|
23
23
|
const tilesPanelName = "sap.cux.home.TilesPanel";
|
|
24
24
|
const cardsPanelName = "sap.cux.home.CardsPanel";
|
|
25
25
|
const spaceInsightsPanelName = "sap.cux.home.SpaceInsightsPanel";
|