diff --git a/packages/nc-gui-v2/components/shared-view/Grid.vue b/packages/nc-gui-v2/components/shared-view/Grid.vue index 59f5310c5e..7c0c8690e9 100644 --- a/packages/nc-gui-v2/components/shared-view/Grid.vue +++ b/packages/nc-gui-v2/components/shared-view/Grid.vue @@ -26,7 +26,8 @@ useProvideSmartsheetStore(sharedView as Ref, meta, true, sorts, neste diff --git a/packages/nc-gui-v2/components/smartsheet-toolbar/Export.vue b/packages/nc-gui-v2/components/smartsheet-toolbar/Export.vue new file mode 100644 index 0000000000..c9f30b06e3 --- /dev/null +++ b/packages/nc-gui-v2/components/smartsheet-toolbar/Export.vue @@ -0,0 +1,17 @@ + diff --git a/packages/nc-gui-v2/components/smartsheet-toolbar/ExportSubActions.vue b/packages/nc-gui-v2/components/smartsheet-toolbar/ExportSubActions.vue new file mode 100644 index 0000000000..cca5403190 --- /dev/null +++ b/packages/nc-gui-v2/components/smartsheet-toolbar/ExportSubActions.vue @@ -0,0 +1,80 @@ + + + diff --git a/packages/nc-gui-v2/components/smartsheet-toolbar/ViewActions.vue b/packages/nc-gui-v2/components/smartsheet-toolbar/ViewActions.vue index d77b3227bc..bd40df2f6e 100644 --- a/packages/nc-gui-v2/components/smartsheet-toolbar/ViewActions.vue +++ b/packages/nc-gui-v2/components/smartsheet-toolbar/ViewActions.vue @@ -1,21 +1,15 @@ + + diff --git a/packages/nc-gui-v2/components/smartsheet/Grid.vue b/packages/nc-gui-v2/components/smartsheet/Grid.vue index aff46ce8f7..7852cfd50f 100644 --- a/packages/nc-gui-v2/components/smartsheet/Grid.vue +++ b/packages/nc-gui-v2/components/smartsheet/Grid.vue @@ -382,7 +382,7 @@ const onNavigate = (dir: NavigateDir) => {
diff --git a/packages/nc-gui-v2/components/smartsheet/Toolbar.vue b/packages/nc-gui-v2/components/smartsheet/Toolbar.vue index 01260b88b3..ec91b6cd7e 100644 --- a/packages/nc-gui-v2/components/smartsheet/Toolbar.vue +++ b/packages/nc-gui-v2/components/smartsheet/Toolbar.vue @@ -4,7 +4,7 @@ import ToggleDrawer from '~/components/smartsheet/sidebar/toolbar/ToggleDrawer.v const { isGrid, isForm, isGallery } = useSmartsheetStoreOrThrow() const isPublic = inject(IsPublicInj, ref(false)) -const { allowCSVDownload } = useSharedView() +const { isUIAllowed } = useUIPermission() const { isOpen } = useSidebar() @@ -15,11 +15,13 @@ const { isOpen } = useSidebar() style="z-index: 7" > + + @@ -28,14 +30,15 @@ const { isOpen } = useSidebar() +
- - + + - +
diff --git a/packages/nc-gui-v2/composables/useUIPermission/rolePermissions.ts b/packages/nc-gui-v2/composables/useUIPermission/rolePermissions.ts index b0884700bd..b89ef57c00 100644 --- a/packages/nc-gui-v2/composables/useUIPermission/rolePermissions.ts +++ b/packages/nc-gui-v2/composables/useUIPermission/rolePermissions.ts @@ -8,6 +8,7 @@ const rolePermissions = { column: true, tableAttachment: true, tableRowUpdate: true, + dataInsert: true, rowComments: true, gridViewOptions: true, sortSync: true, diff --git a/packages/nc-gui-v2/composables/useViewColumns.ts b/packages/nc-gui-v2/composables/useViewColumns.ts index 830e9651eb..9923839ed0 100644 --- a/packages/nc-gui-v2/composables/useViewColumns.ts +++ b/packages/nc-gui-v2/composables/useViewColumns.ts @@ -19,6 +19,10 @@ export function useViewColumns(view: Ref | undefined, meta: ComputedRe const { isSharedBase } = useProject() + const isLocalMode = computed( + () => isPublic.value || !isUIAllowed('hideAllColumns') || !isUIAllowed('showAllColumns') || isSharedBase.value, + ) + const loadViewColumns = async () => { if (!meta || !view) return @@ -52,7 +56,7 @@ export function useViewColumns(view: Ref | undefined, meta: ComputedRe } const showAll = async (ignoreIds?: any) => { - if (isPublic.value || isSharedBase.value) { + if (isLocalMode.value) { fields.value = fields.value?.map((field: Field) => ({ ...field, show: true, @@ -75,7 +79,7 @@ export function useViewColumns(view: Ref | undefined, meta: ComputedRe reloadData?.() } const hideAll = async (ignoreIds?: any) => { - if (isPublic.value || isSharedBase.value) { + if (isLocalMode.value) { fields.value = fields.value?.map((field: Field) => ({ ...field, show: false, @@ -144,7 +148,7 @@ export function useViewColumns(view: Ref | undefined, meta: ComputedRe }, set(v: boolean) { if (view?.value?.id) { - if (!isPublic.value && !isSharedBase.value) { + if (!isLocalMode.value) { $api.dbView .update(view.value.id, { show_system_fields: v, diff --git a/packages/nc-gui-v2/layouts/shared-view.vue b/packages/nc-gui-v2/layouts/shared-view.vue index 60141394c8..0805a47a06 100644 --- a/packages/nc-gui-v2/layouts/shared-view.vue +++ b/packages/nc-gui-v2/layouts/shared-view.vue @@ -19,11 +19,11 @@ export default {
-
+
{{ sharedView?.title }} diff --git a/packages/nc-gui-v2/pages/[projectType]/[projectId]/index/index/index.vue b/packages/nc-gui-v2/pages/[projectType]/[projectId]/index/index/index.vue index 08e1eb1467..f84902cfbe 100644 --- a/packages/nc-gui-v2/pages/[projectType]/[projectId]/index/index/index.vue +++ b/packages/nc-gui-v2/pages/[projectType]/[projectId]/index/index/index.vue @@ -12,6 +12,7 @@ const { isOverDropZone } = useDropZone(dropZone, onDrop) const { files, open, reset } = useFileDialog() const { isSharedBase } = useProject() +const { isUIAllowed } = useUIPermission() const { $e } = useNuxtApp() @@ -140,8 +141,12 @@ function onDropZoneClick(e: MouseEvent) {