@sapui5/sap.cux.home 1.141.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 +0 -1
- package/src/sap/cux/home/AdvancedSettingsPanel.js.map +1 -1
- package/src/sap/cux/home/AdvancedSettingsPanel.ts +0 -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 +59 -58
- package/src/sap/cux/home/AppsAdditionPanel.js.map +1 -1
- package/src/sap/cux/home/AppsAdditionPanel.ts +39 -33
- 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 +30 -16
- package/src/sap/cux/home/AppsContainer.js.map +1 -1
- package/src/sap/cux/home/AppsContainer.ts +29 -13
- 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 +2 -1
- package/src/sap/cux/home/BaseAppPanel.js.map +1 -1
- package/src/sap/cux/home/BaseAppPanel.ts +4 -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/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/CardsPanel.d.ts +7 -0
- package/src/sap/cux/home/CardsPanel.d.ts.map +1 -1
- package/src/sap/cux/home/CardsPanel.js +130 -111
- package/src/sap/cux/home/CardsPanel.js.map +1 -1
- package/src/sap/cux/home/CardsPanel.ts +17 -6
- 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/FavAppPanel.d.ts +0 -10
- package/src/sap/cux/home/FavAppPanel.d.ts.map +1 -1
- package/src/sap/cux/home/FavAppPanel.js +258 -313
- package/src/sap/cux/home/FavAppPanel.js.map +1 -1
- package/src/sap/cux/home/FavAppPanel.ts +7 -56
- 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/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 +90 -57
- package/src/sap/cux/home/NewsPanel.js.map +1 -1
- package/src/sap/cux/home/NewsPanel.ts +50 -22
- 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 +1 -1
- package/src/sap/cux/home/PagePanel.js.map +1 -1
- package/src/sap/cux/home/PagePanel.ts +2 -6
- 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/SideBySideIconTabFilter.d.ts +10 -0
- package/src/sap/cux/home/SideBySideIconTabFilter.d.ts.map +1 -1
- package/src/sap/cux/home/SideBySideIconTabFilter.js +11 -1
- package/src/sap/cux/home/SideBySideIconTabFilter.js.map +1 -1
- package/src/sap/cux/home/SideBySideIconTabFilter.ts +11 -0
- 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 +12 -6
- package/src/sap/cux/home/i18n/messagebundle_pt.properties +1 -1
- 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/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/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/fragment/appsAdditionContent.fragment.xml +1 -1
|
@@ -1603,7 +1603,6 @@ export default class AdvancedSettingsPanel extends BaseSettingsPanel {
|
|
|
1603
1603
|
|
|
1604
1604
|
private onResetImportApps(): void {
|
|
1605
1605
|
this.oEventBus.publish("importChannel", "resetImported");
|
|
1606
|
-
MessageToast.show(this._i18nBundle.getText("importAppsNowBtnEnabled") as string);
|
|
1607
1606
|
}
|
|
1608
1607
|
|
|
1609
1608
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"../../../../..","sources":["src/sap/cux/home/App.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,kBAAkB,CAAC;IAOlC,OAAoB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;IAGxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;IAG3D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;IAChD,OAAO,OAAO,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"../../../../..","sources":["src/sap/cux/home/App.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,kBAAkB,CAAC;IAOlC,OAAoB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;IAGxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;IAG3D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;IAChD,OAAO,OAAO,MAAM,sBAAsB,CAAC;IAK3C;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,OAAO;oBAC3B,YAAY,CAAC,EAAE,MAAM,GAAG,YAAY;oBACpC,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,YAAY;QAUhD,OAAO,CAAC,kBAAkB,CAAc;QACxC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAYvC;QAEF,OAAO,CAAC,kBAAkB;QAS1B,OAAO,CAAC,oBAAoB;QAuB5B;;;WAGG;gBACW,UAAU;QAwBxB;;;WAGG;QACU,YAAY,CAAC,KAAK,EAAE,sBAAsB;KASvD;CAEA"}
|
package/src/sap/cux/home/App.js
CHANGED
|
@@ -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/m/GenericTile", "sap/m/library", "sap/ushell/Container", "./BaseApp", "./utils/AppManager"], function (Log, GenericTile, mobileLibrary, Container, __BaseApp, __AppManager) {
|
|
5
|
+
sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/library", "sap/ushell/Container", "./BaseApp", "./utils/AppManager", "./utils/FESRUtil"], function (Log, GenericTile, mobileLibrary, Container, __BaseApp, __AppManager, ___utils_FESRUtil) {
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
8
|
function _interopRequireDefault(obj) {
|
|
@@ -10,6 +10,7 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/library", "sap/ushell
|
|
|
10
10
|
}
|
|
11
11
|
const BaseApp = _interopRequireDefault(__BaseApp);
|
|
12
12
|
const AppManager = _interopRequireDefault(__AppManager);
|
|
13
|
+
const addFESRNavigationSource = ___utils_FESRUtil["addFESRNavigationSource"];
|
|
13
14
|
/**
|
|
14
15
|
*
|
|
15
16
|
* App class for managing and storing Apps.
|
|
@@ -123,6 +124,10 @@ sap.ui.define(["sap/base/Log", "sap/m/GenericTile", "sap/m/library", "sap/ushell
|
|
|
123
124
|
const _this2 = this;
|
|
124
125
|
const _temp = function () {
|
|
125
126
|
if (_this2.getUrl()) {
|
|
127
|
+
const navInfo = _this2.data("additionalInfo");
|
|
128
|
+
if (navInfo?.fesrSource) {
|
|
129
|
+
addFESRNavigationSource(navInfo.fesrSource);
|
|
130
|
+
}
|
|
126
131
|
return Promise.resolve(_this2._launchApp(event)).then(function () {});
|
|
127
132
|
}
|
|
128
133
|
}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.js","names":["sap","ui","define","Log","GenericTile","mobileLibrary","Container","__BaseApp","__AppManager","_interopRequireDefault","obj","__esModule","default","BaseApp","AppManager","App","extend","metadata","library","properties","url","type","group","defaultValue","vizId","constructor","_constructor","id","settings","BaseApp.prototype.constructor.call","_getSSBRootControl","oSmartBusinessAppViz","getContent","getComponentInstance","getRootControl","oError","error","Error","message","String","_getInnerGenericTile","oControl","oControlMetadata","getMetadata","oDefaultAggregationDefinition","getDefaultAggregation","sDefaultAggregationName","name","aAggregationData","getAggregation","oAggregationValue","Array","isArray","getState","LoadState","Loaded","_launchApp","event","_this","appManagerInstance","getInstance","tile","getSource","Promise","resolve","fetchFavVizs","then","favoriteApps","selectedApp","find","app","appUrl","getUrl","includes","smartBusinessAppViz","vizInstance","isSmartBusinessTile","ssbRootControl","ssbGenericTile","firePress","getServiceAsync","spaceContentService","launchTileTarget","getTitle","e","reject","_handlePress","_this2","_temp"],"sources":["App.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 GenericTile, { GenericTile$PressEvent } from \"sap/m/GenericTile\";\nimport mobileLibrary from \"sap/m/library\";\nimport Control from \"sap/ui/core/Control\";\nimport type { MetadataOptions } from \"sap/ui/core/Element\";\nimport Container from \"sap/ushell/Container\";\nimport SpaceContent from \"sap/ushell/services/SpaceContent\";\nimport { $AppSettings } from \"./App\";\nimport BaseApp from \"./BaseApp\";\nimport { ICustomVizInstance, ISectionAndVisualization } from \"./interface/AppsInterface\";\nimport AppManager from \"./utils/AppManager\";\n\n/**\n *\n * App class for managing and storing Apps.\n *\n * @extends sap.cux.home.BaseApp\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.App\n */\nexport default class App extends BaseApp {\n\tconstructor(idOrSettings?: string | $AppSettings);\n\tconstructor(id?: string, settings?: $AppSettings);\n\t/**\n\t * Constructor for a new App.\n\t *\n\t * @param {string} [id] ID for the new app, generated automatically if an ID is not provided\n\t * @param {object} [settings] Initial settings for the new app\n\t */\n\tpublic constructor(id?: string, settings?: $AppSettings) {\n\t\tsuper(id, settings);\n\t}\n\tprivate appManagerInstance!: AppManager;\n\tstatic readonly metadata: MetadataOptions = {\n\t\tlibrary: \"sap.cux.home\",\n\t\tproperties: {\n\t\t\t/**\n\t\t\t * Url of the app where the user navigates to on click\n\t\t\t */\n\t\t\turl: { type: \"string\", group: \"Misc\", defaultValue: \"\" },\n\t\t\t/**\n\t\t\t * VizId of the app. Used for enabling addition of apps to FavoriteApp panel\n\t\t\t */\n\t\t\tvizId: { type: \"string\", group: \"Misc\", defaultValue: \"\" }\n\t\t}\n\t};\n\tprivate _getSSBRootControl(oSmartBusinessAppViz: ICustomVizInstance): Control | null {\n\t\ttry {\n\t\t\treturn oSmartBusinessAppViz.getContent().getComponentInstance().getRootControl() as Control | null;\n\t\t} catch (oError) {\n\t\t\tLog.error(oError instanceof Error ? oError.message : String(oError));\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tprivate _getInnerGenericTile(oControl: Control | null): GenericTile | null {\n\t\tif (!oControl) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst oControlMetadata = oControl.getMetadata();\n\t\tconst oDefaultAggregationDefinition = oControlMetadata.getDefaultAggregation() as { name?: string } | null;\n\t\tconst sDefaultAggregationName = oDefaultAggregationDefinition ? oDefaultAggregationDefinition?.name : \"content\";\n\n\t\tconst aAggregationData = sDefaultAggregationName ? oControl.getAggregation(sDefaultAggregationName) : null;\n\t\tconst oAggregationValue = Array.isArray(aAggregationData) ? aAggregationData[0] : aAggregationData;\n\n\t\tif (!oAggregationValue) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (oAggregationValue instanceof GenericTile && oAggregationValue.getState() === mobileLibrary.LoadState.Loaded) {\n\t\t\treturn oAggregationValue;\n\t\t}\n\n\t\treturn this._getInnerGenericTile(oAggregationValue as Control);\n\t}\n\n\t/**\n\t * Navigates to the clicked app\n\t * @private\n\t */\n\tprivate async _launchApp(event: GenericTile$PressEvent): Promise<void> {\n\t\tthis.appManagerInstance = this.appManagerInstance || AppManager.getInstance();\n\t\tconst tile = event.getSource();\n\t\tconst favoriteApps: ISectionAndVisualization[] = await this.appManagerInstance.fetchFavVizs(false, true);\n\t\tconst selectedApp = favoriteApps.find((app) => {\n\t\t\tconst appUrl = app.url || \"\";\n\t\t\treturn tile.getUrl().includes(appUrl);\n\t\t});\n\t\tconst smartBusinessAppViz = selectedApp?.vizInstance;\n\t\tconst isSmartBusinessTile = selectedApp?.isSmartBusinessTile;\n\t\tif (smartBusinessAppViz) {\n\t\t\tconst ssbRootControl = this._getSSBRootControl(smartBusinessAppViz);\n\t\t\tconst ssbGenericTile = isSmartBusinessTile && this._getInnerGenericTile(ssbRootControl);\n\n\t\t\tif (ssbGenericTile) {\n\t\t\t\tssbGenericTile.firePress();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// Fallback in case smartBusinessAppViz is undefined or ssbGenericTile is not present\n\t\tconst spaceContentService = await Container.getServiceAsync<SpaceContent>(\"SpaceContent\");\n\t\tawait spaceContentService.launchTileTarget(this.getUrl(), this.getTitle());\n\t}\n\n\t/**\n\t * App Press Handler\n\t * @private\n\t */\n\tpublic async _handlePress(event: GenericTile$PressEvent) {\n\t\tif (this.getUrl()) {\n\t\t\tawait this._launchApp(event);\n\t\t}\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AAHAA,GAAA,CAAAC,EAAA,CAAAC,MAAA,
|
|
1
|
+
{"version":3,"file":"App.js","names":["sap","ui","define","Log","GenericTile","mobileLibrary","Container","__BaseApp","__AppManager","___utils_FESRUtil","_interopRequireDefault","obj","__esModule","default","BaseApp","AppManager","addFESRNavigationSource","App","extend","metadata","library","properties","url","type","group","defaultValue","vizId","constructor","_constructor","id","settings","BaseApp.prototype.constructor.call","_getSSBRootControl","oSmartBusinessAppViz","getContent","getComponentInstance","getRootControl","oError","error","Error","message","String","_getInnerGenericTile","oControl","oControlMetadata","getMetadata","oDefaultAggregationDefinition","getDefaultAggregation","sDefaultAggregationName","name","aAggregationData","getAggregation","oAggregationValue","Array","isArray","getState","LoadState","Loaded","_launchApp","event","_this","appManagerInstance","getInstance","tile","getSource","Promise","resolve","fetchFavVizs","then","favoriteApps","selectedApp","find","app","appUrl","getUrl","includes","smartBusinessAppViz","vizInstance","isSmartBusinessTile","ssbRootControl","ssbGenericTile","firePress","getServiceAsync","spaceContentService","launchTileTarget","getTitle","e","reject","_handlePress","_this2","_temp","navInfo","data","fesrSource"],"sources":["App.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 GenericTile, { GenericTile$PressEvent } from \"sap/m/GenericTile\";\nimport mobileLibrary from \"sap/m/library\";\nimport Control from \"sap/ui/core/Control\";\nimport type { MetadataOptions } from \"sap/ui/core/Element\";\nimport Container from \"sap/ushell/Container\";\nimport SpaceContent from \"sap/ushell/services/SpaceContent\";\nimport { $AppSettings } from \"./App\";\nimport BaseApp from \"./BaseApp\";\nimport { IAdditionalInfo, ICustomVizInstance, ISectionAndVisualization } from \"./interface/AppsInterface\";\nimport AppManager from \"./utils/AppManager\";\nimport { addFESRNavigationSource } from \"./utils/FESRUtil\";\n\n/**\n *\n * App class for managing and storing Apps.\n *\n * @extends sap.cux.home.BaseApp\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.App\n */\nexport default class App extends BaseApp {\n\tconstructor(idOrSettings?: string | $AppSettings);\n\tconstructor(id?: string, settings?: $AppSettings);\n\t/**\n\t * Constructor for a new App.\n\t *\n\t * @param {string} [id] ID for the new app, generated automatically if an ID is not provided\n\t * @param {object} [settings] Initial settings for the new app\n\t */\n\tpublic constructor(id?: string, settings?: $AppSettings) {\n\t\tsuper(id, settings);\n\t}\n\tprivate appManagerInstance!: AppManager;\n\tstatic readonly metadata: MetadataOptions = {\n\t\tlibrary: \"sap.cux.home\",\n\t\tproperties: {\n\t\t\t/**\n\t\t\t * Url of the app where the user navigates to on click\n\t\t\t */\n\t\t\turl: { type: \"string\", group: \"Misc\", defaultValue: \"\" },\n\t\t\t/**\n\t\t\t * VizId of the app. Used for enabling addition of apps to FavoriteApp panel\n\t\t\t */\n\t\t\tvizId: { type: \"string\", group: \"Misc\", defaultValue: \"\" }\n\t\t}\n\t};\n\n\tprivate _getSSBRootControl(oSmartBusinessAppViz: ICustomVizInstance): Control | null {\n\t\ttry {\n\t\t\treturn oSmartBusinessAppViz.getContent().getComponentInstance().getRootControl() as Control | null;\n\t\t} catch (oError) {\n\t\t\tLog.error(oError instanceof Error ? oError.message : String(oError));\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tprivate _getInnerGenericTile(oControl: Control | null): GenericTile | null {\n\t\tif (!oControl) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst oControlMetadata = oControl.getMetadata();\n\t\tconst oDefaultAggregationDefinition = oControlMetadata.getDefaultAggregation() as { name?: string } | null;\n\t\tconst sDefaultAggregationName = oDefaultAggregationDefinition ? oDefaultAggregationDefinition?.name : \"content\";\n\n\t\tconst aAggregationData = sDefaultAggregationName ? oControl.getAggregation(sDefaultAggregationName) : null;\n\t\tconst oAggregationValue = Array.isArray(aAggregationData) ? aAggregationData[0] : aAggregationData;\n\n\t\tif (!oAggregationValue) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (oAggregationValue instanceof GenericTile && oAggregationValue.getState() === mobileLibrary.LoadState.Loaded) {\n\t\t\treturn oAggregationValue;\n\t\t}\n\n\t\treturn this._getInnerGenericTile(oAggregationValue as Control);\n\t}\n\n\t/**\n\t * Navigates to the clicked app\n\t * @private\n\t */\n\tprivate async _launchApp(event: GenericTile$PressEvent): Promise<void> {\n\t\tthis.appManagerInstance = this.appManagerInstance || AppManager.getInstance();\n\t\tconst tile = event.getSource();\n\t\tconst favoriteApps: ISectionAndVisualization[] = await this.appManagerInstance.fetchFavVizs(false, true);\n\t\tconst selectedApp = favoriteApps.find((app) => {\n\t\t\tconst appUrl = app.url || \"\";\n\t\t\treturn tile.getUrl().includes(appUrl);\n\t\t});\n\t\tconst smartBusinessAppViz = selectedApp?.vizInstance;\n\t\tconst isSmartBusinessTile = selectedApp?.isSmartBusinessTile;\n\t\tif (smartBusinessAppViz) {\n\t\t\tconst ssbRootControl = this._getSSBRootControl(smartBusinessAppViz);\n\t\t\tconst ssbGenericTile = isSmartBusinessTile && this._getInnerGenericTile(ssbRootControl);\n\n\t\t\tif (ssbGenericTile) {\n\t\t\t\tssbGenericTile.firePress();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// Fallback in case smartBusinessAppViz is undefined or ssbGenericTile is not present\n\t\tconst spaceContentService = await Container.getServiceAsync<SpaceContent>(\"SpaceContent\");\n\t\tawait spaceContentService.launchTileTarget(this.getUrl(), this.getTitle());\n\t}\n\n\t/**\n\t * App Press Handler\n\t * @private\n\t */\n\tpublic async _handlePress(event: GenericTile$PressEvent) {\n\t\tif (this.getUrl()) {\n\t\t\tconst navInfo = this.data(\"additionalInfo\") as IAdditionalInfo;\n\t\t\tif (navInfo?.fesrSource) {\n\t\t\t\taddFESRNavigationSource(navInfo.fesrSource);\n\t\t\t}\n\t\t\tawait this._launchApp(event);\n\t\t}\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AAHAA,GAAA,CAAAC,EAAA,CAAAC,MAAA,kJAAAC,GAAA,EAAAC,WAAA,EAAAC,aAAA,EAAAC,SAAA,EAAAC,SAAA,EAAAC,YAAA,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;EAAA,MAaOG,OAAO,GAAAJ,sBAAA,CAAAH,SAAA;EAAA,MAEPQ,UAAU,GAAAL,sBAAA,CAAAF,YAAA;EAAA,MACRQ,uBAAuB,GAAAP,iBAAA;EAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EAdA,MAeqBQ,GAAG,GAASH,OAAO,CAAAI,MAAA;IAavBC,QAAQ,EAAoB;MAC3CC,OAAO,EAAE,cAAc;MACvBC,UAAU,EAAE;QACX;AACH;AACA;QACGC,GAAG,EAAE;UAAEC,IAAI,EAAE,QAAQ;UAAEC,KAAK,EAAE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SAAS,CAAC4E,eAAe,CAAe,cAAc,CAAC,EAAAd,IAAA,WAAnFe,mBAAmB;YAAA,OAAAlB,OAAA,CAAAC,OAAA,CACnBiB,mBAAmB,CAACC,gBAAgB,CAACxB,KAAA,CAAKc,MAAM,CAAC,CAAC,EAAEd,KAAA,CAAKyB,QAAQ,CAAC,CAAC,CAAC,EAAAjB,IAAA;UAAA;QAAA;MAC3E,CAAC,QAAAkB,CAAA;QAAA,OAAArB,OAAA,CAAAsB,MAAA,CAAAD,CAAA;MAAA;IAAA;IAED;AACD;AACA;AACA;IACcE,YAAY,WAAAA,aAAC7B,KAA6B;MAAA,IAAE;QAAA,MAAA8B,MAAA,GACpD,IAAI;QAAA,MAAAC,KAAA;UAAA,IAAJD,MAAA,CAAKf,MAAM,CAAC,CAAC;YAChB,MAAMiB,OAAO,GAAGF,MAAA,CAAKG,IAAI,CAAC,gBAAgB,CAAoB;YAC9D,IAAID,OAAO,EAAEE,UAAU,EAAE;cACxB7E,uBAAuB,CAAC2E,OAAO,CAACE,UAAU,CAAC;YAC5C;YAAC,OAAA5B,OAAA,CAAAC,OAAA,CACKuB,MAAA,CAAK/B,UAAU,CAACC,KAAK,CAAC,EAAAS,IAAA;UAAA;QAAA;QAAA,OAAAH,OAAA,CAAAC,OAAA,CAAAwB,KAAA,IAAAA,KAAA,CAAAtB,IAAA,GAAAsB,KAAA,CAAAtB,IAAA;MAE9B,CAAC,QAAAkB,CAAA;QAAA,OAAArB,OAAA,CAAAsB,MAAA,CAAAD,CAAA;MAAA;IAAA;EAAA;EAAA,OAnGmBrE,GAAG;AAAA","ignoreList":[]}
|
package/src/sap/cux/home/App.ts
CHANGED
|
@@ -12,8 +12,9 @@ import Container from "sap/ushell/Container";
|
|
|
12
12
|
import SpaceContent from "sap/ushell/services/SpaceContent";
|
|
13
13
|
import { $AppSettings } from "./App";
|
|
14
14
|
import BaseApp from "./BaseApp";
|
|
15
|
-
import { ICustomVizInstance, ISectionAndVisualization } from "./interface/AppsInterface";
|
|
15
|
+
import { IAdditionalInfo, ICustomVizInstance, ISectionAndVisualization } from "./interface/AppsInterface";
|
|
16
16
|
import AppManager from "./utils/AppManager";
|
|
17
|
+
import { addFESRNavigationSource } from "./utils/FESRUtil";
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
*
|
|
@@ -56,6 +57,7 @@ export default class App extends BaseApp {
|
|
|
56
57
|
vizId: { type: "string", group: "Misc", defaultValue: "" }
|
|
57
58
|
}
|
|
58
59
|
};
|
|
60
|
+
|
|
59
61
|
private _getSSBRootControl(oSmartBusinessAppViz: ICustomVizInstance): Control | null {
|
|
60
62
|
try {
|
|
61
63
|
return oSmartBusinessAppViz.getContent().getComponentInstance().getRootControl() as Control | null;
|
|
@@ -122,6 +124,10 @@ export default class App extends BaseApp {
|
|
|
122
124
|
*/
|
|
123
125
|
public async _handlePress(event: GenericTile$PressEvent) {
|
|
124
126
|
if (this.getUrl()) {
|
|
127
|
+
const navInfo = this.data("additionalInfo") as IAdditionalInfo;
|
|
128
|
+
if (navInfo?.fesrSource) {
|
|
129
|
+
addFESRNavigationSource(navInfo.fesrSource);
|
|
130
|
+
}
|
|
125
131
|
await this._launchApp(event);
|
|
126
132
|
}
|
|
127
133
|
}
|
|
@@ -123,6 +123,7 @@ declare module "sap/cux/home/AppsAdditionPanel" {
|
|
|
123
123
|
* @private
|
|
124
124
|
* @param {string} id - The unique ID for the container.
|
|
125
125
|
* @param {Context} context - The binding context for the app.
|
|
126
|
+
* @param {boolean} isEnglishLanguage - Flag indicating if the language is english.
|
|
126
127
|
* @returns {VBox} The app details container.
|
|
127
128
|
*/
|
|
128
129
|
private _getAppDetailsContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppsAdditionPanel.d.ts","sourceRoot":"../../../../..","sources":["src/sap/cux/home/AppsAdditionPanel.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"AppsAdditionPanel.d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mBAAmB;QAuBjC;;;;;;;WAOG;QACH,OAAO,CAAC,iBAAiB;QAuBzB;;;;;;;WAOG;QACH,OAAO,CAAC,oBAAoB;QAQ5B;;;;;;WAMG;QACI,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;QAU/C;;;;;WAKG;gBACW,cAAc;QAmC5B;;;;;WAKG;QACH,OAAO,CAAC,SAAS;QAIjB;;;;;WAKG;QACH,OAAO,CAAC,gBAAgB;QAMxB;;;;;WAKG;QACH,OAAO,CAAC,cAAc;QAMtB;;;;;WAKG;gBACW,mBAAmB;QAIjC;;;;;WAKG;QACH,OAAO,CAAC,oBAAoB;QAM5B;;;;;WAKG;gBACW,mBAAmB;QAIjC;;;;;WAKG;QACI,qBAAqB,CAAC,KAAK,EAAE,6BAA6B,GAAG,IAAI;QAcxE;;;;;WAKG;QACH,OAAO,CAAC,YAAY;QAUpB;;;;;;WAMG;QACH,OAAO,CAAC,aAAa;QAQrB;;;;;WAKG;QACI,0BAA0B,CAAC,KAAK,EAAE,wBAAwB;QAkBjE;;;;;WAKG;QACI,qBAAqB,IAAI,MAAM;QAKtC;;;;WAIG;QACH,OAAO,CAAC,aAAa;QAOrB;;;;WAIG;QACI,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;KAQ/C;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/m/Button", "sap/m/CustomListItem", "sap/m/ExpandableText", "sap/m/FlexBox", "sap/m/GenericTile", "sap/m/HBox", "sap/m/Label", "sap/m/library", "sap/m/MessageToast", "sap/m/Text", "sap/m/VBox", "sap/ui/core/Fragment", "sap/ui/core/library", "sap/ui/model/ChangeReason", "sap/ui/model/json/JSONModel", "sap/ui/model/resource/ResourceModel", "sap/ui/model/Sorter", "sap/ushell/Container", "./AppsContainer", "./BaseSettingsPanel", "./FavAppPanel", "./InsightsContainer", "./utils/AppManager", "./utils/Constants", "./utils/DataFormatUtils", "./utils/FeatureUtils", "./utils/FESRUtil"], function (Log, Button, CustomListItem, ExpandableText, FlexBox, GenericTile, HBox, Label, sap_m_library, MessageToast, Text, VBox, Fragment, sap_ui_core_library, ChangeReason, JSONModel, ResourceModel, Sorter, Container, __AppsContainer, __BaseSettingsPanel, __FavAppPanel, __InsightsContainer, __AppManager, ___utils_Constants, ___utils_DataFormatUtils, ___utils_FeatureUtils, ___utils_FESRUtil) {
|
|
5
|
+
sap.ui.define(["sap/base/i18n/Localization", "sap/base/Log", "sap/m/Button", "sap/m/CustomListItem", "sap/m/ExpandableText", "sap/m/FlexBox", "sap/m/GenericTile", "sap/m/HBox", "sap/m/Label", "sap/m/library", "sap/m/MessageToast", "sap/m/Text", "sap/m/VBox", "sap/ui/core/Fragment", "sap/ui/core/library", "sap/ui/model/ChangeReason", "sap/ui/model/json/JSONModel", "sap/ui/model/resource/ResourceModel", "sap/ui/model/Sorter", "sap/ushell/Container", "./AppsContainer", "./BaseSettingsPanel", "./FavAppPanel", "./InsightsContainer", "./utils/AppManager", "./utils/Constants", "./utils/DataFormatUtils", "./utils/FeatureUtils", "./utils/FESRUtil", "./utils/PXFeedback"], function (Localization, Log, Button, CustomListItem, ExpandableText, FlexBox, GenericTile, HBox, Label, sap_m_library, MessageToast, Text, VBox, Fragment, sap_ui_core_library, ChangeReason, JSONModel, ResourceModel, Sorter, Container, __AppsContainer, __BaseSettingsPanel, __FavAppPanel, __InsightsContainer, __AppManager, ___utils_Constants, ___utils_DataFormatUtils, ___utils_FeatureUtils, ___utils_FESRUtil, ___utils_PXFeedback) {
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
8
|
function _interopRequireDefault(obj) {
|
|
@@ -203,10 +203,11 @@ sap.ui.define(["sap/base/Log", "sap/m/Button", "sap/m/CustomListItem", "sap/m/Ex
|
|
|
203
203
|
const isNavigationSupportedForFeature = ___utils_FeatureUtils["isNavigationSupportedForFeature"];
|
|
204
204
|
const addFESRSemanticStepName = ___utils_FESRUtil["addFESRSemanticStepName"];
|
|
205
205
|
const FESR_EVENTS = ___utils_FESRUtil["FESR_EVENTS"];
|
|
206
|
+
const triggerPXIntegration = ___utils_PXFeedback["triggerPXIntegration"];
|
|
206
207
|
const Constants = {
|
|
207
208
|
DeprecatedInfoText: "deprecated",
|
|
208
209
|
MinQueryLength: 2,
|
|
209
|
-
MaxDescriptionLength:
|
|
210
|
+
MaxDescriptionLength: 2000
|
|
210
211
|
};
|
|
211
212
|
var SearchStatus = /*#__PURE__*/function (SearchStatus) {
|
|
212
213
|
SearchStatus["Idle"] = "idle";
|
|
@@ -408,13 +409,17 @@ sap.ui.define(["sap/base/Log", "sap/m/Button", "sap/m/CustomListItem", "sap/m/Ex
|
|
|
408
409
|
* @returns {CustomListItem} The generated list item control.
|
|
409
410
|
*/
|
|
410
411
|
_generateListItem: function _generateListItem(id, context) {
|
|
412
|
+
const isStaticApp = context.getProperty("isStaticApp");
|
|
413
|
+
const langTag = Localization.getLanguageTag();
|
|
414
|
+
const currentLanguage = langTag.language.toLowerCase();
|
|
415
|
+
const isEnglishLanguage = currentLanguage.startsWith("en");
|
|
411
416
|
const listItem = new CustomListItem(id, {
|
|
412
417
|
selected: context.getProperty("addedToHomePage"),
|
|
413
418
|
content: [new FlexBox(recycleId(`${id}-result-container`), {
|
|
414
419
|
renderType: "Bare",
|
|
415
|
-
direction:
|
|
416
|
-
alignItems:
|
|
417
|
-
items: [this._getAppPreviewContainer(id, context), this._getAppDetailsContainer(id, context)]
|
|
420
|
+
direction: isEnglishLanguage && isStaticApp ? "Column" : "Row",
|
|
421
|
+
alignItems: isEnglishLanguage && isStaticApp ? "Start" : "Center",
|
|
422
|
+
items: [this._getAppPreviewContainer(id, context), this._getAppDetailsContainer(id, context, isEnglishLanguage)]
|
|
418
423
|
}).addStyleClass("sapUiSmallMargin")]
|
|
419
424
|
});
|
|
420
425
|
|
|
@@ -466,14 +471,16 @@ sap.ui.define(["sap/base/Log", "sap/m/Button", "sap/m/CustomListItem", "sap/m/Ex
|
|
|
466
471
|
* @private
|
|
467
472
|
* @param {string} id - The unique ID for the container.
|
|
468
473
|
* @param {Context} context - The binding context for the app.
|
|
474
|
+
* @param {boolean} isEnglishLanguage - Flag indicating if the language is english.
|
|
469
475
|
* @returns {VBox} The app details container.
|
|
470
476
|
*/
|
|
471
|
-
_getAppDetailsContainer: function _getAppDetailsContainer(id, context) {
|
|
477
|
+
_getAppDetailsContainer: function _getAppDetailsContainer(id, context, isEnglishLanguage) {
|
|
478
|
+
let description = isEnglishLanguage ? context.getProperty("description") : this._i18nBundle.getText("NoDescriptionAvailable");
|
|
472
479
|
return new VBox(recycleId(`${id}-app-details-container`), {
|
|
473
480
|
renderType: "Bare",
|
|
474
481
|
gap: "0.5rem",
|
|
475
482
|
items: [new ExpandableText(recycleId(`${id}-description`), {
|
|
476
|
-
text:
|
|
483
|
+
text: description,
|
|
477
484
|
maxCharacters: Constants.MaxDescriptionLength
|
|
478
485
|
}), new HBox(recycleId(`${id}-app-status-container`), {
|
|
479
486
|
renderType: "Bare",
|
|
@@ -486,7 +493,7 @@ sap.ui.define(["sap/base/Log", "sap/m/Button", "sap/m/CustomListItem", "sap/m/Ex
|
|
|
486
493
|
items: this._generateStatusTexts(id, context.getProperty("status"))
|
|
487
494
|
}).addStyleClass("sapUiTinyMarginBegin statusTextsContainer")]
|
|
488
495
|
})]
|
|
489
|
-
}).addStyleClass(context.getProperty("isStaticApp") ? "sapUiSmallMarginTop" : "sapUiSmallMarginBegin");
|
|
496
|
+
}).addStyleClass(isEnglishLanguage && context.getProperty("isStaticApp") ? "sapUiSmallMarginTop" : "sapUiSmallMarginBegin");
|
|
490
497
|
},
|
|
491
498
|
/**
|
|
492
499
|
* Checks if the Apps Addition Panel is supported. Internally, it checks if the
|
|
@@ -644,8 +651,9 @@ sap.ui.define(["sap/base/Log", "sap/m/Button", "sap/m/CustomListItem", "sap/m/Ex
|
|
|
644
651
|
if (_temp4 && _temp4.then) return _temp4.then(function () {});
|
|
645
652
|
}); // suggest apps if there are results and search is not cancelled
|
|
646
653
|
}, function (err) {
|
|
647
|
-
|
|
648
|
-
|
|
654
|
+
const message = err.message || "";
|
|
655
|
+
Log.error(message);
|
|
656
|
+
_this3._handleError(message);
|
|
649
657
|
});
|
|
650
658
|
}, function (_wasThrown, _result) {
|
|
651
659
|
// update search status only if search is not cancelled
|
|
@@ -786,48 +794,39 @@ sap.ui.define(["sap/base/Log", "sap/m/Button", "sap/m/CustomListItem", "sap/m/Ex
|
|
|
786
794
|
fetchAppsFromSearch: function _fetchAppsFromSearch(query) {
|
|
787
795
|
try {
|
|
788
796
|
const _this5 = this;
|
|
789
|
-
return Promise.resolve(
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
function
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
797
|
+
return Promise.resolve(_this5._fetchCSRFToken()).then(function (token) {
|
|
798
|
+
const headers = {
|
|
799
|
+
"Content-Type": "application/json",
|
|
800
|
+
...(token && {
|
|
801
|
+
"X-CSRF-Token": token
|
|
802
|
+
})
|
|
803
|
+
};
|
|
804
|
+
return Promise.resolve(fetch(AI_APP_FINDER_API, {
|
|
805
|
+
method: "POST",
|
|
806
|
+
headers,
|
|
807
|
+
body: JSON.stringify({
|
|
808
|
+
UserInput: query
|
|
809
|
+
})
|
|
810
|
+
})).then(function (response) {
|
|
811
|
+
let _exit = false;
|
|
812
|
+
function _temp9(_result2) {
|
|
813
|
+
return _exit ? _result2 : Promise.resolve(response.json()).then(function (_response$json2) {
|
|
814
|
+
const queryResult = _response$json2;
|
|
815
|
+
return queryResult.value || [];
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
const _temp8 = function () {
|
|
819
|
+
if (!response.ok) {
|
|
820
|
+
return Promise.resolve(response.json()).then(function (_response$json) {
|
|
821
|
+
const errorResponse = _response$json;
|
|
822
|
+
throw new Error(errorResponse.error?.message || "");
|
|
809
823
|
});
|
|
810
824
|
}
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
const errorResponse = _response$json;
|
|
815
|
-
_this5._handleError(errorResponse.error?.message || "");
|
|
816
|
-
const _temp8 = [];
|
|
817
|
-
_exit = true;
|
|
818
|
-
return _temp8;
|
|
819
|
-
});
|
|
820
|
-
}
|
|
821
|
-
}();
|
|
822
|
-
// handle error responses
|
|
823
|
-
return _temp9 && _temp9.then ? _temp9.then(_temp0) : _temp0(_temp9);
|
|
824
|
-
});
|
|
825
|
+
}();
|
|
826
|
+
// handle error responses
|
|
827
|
+
return _temp8 && _temp8.then ? _temp8.then(_temp9) : _temp9(_temp8);
|
|
825
828
|
});
|
|
826
|
-
}
|
|
827
|
-
Log.error(error.message);
|
|
828
|
-
_this5._handleError();
|
|
829
|
-
return [];
|
|
830
|
-
}));
|
|
829
|
+
});
|
|
831
830
|
} catch (e) {
|
|
832
831
|
return Promise.reject(e);
|
|
833
832
|
}
|
|
@@ -899,9 +898,9 @@ sap.ui.define(["sap/base/Log", "sap/m/Button", "sap/m/CustomListItem", "sap/m/Ex
|
|
|
899
898
|
onPressAddApps: function _onPressAddApps() {
|
|
900
899
|
try {
|
|
901
900
|
const _this6 = this;
|
|
902
|
-
function
|
|
903
|
-
function
|
|
904
|
-
function
|
|
901
|
+
function _temp13() {
|
|
902
|
+
function _temp11() {
|
|
903
|
+
function _temp1() {
|
|
905
904
|
_this6.getParent()?.close();
|
|
906
905
|
if (userSelectedApps.length > 1) {
|
|
907
906
|
MessageToast.show(_this6._i18nBundle.getText("contentAddedToMyhome"));
|
|
@@ -913,30 +912,31 @@ sap.ui.define(["sap/base/Log", "sap/m/Button", "sap/m/CustomListItem", "sap/m/Ex
|
|
|
913
912
|
}
|
|
914
913
|
_this6.resetPanel();
|
|
915
914
|
}
|
|
916
|
-
const
|
|
915
|
+
const _temp0 = function () {
|
|
917
916
|
if (dynamicAppsPresent) {
|
|
918
917
|
return Promise.resolve(_this6.refreshInsightsApps()).then(function () {});
|
|
919
918
|
}
|
|
920
919
|
}();
|
|
921
|
-
return
|
|
920
|
+
return _temp0 && _temp0.then ? _temp0.then(_temp1) : _temp1(_temp0);
|
|
922
921
|
}
|
|
923
|
-
const
|
|
922
|
+
const _temp10 = function () {
|
|
924
923
|
if (staticAppsPresent) {
|
|
925
924
|
return Promise.resolve(_this6.refreshFavoriteApps()).then(function () {});
|
|
926
925
|
}
|
|
927
926
|
}();
|
|
928
|
-
return
|
|
927
|
+
return _temp10 && _temp10.then ? _temp10.then(_temp11) : _temp11(_temp10);
|
|
929
928
|
}
|
|
929
|
+
triggerPXIntegration("addAppsButton");
|
|
930
930
|
const userSelectedApps = _this6.model.getProperty("/userSelectedApps");
|
|
931
931
|
let staticAppsPresent = false;
|
|
932
932
|
let dynamicAppsPresent = false;
|
|
933
|
-
const
|
|
933
|
+
const _temp12 = _forOf(userSelectedApps, function (app) {
|
|
934
934
|
const isStaticApp = app.getBindingContext()?.getProperty("isStaticApp");
|
|
935
935
|
if (isStaticApp) staticAppsPresent = true;else dynamicAppsPresent = true;
|
|
936
936
|
const vizId = app.getBindingContext()?.getProperty("chipID");
|
|
937
937
|
return Promise.resolve(_this6.appManagerInstance.addVisualization(vizId, isStaticApp ? undefined : MYINSIGHT_SECTION_ID)).then(function () {});
|
|
938
938
|
});
|
|
939
|
-
return Promise.resolve(
|
|
939
|
+
return Promise.resolve(_temp12 && _temp12.then ? _temp12.then(_temp13) : _temp13(_temp12));
|
|
940
940
|
} catch (e) {
|
|
941
941
|
return Promise.reject(e);
|
|
942
942
|
}
|
|
@@ -1100,6 +1100,7 @@ sap.ui.define(["sap/base/Log", "sap/m/Button", "sap/m/CustomListItem", "sap/m/Ex
|
|
|
1100
1100
|
sendFeedback: function _sendFeedback(feedbackType) {
|
|
1101
1101
|
this.resetFeedback();
|
|
1102
1102
|
this.model.setProperty(`/feedback/${feedbackType}`, true);
|
|
1103
|
+
triggerPXIntegration(feedbackType);
|
|
1103
1104
|
MessageToast.show(this._i18nBundle.getText("feedBackSent"), {
|
|
1104
1105
|
width: "20em"
|
|
1105
1106
|
});
|