Browse Source

fix(gui): close referenced row list modal on adding new

Signed-off-by: Pranav C <pranavxc@gmail.com>
fix/save-rows-on-tab-switch
Pranav C 2 years ago
parent
commit
9349843d4d
  1. 20
      packages/nc-gui/components/virtual-cell/components/ListItems.vue

20
packages/nc-gui/components/virtual-cell/components/ListItems.vue

@ -95,6 +95,12 @@ const newRowState = computed(() => {
}
}
})
// if it's an existing record close the list
// after new record creation since it's already linking while creating
watch(expandedFormDlg, (nexVal) => {
if (!nexVal && !isNew.value) vModel.value = false
})
</script>
<template>
@ -110,9 +116,9 @@ const newRowState = computed(() => {
<div class="flex-1" />
<MdiReload class="cursor-pointer text-gray-500 nc-reload" @click="loadChildrenExcludedList" />
<!-- Add new record -->
<a-button v-if="!isPublic" type="primary" size="small" @click="expandedFormDlg = true">{{
$t('activity.addNewRecord')
}}</a-button>
<a-button v-if="!isPublic" type="primary" size="small" @click="expandedFormDlg = true"
>{{ $t('activity.addNewRecord') }}
</a-button>
</div>
<template v-if="childrenExcludedList?.pageInfo?.totalRows">
<div class="flex-1 overflow-auto min-h-0 scrollbar-thin-dull px-12">
@ -122,10 +128,10 @@ const newRowState = computed(() => {
class="!my-4 cursor-pointer hover:(!bg-gray-200/50 shadow-md) group"
@click="linkRow(refRow)"
>
{{ refRow[relatedTablePrimaryValueProp]
}}<span class="hidden group-hover:(inline) text-gray-400 text-[11px] ml-1"
>({{ $t('labels.primaryKey') }} : {{ getRelatedTableRowId(refRow) }})</span
>
{{ refRow[relatedTablePrimaryValueProp] }}
<span class="hidden group-hover:(inline) text-gray-400 text-[11px] ml-1">
({{ $t('labels.primaryKey') }} : {{ getRelatedTableRowId(refRow) }})
</span>
</a-card>
</div>
<div class="flex justify-center mt-6">

Loading…
Cancel
Save