Browse Source

fix/minor cleanup

pull/3083/head
Muhammed Mustafa 2 years ago
parent
commit
e9b62481b1
  1. 6
      packages/nc-gui-v2/components/smartsheet/Grid.vue
  2. 6
      packages/nc-gui-v2/composables/useGridViewColumnWidth.ts

6
packages/nc-gui-v2/components/smartsheet/Grid.vue

@ -83,11 +83,7 @@ const {
const { loadGridViewColumns, updateWidth, resizingColWidth, resizingCol } = useGridViewColumnWidth(view as any)
onMounted(() => {
if (!isPublicView.value) {
loadGridViewColumns()
} else {
loadGridViewColumns(fields.value)
}
loadGridViewColumns()
})
provide(IsFormInj, ref(false))

6
packages/nc-gui-v2/composables/useGridViewColumnWidth.ts

@ -36,9 +36,9 @@ export function useGridViewColumnWidth(view: Ref<(GridType & { id?: string }) |
{ deep: true, immediate: true },
)
const loadGridViewColumns = async (cols?: GridColumnType[] | undefined) => {
if (!view.value?.id && !cols) return
const colsData: GridColumnType[] = cols ?? (await $api.dbView.gridColumnsList(view.value.id))
const loadGridViewColumns = async () => {
if (!view.value?.id && !isPublic.value) return
const colsData: GridColumnType[] = isPublic.value ? columns.value : await $api.dbView.gridColumnsList(view.value.id)
gridViewCols.value = colsData.reduce<Record<string, GridColumnType>>(
(o, col) => ({
...o,

Loading…
Cancel
Save