fix: show dashboard to manager only

(cherry picked from commit b3075416e2d0df8549e920d837cbe532b47d6f8b)
This commit is contained in:
Shariq Ansari 2025-07-10 13:59:30 +05:30 committed by Mergify
parent 756fdd212a
commit e91ebc7eb9

View File

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