mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: add small dot. Fixes #76
This commit is contained in:
@@ -1,29 +1,38 @@
|
|||||||
import {Tag} from 'antd'
|
import {Badge, Tag} from 'antd'
|
||||||
import {DeleteOutlined, ExclamationCircleOutlined} from '@ant-design/icons'
|
import {DeleteOutlined, ExclamationCircleOutlined} from '@ant-design/icons'
|
||||||
import punycode from 'punycode/punycode'
|
import punycode from 'punycode/punycode'
|
||||||
import {Link} from 'react-router-dom'
|
import {Link} from 'react-router-dom'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
import type {Event} from "../api"
|
||||||
|
import {t} from "ttag"
|
||||||
|
|
||||||
|
export function DomainToTag({domain}: { domain: { ldhName: string, deleted: boolean, status: string[], events: Event[] } }) {
|
||||||
|
const lastChangedEvent = domain.events.find(e => e.action === 'last changed' && !e.deleted)
|
||||||
|
|
||||||
export function DomainToTag({domain}: { domain: { ldhName: string, deleted: boolean, status: string[] } }) {
|
|
||||||
return (
|
return (
|
||||||
<Link to={'/search/domain/' + domain.ldhName}>
|
<Link to={'/search/domain/' + domain.ldhName}>
|
||||||
<Tag
|
<Badge dot={
|
||||||
color={
|
lastChangedEvent !== undefined &&
|
||||||
domain.deleted
|
(new Date().getTime() - new Date(lastChangedEvent.date).getTime()) < 7*24*60*60*1e3
|
||||||
? 'magenta'
|
} color='blue' title={t`The domain name was updated less than a week ago.`}>
|
||||||
: domain.status.includes('redemption period')
|
<Tag
|
||||||
? 'yellow'
|
color={
|
||||||
: domain.status.includes('pending delete') ? 'volcano' : 'default'
|
domain.deleted
|
||||||
}
|
? 'magenta'
|
||||||
icon={
|
: domain.status.includes('redemption period')
|
||||||
domain.deleted
|
? 'yellow'
|
||||||
? <DeleteOutlined/>
|
: domain.status.includes('pending delete') ? 'volcano' : 'default'
|
||||||
: domain.status.includes('redemption period')
|
}
|
||||||
? <ExclamationCircleOutlined/>
|
icon={
|
||||||
: domain.status.includes('pending delete') ? <DeleteOutlined/> : null
|
domain.deleted
|
||||||
}
|
? <DeleteOutlined/>
|
||||||
>{punycode.toUnicode(domain.ldhName)}
|
: domain.status.includes('redemption period')
|
||||||
</Tag>
|
? <ExclamationCircleOutlined/>
|
||||||
|
: domain.status.includes('pending delete') ? <DeleteOutlined/> : null
|
||||||
|
}
|
||||||
|
>{punycode.toUnicode(domain.ldhName)}
|
||||||
|
</Tag>
|
||||||
|
</Badge>
|
||||||
</Link>
|
</Link>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class Domain
|
|||||||
* @var Collection<int, DomainEvent>
|
* @var Collection<int, DomainEvent>
|
||||||
*/
|
*/
|
||||||
#[ORM\OneToMany(targetEntity: DomainEvent::class, mappedBy: 'domain', cascade: ['persist'], orphanRemoval: true)]
|
#[ORM\OneToMany(targetEntity: DomainEvent::class, mappedBy: 'domain', cascade: ['persist'], orphanRemoval: true)]
|
||||||
#[Groups(['domain:item', 'domain:list'])]
|
#[Groups(['domain:item', 'domain:list', 'watchlist:list'])]
|
||||||
private Collection $events;
|
private Collection $events;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -23,7 +23,11 @@ use Symfony\Component\Uid\Uuid;
|
|||||||
operations: [
|
operations: [
|
||||||
new GetCollection(
|
new GetCollection(
|
||||||
routeName: 'watchlist_get_all_mine',
|
routeName: 'watchlist_get_all_mine',
|
||||||
normalizationContext: ['groups' => 'watchlist:list'],
|
normalizationContext: ['groups' => [
|
||||||
|
'watchlist:list',
|
||||||
|
'domain:list',
|
||||||
|
'event:list',
|
||||||
|
]],
|
||||||
name: 'get_all_mine',
|
name: 'get_all_mine',
|
||||||
),
|
),
|
||||||
new GetCollection(
|
new GetCollection(
|
||||||
@@ -33,6 +37,8 @@ use Symfony\Component\Uid\Uuid;
|
|||||||
'domain:list',
|
'domain:list',
|
||||||
'tld:list',
|
'tld:list',
|
||||||
'event:list',
|
'event:list',
|
||||||
|
'domain:list',
|
||||||
|
'event:list',
|
||||||
]],
|
]],
|
||||||
name: 'get_tracked_domains'
|
name: 'get_tracked_domains'
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -661,6 +661,10 @@ msgstr ""
|
|||||||
msgid "Roles"
|
msgid "Roles"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: assets/utils/functions/DomainToTag.tsx:16
|
||||||
|
msgid "The domain name was updated less than a week ago."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: assets/utils/functions/rdapTranslation.ts:7
|
#: assets/utils/functions/rdapTranslation.ts:7
|
||||||
#: assets/utils/providers/forms/EppConnectorForm.tsx:241
|
#: assets/utils/providers/forms/EppConnectorForm.tsx:241
|
||||||
msgid "Registrant"
|
msgid "Registrant"
|
||||||
|
|||||||
Reference in New Issue
Block a user