From 5f30b7b173d9a0987b41705a55747af2b16ea597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Gangloff?= Date: Mon, 23 Dec 2024 15:14:23 +0100 Subject: [PATCH] feat: improve the display of entity handles --- assets/components/search/EntitiesList.tsx | 4 ++-- assets/utils/functions/roleToAvatar.tsx | 11 ++++++----- assets/utils/functions/rolesToColor.tsx | 4 ++-- src/Service/RDAPService.php | 3 +++ 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/assets/components/search/EntitiesList.tsx b/assets/components/search/EntitiesList.tsx index 9bca8ab..1c3a833 100644 --- a/assets/components/search/EntitiesList.tsx +++ b/assets/components/search/EntitiesList.tsx @@ -1,4 +1,4 @@ -import {List, Tag, Tooltip} from "antd"; +import {List, Tag, Tooltip, Typography} from "antd"; import React from "react"; import {Domain} from "../../utils/api"; import {rdapRoleDetailTranslation, rdapRoleTranslation} from "../../utils/functions/rdapTranslation"; @@ -28,7 +28,7 @@ export function EntitiesList({domain}: { domain: Domain }) { return {e.entity.handle}} description={<> {details.fn &&
👤 {details.fn}
} {details.organization &&
🏢 {details.organization}
} diff --git a/assets/utils/functions/roleToAvatar.tsx b/assets/utils/functions/roleToAvatar.tsx index 308520e..2e685cb 100644 --- a/assets/utils/functions/roleToAvatar.tsx +++ b/assets/utils/functions/roleToAvatar.tsx @@ -13,12 +13,13 @@ import {rolesToColor} from "./rolesToColor"; export const roleToAvatar = (e: { roles: string[] }) => : e.roles.includes('registrar') ? + : + e.roles.includes('registrar') ? : - e.roles.includes('technical') ? - : - e.roles.includes('administrative') ? - : + e.roles.includes('administrative') ? + : + e.roles.includes('technical') ? + : e.roles.includes('billing') ? : }/> \ No newline at end of file diff --git a/assets/utils/functions/rolesToColor.tsx b/assets/utils/functions/rolesToColor.tsx index fbfb73e..ea0f2d7 100644 --- a/assets/utils/functions/rolesToColor.tsx +++ b/assets/utils/functions/rolesToColor.tsx @@ -1,6 +1,6 @@ export const rolesToColor = (roles: string[]) => roles.includes('registrant') ? 'green' : - roles.includes('technical') ? 'orange' : + roles.includes('registrar') ? 'purple' : roles.includes('administrative') ? 'blue' : - roles.includes('registrar') ? 'purple' : + roles.includes('technical') ? 'orange' : roles.includes('sponsor') ? 'magenta' : roles.includes('billing') ? 'cyan' : 'default' \ No newline at end of file diff --git a/src/Service/RDAPService.php b/src/Service/RDAPService.php index 676cc8a..8aa1095 100644 --- a/src/Service/RDAPService.php +++ b/src/Service/RDAPService.php @@ -357,6 +357,9 @@ readonly class RDAPService } } + /** + * @throws \DateMalformedStringException + */ private function updateDomainNameservers(Domain $domain, array $rdapData): void { if (array_key_exists('nameservers', $rdapData) && is_array($rdapData['nameservers'])) {