@sap-ux/preview-middleware 0.18.18 → 0.18.20

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 (77) hide show
  1. package/dist/client/adp/api-handler.js +153 -153
  2. package/dist/client/adp/command-executor.js +75 -75
  3. package/dist/client/adp/control-utils.js +44 -44
  4. package/dist/client/adp/controllers/AddSubpage.controller.js +128 -0
  5. package/dist/client/adp/controllers/AddSubpage.controller.ts +195 -0
  6. package/dist/client/adp/controllers/BaseDialog.controller.js +187 -187
  7. package/dist/client/adp/controllers/ControllerExtension.controller.js +209 -209
  8. package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
  9. package/dist/client/adp/controllers/FileExistsDialog.controller.js +66 -66
  10. package/dist/client/adp/dialog-factory.js +133 -125
  11. package/dist/client/adp/dialog-factory.ts +17 -3
  12. package/dist/client/adp/init-dialogs.js +107 -107
  13. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +55 -55
  14. package/dist/client/adp/quick-actions/common/add-new-subpage.js +140 -0
  15. package/dist/client/adp/quick-actions/common/add-new-subpage.ts +164 -0
  16. package/dist/client/adp/quick-actions/common/create-page-action.js +51 -51
  17. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +36 -36
  18. package/dist/client/adp/quick-actions/common/op-add-header-field.js +61 -61
  19. package/dist/client/adp/quick-actions/common/utils.js +18 -18
  20. package/dist/client/adp/quick-actions/control-types.js +21 -21
  21. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
  22. package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
  23. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
  24. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +104 -104
  25. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +96 -96
  26. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +78 -78
  27. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
  28. package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +69 -69
  29. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +59 -59
  30. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
  31. package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +84 -84
  32. package/dist/client/adp/quick-actions/fe-v2/registry.js +76 -75
  33. package/dist/client/adp/quick-actions/fe-v2/registry.ts +7 -3
  34. package/dist/client/adp/quick-actions/fe-v2/utils.js +116 -116
  35. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +73 -73
  36. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +50 -50
  37. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +46 -46
  38. package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +81 -81
  39. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +56 -56
  40. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  41. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +53 -53
  42. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
  43. package/dist/client/adp/quick-actions/fe-v4/registry.js +58 -58
  44. package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
  45. package/dist/client/adp/quick-actions/load.js +44 -44
  46. package/dist/client/adp/quick-actions/quick-action-base.js +53 -53
  47. package/dist/client/adp/ui/AddSubpage.fragment.xml +73 -0
  48. package/dist/client/adp/utils.js +160 -160
  49. package/dist/client/cpe/changes/index.js +10 -10
  50. package/dist/client/cpe/changes/validator.js +39 -39
  51. package/dist/client/cpe/documentation.js +164 -164
  52. package/dist/client/cpe/feature-service.js +36 -36
  53. package/dist/client/cpe/logger.js +30 -30
  54. package/dist/client/cpe/outline/editable.js +37 -37
  55. package/dist/client/cpe/outline/nodes.js +222 -222
  56. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  57. package/dist/client/cpe/quick-actions/registry.js +143 -143
  58. package/dist/client/cpe/quick-actions/utils.js +92 -92
  59. package/dist/client/cpe/types.js +4 -4
  60. package/dist/client/cpe/ui5-utils.js +33 -33
  61. package/dist/client/cpe/utils.js +138 -138
  62. package/dist/client/flp/WorkspaceConnector.js +86 -86
  63. package/dist/client/flp/common.js +28 -28
  64. package/dist/client/flp/enableFakeConnector.js +83 -83
  65. package/dist/client/flp/initConnectors.js +28 -28
  66. package/dist/client/flp/initRta.js +178 -178
  67. package/dist/client/i18n.js +56 -56
  68. package/dist/client/messagebundle.properties +6 -0
  69. package/dist/client/utils/application.js +32 -32
  70. package/dist/client/utils/core.js +68 -68
  71. package/dist/client/utils/error.js +19 -19
  72. package/dist/client/utils/fe-v2.js +58 -0
  73. package/dist/client/utils/fe-v2.ts +63 -0
  74. package/dist/client/utils/fe-v4.js +141 -118
  75. package/dist/client/utils/fe-v4.ts +19 -0
  76. package/dist/client/utils/version.js +104 -104
  77. package/package.json +8 -8
