mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: gray out old expiration events no longer relevant
This commit is contained in:
@@ -24,7 +24,7 @@ export function actionToColor(a: EventAction) {
|
|||||||
export const domainEvent = () => ({
|
export const domainEvent = () => ({
|
||||||
registration: t`Registration`,
|
registration: t`Registration`,
|
||||||
reregistration: t`Reregistration`,
|
reregistration: t`Reregistration`,
|
||||||
'last changed': t`Last changed`,
|
'last changed': t`Changed`,
|
||||||
expiration: t`Expiration`,
|
expiration: t`Expiration`,
|
||||||
deletion: t`Deletion`,
|
deletion: t`Deletion`,
|
||||||
reinstantiation: t`Reinstantiation`,
|
reinstantiation: t`Reinstantiation`,
|
||||||
@@ -38,15 +38,15 @@ export const domainEvent = () => ({
|
|||||||
export function EventTimeline({domain}: { domain: Domain }) {
|
export function EventTimeline({domain}: { domain: Domain }) {
|
||||||
const sm = useBreakpoint('sm')
|
const sm = useBreakpoint('sm')
|
||||||
|
|
||||||
|
|
||||||
const locale = navigator.language.split('-')[0]
|
const locale = navigator.language.split('-')[0]
|
||||||
const domainEventTranslated = domainEvent()
|
const domainEventTranslated = domainEvent()
|
||||||
|
|
||||||
|
const domainEvents = domain.events.sort((e1, e2) => new Date(e2.date).getTime() - new Date(e1.date).getTime())
|
||||||
|
const expirationEvents = domainEvents.filter(e => e.action === 'expiration')
|
||||||
|
|
||||||
return <Timeline
|
return <Timeline
|
||||||
mode={sm ? "left" : "right"}
|
mode={sm ? "left" : "right"}
|
||||||
items={domain.events
|
items={domainEvents.map(({action, date}) => {
|
||||||
.sort((e1, e2) => new Date(e2.date).getTime() - new Date(e1.date).getTime())
|
|
||||||
.map(({action, date}) => {
|
|
||||||
let dot
|
let dot
|
||||||
if (action === 'registration') {
|
if (action === 'registration') {
|
||||||
dot = <SignatureOutlined style={{fontSize: '16px'}}/>
|
dot = <SignatureOutlined style={{fontSize: '16px'}}/>
|
||||||
@@ -73,7 +73,7 @@ export function EventTimeline({domain}: { domain: Domain }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
color: actionToColor(action),
|
color: (action === 'expiration' ? (expirationEvents.length > 0 && domainEvents[0].date === date) : true) ? actionToColor(action) : 'grey',
|
||||||
dot,
|
dot,
|
||||||
pending: new Date(date).getTime() > new Date().getTime(),
|
pending: new Date(date).getTime() > new Date().getTime(),
|
||||||
...text
|
...text
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ msgid "Reregistration"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: assets/components/search/EventTimeline.tsx:27
|
#: assets/components/search/EventTimeline.tsx:27
|
||||||
msgid "Last changed"
|
msgid "Changed"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: assets/components/search/EventTimeline.tsx:28
|
#: assets/components/search/EventTimeline.tsx:28
|
||||||
|
|||||||
Reference in New Issue
Block a user