Browse Source

feat(nc-gui): introduce no image option in cover image fields menu

pull/4003/head
Wing-Kam Wong 2 years ago
parent
commit
b6d0f29d0d
  1. 2
      packages/nc-gui/components/smartsheet/Gallery.vue
  2. 19
      packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue

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

@ -177,7 +177,7 @@ watch(view, async (nextView) => {
class="!rounded-lg h-full overflow-hidden break-all max-w-[450px]"
@click="expandFormClick($event, record)"
>
<template #cover>
<template v-if="galleryData.fk_cover_image_col_id" #cover>
<a-carousel v-if="!reloadAttachments && attachments(record).length" autoplay class="gallery-carousel" arrows>
<template #customPaging>
<a>

19
packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue

@ -80,7 +80,6 @@ const coverImageColumnId = computed({
: undefined,
set: async (val) => {
if (
val &&
(activeView.value?.type === ViewTypes.GALLERY || activeView.value?.type === ViewTypes.KANBAN) &&
activeView.value?.id &&
activeView.value?.view
@ -104,14 +103,16 @@ const coverImageColumnId = computed({
})
const coverOptions = computed<SelectProps['options']>(() => {
return fields.value
?.filter((el) => el.fk_column_id && metaColumnById.value[el.fk_column_id].uidt === UITypes.Attachment)
.map((field) => {
return {
value: field.fk_column_id,
label: field.title,
}
})
const filterFields =
fields.value
?.filter((el) => el.fk_column_id && metaColumnById.value[el.fk_column_id].uidt === UITypes.Attachment)
.map((field) => {
return {
value: field.fk_column_id,
label: field.title,
}
}) ?? []
return [{ value: null, label: 'No Image' }, ...filterFields]
})
const getIcon = (c: ColumnType) =>

Loading…
Cancel
Save