@@ -1,58 +1,58 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/base/i18n/ResourceBundle", "sap/ui/model/resource/ResourceModel"], function (ResourceBundle, ResourceModel) {
4
- "use strict";
5
-
6
- const BUNDLE_CACHE = {};
7
- const MODEL_CACHE = {};
8
- async function getResourceBundle(key) {
9
- const cachedBundle = BUNDLE_CACHE[key];
10
- if (cachedBundle) {
11
- return cachedBundle;
12
- }
13
- const bundle = await ResourceBundle.create({
14
- bundleUrl: '/preview/client/messagebundle.properties',
15
- url: '/preview/client/messagebundle.properties',
16
- supportedLocales: [''],
17
- locale: '',
18
- async: true
19
- });
20
- BUNDLE_CACHE[key] = bundle;
21
- return bundle;
22
- }
23
- async function getResourceModel() {
24
- let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'open.ux.preview.client';
25
- const cachedModel = MODEL_CACHE[key];
26
- if (cachedModel) {
27
- return cachedModel;
28
- }
29
- const bundle = await getResourceBundle(key);
30
- const model = new ResourceModel({
31
- bundle
32
- });
33
- MODEL_CACHE[key] = model;
34
- return model;
35
- }
36
- class TextBundle {
37
- constructor(bundle) {
38
- this.bundle = bundle;
39
- }
40
- getText(key, args) {
41
- return this.bundle.getText(key, args) ?? key;
42
- }
43
- }
44
- async function getTextBundle() {
45
- let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'open.ux.preview.client';
46
- const bundle = await getResourceBundle(key);
47
- return new TextBundle(bundle);
48
- }
49
- var __exports = {
50
- __esModule: true
51
- };
52
- __exports.getResourceBundle = getResourceBundle;
53
- __exports.getResourceModel = getResourceModel;
54
- __exports.TextBundle = TextBundle;
55
- __exports.getTextBundle = getTextBundle;
56
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/base/i18n/ResourceBundle", "sap/ui/model/resource/ResourceModel"], function (ResourceBundle, ResourceModel) {
4
+ "use strict";
5
+
6
+ const BUNDLE_CACHE = {};
7
+ const MODEL_CACHE = {};
8
+ async function getResourceBundle(key) {
9
+ const cachedBundle = BUNDLE_CACHE[key];
10
+ if (cachedBundle) {
11
+ return cachedBundle;
12
+ }
13
+ const bundle = await ResourceBundle.create({
14
+ bundleUrl: '/preview/client/messagebundle.properties',
15
+ url: '/preview/client/messagebundle.properties',
16
+ supportedLocales: [''],
17
+ locale: '',
18
+ async: true
19
+ });
20
+ BUNDLE_CACHE[key] = bundle;
21
+ return bundle;
22
+ }
23
+ async function getResourceModel() {
24
+ let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'open.ux.preview.client';
25
+ const cachedModel = MODEL_CACHE[key];
26
+ if (cachedModel) {
27
+ return cachedModel;
28
+ }
29
+ const bundle = await getResourceBundle(key);
30
+ const model = new ResourceModel({
31
+ bundle
32
+ });
33
+ MODEL_CACHE[key] = model;
34
+ return model;
35
+ }
36
+ class TextBundle {
37
+ constructor(bundle) {
38
+ this.bundle = bundle;
39
+ }
40
+ getText(key, args) {
41
+ return this.bundle.getText(key, args) ?? key;
42
+ }
43
+ }
44
+ async function getTextBundle() {
45
+ let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'open.ux.preview.client';
46
+ const bundle = await getResourceBundle(key);
47
+ return new TextBundle(bundle);
48
+ }
49
+ var __exports = {
50
+ __esModule: true
51
+ };
52
+ __exports.getResourceBundle = getResourceBundle;
53
+ __exports.getResourceModel = getResourceModel;
54
+ __exports.TextBundle = TextBundle;
55
+ __exports.getTextBundle = getTextBundle;
56
+ return __exports;
57
57
  });
