Skip to content

Commit 844fa93

Browse files
committed
Increase max order export number
1 parent 2757088 commit 844fa93

File tree

7 files changed

+65
-18
lines changed

7 files changed

+65
-18
lines changed

backend/app/Http/Actions/Orders/ExportOrdersAction.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public function __invoke(int $eventId): BinaryFileResponse
2828
$this->isActionAuthorized($eventId, EventDomainObject::class);
2929

3030
$orders = $this->orderRepository
31+
->setMaxPerPage(10000)
3132
->loadRelation(QuestionAndAnswerViewDomainObject::class)
3233
->findByEventId($eventId, new QueryParamsDTO(
3334
page: 1,

backend/app/Repository/Eloquent/BaseRepository.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ abstract class BaseRepository implements RepositoryInterface
3333

3434
protected DatabaseManager $db;
3535

36+
protected int $maxPerPage = self::MAX_PAGINATE_LIMIT;
37+
3638
/** @var Relationship[] */
3739
protected array $eagerLoads = [];
3840

@@ -50,6 +52,13 @@ public function __construct(Application $application, DatabaseManager $db)
5052
*/
5153
abstract protected function getModel(): string;
5254

55+
public function setMaxPerPage(int $maxPerPage): static
56+
{
57+
$this->maxPerPage = $maxPerPage;
58+
59+
return $this;
60+
}
61+
5362
public function all(array $columns = self::DEFAULT_COLUMNS): Collection
5463
{
5564
return $this->handleResults($this->model->all($columns));
@@ -408,7 +417,7 @@ private function getPaginationPerPage(?int $perPage): int
408417
$perPage = self::DEFAULT_PAGINATE_LIMIT;
409418
}
410419

411-
return (int)min($perPage, self::MAX_PAGINATE_LIMIT);
420+
return (int)min($perPage, $this->maxPerPage);
412421
}
413422

414423
/**

frontend/src/components/common/CheckoutQuestion/index.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Question, QuestionType, Product} from "../../../types.ts";
1+
import {Product, Question, QuestionType} from "../../../types.ts";
22
import {UseFormReturnType} from "@mantine/form";
33
import {Box, Checkbox, ComboboxItem, Group, NativeSelect, Radio, Select, Textarea, TextInput} from "@mantine/core";
44
import {t} from "@lingui/macro";
@@ -69,6 +69,8 @@ const DateInput = ({question, name, form}: QuestionInputProps) => {
6969
type="date"
7070
{...form.getInputProps(`${name}.answer`)}
7171
label={question.title}
72+
description={(
73+
<UserGeneratedContent dangerouslySetInnerHTML={{__html: question.description || ''}}/>)}
7274
/>
7375
</>
7476
);
@@ -146,7 +148,8 @@ const AddressInput = ({question, name, form}: QuestionInputProps) => {
146148
return (
147149
<>
148150
<h4>{question.title}</h4>
149-
<div className={classes.description} dangerouslySetInnerHTML={{__html: question.description || ''}}/>
151+
<UserGeneratedContent className={classes.description}
152+
dangerouslySetInnerHTML={{__html: question.description || ''}}/>
150153

151154
<TextInput withAsterisk={question.required}
152155
{...form.getInputProps(`${name}.address_line_1`)}
@@ -220,11 +223,11 @@ export const CheckoutOrderQuestions = ({questions, form}: CheckoutQuestionProps)
220223
}
221224

222225
export const CheckoutProductQuestions = ({
223-
questions,
224-
form,
225-
product,
226-
index: productIndex
227-
}: CheckoutProductQuestionProps) => {
226+
questions,
227+
form,
228+
product,
229+
index: productIndex
230+
}: CheckoutProductQuestionProps) => {
228231
let questionIndex = 0;
229232
return (
230233
<>

frontend/src/components/common/FilterModal/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ export const FilterModal: React.FC<FilterModalProps> = ({
243243
<Button
244244
variant="light"
245245
onClick={handleReset}
246-
color="red"
247246
disabled={!hasActiveFilters}
248247
>
249248
{t`Reset`}

frontend/src/components/common/ProductSelector/index.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ interface ProductSelectorProps {
1616
includedProductTypes?: ProductType[];
1717
multiSelect?: boolean;
1818
showTierSelector?: boolean;
19+
noProductsMessage?: string;
1920
}
2021

2122
export const ProductSelector = ({
@@ -29,6 +30,7 @@ export const ProductSelector = ({
2930
includedProductTypes = [ProductType.Ticket, ProductType.General],
3031
multiSelect = true,
3132
showTierSelector = false,
33+
noProductsMessage = t`No products available for selection`,
3234
}: ProductSelectorProps) => {
3335
const formattedData = productCategories?.map((category) => ({
3436
group: category.name,
@@ -42,6 +44,17 @@ export const ProductSelector = ({
4244
}));
4345
const eventProducts = productCategories?.flatMap(category => category.products).filter(product => product !== undefined);
4446

47+
if (!eventProducts || eventProducts.length === 0) {
48+
return (
49+
<Select
50+
label={label}
51+
placeholder={noProductsMessage}
52+
disabled
53+
{...form.getInputProps(productFieldName)}
54+
/>
55+
);
56+
}
57+
4558
const TierSelector = () => {
4659
return (
4760
<>

frontend/src/components/layouts/CheckIn/index.tsx

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ import {AxiosError} from "axios";
99
import classes from "./CheckIn.module.scss";
1010
import {ActionIcon, Alert, Button, Loader, Modal, Progress, Stack} from "@mantine/core";
1111
import {SearchBar} from "../../common/SearchBar";
12-
import {IconCreditCard, IconInfoCircle, IconQrcode, IconTicket, IconUserCheck} from "@tabler/icons-react";
12+
import {
13+
IconAlertCircle,
14+
IconCreditCard,
15+
IconInfoCircle,
16+
IconQrcode,
17+
IconTicket,
18+
IconUserCheck
19+
} from "@tabler/icons-react";
1320
import {QRScannerComponent} from "../../common/AttendeeCheckInTable/QrScanner.tsx";
1421
import {useGetCheckInListAttendees} from "../../../queries/useGetCheckInListAttendeesPublic.ts";
1522
import {useCreateCheckInPublic} from "../../../mutations/useCreateCheckInPublic.ts";
@@ -56,7 +63,9 @@ const CheckIn = () => {
5663
const attendees = attendeesQuery?.data?.data;
5764
const checkInMutation = useCreateCheckInPublic(queryFilters);
5865
const deleteCheckInMutation = useDeleteCheckInPublic(queryFilters);
59-
const allowOrdersAwaitingOfflinePaymentToCheckIn = eventSettings?.allow_orders_awaiting_offline_payment_to_check_in;
66+
const areOfflinePaymentsEnabled = eventSettings?.payment_providers?.includes('OFFLINE');
67+
const allowOrdersAwaitingOfflinePaymentToCheckIn = areOfflinePaymentsEnabled
68+
&& eventSettings?.allow_orders_awaiting_offline_payment_to_check_in;
6069

6170
const handleCheckInAction = (attendee: Attendee, action: 'check-in' | 'check-in-and-mark-order-as-paid') => {
6271
checkInMutation.mutate({
@@ -116,7 +125,7 @@ const CheckIn = () => {
116125
}
117126

118127
if (!allowOrdersAwaitingOfflinePaymentToCheckIn && isAttendeeAwaitingPayment) {
119-
showError(t`You cannot check in attendees with unpaid orders.`);
128+
showError(t`You cannot check in attendees with unpaid orders. This setting can be changed in the event settings.`);
120129
return;
121130
}
122131

@@ -148,6 +157,18 @@ const CheckIn = () => {
148157
handleCheckInAction(attendee, 'check-in');
149158
};
150159

160+
const checkInButtonText = (attendee: Attendee) => {
161+
if (!allowOrdersAwaitingOfflinePaymentToCheckIn && attendee.status === 'AWAITING_PAYMENT') {
162+
return t`Cannot Check In`;
163+
}
164+
165+
if (attendee.check_in) {
166+
return t`Check Out`;
167+
}
168+
169+
return t`Check In`;
170+
}
171+
151172
const CheckInOptionsModal = () => {
152173
if (!selectedAttendee) return null;
153174

@@ -162,7 +183,10 @@ const CheckIn = () => {
162183
size="md"
163184
>
164185
<Stack>
165-
<Alert variant={'light'} title={t`Unpaid Order`}>
186+
<Alert
187+
icon={<IconAlertCircle size={20}/>}
188+
variant={'light'}
189+
title={t`Unpaid Order`}>
166190
{t`This attendee has an unpaid order.`}
167191
</Alert>
168192
<Button
@@ -253,9 +277,7 @@ const CheckIn = () => {
253277
}
254278
)()}
255279
>
256-
{attendee.check_in
257-
? t`Check Out`
258-
: allowOrdersAwaitingOfflinePaymentToCheckIn ? t`Check In` : t`Cannot Check In`}
280+
{checkInButtonText(attendee)}
259281
</Button>}
260282
</div>
261283
</div>

frontend/src/components/routes/auth/Register/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ export const Register = () => {
8080
label={t`Password`}
8181
placeholder={t`Your password`}
8282
required mt="md"
83-
mb={10}
83+
mb={20}
8484
/>
8585
<PasswordInput {...form.getInputProps('password_confirmation')}
8686
label={t`Confirm Password`}
8787
placeholder={t`Confirm password`}
8888
required
8989
mt="md"
90-
mb={10}
90+
mb={20}
9191
/>
9292
</InputGroup>
9393
<TextInput

0 commit comments

Comments
 (0)