diff --git a/assets/components/tracking/connector/ConnectorsList.tsx b/assets/components/tracking/connector/ConnectorsList.tsx
index fe4b7ca..cbc2d8b 100644
--- a/assets/components/tracking/connector/ConnectorsList.tsx
+++ b/assets/components/tracking/connector/ConnectorsList.tsx
@@ -1,13 +1,13 @@
-import {Card, Divider, message, Popconfirm, theme, Typography} from 'antd'
-import {t} from 'ttag'
+import {Card, Divider, message, Popconfirm, Space, theme, Typography} from 'antd'
+import {jt, t} from 'ttag'
import {DeleteFilled} from '@ant-design/icons'
import React from 'react'
import type {Connector} from '../../../utils/api/connectors'
-import { deleteConnector} from '../../../utils/api/connectors'
+import {deleteConnector} from '../../../utils/api/connectors'
const {useToken} = theme
-export type ConnectorElement = Connector & { id: string, createdAt: string }
+export type ConnectorElement = Connector & { id: string, createdAt: string, watchlistCount: number }
export function ConnectorsList({connectors, onDelete}: { connectors: ConnectorElement[], onDelete: () => void }) {
const {token} = useToken()
@@ -19,29 +19,37 @@ export function ConnectorsList({connectors, onDelete}: { connectors: ConnectorEl
return (
<>
- {connectors.map(connector =>
- <>
- {contextHolder}
- {t`Connector ${connector.provider}`}
- }
- size='small'
- style={{width: '100%'}}
- extra={ await onConnectorDelete(connector)}
- okText={t`Yes`}
- cancelText={t`No`}
- >
- }
- >
-
-
-
- >
+ {connectors.map(connector => {
+ const createdAt =
+ {new Date(connector.createdAt).toLocaleString()}
+
+ const {watchlistCount} = connector
+
+ return <>
+ {contextHolder}
+
+ {t`Connector ${connector.provider}`}{connector.id}
+ }
+ size='small'
+ style={{width: '100%'}}
+ extra={ await onConnectorDelete(connector)}
+ okText={t`Yes`}
+ cancelText={t`No`}
+ >
+ }
+ >
+ {jt`Creation date: ${createdAt}`}
+ {t`Used in: ${watchlistCount} Watchlist`}
+
+
+
+ >
+ }
)}
>
)
diff --git a/src/Entity/Connector.php b/src/Entity/Connector.php
index 4143526..74c58b1 100644
--- a/src/Entity/Connector.php
+++ b/src/Entity/Connector.php
@@ -67,6 +67,9 @@ class Connector
#[ORM\Column]
private ?\DateTimeImmutable $createdAt = null;
+ #[Groups(['connector:list'])]
+ protected int $watchlistCount;
+
public function __construct()
{
$this->id = Uuid::v4();
@@ -155,4 +158,9 @@ class Connector
return $this;
}
+
+ public function getWatchlistCount(): ?int
+ {
+ return $this->watchLists->count();
+ }
}
diff --git a/translations/translations.pot b/translations/translations.pot
index b1c0ea3..e97ebcb 100644
--- a/translations/translations.pot
+++ b/translations/translations.pot
@@ -361,29 +361,49 @@ msgid ""
"any Watchlist"
msgstr ""
-#: assets/components/tracking/connector/ConnectorsList.tsx:28
+#: assets/components/tracking/connector/ConnectorsList.tsx:32
#, javascript-format
msgid "Connector ${ connector.provider }"
msgstr ""
-#: assets/components/tracking/connector/ConnectorsList.tsx:33
+#: assets/components/tracking/connector/ConnectorsList.tsx:37
msgid "Delete the Connector"
msgstr ""
-#: assets/components/tracking/connector/ConnectorsList.tsx:34
+#: assets/components/tracking/connector/ConnectorsList.tsx:38
msgid "Are you sure to delete this Connector?"
msgstr ""
-#: assets/components/tracking/connector/ConnectorsList.tsx:36
+#: assets/components/tracking/connector/ConnectorsList.tsx:40
#: assets/components/tracking/watchlist/DeleteWatchlistButton.tsx:16
msgid "Yes"
msgstr ""
-#: assets/components/tracking/connector/ConnectorsList.tsx:37
+#: assets/components/tracking/connector/ConnectorsList.tsx:41
#: assets/components/tracking/watchlist/DeleteWatchlistButton.tsx:17
msgid "No"
msgstr ""
+#: assets/components/tracking/connector/ConnectorsList.tsx:45
+#, javascript-format
+msgid "Creation date: ${ createdAt }"
+msgstr ""
+
+#: assets/components/tracking/connector/ConnectorsList.tsx:46
+#, javascript-format
+msgid "Used in: ${ watchlistCount } Watchlist"
+msgstr ""
+
+#: assets/components/tracking/connector/ConnectorsList.tsx:47
+msgid ""
+"You can stop using a connector at any time. To delete a connector, you must "
+"remove it from each linked Watchlist.\n"
+"The creation date corresponds to the date on which you consented to the "
+"creation of the connector and on which you declared in particular that you "
+"fulfilled the conditions of use of the supplier's API, waived the right of "
+"withdrawal and were of the minimum age to consent to these conditions."
+msgstr ""
+
#: assets/components/tracking/watchlist/CalendarWatchlistButton.tsx:15
msgid "QR Code for iCalendar export"
msgstr ""