Browse Source

fix: allow owner or creator to alter view type

pull/9807/head
Pranav C 2 weeks ago
parent
commit
b037f4bdbe
  1. 20
      packages/nc-gui/components/smartsheet/toolbar/ViewActionMenu.vue

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

@ -298,14 +298,9 @@ const isDefaultView = computed(() => view.value?.is_default)
<template v-if="isUIAllowed('viewCreateOrEdit')">
<NcDivider />
<SmartsheetToolbarNotAllowedTooltip
v-if="isEeUI"
:enabled="!isViewOwner && view.lock_type === LockType.Personal"
message="Only view owner can change personal view"
>
<NcSubMenu
key="lock-type"
:disabled="!isViewOwner && view.lock_type === LockType.Personal"
:disabled="!isViewOwner && !isUIAllowed('reAssignViewOwner') && view.lock_type === LockType.Personal"
class="scrollbar-thin-dull max-h-90vh overflow-auto !py-0"
>
<template #title>
@ -318,13 +313,12 @@ const isDefaultView = computed(() => view.value?.is_default)
]"
class="flex flex-row items-center gap-x-3"
>
<div :class="{ 'text-gray-400': !isViewOwner && view.lock_type === LockType.Personal }">
<div>
{{ $t('labels.viewMode') }}
</div>
<div class="nc-base-menu-item flex !flex-shrink group !py-1 !px-1 rounded-md bg-brand-50">
<LazySmartsheetToolbarLockType
:type="lockType"
:disabled="!isViewOwner && view.lock_type === LockType.Personal"
class="flex nc-view-actions-lock-type !text-brand-500 !flex-shrink"
hide-tick
/>
@ -339,19 +333,23 @@ const isDefaultView = computed(() => view.value?.is_default)
<LazySmartsheetToolbarLockType :type="LockType.Collaborative" @click="changeLockType(LockType.Collaborative)" />
</a-menu-item>
<SmartsheetToolbarNotAllowedTooltip
v-if="isEeUI && !isDefaultView"
:enabled="!isViewOwner"
message="Only view owner can change to personal view"
>
<a-menu-item
v-if="isViewOwner && !isDefaultView"
:disabled="!isViewOwner"
class="!mx-1 !py-2 !rounded-md nc-view-action-lock-subaction max-w-[100px]"
@click="changeLockType(LockType.Personal)"
>
<LazySmartsheetToolbarLockType :type="LockType.Personal" />
</a-menu-item>
</SmartsheetToolbarNotAllowedTooltip>
<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>
</SmartsheetToolbarNotAllowedTooltip>
<SmartsheetToolbarNotAllowedTooltip
v-if="isEeUI && !isDefaultView"
:enabled="!(isViewOwner || isUIAllowed('reAssignViewOwner'))"

Loading…
Cancel
Save