fixed quick export handler from mongo

This commit is contained in:
Jan Prochazka 2022-03-10 09:34:05 +01:00
parent c4b0b185e6
commit 7497e2684c

View File

@ -109,6 +109,7 @@
import { parseFilter } from 'dbgate-filterparser'; import { parseFilter } from 'dbgate-filterparser';
import { scriptToSql } from 'dbgate-sqltree'; import { scriptToSql } from 'dbgate-sqltree';
import _ from 'lodash'; import _ from 'lodash';
import { registerQuickExportHandler } from '../buttons/ToolStripExportButton.svelte';
import registerCommand from '../commands/registerCommand'; import registerCommand from '../commands/registerCommand';
import ErrorInfo from '../elements/ErrorInfo.svelte'; import ErrorInfo from '../elements/ErrorInfo.svelte';
import ConfirmNoSqlModal from '../modals/ConfirmNoSqlModal.svelte'; import ConfirmNoSqlModal from '../modals/ConfirmNoSqlModal.svelte';
@ -193,10 +194,7 @@
); );
} }
registerMenu( const quickExportHandler = fmt => async () => {
{ command: 'collectionDataGrid.openQuery', tag: 'export' },
{
...createQuickExportMenu($extensions, fmt => async () => {
const coninfo = await getConnectionInfo({ conid }); const coninfo = await getConnectionInfo({ conid });
exportElectronFile( exportElectronFile(
pureName || 'Data', pureName || 'Data',
@ -212,7 +210,14 @@
}, },
fmt fmt
); );
}), };
registerQuickExportHandler(quickExportHandler);
registerMenu(
{ command: 'collectionDataGrid.openQuery', tag: 'export' },
{
...createQuickExportMenu($extensions, quickExportHandler),
tag: 'export', tag: 'export',
}, },