Browse Source

fix: expanded gallery

pull/6554/head
DarkPhoenix2704 1 year ago
parent
commit
8545bb15ed
  1. 2
      packages/nc-gui/components/smartsheet/Gallery.vue
  2. 8
      packages/nc-gui/components/smartsheet/expanded-form/index.vue
  3. 12
      packages/nc-gui/utils/dataUtils.ts

2
packages/nc-gui/components/smartsheet/Gallery.vue

@ -126,7 +126,7 @@ const attachments = (record: any): Attachment[] => {
const expandForm = (row: RowType, state?: Record<string, any>) => {
const rowId = extractPkFromRow(row.row, meta.value!.columns!)
if (rowId && !isPublic.value) {
if (rowId) {
router.push({
query: {
...route.query,

8
packages/nc-gui/components/smartsheet/expanded-form/index.vue

@ -46,7 +46,7 @@ interface Props {
const props = defineProps<Props>()
const emits = defineEmits(['update:modelValue', 'cancel', 'next', 'prev', 'update:row'])
const emits = defineEmits(['update:modelValue', 'cancel', 'next', 'prev'])
const key = ref(0)
@ -339,8 +339,10 @@ const onConfirmDeleteRowClick = async () => {
}
watch(rowId, async (nRow) => {
await _loadRow(nRow)
await loadCommentsAndLogs()
if (nRow.value) {
await _loadRow(nRow)
await loadCommentsAndLogs()
}
})
const showRightSections = computed(() => {

12
packages/nc-gui/utils/dataUtils.ts

@ -4,13 +4,11 @@ import type { Row } from 'lib'
import { isColumnRequiredAndNull } from './columnUtils'
export const extractPkFromRow = (row: Record<string, any>, columns: ColumnType[]) => {
return (
row &&
columns
?.filter((c) => c.pk)
.map((c) => row?.[c.title as string])
.join('___')
)
if (!row || !columns) return null
return columns
.filter((c) => c.pk)
.map((c) => row?.[c.title as string])
.join('___')
}
export const rowPkData = (row: Record<string, any>, columns: ColumnType[]) => {

Loading…
Cancel
Save