Browse Source

refactor/gui-v2-added readonly mode to Share view

pull/3083/head
Muhammed Mustafa 2 years ago
parent
commit
4b51c73dcd
  1. 4
      packages/nc-gui-v2/components/smartsheet/Grid.vue
  2. 3
      packages/nc-gui-v2/pages/[projectType]/view/[viewId].vue

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

@ -100,9 +100,7 @@ provide(ChangePageInj, changePage)
provide(ReadonlyInj, !isUIAllowed('xcDatatableEditable')) provide(ReadonlyInj, !isUIAllowed('xcDatatableEditable'))
reloadViewDataHook?.on(async () => { reloadViewDataHook?.on(async () => {
if (!isPublicView) { loadAggCommentsCount()
loadAggCommentsCount()
}
await loadData() await loadData()
}) })

3
packages/nc-gui-v2/pages/[projectType]/view/[viewId].vue

@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import type { Ref } from 'vue' import type { Ref } from 'vue'
import type { TableType } from 'nocodb-sdk/build/main' import type { TableType } from 'nocodb-sdk/build/main'
import { ActiveViewInj, FieldsInj, IsPublicInj, MetaInj, ReloadViewDataHookInj } from '~/context' import { ActiveViewInj, FieldsInj, IsPublicInj, MetaInj, ReadonlyInj, ReloadViewDataHookInj } from '~/context'
definePageMeta({ definePageMeta({
requiresAuth: false, requiresAuth: false,
@ -19,6 +19,7 @@ provide(MetaInj, meta)
provide(ActiveViewInj, sharedView) provide(ActiveViewInj, sharedView)
provide(FieldsInj, columns) provide(FieldsInj, columns)
provide(IsPublicInj, ref(true)) provide(IsPublicInj, ref(true))
provide(ReadonlyInj, ref(true))
const { isGrid } = useProvideSmartsheetStore(sharedView as Ref<TableType>, meta) const { isGrid } = useProvideSmartsheetStore(sharedView as Ref<TableType>, meta)
</script> </script>

Loading…
Cancel
Save