Browse Source

fix: Hide export btn on toolbar when on viewer permision

pull/7089/head
Muhammed Mustafa 12 months ago
parent
commit
2e00a0fa2a
  1. 2
      packages/nc-gui/components/smartsheet/Toolbar.vue
  2. 70
      packages/nc-gui/components/smartsheet/toolbar/ViewActionMenu.vue

2
packages/nc-gui/components/smartsheet/Toolbar.vue

@ -39,7 +39,7 @@ const { allowCSVDownload } = useSharedView()
<!-- <LazySmartsheetToolbarQrScannerButton v-if="isMobileMode && (isGrid || isKanban || isGallery)" /> --> <!-- <LazySmartsheetToolbarQrScannerButton v-if="isMobileMode && (isGrid || isKanban || isGallery)" /> -->
<LazySmartsheetToolbarExport v-if="(!isPublic && !isUIAllowed('dataInsert')) || (isPublic && allowCSVDownload)" /> <LazySmartsheetToolbarExport v-if="isPublic && allowCSVDownload" />
<div class="flex-1" /> <div class="flex-1" />
</template> </template>

70
packages/nc-gui/components/smartsheet/toolbar/ViewActionMenu.vue

@ -239,44 +239,48 @@ const onDelete = async () => {
<LazySmartsheetToolbarExportSubActions /> <LazySmartsheetToolbarExportSubActions />
</NcSubMenu> </NcSubMenu>
<NcDivider />
</template> </template>
<NcSubMenu v-if="isUIAllowed('viewCreateOrEdit')" key="lock-type" class="scrollbar-thin-dull max-h-90vh overflow-auto !py-0"> <template v-if="isUIAllowed('viewCreateOrEdit')">
<template #title> <NcDivider />
<div
v-e="[ <NcSubMenu key="lock-type" class="scrollbar-thin-dull max-h-90vh overflow-auto !py-0">
'c:navdraw:preview-as', <template #title>
{ <div
sidebar: props.inSidebar, v-e="[
}, 'c:navdraw:preview-as',
]" {
class="flex flex-row items-center gap-x-3" sidebar: props.inSidebar,
> },
<div> ]"
{{ $t('labels.viewMode') }} class="flex flex-row items-center gap-x-3"
</div> >
<div class="nc-base-menu-item flex !flex-shrink group !py-1 !px-1 rounded-md bg-brand-50"> <div>
<LazySmartsheetToolbarLockType {{ $t('labels.viewMode') }}
hide-tick </div>
:type="lockType" <div class="nc-base-menu-item flex !flex-shrink group !py-1 !px-1 rounded-md bg-brand-50">
class="flex nc-view-actions-lock-type !text-brand-500 !flex-shrink" <LazySmartsheetToolbarLockType
/> hide-tick
:type="lockType"
class="flex nc-view-actions-lock-type !text-brand-500 !flex-shrink"
/>
</div>
<div class="flex flex-grow"></div>
</div> </div>
<div class="flex flex-grow"></div> </template>
</div>
</template>
<template #expandIcon></template> <template #expandIcon></template>
<div class="flex py-3 px-4 font-bold uppercase text-xs text-gray-500">{{ $t('labels.viewMode') }}</div> <div class="flex py-3 px-4 font-bold uppercase text-xs text-gray-500">{{ $t('labels.viewMode') }}</div>
<a-menu-item class="!mx-1 !py-2 !rounded-md nc-view-action-lock-subaction"> <a-menu-item class="!mx-1 !py-2 !rounded-md nc-view-action-lock-subaction">
<LazySmartsheetToolbarLockType :type="LockType.Collaborative" @click="changeLockType(LockType.Collaborative)" /> <LazySmartsheetToolbarLockType :type="LockType.Collaborative" @click="changeLockType(LockType.Collaborative)" />
</a-menu-item> </a-menu-item>
<a-menu-item class="!mx-1 !py-2 !rounded-md nc-view-action-lock-subaction">
<LazySmartsheetToolbarLockType :type="LockType.Locked" @click="changeLockType(LockType.Locked)" />
</a-menu-item>
</NcSubMenu>
</template>
<a-menu-item class="!mx-1 !py-2 !rounded-md nc-view-action-lock-subaction">
<LazySmartsheetToolbarLockType :type="LockType.Locked" @click="changeLockType(LockType.Locked)" />
</a-menu-item>
</NcSubMenu>
<template v-if="!view.is_default"> <template v-if="!view.is_default">
<NcDivider /> <NcDivider />
<NcTooltip v-if="lockType === LockType.Locked"> <NcTooltip v-if="lockType === LockType.Locked">

Loading…
Cancel
Save