From e8cc5192cb64d3b6bdd568e05258a286fbe371a1 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 16 Nov 2021 20:51:15 +0530 Subject: [PATCH] feat: add validation rules for csv import(in progress) Signed-off-by: Pranav C --- package.json | 2 +- .../import/dropOrSelectFileModal.vue | 5 +- .../components/columnMappingModal.vue | 147 +++++++++++------- .../components/csvExportImport.vue | 8 +- packages/nc-gui/plugins/ncApis/gqlApi.js | 14 ++ 5 files changed, 119 insertions(+), 57 deletions(-) diff --git a/package.json b/package.json index aa7aca50a5..dcb1f80975 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "lerna": "^3.20.1" }, "scripts": { - "start:api": "cd ./packages/nocodb; npm install; cross-env NC_DISABLE_TELE=true npm run watch:run", + "start:api": "cd ./packages/nocodb; npm install; npm run watch:run", "start:web": "cd ./packages/nc-gui; npm install; npm run dev", "cypress:run": "cypress run --config-file ./scripts/cypress/cypress.json", "cypress:open": "cypress open --config-file ./scripts/cypress/cypress.json", diff --git a/packages/nc-gui/components/import/dropOrSelectFileModal.vue b/packages/nc-gui/components/import/dropOrSelectFileModal.vue index a54c73086e..2f90b5207e 100644 --- a/packages/nc-gui/components/import/dropOrSelectFileModal.vue +++ b/packages/nc-gui/components/import/dropOrSelectFileModal.vue @@ -63,10 +63,11 @@ export default { } }, methods: { - _change(file) { - const files = file.target.files + _change(event) { + const files = event.target.files if (files && files[0]) { this.$emit('file', files[0]) + event.target.value = '' } }, dropHandler(ev) { diff --git a/packages/nc-gui/components/project/spreadsheet/components/columnMappingModal.vue b/packages/nc-gui/components/project/spreadsheet/components/columnMappingModal.vue index ac66df2a81..7c25838b43 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/columnMappingModal.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/columnMappingModal.vue @@ -6,79 +6,98 @@ Table : {{ meta._tn }} - + mdi-database-import-outline - Import + + Import +
+ {{ requiredColumnValidationError }} +
- - - - - - Source column - - - Destination column - - - - - - - - -
- {{ r.sourceCn }} -
- - - - - - - - -
+ + + + + + + Source column + + + Destination column + + + + + + + + + +
+ {{ r.sourceCn }} +
+ + + + + + + + + +
+