58
58
  //# sourceMappingURL=i18n.js.map
@@ -1,3 +1,4 @@
1
+ CREATE_BUTTON_LABEL=Create
1
2
  CANCEL_BUTTON_LABEL=Cancel
2
3
 
3
4
  QUICK_ACTION_ADD_PAGE_CONTROLLER=Add Controller to Page
@@ -13,6 +14,7 @@ QUICK_ACTION_ENABLE_TABLE_FILTERING=Enable Table Filtering for Page Variants
13
14
  QUICK_ACTION_ENABLE_TABLE_EMPTY_ROW_MODE=Enable Empty Row Mode for Tables
14
15
  QUICK_ACTION_ENABLE_TABLES_AND_CHARTS_VARIANT_MANAGEMENT=Enable Variant Management in Tables and Charts
15
16
  QUICK_ACTION_ENABLE_TABLES_AND_VARIANT_MANAGEMENT=Enable Variant Management in Tables
17
+ QUICK_ACTION_ADD_NEW_SUB_PAGE=Add Subpage
16
18
 
17
19
  V2_QUICK_ACTION_CHANGE_TABLE_COLUMNS=Change Table Columns
18
20
  V2_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR=Enable "Clear" Button in Filter Bar
@@ -31,6 +33,8 @@ ADP_ADD_FRAGMENT_DIALOG_INDEX_LABEL = Index
31
33
  ADP_ADD_FRAGMENT_DIALOG_FRAGMENT_NAME_LABEL = Fragment Name
32
34
  ADP_ADD_FRAGMENT_DIALOG_COLUMN_FRAGMENT_NAME_LABEL = Column Fragment Name
33
35
  ADP_ADD_FRAGMENT_DIALOG_CELL_FRAGMENT_NAME_LABEL = Cell Fragment Name
36
+ ADP_ADD_SUB_PAGE_DIALOG_PAGE_TYPE_LABEL = Page Type
37
+ ADP_ADD_SUB_PAGE_DIALOG_NAVIGATION_LABEL = Navigation
34
38
  ADP_ADD_FRAGMENT_NOTIFICATION = Note: The "{0}.fragment.xml" fragment will be created once you save the change.
35
39
  ADP_ADD_FRAGMENT_WITH_TEMPLATE_NOTIFICATION = Note: The "{0}.fragment.xml" fragment will be created once you save the changes.
36
40
  ADP_ADD_TWO_FRAGMENTS_WITH_TEMPLATE_NOTIFICATION = Note: The "{0}.fragment.xml" and "{1}.fragment.xml" fragments will be created once you save the changes.
@@ -64,3 +68,5 @@ INVALID_BINDING_STRING_FORMAT=Invalid binding string. Supported value pattern is
64
68
  INVALID_BINDING_MODEL=Invalid binding model.
65
69
  INVALID_BINDING_MODEL_KEY=Invalid key in the binding string. Supported value pattern is {i18n>YOUR_KEY}. Check if the key already exists in i18n.properties.If not, add the key in the i18n.properties file and reload the editor for the new key to take effect.
66
70
 
