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>
import { isVirtualCol, ViewTypes } from 'nocodb-sdk'
import { ViewTypes, isVirtualCol } from 'nocodb-sdk'
import {
ActiveViewInj,
ChangePageInj,
@ -160,8 +160,6 @@ onMounted(async () => {
// provide view data reload hook as fallback to row data reload
provide(ReloadRowDataHookInj, reloadViewDataHook)
watch(view, (nextView) => {
if (nextView?.type === ViewTypes.FORM) {
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 */
function onCreate(view: ViewType) {
views.value.push(view)
async function onCreate(view: ViewType) {
await loadViews()
router.push({ params: { viewTitle: view.title || '' } })
modalOpen = false
$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({
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) => {
if (val && activeView.value?.type === ViewTypes.GALLERY && activeView.value?.id && activeView.value?.view) {
await $api.dbView.galleryUpdate(activeView.value?.id, {
...activeView.value?.view,
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()
}
},
@ -140,7 +142,7 @@ const getIcon = (c: ColumnType) =>
<a-select
v-model:value="coverImageColumnId"
class="w-full"
:options="coverOptions"
:options="coverOptions ?? []"
dropdown-class-name="nc-dropdown-cover-image"
@click.stop
/>
@ -203,6 +205,7 @@ const getIcon = (c: ColumnType) =>
:deep(.ant-checkbox-inner) {
@apply transform scale-60;
}
:deep(.ant-checkbox) {
@apply top-auto;
}

Loading…
Cancel
Save