fix: show dashboard to manager only

This commit is contained in:
Shariq Ansari 2025-07-10 13:59:30 +05:30
parent 2cb09dde4b
commit b3075416e2

View File

@ -140,6 +140,7 @@
</template>
<script setup>
import LucideLayoutDashboard from '~icons/lucide/layout-dashboard'
import CRMLogo from '@/components/Icons/CRMLogo.vue'
import InviteIcon from '@/components/Icons/InviteIcon.vue'
import ConvertIcon from '@/components/Icons/ConvertIcon.vue'
@ -187,7 +188,6 @@ import { capture } from '@/telemetry'
import router from '@/router'
import { useStorage } from '@vueuse/core'
import { ref, reactive, computed, h, markRaw, onMounted } from 'vue'
import LucideLayoutDashboard from '~icons/lucide/layout-dashboard'
const { getPinnedViews, getPublicViews } = viewsStore()
const { toggle: toggleNotificationPanel } = notificationsStore()
@ -197,11 +197,13 @@ const isSidebarCollapsed = useStorage('isSidebarCollapsed', false)
const isFCSite = ref(window.is_fc_site)
const isDemoSite = ref(window.is_demo_site)
const allViews = computed(() => {
const links = [
{
label: 'Dashboard',
icon: LucideLayoutDashboard,
to: 'Dashboard',
condition: () => isManager(),
},
{
label: 'Leads',
@ -240,13 +242,17 @@ const links = [
},
]
const allViews = computed(() => {
let _views = [
{
name: 'All Views',
hideLabel: true,
opened: true,
views: links,
views: links.filter((link) => {
if (link.condition) {
return link.condition()
}
return true
}),
},
]
if (getPublicViews().length) {