Compare commits
No commits in common. "9b6e48f54e65a827152ccd724b5703be30fbedd7" and "52e63706c1b25601be4505cb33ee0c8ba99f6907" have entirely different histories.
9b6e48f54e
...
52e63706c1
|
@ -529,7 +529,6 @@ const transferTicket = async (
|
||||||
sendGreetingMessage?: boolean
|
sendGreetingMessage?: boolean
|
||||||
) => {
|
) => {
|
||||||
const botInfo = await BotIsOnQueue("botqueue");
|
const botInfo = await BotIsOnQueue("botqueue");
|
||||||
const io = getIO();
|
|
||||||
|
|
||||||
const queuesWhatsGreetingMessage = await queuesOutBot(
|
const queuesWhatsGreetingMessage = await queuesOutBot(
|
||||||
wbot,
|
wbot,
|
||||||
|
@ -549,7 +548,6 @@ const transferTicket = async (
|
||||||
}
|
}
|
||||||
|
|
||||||
if (queue) await botTransferTicket(queue, ticket, sendGreetingMessage);
|
if (queue) await botTransferTicket(queue, ticket, sendGreetingMessage);
|
||||||
io.emit('notifyPeding', {data: {ticket, queue}});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const botTransferTicket = async (
|
const botTransferTicket = async (
|
||||||
|
|
|
@ -261,31 +261,31 @@ const NotificationsPopOver = () => {
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
user.queues.forEach(queue =>{
|
user.queues.forEach(queue =>{
|
||||||
if(queue.id === notify.data?.queue?.id){
|
if(queue.id === notify.data.queue?.id){
|
||||||
isQueue = true;
|
isQueue = true;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if(!isQueue){
|
}
|
||||||
return;
|
if(!isQueue && notify){
|
||||||
}else {
|
return;
|
||||||
const notification = new Notification(`${i18n.t("tickets.notification.messagePeding")} ${notify.data?.queue?.name}`);
|
}else{
|
||||||
notification.onclick = e => {
|
const notification = new Notification(`${i18n.t("tickets.notification.messagePeding")} ${notify.data.queue?.name}`);
|
||||||
e.preventDefault()
|
notification.onclick = e => {
|
||||||
window.focus()
|
e.preventDefault()
|
||||||
historyRef.current.push(`/tickets`)
|
window.focus()
|
||||||
}
|
historyRef.current.push(`/tickets`)
|
||||||
|
|
||||||
setDesktopNotifications(prevState => {
|
|
||||||
const notfiticationIndex = prevState.findIndex(
|
|
||||||
n => n.tag === notification.tag
|
|
||||||
)
|
|
||||||
if (notfiticationIndex !== -1) {
|
|
||||||
prevState[notfiticationIndex] = notification
|
|
||||||
return [...prevState]
|
|
||||||
}
|
|
||||||
return [notification, ...prevState]
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setDesktopNotifications(prevState => {
|
||||||
|
const notfiticationIndex = prevState.findIndex(
|
||||||
|
n => n.tag === notification.tag
|
||||||
|
)
|
||||||
|
if (notfiticationIndex !== -1) {
|
||||||
|
prevState[notfiticationIndex] = notification
|
||||||
|
return [...prevState]
|
||||||
|
}
|
||||||
|
return [notification, ...prevState]
|
||||||
|
})
|
||||||
}
|
}
|
||||||
soundAlertRef.current()
|
soundAlertRef.current()
|
||||||
}
|
}
|
||||||
|
|
|
@ -235,9 +235,7 @@ let columnsData = [
|
||||||
|
|
||||||
{ title: `${i18n.t("reports.listColumns.column1_7")}`, field: 'createdAt' },
|
{ title: `${i18n.t("reports.listColumns.column1_7")}`, field: 'createdAt' },
|
||||||
{ title: `${i18n.t("reports.listColumns.column1_8")}`, field: 'updatedAt' },
|
{ title: `${i18n.t("reports.listColumns.column1_8")}`, field: 'updatedAt' },
|
||||||
{ title: `${i18n.t("reports.listColumns.column1_9")}`, field: 'statusChatEnd' },
|
{ title: `${i18n.t("reports.listColumns.column1_9")}`, field: 'statusChatEnd' }]
|
||||||
{ title: `Mensagens`, field: 'messagesToFilter', searchable: true, hidden: true },
|
|
||||||
]
|
|
||||||
|
|
||||||
let columnsDataSuper = [
|
let columnsDataSuper = [
|
||||||
{ title: `${i18n.t("reports.listColumns.column1_1")}`, field: 'whatsapp.name' },
|
{ title: `${i18n.t("reports.listColumns.column1_1")}`, field: 'whatsapp.name' },
|
||||||
|
@ -249,8 +247,7 @@ let columnsDataSuper = [
|
||||||
|
|
||||||
{ title: `${i18n.t("reports.listColumns.column1_7")}`, field: 'createdAt' },
|
{ title: `${i18n.t("reports.listColumns.column1_7")}`, field: 'createdAt' },
|
||||||
{ title: `${i18n.t("reports.listColumns.column1_8")}`, field: 'updatedAt' },
|
{ title: `${i18n.t("reports.listColumns.column1_8")}`, field: 'updatedAt' },
|
||||||
{ title: `${i18n.t("reports.listColumns.column1_9")}`, field: 'statusChatEnd' },
|
{ title: `${i18n.t("reports.listColumns.column1_9")}`, field: 'statusChatEnd' }
|
||||||
{ title: `Mensagens`, field: 'messagesToFilter', searchable: true, hidden: true },
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -372,12 +369,8 @@ const Report = () => {
|
||||||
filterQueuesTickets = ticketsQueue.filter(ticket => ticket?.queue?.name === userQueues[0]?.name)
|
filterQueuesTickets = ticketsQueue.filter(ticket => ticket?.queue?.name === userQueues[0]?.name)
|
||||||
}
|
}
|
||||||
data.tickets = filterQueuesTickets
|
data.tickets = filterQueuesTickets
|
||||||
const tickets = data.tickets.map(ticket => ({
|
dispatchQ({ type: "LOAD_QUERY", payload: data.tickets })
|
||||||
...ticket,
|
|
||||||
messagesToFilter: ticket.messages.map(message => message.body).join(' '),
|
|
||||||
}));
|
|
||||||
dispatchQ({ type: "LOAD_QUERY", payload: tickets })
|
|
||||||
console.log(tickets);
|
|
||||||
setHasMore(data.hasMore)
|
setHasMore(data.hasMore)
|
||||||
setTotalCountTickets(data.count)
|
setTotalCountTickets(data.count)
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
|
|
Loading…
Reference in New Issue