From dc5ae370f4a957cd33bf439143b5a519e944970f Mon Sep 17 00:00:00 2001 From: Khisby Al Ghofari Date: Wed, 12 Apr 2023 13:10:42 +0700 Subject: [PATCH 1/5] feat: add check all on action column editor import modal --- packages/nc-gui/components/template/Editor.vue | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/nc-gui/components/template/Editor.vue b/packages/nc-gui/components/template/Editor.vue index 214ce1da20..4de89e1090 100644 --- a/packages/nc-gui/components/template/Editor.vue +++ b/packages/nc-gui/components/template/Editor.vue @@ -87,6 +87,8 @@ const isImporting = ref(false) const importingTips = ref>({}) +const checkAllRecord = ref(false) + const uiTypeOptions = ref( (Object.keys(UITypes) as (keyof typeof UITypes)[]) .filter( @@ -615,6 +617,13 @@ function handleEditableTnChange(idx: number) { function isSelectDisabled(uidt: string, disableSelect = false) { return (uidt === UITypes.SingleSelect || uidt === UITypes.MultiSelect) && disableSelect } + +function handleCheckAllRecord(event, table_name){ + const isChecked = event.target.checked; + for (const record of srcDestMapping.value[table_name]) { + record.enabled = isChecked; + } +} From 1dc832b0bfaf3375660db1af652b8fc55d152362 Mon Sep 17 00:00:00 2001 From: Khisby Al Ghofari Date: Wed, 12 Apr 2023 17:53:01 +0700 Subject: [PATCH 4/5] feat(nc-gui): specific param type --- packages/nc-gui/components/template/Editor.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/components/template/Editor.vue b/packages/nc-gui/components/template/Editor.vue index ca19059af6..6af851e630 100644 --- a/packages/nc-gui/components/template/Editor.vue +++ b/packages/nc-gui/components/template/Editor.vue @@ -32,6 +32,7 @@ import { useTabs, } from '#imports' import { TabType } from '~/lib' +import type { CheckboxChangeEvent } from 'ant-design-vue/es/checkbox/interface' const { quickImportType, projectTemplate, importData, importColumns, importDataOnly, maxRowsToParse, baseId } = defineProps() @@ -173,7 +174,7 @@ const prevEditableTn = ref([]) onMounted(() => { parseAndLoadTemplate() - + // used to record the previous EditableTn values // for checking the table duplication in current import // and updating the key in importData @@ -618,9 +619,9 @@ function isSelectDisabled(uidt: string, disableSelect = false) { return (uidt === UITypes.SingleSelect || uidt === UITypes.MultiSelect) && disableSelect } -function handleCheckAllRecord(event, table_name) { +function handleCheckAllRecord(event: CheckboxChangeEvent, tableName: string) { const isChecked = event.target.checked - for (const record of srcDestMapping.value[table_name]) { + for (const record of srcDestMapping.value[tableName]) { record.enabled = isChecked } } From 7fecf73556188394e001cb10f98582a90855700e Mon Sep 17 00:00:00 2001 From: Khisby Al Ghofari Date: Wed, 12 Apr 2023 17:54:23 +0700 Subject: [PATCH 5/5] feat(nc-gui): lint --- packages/nc-gui/components/template/Editor.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nc-gui/components/template/Editor.vue b/packages/nc-gui/components/template/Editor.vue index 6af851e630..455611e3a7 100644 --- a/packages/nc-gui/components/template/Editor.vue +++ b/packages/nc-gui/components/template/Editor.vue @@ -3,6 +3,7 @@ import dayjs from 'dayjs' import utc from 'dayjs/plugin/utc' import type { ColumnType, TableType } from 'nocodb-sdk' import { UITypes, isSystemColumn, isVirtualCol } from 'nocodb-sdk' +import type { CheckboxChangeEvent } from 'ant-design-vue/es/checkbox/interface' import { srcDestMappingColumns, tableColumns } from './utils' import { Empty, @@ -32,7 +33,6 @@ import { useTabs, } from '#imports' import { TabType } from '~/lib' -import type { CheckboxChangeEvent } from 'ant-design-vue/es/checkbox/interface' const { quickImportType, projectTemplate, importData, importColumns, importDataOnly, maxRowsToParse, baseId } = defineProps()