Browse Source

fix(nc-gui): Fixed details open for editor role

pull/6636/head
Muhammed Mustafa 1 year ago
parent
commit
48ee51614b
  1. 2
      packages/nc-gui/components/smartsheet/Details.vue
  2. 12
      packages/nc-gui/components/smartsheet/topbar/SelectMode.vue

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

@ -33,7 +33,7 @@ const openedSubTab = computed({
watch(openedSubTab, () => {
// TODO: Find a good way to know when the roles are populated and check
// Re-enable this check for first render
if (openedSubTab.value === 'field' && !isUIAllowed('hookList')) {
if (openedSubTab.value === 'field' && !isUIAllowed('fieldAdd')) {
onViewsTabChange('relation')
}
if (openedSubTab.value === 'webhook' && !isUIAllowed('hookList')) {

12
packages/nc-gui/components/smartsheet/topbar/SelectMode.vue

@ -3,7 +3,17 @@ import { storeToRefs, useViewsStore } from '#imports'
const { openedViewsTab, activeView } = storeToRefs(useViewsStore())
const { isUIAllowed } = useRoles()
const { onViewsTabChange } = useViewsStore()
const onClickDetails = () => {
if (isUIAllowed('fieldAdd')) {
onViewsTabChange('field')
} else {
onViewsTabChange('relation')
}
}
</script>
<template>
@ -26,7 +36,7 @@ const { onViewsTabChange } = useViewsStore()
:class="{
active: openedViewsTab !== 'view',
}"
@click="onViewsTabChange('field')"
@click="onClickDetails"
>
<GeneralIcon
icon="erd"

Loading…
Cancel
Save