Browse Source

fix/minor cleanup

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

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

@ -83,11 +83,7 @@ const {
const { loadGridViewColumns, updateWidth, resizingColWidth, resizingCol } = useGridViewColumnWidth(view as any) const { loadGridViewColumns, updateWidth, resizingColWidth, resizingCol } = useGridViewColumnWidth(view as any)
onMounted(() => { onMounted(() => {
if (!isPublicView.value) {
loadGridViewColumns() loadGridViewColumns()
} else {
loadGridViewColumns(fields.value)
}
}) })
provide(IsFormInj, ref(false)) 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 }, { deep: true, immediate: true },
) )
const loadGridViewColumns = async (cols?: GridColumnType[] | undefined) => { const loadGridViewColumns = async () => {
if (!view.value?.id && !cols) return if (!view.value?.id && !isPublic.value) return
const colsData: GridColumnType[] = cols ?? (await $api.dbView.gridColumnsList(view.value.id)) const colsData: GridColumnType[] = isPublic.value ? columns.value : await $api.dbView.gridColumnsList(view.value.id)
gridViewCols.value = colsData.reduce<Record<string, GridColumnType>>( gridViewCols.value = colsData.reduce<Record<string, GridColumnType>>(
(o, col) => ({ (o, col) => ({
...o, ...o,

Loading…
Cancel
Save