import table wizard

This commit is contained in:
Jan Prochazka 2022-04-28 15:31:41 +02:00
parent 9e25a45090
commit 4c9ae46577
4 changed files with 30 additions and 8 deletions

View File

@ -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;

View File

@ -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,

View File

@ -15,6 +15,6 @@
<SelectField
{options}
isNative
value={values[`actionType_${name}`] || options[0].value}
value={$values[`actionType_${name}`] || options[0].value}
on:change={e => setFieldValue(`actionType_${name}`, e.detail)}
/>

View File

@ -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;