Skip to content

Commit

Permalink
chore: simplify the Watchlist component
Browse files Browse the repository at this point in the history
  • Loading branch information
maelgangloff committed Dec 29, 2024
1 parent 16e3d3b commit f861530
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
23 changes: 10 additions & 13 deletions assets/components/tracking/watchlist/WatchlistCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Card, Divider, Space, Table, Tag, Tooltip} from "antd";
import {Card, Col, Divider, Row, Space, Tag, Tooltip} from "antd";
import {DisconnectOutlined, LinkOutlined} from "@ant-design/icons";
import {t} from "ttag";
import {ViewDiagramWatchlistButton} from "./diagram/ViewDiagramWatchlistButton";
Expand Down Expand Up @@ -72,24 +72,21 @@ export function WatchlistCard({watchlist, onUpdateWatchlist, connectors, onDelet
}
>
<Card.Meta description={watchlist.token} style={{marginBottom: '1em'}}/>
<Table
size='small'
columns={columns}
pagination={false}
style={{width: '100%'}}
dataSource={[{
domains: watchlist.domains.map(d => <DomainToTag domain={d}/>),
events: watchlist.triggers?.filter(t => t.action === 'email')
<Row gutter={16}>
<Col span={16}>
{watchlist.domains.map(d => <DomainToTag domain={d}/>)}
</Col>
<Col span={8}>
{watchlist.triggers?.filter(t => t.action === 'email')
.map(t => <Tooltip
title={t.event in rdapEventDetailTranslated ? rdapEventDetailTranslated[t.event as keyof typeof rdapEventDetailTranslated] : undefined}>
<Tag color={actionToColor(t.event)}>
{rdapEventNameTranslated[t.event as keyof typeof rdapEventNameTranslated]}
</Tag>
</Tooltip>
)
}]}
{...(sm ? {scroll: {y: 'max-content'}} : {scroll: {y: 240}})}
/>
)}
</Col>
</Row>
</Card>
<Divider/>
</>
Expand Down
2 changes: 1 addition & 1 deletion src/Service/RDAPService.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ private function getTld($domain): ?object
$tld = strtolower(idn_to_ascii(substr($domain, $lastDotPosition + 1)));
$tldEntity = $this->tldRepository->findOneBy(['tld' => $tld]);
if (null === $tldEntity) {
throw new NotFoundHttpException("The requested TLD is not yet supported, please try again with another one");
throw new NotFoundHttpException('The requested TLD is not yet supported, please try again with another one');
}

return $tldEntity;
Expand Down
8 changes: 4 additions & 4 deletions translations/translations.pot
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ msgstr ""
#: assets/components/LoginForm.tsx:62
#: assets/components/RegisterForm.tsx:41
#: assets/components/RegisterForm.tsx:49
#: assets/components/search/DomainSearchBar.tsx:20
#: assets/components/search/DomainSearchBar.tsx:21
#: assets/components/tracking/connector/ConnectorForm.tsx:43
#: assets/components/tracking/connector/ConnectorForm.tsx:69
#: assets/components/tracking/connector/ConnectorForm.tsx:77
Expand Down Expand Up @@ -109,7 +109,7 @@ msgstr ""
msgid "Entities"
msgstr ""

#: assets/components/search/DomainSearchBar.tsx:23
#: assets/components/search/DomainSearchBar.tsx:24
#: assets/components/tracking/watchlist/WatchlistForm.tsx:118
msgid "This domain name does not appear to be valid"
msgstr ""
Expand Down Expand Up @@ -514,11 +514,11 @@ msgstr ""
msgid "Sorry, the page you visited does not exist."
msgstr ""

#: assets/pages/search/DomainSearchPage.tsx:28
#: assets/pages/search/DomainSearchPage.tsx:24
msgid "Found !"
msgstr ""

#: assets/pages/search/DomainSearchPage.tsx:44
#: assets/pages/search/DomainSearchPage.tsx:46
msgid ""
"Although the domain exists in my database, it has been deleted from the "
"WHOIS by its registrar."
Expand Down

0 comments on commit f861530

Please sign in to comment.