From c131ac445acae449789dd14f452e740b770321db Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Mon, 20 Jul 2020 15:25:28 +0300 Subject: [PATCH] Merge: - client: fix names of clients in the top clients list Closes #1893 Squashed commit of the following: commit e5de0c4f53558e1ad89dc0069192e534f244f120 Author: Ildar Kamalov Date: Mon Jul 20 14:29:23 2020 +0300 - client: fix names of clients in the top clients list --- client/src/components/Dashboard/Clients.js | 2 +- client/src/helpers/formatClientCell.js | 28 +++++++++++++++------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/client/src/components/Dashboard/Clients.js b/client/src/components/Dashboard/Clients.js index ac8771e5..0716ab33 100644 --- a/client/src/components/Dashboard/Clients.js +++ b/client/src/components/Dashboard/Clients.js @@ -62,7 +62,7 @@ const clientCell = (t, toggleClientStatus, processing, disallowedClients) => fun return ( <>
- {formatClientCell(row, true)} + {formatClientCell(row, true, false)}
{ipMatchListStatus !== IP_MATCH_LIST_STATUS.CIDR && renderBlockingButton(ipMatchListStatus, value, toggleClientStatus, processing)} diff --git a/client/src/helpers/formatClientCell.js b/client/src/helpers/formatClientCell.js index 3fc8e55d..989cc1d2 100644 --- a/client/src/helpers/formatClientCell.js +++ b/client/src/helpers/formatClientCell.js @@ -24,7 +24,7 @@ const getFormattedWhois = (whois) => { ); }; -export const formatClientCell = (row, isDetailed = false) => { +export const formatClientCell = (row, isDetailed = false, isLogs = true) => { const { value, original: { info } } = row; let whoisContainer = ''; let nameContainer = value; @@ -33,13 +33,25 @@ export const formatClientCell = (row, isDetailed = false) => { const { name, whois_info } = info; if (name) { - nameContainer = !whois_info && isDetailed - ? {value} - :
- {name} - {' '} - {`(${value})`} -
; + if (isLogs) { + nameContainer = !whois_info && isDetailed + ? ( + {value} + ) : ( +
+ {name} {`(${value})`} +
+ ); + } else { + nameContainer = ( +
+ {name} {`(${value})`} +
+ ); + } } if (whois_info && isDetailed) {