-
+
|
@@ -117,6 +124,12 @@ export default {
return `Following columns are required : ${missingRequiredColumns.map(c => c._cn).join(', ')}`
}
return false
+ },
+ noSelectedColumnError() {
+ if ((this.mappings || []).filter(v => v.enabled === true).length == 0) {
+ return 'At least one column has to be selected'
+ }
+ return false
}
},
mounted() {
@@ -129,6 +142,11 @@ export default {
return true
}
+ // if it is not selected, then pass validation
+ if (!row.enabled) {
+ return true
+ }
+
const v = this.meta && this.meta.columns.find(c => c._cn === _cn)
if ((this.mappings || []).filter(v => v.destCn === _cn).length > 1) { return 'Duplicate mapping found, please remove one of the mapping' }
@@ -154,6 +172,7 @@ export default {
}
this.mappings.push(o)
}
+ this.$nextTick(()=> this.$refs.form.validate())
},
getIcon(uidt) {
return getUIDTIcon(uidt) || 'mdi-alpha-v-circle-outline'
diff --git a/packages/nc-gui/components/project/spreadsheet/components/moreActions.vue b/packages/nc-gui/components/project/spreadsheet/components/moreActions.vue
index 84329f6a44..d7dd20868f 100644
--- a/packages/nc-gui/components/project/spreadsheet/components/moreActions.vue
+++ b/packages/nc-gui/components/project/spreadsheet/components/moreActions.vue
@@ -289,6 +289,7 @@ export default {
}
this.columnMappingModal = false
this.$store.commit('loader/MutClear')
+ this.$emit('reload')
this.$toast.success('Successfully imported table data').goAway(3000)
} catch (e) {
this.$toast.error(e.message).goAway(3000)
diff --git a/packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue b/packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue
index 06d697795f..3106c373e5 100644
--- a/packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue
+++ b/packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue
@@ -110,6 +110,7 @@
:selected-view="selectedView"
@showAdditionalFeatOverlay="showAdditionalFeatOverlay($event)"
@webhook="showAdditionalFeatOverlay('webhooks')"
+ @reload="reload"
/>
|