@@ -10,7 +10,7 @@ import { injectable } from '@cloudbeaver/core-di';
1010import { CommonDialogService , IMenuContext } from '@cloudbeaver/core-dialogs' ;
1111import { LocalizationService } from '@cloudbeaver/core-localization' ;
1212import { 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' ;
1414import { DATA_CONTEXT_CONNECTION } from '@cloudbeaver/plugin-connections' ;
1515import { IDatabaseDataSource , IDataContainerOptions , ITableFooterMenuContext , TableFooterMenuService } from '@cloudbeaver/plugin-data-viewer' ;
1616import 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