Browse Source

fix(nc-gui): grouping field not available if Kanban created after creating Form view

#3841
pull/3563/head
Wing-Kam Wong 2 years ago
parent
commit
46d7d354ca
  1. 11
      packages/nc-gui/components/dlg/ViewCreate.vue

11
packages/nc-gui/components/dlg/ViewCreate.vue

@ -58,8 +58,6 @@ const meta = inject(MetaInj, ref())
const viewList = inject(ViewListInj) const viewList = inject(ViewListInj)
const fields = inject(FieldsInj, ref([]))
const form = reactive<Form>({ const form = reactive<Form>({
title: props.title || '', title: props.title || '',
type: props.type, type: props.type,
@ -99,11 +97,12 @@ const typeAlias = computed(
}[props.type]), }[props.type]),
) )
watch(vModel, (value) => value && init())
watch( watch(
() => props.type, () => props.type,
(newType) => { (newType) => {
form.type = newType form.type = newType
init()
}, },
) )
@ -115,9 +114,9 @@ function init() {
} }
// preset the grouping field column // preset the grouping field column
if (form.type === ViewTypes.KANBAN) { if (props.type === ViewTypes.KANBAN) {
singleSelectFieldOptions.value = fields.value singleSelectFieldOptions.value = meta
.filter((el) => el.uidt === UITypes.SingleSelect) .value!.columns!.filter((el) => el.uidt === UITypes.SingleSelect)
.map((field) => { .map((field) => {
return { return {
value: field.id, value: field.id,

Loading…
Cancel
Save