diff --git a/packages/web/src/appobj/DatabaseObjectAppObject.svelte b/packages/web/src/appobj/DatabaseObjectAppObject.svelte index e9029c88..0fbeb6ed 100644 --- a/packages/web/src/appobj/DatabaseObjectAppObject.svelte +++ b/packages/web/src/appobj/DatabaseObjectAppObject.svelte @@ -71,6 +71,10 @@ functionName: 'tableReader', isExport: true, }, + { + label: 'Import', + isImport: true, + }, { label: 'Open as data sheet', isOpenFreeTable: true, @@ -615,6 +619,17 @@ }, engine: driver.engine, }); + } else if (menu.isImport) { + const { conid, database } = data; + showModal(ImportExportModal, { + initialValues: { + sourceStorageType: getDefaultFileFormat(getExtensions()).storageType, + targetStorageType: 'database', + targetConnectionId: conid, + targetDatabaseName: database, + fixedTargetPureName: data.pureName, + }, + }); } else { openDatabaseObjectDetail( menu.tab, @@ -661,6 +676,7 @@ import InputTextModal from '../modals/InputTextModal.svelte'; import { extractShellConnection } from '../impexp/createImpExpScript'; import { format as dateFormat } from 'date-fns'; + import { getDefaultFileFormat } from '../plugins/fileformats'; export let data; export let passProps; diff --git a/packages/web/src/impexp/ImportExportConfigurator.svelte b/packages/web/src/impexp/ImportExportConfigurator.svelte index 4ed7fcab..982253d6 100644 --- a/packages/web/src/impexp/ImportExportConfigurator.svelte +++ b/packages/web/src/impexp/ImportExportConfigurator.svelte @@ -29,6 +29,12 @@ if (preferedStorageType && preferedStorageType != values.sourceStorageType) { newValues['sourceStorageType'] = preferedStorageType; } + for (const source of newSources) { + if (values.fixedTargetPureName) { + values[`targetName_${source}`] = values.fixedTargetPureName; + values[`actionType_${source}`] = 'appendData'; + } + } valuesStore.set({ ...values, ...newValues, diff --git a/packages/web/src/impexp/SourceAction.svelte b/packages/web/src/impexp/SourceAction.svelte index bfd9c0e8..f23dbc91 100644 --- a/packages/web/src/impexp/SourceAction.svelte +++ b/packages/web/src/impexp/SourceAction.svelte @@ -15,6 +15,6 @@ setFieldValue(`actionType_${name}`, e.detail)} /> diff --git a/packages/web/src/tabs/ShellTab.svelte b/packages/web/src/tabs/ShellTab.svelte index d97ccaf3..9ddf3df6 100644 --- a/packages/web/src/tabs/ShellTab.svelte +++ b/packages/web/src/tabs/ShellTab.svelte @@ -23,13 +23,13 @@ onClick: () => getCurrentEditor().copyNodeScript(), }); - // registerCommand({ - // id: 'shell.openWizard', - // category: 'Shell', - // name: 'Open wizard', - // // testEnabled: () => getCurrentEditor()?.openWizardEnabled(), - // onClick: () => getCurrentEditor().openWizard(), - // }); + registerCommand({ + id: 'shell.openWizard', + category: 'Shell', + name: 'Open wizard', + // testEnabled: () => getCurrentEditor()?.openWizardEnabled(), + onClick: () => getCurrentEditor().openWizard(), + }); const configRegex = /\s*\/\/\s*@ImportExportConfigurator\s*\n\s*\/\/\s*(\{[^\n]+\})\n/; const requireRegex = /\s*(\/\/\s*@require\s+[^\n]+)\n/g;