From ce1690eeb1b6e1e2371b8f7301c3c80eefc1dec2 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Thu, 4 Sep 2025 12:02:35 +0530 Subject: [PATCH] feat: Agent assignment index page (#12364) --- .../AssignmentCard/AssignmentCard.story.vue | 0 .../AssignmentCard/AssignmentCard.vue | 7 +- .../components-next/sidebar/Sidebar.vue | 6 ++ app/javascript/dashboard/featureFlags.js | 1 + .../dashboard/i18n/locale/en/settings.json | 27 +++++++ .../settings/assignmentPolicy/Index.vue | 81 +++++++++++++++++++ .../assignmentPolicy.routes.js | 30 +++++++ .../dashboard/settings/settings.routes.js | 2 + 8 files changed, 152 insertions(+), 2 deletions(-) rename app/javascript/dashboard/components-next/{AgentManagementPolicy => AssignmentPolicy}/AssignmentCard/AssignmentCard.story.vue (100%) rename app/javascript/dashboard/components-next/{AgentManagementPolicy => AssignmentPolicy}/AssignmentCard/AssignmentCard.vue (88%) create mode 100644 app/javascript/dashboard/routes/dashboard/settings/assignmentPolicy/Index.vue create mode 100644 app/javascript/dashboard/routes/dashboard/settings/assignmentPolicy/assignmentPolicy.routes.js diff --git a/app/javascript/dashboard/components-next/AgentManagementPolicy/AssignmentCard/AssignmentCard.story.vue b/app/javascript/dashboard/components-next/AssignmentPolicy/AssignmentCard/AssignmentCard.story.vue similarity index 100% rename from app/javascript/dashboard/components-next/AgentManagementPolicy/AssignmentCard/AssignmentCard.story.vue rename to app/javascript/dashboard/components-next/AssignmentPolicy/AssignmentCard/AssignmentCard.story.vue diff --git a/app/javascript/dashboard/components-next/AgentManagementPolicy/AssignmentCard/AssignmentCard.vue b/app/javascript/dashboard/components-next/AssignmentPolicy/AssignmentCard/AssignmentCard.vue similarity index 88% rename from app/javascript/dashboard/components-next/AgentManagementPolicy/AssignmentCard/AssignmentCard.vue rename to app/javascript/dashboard/components-next/AssignmentPolicy/AssignmentCard/AssignmentCard.vue index c75ac09fb..1e477eafe 100644 --- a/app/javascript/dashboard/components-next/AgentManagementPolicy/AssignmentCard/AssignmentCard.vue +++ b/app/javascript/dashboard/components-next/AssignmentPolicy/AssignmentCard/AssignmentCard.vue @@ -36,9 +36,12 @@ const handleClick = () => {
  • - + {{ feature.label }}
  • diff --git a/app/javascript/dashboard/components-next/sidebar/Sidebar.vue b/app/javascript/dashboard/components-next/sidebar/Sidebar.vue index c4daaf519..27736c3a2 100644 --- a/app/javascript/dashboard/components-next/sidebar/Sidebar.vue +++ b/app/javascript/dashboard/components-next/sidebar/Sidebar.vue @@ -422,6 +422,12 @@ const menuItems = computed(() => { icon: 'i-lucide-users', to: accountScopedRoute('settings_teams_list'), }, + { + name: 'Settings Agent Assignment', + label: t('SIDEBAR.AGENT_ASSIGNMENT'), + icon: 'i-lucide-user-cog', + to: accountScopedRoute('assignment_policy_index'), + }, { name: 'Settings Inboxes', label: t('SIDEBAR.INBOXES'), diff --git a/app/javascript/dashboard/featureFlags.js b/app/javascript/dashboard/featureFlags.js index 28b6b09b7..143094ae5 100644 --- a/app/javascript/dashboard/featureFlags.js +++ b/app/javascript/dashboard/featureFlags.js @@ -1,6 +1,7 @@ export const FEATURE_FLAGS = { AGENT_BOTS: 'agent_bots', AGENT_MANAGEMENT: 'agent_management', + ASSIGNMENT_V2: 'assignment_v2', AUTO_RESOLVE_CONVERSATIONS: 'auto_resolve_conversations', AUTOMATIONS: 'automations', CAMPAIGNS: 'campaigns', diff --git a/app/javascript/dashboard/i18n/locale/en/settings.json b/app/javascript/dashboard/i18n/locale/en/settings.json index d547538db..5b2197a03 100644 --- a/app/javascript/dashboard/i18n/locale/en/settings.json +++ b/app/javascript/dashboard/i18n/locale/en/settings.json @@ -330,6 +330,7 @@ "REPORTS_LABEL": "Labels", "REPORTS_INBOX": "Inbox", "REPORTS_TEAM": "Team", + "AGENT_ASSIGNMENT": "Agent Assignment", "SET_AVAILABILITY_TITLE": "Set yourself as", "SET_YOUR_AVAILABILITY": "Set your availability", "SLA": "SLA", @@ -418,5 +419,31 @@ "SWITCH_TO_REPLY": "Switch to Reply", "TOGGLE_SNOOZE_DROPDOWN": "Toggle snooze dropdown" } + }, + "ASSIGNMENT_POLICY": { + "INDEX": { + "HEADER": { + "TITLE": "Agent assignment", + "DESCRIPTION": "Define policies to effectively manage workload and route conversations based on the needs of inboxes and agents. Learn more here" + }, + "ASSIGNMENT_POLICY": { + "TITLE": "Assignment policy", + "DESCRIPTION": "Manage how conversations get assigned in inboxes.", + "FEATURES": [ + "Assign by conversations evenly or by available capacity", + "Add fair distribution rules to avoid overloading any agent", + "Add inboxes to a policy - one policy per inbox" + ] + }, + "AGENT_CAPACITY_POLICY": { + "TITLE": "Agent capacity policy", + "DESCRIPTION": "Manage workload for agents.", + "FEATURES": [ + "Define maximum conversations per inbox", + "Create exceptions based on labels and time", + "Add agents to a policy - one policy per agent" + ] + } + } } } diff --git a/app/javascript/dashboard/routes/dashboard/settings/assignmentPolicy/Index.vue b/app/javascript/dashboard/routes/dashboard/settings/assignmentPolicy/Index.vue new file mode 100644 index 000000000..6b0f88033 --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/settings/assignmentPolicy/Index.vue @@ -0,0 +1,81 @@ + + + diff --git a/app/javascript/dashboard/routes/dashboard/settings/assignmentPolicy/assignmentPolicy.routes.js b/app/javascript/dashboard/routes/dashboard/settings/assignmentPolicy/assignmentPolicy.routes.js new file mode 100644 index 000000000..2d62674b0 --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/settings/assignmentPolicy/assignmentPolicy.routes.js @@ -0,0 +1,30 @@ +import { FEATURE_FLAGS } from '../../../../featureFlags'; +import { frontendURL } from '../../../../helper/URLHelper'; +import SettingsWrapper from '../SettingsWrapper.vue'; +import AssignmentPolicyIndex from './Index.vue'; + +export default { + routes: [ + { + path: frontendURL('accounts/:accountId/settings/assignment-policy'), + component: SettingsWrapper, + children: [ + { + path: '', + redirect: to => { + return { name: 'assignment_policy_index', params: to.params }; + }, + }, + { + path: 'index', + name: 'assignment_policy_index', + component: AssignmentPolicyIndex, + meta: { + featureFlag: FEATURE_FLAGS.ASSIGNMENT_V2, + permissions: ['administrator'], + }, + }, + ], + }, + ], +}; diff --git a/app/javascript/dashboard/routes/dashboard/settings/settings.routes.js b/app/javascript/dashboard/routes/dashboard/settings/settings.routes.js index ef39688a5..967c6cd55 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/settings.routes.js +++ b/app/javascript/dashboard/routes/dashboard/settings/settings.routes.js @@ -6,6 +6,7 @@ import { import account from './account/account.routes'; import agent from './agents/agent.routes'; +import assignmentPolicy from './assignmentPolicy/assignmentPolicy.routes'; import agentBot from './agentBots/agentBot.routes'; import attributes from './attributes/attributes.routes'; import automation from './automation/automation.routes'; @@ -44,6 +45,7 @@ export default { }, ...account.routes, ...agent.routes, + ...assignmentPolicy.routes, ...agentBot.routes, ...attributes.routes, ...automation.routes,