Browse Source

fix PR issues

pull/4749/head
flisowna 2 years ago
parent
commit
94e6e5367d
  1. 4
      packages/nc-gui/components/smartsheet/Map.vue
  2. 5
      packages/nc-gui/components/smartsheet/toolbar/MappedBy.vue
  3. 20
      packages/nc-gui/composables/useMapViewDataStore.ts

4
packages/nc-gui/components/smartsheet/Map.vue

@ -189,7 +189,7 @@ watch([formattedData, mapMetaData, markersClusterGroupRef], () => {
addMarker(lat, long, row)
})
syncCount()
// syncCount()
})
watch(view, async (nextView) => {
@ -201,7 +201,7 @@ watch(view, async (nextView) => {
const count = computed(() => paginationData.value.totalRows)
syncCount()
// syncCount()
</script>
<template>

5
packages/nc-gui/components/smartsheet/toolbar/MappedBy.vue

@ -5,7 +5,6 @@ import type { SelectProps } from 'ant-design-vue'
import {
ActiveViewInj,
IsLockedInj,
IsPublicInj,
MetaInj,
ReloadViewDataHookInj,
computed,
@ -19,8 +18,6 @@ const meta = inject(MetaInj, ref())
const activeView = inject(ActiveViewInj, ref())
const IsPublic = inject(IsPublicInj, ref(false))
const reloadDataHook = inject(ReloadViewDataHookInj)!
const isLocked = inject(IsLockedInj, ref(false))
@ -72,7 +69,7 @@ const handleChange = () => {
</script>
<template>
<a-dropdown v-if="!IsPublic" v-model:visible="mappedByDropdown" :trigger="['click']">
<a-dropdown v-model:visible="mappedByDropdown" :trigger="['click']">
<div class="nc-map-btn">
<a-button v-e="['c:map:change-grouping-field']" class="nc-map-stacked-by-menu-btn nc-toolbar-btn" :disabled="isLocked">
<div class="flex items-center gap-1">

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

@ -61,15 +61,17 @@ const [useProvideMapViewStore, useMapViewStore] = useInjectionState(
}))
async function syncCount() {
if (!isPublic.value) {
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 shouldUpdateRowsCounter = !isPublic.value
// if (shouldUpdateRowsCounter) {
const { count } = await $api.dbViewRow.count(
NOCO,
project?.value?.title as string,
meta?.value?.id as string,
viewMeta?.value?.id as string,
)
console.log('in Sync')
paginationData.value.totalRows = count
// }
}
async function loadMapMeta() {

Loading…
Cancel
Save