Browse Source

refactor/gui-v2 added allowcsv flag to shared grid view

pull/3083/head
Muhammed Mustafa 2 years ago
parent
commit
25ddcb70e8
  1. 4
      packages/nc-gui-v2/components/smartsheet/Toolbar.vue
  2. 4
      packages/nc-gui-v2/composables/useSharedView.ts

4
packages/nc-gui-v2/components/smartsheet/Toolbar.vue

@ -3,6 +3,7 @@ import { useSmartsheetStoreOrThrow } from '~/composables'
import { IsPublicInj } from '~/context'
const { isGrid, isForm, isGallery } = useSmartsheetStoreOrThrow()
const { allowCSVDownload } = useSharedView()
const isPublic = inject(IsPublicInj, ref(false))
</script>
@ -16,7 +17,8 @@ const isPublic = inject(IsPublicInj, ref(false))
<SmartsheetToolbarShareView v-if="(isForm || isGrid) && !isPublic" />
<SmartsheetToolbarMoreActions v-if="isGrid" />
<SmartsheetToolbarMoreActions v-if="(isGrid && !isPublic) || (isGrid && isPublic && allowCSVDownload)" />
<div class="flex-1" />
<SmartsheetToolbarSearchData v-if="isGrid || isGallery" class="shrink mr-2" />
</div>

4
packages/nc-gui-v2/composables/useSharedView.ts

@ -7,6 +7,7 @@ const paginationData = ref<PaginatedType>({ page: 1, pageSize: 25 })
const sharedView = ref<ViewType>()
const sorts = ref<SortType[]>([])
const password = ref<string | undefined>()
const allowCSVDownload = ref<boolean>(false)
export function useSharedView() {
const meta = ref<TableType>(sharedView.value?.model)
@ -32,6 +33,8 @@ export function useSharedView() {
},
})
allowCSVDownload.value = JSON.parse(viewMeta.meta).allowCSVDownload
if (localPassword) password.value = localPassword
sharedView.value = viewMeta
@ -97,5 +100,6 @@ export function useSharedView() {
sorts,
exportFile,
formColumns,
allowCSVDownload,
}
}

Loading…
Cancel
Save