From 63d8f4a1641443469844ded4ce9cf994bd918641 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 17 Nov 2021 17:16:39 +0530 Subject: [PATCH] feat: project from excel Signed-off-by: Pranav C --- .../components/import/dropOrSelectFile.vue | 105 ++++++++++++ .../import/dropOrSelectFileModal.vue | 82 +++++---- .../nc-gui/components/import/excelImport.vue | 159 ++++++++++++++---- .../CSVTemplateAdapter.js | 8 +- .../ExcelTemplateAdapter.js | 16 +- .../ExcelUrlTemplateAdapter.js | 20 +++ .../TemplateGenerator.js | 0 .../components/csvExportImport.vue | 6 +- .../createProjectFromTemplateBtn.vue | 11 +- .../nc-gui/components/templates/editor.vue | 121 ++++++------- packages/nc-gui/pages/projects/index.vue | 102 ++++++----- packages/nocodb/src/lib/sqlMgr/SqlMgr.ts | 11 ++ packages/nocodb/src/lib/utils/projectAcl.ts | 1 + 13 files changed, 451 insertions(+), 191 deletions(-) create mode 100644 packages/nc-gui/components/import/dropOrSelectFile.vue rename packages/nc-gui/components/import/{ => templateParsers}/CSVTemplateAdapter.js (68%) rename packages/nc-gui/components/import/{ => templateParsers}/ExcelTemplateAdapter.js (83%) create mode 100644 packages/nc-gui/components/import/templateParsers/ExcelUrlTemplateAdapter.js rename packages/nc-gui/components/import/{ => templateParsers}/TemplateGenerator.js (100%) diff --git a/packages/nc-gui/components/import/dropOrSelectFile.vue b/packages/nc-gui/components/import/dropOrSelectFile.vue new file mode 100644 index 0000000000..d9ec39d271 --- /dev/null +++ b/packages/nc-gui/components/import/dropOrSelectFile.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/packages/nc-gui/components/import/dropOrSelectFileModal.vue b/packages/nc-gui/components/import/dropOrSelectFileModal.vue index 2f90b5207e..7f24221cdc 100644 --- a/packages/nc-gui/components/import/dropOrSelectFileModal.vue +++ b/packages/nc-gui/components/import/dropOrSelectFileModal.vue @@ -1,47 +1,55 @@ diff --git a/packages/nc-gui/components/import/excelImport.vue b/packages/nc-gui/components/import/excelImport.vue index 2229564fbb..facfe7560c 100644 --- a/packages/nc-gui/components/import/excelImport.vue +++ b/packages/nc-gui/components/import/excelImport.vue @@ -2,31 +2,81 @@
-
-
- - mdi-file-plus-outline + + + + mdi-file-upload-outline -

- Select Files to Upload -

-

- or drag and drop files -

-
-
+ Upload + + + + mdi-link-variant + + URL + + + +
+
+ + mdi-file-plus-outline + +

+ Select File to Upload +

+

+ or drag and drop file +

+ +

+ Supported: .xls, .xlsx, .xlsm +

+
+
+
+ +
+
+ +
+ + + Load + +
+
+
+
+
+ + + + + + +
@@ -37,7 +87,7 @@ class="nc-excel-import-input" type="file" style="display: none" - accept=".xlsx, .xls" + accept=".xlsx, .xls, .xlsm" @change="_change($event)" > - + @@ -262,7 +261,7 @@ 'items-per-page-options': [20, -1], }" class="pa-4 text-left mx-auto " - style="cursor: pointer" + style="cursor: pointer; max-width: 100%" >