@sap-ux/preview-middleware 0.19.7 → 0.19.8

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,88 @@
1
+ import ODataModelV2 from 'sap/ui/model/odata/v2/ODataModel';
2
+ import ODataMetaModelV2, { EntityContainer, EntitySet, EntityType } from 'sap/ui/model/odata/ODataMetaModel';
3
+ import TemplateComponent from 'sap/suite/ui/generic/template/lib/TemplateComponent';
4
+ import type AppComponent from 'sap/suite/ui/generic/template/lib/AppComponent';
5
+
6
+ import { getV2ApplicationPages } from '../../../utils/fe-v2';
7
+ import { AddNewSubpageBase, ApplicationPageData } from '../add-new-subpage-quick-action-base';
8
+ import Component from 'sap/ui/core/Component';
9
+ import { isA } from '../../../utils/core';
10
+ import { areManifestChangesSupported, getV2AppComponent } from './utils';
11
+ import { PageDescriptorV2 } from '../../controllers/AddSubpage.controller';
12
+
13
+ const OBJECT_PAGE_COMPONENT_NAME_V2 = 'sap.suite.ui.generic.template.ObjectPage';
14
+
15
+ /**
16
+ * Quick Action for adding a custom page action.
17
+ */
18
+ export class AddNewSubpage extends AddNewSubpageBase<ODataMetaModelV2> {
19
+ protected appComponent: AppComponent | undefined;
20
+
21
+ protected get currentPageDescriptor(): PageDescriptorV2 {
22
+ if (!this.entitySet) {
23
+ throw new Error('entitySet is not defined');
24
+ }
25
+ if (!this.pageType) {
26
+ throw new Error('pageType is not defined');
27
+ }
28
+ if (!this.appComponent) {
29
+ throw new Error('appComponent is not defined');
30
+ }
31
+ return {
32
+ appType: 'fe-v2',
33
+ appComponent: this.appComponent,
34
+ entitySet: this.entitySet,
35
+ pageType: this.pageType
36
+ };
37
+ }
38
+
39
+ protected getApplicationPages(): ApplicationPageData[] {
40
+ return getV2ApplicationPages(this.context.manifest);
41
+ }
42
+
43
+ protected isPageExists(targetEntitySet: string): boolean {
44
+ return this.existingPages.some((page) => page.entitySet === targetEntitySet);
45
+ }
46
+
47
+ protected isCurrentObjectPage(): boolean {
48
+ return this.pageType === OBJECT_PAGE_COMPONENT_NAME_V2;
49
+ }
50
+
51
+ protected getODataMetaModel(): ODataMetaModelV2 | undefined {
52
+ return (this.context.rta.getRootControlInstance().getModel() as ODataModelV2)?.getMetaModel();
53
+ }
54
+
55
+ protected getEntitySetNameFromPageComponent(component: Component | undefined): string {
56
+ if (!isA<TemplateComponent>('sap.suite.ui.generic.template.lib.TemplateComponent', component)) {
57
+ throw new Error('Unexpected type of page owner component');
58
+ }
59
+ return component.getEntitySet();
60
+ }
61
+
62
+ protected async prepareNavigationData(entitySetName: string, metaModel: ODataMetaModelV2): Promise<void> {
63
+ const entitySet = metaModel.getODataEntitySet(entitySetName) as EntitySet;
64
+ const entityType = metaModel.getODataEntityType(entitySet.entityType) as EntityType;
65
+
66
+ for (const navProp of entityType?.navigationProperty || []) {
67
+ const associationEnd = metaModel.getODataAssociationEnd(entityType, navProp.name);
68
+ if (associationEnd?.multiplicity !== '*') {
69
+ continue;
70
+ }
71
+ const entityContainer = metaModel.getODataEntityContainer() as EntityContainer;
72
+ if (!entityContainer?.entitySet?.length) {
73
+ continue;
74
+ }
75
+ const targetEntitySet = entityContainer.entitySet.find((item) => item.entityType === associationEnd.type);
76
+ await this.addNavigationOptionIfAvailable(metaModel, targetEntitySet?.name, navProp.name);
77
+ }
78
+ return Promise.resolve();
79
+ }
80
+
81
+ async initialize(): Promise<void> {
82
+ if (!(await areManifestChangesSupported(this.context.manifest))) {
83
+ return Promise.resolve();
84
+ }
85
+ this.appComponent = getV2AppComponent(this.context.view);
86
+ return super.initialize();
87
+ }
88
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/ComponentContainer", "../../../cpe/quick-actions/registry", "../common/add-controller-to-page", "./lr-toggle-clear-filter-bar", "./change-table-columns", "../common/op-add-header-field", "../common/op-add-custom-section", "../fe-v2/create-table-action", "./create-table-custom-column", "../common/create-page-action", "./lr-enable-table-filtering", "./lr-enable-semantic-date-range-filter-bar", "./op-enable-empty-row-mode", "../common/add-new-annotation-file", "./op-enable-variant-management", "./lr-enable-variant-management", "../common/add-new-subpage"], function (XMLView, ComponentContainer, _____cpe_quick_actions_registry, ___common_add_controller_to_page, ___lr_toggle_clear_filter_bar, ___change_table_columns, ___common_op_add_header_field, ___common_op_add_custom_section, ___fe_v2_create_table_action, ___create_table_custom_column, ___common_create_page_action, ___lr_enable_table_filtering, ___lr_enable_semantic_date_range_filter_bar, ___op_enable_empty_row_mode, ___common_add_new_annotation_file, ___op_enable_variant_management, ___lr_enable_variant_management, ___common_add_new_subpage) {
3
+ sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/ComponentContainer", "../../../cpe/quick-actions/registry", "../common/add-controller-to-page", "./lr-toggle-clear-filter-bar", "./change-table-columns", "../common/op-add-header-field", "../common/op-add-custom-section", "../fe-v2/create-table-action", "./create-table-custom-column", "../common/create-page-action", "./lr-enable-table-filtering", "./lr-enable-semantic-date-range-filter-bar", "./op-enable-empty-row-mode", "../common/add-new-annotation-file", "./op-enable-variant-management", "./lr-enable-variant-management", "../fe-v2/add-new-subpage"], function (XMLView, ComponentContainer, _____cpe_quick_actions_registry, ___common_add_controller_to_page, ___lr_toggle_clear_filter_bar, ___change_table_columns, ___common_op_add_header_field, ___common_op_add_custom_section, ___fe_v2_create_table_action, ___create_table_custom_column, ___common_create_page_action, ___lr_enable_table_filtering, ___lr_enable_semantic_date_range_filter_bar, ___op_enable_empty_row_mode, ___common_add_new_annotation_file, ___op_enable_variant_management, ___lr_enable_variant_management, ___fe_v2_add_new_subpage) {
4
4
  "use strict";
5
5
 
6
6
  const QuickActionDefinitionRegistry = _____cpe_quick_actions_registry["QuickActionDefinitionRegistry"];
@@ -18,7 +18,7 @@ sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/ComponentContainer", "../
18
18
  const AddNewAnnotationFile = ___common_add_new_annotation_file["AddNewAnnotationFile"];
19
19
  const EnableObjectPageVariantManagementQuickAction = ___op_enable_variant_management["EnableObjectPageVariantManagementQuickAction"];
20
20
  const EnableListReportVariantManagementQuickAction = ___lr_enable_variant_management["EnableListReportVariantManagementQuickAction"];
21
- const AddNewSubpage = ___common_add_new_subpage["AddNewSubpage"];
21
+ const AddNewSubpage = ___fe_v2_add_new_subpage["AddNewSubpage"];
22
22
  const OBJECT_PAGE_TYPE = 'sap.suite.ui.generic.template.ObjectPage.view.Details';
23
23
  const LIST_REPORT_TYPE = 'sap.suite.ui.generic.template.ListReport.view.ListReport';
24
24
  const ANALYTICAL_LIST_PAGE_TYPE = 'sap.suite.ui.generic.template.AnalyticalListPage.view.AnalyticalListPage';
@@ -23,7 +23,7 @@ import { EnableTableEmptyRowModeQuickAction } from './op-enable-empty-row-mode';
23
23
  import { AddNewAnnotationFile } from '../common/add-new-annotation-file';
24
24
  import { EnableObjectPageVariantManagementQuickAction } from './op-enable-variant-management';
25
25
  import { EnableListReportVariantManagementQuickAction } from './lr-enable-variant-management';
26
- import { AddNewSubpage } from '../common/add-new-subpage';
26
+ import { AddNewSubpage } from '../fe-v2/add-new-subpage';
27
27
  type PageName = 'listReport' | 'objectPage' | 'analyticalListPage';
28
28
 
29
29
  const OBJECT_PAGE_TYPE = 'sap.suite.ui.generic.template.ObjectPage.view.Details';
@@ -0,0 +1,132 @@
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../../utils/fe-v4", "../add-new-subpage-quick-action-base", "../../../utils/core", "../../../utils/version"], function (_____utils_fe_v4, ___add_new_subpage_quick_action_base, _____utils_core, _____utils_version) {
4
+ "use strict";
5
+
6
+ const getV4AppComponent = _____utils_fe_v4["getV4AppComponent"];
7
+ const getV4ApplicationPages = _____utils_fe_v4["getV4ApplicationPages"];
8
+ const AddNewSubpageBase = ___add_new_subpage_quick_action_base["AddNewSubpageBase"];
9
+ const isA = _____utils_core["isA"];
10
+ const getUi5Version = _____utils_version["getUi5Version"];
11
+ const isLowerThanMinimalUi5Version = _____utils_version["isLowerThanMinimalUi5Version"];
12
+ const OBJECT_PAGE_COMPONENT_NAME_V4 = 'sap.fe.templates.ObjectPage.ObjectPage';
13
+ /**
14
+ * Quick Action for adding a custom page action.
15
+ */
16
+ class AddNewSubpage extends AddNewSubpageBase {
17
+ get currentPageDescriptor() {
18
+ if (!this.pageId) {
19
+ throw new Error('pageId is not defined');
20
+ }
21
+ if (!this.routePattern) {
22
+ throw new Error('routePattern is not defined');
23
+ }
24
+ if (!this.appComponent) {
25
+ throw new Error('appComponent is not defined');
26
+ }
27
+ return {
28
+ appType: 'fe-v4',
29
+ appComponent: this.appComponent,
30
+ pageId: this.pageId,
31
+ routePattern: this.routePattern
32
+ };
33
+ }
34
+ getApplicationPages() {
35
+ return getV4ApplicationPages(this.context.manifest);
36
+ }
37
+ async resolveContextPathTargetName(contextPath, metaModel) {
38
+ let result;
39
+ const segments = contextPath.split('/').filter(s => !!s);
40
+ if (segments.length === 1) {
41
+ // one segment - assumed it is the direct name of entitySet
42
+ result = segments[0];
43
+ } else {
44
+ // resolve segment by segment
45
+ let targetObject = await metaModel.requestObject(`/${segments[0]}`); // NO SONAR;
46
+
47
+ let idx = 1;
48
+ let targetSetName = '';
49
+ while (targetObject && idx < segments.length) {
50
+ const navProp = segments[idx];
51
+ targetSetName = targetObject.$NavigationPropertyBinding[navProp];
52
+ if (!targetSetName) {
53
+ targetObject = undefined;
54
+ } else {
55
+ targetObject = await metaModel.requestObject(`/${targetSetName}`); // NO SONAR;
56
+ idx++;
57
+ }
58
+ }
59
+ if (targetObject) {
60
+ result = targetSetName;
61
+ }
62
+ }
63
+ return result;
64
+ }
65
+ async isPageExists(targetEntitySet, metaModel) {
66
+ let pageFound = false;
67
+ let entitySetName;
68
+ for (const page of this.existingPages) {
69
+ if (page.contextPath) {
70
+ // resolve contextPath to target entitySet
71
+ entitySetName = await this.resolveContextPathTargetName(page.contextPath, metaModel);
72
+ } else {
73
+ entitySetName = page.entitySet;
74
+ }
75
+ if (entitySetName === targetEntitySet) {
76
+ pageFound = true;
77
+ break;
78
+ }
79
+ }
80
+ return pageFound;
81
+ }
82
+ isCurrentObjectPage() {
83
+ return this.pageType === OBJECT_PAGE_COMPONENT_NAME_V4;
84
+ }
85
+ getODataMetaModel() {
86
+ return this.context.rta.getRootControlInstance().getModel()?.getMetaModel();
87
+ }
88
+ getEntitySetNameFromPageComponent(component) {
89
+ if (!isA('sap.fe.templates.ListReport.Component', component) && !isA('sap.fe.templates.ObjectPage.Component', component)) {
90
+ throw new Error('Unexpected type of page owner component');
91
+ }
92
+ return component.getEntitySet();
93
+ }
94
+ async prepareNavigationData(entitySetName, metaModel) {
95
+ const entitySet = await metaModel.requestObject(`/${entitySetName}`); // NO SONAR;
96
+ const entityTypePath = entitySet.$Type;
97
+ const entitySetNavigationKeys = Object.keys(entitySet.$NavigationPropertyBinding);
98
+ for (const navigationProperty of entitySetNavigationKeys) {
99
+ const associationEnd = await metaModel.requestObject(`/${entityTypePath}/${navigationProperty}`);
100
+ if (associationEnd?.$isCollection) {
101
+ const targetEntitySet = entitySet.$NavigationPropertyBinding[navigationProperty];
102
+ await this.addNavigationOptionIfAvailable(metaModel, targetEntitySet, navigationProperty);
103
+ }
104
+ }
105
+ }
106
+ async initialize() {
107
+ const version = await getUi5Version();
108
+ if (isLowerThanMinimalUi5Version(version, {
109
+ major: 1,
110
+ minor: 135
111
+ })) {
112
+ return;
113
+ }
114
+ await super.initialize();
115
+ this.appComponent = getV4AppComponent(this.context.view);
116
+ this.pageId = this.context.view.getViewData()?.stableId.split('::').pop();
117
+ // remember current page route pattern (used in dialog controller for new page change)
118
+ const currentPageRoute = (this.context.manifest['sap.ui5'].routing?.routes ?? []).find(r => r.name === this.pageId);
119
+ if (!currentPageRoute) {
120
+ throw new Error('Current page navigation route not found in manifest');
121
+ }
122
+ this.routePattern = currentPageRoute.pattern;
123
+ }
124
+ }
125
+ var __exports = {
126
+ __esModule: true
127
+ };
128
+ __exports.OBJECT_PAGE_COMPONENT_NAME_V4 = OBJECT_PAGE_COMPONENT_NAME_V4;
129
+ __exports.AddNewSubpage = AddNewSubpage;
130
+ return __exports;
131
+ });
132
+ //# sourceMappingURL=add-new-subpage.js.map
@@ -0,0 +1,170 @@
1
+ import ODataModelV4 from 'sap/ui/model/odata/v4/ODataModel';
2
+ import ODataMetaModelV4 from 'sap/ui/model/odata/v4/ODataMetaModel';
3
+ import Component from 'sap/ui/core/Component';
4
+ import AppComponent from 'sap/fe/core/AppComponent';
5
+
6
+ import { getV4AppComponent, getV4ApplicationPages } from '../../../utils/fe-v4';
7
+ import { AddNewSubpageBase, ApplicationPageData } from '../add-new-subpage-quick-action-base';
8
+ import { isA } from '../../../utils/core';
9
+ import FEObjectPageComponent from 'sap/fe/templates/ObjectPage/Component';
10
+ import FEListReportComponent from 'sap/fe/templates/ListReport/Component';
11
+ import { getUi5Version, isLowerThanMinimalUi5Version } from '../../../utils/version';
12
+ import { PageDescriptorV4 } from '../../controllers/AddSubpage.controller';
13
+
14
+ export const OBJECT_PAGE_COMPONENT_NAME_V4 = 'sap.fe.templates.ObjectPage.ObjectPage';
15
+
16
+ interface ViewDataType {
17
+ stableId: string;
18
+ }
19
+
20
+ /**
21
+ * Quick Action for adding a custom page action.
22
+ */
23
+ export class AddNewSubpage extends AddNewSubpageBase<ODataMetaModelV4> {
24
+ protected pageId: string | undefined;
25
+ protected routePattern: string | undefined;
26
+ protected appComponent: AppComponent | undefined;
27
+
28
+ protected get currentPageDescriptor(): PageDescriptorV4 {
29
+ if (!this.pageId) {
30
+ throw new Error('pageId is not defined');
31
+ }
32
+ if (!this.routePattern) {
33
+ throw new Error('routePattern is not defined');
34
+ }
35
+ if (!this.appComponent) {
36
+ throw new Error('appComponent is not defined');
37
+ }
38
+ return {
39
+ appType: 'fe-v4',
40
+ appComponent: this.appComponent,
41
+ pageId: this.pageId,
42
+ routePattern: this.routePattern
43
+ };
44
+ }
45
+
46
+ protected getApplicationPages(): ApplicationPageData[] {
47
+ return getV4ApplicationPages(this.context.manifest);
48
+ }
49
+
50
+ private async resolveContextPathTargetName(
51
+ contextPath: string,
52
+ metaModel: ODataMetaModelV4
53
+ ): Promise<string | undefined> {
54
+ let result: string | undefined;
55
+ const segments = contextPath.split('/').filter((s) => !!s);
56
+ if (segments.length === 1) {
57
+ // one segment - assumed it is the direct name of entitySet
58
+ result = segments[0];
59
+ } else {
60
+ // resolve segment by segment
61
+ let targetObject = (await metaModel.requestObject(`/${segments[0]}`)) as
62
+ | {
63
+ $Type: string;
64
+ $NavigationPropertyBinding: { [key: string]: string };
65
+ }
66
+ | undefined; // NO SONAR;
67
+
68
+ let idx = 1;
69
+ let targetSetName = '';
70
+ while (targetObject && idx < segments.length) {
71
+ const navProp = segments[idx];
72
+ targetSetName = targetObject.$NavigationPropertyBinding[navProp];
73
+ if (!targetSetName) {
74
+ targetObject = undefined;
75
+ } else {
76
+ targetObject = (await metaModel.requestObject(`/${targetSetName}`)) as
77
+ | {
78
+ $Type: string;
79
+ $NavigationPropertyBinding: { [key: string]: string };
80
+ }
81
+ | undefined; // NO SONAR;
82
+ idx++;
83
+ }
84
+ }
85
+ if (targetObject) {
86
+ result = targetSetName;
87
+ }
88
+ }
89
+ return result;
90
+ }
91
+
92
+ protected async isPageExists(targetEntitySet: string, metaModel: ODataMetaModelV4): Promise<boolean> {
93
+ let pageFound = false;
94
+ let entitySetName: string | undefined;
95
+ for (const page of this.existingPages) {
96
+ if (page.contextPath) {
97
+ // resolve contextPath to target entitySet
98
+ entitySetName = await this.resolveContextPathTargetName(page.contextPath, metaModel);
99
+ } else {
100
+ entitySetName = page.entitySet;
101
+ }
102
+
103
+ if (entitySetName === targetEntitySet) {
104
+ pageFound = true;
105
+ break;
106
+ }
107
+ }
108
+
109
+ return pageFound;
110
+ }
111
+
112
+ protected isCurrentObjectPage(): boolean {
113
+ return this.pageType === OBJECT_PAGE_COMPONENT_NAME_V4;
114
+ }
115
+
116
+ protected getODataMetaModel(): ODataMetaModelV4 | undefined {
117
+ return (this.context.rta.getRootControlInstance().getModel() as ODataModelV4)?.getMetaModel();
118
+ }
119
+
120
+ protected getEntitySetNameFromPageComponent(component: Component | undefined): string {
121
+ if (
122
+ !isA<FEObjectPageComponent>('sap.fe.templates.ListReport.Component', component) &&
123
+ !isA<FEListReportComponent>('sap.fe.templates.ObjectPage.Component', component)
124
+ ) {
125
+ throw new Error('Unexpected type of page owner component');
126
+ }
127
+ return component.getEntitySet();
128
+ }
129
+
130
+ protected async prepareNavigationData(entitySetName: string, metaModel: ODataMetaModelV4) {
131
+ const entitySet = (await metaModel.requestObject(`/${entitySetName}`)) as {
132
+ $Type: string;
133
+ $NavigationPropertyBinding: { [key: string]: string };
134
+ }; // NO SONAR;
135
+ const entityTypePath = entitySet.$Type;
136
+ const entitySetNavigationKeys = Object.keys(entitySet.$NavigationPropertyBinding);
137
+
138
+ for (const navigationProperty of entitySetNavigationKeys) {
139
+ const associationEnd = (await metaModel.requestObject(`/${entityTypePath}/${navigationProperty}`)) as {
140
+ $Type: string;
141
+ $isCollection: boolean;
142
+ $kind: 'NavigationProperty';
143
+ };
144
+ if (associationEnd?.$isCollection) {
145
+ const targetEntitySet = entitySet.$NavigationPropertyBinding[navigationProperty];
146
+ await this.addNavigationOptionIfAvailable(metaModel, targetEntitySet, navigationProperty);
147
+ }
148
+ }
149
+ }
150
+
151
+ async initialize(): Promise<void> {
152
+ const version = await getUi5Version();
153
+ if (isLowerThanMinimalUi5Version(version, { major: 1, minor: 135 })) {
154
+ return;
155
+ }
156
+ await super.initialize();
157
+
158
+ this.appComponent = getV4AppComponent(this.context.view);
159
+
160
+ this.pageId = (this.context.view.getViewData() as ViewDataType)?.stableId.split('::').pop() as string;
161
+ // remember current page route pattern (used in dialog controller for new page change)
162
+ const currentPageRoute = (this.context.manifest['sap.ui5'].routing?.routes ?? []).find(
163
+ (r) => r.name === this.pageId
164
+ );
165
+ if (!currentPageRoute) {
166
+ throw new Error('Current page navigation route not found in manifest');
167
+ }
168
+ this.routePattern = currentPageRoute.pattern;
169
+ }
170
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- sap.ui.define(["../../../cpe/quick-actions/registry", "../common/add-controller-to-page", "./lr-toggle-clear-filter-bar", "./change-table-columns", "../common/op-add-header-field", "../common/op-add-custom-section", "./create-table-custom-column", "../common/create-page-action", "./create-table-action", "./lr-enable-table-filtering", "./lr-enable-semantic-date-range-filter-bar", "./op-enable-empty-row-mode", "../common/add-new-annotation-file", "./enable-variant-management"], function (_____cpe_quick_actions_registry, ___common_add_controller_to_page, ___lr_toggle_clear_filter_bar, ___change_table_columns, ___common_op_add_header_field, ___common_op_add_custom_section, ___create_table_custom_column, ___common_create_page_action, ___create_table_action, ___lr_enable_table_filtering, ___lr_enable_semantic_date_range_filter_bar, ___op_enable_empty_row_mode, ___common_add_new_annotation_file, ___enable_variant_management) {
3
+ sap.ui.define(["../../../cpe/quick-actions/registry", "../common/add-controller-to-page", "./lr-toggle-clear-filter-bar", "./change-table-columns", "../common/op-add-header-field", "../common/op-add-custom-section", "./create-table-custom-column", "../common/create-page-action", "./create-table-action", "./lr-enable-table-filtering", "./lr-enable-semantic-date-range-filter-bar", "./op-enable-empty-row-mode", "../common/add-new-annotation-file", "./enable-variant-management", "../fe-v4/add-new-subpage"], function (_____cpe_quick_actions_registry, ___common_add_controller_to_page, ___lr_toggle_clear_filter_bar, ___change_table_columns, ___common_op_add_header_field, ___common_op_add_custom_section, ___create_table_custom_column, ___common_create_page_action, ___create_table_action, ___lr_enable_table_filtering, ___lr_enable_semantic_date_range_filter_bar, ___op_enable_empty_row_mode, ___common_add_new_annotation_file, ___enable_variant_management, ___fe_v4_add_new_subpage) {
4
4
  "use strict";
5
5
 
6
6
  const QuickActionDefinitionRegistry = _____cpe_quick_actions_registry["QuickActionDefinitionRegistry"];
@@ -17,6 +17,7 @@ sap.ui.define(["../../../cpe/quick-actions/registry", "../common/add-controller-
17
17
  const EnableTableEmptyRowModeQuickAction = ___op_enable_empty_row_mode["EnableTableEmptyRowModeQuickAction"];
18
18
  const AddNewAnnotationFile = ___common_add_new_annotation_file["AddNewAnnotationFile"];
19
19
  const EnableVariantManagementQuickAction = ___enable_variant_management["EnableVariantManagementQuickAction"];
20
+ const AddNewSubpage = ___fe_v4_add_new_subpage["AddNewSubpage"];
20
21
  const LIST_REPORT_TYPE = 'sap.fe.templates.ListReport.ListReport';
21
22
  const OBJECT_PAGE_TYPE = 'sap.fe.templates.ObjectPage.ObjectPage';
22
23
 
@@ -39,14 +40,14 @@ sap.ui.define(["../../../cpe/quick-actions/registry", "../common/add-controller-
39
40
  if (name === 'listReport') {
40
41
  definitionGroups.push({
41
42
  title: 'LIST REPORT',
42
- definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, ToggleClearFilterBarQuickAction, ToggleSemanticDateRangeFilterBar, EnableVariantManagementQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableFilteringQuickAction, AddNewAnnotationFile],
43
+ definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, ToggleClearFilterBarQuickAction, ToggleSemanticDateRangeFilterBar, EnableVariantManagementQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableFilteringQuickAction, AddNewAnnotationFile, AddNewSubpage],
43
44
  view,
44
45
  key: name + index
45
46
  });
46
47
  } else if (name === 'objectPage') {
47
48
  definitionGroups.push({
48
49
  title: 'OBJECT PAGE',
49
- definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction, ChangeTableColumnsQuickAction, EnableVariantManagementQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableEmptyRowModeQuickAction, AddNewAnnotationFile],
50
+ definitions: [AddControllerToPageQuickAction, AddPageActionQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction, ChangeTableColumnsQuickAction, EnableVariantManagementQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, EnableTableEmptyRowModeQuickAction, AddNewAnnotationFile, AddNewSubpage],
50
51
  view,
51
52
  key: name + index
52
53
  });
@@ -17,6 +17,7 @@ import { ToggleSemanticDateRangeFilterBar } from './lr-enable-semantic-date-rang
17
17
  import { EnableTableEmptyRowModeQuickAction } from './op-enable-empty-row-mode';
18
18
  import { AddNewAnnotationFile } from '../common/add-new-annotation-file';
19
19
  import { EnableVariantManagementQuickAction } from './enable-variant-management';
20
+ import { AddNewSubpage } from '../fe-v4/add-new-subpage';
20
21
 
21
22
  type PageName = 'listReport' | 'objectPage';
22
23
 
@@ -50,7 +51,8 @@ export default class FEV4QuickActionRegistry extends QuickActionDefinitionRegist
50
51
  AddTableActionQuickAction,
51
52
  AddTableCustomColumnQuickAction,
52
53
  EnableTableFilteringQuickAction,
53
- AddNewAnnotationFile
54
+ AddNewAnnotationFile,
55
+ AddNewSubpage
54
56
  ],
55
57
  view,
56
58
  key: name + index
@@ -68,7 +70,8 @@ export default class FEV4QuickActionRegistry extends QuickActionDefinitionRegist
68
70
  AddTableActionQuickAction,
69
71
  AddTableCustomColumnQuickAction,
70
72
  EnableTableEmptyRowModeQuickAction,
71
- AddNewAnnotationFile
73
+ AddNewAnnotationFile,
74
+ AddNewSubpage
72
75
  ],
73
76
  view,
74
77
  key: name + index
@@ -40,10 +40,35 @@ sap.ui.define(["../../../utils/core", "sap/ui/rta/command/CommandFactory", "../.
40
40
  }
41
41
  return [];
42
42
  }
43
+ const PATTERN_SUFFIX = ':?query:';
44
+
45
+ /**
46
+ * Generates the pattern for a new route based on the input.
47
+ *
48
+ * @param sourceRoutePattern source page route pattern
49
+ * @param navProperty navigation property name (used to build nav pattern for nested OP )
50
+ * @param targetEntitySet navigation target entity set
51
+ * @returns the generated pattern as string
52
+ */
53
+ function generateRoutePattern(sourceRoutePattern, navProperty, targetEntitySet) {
54
+ const parts = [];
55
+ const basePattern = sourceRoutePattern.replace(PATTERN_SUFFIX, '');
56
+ if (basePattern) {
57
+ parts.push(basePattern);
58
+ parts.push('/');
59
+ parts.push(navProperty);
60
+ } else {
61
+ parts.push(targetEntitySet);
62
+ }
63
+ parts.push(`({${targetEntitySet}Key})`);
64
+ parts.push(PATTERN_SUFFIX);
65
+ return parts.join('');
66
+ }
43
67
  var __exports = {
44
68
  __esModule: true
45
69
  };
46
70
  __exports.executeToggleAction = executeToggleAction;
71
+ __exports.generateRoutePattern = generateRoutePattern;
47
72
  return __exports;
48
73
  });
49
74
  //# sourceMappingURL=utils.js.map
@@ -51,3 +51,32 @@ export async function executeToggleAction(
51
51
 
52
52
  return [];
53
53
  }
54
+
55
+ const PATTERN_SUFFIX = ':?query:';
56
+
57
+ /**
58
+ * Generates the pattern for a new route based on the input.
59
+ *
60
+ * @param sourceRoutePattern source page route pattern
61
+ * @param navProperty navigation property name (used to build nav pattern for nested OP )
62
+ * @param targetEntitySet navigation target entity set
63
+ * @returns the generated pattern as string
64
+ */
65
+ export function generateRoutePattern(
66
+ sourceRoutePattern: string,
67
+ navProperty: string,
68
+ targetEntitySet: string
69
+ ): string {
70
+ const parts: string[] = [];
71
+ const basePattern = sourceRoutePattern.replace(PATTERN_SUFFIX, '');
72
+ if (basePattern) {
73
+ parts.push(basePattern);
74
+ parts.push('/');
75
+ parts.push(navProperty);
76
+ } else {
77
+ parts.push(targetEntitySet);
78
+ }
79
+ parts.push(`({${targetEntitySet}Key})`);
80
+ parts.push(PATTERN_SUFFIX);
81
+ return parts.join('');
82
+ }
@@ -1,39 +1,40 @@
1
1
  # Supported UI5 Versions for Quick Actions in Adaptation Projects Based on Fiori Elements Applications with OData V2 and OData V4
2
2
 
3
+ | Quick Action | OData Version | Page Type** | 1.71| 1.84| 1.96|1.108|1.120|1.124|1.127|1.130|1.131|>=1.132.0|>=1.135.0|
4
+ |----------------------------------------------------|---------------|-------------|-----|-----|-----|-----|-----|-----|-----|-----|-----|---------|---------|
5
+ | Add Controller to Page | V2 | LR, ALP, OP | x | x | x | x | x | x | x | x | x | x | x |
6
+ | | V4 | LR, ALP, OP | x | x | x | x | x | x | x | x | x | x | x |
7
+ | Add Header Field | V2 | OP | x | x | x | x | x | x | x | x | x | x | x |
8
+ | | V4 | OP | x | x | x | x | x | x | x | x | x | x | x |
9
+ | Add Custom Section | V2 | OP | x | x | x | x | x | x | x | x | x | x | x |
10
+ | | V4 | OP | x | x | x | x | x | x | x | x | x | x | x |
11
+ | Add Custom Page Action | V2 | LR, ALP, OP | | | | | | | | x | x | x | x |
12
+ | | V4 | LR, ALP, OP | | | | | | | | x | x | x | x |
13
+ | Add Custom Table Action | V2 | LR, ALP, OP | | | x | x | x | x | x | x | x | x | x |
14
+ | | V4 | LR, ALP, OP | | | x | x | x | x | x | x | x | x | x |
15
+ | Add Custom Table Column | V2 | LR, ALP, OP | | | x | x | x | x | x | x | x | x | x |
16
+ | | V4 | LR, ALP, OP | | | x | x | x | x | x | x | x | x | x |
17
+ | Change Table Columns | V2 | LR, ALP, OP | | | x | x | x | x | x | x | x | x | x |
18
+ | | V4 | LR, ALP, OP | | | x | x | x | x | x | x | x | x | x |
19
+ | Enable/Disable "Clear" Button | V2 | LR, ALP | x | x | x | x | x | x | x | x | x | x | x |
20
+ | | V4 | LR, ALP | x | x | x | x | x | x | x | x | x | x | x |
21
+ | Enable Semantic Date Range* | V2 | LR, ALP | | | x | x | x | | | x | x | x | x |
22
+ | | V4 | LR, ALP | | | | | | | | x | x | x | x |
23
+ | Enable Table Filtering for Page Variants* | V2 | LR, ALP | | | x | x | x | | | x | x | x | x |
24
+ | | V4 | LR, ALP | | | | | | | | | x | x | x |
25
+ | Add Local Annotation File* | V2 | LR, ALP, OP | | | | | | | | | | x | x |
26
+ | | V4 | LR, ALP, OP | | | | | | | | | | x | x |
27
+ | Enable Empty Row Mode for Tables* | V2 | OP | | | | | | | | x | x | x | x |
28
+ | | V4 | OP | | | | | | | | | x | x | x |
29
+ | Enable Variant Management in Tables and Charts* | V2 | LR, ALP | | | x | x | x | | | x | x | x | x |
30
+ | | V4 | LR, ALP, OP | | | | | | | | | x | x | x |
31
+ | Enable Variant Management in Tables* | V2 | OP | | | x | x | x | | | x | x | x | x |
32
+ | | V4 | | | | | | | | | | | | |
33
+ | Add Subpage* | V2 | LR, ALP, OP | | | x | x | x | | | x | x | x | x |
34
+ | | V4 | LR, ALP, OP | | | | | | | | | | | x |
3
35
 
4
36
 
5
- Here’s the updated table with the additional column titled ">= SAPUI5 1.132.0":
37
+ *Actions resulting in manifest changes are not available for adaptation projects built for OData v2 applications using outdated array page structure in manifest.json.
6
38
 
7
- | Quick Action | OData Version | Page Type | SAPUI5 1.71 | SAPUI5 1.84 | SAPUI5 1.96 | SAPUI5 1.108 | SAPUI5 1.120 | SAPUI5 1.24 | SAPUI5 1.27 | SAPUI5 1.130 | SAPUI5 1.131 | >= SAPUI5 1.132.0 |
8
- | ---------------------------------------- | ------------- | --------------------------------------- | ----------- | ----------- | ----------- | ------------ | ------------ | ----------- | ----------- | ------------ | ------------ | ---------------- |
9
- | Add Controller to Page | OData V2 | List Report/Analytical List Page, Object Page | X | X | X | X | X | X | X | X | X | X |
10
- | | OData V4 | List Report/Analytical List Page, Object Page | X | X | X | X | X | X | X | X | X | X |
11
- | Add Header Field | OData V2 | Object Page | X | X | X | X | X | X | X | X | X | X |
12
- | | OData V4 | Object Page | X | X | X | X | X | X | X | X | X | X |
13
- | Add Custom Section | OData V2 | Object Page | X | X | X | X | X | X | X | X | X | X |
14
- | | OData V4 | Object Page | X | X | X | X | X | X | X | X | X | X |
15
- | Add Custom Page Action | OData V2 | List Report/Analytical List Page, Object Page | | | | | | | | X | X | X |
16
- | | OData V4 | List Report/Analytical List Page, Object Page | | | | | | | | X | X | X |
17
- | Add Custom Table Action | OData V2 | List Report/Analytical List Page, Object Page | | | X | X | X | X | X | X | X | X |
18
- | | OData V4 | List Report/Analytical List Page, Object Page | | | X | X | X | X | X | X | X | X |
19
- | Add Custom Table Column | OData V2 | List Report/Analytical List Page, Object Page | | | X | X | X | X | X | X | X | X |
20
- | | OData V4 | List Report/Analytical List Page, Object Page | | | X | X | X | X | X | X | X | X |
21
- | Change Table Columns | OData V2 | List Report/Analytical List Page, Object Page | | | X | X | X | X | X | X | X | X |
22
- | | OData V4 | List Report/Analytical List Page, Object Page | | | X | X | X | X | X | X | X | X |
23
- | Enable/Disable "Clear" Button | OData V2 | List Report/Analytical List Page | X | X | X | X | X | X | X | X | X | X |
24
- | | OData V4 | List Report/Analytical List Page | X | X | X | X | X | X | X | X | X | X |
25
- | Enable Semantic Date Range* | OData V2 | List Report/Analytical List Page | | | X | X | X | | | X | X | X |
26
- | | OData V4 | List Report/Analytical List Page | | | | | | | | X | X | X |
27
- | Enable Table Filtering for Page Variants*| OData V2 | List Report/Analytical List Page | | | X | X | X | | | X | X | X |
28
- | | OData V4 | List Report/Analytical List Page | | | | | | | | | X | X |
29
- | Add Local Annotation File* | OData V2 | List Report/Analytical List Page, Object Page | | | | | | | | | | X |
30
- | | OData V4 | List Report/Analytical List Page, Object Page | | | | | | | | | | X |
31
- | Enable Empty Row Mode for Tables* | OData V2 | Object Page | | | | | | | | X | X | X |
32
- | | OData V4 | Object Page | | | | | | | | | X | X |
33
- | Enable Variant Management in Tables and Charts* | OData V2 | List Report/Analytical List Page | | | X | X | X | | | X | X | X |
34
- | | OData V4 | List Report/Analytical List Page, Object Page | | | | | | | | | X | X |
35
- | Enable Variant Management in Tables* | OData V2 | Object Page | | | X | X | X | | | X | X | X |
36
- | |
37
-
38
- *Actions resulting in manifest changes are not available for adaptation projects built for OData v2 appliactions using outdated array page structure in manifest.json.
39
+ ** Meaning of Page Type abbreviation: LR - List Report, ALP - Analytical List Page, OP - Object Page
39
40