From 21ba843cebd74c401e85fdc57576a7c3bdee9e18 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 5 Feb 2024 19:18:21 +0530 Subject: [PATCH] fix: do not allow pinning public views --- frontend/src/components/ViewControls.vue | 21 +++++++++++---------- frontend/src/stores/users.js | 6 +++--- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/ViewControls.vue b/frontend/src/components/ViewControls.vue index 84bc9250..5db02f87 100644 --- a/frontend/src/components/ViewControls.vue +++ b/frontend/src/components/ViewControls.vue @@ -402,21 +402,22 @@ const viewActions = computed(() => { ] if (route.query.view && (!view.value.public || isManager())) { - actions[0].items.push( - { - label: 'Rename', - icon: () => h(EditIcon, { class: 'h-4 w-4' }), - onClick: () => renameView(), - }, - { + actions[0].items.push({ + label: 'Rename', + icon: () => h(EditIcon, { class: 'h-4 w-4' }), + onClick: () => renameView(), + }) + + if (!view.value.public) { + actions[0].items.push({ label: view.value.pinned ? 'Unpin View' : 'Pin View', icon: () => h(view.value.pinned ? UnpinIcon : PinIcon, { class: 'h-4 w-4' }), onClick: () => pinView(), - } - ) + }) + } - if (route.query.view && isManager()) { + if (isManager()) { actions[0].items.push({ label: view.value.public ? 'Make Private' : 'Make Public', icon: () => diff --git a/frontend/src/stores/users.js b/frontend/src/stores/users.js index 0c26f7a8..f349c647 100644 --- a/frontend/src/stores/users.js +++ b/frontend/src/stores/users.js @@ -25,9 +25,9 @@ export const usersStore = defineStore('crm-users', () => { }, }) - if (!users.data?.length) { - users.fetch() - } + // if (!users.data?.length) { + // users.fetch() + // } function getUser(email) { if (!email || email === 'sessionUser') {