Browse Source

fix: kanban image not loading

pull/6604/head
DarkPhoenix2704 11 months ago
parent
commit
93b5ef743a
  1. 2
      packages/nc-gui/components/smartsheet/Kanban.vue
  2. 2
      packages/nocodb/src/db/BaseModelSqlv2.ts
  3. 13
      packages/nocodb/src/helpers/getAst.ts

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

@ -564,7 +564,7 @@ watch(
</template>
<template v-for="(attachment, index) in attachments(record)">
<LazyCellAttachmentImage
<LazyCellAttachmentImage
v-if="isImage(attachment.title, attachment.mimetype ?? attachment.type)"
:key="`carousel-${record.row.id}-${index}`"
class="h-52 object-cover"

2
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -3922,7 +3922,7 @@ class BaseModelSqlv2 {
const proto = await this.getProto();
const data = await groupedQb;
const data: any[] = await this.execAndParse(groupedQb);
const result = data?.map((d) => {
d.__proto__ = proto;
return d;

13
packages/nocodb/src/helpers/getAst.ts

@ -1,11 +1,11 @@
import { isSystemColumn, RelationTypes, UITypes } from 'nocodb-sdk';
import { isSystemColumn, RelationTypes, UITypes, ViewTypes } from 'nocodb-sdk';
import type {
Column,
LinkToAnotherRecordColumn,
LookupColumn,
Model,
} from '~/models';
import { GalleryView, View } from '~/models';
import { GalleryView, KanbanView, View } from '~/models';
const getAst = async ({
query,
@ -33,11 +33,12 @@ const getAst = async ({
dependencyFields.fieldsSet = dependencyFields.fieldsSet || new Set();
let coverImageId;
if (view) {
if (view.type === ViewTypes.GALLERY) {
const gallery = await GalleryView.get(view.id);
if (gallery) {
coverImageId = gallery.fk_cover_image_col_id;
}
coverImageId = gallery.fk_cover_image_col_id;
} else if (view.type === ViewTypes.KANBAN) {
const kanban = await KanbanView.get(view.id);
coverImageId = kanban.fk_cover_image_col_id;
}
if (!model.columns?.length) await model.getColumns();

Loading…
Cancel
Save