diff --git a/backend/app/Repository/Eloquent/AttendeeRepository.php b/backend/app/Repository/Eloquent/AttendeeRepository.php index 0f4e7bddf..a65aa4c5e 100644 --- a/backend/app/Repository/Eloquent/AttendeeRepository.php +++ b/backend/app/Repository/Eloquent/AttendeeRepository.php @@ -7,7 +7,6 @@ use HiEvents\DomainObjects\Generated\AttendeeDomainObjectAbstract; use HiEvents\DomainObjects\Status\AttendeeStatus; use HiEvents\DomainObjects\Status\OrderStatus; -use HiEvents\Http\DTO\FilterFieldDTO; use HiEvents\Http\DTO\QueryParamsDTO; use HiEvents\Models\Attendee; use HiEvents\Repository\Eloquent\Value\Relationship; diff --git a/frontend/src/components/common/AttendeeTable/index.tsx b/frontend/src/components/common/AttendeeTable/index.tsx index 734a89dcf..be6d4119c 100644 --- a/frontend/src/components/common/AttendeeTable/index.tsx +++ b/frontend/src/components/common/AttendeeTable/index.tsx @@ -1,9 +1,19 @@ -import {Anchor, Avatar, Badge, Button, Table as MantineTable, Tooltip, ActionIcon, Popover, Group} from '@mantine/core'; -import {Attendee, MessageType} from "../../../types.ts"; -import {IconMailForward, IconPlus, IconSend, IconTrash, IconUserCog, IconQrcode, IconNote, IconCopy} from "@tabler/icons-react"; +import {ActionIcon, Anchor, Avatar, Badge, Button, Group, Popover, Table as MantineTable, Tooltip} from '@mantine/core'; +import {Attendee, IdParam, MessageType} from "../../../types.ts"; +import { + IconCopy, + IconMailForward, + IconNote, + IconPlus, + IconQrcode, + IconQrcodeOff, + IconSend, + IconTrash, + IconUserCog +} from "@tabler/icons-react"; import {getInitials, getProductFromEvent} from "../../../utilites/helpers.ts"; import {Table, TableHead} from "../Table"; -import {useDisclosure, useClipboard} from "@mantine/hooks"; +import {useClipboard, useDisclosure} from "@mantine/hooks"; import {SendMessageModal} from "../../modals/SendMessageModal"; import {useState} from "react"; import {NoResultsSplash} from "../NoResultsSplash"; @@ -22,7 +32,6 @@ import {ActionMenu} from '../ActionMenu'; import {AttendeeStatusBadge} from "../AttendeeStatusBadge"; import {CheckInStatusModal} from "../CheckInStatusModal"; import {prettyDate} from "../../../utilites/dates.ts"; -import {IdParam} from "../../../types.ts"; interface AttendeeTableProps { attendees: Attendee[]; @@ -116,7 +125,7 @@ export const AttendeeTable = ({attendees, openCreateModal}: AttendeeTableProps) return getCheckInCount(attendee) > 0; }; - const handleCopyEmail = (email: string, attendeeId: number | undefined) => { + const handleCopyEmail = (email: string) => { clipboard.copy(email); showSuccess(t`Email address copied to clipboard`); setEmailPopoverId(null); @@ -202,7 +211,7 @@ export const AttendeeTable = ({attendees, openCreateModal}: AttendeeTableProps) variant="light" color="gray" leftSection={} - onClick={() => handleCopyEmail(attendee.email, attendee.id)} + onClick={() => handleCopyEmail(attendee.email)} > {t`Copy Email`} @@ -253,7 +262,8 @@ export const AttendeeTable = ({attendees, openCreateModal}: AttendeeTableProps) onClick={() => handleModalClick(attendee, checkInModal)} aria-label={t`View check-in status`} > - + {!hasChecked && } + {hasChecked && } {hasChecked && ( { const [downloadPending, setDownloadPending] = useState(false); const {data: event} = useGetEvent(eventId); - const productOptions = getProductsFromEvent(event)?.flatMap(product => { + const productOptions = getProductsFromEvent(event) + ?.filter(product => product.product_type === ProductType.Ticket) + ?.flatMap(product => { const options = []; options.push({ diff --git a/frontend/src/utilites/helpers.ts b/frontend/src/utilites/helpers.ts index 656368bf5..02ee5a864 100644 --- a/frontend/src/utilites/helpers.ts +++ b/frontend/src/utilites/helpers.ts @@ -1,4 +1,4 @@ -import {Event} from "../types.ts"; +import {Event, Product} from "../types.ts"; import {MantineColor} from "@mantine/core"; import {getConfig} from "./config.ts"; @@ -28,7 +28,7 @@ export const getInitials = (fullName: string) => { }, ''); }; -export const getProductsFromEvent = (event?: Event) => { +export const getProductsFromEvent = (event?: Event): Product[] | undefined => { return event?.product_categories?.flatMap(category => category.products).filter(product => product !== undefined); }