71
+ NO_SUB_PAGES_TO_ADD=This option has been disabled because there are no subpages to add
72
+ ADD_SUB_PAGE_DIALOG_TITLE=Add Subpage
@@ -1,34 +1,34 @@
1
- "use strict";
2
-
3
- sap.ui.define([], function () {
4
- "use strict";
5
-
6
- /**
7
- * Determines application type based on the manifest.json.
8
- *
9
- * @param manifest - Application Manifest.
10
- * @returns Application type.
11
- */
12
- function getApplicationType(manifest) {
13
- if (manifest['sap.ui.generic.app'] || manifest['sap.ovp']) {
14
- return 'fe-v2';
15
- } else if (manifest['sap.ui5']?.routing?.targets) {
16
- let hasV4pPages = false;
17
- Object.keys(manifest?.['sap.ui5']?.routing?.targets ?? []).forEach(target => {
18
- if (manifest?.['sap.ui5']?.routing?.targets?.[target]?.name?.startsWith('sap.fe.templates.')) {
19
- hasV4pPages = true;
20
- }
21
- });
22
- if (hasV4pPages) {
23
- return 'fe-v4';
24
- }
25
- }
26
- return 'freestyle';
27
- }
28
- var __exports = {
29
- __esModule: true
30
- };
31
- __exports.getApplicationType = getApplicationType;
32
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define([], function () {
4
+ "use strict";
5
+
6
+ /**
7
+ * Determines application type based on the manifest.json.
8
+ *
9
+ * @param manifest - Application Manifest.
10
+ * @returns Application type.
11
+ */
12
+ function getApplicationType(manifest) {
13
+ if (manifest['sap.ui.generic.app'] || manifest['sap.ovp']) {
14
+ return 'fe-v2';
15
+ } else if (manifest['sap.ui5']?.routing?.targets) {
16
+ let hasV4pPages = false;
17
+ Object.keys(manifest?.['sap.ui5']?.routing?.targets ?? []).forEach(target => {
18
+ if (manifest?.['sap.ui5']?.routing?.targets?.[target]?.name?.startsWith('sap.fe.templates.')) {
19
+ hasV4pPages = true;
20
+ }
21
+ });
22
+ if (hasV4pPages) {
23
+ return 'fe-v4';
24
+ }
25
+ }
26
+ return 'freestyle';
27
+ }
28
+ var __exports = {
29
+ __esModule: true
30
+ };
31
+ __exports.getApplicationType = getApplicationType;
32
+ return __exports;
33
33
  });
34
34
  //# sourceMappingURL=application.js.map
@@ -1,70 +1,70 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/core/Component", "sap/ui/core/Element"], function (Component, Element) {
4
- "use strict";
5
-
6
- /**
7
- * Gets Component by id.
8
- *
9
- * @param id - unique identifier for control
10
- * @returns Component | undefined
11
- */
12
- function getComponent(id) {
13
- if (Component?.getComponentById) {
14
- return Component.getComponentById(id);
15
- } else if (Component?.get) {
16
- // Older version must be still supported until maintenance period.
17
- return Component.get(id); // NOSONAR
18
- } else {
19
- // Older version must be still supported until maintenance period.
20
- return sap.ui.getCore().getComponent(id); // NOSONAR
21
- }
22
- }
23
-
24
- /**
25
- * Returns control by its global ID.
26
- *
27
- * @param id Id of the control.
28
- * @returns Control instance if it exists.
29
- */
30
- function getControlById(id) {
31
- if (typeof Element.getElementById === 'function') {
32
- return Element.getElementById(id);
33
- } else {
34
- return sap.ui.getCore().byId(id);
35
- }
36
- }
37
-
38
- /**
39
- * Checks wether this object is an instance of a ManagedObject.
40
- *
41
- * @param element An object.
42
- * @returns True if element is an instance of a ManagedObject.
43
- */
44
- function isManagedObject(element) {
45
- if (typeof element?.isA === 'function') {
46
- return element.isA('sap.ui.base.ManagedObject');
47
- }
48
- return false;
49
- }
50
-
51
- /**
52
- * Checks whether this object is an instance of the named type.
53
- *
54
- * @param type - Type to check for.
55
- * @param element - Object to check
56
- * @returns Whether this object is an instance of the given type.
57
- */
58
- function isA(type, element) {
59
- return !!element?.isA(type);
60
- }
61
- var __exports = {
62
- __esModule: true
63
- };
64
- __exports.getComponent = getComponent;
65
- __exports.getControlById = getControlById;
66
- __exports.isManagedObject = isManagedObject;
67
- __exports.isA = isA;
68
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/core/Component", "sap/ui/core/Element"], function (Component, Element) {
4
+ "use strict";
5
+
6
+ /**
7
+ * Gets Component by id.
8
+ *
9
+ * @param id - unique identifier for control
10
+ * @returns Component | undefined
11
+ */
12
+ function getComponent(id) {
13
+ if (Component?.getComponentById) {
14
+ return Component.getComponentById(id);
15
+ } else if (Component?.get) {
16
+ // Older version must be still supported until maintenance period.
17
+ return Component.get(id); // NOSONAR
18
+ } else {
19
+ // Older version must be still supported until maintenance period.
20
+ return sap.ui.getCore().getComponent(id); // NOSONAR
21
+ }
22
+ }
23
+
24
+ /**
25
+ * Returns control by its global ID.
26
+ *
27
+ * @param id Id of the control.
28
+ * @returns Control instance if it exists.
29
+ */
30
+ function getControlById(id) {
31
+ if (typeof Element.getElementById === 'function') {
32
+ return Element.getElementById(id);
33
+ } else {
34
+ return sap.ui.getCore().byId(id);
35
+ }
36
+ }
37
+
38
+ /**
39
+ * Checks wether this object is an instance of a ManagedObject.
40
+ *
41
+ * @param element An object.
42
+ * @returns True if element is an instance of a ManagedObject.
43
+ */
44
+ function isManagedObject(element) {
45
+ if (typeof element?.isA === 'function') {
46
+ return element.isA('sap.ui.base.ManagedObject');
47
+ }
48
+ return false;
49
+ }
50
+
51
+ /**
52
+ * Checks whether this object is an instance of the named type.
53
+ *
54
+ * @param type - Type to check for.
55
+ * @param element - Object to check
56
+ * @returns Whether this object is an instance of the given type.
57
+ */
58
+ function isA(type, element) {
59
+ return !!element?.isA(type);
60
+ }
61
+ var __exports = {
62
+ __esModule: true
63
+ };
64
+ __exports.getComponent = getComponent;
65
+ __exports.getControlById = getControlById;
66
+ __exports.isManagedObject = isManagedObject;
67
+ __exports.isA = isA;
68
+ return __exports;
69
69
  });
