Browse Source

fix(gui): gallery view bug fixes

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3830/head
Pranav C 2 years ago
parent
commit
90ab7166f1
  1. 4
      packages/nc-gui/components/smartsheet/Gallery.vue
  2. 4
      packages/nc-gui/components/smartsheet/sidebar/index.vue
  3. 9
      packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue

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

@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { isVirtualCol, ViewTypes } from 'nocodb-sdk' import { ViewTypes, isVirtualCol } from 'nocodb-sdk'
import { import {
ActiveViewInj, ActiveViewInj,
ChangePageInj, ChangePageInj,
@ -160,8 +160,6 @@ onMounted(async () => {
// provide view data reload hook as fallback to row data reload // provide view data reload hook as fallback to row data reload
provide(ReloadRowDataHookInj, reloadViewDataHook) provide(ReloadRowDataHookInj, reloadViewDataHook)
watch(view, (nextView) => { watch(view, (nextView) => {
if (nextView?.type === ViewTypes.FORM) { if (nextView?.type === ViewTypes.FORM) {
reloadEventHook.trigger() reloadEventHook.trigger()

4
packages/nc-gui/components/smartsheet/sidebar/index.vue

@ -94,8 +94,8 @@ function openModal({ type, title = '', copyViewId }: { type: ViewTypes; title: s
} }
/** Handle view creation */ /** Handle view creation */
function onCreate(view: ViewType) { async function onCreate(view: ViewType) {
views.value.push(view) await loadViews()
router.push({ params: { viewTitle: view.title || '' } }) router.push({ params: { viewTitle: view.title || '' } })
modalOpen = false modalOpen = false
$e('a:view:create', { view: view.type }) $e('a:view:create', { view: view.type })

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

@ -86,14 +86,16 @@ const onMove = (_event: { moved: { newIndex: number } }) => {
const coverImageColumnId = computed({ const coverImageColumnId = computed({
get: () => get: () =>
activeView.value?.type === ViewTypes.GALLERY ? (activeView.value?.view as GalleryType).fk_cover_image_col_id : undefined, activeView.value?.type === ViewTypes.GALLERY && activeView.value?.view
? (activeView.value?.view as GalleryType).fk_cover_image_col_id
: undefined,
set: async (val) => { set: async (val) => {
if (val && activeView.value?.type === ViewTypes.GALLERY && activeView.value?.id && activeView.value?.view) { if (val && activeView.value?.type === ViewTypes.GALLERY && activeView.value?.id && activeView.value?.view) {
await $api.dbView.galleryUpdate(activeView.value?.id, { await $api.dbView.galleryUpdate(activeView.value?.id, {
...activeView.value?.view, ...activeView.value?.view,
fk_cover_image_col_id: val, fk_cover_image_col_id: val,
}) })
;(activeView.value?.view as GalleryType).fk_cover_image_col_id = val ;(activeView.value.view as GalleryType).fk_cover_image_col_id = val
reloadViewMetaHook.trigger() reloadViewMetaHook.trigger()
} }
}, },
@ -140,7 +142,7 @@ const getIcon = (c: ColumnType) =>
<a-select <a-select
v-model:value="coverImageColumnId" v-model:value="coverImageColumnId"
class="w-full" class="w-full"
:options="coverOptions" :options="coverOptions ?? []"
dropdown-class-name="nc-dropdown-cover-image" dropdown-class-name="nc-dropdown-cover-image"
@click.stop @click.stop
/> />
@ -203,6 +205,7 @@ const getIcon = (c: ColumnType) =>
:deep(.ant-checkbox-inner) { :deep(.ant-checkbox-inner) {
@apply transform scale-60; @apply transform scale-60;
} }
:deep(.ant-checkbox) { :deep(.ant-checkbox) {
@apply top-auto; @apply top-auto;
} }

Loading…
Cancel
Save