From 2aad4e1d621693546e693695c706595e068366f6 Mon Sep 17 00:00:00 2001 From: Claudemir Todo Bom Date: Thu, 21 Nov 2024 12:19:04 -0300 Subject: [PATCH] fix groups update when not using group tabs --- frontend/src/components/TicketsListCustom/index.js | 10 +++++----- frontend/src/components/TicketsManagerTabs/index.js | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/TicketsListCustom/index.js b/frontend/src/components/TicketsListCustom/index.js index 94a250e..41a9d96 100644 --- a/frontend/src/components/TicketsListCustom/index.js +++ b/frontend/src/components/TicketsListCustom/index.js @@ -175,7 +175,7 @@ const TicketsListCustom = (props) => { updateCount, style, setTabOpen, - groupActionButtons, + showTabGroups } = props; const classes = useStyles(); const [pageNumber, setPageNumber] = useState(1); @@ -275,7 +275,7 @@ const TicketsListCustom = (props) => { const onCompanyAppMessage = (data) => { console.debug("appMessage event received", data); - if (!!data.ticket?.isGroup !== !!groups) { + if (showTabGroups && !!data.ticket?.isGroup !== !!groups) { return; } @@ -290,7 +290,7 @@ const TicketsListCustom = (props) => { if ( data.action === "create" && - !!data.ticket?.isGroup === !!groups && + (!showTabGroups || !!data.ticket?.isGroup === !!groups) && shouldUpdateTicket(data.ticket) && (status === undefined || data.ticket.status === status) ) { @@ -332,7 +332,7 @@ const TicketsListCustom = (props) => { socket.disconnect(); }; - }, [status, showAll, user, selectedQueueIds, tags, users, profile, queues, socketManager]); + }, [status, showAll, groups, showTabGroups, user, selectedQueueIds, tags, users, profile, queues, socketManager]); useEffect(() => { if (typeof updateCount === "function") { @@ -382,7 +382,7 @@ const TicketsListCustom = (props) => { ticket={ticket} setTabOpen={setTabOpen} key={ticket.id} - groupActionButtons={groupActionButtons} + groupActionButtons={!!groups && !showTabGroups} /> ))} diff --git a/frontend/src/components/TicketsManagerTabs/index.js b/frontend/src/components/TicketsManagerTabs/index.js index c9c4acb..d993e2a 100644 --- a/frontend/src/components/TicketsManagerTabs/index.js +++ b/frontend/src/components/TicketsManagerTabs/index.js @@ -340,7 +340,7 @@ const TicketsManagerTabs = () => { updateCount={(val) => setOpenCount(val)} style={applyPanelStyle("open")} setTabOpen={setTabOpen} - groupActionButtons={!showTabGroups} + showTabGroups={showTabGroups} /> { updateCount={(val) => setPendingCount(val)} style={applyPanelStyle("pending")} setTabOpen={setTabOpen} - groupActionButtons={!showTabGroups} + showTabGroups={showTabGroups} /> @@ -357,7 +357,7 @@ const TicketsManagerTabs = () => { status="closed" showAll={true} selectedQueueIds={selectedQueueIds} - groupActionButtons={!showTabGroups} + showTabGroups={showTabGroups} /> @@ -365,6 +365,7 @@ const TicketsManagerTabs = () => { groups={true} showAll={true} selectedQueueIds={selectedQueueIds} + showTabGroups={showTabGroups} /> @@ -379,7 +380,7 @@ const TicketsManagerTabs = () => { tags={selectedTags} users={selectedUsers} selectedQueueIds={selectedQueueIds} - groupActionButtons={!showTabGroups} + showTabGroups={showTabGroups} />