fix: show dashboard to manager only
This commit is contained in:
parent
2cb09dde4b
commit
b3075416e2
@ -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,56 +197,62 @@ 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 = [
|
|
||||||
{
|
|
||||||
label: 'Dashboard',
|
|
||||||
icon: LucideLayoutDashboard,
|
|
||||||
to: 'Dashboard',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Leads',
|
|
||||||
icon: LeadsIcon,
|
|
||||||
to: 'Leads',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Deals',
|
|
||||||
icon: DealsIcon,
|
|
||||||
to: 'Deals',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Contacts',
|
|
||||||
icon: ContactsIcon,
|
|
||||||
to: 'Contacts',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Organizations',
|
|
||||||
icon: OrganizationsIcon,
|
|
||||||
to: 'Organizations',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Notes',
|
|
||||||
icon: NoteIcon,
|
|
||||||
to: 'Notes',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Tasks',
|
|
||||||
icon: TaskIcon,
|
|
||||||
to: 'Tasks',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Call Logs',
|
|
||||||
icon: PhoneIcon,
|
|
||||||
to: 'Call Logs',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
const allViews = computed(() => {
|
const allViews = computed(() => {
|
||||||
|
const links = [
|
||||||
|
{
|
||||||
|
label: 'Dashboard',
|
||||||
|
icon: LucideLayoutDashboard,
|
||||||
|
to: 'Dashboard',
|
||||||
|
condition: () => isManager(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Leads',
|
||||||
|
icon: LeadsIcon,
|
||||||
|
to: 'Leads',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Deals',
|
||||||
|
icon: DealsIcon,
|
||||||
|
to: 'Deals',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Contacts',
|
||||||
|
icon: ContactsIcon,
|
||||||
|
to: 'Contacts',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Organizations',
|
||||||
|
icon: OrganizationsIcon,
|
||||||
|
to: 'Organizations',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Notes',
|
||||||
|
icon: NoteIcon,
|
||||||
|
to: 'Notes',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Tasks',
|
||||||
|
icon: TaskIcon,
|
||||||
|
to: 'Tasks',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Call Logs',
|
||||||
|
icon: PhoneIcon,
|
||||||
|
to: 'Call Logs',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
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) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user