Browse Source

Merge pull request #3786 from nocodb/fix/3784-gallery-view-bugs

Fix(gui):  Gallery view bugs
pull/3791/head
Pranav C 2 years ago committed by GitHub
parent
commit
e65bb785bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      packages/nc-gui/components/smartsheet/Gallery.vue

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

@ -12,6 +12,7 @@ import {
OpenNewRecordFormHookInj,
PaginationDataInj,
ReadonlyInj,
ReloadRowDataHookInj,
ReloadViewMetaHookInj,
extractPkFromRow,
inject,
@ -29,6 +30,7 @@ interface Attachment {
const meta = inject(MetaInj, ref())
const view = inject(ActiveViewInj, ref())
const reloadViewMetaHook = inject(ReloadViewMetaHookInj)
const reloadViewDataHook = inject(ReloadViewDataHookInj)
const openNewRecordFormHook = inject(OpenNewRecordFormHookInj, createEventHook())
const expandedFormDlg = ref(false)
@ -85,7 +87,7 @@ const attachments = (record: any): Array<Attachment> => {
}
}
const expandForm = (row: RowType, _state?: Record<string, any>) => {
const expandForm = (row: RowType, state?: Record<string, any>) => {
if (!isUIAllowed('xcDatatableEditable')) return
const rowId = extractPkFromRow(row.row, meta.value.columns)
@ -140,11 +142,17 @@ reloadViewMetaHook?.on(async () => {
reloadAttachments.value = false
})
})
reloadViewDataHook?.on(async () => {
await loadData()
})
onMounted(async () => {
await loadData()
await loadGalleryData()
})
// provide view data reload hook as fallback to row data reload
provide(ReloadRowDataHookInj, reloadViewDataHook)
</script>
<template>

Loading…
Cancel
Save