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

Loading…
Cancel
Save