Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion backend/app/Repository/Eloquent/AttendeeRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
26 changes: 18 additions & 8 deletions frontend/src/components/common/AttendeeTable/index.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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[];
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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 && (
<Badge
size="xs"
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/components/routes/event/attendees.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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({
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/utilites/helpers.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand Down Expand Up @@ -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);
}

Expand Down
Loading