@sap-ux/preview-middleware 0.16.96 → 0.16.98
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/command-executor.js +17 -0
- package/dist/client/adp/command-executor.ts +19 -1
- package/dist/client/adp/controllers/AddFragment.controller.js +14 -63
- package/dist/client/adp/controllers/AddFragment.controller.ts +10 -74
- package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +179 -0
- package/dist/client/adp/controllers/AddTableColumnFragments.controller.ts +298 -0
- package/dist/client/adp/controllers/BaseDialog.controller.js +83 -1
- package/dist/client/adp/controllers/BaseDialog.controller.ts +84 -0
- package/dist/client/adp/init-dialogs.js +9 -1
- package/dist/client/adp/init-dialogs.ts +9 -1
- package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +1 -1
- package/dist/client/adp/quick-actions/fe-v2/change-table-columns.ts +1 -1
- package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +1 -1
- package/dist/client/adp/quick-actions/fe-v2/create-table-action.ts +1 -1
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +106 -0
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +125 -0
- package/dist/client/adp/quick-actions/fe-v2/registry.js +14 -5
- package/dist/client/adp/quick-actions/fe-v2/registry.ts +18 -4
- package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +58 -0
- package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.ts +54 -0
- package/dist/client/adp/quick-actions/fe-v4/registry.js +4 -3
- package/dist/client/adp/quick-actions/fe-v4/registry.ts +5 -2
- package/dist/client/adp/quick-actions/{fe-v2/table-quick-action-base.js → table-quick-action-base.js} +29 -21
- package/dist/client/adp/quick-actions/{fe-v2/table-quick-action-base.ts → table-quick-action-base.ts} +16 -17
- package/dist/client/adp/ui/AddTableColumnFragments.fragment.xml +63 -0
- package/dist/client/messagebundle.properties +6 -0
- package/dist/client/tsconfig.tsbuildinfo +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["../../../utils/core", "sap/ui/dt/OverlayRegistry", "../../init-dialogs", "../table-quick-action-base", "../../utils", "../../../i18n", "../../../cpe/feature-service"], function (_____utils_core, OverlayRegistry, ____init_dialogs, ___table_quick_action_base, ____utils, _____i18n, _____cpe_feature_service) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const getControlById = _____utils_core["getControlById"];
|
|
7
|
+
const isA = _____utils_core["isA"];
|
|
8
|
+
const DialogNames = ____init_dialogs["DialogNames"];
|
|
9
|
+
const handler = ____init_dialogs["handler"];
|
|
10
|
+
const ANALYTICAL_TABLE_TYPE = ___table_quick_action_base["ANALYTICAL_TABLE_TYPE"];
|
|
11
|
+
const GRID_TABLE_TYPE = ___table_quick_action_base["GRID_TABLE_TYPE"];
|
|
12
|
+
const M_TABLE_TYPE = ___table_quick_action_base["M_TABLE_TYPE"];
|
|
13
|
+
const SMART_TABLE_TYPE = ___table_quick_action_base["SMART_TABLE_TYPE"];
|
|
14
|
+
const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
|
|
15
|
+
const TREE_TABLE_TYPE = ___table_quick_action_base["TREE_TABLE_TYPE"];
|
|
16
|
+
const notifyUser = ____utils["notifyUser"];
|
|
17
|
+
const getTextBundle = _____i18n["getTextBundle"];
|
|
18
|
+
const FeatureService = _____cpe_feature_service["FeatureService"];
|
|
19
|
+
const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
|
|
20
|
+
const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Reusable function which performs some preparation steps before table action execution
|
|
24
|
+
*
|
|
25
|
+
* @param table - table element
|
|
26
|
+
* @param sectionInfo - section data
|
|
27
|
+
* @param iconTabBar - icon tab bar element
|
|
28
|
+
* @param iconTabBarFilterKey - tab bar key to select a tab
|
|
29
|
+
*/
|
|
30
|
+
function preprocessActionExecution(table, sectionInfo, iconTabBar, iconTabBarFilterKey) {
|
|
31
|
+
if (sectionInfo) {
|
|
32
|
+
const {
|
|
33
|
+
layout,
|
|
34
|
+
section,
|
|
35
|
+
subSection
|
|
36
|
+
} = sectionInfo;
|
|
37
|
+
layout?.setSelectedSection(section);
|
|
38
|
+
section.setSelectedSubSection(subSection);
|
|
39
|
+
} else {
|
|
40
|
+
getControlById(table.getId())?.getDomRef()?.scrollIntoView();
|
|
41
|
+
}
|
|
42
|
+
if (iconTabBar && iconTabBarFilterKey) {
|
|
43
|
+
iconTabBar.setSelectedKey(iconTabBarFilterKey);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
class AddTableCustomColumnQuickAction extends TableQuickActionDefinitionBase {
|
|
47
|
+
constructor(context) {
|
|
48
|
+
super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Initializes action object instance
|
|
53
|
+
*/
|
|
54
|
+
async initialize() {
|
|
55
|
+
if (FeatureService.isFeatureEnabled('cpe.beta.quick-actions') === false) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
await super.initialize();
|
|
59
|
+
}
|
|
60
|
+
async execute(path) {
|
|
61
|
+
const {
|
|
62
|
+
table,
|
|
63
|
+
iconTabBarFilterKey,
|
|
64
|
+
sectionInfo
|
|
65
|
+
} = this.tableMap[path];
|
|
66
|
+
if (!table) {
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
|
|
70
|
+
this.selectOverlay(table);
|
|
71
|
+
let tableInternal = table;
|
|
72
|
+
if (isA(SMART_TABLE_TYPE, table)) {
|
|
73
|
+
const itemsAggregation = table.getAggregation('items');
|
|
74
|
+
tableInternal = itemsAggregation.find(item => {
|
|
75
|
+
return [M_TABLE_TYPE, TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some(tType => isA(tType, item));
|
|
76
|
+
});
|
|
77
|
+
if (!tableInternal) {
|
|
78
|
+
return [];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const overlay = OverlayRegistry.getOverlay(tableInternal) || [];
|
|
82
|
+
if (!overlay) {
|
|
83
|
+
return [];
|
|
84
|
+
}
|
|
85
|
+
if (tableInternal.getAggregation('items').length === 0) {
|
|
86
|
+
const bundle = await getTextBundle();
|
|
87
|
+
notifyUser(bundle.getText('TABLE_ROWS_NEEDED_TO_CREATE_CUSTOM_COLUMN'), 8000);
|
|
88
|
+
return [];
|
|
89
|
+
}
|
|
90
|
+
const dialog = [TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some(type => isA(type, tableInternal)) ? DialogNames.ADD_FRAGMENT : DialogNames.ADD_TABLE_COLUMN_FRAGMENTS;
|
|
91
|
+
await handler(overlay, this.context.rta, dialog, undefined, {
|
|
92
|
+
aggregation: 'columns',
|
|
93
|
+
title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
|
|
94
|
+
});
|
|
95
|
+
return [];
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
var __exports = {
|
|
99
|
+
__esModule: true
|
|
100
|
+
};
|
|
101
|
+
__exports.CREATE_TABLE_CUSTOM_COLUMN = CREATE_TABLE_CUSTOM_COLUMN;
|
|
102
|
+
__exports.preprocessActionExecution = preprocessActionExecution;
|
|
103
|
+
__exports.AddTableCustomColumnQuickAction = AddTableCustomColumnQuickAction;
|
|
104
|
+
return __exports;
|
|
105
|
+
});
|
|
106
|
+
//# sourceMappingURL=create-table-custom-column.js.map
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
2
|
+
import type SmartTable from 'sap/ui/comp/smarttable/SmartTable';
|
|
3
|
+
|
|
4
|
+
import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
|
|
5
|
+
import { getControlById, isA } from '../../../utils/core';
|
|
6
|
+
import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
|
|
7
|
+
import { DialogNames, handler } from '../../init-dialogs';
|
|
8
|
+
import {
|
|
9
|
+
ANALYTICAL_TABLE_TYPE,
|
|
10
|
+
GRID_TABLE_TYPE,
|
|
11
|
+
M_TABLE_TYPE,
|
|
12
|
+
SMART_TABLE_TYPE,
|
|
13
|
+
TableQuickActionDefinitionBase,
|
|
14
|
+
TREE_TABLE_TYPE
|
|
15
|
+
} from '../table-quick-action-base';
|
|
16
|
+
import ManagedObject from 'sap/ui/base/ManagedObject';
|
|
17
|
+
import UI5Element from 'sap/ui/core/Element';
|
|
18
|
+
import { notifyUser } from '../../utils';
|
|
19
|
+
import { getTextBundle } from '../../../i18n';
|
|
20
|
+
import { FeatureService } from '../../../cpe/feature-service';
|
|
21
|
+
import ObjectPageSection from 'sap/uxap/ObjectPageSection';
|
|
22
|
+
import ObjectPageSubSection from 'sap/uxap/ObjectPageSubSection';
|
|
23
|
+
import ObjectPageLayout from 'sap/uxap/ObjectPageLayout';
|
|
24
|
+
import IconTabBar from 'sap/m/IconTabBar';
|
|
25
|
+
|
|
26
|
+
export const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
|
|
27
|
+
|
|
28
|
+
const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Reusable function which performs some preparation steps before table action execution
|
|
32
|
+
*
|
|
33
|
+
* @param table - table element
|
|
34
|
+
* @param sectionInfo - section data
|
|
35
|
+
* @param iconTabBar - icon tab bar element
|
|
36
|
+
* @param iconTabBarFilterKey - tab bar key to select a tab
|
|
37
|
+
*/
|
|
38
|
+
export function preprocessActionExecution(
|
|
39
|
+
table: UI5Element,
|
|
40
|
+
sectionInfo:
|
|
41
|
+
| {
|
|
42
|
+
section: ObjectPageSection;
|
|
43
|
+
subSection: ObjectPageSubSection;
|
|
44
|
+
layout?: ObjectPageLayout;
|
|
45
|
+
}
|
|
46
|
+
| undefined,
|
|
47
|
+
iconTabBar: IconTabBar | undefined,
|
|
48
|
+
iconTabBarFilterKey: string | undefined
|
|
49
|
+
) {
|
|
50
|
+
if (sectionInfo) {
|
|
51
|
+
const { layout, section, subSection } = sectionInfo;
|
|
52
|
+
layout?.setSelectedSection(section);
|
|
53
|
+
section.setSelectedSubSection(subSection);
|
|
54
|
+
} else {
|
|
55
|
+
getControlById(table.getId())?.getDomRef()?.scrollIntoView();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (iconTabBar && iconTabBarFilterKey) {
|
|
59
|
+
iconTabBar.setSelectedKey(iconTabBarFilterKey);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export class AddTableCustomColumnQuickAction
|
|
64
|
+
extends TableQuickActionDefinitionBase
|
|
65
|
+
implements NestedQuickActionDefinition
|
|
66
|
+
{
|
|
67
|
+
constructor(context: QuickActionContext) {
|
|
68
|
+
super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Initializes action object instance
|
|
73
|
+
*/
|
|
74
|
+
async initialize(): Promise<void> {
|
|
75
|
+
if (FeatureService.isFeatureEnabled('cpe.beta.quick-actions') === false) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
await super.initialize();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async execute(path: string): Promise<FlexCommand[]> {
|
|
82
|
+
const { table, iconTabBarFilterKey, sectionInfo } = this.tableMap[path];
|
|
83
|
+
if (!table) {
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
|
|
88
|
+
this.selectOverlay(table);
|
|
89
|
+
|
|
90
|
+
let tableInternal: ManagedObject | undefined = table;
|
|
91
|
+
if (isA<SmartTable>(SMART_TABLE_TYPE, table)) {
|
|
92
|
+
const itemsAggregation = table.getAggregation('items') as ManagedObject[];
|
|
93
|
+
tableInternal = itemsAggregation.find((item) => {
|
|
94
|
+
return [M_TABLE_TYPE, TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some((tType) =>
|
|
95
|
+
isA(tType, item)
|
|
96
|
+
);
|
|
97
|
+
});
|
|
98
|
+
if (!tableInternal) {
|
|
99
|
+
return [];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const overlay = OverlayRegistry.getOverlay(tableInternal as UI5Element) || [];
|
|
104
|
+
if (!overlay) {
|
|
105
|
+
return [];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if ((tableInternal.getAggregation('items') as ManagedObject[]).length === 0) {
|
|
109
|
+
const bundle = await getTextBundle();
|
|
110
|
+
notifyUser(bundle.getText('TABLE_ROWS_NEEDED_TO_CREATE_CUSTOM_COLUMN'), 8000);
|
|
111
|
+
return [];
|
|
112
|
+
}
|
|
113
|
+
const dialog = [TREE_TABLE_TYPE, ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE].some((type) =>
|
|
114
|
+
isA(type, tableInternal)
|
|
115
|
+
)
|
|
116
|
+
? DialogNames.ADD_FRAGMENT
|
|
117
|
+
: DialogNames.ADD_TABLE_COLUMN_FRAGMENTS;
|
|
118
|
+
await handler(overlay, this.context.rta, dialog, undefined, {
|
|
119
|
+
aggregation: 'columns',
|
|
120
|
+
title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
return [];
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -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", "../common/create-page-action"], 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, ___common_create_page_action) {
|
|
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"], 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) {
|
|
4
4
|
"use strict";
|
|
5
5
|
|
|
6
6
|
const QuickActionDefinitionRegistry = _____cpe_quick_actions_registry["QuickActionDefinitionRegistry"];
|
|
@@ -10,17 +10,19 @@ sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/ComponentContainer", "../
|
|
|
10
10
|
const AddHeaderFieldQuickAction = ___common_op_add_header_field["AddHeaderFieldQuickAction"];
|
|
11
11
|
const AddCustomSectionQuickAction = ___common_op_add_custom_section["AddCustomSectionQuickAction"];
|
|
12
12
|
const AddTableActionQuickAction = ___fe_v2_create_table_action["AddTableActionQuickAction"];
|
|
13
|
+
const AddTableCustomColumnQuickAction = ___create_table_custom_column["AddTableCustomColumnQuickAction"];
|
|
13
14
|
const AddPageActionQuickAction = ___common_create_page_action["AddPageActionQuickAction"];
|
|
14
15
|
const OBJECT_PAGE_TYPE = 'sap.suite.ui.generic.template.ObjectPage.view.Details';
|
|
15
16
|
const LIST_REPORT_TYPE = 'sap.suite.ui.generic.template.ListReport.view.ListReport';
|
|
16
|
-
|
|
17
|
+
const ANALYTICAL_LIST_PAGE_TYPE = 'sap.suite.ui.generic.template.AnalyticalListPage.view.AnalyticalListPage';
|
|
17
18
|
/**
|
|
18
19
|
* Quick Action provider for SAP Fiori Elements V2 applications.
|
|
19
20
|
*/
|
|
20
21
|
class FEV2QuickActionRegistry extends QuickActionDefinitionRegistry {
|
|
21
22
|
PAGE_NAME_MAP = {
|
|
22
23
|
[LIST_REPORT_TYPE]: 'listReport',
|
|
23
|
-
[OBJECT_PAGE_TYPE]: 'objectPage'
|
|
24
|
+
[OBJECT_PAGE_TYPE]: 'objectPage',
|
|
25
|
+
[ANALYTICAL_LIST_PAGE_TYPE]: 'analyticalListPage'
|
|
24
26
|
};
|
|
25
27
|
getDefinitions(context) {
|
|
26
28
|
const activePages = this.getActivePageContent(context.controlIndex);
|
|
@@ -33,14 +35,21 @@ sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/ComponentContainer", "../
|
|
|
33
35
|
if (name === 'listReport') {
|
|
34
36
|
definitionGroups.push({
|
|
35
37
|
title: 'LIST REPORT',
|
|
36
|
-
definitions: [ToggleClearFilterBarQuickAction, AddControllerToPageQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddPageActionQuickAction],
|
|
38
|
+
definitions: [ToggleClearFilterBarQuickAction, AddControllerToPageQuickAction, ChangeTableColumnsQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction, AddPageActionQuickAction],
|
|
37
39
|
view,
|
|
38
40
|
key: name + index
|
|
39
41
|
});
|
|
40
42
|
} else if (name === 'objectPage') {
|
|
41
43
|
definitionGroups.push({
|
|
42
44
|
title: 'OBJECT PAGE',
|
|
43
|
-
definitions: [AddControllerToPageQuickAction, ChangeTableColumnsQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction, AddTableActionQuickAction,
|
|
45
|
+
definitions: [AddControllerToPageQuickAction, ChangeTableColumnsQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction],
|
|
46
|
+
view,
|
|
47
|
+
key: name + index
|
|
48
|
+
});
|
|
49
|
+
} else if (name === 'analyticalListPage') {
|
|
50
|
+
definitionGroups.push({
|
|
51
|
+
title: 'ANALYTICAL LIST PAGE',
|
|
52
|
+
definitions: [AddControllerToPageQuickAction, ChangeTableColumnsQuickAction, AddTableCustomColumnQuickAction],
|
|
44
53
|
view,
|
|
45
54
|
key: name + index
|
|
46
55
|
});
|
|
@@ -15,19 +15,21 @@ import { ChangeTableColumnsQuickAction } from './change-table-columns';
|
|
|
15
15
|
import { AddHeaderFieldQuickAction } from '../common/op-add-header-field';
|
|
16
16
|
import { AddCustomSectionQuickAction } from '../common/op-add-custom-section';
|
|
17
17
|
import { AddTableActionQuickAction } from '../fe-v2/create-table-action';
|
|
18
|
+
import { AddTableCustomColumnQuickAction } from './create-table-custom-column';
|
|
18
19
|
import { AddPageActionQuickAction } from '../common/create-page-action';
|
|
19
|
-
type PageName = 'listReport' | 'objectPage';
|
|
20
|
+
type PageName = 'listReport' | 'objectPage' | 'analyticalListPage';
|
|
20
21
|
|
|
21
22
|
const OBJECT_PAGE_TYPE = 'sap.suite.ui.generic.template.ObjectPage.view.Details';
|
|
22
23
|
const LIST_REPORT_TYPE = 'sap.suite.ui.generic.template.ListReport.view.ListReport';
|
|
23
|
-
|
|
24
|
+
const ANALYTICAL_LIST_PAGE_TYPE = 'sap.suite.ui.generic.template.AnalyticalListPage.view.AnalyticalListPage';
|
|
24
25
|
/**
|
|
25
26
|
* Quick Action provider for SAP Fiori Elements V2 applications.
|
|
26
27
|
*/
|
|
27
28
|
export default class FEV2QuickActionRegistry extends QuickActionDefinitionRegistry<PageName> {
|
|
28
29
|
PAGE_NAME_MAP: Record<string, PageName> = {
|
|
29
30
|
[LIST_REPORT_TYPE]: 'listReport',
|
|
30
|
-
[OBJECT_PAGE_TYPE]: 'objectPage'
|
|
31
|
+
[OBJECT_PAGE_TYPE]: 'objectPage',
|
|
32
|
+
[ANALYTICAL_LIST_PAGE_TYPE]: 'analyticalListPage'
|
|
31
33
|
};
|
|
32
34
|
getDefinitions(context: QuickActionActivationContext): QuickActionDefinitionGroup[] {
|
|
33
35
|
const activePages = this.getActivePageContent(context.controlIndex);
|
|
@@ -43,6 +45,7 @@ export default class FEV2QuickActionRegistry extends QuickActionDefinitionRegist
|
|
|
43
45
|
AddControllerToPageQuickAction,
|
|
44
46
|
ChangeTableColumnsQuickAction,
|
|
45
47
|
AddTableActionQuickAction,
|
|
48
|
+
AddTableCustomColumnQuickAction,
|
|
46
49
|
AddPageActionQuickAction
|
|
47
50
|
],
|
|
48
51
|
view,
|
|
@@ -57,7 +60,18 @@ export default class FEV2QuickActionRegistry extends QuickActionDefinitionRegist
|
|
|
57
60
|
AddHeaderFieldQuickAction,
|
|
58
61
|
AddCustomSectionQuickAction,
|
|
59
62
|
AddTableActionQuickAction,
|
|
60
|
-
|
|
63
|
+
AddTableCustomColumnQuickAction
|
|
64
|
+
],
|
|
65
|
+
view,
|
|
66
|
+
key: name + index
|
|
67
|
+
});
|
|
68
|
+
} else if (name === 'analyticalListPage') {
|
|
69
|
+
definitionGroups.push({
|
|
70
|
+
title: 'ANALYTICAL LIST PAGE',
|
|
71
|
+
definitions: [
|
|
72
|
+
AddControllerToPageQuickAction,
|
|
73
|
+
ChangeTableColumnsQuickAction,
|
|
74
|
+
AddTableCustomColumnQuickAction
|
|
61
75
|
],
|
|
62
76
|
view,
|
|
63
77
|
key: name + index
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/dt/OverlayRegistry", "../../init-dialogs", "../table-quick-action-base", "../../../cpe/feature-service", "../fe-v2/create-table-custom-column"], function (OverlayRegistry, ____init_dialogs, ___table_quick_action_base, _____cpe_feature_service, ___fe_v2_create_table_custom_column) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const DialogNames = ____init_dialogs["DialogNames"];
|
|
7
|
+
const handler = ____init_dialogs["handler"];
|
|
8
|
+
const SMART_TABLE_TYPE = ___table_quick_action_base["SMART_TABLE_TYPE"];
|
|
9
|
+
const GRID_TABLE_TYPE = ___table_quick_action_base["GRID_TABLE_TYPE"];
|
|
10
|
+
const MDC_TABLE_TYPE = ___table_quick_action_base["MDC_TABLE_TYPE"];
|
|
11
|
+
const TableQuickActionDefinitionBase = ___table_quick_action_base["TableQuickActionDefinitionBase"];
|
|
12
|
+
const TREE_TABLE_TYPE = ___table_quick_action_base["TREE_TABLE_TYPE"];
|
|
13
|
+
const FeatureService = _____cpe_feature_service["FeatureService"];
|
|
14
|
+
const preprocessActionExecution = ___fe_v2_create_table_custom_column["preprocessActionExecution"];
|
|
15
|
+
const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
|
|
16
|
+
const CONTROL_TYPES = [SMART_TABLE_TYPE, MDC_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
|
|
17
|
+
class AddTableCustomColumnQuickAction extends TableQuickActionDefinitionBase {
|
|
18
|
+
constructor(context) {
|
|
19
|
+
super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Initializes action object instance
|
|
24
|
+
*/
|
|
25
|
+
async initialize() {
|
|
26
|
+
if (FeatureService.isFeatureEnabled('cpe.beta.quick-actions') === false) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
await super.initialize();
|
|
30
|
+
}
|
|
31
|
+
async execute(path) {
|
|
32
|
+
const {
|
|
33
|
+
table,
|
|
34
|
+
iconTabBarFilterKey,
|
|
35
|
+
sectionInfo
|
|
36
|
+
} = this.tableMap[path];
|
|
37
|
+
if (!table) {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
|
|
41
|
+
this.selectOverlay(table);
|
|
42
|
+
const overlay = OverlayRegistry.getOverlay(table);
|
|
43
|
+
await handler(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
44
|
+
aggregation: 'columns',
|
|
45
|
+
title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
|
|
46
|
+
});
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
var __exports = {
|
|
51
|
+
__esModule: true
|
|
52
|
+
};
|
|
53
|
+
__exports.CREATE_TABLE_CUSTOM_COLUMN = CREATE_TABLE_CUSTOM_COLUMN;
|
|
54
|
+
__exports.CONTROL_TYPES = CONTROL_TYPES;
|
|
55
|
+
__exports.AddTableCustomColumnQuickAction = AddTableCustomColumnQuickAction;
|
|
56
|
+
return __exports;
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=create-table-custom-column.js.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import FlexCommand from 'sap/ui/rta/command/FlexCommand';
|
|
2
|
+
|
|
3
|
+
import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition';
|
|
4
|
+
import OverlayRegistry from 'sap/ui/dt/OverlayRegistry';
|
|
5
|
+
import { DialogNames, handler } from '../../init-dialogs';
|
|
6
|
+
import {
|
|
7
|
+
SMART_TABLE_TYPE,
|
|
8
|
+
GRID_TABLE_TYPE,
|
|
9
|
+
MDC_TABLE_TYPE,
|
|
10
|
+
TableQuickActionDefinitionBase,
|
|
11
|
+
TREE_TABLE_TYPE
|
|
12
|
+
} from '../table-quick-action-base';
|
|
13
|
+
import { FeatureService } from '../../../cpe/feature-service';
|
|
14
|
+
import { preprocessActionExecution } from '../fe-v2/create-table-custom-column';
|
|
15
|
+
|
|
16
|
+
export const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column';
|
|
17
|
+
|
|
18
|
+
export const CONTROL_TYPES = [SMART_TABLE_TYPE, MDC_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE];
|
|
19
|
+
|
|
20
|
+
export class AddTableCustomColumnQuickAction
|
|
21
|
+
extends TableQuickActionDefinitionBase
|
|
22
|
+
implements NestedQuickActionDefinition
|
|
23
|
+
{
|
|
24
|
+
constructor(context: QuickActionContext) {
|
|
25
|
+
super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Initializes action object instance
|
|
30
|
+
*/
|
|
31
|
+
async initialize(): Promise<void> {
|
|
32
|
+
if (FeatureService.isFeatureEnabled('cpe.beta.quick-actions') === false) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
await super.initialize();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async execute(path: string): Promise<FlexCommand[]> {
|
|
39
|
+
const { table, iconTabBarFilterKey, sectionInfo } = this.tableMap[path];
|
|
40
|
+
if (!table) {
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
preprocessActionExecution(table, sectionInfo, this.iconTabBar, iconTabBarFilterKey);
|
|
45
|
+
this.selectOverlay(table);
|
|
46
|
+
|
|
47
|
+
const overlay = OverlayRegistry.getOverlay(table);
|
|
48
|
+
await handler(overlay, this.context.rta, DialogNames.ADD_FRAGMENT, undefined, {
|
|
49
|
+
aggregation: 'columns',
|
|
50
|
+
title: 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN'
|
|
51
|
+
});
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -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", "../common/create-page-action", "./create-table-action"], 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, ___common_create_page_action, ___create_table_action) {
|
|
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"], 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) {
|
|
4
4
|
"use strict";
|
|
5
5
|
|
|
6
6
|
const QuickActionDefinitionRegistry = _____cpe_quick_actions_registry["QuickActionDefinitionRegistry"];
|
|
@@ -9,6 +9,7 @@ sap.ui.define(["../../../cpe/quick-actions/registry", "../common/add-controller-
|
|
|
9
9
|
const ChangeTableColumnsQuickAction = ___change_table_columns["ChangeTableColumnsQuickAction"];
|
|
10
10
|
const AddHeaderFieldQuickAction = ___common_op_add_header_field["AddHeaderFieldQuickAction"];
|
|
11
11
|
const AddCustomSectionQuickAction = ___common_op_add_custom_section["AddCustomSectionQuickAction"];
|
|
12
|
+
const AddTableCustomColumnQuickAction = ___create_table_custom_column["AddTableCustomColumnQuickAction"];
|
|
12
13
|
const AddPageActionQuickAction = ___common_create_page_action["AddPageActionQuickAction"];
|
|
13
14
|
const AddTableActionQuickAction = ___create_table_action["AddTableActionQuickAction"];
|
|
14
15
|
const LIST_REPORT_TYPE = 'sap.fe.templates.ListReport.ListReport';
|
|
@@ -33,14 +34,14 @@ sap.ui.define(["../../../cpe/quick-actions/registry", "../common/add-controller-
|
|
|
33
34
|
if (name === 'listReport') {
|
|
34
35
|
definitionGroups.push({
|
|
35
36
|
title: 'LIST REPORT',
|
|
36
|
-
definitions: [ToggleClearFilterBarQuickAction, AddControllerToPageQuickAction, ChangeTableColumnsQuickAction, AddPageActionQuickAction, AddTableActionQuickAction],
|
|
37
|
+
definitions: [ToggleClearFilterBarQuickAction, AddControllerToPageQuickAction, ChangeTableColumnsQuickAction, AddPageActionQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction],
|
|
37
38
|
view,
|
|
38
39
|
key: name + index
|
|
39
40
|
});
|
|
40
41
|
} else if (name === 'objectPage') {
|
|
41
42
|
definitionGroups.push({
|
|
42
43
|
title: 'OBJECT PAGE',
|
|
43
|
-
definitions: [AddControllerToPageQuickAction, ChangeTableColumnsQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction, AddPageActionQuickAction, AddTableActionQuickAction],
|
|
44
|
+
definitions: [AddControllerToPageQuickAction, ChangeTableColumnsQuickAction, AddHeaderFieldQuickAction, AddCustomSectionQuickAction, AddPageActionQuickAction, AddTableActionQuickAction, AddTableCustomColumnQuickAction],
|
|
44
45
|
view,
|
|
45
46
|
key: name + index
|
|
46
47
|
});
|
|
@@ -9,6 +9,7 @@ import { ToggleClearFilterBarQuickAction } from './lr-toggle-clear-filter-bar';
|
|
|
9
9
|
import { ChangeTableColumnsQuickAction } from './change-table-columns';
|
|
10
10
|
import { AddHeaderFieldQuickAction } from '../common/op-add-header-field';
|
|
11
11
|
import { AddCustomSectionQuickAction } from '../common/op-add-custom-section';
|
|
12
|
+
import { AddTableCustomColumnQuickAction } from './create-table-custom-column';
|
|
12
13
|
import { AddPageActionQuickAction } from '../common/create-page-action';
|
|
13
14
|
import { AddTableActionQuickAction } from './create-table-action';
|
|
14
15
|
|
|
@@ -39,7 +40,8 @@ export default class FEV4QuickActionRegistry extends QuickActionDefinitionRegist
|
|
|
39
40
|
AddControllerToPageQuickAction,
|
|
40
41
|
ChangeTableColumnsQuickAction,
|
|
41
42
|
AddPageActionQuickAction,
|
|
42
|
-
AddTableActionQuickAction
|
|
43
|
+
AddTableActionQuickAction,
|
|
44
|
+
AddTableCustomColumnQuickAction
|
|
43
45
|
],
|
|
44
46
|
view,
|
|
45
47
|
key: name + index
|
|
@@ -53,7 +55,8 @@ export default class FEV4QuickActionRegistry extends QuickActionDefinitionRegist
|
|
|
53
55
|
AddHeaderFieldQuickAction,
|
|
54
56
|
AddCustomSectionQuickAction,
|
|
55
57
|
AddPageActionQuickAction,
|
|
56
|
-
AddTableActionQuickAction
|
|
58
|
+
AddTableActionQuickAction,
|
|
59
|
+
AddTableCustomColumnQuickAction
|
|
57
60
|
],
|
|
58
61
|
view,
|
|
59
62
|
key: name + index
|
|
@@ -2,25 +2,29 @@
|
|
|
2
2
|
sap.ui.define([
|
|
3
3
|
'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
|
|
4
4
|
'sap/ui/dt/OverlayUtil',
|
|
5
|
-
'
|
|
6
|
-
'
|
|
7
|
-
'
|
|
8
|
-
], function (___sap_ux_private_control_property_editor_common, OverlayUtil,
|
|
5
|
+
'../../cpe/quick-actions/utils',
|
|
6
|
+
'../../utils/core',
|
|
7
|
+
'../../utils/version'
|
|
8
|
+
], function (___sap_ux_private_control_property_editor_common, OverlayUtil, ____cpe_quick_actions_utils, ____utils_core, ____utils_version) {
|
|
9
9
|
'use strict';
|
|
10
10
|
const NESTED_QUICK_ACTION_KIND = ___sap_ux_private_control_property_editor_common['NESTED_QUICK_ACTION_KIND'];
|
|
11
|
-
const getParentContainer =
|
|
12
|
-
const getRelevantControlFromActivePage =
|
|
13
|
-
const getControlById =
|
|
14
|
-
const isA =
|
|
15
|
-
const isManagedObject =
|
|
16
|
-
const getUi5Version =
|
|
17
|
-
const isLowerThanMinimalUi5Version =
|
|
11
|
+
const getParentContainer = ____cpe_quick_actions_utils['getParentContainer'];
|
|
12
|
+
const getRelevantControlFromActivePage = ____cpe_quick_actions_utils['getRelevantControlFromActivePage'];
|
|
13
|
+
const getControlById = ____utils_core['getControlById'];
|
|
14
|
+
const isA = ____utils_core['isA'];
|
|
15
|
+
const isManagedObject = ____utils_core['isManagedObject'];
|
|
16
|
+
const getUi5Version = ____utils_version['getUi5Version'];
|
|
17
|
+
const isLowerThanMinimalUi5Version = ____utils_version['isLowerThanMinimalUi5Version'];
|
|
18
18
|
const SMART_TABLE_ACTION_ID = 'CTX_COMP_VARIANT_CONTENT';
|
|
19
19
|
const M_TABLE_ACTION_ID = 'CTX_ADD_ELEMENTS_AS_CHILD';
|
|
20
20
|
const SETTINGS_ID = 'CTX_SETTINGS';
|
|
21
21
|
const ICON_TAB_BAR_TYPE = 'sap.m.IconTabBar';
|
|
22
22
|
const SMART_TABLE_TYPE = 'sap.ui.comp.smarttable.SmartTable';
|
|
23
23
|
const M_TABLE_TYPE = 'sap.m.Table';
|
|
24
|
+
const MDC_TABLE_TYPE = 'sap.ui.mdc.Table';
|
|
25
|
+
const TREE_TABLE_TYPE = 'sap.ui.table.TreeTable';
|
|
26
|
+
const GRID_TABLE_TYPE = 'sap.ui.table.Table';
|
|
27
|
+
const ANALYTICAL_TABLE_TYPE = 'sap.ui.table.AnalyticalTable';
|
|
24
28
|
async function getActionId(table) {
|
|
25
29
|
const {major, minor} = await getUi5Version();
|
|
26
30
|
if (isA(SMART_TABLE_TYPE, table)) {
|
|
@@ -95,13 +99,12 @@ sap.ui.define([
|
|
|
95
99
|
}
|
|
96
100
|
}
|
|
97
101
|
getTableLabel(table) {
|
|
98
|
-
if (isA(SMART_TABLE_TYPE, table)) {
|
|
102
|
+
if (isA(SMART_TABLE_TYPE, table) || isA(MDC_TABLE_TYPE, table)) {
|
|
99
103
|
const header = table.getHeader();
|
|
100
104
|
if (header) {
|
|
101
105
|
return `'${ header }' table`;
|
|
102
106
|
}
|
|
103
|
-
}
|
|
104
|
-
if (isA(M_TABLE_TYPE, table)) {
|
|
107
|
+
} else if (isA(M_TABLE_TYPE, table)) {
|
|
105
108
|
const tilte = table?.getHeaderToolbar()?.getTitleControl()?.getText();
|
|
106
109
|
if (tilte) {
|
|
107
110
|
return `'${ tilte }' table`;
|
|
@@ -168,13 +171,12 @@ sap.ui.define([
|
|
|
168
171
|
}
|
|
169
172
|
}
|
|
170
173
|
processTable(table, sectionInfo) {
|
|
171
|
-
if (
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
if (isA(M_TABLE_TYPE, table)) {
|
|
174
|
+
if ([
|
|
175
|
+
SMART_TABLE_TYPE,
|
|
176
|
+
M_TABLE_TYPE,
|
|
177
|
+
MDC_TABLE_TYPE,
|
|
178
|
+
TREE_TABLE_TYPE
|
|
179
|
+
].some(type => isA(type, table))) {
|
|
178
180
|
this.children.push({
|
|
179
181
|
label: this.getTableLabel(table),
|
|
180
182
|
children: []
|
|
@@ -203,6 +205,12 @@ sap.ui.define([
|
|
|
203
205
|
}
|
|
204
206
|
}
|
|
205
207
|
var __exports = { __esModule: true };
|
|
208
|
+
__exports.SMART_TABLE_TYPE = SMART_TABLE_TYPE;
|
|
209
|
+
__exports.M_TABLE_TYPE = M_TABLE_TYPE;
|
|
210
|
+
__exports.MDC_TABLE_TYPE = MDC_TABLE_TYPE;
|
|
211
|
+
__exports.TREE_TABLE_TYPE = TREE_TABLE_TYPE;
|
|
212
|
+
__exports.GRID_TABLE_TYPE = GRID_TABLE_TYPE;
|
|
213
|
+
__exports.ANALYTICAL_TABLE_TYPE = ANALYTICAL_TABLE_TYPE;
|
|
206
214
|
__exports.TableQuickActionDefinitionBase = TableQuickActionDefinitionBase;
|
|
207
215
|
return __exports;
|
|
208
216
|
});
|