@sap-ux/preview-middleware 0.23.102 → 0.23.104
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/dist/client/cpe/odata-health/odata-health-checker.js +1 -0
- package/dist/client/cpe/odata-health/odata-health-checker.ts +2 -1
- package/dist/client/flp/homepage/controller/MyHome.controller.js +54 -0
- package/dist/client/flp/homepage/controller/MyHome.controller.ts +41 -0
- package/dist/client/flp/homepage/view/MyHome.view.xml +1 -7
- package/package.json +10 -10
|
@@ -11,7 +11,7 @@ type DataSource = ManifestNamespace.DataSource;
|
|
|
11
11
|
/**
|
|
12
12
|
* The OData version type.
|
|
13
13
|
*/
|
|
14
|
-
type ODataVersion = 'v2' | 'v4' | '2.0' | '4.0';
|
|
14
|
+
type ODataVersion = 'v2' | 'v4' | '2.0' | '4.0' | '4.01';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Describes an OData service instance.
|
|
@@ -104,6 +104,7 @@ export class ODataHealthChecker {
|
|
|
104
104
|
return this.getServiceV2Metadata(serviceUrl);
|
|
105
105
|
case 'v4':
|
|
106
106
|
case '4.0':
|
|
107
|
+
case '4.01':
|
|
107
108
|
return this.getServiceV4Metadata(serviceUrl);
|
|
108
109
|
}
|
|
109
110
|
}
|
|
@@ -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.
|
|
12
|
+
"version": "0.23.104",
|
|
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.
|
|
30
|
+
"@sap-ux/adp-tooling": "0.18.48",
|
|
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.
|
|
35
|
-
"@sap-ux/project-access": "1.34.
|
|
36
|
-
"@sap-ux/system-access": "0.6.
|
|
34
|
+
"@sap-ux/logger": "0.8.1",
|
|
35
|
+
"@sap-ux/project-access": "1.34.4",
|
|
36
|
+
"@sap-ux/system-access": "0.6.45",
|
|
37
37
|
"@sap-ux/i18n": "0.3.7"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@sap-ux-private/playwright": "0.2.
|
|
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.
|
|
57
|
-
"@sap-ux/axios-extension": "1.25.
|
|
58
|
-
"@sap-ux/store": "1.5.
|
|
59
|
-
"@sap-ux/ui5-info": "0.13.
|
|
56
|
+
"@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.18.15",
|
|
57
|
+
"@sap-ux/axios-extension": "1.25.8",
|
|
58
|
+
"@sap-ux/store": "1.5.3",
|
|
59
|
+
"@sap-ux/ui5-info": "0.13.10"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"express": "4"
|