This commit is contained in:
Jan Prochazka 2020-11-19 08:02:16 +01:00
parent ac049f43a3
commit 64362cdf13
5 changed files with 6 additions and 6 deletions

View File

@ -1,7 +1,7 @@
export default { export default {
storageType: 'csv', storageType: 'csv',
extension: 'csv', extension: 'csv',
name: 'CSV files',
readerFunc: 'csvReader', readerFunc: 'csvReader',
writerFunc: 'csvWriter', writerFunc: 'csvWriter',
filesTitle: 'CSV files',
}; };

View File

@ -1,6 +1,6 @@
export default { export default {
storageType: 'excel', storageType: 'excel',
extension: 'xlsx', extension: 'xlsx',
name: 'MS Excel files',
readerFunc: 'excelSheetReader', readerFunc: 'excelSheetReader',
filesTitle: 'MS Excel files',
}; };

View File

@ -1,7 +1,7 @@
export default { export default {
storageType: 'jsonl', storageType: 'jsonl',
extension: 'jsonl', extension: 'jsonl',
name: 'JSON lines',
readerFunc: 'jsonLinesReader', readerFunc: 'jsonLinesReader',
writerFunc: 'jsonLinesWriter', writerFunc: 'jsonLinesWriter',
filesTitle: 'JSON lines',
}; };

View File

@ -1,7 +1,7 @@
export interface FileFormatDefinition { export interface FileFormatDefinition {
storageType: string; storageType: string;
extension: string; extension: string;
name: string;
readerFunc?: string; readerFunc?: string;
writerFunc?: string; writerFunc?: string;
filesTitle: string;
} }

View File

@ -91,7 +91,7 @@ const Title = styled.div`
function getFileFilters(storageType) { function getFileFilters(storageType) {
const res = []; const res = [];
const format = findFileFormat(storageType); const format = findFileFormat(storageType);
if (format) res.push({ name: format.filesTitle, extensions: [format.extension] }); if (format) res.push({ name: format.name, extensions: [format.extension] });
res.push({ name: 'All Files', extensions: ['*'] }); res.push({ name: 'All Files', extensions: ['*'] });
return res; return res;
} }
@ -195,7 +195,7 @@ function SourceTargetConfig({
{ value: 'database', label: 'Database', directions: ['source', 'target'] }, { value: 'database', label: 'Database', directions: ['source', 'target'] },
...fileformats.map((format) => ({ ...fileformats.map((format) => ({
value: format.storageType, value: format.storageType,
label: format.filesTitle, label: format.name,
directions: getFileFormatDirections(format), directions: getFileFormatDirections(format),
})), })),
{ value: 'query', label: 'SQL Query', directions: ['source'] }, { value: 'query', label: 'SQL Query', directions: ['source'] },