@sap-ux/preview-middleware 0.20.72 → 0.20.74
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/adp/api-handler.js +2 -2
- package/dist/client/adp/api-handler.ts +2 -2
- package/dist/client/adp/command-executor.js +66 -76
- package/dist/client/adp/command-executor.ts +28 -13
- package/dist/client/adp/controllers/AddCustomFragment.controller.js +22 -8
- package/dist/client/adp/controllers/AddCustomFragment.controller.ts +16 -6
- package/dist/client/adp/controllers/AddFragment.controller.js +32 -18
- package/dist/client/adp/controllers/AddFragment.controller.ts +23 -13
- package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +35 -19
- package/dist/client/adp/controllers/AddTableColumnFragments.controller.ts +26 -20
- package/dist/client/adp/controllers/BaseDialog.controller.js +1 -9
- package/dist/client/adp/controllers/BaseDialog.controller.ts +0 -14
- package/dist/client/adp/controllers/ControllerExtension.controller.js +252 -267
- package/dist/client/adp/controllers/ControllerExtension.controller.ts +61 -17
- package/dist/client/adp/controllers/ExtensionPoint.controller.js +115 -140
- package/dist/client/adp/controllers/ExtensionPoint.controller.ts +17 -5
- package/dist/client/adp/init.js +22 -10
- package/dist/client/adp/init.ts +31 -13
- package/dist/client/adp/quick-actions/common/add-controller-to-page.js +4 -4
- package/dist/client/adp/quick-actions/common/add-controller-to-page.ts +6 -4
- package/dist/client/adp/quick-actions/common/add-new-annotation-file.js +29 -14
- package/dist/client/adp/quick-actions/common/add-new-annotation-file.ts +22 -9
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +100 -98
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +8 -8
- package/dist/client/adp/sync-views-utils.js +11 -13
- package/dist/client/adp/sync-views-utils.ts +10 -12
- package/dist/client/adp/utils.js +1 -15
- package/dist/client/adp/utils.ts +0 -14
- package/dist/client/cpe/changes/service.js +26 -16
- package/dist/client/cpe/changes/service.ts +28 -21
- package/dist/client/cpe/documentation.js +125 -159
- package/dist/client/cpe/documentation.ts +16 -2
- package/dist/client/cpe/init.js +27 -5
- package/dist/client/cpe/init.ts +29 -4
- package/dist/client/cpe/outline/service.js +12 -3
- package/dist/client/cpe/outline/service.ts +10 -8
- package/dist/client/cpe/quick-actions/quick-action-service.ts +0 -1
- package/dist/client/cpe/selection.js +16 -4
- package/dist/client/cpe/selection.ts +14 -3
- package/dist/client/flp/init.js +28 -11
- package/dist/client/flp/init.ts +36 -19
- package/dist/client/messagebundle.properties +34 -1
- package/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +2 -2
- package/dist/client/utils/info-center-message.js +33 -0
- package/dist/client/utils/info-center-message.ts +60 -0
- package/dist/client/utils/version.js +69 -104
- package/dist/client/utils/version.ts +25 -14
- package/package.json +5 -5
|
@@ -1,106 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
sap
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
sap.ui.define([
|
|
3
|
+
'sap/ui/VersionInfo',
|
|
4
|
+
'sap/base/Log',
|
|
5
|
+
'./info-center-message',
|
|
6
|
+
'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common'
|
|
7
|
+
], function (VersionInfo, Log, ___info_center_message, ___sap_ux_private_control_property_editor_common) {
|
|
8
|
+
'use strict';
|
|
9
|
+
const sendInfoCenterMessage = ___info_center_message['sendInfoCenterMessage'];
|
|
10
|
+
const MessageBarType = ___sap_ux_private_control_property_editor_common['MessageBarType'];
|
|
11
|
+
const minVersionInfo = {
|
|
12
|
+
major: 1,
|
|
13
|
+
minor: 71
|
|
14
|
+
};
|
|
15
|
+
function checkVersionInfo(versionInfo) {
|
|
16
|
+
if (isNaN(versionInfo.major) || isNaN(versionInfo.minor) || isNaN(versionInfo.patch ?? 0)) {
|
|
17
|
+
void sendInfoCenterMessage({
|
|
18
|
+
title: { key: 'FLP_UI_VERSION_RETRIEVAL_FAILURE_TITLE' },
|
|
19
|
+
description: { key: 'FLP_UI_INVALID_UI5_VERSION_DESCRIPTION' },
|
|
20
|
+
type: MessageBarType.error
|
|
21
|
+
});
|
|
22
|
+
throw new Error('Invalid version info');
|
|
23
|
+
}
|
|
22
24
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
25
|
+
async function getUi5Version() {
|
|
26
|
+
let library = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'sap.ui.core';
|
|
27
|
+
let version = (await VersionInfo.load({ library }))?.version;
|
|
28
|
+
if (!version) {
|
|
29
|
+
Log.error('Could not get UI5 version of application. Using version: 1.130.0 as fallback.');
|
|
30
|
+
version = '1.130.0';
|
|
31
|
+
await sendInfoCenterMessage({
|
|
32
|
+
title: { key: 'FLP_UI_VERSION_RETRIEVAL_FAILURE_TITLE' },
|
|
33
|
+
description: {
|
|
34
|
+
key: 'FLP_UI_VERSION_RETRIEVAL_FAILURE_DESCRIPTION',
|
|
35
|
+
params: [version]
|
|
36
|
+
},
|
|
37
|
+
type: MessageBarType.error
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const [major, minor, patch] = version.split('.').map(versionPart => parseInt(versionPart, 10));
|
|
41
|
+
const label = version.split(/-(.*)/s)?.[1];
|
|
42
|
+
return {
|
|
43
|
+
major,
|
|
44
|
+
minor,
|
|
45
|
+
patch,
|
|
46
|
+
label
|
|
47
|
+
};
|
|
42
48
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
checkVersionInfo(ui5VersionInfo);
|
|
67
|
-
checkVersionInfo(minUi5VersionInfo);
|
|
68
|
-
return ui5VersionInfo.major < minUi5VersionInfo.major || ui5VersionInfo.major === minUi5VersionInfo.major && ui5VersionInfo.minor < minUi5VersionInfo.minor || ui5VersionInfo.major === minUi5VersionInfo.major && ui5VersionInfo.minor === minUi5VersionInfo.minor && (ui5VersionInfo?.patch ?? 0) < (minUi5VersionInfo?.patch ?? 0);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Checks if the given version is equal to the specified version.
|
|
73
|
-
* Note that the patch version of actual SAPUI5 version might differ from the lib that has been used for the version request (e.g. SAPUI5 1.96.38 contains sap.ui.core 1.96.36).
|
|
74
|
-
* For details see the patch info of the respective SAPUI5 version (e.g. https://ui5.sap.com/1.96.38/patchinfo.html).
|
|
75
|
-
*
|
|
76
|
-
* @param ui5VersionInfo to check
|
|
77
|
-
* @param targetUi5VersionInfo to check against (default is 1.71)
|
|
78
|
-
* @throws Error if the version info is invalid
|
|
79
|
-
*
|
|
80
|
-
* @returns boolean
|
|
81
|
-
*/
|
|
82
|
-
function isVersionEqualOrHasNewerPatch(ui5VersionInfo) {
|
|
83
|
-
let targetUi5VersionInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : minVersionInfo;
|
|
84
|
-
checkVersionInfo(ui5VersionInfo);
|
|
85
|
-
checkVersionInfo(targetUi5VersionInfo);
|
|
86
|
-
return ui5VersionInfo.major === targetUi5VersionInfo.major && ui5VersionInfo.minor === targetUi5VersionInfo.minor && (ui5VersionInfo?.patch ?? 0) >= (targetUi5VersionInfo?.patch ?? 0);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Get UI5 version validation message.
|
|
91
|
-
* @param ui5VersionInfo to be mentioned in the message
|
|
92
|
-
* @returns string with validation message.
|
|
93
|
-
*/
|
|
94
|
-
function getUI5VersionValidationMessage(ui5VersionInfo) {
|
|
95
|
-
return `The current SAPUI5 version set for this Adaptation project is ${ui5VersionInfo.major}.${ui5VersionInfo.minor}. The minimum version to use for SAPUI5 Adaptation Project and its SAPUI5 Visual Editor is ${minVersionInfo.major}.${minVersionInfo.minor}`;
|
|
96
|
-
}
|
|
97
|
-
var __exports = {
|
|
98
|
-
__esModule: true
|
|
99
|
-
};
|
|
100
|
-
__exports.getUi5Version = getUi5Version;
|
|
101
|
-
__exports.isLowerThanMinimalUi5Version = isLowerThanMinimalUi5Version;
|
|
102
|
-
__exports.isVersionEqualOrHasNewerPatch = isVersionEqualOrHasNewerPatch;
|
|
103
|
-
__exports.getUI5VersionValidationMessage = getUI5VersionValidationMessage;
|
|
104
|
-
return __exports;
|
|
105
|
-
});
|
|
106
|
-
//# sourceMappingURL=version.js.map
|
|
49
|
+
function isLowerThanMinimalUi5Version(ui5VersionInfo) {
|
|
50
|
+
let minUi5VersionInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : minVersionInfo;
|
|
51
|
+
checkVersionInfo(ui5VersionInfo);
|
|
52
|
+
checkVersionInfo(minUi5VersionInfo);
|
|
53
|
+
return ui5VersionInfo.major < minUi5VersionInfo.major || ui5VersionInfo.major === minUi5VersionInfo.major && ui5VersionInfo.minor < minUi5VersionInfo.minor || ui5VersionInfo.major === minUi5VersionInfo.major && ui5VersionInfo.minor === minUi5VersionInfo.minor && (ui5VersionInfo?.patch ?? 0) < (minUi5VersionInfo?.patch ?? 0);
|
|
54
|
+
}
|
|
55
|
+
function isVersionEqualOrHasNewerPatch(ui5VersionInfo) {
|
|
56
|
+
let targetUi5VersionInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : minVersionInfo;
|
|
57
|
+
checkVersionInfo(ui5VersionInfo);
|
|
58
|
+
checkVersionInfo(targetUi5VersionInfo);
|
|
59
|
+
return ui5VersionInfo.major === targetUi5VersionInfo.major && ui5VersionInfo.minor === targetUi5VersionInfo.minor && (ui5VersionInfo?.patch ?? 0) >= (targetUi5VersionInfo?.patch ?? 0);
|
|
60
|
+
}
|
|
61
|
+
function getFullyQualifiedUi5Version(ui5VersionInfo) {
|
|
62
|
+
return `${ ui5VersionInfo.major }.${ ui5VersionInfo.minor }`;
|
|
63
|
+
}
|
|
64
|
+
var __exports = { __esModule: true };
|
|
65
|
+
__exports.minVersionInfo = minVersionInfo;
|
|
66
|
+
__exports.getUi5Version = getUi5Version;
|
|
67
|
+
__exports.isLowerThanMinimalUi5Version = isLowerThanMinimalUi5Version;
|
|
68
|
+
__exports.isVersionEqualOrHasNewerPatch = isVersionEqualOrHasNewerPatch;
|
|
69
|
+
__exports.getFullyQualifiedUi5Version = getFullyQualifiedUi5Version;
|
|
70
|
+
return __exports;
|
|
71
|
+
});
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import VersionInfo from 'sap/ui/VersionInfo';
|
|
2
2
|
import Log from 'sap/base/Log';
|
|
3
|
+
import { sendInfoCenterMessage } from './info-center-message';
|
|
4
|
+
import { MessageBarType } from '@sap-ux-private/control-property-editor-common';
|
|
3
5
|
|
|
4
6
|
type SingleVersionInfo =
|
|
5
7
|
| {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
name: string;
|
|
9
|
+
version: string;
|
|
10
|
+
}
|
|
9
11
|
| undefined;
|
|
10
12
|
|
|
11
13
|
export type Ui5VersionInfo = {
|
|
@@ -18,7 +20,7 @@ export type Ui5VersionInfo = {
|
|
|
18
20
|
/**
|
|
19
21
|
* Default minimal supported UI5 version
|
|
20
22
|
*/
|
|
21
|
-
const minVersionInfo = {
|
|
23
|
+
export const minVersionInfo = {
|
|
22
24
|
major: 1,
|
|
23
25
|
minor: 71
|
|
24
26
|
} as Readonly<Ui5VersionInfo>;
|
|
@@ -29,9 +31,12 @@ const minVersionInfo = {
|
|
|
29
31
|
* @throws Error if the version info is invalid
|
|
30
32
|
*/
|
|
31
33
|
function checkVersionInfo(versionInfo: Ui5VersionInfo): void {
|
|
32
|
-
if(isNaN(versionInfo.major) ||
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
if (isNaN(versionInfo.major) || isNaN(versionInfo.minor) || isNaN(versionInfo.patch ?? 0)) {
|
|
35
|
+
void sendInfoCenterMessage({
|
|
36
|
+
title: { key: 'FLP_UI_VERSION_RETRIEVAL_FAILURE_TITLE' },
|
|
37
|
+
description: { key: 'FLP_UI_INVALID_UI5_VERSION_DESCRIPTION' },
|
|
38
|
+
type: MessageBarType.error
|
|
39
|
+
});
|
|
35
40
|
throw new Error('Invalid version info');
|
|
36
41
|
}
|
|
37
42
|
}
|
|
@@ -50,6 +55,11 @@ export async function getUi5Version(library: string = 'sap.ui.core'): Promise<Ui
|
|
|
50
55
|
if (!version) {
|
|
51
56
|
Log.error('Could not get UI5 version of application. Using version: 1.130.0 as fallback.');
|
|
52
57
|
version = '1.130.0';
|
|
58
|
+
await sendInfoCenterMessage({
|
|
59
|
+
title: { key: 'FLP_UI_VERSION_RETRIEVAL_FAILURE_TITLE' },
|
|
60
|
+
description: { key: 'FLP_UI_VERSION_RETRIEVAL_FAILURE_DESCRIPTION', params: [version] },
|
|
61
|
+
type: MessageBarType.error
|
|
62
|
+
});
|
|
53
63
|
}
|
|
54
64
|
const [major, minor, patch] = version.split('.').map((versionPart) => parseInt(versionPart, 10));
|
|
55
65
|
const label = version.split(/-(.*)/s)?.[1];
|
|
@@ -83,8 +93,8 @@ export function isLowerThanMinimalUi5Version(
|
|
|
83
93
|
ui5VersionInfo.major < minUi5VersionInfo.major ||
|
|
84
94
|
(ui5VersionInfo.major === minUi5VersionInfo.major && ui5VersionInfo.minor < minUi5VersionInfo.minor) ||
|
|
85
95
|
(ui5VersionInfo.major === minUi5VersionInfo.major &&
|
|
86
|
-
|
|
87
|
-
|
|
96
|
+
ui5VersionInfo.minor === minUi5VersionInfo.minor &&
|
|
97
|
+
(ui5VersionInfo?.patch ?? 0) < (minUi5VersionInfo?.patch ?? 0))
|
|
88
98
|
);
|
|
89
99
|
}
|
|
90
100
|
|
|
@@ -113,10 +123,11 @@ export function isVersionEqualOrHasNewerPatch(
|
|
|
113
123
|
}
|
|
114
124
|
|
|
115
125
|
/**
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
* @
|
|
126
|
+
* Returns the fully qualified UI5 version string - major and minor version concatenated.
|
|
127
|
+
*
|
|
128
|
+
* @param {Ui5VersionInfo} ui5VersionInfo - The ui5 version info object containing major and minor version.
|
|
129
|
+
* @returns {string} The fully qualified UI5 version string.
|
|
119
130
|
*/
|
|
120
|
-
export function
|
|
121
|
-
return
|
|
131
|
+
export function getFullyQualifiedUi5Version(ui5VersionInfo: Ui5VersionInfo): string {
|
|
132
|
+
return `${ui5VersionInfo.major}.${ui5VersionInfo.minor}`;
|
|
122
133
|
}
|
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.20.
|
|
12
|
+
"version": "0.20.74",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"ejs": "3.1.10",
|
|
26
26
|
"mem-fs": "2.1.0",
|
|
27
27
|
"mem-fs-editor": "9.4.0",
|
|
28
|
-
"@sap-ux/adp-tooling": "0.15.
|
|
28
|
+
"@sap-ux/adp-tooling": "0.15.11",
|
|
29
29
|
"@sap-ux/btp-utils": "1.1.0",
|
|
30
|
-
"@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.
|
|
30
|
+
"@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@1.0.0",
|
|
31
31
|
"@sap-ux/feature-toggle": "0.3.0",
|
|
32
32
|
"@sap-ux/logger": "0.7.0",
|
|
33
|
-
"@sap-ux/project-access": "1.30.
|
|
33
|
+
"@sap-ux/project-access": "1.30.10",
|
|
34
34
|
"@sap-ux/system-access": "0.6.11",
|
|
35
35
|
"@sap-ux/i18n": "0.3.2"
|
|
36
36
|
},
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"nock": "13.4.0",
|
|
51
51
|
"npm-run-all2": "6.2.0",
|
|
52
52
|
"supertest": "7.1.4",
|
|
53
|
-
"@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.
|
|
53
|
+
"@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@1.0.0",
|
|
54
54
|
"@sap-ux/axios-extension": "1.22.4",
|
|
55
55
|
"@sap-ux/store": "1.1.2",
|
|
56
56
|
"@sap-ux/ui5-info": "0.12.1"
|