Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] "Taken At" and "Average of Response Time" fields not rendering properly on Room Information panel #21365

Merged
merged 4 commits into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions client/omnichannel/directory/chats/contextualBar/ChatInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { FormSkeleton } from '../../Skeleton';
import { useEndpointData } from '../../../../hooks/useEndpointData';
import { useTranslation } from '../../../../contexts/TranslationContext';
import { useFormatDateAndTime } from '../../../../hooks/useFormatDateAndTime';
import { useFormatDuration } from '../../../../hooks/useFormatDuration';
import { AsyncStatePhase } from '../../../../hooks/useAsyncState';
import UserAvatar from '../../../../components/avatar/UserAvatar';
import { UserStatus } from '../../../../components/UserStatus';
Expand Down Expand Up @@ -94,6 +95,8 @@ export function ChatInfo({ id, route }) {

const formatDateAndTime = useFormatDateAndTime();

const formatDuration = useFormatDuration();

const { value: data, phase: state, error } = useEndpointData(`rooms.info?roomId=${ id }`);
const { room: { ts, tags, closedAt, departmentId, v, servedBy, metrics, topic, waitingResponse, responseBy } } = data || { room: { v: { } } };
const routePath = useRoute(route || 'omnichannel-directory');
Expand Down Expand Up @@ -153,6 +156,14 @@ export function ChatInfo({ id, route }) {
<Label>{t('Closed_At')}</Label>
<Info>{formatDateAndTime(closedAt)}</Info>
</>}
{servedBy?.ts && <>
<Label>{t('Taken_At')}</Label>
<Info>{formatDateAndTime(servedBy.ts)}</Info>
</>}
{metrics?.response?.avg && formatDuration(metrics.response.avg) && <>
<Label>{t('Avg_response_time')}</Label>
<Info>{formatDuration(metrics.response.avg)}</Info>
rafaelblink marked this conversation as resolved.
Show resolved Hide resolved
</>}
{!waitingResponse && <>
<Label>{t('Inactivity_Time')}</Label>
<Info>{moment(responseBy.lastMessageTs).fromNow(true)}</Info>
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -3778,6 +3778,7 @@
"Tag": "Tag",
"Tag_removed": "Tag Removed",
"Take_it": "Take it!",
"Taken_At": "Taken At",
"Target user not allowed to receive messages": "Target user not allowed to receive messages",
"TargetRoom": "Target Room",
"TargetRoom_Description": "The room where messages will be sent which are a result of this event being fired. Only one target room is allowed and it must exist.",
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-i18n/i18n/pt-BR.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -3137,6 +3137,7 @@
"Tag": "Tag",
"Tag_removed": "Tag Removida",
"Take_it": "Pegue!",
"Taken_At": "Atribuído em",
"Target user not allowed to receive messages": "Usuário de destino não autorizado a receber mensagens",
"TargetRoom": "Sala de destino",
"TargetRoom_Description": "A sala onde as mensagens serão enviadas, que são o resultado desse evento a ser disparado. Somente uma sala alvo é permitida e deve existir.",
Expand Down