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) addMarker(lat, long, row)
}) })
syncCount() // syncCount()
}) })
watch(view, async (nextView) => { watch(view, async (nextView) => {
@ -201,7 +201,7 @@ watch(view, async (nextView) => {
const count = computed(() => paginationData.value.totalRows) const count = computed(() => paginationData.value.totalRows)
syncCount() // syncCount()
</script> </script>
<template> <template>

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

@ -5,7 +5,6 @@ import type { SelectProps } from 'ant-design-vue'
import { import {
ActiveViewInj, ActiveViewInj,
IsLockedInj, IsLockedInj,
IsPublicInj,
MetaInj, MetaInj,
ReloadViewDataHookInj, ReloadViewDataHookInj,
computed, computed,
@ -19,8 +18,6 @@ const meta = inject(MetaInj, ref())
const activeView = inject(ActiveViewInj, ref()) const activeView = inject(ActiveViewInj, ref())
const IsPublic = inject(IsPublicInj, ref(false))
const reloadDataHook = inject(ReloadViewDataHookInj)! const reloadDataHook = inject(ReloadViewDataHookInj)!
const isLocked = inject(IsLockedInj, ref(false)) const isLocked = inject(IsLockedInj, ref(false))
@ -72,7 +69,7 @@ const handleChange = () => {
</script> </script>
<template> <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"> <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"> <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"> <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() { async function syncCount() {
if (!isPublic.value) { // const shouldUpdateRowsCounter = !isPublic.value
const { count } = await $api.dbViewRow.count( // if (shouldUpdateRowsCounter) {
NOCO, const { count } = await $api.dbViewRow.count(
project?.value?.title as string, NOCO,
meta?.value?.id as string, project?.value?.title as string,
viewMeta?.value?.id as string, meta?.value?.id as string,
) viewMeta?.value?.id as string,
paginationData.value.totalRows = count )
} console.log('in Sync')
paginationData.value.totalRows = count
// }
} }
async function loadMapMeta() { async function loadMapMeta() {

Loading…
Cancel
Save