diff --git a/app/javascript/dashboard/i18n/locale/en/agentMgmt.json b/app/javascript/dashboard/i18n/locale/en/agentMgmt.json
index dcc8c9fda..0f965c717 100644
--- a/app/javascript/dashboard/i18n/locale/en/agentMgmt.json
+++ b/app/javascript/dashboard/i18n/locale/en/agentMgmt.json
@@ -91,6 +91,23 @@
},
"SEARCH": {
"NO_RESULTS": "No results found."
+ },
+ "MULTI_SELECTOR": {
+ "PLACEHOLDER": "None",
+ "TITLE": {
+ "AGENT": "Select agent",
+ "TEAM": "Select team"
+ },
+ "SEARCH": {
+ "NO_RESULTS": {
+ "AGENT": "No agents found",
+ "TEAM": "No teams found"
+ },
+ "PLACEHOLDER": {
+ "AGENT": "Search agents",
+ "TEAM": "Search teams"
+ }
+ }
}
}
}
diff --git a/app/javascript/dashboard/routes/dashboard/conversation/ContactPanel.vue b/app/javascript/dashboard/routes/dashboard/conversation/ContactPanel.vue
index f2e7a8870..0231d3e01 100644
--- a/app/javascript/dashboard/routes/dashboard/conversation/ContactPanel.vue
+++ b/app/javascript/dashboard/routes/dashboard/conversation/ContactPanel.vue
@@ -24,27 +24,21 @@
-
-
-
-
-
{{ props.option.name }}
-
-
- {{ $t('AGENT_MGMT.SEARCH.NO_RESULTS') }}
-
+ :selected-item="assignedAgent"
+ :multiselector-title="$t('AGENT_MGMT.MULTI_SELECTOR.TITLE.AGENT')"
+ :multiselector-placeholder="
+ $t('AGENT_MGMT.MULTI_SELECTOR.PLACEHOLDER')
+ "
+ :no-search-result="
+ $t('AGENT_MGMT.MULTI_SELECTOR.SEARCH.NO_RESULTS.AGENT')
+ "
+ :input-placeholder="
+ $t('AGENT_MGMT.MULTI_SELECTOR.SEARCH.PLACEHOLDER.AGENT')
+ "
+ @click="onClickAssignAgent"
+ />
-
- {{ $t('AGENT_MGMT.SEARCH.NO_RESULTS') }}
-
+ :selected-item="assignedTeam"
+ :multiselector-title="$t('AGENT_MGMT.MULTI_SELECTOR.TITLE.TEAM')"
+ :multiselector-placeholder="
+ $t('AGENT_MGMT.MULTI_SELECTOR.PLACEHOLDER')
+ "
+ :no-search-result="
+ $t('AGENT_MGMT.MULTI_SELECTOR.SEARCH.NO_RESULTS.TEAM')
+ "
+ :input-placeholder="
+ $t('AGENT_MGMT.MULTI_SELECTOR.SEARCH.PLACEHOLDER.TEAM')
+ "
+ @click="onClickAssignTeam"
+ />
@@ -138,7 +134,7 @@ import ContactDetailsItem from './ContactDetailsItem.vue';
import ContactInfo from './contact/ContactInfo';
import ConversationLabels from './labels/LabelBox.vue';
import ContactCustomAttributes from './ContactCustomAttributes';
-import AvailabilityStatusBadge from 'dashboard/components/widgets/conversation/AvailabilityStatusBadge.vue';
+import MultiselectDropdown from 'shared/components/ui/MultiselectDropdown.vue';
import flag from 'country-code-emoji';
@@ -149,7 +145,7 @@ export default {
ContactDetailsItem,
ContactInfo,
ConversationLabels,
- AvailabilityStatusBadge,
+ MultiselectDropdown,
},
mixins: [alertMixin, agentMixin],
props: {
@@ -330,6 +326,21 @@ export default {
};
this.assignedAgent = selfAssign;
},
+ onClickAssignAgent(selectedItem) {
+ if (this.assignedAgent && this.assignedAgent.id === selectedItem.id) {
+ this.assignedAgent = null;
+ } else {
+ this.assignedAgent = selectedItem;
+ }
+ },
+
+ onClickAssignTeam(selectedItemTeam) {
+ if (this.assignedTeam && this.assignedTeam.id === selectedItemTeam.id) {
+ this.assignedTeam = null;
+ } else {
+ this.assignedTeam = selectedItemTeam;
+ }
+ },
},
};
diff --git a/app/javascript/shared/components/ui/MultiselectDropdown.stories.js b/app/javascript/shared/components/ui/MultiselectDropdown.stories.js
index ff3f366f0..8b067e489 100644
--- a/app/javascript/shared/components/ui/MultiselectDropdown.stories.js
+++ b/app/javascript/shared/components/ui/MultiselectDropdown.stories.js
@@ -1,5 +1,5 @@
import { action } from '@storybook/addon-actions';
-import Dropdown from './MutiselectDropdown';
+import Dropdown from './MultiselectDropdown';
export default {
title: 'Components/Dropdown/Multiselect Dropdown',
diff --git a/app/javascript/shared/components/ui/MutiselectDropdown.vue b/app/javascript/shared/components/ui/MultiselectDropdown.vue
similarity index 97%
rename from app/javascript/shared/components/ui/MutiselectDropdown.vue
rename to app/javascript/shared/components/ui/MultiselectDropdown.vue
index 5f99a8dbd..cf90179b2 100644
--- a/app/javascript/shared/components/ui/MutiselectDropdown.vue
+++ b/app/javascript/shared/components/ui/MultiselectDropdown.vue
@@ -1,5 +1,9 @@
-