@sap-ux/preview-middleware 0.20.73 → 0.21.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.
Files changed (48) hide show
  1. package/dist/client/adp/api-handler.js +2 -2
  2. package/dist/client/adp/api-handler.ts +2 -2
  3. package/dist/client/adp/command-executor.js +66 -76
  4. package/dist/client/adp/command-executor.ts +28 -13
  5. package/dist/client/adp/controllers/AddCustomFragment.controller.js +22 -8
  6. package/dist/client/adp/controllers/AddCustomFragment.controller.ts +16 -6
  7. package/dist/client/adp/controllers/AddFragment.controller.js +32 -18
  8. package/dist/client/adp/controllers/AddFragment.controller.ts +23 -13
  9. package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +35 -19
  10. package/dist/client/adp/controllers/AddTableColumnFragments.controller.ts +26 -20
  11. package/dist/client/adp/controllers/BaseDialog.controller.js +1 -9
  12. package/dist/client/adp/controllers/BaseDialog.controller.ts +0 -14
  13. package/dist/client/adp/controllers/ControllerExtension.controller.js +252 -267
  14. package/dist/client/adp/controllers/ControllerExtension.controller.ts +61 -17
  15. package/dist/client/adp/controllers/ExtensionPoint.controller.js +115 -140
  16. package/dist/client/adp/controllers/ExtensionPoint.controller.ts +17 -5
  17. package/dist/client/adp/init.js +22 -10
  18. package/dist/client/adp/init.ts +31 -13
  19. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +4 -4
  20. package/dist/client/adp/quick-actions/common/add-controller-to-page.ts +6 -4
  21. package/dist/client/adp/quick-actions/common/add-new-annotation-file.js +29 -14
  22. package/dist/client/adp/quick-actions/common/add-new-annotation-file.ts +22 -9
  23. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +100 -98
  24. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +8 -8
  25. package/dist/client/adp/sync-views-utils.js +11 -13
  26. package/dist/client/adp/sync-views-utils.ts +10 -12
  27. package/dist/client/adp/utils.js +1 -15
  28. package/dist/client/adp/utils.ts +0 -14
  29. package/dist/client/cpe/changes/service.js +26 -16
  30. package/dist/client/cpe/changes/service.ts +28 -21
  31. package/dist/client/cpe/documentation.js +125 -159
  32. package/dist/client/cpe/documentation.ts +16 -2
  33. package/dist/client/cpe/init.js +27 -5
  34. package/dist/client/cpe/init.ts +29 -4
  35. package/dist/client/cpe/outline/service.js +12 -3
  36. package/dist/client/cpe/outline/service.ts +10 -8
  37. package/dist/client/cpe/quick-actions/quick-action-service.ts +0 -1
  38. package/dist/client/cpe/selection.js +16 -4
  39. package/dist/client/cpe/selection.ts +14 -3
  40. package/dist/client/flp/init.js +28 -11
  41. package/dist/client/flp/init.ts +36 -19
  42. package/dist/client/messagebundle.properties +34 -1
  43. package/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +2 -2
  44. package/dist/client/utils/info-center-message.js +33 -0
  45. package/dist/client/utils/info-center-message.ts +60 -0
  46. package/dist/client/utils/version.js +69 -104
  47. package/dist/client/utils/version.ts +25 -14
  48. package/package.json +7 -7
@@ -1,106 +1,71 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/VersionInfo", "sap/base/Log"], function (VersionInfo, Log) {
4
- "use strict";
5
-
6
- /**
7
- * Default minimal supported UI5 version
8
- */
9
- const minVersionInfo = {
10
- major: 1,
11
- minor: 71
12
- };
13
-
14
- /**
15
- * Check if the given version info is valid.
16
- * @param versionInfo to check
17
- * @throws Error if the version info is invalid
18
- */
19
- function checkVersionInfo(versionInfo) {
20
- if (isNaN(versionInfo.major) || isNaN(versionInfo.minor) || isNaN(versionInfo.patch ?? 0)) {
21
- throw new Error('Invalid version info');
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
- * Retrieve the UI5 version.
27
- * If no library is given, the version from 'sap.ui.core' will be retrieved.
28
- * 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).
29
- * For details see the patch info of the respective SAPUI5 version (e.g. https://ui5.sap.com/1.96.38/patchinfo.html).
30
- *
31
- * @param library - (optional) specific library name to get the version from, e.g. 'sap.m'
32
- * @returns Ui5VersionInfo
33
- */
34
- async function getUi5Version() {
35
- let library = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'sap.ui.core';
36
- let version = (await VersionInfo.load({
37
- library
38
- }))?.version;
39
- if (!version) {
40
- Log.error('Could not get UI5 version of application. Using version: 1.130.0 as fallback.');
41
- version = '1.130.0';
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
- const [major, minor, patch] = version.split('.').map(versionPart => parseInt(versionPart, 10));
44
- const label = version.split(/-(.*)/s)?.[1];
45
- return {
46
- major,
47
- minor,
48
- patch,
49
- label
50
- };
51
- }
52
-
53
- /**
54
- * Checks if the given version is lower than the required minimal version.
55
- * 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).
56
- * For details see the patch info of the respective SAPUI5 version (e.g. https://ui5.sap.com/1.96.38/patchinfo.html).
57
- *
58
- * @param ui5VersionInfo to check
59
- * @param minUi5VersionInfo to check against (default is 1.71)
60
- * @throws Error if the version info is invalid
61
- *
62
- * @returns boolean
63
- */
64
- function isLowerThanMinimalUi5Version(ui5VersionInfo) {
65
- let minUi5VersionInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : minVersionInfo;
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
- name: string;
7
- version: string;
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
- isNaN(versionInfo.minor) ||
34
- isNaN(versionInfo.patch ?? 0)) {
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
- ui5VersionInfo.minor === minUi5VersionInfo.minor &&
87
- (ui5VersionInfo?.patch ?? 0) < (minUi5VersionInfo?.patch ?? 0))
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
- * Get UI5 version validation message.
117
- * @param ui5VersionInfo to be mentioned in the message
118
- * @returns string with validation message.
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 getUI5VersionValidationMessage(ui5VersionInfo: Ui5VersionInfo): string {
121
- 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}`;
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.73",
12
+ "version": "0.21.0",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -25,13 +25,13 @@
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.10",
28
+ "@sap-ux/adp-tooling": "0.15.12",
29
29
  "@sap-ux/btp-utils": "1.1.0",
30
- "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.6.8",
30
+ "@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.7.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.9",
34
- "@sap-ux/system-access": "0.6.11",
33
+ "@sap-ux/project-access": "1.30.10",
34
+ "@sap-ux/system-access": "0.6.12",
35
35
  "@sap-ux/i18n": "0.3.2"
36
36
  },
37
37
  "devDependencies": {
@@ -50,8 +50,8 @@
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.14.11",
54
- "@sap-ux/axios-extension": "1.22.4",
53
+ "@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.15.0",
54
+ "@sap-ux/axios-extension": "1.22.5",
55
55
  "@sap-ux/store": "1.1.2",
56
56
  "@sap-ux/ui5-info": "0.12.1"
57
57
  },