@sap-ux/preview-middleware 0.23.103 → 0.23.105

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.
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/core/mvc/Controller", "sap/cux/home/NewsPanel", "sap/base/Log"], function (Controller, NewsPanel, Log) {
4
+ "use strict";
5
+
6
+ function __ui5_require_async(path) {
7
+ return new Promise(function (resolve, reject) {
8
+ sap.ui.require([path], function (module) {
9
+ if (!(module && module.__esModule)) {
10
+ module = module === null || !(typeof module === "object" && path.endsWith("/library")) ? {
11
+ default: module
12
+ } : module;
13
+ Object.defineProperty(module, "__esModule", {
14
+ value: true
15
+ });
16
+ }
17
+ resolve(module);
18
+ }, function (err) {
19
+ reject(err);
20
+ });
21
+ });
22
+ }
23
+ /**
24
+ * @namespace open.ux.preview.client.flp.homepage.controller.MyHome
25
+ */
26
+ const MyHomeController = Controller.extend("open.ux.preview.client.flp.homepage.controller.MyHome.MyHomeController", {
27
+ onInit: function _onInit() {
28
+ void this.initializeNewsContainer();
29
+ },
30
+ initializeNewsContainer: async function _initializeNewsContainer() {
31
+ // Determine which NewsContainer to use based on availability
32
+ let NewsContainerClass;
33
+ try {
34
+ NewsContainerClass = (await __ui5_require_async('sap/cux/home/NewsContainer')).default;
35
+ } catch (e) {
36
+ Log.info(e?.message);
37
+ NewsContainerClass = (await __ui5_require_async('sap/cux/home/NewsAndPagesContainer')).default;
38
+ }
39
+ const view = this.getView();
40
+ if (view) {
41
+ const newsContainer = new NewsContainerClass(`${view.getId()}-newsContainer`, {
42
+ content: [new NewsPanel(`${view.getId()}-news`, {
43
+ // eslint-disable-next-line @sap-ux/fiori-tools/sap-no-hardcoded-url
44
+ url: 'https://sapui5untested.int.sap.eu2.hana.ondemand.com/databinding/proxy/https/news.sap.com/feed'
45
+ })]
46
+ }).addStyleClass('homeNewsContainer');
47
+ const page = view.byId('page');
48
+ page?.insertContent(newsContainer, 0);
49
+ }
50
+ }
51
+ });
52
+ return MyHomeController;
53
+ });
54
+ //# sourceMappingURL=MyHome.controller.js.map
@@ -0,0 +1,41 @@
1
+ import Controller from 'sap/ui/core/mvc/Controller';
2
+ import NewsPanel from 'sap/cux/home/NewsPanel';
3
+ import Log from 'sap/base/Log';
4
+ import Page from 'sap/m/Page';
5
+ import type NewsContainer from 'sap/cux/home/NewsContainer';
6
+ import type NewsAndPagesContainer from 'sap/cux/home/NewsAndPagesContainer';
7
+
8
+ /**
9
+ * @namespace open.ux.preview.client.flp.homepage.controller.MyHome
10
+ */
11
+ export default class MyHomeController extends Controller {
12
+ onInit() {
13
+ void this.initializeNewsContainer();
14
+ }
15
+
16
+ private async initializeNewsContainer() {
17
+ // Determine which NewsContainer to use based on availability
18
+ let NewsContainerClass: typeof NewsContainer | typeof NewsAndPagesContainer;
19
+ try {
20
+ NewsContainerClass = (await import('sap/cux/home/NewsContainer')).default;
21
+ } catch (e: unknown) {
22
+ Log.info((e as Error)?.message);
23
+ NewsContainerClass = (await import('sap/cux/home/NewsAndPagesContainer')).default;
24
+ }
25
+
26
+ const view = this.getView();
27
+ if (view) {
28
+ const newsContainer = new NewsContainerClass(`${view.getId()}-newsContainer`, {
29
+ content: [
30
+ new NewsPanel(`${view.getId()}-news`, {
31
+ // eslint-disable-next-line @sap-ux/fiori-tools/sap-no-hardcoded-url
32
+ url: 'https://sapui5untested.int.sap.eu2.hana.ondemand.com/databinding/proxy/https/news.sap.com/feed'
33
+ })
34
+ ]
35
+ }).addStyleClass('homeNewsContainer');
36
+
37
+ const page = view.byId('page') as Page;
38
+ page?.insertContent(newsContainer, 0);
39
+ }
40
+ }
41
+ }
@@ -3,6 +3,7 @@
3
3
  xmlns:m="sap.m"
4
4
  xmlns:mvc="sap.ui.core.mvc"
5
5
  displayBlock="true"
6
+ controllerName="open.ux.preview.client.flp.homepage.controller.MyHome"
6
7
  class="sapUShellFullHeight"
7
8
  >
8
9
  <m:Page
@@ -10,13 +11,6 @@
10
11
  showHeader="false"
11
12
  class="sapUiBaseLayout sapUiResponsiveContentPadding sapUiLayoutPadding sapCuxBaseLayout"
12
13
  >
13
- <NewsAndPagesContainer id="newsContainer" class="homeNewsContainer">
14
- <NewsPanel
15
- id="news"
16
- url="https://sapui5untested.int.sap.eu2.hana.ondemand.com/databinding/proxy/https/news.sap.com/feed"
17
- />
18
- </NewsAndPagesContainer>
19
-
20
14
  <AppsContainer id="appsContainer">
21
15
  <FavAppPanel id="favoriteApps" />
22
16
  </AppsContainer>
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "bugs": {
10
10
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Apreview-middleware"
11
11
  },
12
- "version": "0.23.103",
12
+ "version": "0.23.105",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -27,17 +27,17 @@
27
27
  "mem-fs-editor": "9.4.0",
28
28
  "qrcode": "1.5.4",
29
29
  "@sap/bas-sdk": "3.12.0",
30
- "@sap-ux/adp-tooling": "0.18.47",
30
+ "@sap-ux/adp-tooling": "0.18.49",
31
31
  "@sap-ux/btp-utils": "1.1.6",
32
32
  "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.7.9",
33
33
  "@sap-ux/feature-toggle": "0.3.5",
34
- "@sap-ux/logger": "0.8.0",
35
- "@sap-ux/project-access": "1.34.3",
36
- "@sap-ux/system-access": "0.6.44",
34
+ "@sap-ux/logger": "0.8.1",
35
+ "@sap-ux/project-access": "1.34.5",
36
+ "@sap-ux/system-access": "0.6.46",
37
37
  "@sap-ux/i18n": "0.3.7"
38
38
  },
39
39
  "devDependencies": {
40
- "@sap-ux-private/playwright": "0.2.5",
40
+ "@sap-ux-private/playwright": "0.2.6",
41
41
  "@types/connect": "^3.4.38",
42
42
  "@types/qrcode": "1.5.5",
43
43
  "@types/ejs": "3.1.2",
@@ -53,10 +53,10 @@
53
53
  "nock": "13.4.0",
54
54
  "npm-run-all2": "6.2.0",
55
55
  "supertest": "7.1.4",
56
- "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.18.14",
57
- "@sap-ux/axios-extension": "1.25.7",
58
- "@sap-ux/store": "1.5.2",
59
- "@sap-ux/ui5-info": "0.13.9"
56
+ "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.18.15",
57
+ "@sap-ux/axios-extension": "1.25.9",
58
+ "@sap-ux/store": "1.5.3",
59
+ "@sap-ux/ui5-info": "0.13.10"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "express": "4"