Browse Source

feat: row height support for public views

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/4840/head
mertmit 2 years ago
parent
commit
331bcd022a
  1. 23
      packages/nc-gui/components/smartsheet/toolbar/RowHeight.vue

23
packages/nc-gui/components/smartsheet/toolbar/RowHeight.vue

@ -1,28 +1,31 @@
<script setup lang="ts">
import type { GridType } from 'nocodb-sdk'
import { ActiveViewInj, IsLockedInj, ReloadViewDataHookInj, inject, ref, useMenuCloseOnEsc } from '#imports'
import { ActiveViewInj, IsLockedInj, inject, ref, useMenuCloseOnEsc } from '#imports'
const { isSharedBase } = useProject()
const view = inject(ActiveViewInj, ref())
const isLocked = inject(IsLockedInj, ref(false))
const isPublic = inject(IsPublicInj, ref(false))
const reloadDataHook = inject(ReloadViewDataHookInj)
const isLocked = inject(IsLockedInj, ref(false))
const { $api } = useNuxtApp()
const open = ref(false)
const updateRowHeight = (rh: number) => {
const updateRowHeight = async (rh: number) => {
if (view.value?.id) {
try {
$api.dbView.gridUpdate(view.value.id, {
row_height: rh,
})
;(view.value.view as GridType).row_height = rh
if (!isPublic.value && !isSharedBase.value) {
await $api.dbView.gridUpdate(view.value.id, {
row_height: rh,
})
message.success('View updated successfully!')
message.success('View updated successfully!')
}
reloadDataHook?.trigger()
;(view.value.view as GridType).row_height = rh
open.value = false
} catch (e) {

Loading…
Cancel
Save