Skip to content

Commit

Permalink
Rename to whois
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemBaskal committed Apr 1, 2021
1 parent e3cc4a6 commit c2cfdef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
10 changes: 5 additions & 5 deletions client/src/components/Logs/Cells/ClientCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const ClientCell = ({
client_info,
client_info: {
name,
whois_info,
whois_info: {
whois,
whois: {
country,
city,
orgname,
Expand All @@ -41,9 +41,9 @@ const ClientCell = ({

const autoClient = autoClients.find((autoClient) => autoClient.name === client);
const source = autoClient?.source;
const whoisAvailable = Object.keys(whois_info).length > 0;
const whoisAvailable = Object.keys(whois).length > 0;
const clientName = name || client_id;
const clientInfo = { ...client_info, name: clientName };
const clientInfo = { ...client_info, whois_info: whois, name: clientName };

const id = nanoid();

Expand Down Expand Up @@ -210,7 +210,7 @@ ClientCell.propTypes = {
client_info: propTypes.shape({
ids: propTypes.arrayOf(propTypes.string).isRequired,
name: propTypes.string.isRequired,
whois_info: propTypes.shape({
whois: propTypes.shape({
country: propTypes.string,
city: propTypes.string,
orgname: propTypes.string,
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/Logs/Cells/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const Row = memo(({
name,
disallowed,
disallowed_rule,
whois_info: {
whois: {
country,
city,
orgname,
Expand Down Expand Up @@ -232,7 +232,7 @@ Row.propTypes = {
client_info: propTypes.shape({
ids: propTypes.arrayOf(propTypes.string).isRequired,
name: propTypes.string.isRequired,
whois_info: propTypes.shape({
whois: propTypes.shape({
country: propTypes.string,
city: propTypes.string,
orgname: propTypes.string,
Expand Down
6 changes: 1 addition & 5 deletions client/src/helpers/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,7 @@ export const normalizeLogs = (logs) => logs.map((log) => {
client,
client_proto,
client_id,
client_info: {
...client_info,
// TODO remove default value after setting default value on the server
whois_info: client_info.whois_info || {},
},
client_info,
/* TODO 'filterId' and 'rule' are deprecated, will be removed in 0.106 */
filterId,
rule,
Expand Down

0 comments on commit c2cfdef

Please sign in to comment.