diff --git a/packages/nc-gui/components/ProjectTreeView.vue b/packages/nc-gui/components/ProjectTreeView.vue
index 7da30e6573..f074bd2c27 100644
--- a/packages/nc-gui/components/ProjectTreeView.vue
+++ b/packages/nc-gui/components/ProjectTreeView.vue
@@ -769,12 +769,12 @@
:heading="selectedNodeForDelete.heading"
type="error"
/>
-
@@ -795,7 +795,7 @@ import DlgTableCreate from "@/components/utils/dlgTableCreate";
import DlgViewCreate from "@/components/utils/dlgViewCreate";
import SponsorMini from "@/components/sponsorMini";
import {validateTableName} from "~/helpers";
-import ExcelImport from "~/components/import/excelImport";
+import QuickImport from "~/components/import/quickImport";
import draggable from "vuedraggable";
import GithubStarBtn from "~/components/githubStarBtn";
@@ -810,7 +810,7 @@ export default {
SettingsModal,
GithubStarBtn,
draggable,
- ExcelImport,
+ QuickImport,
SponsorMini,
DlgViewCreate,
DlgTableCreate,
@@ -864,7 +864,7 @@ export default {
open: [],
search: null,
menuVisible: false,
- excelImportDialog: false,
+ quickImportDialog: false,
x: 0,
y: 0,
menuItem: null,
@@ -1162,7 +1162,7 @@ export default {
this.miniExpanded = false;
}
},
- onExcelImport() {
+ onQuickImport() {
if (!this.menuItem || this.menuItem.type !== "tableDir") {
this.menuItem = this.listViewArr.find((n) => n.type === "tableDir");
}
@@ -1437,7 +1437,7 @@ export default {
await this.loadViews(this.menuItem);
this.$toast.success("Views refreshed").goAway(1000);
} else if (action === "IMPORT_EXCEL") {
- this.excelImportDialog = true;
+ this.quickImportDialog = true;
} else if (action === "ENV_DB_FUNCTIONS_REFRESH") {
await this.loadFunctions(this.menuItem);
this.$toast.success("Functions refreshed").goAway(1000);
diff --git a/packages/nc-gui/components/import/excelImport.vue b/packages/nc-gui/components/import/quickImport.vue
similarity index 83%
rename from packages/nc-gui/components/import/excelImport.vue
rename to packages/nc-gui/components/import/quickImport.vue
index c9f172bb26..e1c9ae8ecf 100644
--- a/packages/nc-gui/components/import/excelImport.vue
+++ b/packages/nc-gui/components/import/quickImport.vue
@@ -43,8 +43,8 @@
{{ $t('msg.info.upload_sub') }}
-
-
+
+
{{ $t('msg.info.excelSupport') }}
@@ -60,7 +60,7 @@
v-model="url"
hide-details="auto"
type="url"
- :label="$t('msg.info.excelURL')"
+ :label="quickImportType == 'excel' ? $t('msg.info.excelURL') : $t('msg.info.csvURL') "
class="caption"
outlined
dense
@@ -106,6 +106,7 @@
+
-
+
-
- {{ $t('activity.importExcel') }} : {{ filename }}
+
+
+ {{ $t('activity.importExcel') }}
+
+
+
+ {{ $t('activity.importCSV') }}
+
+ : {{ filename }}
-
-
- {{ $t('activity.importExcel') }}
+
+ {{ $t('activity.importExcel') }}
+
+
+
+ {{ $t('activity.importCSV') }}
+
@@ -172,12 +193,13 @@ import ExcelUrlTemplateAdapter from '~/components/import/templateParsers/ExcelUr
import ExcelTemplateAdapter from '~/components/import/templateParsers/ExcelTemplateAdapter'
export default {
- name: 'ExcelImport',
+ name: 'QuickImport',
components: { CreateProjectFromTemplateBtn, TemplateEditor },
props: {
hideLabel: Boolean,
value: Boolean,
- importToProject: Boolean
+ importToProject: Boolean,
+ quickImportType: String
},
data() {
return {
@@ -276,7 +298,9 @@ export default {
this.templateEditorModal = true
} catch (e) {
console.log(e)
- this.$toast.error(e.message).goAway(3000)
+ this.$toast
+ .error(await this._extractSdkResponseErrorMsg(e))
+ .goAway(3000)
}
},
@@ -296,8 +320,14 @@ export default {
return
}
- if ((!/\.xls[xm]?$/.test(file.name)) && (!/\.o[dt]s?$/.test(file.name))) {
- return this.$toast.error('Dropped file is not an accepted file type. The accepted file types are .xlsx,.xls,.xlsm!').goAway(3000)
+ if (this.quickImportType === 'excel') {
+ if (!/.*\.(xls|xlsx|xlsm|ods|ots)/.test(file.name)) {
+ return this.$toast.error('Dropped file is not an accepted file type. The accepted file types are .xls, .xlsx, .xlsm, .ods, .ots!').goAway(3000)
+ }
+ } else if (this.quickImportType === 'csv') {
+ if (!/.*\.(csv)/.test(file.name)) {
+ return this.$toast.error('Dropped file is not an accepted file type. The accepted file type is .csv!').goAway(3000)
+ }
}
this._file(file)
},
diff --git a/packages/nc-gui/components/project/spreadsheet/components/importExport/columnMappingModal.vue b/packages/nc-gui/components/project/spreadsheet/components/importExport/columnMappingModal.vue
index a2ff286336..c65faf4ed8 100644
--- a/packages/nc-gui/components/project/spreadsheet/components/importExport/columnMappingModal.vue
+++ b/packages/nc-gui/components/project/spreadsheet/components/importExport/columnMappingModal.vue
@@ -1,6 +1,7 @@
-
+
+
Table : {{ meta.title }}
@@ -99,12 +100,12 @@ export default {
meta: Object,
importDataColumns: Array,
value: Boolean,
- parsedCsv: Object
+ parsedCsv: Object,
},
data() {
return {
mappings: [],
- valid: false
+ valid: false,
}
},
computed: {
@@ -194,9 +195,11 @@ export default {
this.mappings = []
for (const col of this.importDataColumns) {
const o = { sourceCn: col, enabled: true }
- const tableColumn = this.meta.columns.find(c => c.title === col)
- if (tableColumn) {
- o.destCn = tableColumn.title
+ if (this.meta) {
+ const tableColumn = this.meta.columns.find(c => c.title === col)
+ if (tableColumn) {
+ o.destCn = tableColumn.title
+ }
}
this.mappings.push(o)
}
@@ -204,7 +207,7 @@ export default {
},
getIcon(uidt) {
return getUIDTIcon(uidt) || 'mdi-alpha-v-circle-outline'
- }
+ },
}
}
diff --git a/packages/nc-gui/components/projectTabs.vue b/packages/nc-gui/components/projectTabs.vue
index 2ce35f7b6e..054114b3e7 100644
--- a/packages/nc-gui/components/projectTabs.vue
+++ b/packages/nc-gui/components/projectTabs.vue
@@ -42,14 +42,12 @@
max-width: 140px;
text-overflow: ellipsis;
"
- >{{ tab.name }}
+ >{{ tab.name }}
mdi-close
-
-
-
- mdi-plus-box
-
-
+
+
+
+
+
+ mdi-plus-box
+
+
+
+ Add / Import
+
+
+
+
+
+
+
+
+ mdi-table
+
+
+
+ {{ $t('tooltip.addTable') }}
+
+
+
+
+
+ QUICK IMPORT FROM
+
+
+
+
+ mdi-file-document-outline
+
+
+
+ CSV file
+
+
+
+
+
+
+ mdi-file-excel
+
+
+
+ Microsoft Excel
+
+
+
+
+
-
+
-
-
+
+