[] = useMemo(() => {
return [
- {
- header: ({ column }) => ,
- accessorKey: 'name',
- enableSorting: true,
- enableGlobalFilter: true,
- cell: ({
- row: {
- original: { firstName, lastName },
- },
- }) => (
-
- {firstName} {lastName}
-
- ),
- },
- {
- header: ({ column }) => ,
- accessorKey: 'email',
- enableSorting: true,
- },
- {
- header: ({ column }) => ,
- accessorKey: 'tags',
- cell: ({
- row: {
- original: { tags },
- },
- }) => ,
- },
- {
- header: ({ column }) => ,
- accessorKey: 'phoneNumber',
- enableSorting: true,
- },
- {
- header: ({ column }) => ,
- accessorKey: 'status',
- enableSorting: true,
- cell: ({
- row: {
- original: { status },
- },
- }) => {status},
- },
- {
- header: ({ column }) => ,
- accessorKey: 'latestActivityAt',
- enableSorting: true,
- cell: ({
- row: {
- original: { latestActivityAt },
- },
- }) => {latestActivityAt ? format(latestActivityAt, DateTimeFormat) : '-'}
,
- },
- {
- header: '',
- accessorKey: 'action',
- enableSorting: true,
- cell: ({ row }) => (
-
-
-
-
-
- navigateToObserver(row.original.id)}>View
- navigateToEdit(row.original.id)}>Edit
- handleResendInviteToObserver(row.original.id)}>
- Resend invitation email
-
-
-
- ),
- },
- ];}, [currentElectionRoundId]);
+ {
+ header: ({ column }) => ,
+ accessorKey: 'name',
+ enableSorting: true,
+ enableGlobalFilter: true,
+ cell: ({
+ row: {
+ original: { firstName, lastName },
+ },
+ }) => (
+
+ {firstName} {lastName}
+
+ ),
+ },
+ {
+ header: ({ column }) => ,
+ accessorKey: 'email',
+ enableSorting: true,
+ },
+ {
+ header: ({ column }) => ,
+ accessorKey: 'tags',
+ cell: ({
+ row: {
+ original: { tags },
+ },
+ }) => ,
+ },
+ {
+ header: ({ column }) => ,
+ accessorKey: 'phoneNumber',
+ enableSorting: true,
+ },
+ {
+ header: ({ column }) => ,
+ accessorKey: 'status',
+ enableSorting: true,
+ cell: ({
+ row: {
+ original: { status },
+ },
+ }) => {status},
+ },
+ {
+ header: ({ column }) => ,
+ accessorKey: 'latestActivityAt',
+ enableSorting: true,
+ cell: ({
+ row: {
+ original: { latestActivityAt },
+ },
+ }) => {latestActivityAt ? format(latestActivityAt, DateTimeFormat) : '-'}
,
+ },
+ {
+ header: '',
+ accessorKey: 'action',
+ enableSorting: true,
+ cell: ({ row }) => (
+
+
+
+
+
+ navigateToObserver(row.original.id)}>View
+ navigateToEdit(row.original.id)}>Edit
+ handleResendInviteToObserver(row.original.id)}>
+ Resend invitation email
+
+
+
+ ),
+ },
+ ];
+ }, [currentElectionRoundId]);
const [searchText, setSearchText] = useState(search.searchText);
const debouncedSearch = useDebounce(search, 300);
@@ -130,6 +132,7 @@ function MonitoringObserversList() {
const [importErrorsFileId, setImportErrorsFileId] = useState();
const [monitoringObserverId, setMonitoringObserverId] = useState();
+ const createMonitoringObserverDialog = useDialog();
const importMonitoringObserversDialog = useDialog();
const importMonitoringObserverErrorsDialog = useDialog();
const confirmResendInvitesDialog = useDialog();
@@ -155,7 +158,7 @@ function MonitoringObserversList() {
const params = [
['status', debouncedSearch.monitoringObserverStatus],
['tags', debouncedSearch.tags],
- ['searchText', debouncedSearch.searchText]
+ ['searchText', debouncedSearch.searchText],
].filter(([_, value]) => value);
return Object.fromEntries(params);
@@ -184,7 +187,7 @@ function MonitoringObserversList() {
});
},
- onSuccess: (_, {electionRoundId}) => {
+ onSuccess: (_, { electionRoundId }) => {
queryClient.invalidateQueries({ queryKey: monitoringObserversKeys.all(electionRoundId) });
router.invalidate();
@@ -251,19 +254,13 @@ function MonitoringObserversList() {
Monitoring observers list
-
-
-
-
{!!importErrorsFileId && (
)}
+
{
@@ -291,6 +288,12 @@ function MonitoringObserversList() {
Import observer list
+
+
+