Browse Source

fix(gui): avoid header menu in form view and for user who doesn't have permission

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5206/head
Pranav C 2 years ago
parent
commit
29d4544bb1
  1. 18
      packages/nc-gui/components/smartsheet/header/Cell.vue

18
packages/nc-gui/components/smartsheet/header/Cell.vue

@ -7,6 +7,7 @@ interface Props {
required?: boolean | number
hideMenu?: boolean
}
const props = defineProps<Props>()
const hideMenu = toRef(props, 'hideMenu')
@ -34,6 +35,12 @@ const closeAddColumnDropdown = () => {
columnOrder.value = null
editColumnDropdown.value = false
}
const openHeaderMenu = () => {
if (!isForm && isUIAllowed('edit-column')) {
editColumnDropdown.value = true
}
}
</script>
<template>
@ -47,20 +54,15 @@ const closeAddColumnDropdown = () => {
class="name cursor-pointer"
style="white-space: nowrap"
:title="column.title"
@dblclick="editColumnDropdown = true"
>{{ column.title }}</span
>
@dblclick="openHeaderMenu"
>{{ column.title }}</span>
<span v-if="(column.rqd && !column.cdf) || required" class="text-red-500">&nbsp;*</span>
<template v-if="!hideMenu">
<div class="flex-1" />
<LazySmartsheetHeaderMenu
v-if="!isForm && isUIAllowed('edit-column')"
@add-column="addField"
@edit="editColumnDropdown = true"
/>
<LazySmartsheetHeaderMenu v-if="!isForm && isUIAllowed('edit-column')" @add-column="addField" @edit="openHeaderMenu" />
</template>
<a-dropdown

Loading…
Cancel
Save