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, () => { watch(openedSubTab, () => {
// TODO: Find a good way to know when the roles are populated and check // TODO: Find a good way to know when the roles are populated and check
// Re-enable this check for first render // Re-enable this check for first render
if (openedSubTab.value === 'field' && !isUIAllowed('hookList')) { if (openedSubTab.value === 'field' && !isUIAllowed('fieldAdd')) {
onViewsTabChange('relation') onViewsTabChange('relation')
} }
if (openedSubTab.value === 'webhook' && !isUIAllowed('hookList')) { 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 { openedViewsTab, activeView } = storeToRefs(useViewsStore())
const { isUIAllowed } = useRoles()
const { onViewsTabChange } = useViewsStore() const { onViewsTabChange } = useViewsStore()
const onClickDetails = () => {
if (isUIAllowed('fieldAdd')) {
onViewsTabChange('field')
} else {
onViewsTabChange('relation')
}
}
</script> </script>
<template> <template>
@ -26,7 +36,7 @@ const { onViewsTabChange } = useViewsStore()
:class="{ :class="{
active: openedViewsTab !== 'view', active: openedViewsTab !== 'view',
}" }"
@click="onViewsTabChange('field')" @click="onClickDetails"
> >
<GeneralIcon <GeneralIcon
icon="erd" icon="erd"

Loading…
Cancel
Save