diff --git a/packages/nc-gui/components/smartsheet/Gallery.vue b/packages/nc-gui/components/smartsheet/Gallery.vue index 52bced22c6..592298e1bd 100644 --- a/packages/nc-gui/components/smartsheet/Gallery.vue +++ b/packages/nc-gui/components/smartsheet/Gallery.vue @@ -563,8 +563,20 @@ watch( } &.nc-virtual-cell-lookup { .nc-lookup-cell { - @apply !h-5.5; + &:has(.nc-attachment-wrapper) { + @apply !h-auto; + .nc-attachment-cell { + @apply !h-auto; + + .nc-attachment-wrapper { + @apply py-0; + } + } + } + &:not(:has(.nc-attachment-wrapper)) { + @apply !h-5.5; + } .nc-cell-lookup-scroll { @apply py-0 h-auto; } diff --git a/packages/nc-gui/components/smartsheet/Kanban.vue b/packages/nc-gui/components/smartsheet/Kanban.vue index e4d932b97e..2596172f36 100644 --- a/packages/nc-gui/components/smartsheet/Kanban.vue +++ b/packages/nc-gui/components/smartsheet/Kanban.vue @@ -1315,8 +1315,20 @@ const handleSubmitRenameOrNewStack = async (loadMeta: boolean, stack?: any, stac } &.nc-virtual-cell-lookup { .nc-lookup-cell { - @apply !h-5.5; + &:has(.nc-attachment-wrapper) { + @apply !h-auto; + .nc-attachment-cell { + @apply !h-auto; + + .nc-attachment-wrapper { + @apply py-0; + } + } + } + &:not(:has(.nc-attachment-wrapper)) { + @apply !h-5.5; + } .nc-cell-lookup-scroll { @apply py-0 h-auto; } diff --git a/packages/nc-gui/components/smartsheet/details/Fields.vue b/packages/nc-gui/components/smartsheet/details/Fields.vue index a6c64a64b9..d664388907 100644 --- a/packages/nc-gui/components/smartsheet/details/Fields.vue +++ b/packages/nc-gui/components/smartsheet/details/Fields.vue @@ -51,7 +51,9 @@ const { meta, view } = useSmartsheetStoreOrThrow() const isLocked = inject(IsLockedInj, ref(false)) -const { openedViewsTab } = storeToRefs(useViewsStore()) +const viewsStore = useViewsStore() + +const { openedViewsTab } = storeToRefs(viewsStore) const localMetaColumns = ref([]) @@ -691,15 +693,25 @@ const saveChanges = async () => { } } + const deletedOrUpdatedColumnIds: Set = new Set() + for (const op of ops.value) { if (op.op === 'add') { if (activeField.value && compareCols(activeField.value, op.column)) { changeField() } } else if (op.op === 'delete') { + deletedOrUpdatedColumnIds.add(op.column.id as string) + if (activeField.value && compareCols(activeField.value, op.column)) { changeField() } + } else if (op.op === 'update') { + const originalColumn = meta.value?.columns?.find((c) => c.id === op.column.id) as ColumnType + + if (originalColumn?.uidt === UITypes.Attachment && originalColumn?.uidt !== op.column.uidt) { + deletedOrUpdatedColumnIds.add(op.column.id as string) + } } } @@ -736,10 +748,20 @@ const saveChanges = async () => { moveOps.value = [] } + for (const op of ops.value) { + // remove column id from deletedColumnIds if operation was failed + if (deletedOrUpdatedColumnIds.has(op.column.id as string) && (op.op === 'delete' || op.op === 'update')) { + deletedOrUpdatedColumnIds.delete(op.column.id as string) + } + } + await getMeta(meta.value.id, true) metaToLocal() + // Update views if column is used as cover image + viewsStore.updateViewCoverImageColumnId({ metaId: meta.value.id as string, columnIds: deletedOrUpdatedColumnIds }) + columnsHash.value = (await $api.dbTableColumn.hash(meta.value?.id)).hash visibilityOps.value = [] diff --git a/packages/nc-gui/components/smartsheet/header/DeleteColumnModal.vue b/packages/nc-gui/components/smartsheet/header/DeleteColumnModal.vue index 4cfcd7517f..5dbaf06a2b 100644 --- a/packages/nc-gui/components/smartsheet/header/DeleteColumnModal.vue +++ b/packages/nc-gui/components/smartsheet/header/DeleteColumnModal.vue @@ -1,6 +1,6 @@