Skip to content

Commit

Permalink
Merge pull request #272 from HiEventsDev/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
daveearley authored Oct 29, 2024
2 parents f465578 + c85050a commit 1e71d2b
Show file tree
Hide file tree
Showing 16 changed files with 65 additions and 298 deletions.
1 change: 1 addition & 0 deletions backend/config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
],

'email_logo_url' => env('APP_EMAIL_LOGO_URL'),
'email_logo_link_url' => env('APP_EMAIL_LOGO_LINK_URL', env('APP_FRONTEND_URL', 'http://localhost')),
'email_footer_text' => env('APP_EMAIL_FOOTER_TEXT'),

/*
Expand Down
1 change: 0 additions & 1 deletion backend/database/migrations/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ create table if not exists tickets
deleted_at timestamp,
type varchar(20) default 'PAID'::character varying not null,
is_hidden boolean default false,
start_collapsed boolean default false,
primary key (id),
constraint fk_tickets_event_id
foreign key (event_id) references events
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
{{ __('If you have any questions or need assistance, please reply to this email or contact the event organizer') }}
{{ __('at') }} <a href="mailto:{{$eventSettings->getSupportEmail()}}">{{$eventSettings->getSupportEmail()}}</a>.

{{ __('Best regards,') }}
<br>
{{config('app.name')}}
{{ __('Best regards,') }}<br>
{{ config('app.name') }}

<script type="application/ld+json">
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{{ __('If you have any questions or need assistance, please respond to this email.') }}
<br><br>
{{ __('Thank you') }},<br>
{{config('app.name')}}
{{ config('app.name') }}

{!! $eventSettings->getGetEmailFooterHtml() !!}
</x-mail::message>
5 changes: 2 additions & 3 deletions backend/resources/views/emails/orders/order-failed.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
{{ __('If you have any questions or need assistance, feel free to reach out to our support team') }}
{{ __('at') }} {{ $supportEmail ?? '[email protected]' }}.

{{ __('Best regards') }},
<br>
{{config('app.name')}}
{{ __('Best regards') }},<br>
{{ config('app.name') }}

{!! $eventSettings->getGetEmailFooterHtml() !!}
</x-mail::message>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

{{ __('You have received a refund of :refundAmount for the following event: :eventTitle.', ['refundAmount' => $refundAmount, 'eventTitle' => $event->getTitle()]) }}

{{ __('Thank you') }}
{{ __('Thank you') }},<br>
{{ config('app.name') }}

{!! $eventSettings->getGetEmailFooterHtml() !!}
</x-mail::message>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</x-mail::button>

{{ __('Best regards') }},<br>
{{ __('Hi.Events') }}
{{ config('app.name') }}

{!! $eventSettings->getGetEmailFooterHtml() !!}
</x-mail::message>
3 changes: 1 addition & 2 deletions backend/resources/views/emails/orders/summary.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
- **{{ __('Prepare for the Event:') }}** {{ __('Make sure to note the event date, time, and location.') }}
- **{{ __('Stay Updated:') }}** {{ __('Keep an eye on your email for any updates from the event organizer.') }}

{{ __('Best regards,') }}
<br>
{{ __('Best regards,') }}<br>
{{ config('app.name') }}
</x-mail::message>
7 changes: 3 additions & 4 deletions backend/resources/views/vendor/mail/html/message.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<x-mail::layout>
{{-- Header --}}
<x-slot:header>
<x-mail::header :url="config('app.frontend_url')">
<x-mail::header :url="config('app.email_logo_link_url')">
@if($appLogo = config('app.email_logo_url'))
<img src="{{ $appLogo }}" class="logo" alt="{{ config('app.name') }}"
style="max-width: 300px;">
Expand Down Expand Up @@ -36,9 +36,8 @@
{{-- You can find the full license text at: https://github.com/HiEventsDev/hi.events/blob/main/LICENSE --}}
{{-- In accordance with Section 7(b) of the AGPL, we ask that you retain the "Powered by Hi.Events" notice. --}}
{{-- If you wish to remove this notice, a commercial license is available at: https://hi.events/licensing --}}
© {{ date('Y') }} <a title="Manage events and sell tickets online with Hi.Events"
href="https://hi.events?utm_source=app-email-footer">Hi.Events</a> - Effortless
Event Management

© {{ date('Y') }} {{ config('app.name') }} | Powered by <a title="Manage events and sell tickets online with Hi.Events" href="https://hi.events?utm_source=app-email-footer">Hi.Events</a>
@endif
</x-mail::footer>
</x-slot:footer>
Expand Down
8 changes: 7 additions & 1 deletion docker/all-in-one/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@ services:
- DATABASE_URL=postgresql://postgres:secret@postgres:5432/hi-events

depends_on:
- postgres
postgres:
condition: service_healthy

postgres:
image: postgres:latest
container_name: postgres
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 10s
timeout: 5s
retries: 5
environment:
POSTGRES_DB: hi-events
POSTGRES_USER: postgres
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
position: absolute;
animation: colorfulBorder 10s infinite;
border-radius: 10px;
outline: solid 50vmax #472e7840;
outline: solid 50vmax rgb(71 46 120 / 50%);
transition: outline-color .2s ease-out;
min-width: 200px;
min-height: 200px;

Expand All @@ -72,6 +73,18 @@
}
}

.scannerOverlay.success {
outline: solid 50vmax rgb(80 148 80 / 75%);
}

.scannerOverlay.failure {
outline: solid 50vmax rgb(193 72 72 / 75%);
}

.scannerOverlay.checkingIn {
outline: solid 50vmax rgb(172 158 85 / 60%);
}

video {
width: 100vw !important;
height: 100vh !important;
Expand Down
32 changes: 28 additions & 4 deletions frontend/src/components/common/AttendeeCheckInTable/QrScanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {showError} from "../../../utilites/notifications.tsx";
import {t, Trans} from "@lingui/macro";

interface QRScannerComponentProps {
onCheckIn: (attendeePublicId: string, onRequestComplete: () => void, onFailure: () => void) => void;
onCheckIn: (attendeePublicId: string, onRequestComplete: (didSucceed: boolean) => void, onFailure: () => void) => void;
onClose: () => void;
}

Expand All @@ -25,7 +25,9 @@ export const QRScannerComponent = (props: QRScannerComponentProps) => {
const latestProcessedAttendeeIdsRef = useRef<string[]>([]);

const [currentAttendeeId, setCurrentAttendeeId] = useState<string | null>(null);
const [debouncedAttendeeId] = useDebouncedValue(currentAttendeeId, 500);
const [debouncedAttendeeId] = useDebouncedValue(currentAttendeeId, 1000);
const [isScanFailed, setIsScanFailed] = useState(false);
const [isScanSucceeded, setIsScanSucceeded] = useState(false);

useEffect(() => {
latestProcessedAttendeeIdsRef.current = processedAttendeeIds;
Expand Down Expand Up @@ -54,17 +56,39 @@ export const QRScannerComponent = (props: QRScannerComponentProps) => {
const latestProcessedAttendeeIds = latestProcessedAttendeeIdsRef.current;
const alreadyScanned = latestProcessedAttendeeIds.includes(debouncedAttendeeId);

if (isScanSucceeded || isScanFailed) {
return;
}

if (alreadyScanned) {
showError(t`You already scanned this ticket`);

setIsScanFailed(true);
setInterval(function() {
setIsScanFailed(false);
}, 500);

return;
}

if (!isCheckingIn && !alreadyScanned) {
setIsCheckingIn(true);
props.onCheckIn(debouncedAttendeeId, () => {
props.onCheckIn(debouncedAttendeeId, (didSucceed) => {
setIsCheckingIn(false);
setProcessedAttendeeIds(prevIds => [...prevIds, debouncedAttendeeId]);
setCurrentAttendeeId(null);

if (didSucceed) {
setIsScanSucceeded(true);
setInterval(function() {
setIsScanSucceeded(false);
}, 500);
} else {
setIsScanFailed(true);
setInterval(function() {
setIsScanFailed(false);
}, 500);
}
}, () => {
setIsCheckingIn(false);
setCurrentAttendeeId(null);
Expand Down Expand Up @@ -178,7 +202,7 @@ export const QRScannerComponent = (props: QRScannerComponentProps) => {
</Menu.Dropdown>
</Menu>
</Button>
<div className={classes.scannerOverlay}/>
<div className={`${classes.scannerOverlay} ${isScanSucceeded ? classes.success : ""} ${isScanFailed ? classes.failure : ""} ${isCheckingIn ? classes.checkingIn : ""}`}/>
</div>
);
};
Loading

0 comments on commit 1e71d2b

Please sign in to comment.