fix: display an icon even if the event action is not standard

This commit is contained in:
Maël Gangloff
2024-12-19 13:48:26 +01:00
parent 1b3e5c5ef8
commit 7c606e2697
4 changed files with 8 additions and 7 deletions

View File

@@ -14,8 +14,9 @@ export function EntitiesList({domain}: { domain: Domain }) {
const roleToTag = (r: string) => <Tooltip
title={r in rdapRoleDetailTranslated ? rdapRoleDetailTranslated[r as keyof typeof rdapRoleDetailTranslated] : undefined}>
<Tag
color={rolesToColor([r])}>{rdapRoleTranslated[r as keyof typeof rdapRoleTranslated]}</Tag>
<Tag color={rolesToColor([r])}>{
r in rdapRoleTranslated ? rdapRoleTranslated[r as keyof typeof rdapRoleTranslated] : r
}</Tag>
</Tooltip>
return <List

View File

@@ -17,8 +17,6 @@ export function EventTimeline({events}: { events: Event[] }) {
<Timeline
mode={sm ? "left" : "right"}
items={events.map(e => {
const sameEvents = events.filter(se => se.action === e.action)
const eventName = <Typography.Text style={{color: e.deleted ? 'grey' : 'default'}}>
{e.action in rdapEventNameTranslated ? rdapEventNameTranslated[e.action as keyof typeof rdapEventNameTranslated] : e.action}
</Typography.Text>

View File

@@ -80,12 +80,12 @@ export function WatchlistCard({watchlist, onUpdateWatchlist, connectors, onDelet
dataSource={[{
domains: watchlist.domains.map(d => <Tag
color={
d.deleted ? 'magenta' : // If the domain is deleted
d.deleted ? 'magenta' :
d.status.includes('redemption period') ? 'yellow' :
d.status.includes('pending delete') ? 'volcano' : 'default'
}
icon={
d.deleted ? <DeleteOutlined/> : // If the domain is deleted
d.deleted ? <DeleteOutlined/> :
d.status.includes('redemption period') ? <ExclamationCircleOutlined/> :
d.status.includes('pending delete') ? <DeleteOutlined/> : null
}>{punycode.toUnicode(d.ldhName)}</Tag>),

View File

@@ -3,6 +3,7 @@ import {
ClockCircleOutlined,
DeleteOutlined,
LockOutlined,
PushpinOutlined,
ReloadOutlined,
ShareAltOutlined,
SignatureOutlined,
@@ -23,4 +24,5 @@ export const actionToIcon = (a: EventAction) => a === 'registration' ?
<ClockCircleOutlined
style={{fontSize: '16px'}}/> : a === 'enum validation expiration' ?
<ClockCircleOutlined style={{fontSize: '16px'}}/> : a === 'reinstantiation' ?
<ReloadOutlined style={{fontSize: '16px'}}/> : undefined
<ReloadOutlined style={{fontSize: '16px'}}/> :
<PushpinOutlined style={{fontSize: '16px'}}/>