From 4ea8b6ac94dcb1a811b91efa27860f57b9068f66 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Fri, 19 Aug 2022 19:03:42 +0530 Subject: [PATCH 1/6] fix/Added filter sorting for user with viewer role --- .../nc-gui-v2/components/shared-view/Grid.vue | 4 +- .../smartsheet-toolbar/ColumnFilter.vue | 12 +-- .../smartsheet-toolbar/ColumnFilterMenu.vue | 6 +- .../composables/useSmartsheetStore.ts | 14 ++- .../nc-gui-v2/composables/useViewColumns.ts | 6 +- packages/nc-gui-v2/composables/useViewData.ts | 8 +- .../nc-gui-v2/composables/useViewFilters.ts | 86 ++++++++----------- .../nc-gui-v2/composables/useViewSorts.ts | 25 ++---- 8 files changed, 79 insertions(+), 82 deletions(-) diff --git a/packages/nc-gui-v2/components/shared-view/Grid.vue b/packages/nc-gui-v2/components/shared-view/Grid.vue index 3320f0551c..59f5310c5e 100644 --- a/packages/nc-gui-v2/components/shared-view/Grid.vue +++ b/packages/nc-gui-v2/components/shared-view/Grid.vue @@ -4,7 +4,7 @@ import type { TableType } from 'nocodb-sdk' import { ActiveViewInj, FieldsInj, IsPublicInj, MetaInj, ReadonlyInj, ReloadViewDataHookInj } from '~/context' -const { sharedView, meta } = useSharedView() +const { sharedView, meta, sorts, nestedFilters } = useSharedView() const reloadEventHook = createEventHook() provide(ReloadViewDataHookInj, reloadEventHook) @@ -14,7 +14,7 @@ provide(ActiveViewInj, sharedView) provide(FieldsInj, ref(meta.value.columns as any[])) provide(IsPublicInj, ref(true)) -useProvideSmartsheetStore(sharedView as Ref, meta) +useProvideSmartsheetStore(sharedView as Ref, meta, true, sorts, nestedFilters)