From c82c298a9301ee2b6191e9ef19700c622da16c13 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 16 Apr 2021 09:40:44 +0100 Subject: [PATCH] Update create table modal to use new forms --- .../TableNavigator/TableDataImport.svelte | 41 ++++++++++++------- .../modals/CreateTableModal.svelte | 1 - 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte b/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte index ea9cb644e0..806961476e 100644 --- a/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte +++ b/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte @@ -91,9 +91,24 @@ } const handleTypeChange = column => evt => { - schema[column].type = evt.target.value + schema[column].type = evt.detail validateCSV() } + + const typeOptions = [ + { + label: "Text", + value: "string", + }, + { + label: "Number", + value: "number", + }, + { + label: "Date", + value: "datetime", + }, + ]
@@ -108,14 +123,12 @@
{columnName} + on:change={handleTypeChange(columnName)} + options={typeOptions} + placeholder={null} + getOptionLabel={option => option.label} + getOptionValue={option => option.value} /> {schema[columnName].success ? 'Success' : 'Failure'} @@ -128,12 +141,10 @@
{#if fields.length}
- - +