Browse Source

fix(gui-v2): highlight filter button if at-least one filter present

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3039/head
Pranav C 2 years ago
parent
commit
60037b8bae
  1. 15
      packages/nc-gui-v2/components/smartsheet-toolbar/ColumnFilterMenu.vue

15
packages/nc-gui-v2/components/smartsheet-toolbar/ColumnFilterMenu.vue

@ -1,21 +1,26 @@
<script setup lang="ts">
import type ColumnFilter from './ColumnFilter.vue'
import { useState } from '#app'
import { IsLockedInj } from '~/context'
import { ActiveViewInj, IsLockedInj } from '~/context'
import MdiFilterIcon from '~icons/mdi/filter-outline'
import MdiMenuDownIcon from '~icons/mdi/menu-down'
const autoApplyFilter = useState('autoApplyFilter', () => false)
const isLocked = inject(IsLockedInj)
const activeView = inject(ActiveViewInj)
const { filterAutoSave } = useGlobal()
// todo: emit from child
const filtersLength = ref(0)
// todo: avoid duplicate api call by keeping a filter store
const { filters, loadFilters } = useViewFilters(
activeView,
undefined,
computed(() => false),
)
await loadFilters()
const filtersLength = ref(filters?.value?.length ?? 0)
const filterComp = ref<typeof ColumnFilter>()
// todo: implement
const applyChanges = async () => {
await filterComp?.value?.applyChanges()
}

Loading…
Cancel
Save