Browse Source

feat(gui-v2): disable copy & delete view in sidebar for locked view

pull/3209/head
Wing-Kam Wong 2 years ago
parent
commit
cfe0109132
  1. 6
      packages/nc-gui-v2/components/smartsheet/sidebar/RenameableMenuItem.vue

6
packages/nc-gui-v2/components/smartsheet/sidebar/RenameableMenuItem.vue

@ -2,7 +2,7 @@
import type { ViewTypes } from 'nocodb-sdk' import type { ViewTypes } from 'nocodb-sdk'
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
import { viewIcons } from '~/utils' import { viewIcons } from '~/utils'
import { onKeyStroke, useDebounceFn, useNuxtApp, useUIPermission, useVModel } from '#imports' import { IsLockedInj, onKeyStroke, useDebounceFn, useNuxtApp, useUIPermission, useVModel } from '#imports'
interface Props { interface Props {
view: Record<string, any> view: Record<string, any>
@ -27,6 +27,8 @@ const { $e } = useNuxtApp()
const { isUIAllowed } = useUIPermission() const { isUIAllowed } = useUIPermission()
const isLocked = inject(IsLockedInj)
/** Is editing the view name enabled */ /** Is editing the view name enabled */
let isEditing = $ref<boolean>(false) let isEditing = $ref<boolean>(false)
@ -168,7 +170,7 @@ function onStopEdit() {
<div class="flex-1" /> <div class="flex-1" />
<template v-if="!isEditing && isUIAllowed('virtualViewsCreateOrEdit')"> <template v-if="!isEditing && !isLocked && isUIAllowed('virtualViewsCreateOrEdit')">
<div class="flex items-center gap-1"> <div class="flex items-center gap-1">
<a-tooltip placement="left"> <a-tooltip placement="left">
<template #title> <template #title>

Loading…
Cancel
Save