From 3e23a453dd6753c063dfc185127b417bb7997987 Mon Sep 17 00:00:00 2001 From: Daniel Spaude Date: Mon, 13 Mar 2023 12:19:25 +0100 Subject: [PATCH] Revert "shared map view issue debugging - WIP" This reverts commit b7fc4ffa9a4b6c3593b4a733b6f889d41617c8fa. --- .../nc-gui/composables/useMapViewDataStore.ts | 48 +++++++++---------- packages/nc-gui/composables/useViewData.ts | 2 - 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/packages/nc-gui/composables/useMapViewDataStore.ts b/packages/nc-gui/composables/useMapViewDataStore.ts index afb883b325..f8ffde3a60 100644 --- a/packages/nc-gui/composables/useMapViewDataStore.ts +++ b/packages/nc-gui/composables/useMapViewDataStore.ts @@ -61,43 +61,43 @@ const [useProvideMapViewStore, useMapViewStore] = useInjectionState( })) async function syncCount() { - const { count } = await $api.dbViewRow.count( - NOCO, - project?.value?.title as string, - meta?.value?.id as string, - viewMeta?.value?.id as string, - ) - paginationData.value.totalRows = count + // const { count } = await $api.dbViewRow.count( + // NOCO, + // project?.value?.title as string, + // meta?.value?.id as string, + // viewMeta?.value?.id as string, + // ) + // paginationData.value.totalRows = count } async function loadMapMeta() { alert('loadMapData') - if (!viewMeta?.value?.id || !meta?.value?.columns) return + // if (!viewMeta?.value?.id || !meta?.value?.columns) return // mapMetaData.value = await $api.dbView.mapRead(viewMeta.value.id) - geoDataFieldColumn.value = - (meta.value.columns as ColumnType[]).filter((f) => f.id === mapMetaData.value.fk_geo_data_col_id)[0] || {} + // geoDataFieldColumn.value = + // (meta.value.columns as ColumnType[]).filter((f) => f.id === mapMetaData.value.fk_geo_data_col_id)[0] || {} } async function loadMapData() { - if ((!project?.value?.id || !meta.value?.id || !viewMeta.value?.id) && !isPublic?.value) return + // if ((!project?.value?.id || !meta.value?.id || !viewMeta.value?.id) && !isPublic?.value) return - const res = !isPublic.value - ? await api.dbViewRow.list('noco', project.value.id!, meta.value!.id!, viewMeta.value!.id!, { - ...queryParams.value, - ...(isUIAllowed('filterSync') ? {} : { filterArrJson: JSON.stringify(nestedFilters.value) }), - where: where?.value, - }) - : await fetchSharedViewData({ sortsArr: sorts.value, filtersArr: nestedFilters.value }) + // const res = !isPublic.value + // ? await api.dbViewRow.list('noco', project.value.id!, meta.value!.id!, viewMeta.value!.id!, { + // ...queryParams.value, + // ...(isUIAllowed('filterSync') ? {} : { filterArrJson: JSON.stringify(nestedFilters.value) }), + // where: where?.value, + // }) + // : await fetchSharedViewData({ sortsArr: sorts.value, filtersArr: nestedFilters.value }) - formattedData.value = formatData(res.list) + // formattedData.value = formatData(res.list) } async function updateMapMeta(updateObj: Partial) { - if (!viewMeta?.value?.id || !isUIAllowed('xcDatatableEditable')) return - await $api.dbView.mapUpdate(viewMeta.value.id, { - ...mapMetaData.value, - ...updateObj, - }) + // if (!viewMeta?.value?.id || !isUIAllowed('xcDatatableEditable')) return + // await $api.dbView.mapUpdate(viewMeta.value.id, { + // ...mapMetaData.value, + // ...updateObj, + // }) } const { getMeta } = useMetas() diff --git a/packages/nc-gui/composables/useViewData.ts b/packages/nc-gui/composables/useViewData.ts index 7b699c6e9c..cd2ba8dde9 100644 --- a/packages/nc-gui/composables/useViewData.ts +++ b/packages/nc-gui/composables/useViewData.ts @@ -187,7 +187,6 @@ export function useViewData( } async function loadData(params: Parameters['dbViewRow']['list']>[4] = {}) { - debugger if ((!project?.value?.id || !meta.value?.id || !viewMeta.value?.id) && !isPublic.value) return const response = !isPublic.value ? await api.dbViewRow.list('noco', project.value.id!, meta.value!.id!, viewMeta.value!.id!, { @@ -218,7 +217,6 @@ export function useViewData( galleryData.value = isPublic.value ? (sharedView.value?.view as GalleryType) : await $api.dbView.galleryRead(viewMeta.value.id) - // debugger } async function insertRow(