Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️
PHP attendize-alternativedoor-managementevent-check-inevent-managementevent-registrationevent-ticketingeventbrite-alternativeeventslaravelopen-sourcephpreactself-hostedsell-ticketssell-tickets-onlineticket-sellingticketing-systemtickettailor-alternativetito-alternative
Chore: Attendee table cleanup (#899)
Dave Earley2855efefd7e7
diff --git a/backend/app/Repository/Eloquent/AttendeeRepository.php b/backend/app/Repository/Eloquent/AttendeeRepository.phpindex 0f4e7bddf..a65aa4c5e 100644--- a/backend/app/Repository/Eloquent/AttendeeRepository.php+++ b/backend/app/Repository/Eloquent/AttendeeRepository.php@@ -7,7 +7,6 @@ use HiEvents\DomainObjects\AttendeeDomainObject;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.tsxindex 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={<IconCopy size={16}/>}- onClick={() => handleCopyEmail(attendee.email, attendee.id)}+ onClick={() => handleCopyEmail(attendee.email)}>{t`Copy Email`}</Button>@@ -253,7 +262,8 @@ export const AttendeeTable = ({attendees, openCreateModal}: AttendeeTableProps)onClick={() => handleModalClick(attendee, checkInModal)}aria-label={t`View check-in status`}>- <IconQrcode size={18}/>+ {!hasChecked && <IconQrcodeOff size={18}/>}+ {hasChecked && <IconQrcode size={18}/>}{hasChecked && (<Badgesize="xs"diff --git a/frontend/src/components/routes/event/attendees.tsx b/frontend/src/components/routes/event/attendees.tsxindex 3958d7642..ddd601ccf 100644--- a/frontend/src/components/routes/event/attendees.tsx+++ b/frontend/src/components/routes/event/attendees.tsx@@ -10,7 +10,7 @@ import {IconDownload, IconPlus} from "@tabler/icons-react";import {ToolBar} from "../../common/ToolBar";import {TableSkeleton} from "../../common/TableSkeleton";import {useFilterQueryParamSync} from "../../../hooks/useFilterQueryParamSync.ts";-import {IdParam, QueryFilters, QueryFilterOperator} from "../../../types.ts";+import {IdParam, QueryFilters, QueryFilterOperator, ProductType} from "../../../types.ts";import {useDisclosure} from "@mantine/hooks";import {CreateAttendeeModal} from "../../modals/CreateAttendeeModal";import {downloadBinary} from "../../../utilites/download.ts";@@ -38,7 +38,9 @@ const Attendees = () => {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.tsindex 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);}