70
70
  //# sourceMappingURL=core.js.map
@@ -1,21 +1,21 @@
1
- "use strict";
2
-
3
- sap.ui.define([], function () {
4
- "use strict";
5
-
6
- /**
7
- * Returns the Error if the error is an instance of `Error` otherwise a new Error instance with string representation of the error.
8
- *
9
- * @param error {unknown} - the error instance
10
- * @returns {Error} the error
11
- */
12
- function getError(error) {
13
- return error instanceof Error ? error : new Error(JSON.stringify(error));
14
- }
15
- var __exports = {
16
- __esModule: true
17
- };
18
- __exports.getError = getError;
19
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define([], function () {
4
+ "use strict";
5
+
6
+ /**
7
+ * Returns the Error if the error is an instance of `Error` otherwise a new Error instance with string representation of the error.
8
+ *
9
+ * @param error {unknown} - the error instance
10
+ * @returns {Error} the error
11
+ */
12
+ function getError(error) {
13
+ return error instanceof Error ? error : new Error(JSON.stringify(error));
14
+ }
15
+ var __exports = {
16
+ __esModule: true
17
+ };
18
+ __exports.getError = getError;
19
+ return __exports;
20
20
  });
21
21
  //# sourceMappingURL=error.js.map
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ sap.ui.define([], function () {
4
+ "use strict";
5
+
6
+ const OBJECT_PAGE_COMPONENT_NAME = 'sap.suite.ui.generic.template.ObjectPage';
7
+
8
+ /**
9
+ * Returns application object page definitions found in manifest
10
+ *
11
+ * @param manifest - manifest object
12
+ * @returns array with page descriptors
13
+ */
14
+ function getV2ApplicationPages(manifest) {
15
+ // do we need to distinguish both navigation source and target entitySets to differentiate alternative routes?
16
+ const rootEntry = manifest['sap.ui.generic.app'] || manifest['sap.ovp'];
17
+ if (rootEntry) {
18
+ const result = [];
19
+ const collectPageData = (pagesDefinitions, idPrefix) => {
20
+ if (!pagesDefinitions) {
21
+ return;
22
+ }
23
+ if (Array.isArray(pagesDefinitions)) {
24
+ pagesDefinitions.forEach((entry, idx) => {
25
+ const id = `${idPrefix}-${idx}`;
26
+ if (entry.component.name === OBJECT_PAGE_COMPONENT_NAME) {
27
+ result.push({
28
+ id,
29
+ entitySet: entry.entitySet
30
+ });
31
+ }
32
+ collectPageData(entry.pages, id);
33
+ });
34
+ } else {
35
+ const pageIds = Object.keys(pagesDefinitions);
36
+ for (const pageId of pageIds) {
37
+ if (pagesDefinitions[pageId].component.name === OBJECT_PAGE_COMPONENT_NAME) {
38
+ result.push({
39
+ id: pageId,
40
+ entitySet: pagesDefinitions[pageId].entitySet
41
+ });
42
+ }
43
+ collectPageData(pagesDefinitions[pageId].pages, idPrefix);
44
+ }
45
+ }
46
+ };
47
+ collectPageData(rootEntry.pages, 'page');
48
+ return result;
49
+ }
50
+ return [];
51
+ }
52
+ var __exports = {
53
+ __esModule: true
54
+ };
55
+ __exports.getV2ApplicationPages = getV2ApplicationPages;
56
+ return __exports;
57
+ });
58
+ //# sourceMappingURL=fe-v2.js.map
@@ -0,0 +1,63 @@
1
+ import type { Manifest } from 'sap/ui/rta/RuntimeAuthoring';
2
+
3
+ interface V2ManifestPageDefinition {
4
+ component: {
5
+ name: string;
6
+ };
7
+ entitySet: string;
8
+ pages?: Record<string, V2ManifestPageDefinition> | Array<V2ManifestPageDefinition>;
9
+ }
10
+
11
+ const OBJECT_PAGE_COMPONENT_NAME = 'sap.suite.ui.generic.template.ObjectPage';
12
+
13
+ /**
14
+ * Returns application object page definitions found in manifest
15
+ *
16
+ * @param manifest - manifest object
17
+ * @returns array with page descriptors
18
+ */
19
+ export function getV2ApplicationPages(manifest: Manifest): { id: string; entitySet: string | undefined }[] {
20
+ // do we need to distinguish both navigation source and target entitySets to differentiate alternative routes?
21
+ const rootEntry = manifest['sap.ui.generic.app'] || manifest['sap.ovp'];
22
+ if (rootEntry) {
23
+ const result: { id: string; entitySet: string | undefined }[] = [];
24
+
25
+ const collectPageData = <
26
+ T extends Record<string, V2ManifestPageDefinition> | Array<V2ManifestPageDefinition>
27
+ >(
28
+ pagesDefinitions: T | undefined,
29
+ idPrefix: string
30
+ ) => {
31
+ if (!pagesDefinitions) {
32
+ return;
33
+ }
34
+
35
+ if (Array.isArray(pagesDefinitions)) {
36
+ pagesDefinitions.forEach((entry, idx) => {
37
+ const id = `${idPrefix}-${idx}`;
38
+ if (entry.component.name === OBJECT_PAGE_COMPONENT_NAME) {
39
+ result.push({
40
+ id,
41
+ entitySet: entry.entitySet
42
+ });
43
+ }
44
+ collectPageData(entry.pages, id);
45
+ });
46
+ } else {
47
+ const pageIds = Object.keys(pagesDefinitions);
48
+ for (const pageId of pageIds) {
49
+ if (pagesDefinitions[pageId].component.name === OBJECT_PAGE_COMPONENT_NAME) {
50
+ result.push({
51
+ id: pageId,
52
+ entitySet: pagesDefinitions[pageId].entitySet
53
+ });
54
+ }
55
+ collectPageData(pagesDefinitions[pageId].pages, idPrefix);
56
+ }
57
+ }
58
+ };
59
+ collectPageData(rootEntry.pages, 'page');
60
+ return result;
61
+ }
62
+ return [];
63
+ }