Skip to content

Commit

Permalink
fix groups update when not using group tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
allgood committed Nov 21, 2024
1 parent c0a5d4c commit 2aad4e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
10 changes: 5 additions & 5 deletions frontend/src/components/TicketsListCustom/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const TicketsListCustom = (props) => {
updateCount,
style,
setTabOpen,
groupActionButtons,
showTabGroups
} = props;
const classes = useStyles();
const [pageNumber, setPageNumber] = useState(1);
Expand Down Expand Up @@ -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;
}

Expand All @@ -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)
) {
Expand Down Expand Up @@ -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") {
Expand Down Expand Up @@ -382,7 +382,7 @@ const TicketsListCustom = (props) => {
ticket={ticket}
setTabOpen={setTabOpen}
key={ticket.id}
groupActionButtons={groupActionButtons}
groupActionButtons={!!groups && !showTabGroups}
/>
))}
</>
Expand Down
9 changes: 5 additions & 4 deletions frontend/src/components/TicketsManagerTabs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,15 +340,15 @@ const TicketsManagerTabs = () => {
updateCount={(val) => setOpenCount(val)}
style={applyPanelStyle("open")}
setTabOpen={setTabOpen}
groupActionButtons={!showTabGroups}
showTabGroups={showTabGroups}
/>
<TicketsList
status="pending"
selectedQueueIds={selectedQueueIds}
updateCount={(val) => setPendingCount(val)}
style={applyPanelStyle("pending")}
setTabOpen={setTabOpen}
groupActionButtons={!showTabGroups}
showTabGroups={showTabGroups}
/>
</Paper>
</TabPanel>
Expand All @@ -357,14 +357,15 @@ const TicketsManagerTabs = () => {
status="closed"
showAll={true}
selectedQueueIds={selectedQueueIds}
groupActionButtons={!showTabGroups}
showTabGroups={showTabGroups}
/>
</TabPanel>
<TabPanel value={tab} name="groups" className={classes.ticketsWrapper}>
<TicketsList
groups={true}
showAll={true}
selectedQueueIds={selectedQueueIds}
showTabGroups={showTabGroups}
/>
</TabPanel>
<TabPanel value={tab} name="search" className={classes.ticketsWrapper}>
Expand All @@ -379,7 +380,7 @@ const TicketsManagerTabs = () => {
tags={selectedTags}
users={selectedUsers}
selectedQueueIds={selectedQueueIds}
groupActionButtons={!showTabGroups}
showTabGroups={showTabGroups}
/>
</TabPanel>
</Paper>
Expand Down

0 comments on commit 2aad4e1

Please sign in to comment.