Skip to content

Commit 356f915

Browse files
authored
Merge pull request #10 from zzyangh/feature/remove-export-action
[feature]: Remove export actions
2 parents c32ff01 + b3730e3 commit 356f915

File tree

2 files changed

+44
-49
lines changed

2 files changed

+44
-49
lines changed

webapp/packages/core-view/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export * from './Action/Actions/ACTION_COLLAPSE_ALL';
22
export * from './Action/Actions/ACTION_DELETE';
33
export * from './Action/Actions/ACTION_EDIT';
4-
export * from './Action/Actions/ACTION_EXPORT';
4+
// export * from './Action/Actions/ACTION_EXPORT';
55
export * from './Action/Actions/ACTION_FILTER';
66
export * from './Action/Actions/ACTION_LAYOUT';
77
export * from './Action/Actions/ACTION_NEW_FOLDER';

webapp/packages/plugin-data-export/src/DataExportMenuService.ts

Lines changed: 43 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { injectable } from '@cloudbeaver/core-di';
1010
import { CommonDialogService, IMenuContext } from '@cloudbeaver/core-dialogs';
1111
import { LocalizationService } from '@cloudbeaver/core-localization';
1212
import { DATA_CONTEXT_NAV_NODE, EObjectFeature } from '@cloudbeaver/core-navigation-tree';
13-
import { ACTION_EXPORT, ActionService, DATA_CONTEXT_MENU_NESTED, MenuService } from '@cloudbeaver/core-view';
13+
import { ActionService, DATA_CONTEXT_MENU_NESTED, MenuService } from '@cloudbeaver/core-view';
1414
import { DATA_CONTEXT_CONNECTION } from '@cloudbeaver/plugin-connections';
1515
import { IDatabaseDataSource, IDataContainerOptions, ITableFooterMenuContext, TableFooterMenuService } from '@cloudbeaver/plugin-data-viewer';
1616
import type { IDataQueryOptions } from '@cloudbeaver/plugin-sql-editor';
@@ -30,53 +30,48 @@ export class DataExportMenuService {
3030
) {}
3131

3232
register(): void {
33-
this.tableFooterMenuService.registerMenuItem({
34-
id: 'export ',
35-
order: 5,
36-
title: 'data_transfer_dialog_export',
37-
tooltip: 'data_transfer_dialog_export_tooltip',
38-
icon: 'table-export',
39-
isPresent(context) {
40-
return context.contextType === TableFooterMenuService.nodeContextType;
41-
},
42-
isHidden: () => this.isDisabled(),
43-
isDisabled(context) {
44-
return (
45-
context.data.model.isLoading() ||
46-
context.data.model.isDisabled(context.data.resultIndex) ||
47-
!context.data.model.getResult(context.data.resultIndex)
48-
);
49-
},
50-
onClick: this.exportData.bind(this),
51-
});
52-
53-
this.menuService.addCreator({
54-
isApplicable: context => {
55-
const node = context.tryGet(DATA_CONTEXT_NAV_NODE);
56-
57-
if (node && !node.objectFeatures.includes(EObjectFeature.dataContainer)) {
58-
return false;
59-
}
60-
61-
return !this.isDisabled() && context.has(DATA_CONTEXT_CONNECTION) && !context.has(DATA_CONTEXT_MENU_NESTED);
62-
},
63-
getItems: (context, items) => [...items, ACTION_EXPORT],
64-
});
65-
66-
this.actionService.addHandler({
67-
id: 'data-export',
68-
isActionApplicable: (context, action) => action === ACTION_EXPORT && context.has(DATA_CONTEXT_CONNECTION) && context.has(DATA_CONTEXT_NAV_NODE),
69-
handler: async (context, action) => {
70-
const node = context.get(DATA_CONTEXT_NAV_NODE);
71-
const connection = context.get(DATA_CONTEXT_CONNECTION);
72-
73-
this.commonDialogService.open(DataExportDialog, {
74-
connectionKey: createConnectionParam(connection),
75-
name: node?.name,
76-
containerNodePath: node?.id,
77-
});
78-
},
79-
});
33+
// this.tableFooterMenuService.registerMenuItem({
34+
// id: 'export ',
35+
// order: 5,
36+
// title: 'data_transfer_dialog_export',
37+
// tooltip: 'data_transfer_dialog_export_tooltip',
38+
// icon: 'table-export',
39+
// isPresent(context) {
40+
// return context.contextType === TableFooterMenuService.nodeContextType;
41+
// },
42+
// isHidden: () => this.isDisabled(),
43+
// isDisabled(context) {
44+
// return (
45+
// context.data.model.isLoading() ||
46+
// context.data.model.isDisabled(context.data.resultIndex) ||
47+
// !context.data.model.getResult(context.data.resultIndex)
48+
// );
49+
// },
50+
// onClick: this.exportData.bind(this),
51+
// });
52+
// this.menuService.addCreator({
53+
// isApplicable: context => {
54+
// const node = context.tryGet(DATA_CONTEXT_NAV_NODE);
55+
// if (node && !node.objectFeatures.includes(EObjectFeature.dataContainer)) {
56+
// return false;
57+
// }
58+
// return !this.isDisabled() && context.has(DATA_CONTEXT_CONNECTION) && !context.has(DATA_CONTEXT_MENU_NESTED);
59+
// },
60+
// getItems: (context, items) => [...items, ACTION_EXPORT],
61+
// });
62+
// this.actionService.addHandler({
63+
// id: 'data-export',
64+
// isActionApplicable: (context, action) => action === ACTION_EXPORT && context.has(DATA_CONTEXT_CONNECTION) && context.has(DATA_CONTEXT_NAV_NODE),
65+
// handler: async (context, action) => {
66+
// const node = context.get(DATA_CONTEXT_NAV_NODE);
67+
// const connection = context.get(DATA_CONTEXT_CONNECTION);
68+
// this.commonDialogService.open(DataExportDialog, {
69+
// connectionKey: createConnectionParam(connection),
70+
// name: node?.name,
71+
// containerNodePath: node?.id,
72+
// });
73+
// },
74+
// });
8075
}
8176

8277
private exportData(context: IMenuContext<ITableFooterMenuContext>) {

0 commit comments

Comments
 (0)