Publish current project state
This commit is contained in:
@@ -22,6 +22,10 @@ import {
|
||||
} from 'dashboard/helper/commandbar/icons';
|
||||
import { frontendURL } from 'dashboard/helper/URLHelper';
|
||||
import { FEATURE_FLAGS } from 'dashboard/featureFlags';
|
||||
import {
|
||||
ROLE_ADMINISTRATOR,
|
||||
ROLE_AGENT,
|
||||
} from 'dashboard/constants/permissions.js';
|
||||
|
||||
const GO_TO_COMMANDS = [
|
||||
{
|
||||
@@ -30,7 +34,7 @@ const GO_TO_COMMANDS = [
|
||||
section: 'COMMAND_BAR.SECTIONS.GENERAL',
|
||||
icon: ICON_CONVERSATION_DASHBOARD,
|
||||
path: accountId => `accounts/${accountId}/dashboard`,
|
||||
role: ['administrator', 'agent'],
|
||||
role: [ROLE_ADMINISTRATOR, ROLE_AGENT],
|
||||
},
|
||||
{
|
||||
id: 'goto_contacts_dashboard',
|
||||
@@ -39,7 +43,7 @@ const GO_TO_COMMANDS = [
|
||||
featureFlag: FEATURE_FLAGS.CRM,
|
||||
icon: ICON_CONTACT_DASHBOARD,
|
||||
path: accountId => `accounts/${accountId}/contacts`,
|
||||
role: ['administrator', 'agent'],
|
||||
role: [ROLE_ADMINISTRATOR, ROLE_AGENT],
|
||||
},
|
||||
{
|
||||
id: 'open_reports_overview',
|
||||
@@ -48,7 +52,7 @@ const GO_TO_COMMANDS = [
|
||||
featureFlag: FEATURE_FLAGS.REPORTS,
|
||||
icon: ICON_REPORTS_OVERVIEW,
|
||||
path: accountId => `accounts/${accountId}/reports/overview`,
|
||||
role: ['administrator'],
|
||||
role: [ROLE_ADMINISTRATOR],
|
||||
},
|
||||
{
|
||||
id: 'open_conversation_reports',
|
||||
@@ -57,7 +61,7 @@ const GO_TO_COMMANDS = [
|
||||
featureFlag: FEATURE_FLAGS.REPORTS,
|
||||
icon: ICON_CONVERSATION_REPORTS,
|
||||
path: accountId => `accounts/${accountId}/reports/conversation`,
|
||||
role: ['administrator'],
|
||||
role: [ROLE_ADMINISTRATOR],
|
||||
},
|
||||
{
|
||||
id: 'open_agent_reports',
|
||||
@@ -66,7 +70,7 @@ const GO_TO_COMMANDS = [
|
||||
featureFlag: FEATURE_FLAGS.REPORTS,
|
||||
icon: ICON_AGENT_REPORTS,
|
||||
path: accountId => `accounts/${accountId}/reports/agent`,
|
||||
role: ['administrator'],
|
||||
role: [ROLE_ADMINISTRATOR],
|
||||
},
|
||||
{
|
||||
id: 'open_label_reports',
|
||||
@@ -75,7 +79,7 @@ const GO_TO_COMMANDS = [
|
||||
featureFlag: FEATURE_FLAGS.REPORTS,
|
||||
icon: ICON_LABEL_REPORTS,
|
||||
path: accountId => `accounts/${accountId}/reports/label`,
|
||||
role: ['administrator'],
|
||||
role: [ROLE_ADMINISTRATOR],
|
||||
},
|
||||
{
|
||||
id: 'open_inbox_reports',
|
||||
@@ -84,7 +88,7 @@ const GO_TO_COMMANDS = [
|
||||
featureFlag: FEATURE_FLAGS.REPORTS,
|
||||
icon: ICON_INBOX_REPORTS,
|
||||
path: accountId => `accounts/${accountId}/reports/inboxes`,
|
||||
role: ['administrator'],
|
||||
role: [ROLE_ADMINISTRATOR],
|
||||
},
|
||||
{
|
||||
id: 'open_team_reports',
|
||||
@@ -93,7 +97,7 @@ const GO_TO_COMMANDS = [
|
||||
featureFlag: FEATURE_FLAGS.REPORTS,
|
||||
icon: ICON_TEAM_REPORTS,
|
||||
path: accountId => `accounts/${accountId}/reports/teams`,
|
||||
role: ['administrator'],
|
||||
role: [ROLE_ADMINISTRATOR],
|
||||
},
|
||||
{
|
||||
id: 'open_agent_settings',
|
||||
@@ -102,7 +106,7 @@ const GO_TO_COMMANDS = [
|
||||
featureFlag: FEATURE_FLAGS.AGENT_MANAGEMENT,
|
||||
icon: ICON_AGENT_REPORTS,
|
||||
path: accountId => `accounts/${accountId}/settings/agents/list`,
|
||||
role: ['administrator'],
|
||||
role: [ROLE_ADMINISTRATOR],
|
||||
},
|
||||
{
|
||||
id: 'open_team_settings',
|
||||
@@ -111,7 +115,7 @@ const GO_TO_COMMANDS = [
|
||||
section: 'COMMAND_BAR.SECTIONS.SETTINGS',
|
||||
icon: ICON_TEAM_REPORTS,
|
||||
path: accountId => `accounts/${accountId}/settings/teams/list`,
|
||||
role: ['administrator'],
|
||||
role: [ROLE_ADMINISTRATOR],
|
||||
},
|
||||
{
|
||||
id: 'open_inbox_settings',
|
||||
@@ -120,7 +124,7 @@ const GO_TO_COMMANDS = [
|
||||
section: 'COMMAND_BAR.SECTIONS.SETTINGS',
|
||||
icon: ICON_INBOXES,
|
||||
path: accountId => `accounts/${accountId}/settings/inboxes/list`,
|
||||
role: ['administrator'],
|
||||
role: [ROLE_ADMINISTRATOR],
|
||||
},
|
||||
{
|
||||
id: 'open_label_settings',
|
||||
@@ -129,7 +133,7 @@ const GO_TO_COMMANDS = [
|
||||
section: 'COMMAND_BAR.SECTIONS.SETTINGS',
|
||||
icon: ICON_LABELS,
|
||||
path: accountId => `accounts/${accountId}/settings/labels/list`,
|
||||
role: ['administrator'],
|
||||
role: [ROLE_ADMINISTRATOR],
|
||||
},
|
||||
{
|
||||
id: 'open_canned_response_settings',
|
||||
@@ -138,7 +142,7 @@ const GO_TO_COMMANDS = [
|
||||
section: 'COMMAND_BAR.SECTIONS.SETTINGS',
|
||||
icon: ICON_CANNED_RESPONSE,
|
||||
path: accountId => `accounts/${accountId}/settings/canned-response/list`,
|
||||
role: ['administrator', 'agent'],
|
||||
role: [ROLE_ADMINISTRATOR, ROLE_AGENT],
|
||||
},
|
||||
{
|
||||
id: 'open_applications_settings',
|
||||
@@ -147,7 +151,7 @@ const GO_TO_COMMANDS = [
|
||||
section: 'COMMAND_BAR.SECTIONS.SETTINGS',
|
||||
icon: ICON_APPS,
|
||||
path: accountId => `accounts/${accountId}/settings/applications`,
|
||||
role: ['administrator'],
|
||||
role: [ROLE_ADMINISTRATOR],
|
||||
},
|
||||
{
|
||||
id: 'open_account_settings',
|
||||
@@ -155,7 +159,7 @@ const GO_TO_COMMANDS = [
|
||||
section: 'COMMAND_BAR.SECTIONS.SETTINGS',
|
||||
icon: ICON_ACCOUNT_SETTINGS,
|
||||
path: accountId => `accounts/${accountId}/settings/general`,
|
||||
role: ['administrator'],
|
||||
role: [ROLE_ADMINISTRATOR],
|
||||
},
|
||||
{
|
||||
id: 'open_profile_settings',
|
||||
@@ -163,7 +167,7 @@ const GO_TO_COMMANDS = [
|
||||
section: 'COMMAND_BAR.SECTIONS.SETTINGS',
|
||||
icon: ICON_USER_PROFILE,
|
||||
path: accountId => `accounts/${accountId}/profile/settings`,
|
||||
role: ['administrator', 'agent'],
|
||||
role: [ROLE_ADMINISTRATOR, ROLE_AGENT],
|
||||
},
|
||||
{
|
||||
id: 'open_notifications',
|
||||
@@ -171,7 +175,7 @@ const GO_TO_COMMANDS = [
|
||||
section: 'COMMAND_BAR.SECTIONS.SETTINGS',
|
||||
icon: ICON_NOTIFICATION,
|
||||
path: accountId => `accounts/${accountId}/notifications`,
|
||||
role: ['administrator', 'agent'],
|
||||
role: [ROLE_ADMINISTRATOR, ROLE_AGENT],
|
||||
},
|
||||
];
|
||||
|
||||
@@ -201,7 +205,7 @@ export function useGoToCommandHotKeys() {
|
||||
});
|
||||
|
||||
if (!isAdmin.value) {
|
||||
commands = commands.filter(command => command.role.includes('agent'));
|
||||
commands = commands.filter(command => command.role.includes(ROLE_AGENT));
|
||||
}
|
||||
|
||||
return commands.map(command => ({
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { computed } from 'vue';
|
||||
import { useStoreGetters } from 'dashboard/composables/store';
|
||||
import { ROLE_ADMINISTRATOR } from 'dashboard/constants/permissions.js';
|
||||
|
||||
/**
|
||||
* Composable to determine if the current user is an administrator.
|
||||
@@ -9,7 +10,7 @@ export function useAdmin() {
|
||||
const getters = useStoreGetters();
|
||||
|
||||
const currentUserRole = computed(() => getters.getCurrentRole.value);
|
||||
const isAdmin = computed(() => currentUserRole.value === 'administrator');
|
||||
const isAdmin = computed(() => currentUserRole.value === ROLE_ADMINISTRATOR);
|
||||
|
||||
return {
|
||||
isAdmin,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { computed } from 'vue';
|
||||
import { useMapGetter } from 'dashboard/composables/store';
|
||||
import { ROLE_AGENT } from 'dashboard/constants/permissions.js';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import {
|
||||
getAgentsByUpdatedPresence,
|
||||
@@ -30,7 +31,7 @@ export function useAgentsList(includeNoneAgent = true) {
|
||||
confirmed: true,
|
||||
name: t('AGENT_MGMT.MULTI_SELECTOR.LIST.NONE') || 'None',
|
||||
id: 0,
|
||||
role: 'agent',
|
||||
role: ROLE_AGENT,
|
||||
account_id: 0,
|
||||
email: 'None',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user