Skip to content
Snippets Groups Projects
Commit f2e976fa authored by Kirill Stytsenko's avatar Kirill Stytsenko
Browse files

WiP on #57

parent 8d068c74
No related branches found
No related tags found
No related merge requests found
<template> <template>
<div>
<h3 class="mb-2 mt-1">Table from CSV</h3>
<v-stepper v-model="step" vertical> <v-stepper v-model="step" vertical>
<v-stepper-step :complete="step > 1" step="1"> <v-stepper-step :complete="step > 1" step="1">
Table
</v-stepper-step>
<v-stepper-content class="pt-0 pb-1" step="1">
<v-text-field v-model="tableName" required label="Name" />
<v-text-field v-model="tableDesc" label="Description" />
<v-btn color="primary" @click="step = 2">
Continue
</v-btn>
</v-stepper-content>
<v-stepper-step :complete="step > 2" step="2">
Upload CSV file Upload CSV file
</v-stepper-step> </v-stepper-step>
<v-stepper-content step="1"> <v-stepper-content step="2">
<v-row dense> <v-row dense>
<v-col cols="8"> <v-col cols="8">
<v-file-input <v-file-input
...@@ -19,10 +33,10 @@ ...@@ -19,10 +33,10 @@
</v-row> </v-row>
</v-stepper-content> </v-stepper-content>
<v-stepper-step :complete="step > 2" step="2"> <v-stepper-step :complete="step > 3" step="3">
Choose data type of columns Choose data type of columns
</v-stepper-step> </v-stepper-step>
<v-stepper-content step="2"> <v-stepper-content step="3">
<div v-for="(c, idx) in columns" :key="idx"> <div v-for="(c, idx) in columns" :key="idx">
<v-row dense class="column pa-2 ml-1 mr-1"> <v-row dense class="column pa-2 ml-1 mr-1">
<v-col cols="4"> <v-col cols="4">
...@@ -45,21 +59,22 @@ ...@@ -45,21 +59,22 @@
</v-row> </v-row>
</div> </div>
<v-btn color="primary" @click="step = 3"> <v-btn color="primary" @click="step = 4">
Continue Continue
</v-btn> </v-btn>
</v-stepper-content> </v-stepper-content>
<v-stepper-step <v-stepper-step
:complete="step > 3" :complete="step > 4"
step="3"> step="4">
Done Done
</v-stepper-step> </v-stepper-step>
<v-stepper-content step="3"> <v-stepper-content step="4">
Done. Go to table. Done. Go to table.
</v-stepper-content> </v-stepper-content>
</v-stepper> </v-stepper>
</div>
</template> </template>
<script> <script>
export default { export default {
...@@ -69,6 +84,8 @@ export default { ...@@ -69,6 +84,8 @@ export default {
data () { data () {
return { return {
step: 1, step: 1,
tableName: '',
tableDesc: '',
loading: false, loading: false,
file: null, file: null,
columns: [], columns: [],
...@@ -97,7 +114,7 @@ export default { ...@@ -97,7 +114,7 @@ export default {
}) })
if (res.data.success) { if (res.data.success) {
this.columns = res.data.columns this.columns = res.data.columns
this.step = 2 this.step = 3
} else { } else {
this.$toast.error('Could not upload CSV data') this.$toast.error('Could not upload CSV data')
} }
......
...@@ -24,7 +24,7 @@ app.post('/table_from_csv', upload.single('file'), async (req, res) => { ...@@ -24,7 +24,7 @@ app.post('/table_from_csv', upload.single('file'), async (req, res) => {
analysis = await fetch(`${process.env.API_ANALYSE}/datatypesbypath?filepath=${path}`) analysis = await fetch(`${process.env.API_ANALYSE}/datatypesbypath?filepath=${path}`)
analysis = await analysis.json() analysis = await analysis.json()
} catch (error) { } catch (error) {
res.json({ success: false, error }) return res.json({ success: false, error })
} }
// map messytables / CoMi's `determine_dt` column types to ours // map messytables / CoMi's `determine_dt` column types to ours
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment