Skip to content

Commit

Permalink
feature: Web-chat Appointments time selector localized [WTEL-3159]
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirBeria committed Feb 29, 2024
1 parent b041e59 commit 7fe2ab4
Showing 1 changed file with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@
@input="setAppointmentMetadata({ prop: 'communicationType', value: $event })"
/>
<wt-select
v-model="channel"
:clearable="false"
:disabled="disableUserInput"
:label="$t('vocabulary.duration')"
:options="durationOptions"
:track-by="null"
:options="options"
:v="v.itemInstance.metadata.appointment.duration"
:value="itemInstance.metadata.appointment.duration"
:disabled="disableUserInput"
@input="setAppointmentMetadata({ prop: 'duration', value: $event })"
track-by="value"
/>
<wt-input
:label="$t('objects.routing.chatGateways.webchat.appointment.availableAgents')"
Expand Down Expand Up @@ -109,6 +108,8 @@ import { mapActions } from 'vuex';
import openedTabComponentMixin
from '../../../../../../../app/mixins/objectPagesMixins/openedObjectTabMixin/openedTabComponentMixin';
import QueuesAPI from '../../../../../../contact-center/modules/queues/api/queues';
import StatisticTimeList
from '../../../../../../contact-center/modules/queues/store/_internals/lookups/StatisticTime.lookup';
import CommunicationsAPI from '../../../../../../lookups/modules/communications/api/communications';
export default {
Expand All @@ -117,6 +118,24 @@ export default {
data: () => ({
durationOptions: ['15m', '30m', '45m', '60m'],
}),
computed: {
channel: {
get() {
return this.options.find((duration) => {
return duration.value === this.itemInstance.metadata.appointment.duration;
});
},
set(value) {
this.setAppointmentMetadata({ prop: 'duration', value: value.value })
},
},
options() {
return StatisticTimeList.slice(0, 4).map((time) => ({
value: `${time.value}m`,
name: this.$t(`objects.ccenter.queues.time.${time.name}`),
}));
},
},
methods: {
...mapActions({
setAppointmentMetadata(dispatch, payload) {
Expand Down

0 comments on commit 7fe2ab4

Please sign in to comment.