Open jaX10bt opened 3 months ago
[BUG]
Upon first logging in to the backoffice, both 'active' and 'status' are set to 'false' and 'offline' respectively. When the user then presses 'Kohal/Eemal', the POST request changes the users status in the back end but this information is not updated in the front end until another GET request is sent by for example navigating to another module.
[BUG]
When a backoffice user has been idle for some time, the popup to change the status to 'kohal' appears. When 'Jah' is clicked then the status changes to 'kohal' and when 'tühista' is clicked the status remains 'eemal'. However now when the backoffice user wants to set their status to 'eemal', the popup is displayed.
The new message notification 'ding' sound is only played in the backoffice when the backoffice tab is active. When the backoffice tab is not active (even when it is visible), there is no indication of a forwarded chat.
[BUG]
In training module, the popup modal that is supposed to ask 'Kas soovid muuta staatuseks "kohal"?' displays 'global.statusChangeQuestion'
Header package needs to be deployed to NPM first.
v0.1.11 published on 8th of august https://www.npmjs.com/package/@buerokratt-ria/header/v/0.1.11
Popup notifications and sound notifications are not working properly.
Active chats request is only sent when the tab is active. When the backoffice window is not active or minimized, there is no indication of a new chat.
When admin sent message and user reads it, message with message-read event was inserted to messages table and this event message was interpreted as user message. Fix is here
Sound and pop-up notifications not working
New chat notifications are working. One behavior could to be improved. Currently notifications are sent for each new customer message in any of the active chats (unanswered, active), IF there are any unanswered chats. Depending on business needs, the logic could be improved - whether to remove the unanswered chat length check to send notifications for all new messages regardless of the number of unanswered chats. OR if notification should be sent only about new chats (unanswered). Then we should not check for new messages in chats, instead we check only if there are any new chats.
Forwarded chat logic seems to be broken. Quick code assessment revealed that the business logic for sending notifications is there, but store state is in bad shape. Header and modules have separate stores. Header fetches and stores chats, messages etc, module is using header store for messages but stores user data in its own store. Therefore all the business checks related to user in header store are broken, because it does not contain user data. (Eg. idCode is used to find chat assignee (CSA))
If forwarded chat logic is fixed, one could also add browser notification sending there, similar to new chat logic.
Will create a new issue based on what's left undone regarding this task.
AS A Bürokratt User I WANT to only receive sound and popup notifications when a new message is received SO THAT I would know when a new message is received
currently whenever a user switches modules, a popup and ding is played for each unanswered chat. a ding and popup is also played seemingly in 2 minute intervals.
I WANT the backoffice user status to not change randomly SO THAT I can reliably keep my status as ACTIVE
currently it seems that there are 2 separate parameters that control the active status. one of them is a boolean 'active' and the other one is a string 'status'.
Acceptance Criteria