Browse Source

fix shared map view issue - fetch up to 1000 map markers also on shared map views

pull/5248/head
Daniel Spaude 2 years ago
parent
commit
bf3872e362
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 6
      packages/nc-gui/composables/useMapViewDataStore.ts
  2. 8
      packages/nc-gui/composables/useSharedView.ts

6
packages/nc-gui/composables/useMapViewDataStore.ts

@ -31,6 +31,8 @@ const [useProvideMapViewStore, useMapViewStore] = useInjectionState(
throw new Error('Table meta is not available') throw new Error('Table meta is not available')
} }
const defaultPageSize = 1000
const formattedData = ref<Row[]>([]) const formattedData = ref<Row[]>([])
const { api } = useApi() const { api } = useApi()
@ -45,14 +47,12 @@ const [useProvideMapViewStore, useMapViewStore] = useInjectionState(
const { sorts, nestedFilters } = useSmartsheetStoreOrThrow() const { sorts, nestedFilters } = useSmartsheetStoreOrThrow()
const { sharedView, fetchSharedViewData } = useSharedView() const { sharedView, fetchSharedViewData } = useSharedView(defaultPageSize)
const mapMetaData = ref<MapType>({}) const mapMetaData = ref<MapType>({})
const geoDataFieldColumn = ref<ColumnType | undefined>() const geoDataFieldColumn = ref<ColumnType | undefined>()
const defaultPageSize = 1000
const paginationData = ref<PaginatedType>({ page: 1, pageSize: defaultPageSize }) const paginationData = ref<PaginatedType>({ page: 1, pageSize: defaultPageSize })
const queryParams = computed(() => ({ const queryParams = computed(() => ({

8
packages/nc-gui/composables/useSharedView.ts

@ -12,7 +12,7 @@ import type {
import { UITypes } from 'nocodb-sdk' import { UITypes } from 'nocodb-sdk'
import { computed, useGlobal, useMetas, useNuxtApp, useState } from '#imports' import { computed, useGlobal, useMetas, useNuxtApp, useState } from '#imports'
export function useSharedView() { export function useSharedView(limit?: number) {
const nestedFilters = ref<(FilterType & { status?: 'update' | 'delete' | 'create'; parentId?: string })[]>([]) const nestedFilters = ref<(FilterType & { status?: 'update' | 'delete' | 'create'; parentId?: string })[]>([])
const { appInfo } = $(useGlobal()) const { appInfo } = $(useGlobal())
@ -21,7 +21,10 @@ export function useSharedView() {
const appInfoDefaultLimit = appInfo.defaultLimit || 25 const appInfoDefaultLimit = appInfo.defaultLimit || 25
const paginationData = useState<PaginatedType>('paginationData', () => ({ page: 1, pageSize: appInfoDefaultLimit })) const paginationData = useState<PaginatedType>('paginationData', () => ({
page: 1,
pageSize: appInfoDefaultLimit,
}))
const sharedView = useState<ViewType | undefined>('sharedView', () => undefined) const sharedView = useState<ViewType | undefined>('sharedView', () => undefined)
@ -113,6 +116,7 @@ export function useSharedView() {
const { data } = await $api.public.dataList( const { data } = await $api.public.dataList(
sharedView.value.uuid!, sharedView.value.uuid!,
{ {
limit,
offset, offset,
filterArrJson: JSON.stringify(filtersArr ?? nestedFilters.value), filterArrJson: JSON.stringify(filtersArr ?? nestedFilters.value),
sortArrJson: JSON.stringify(sortsArr ?? sorts.value), sortArrJson: JSON.stringify(sortsArr ?? sorts.value),

Loading…
Cancel
Save