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
Fix promo code input styles (#395)
Dave Earley65118fe91182
diff --git a/backend/app/Http/Actions/Auth/LoginAction.php b/backend/app/Http/Actions/Auth/LoginAction.phpindex e5f3b1782..3f0e0efd6 100644--- a/backend/app/Http/Actions/Auth/LoginAction.php+++ b/backend/app/Http/Actions/Auth/LoginAction.php@@ -26,7 +26,7 @@ class LoginAction extends BaseAuthAction$loginResponse = $this->loginHandler->handle(new LoginCredentialsDTO(email: strtolower($request->validated('email')),password: $request->validated('password'),- accountId: $request->validated('account_id'),+ accountId: (int)$request->validated('account_id'),));} catch (UnauthorizedException $e) {return $this->errorResponse(diff --git a/backend/app/Http/Actions/Auth/RefreshTokenAction.php b/backend/app/Http/Actions/Auth/RefreshTokenAction.phpindex 7f40752a3..c21f85011 100644--- a/backend/app/Http/Actions/Auth/RefreshTokenAction.php+++ b/backend/app/Http/Actions/Auth/RefreshTokenAction.php@@ -8,6 +8,6 @@ class RefreshTokenAction extends BaseAuthAction{public function __invoke(): JsonResponse{- return $this->respondWithToken(auth()->refresh(), auth()->user()->accounts);+ return $this->respondWithToken(auth()->refresh(), $this->getAuthenticatedUser()->accounts ?? collect());}}diff --git a/backend/app/Http/Actions/Users/DeactivateUsersAction.php b/backend/app/Http/Actions/Users/DeactivateUsersAction.phpdeleted file mode 100644index fcdc029a6..000000000--- a/backend/app/Http/Actions/Users/DeactivateUsersAction.php+++ /dev/null@@ -1,39 +0,0 @@-<?php--namespace HiEvents\Http\Actions\Users;--use HiEvents\DomainObjects\Enums\Role;-use HiEvents\DomainObjects\Status\UserStatus;-use HiEvents\DomainObjects\UserDomainObject;-use HiEvents\Http\Actions\BaseAction;-use HiEvents\Repository\Interfaces\UserRepositoryInterface;-use Illuminate\Http\Response;--class DeactivateUsersAction extends BaseAction-{- private UserRepositoryInterface $userRepository;-- public function __construct(UserRepositoryInterface $userRepository)- {- $this->userRepository = $userRepository;- }-- public function __invoke(int $userId): Response- {- $this->isActionAuthorized($userId, UserDomainObject::class, Role::ADMIN);-- $authUser = $this->getAuthenticatedUser();-- $this->userRepository->updateWhere(- attributes: [- 'status' => UserStatus::INACTIVE->name,- ],- where: [- 'id' => $authUser->getId(),- 'account_id' => $this->getAuthenticatedAccountId(),- ]- );-- return $this->deletedResponse();- }-}diff --git a/backend/routes/api.php b/backend/routes/api.phpindex 2d951cebe..ac7f25c37 100644--- a/backend/routes/api.php+++ b/backend/routes/api.php@@ -110,7 +110,6 @@ use HiEvents\Http\Actions\Users\CancelEmailChangeAction;use HiEvents\Http\Actions\Users\ConfirmEmailAddressAction;use HiEvents\Http\Actions\Users\ConfirmEmailChangeAction;use HiEvents\Http\Actions\Users\CreateUserAction;-use HiEvents\Http\Actions\Users\DeactivateUsersAction;use HiEvents\Http\Actions\Users\DeleteInvitationAction;use HiEvents\Http\Actions\Users\GetMeAction;use HiEvents\Http\Actions\Users\GetUserAction;@@ -164,7 +163,6 @@ $router->middleware(['auth:api'])->group($router->get('/users', GetUsersAction::class);$router->get('/users/{user_id}', GetUserAction::class);$router->put('/users/{user_id}', UpdateUserAction::class);- $router->delete('/users/{user_id}', DeactivateUsersAction::class);$router->post('/users/{user_id}/email-change/{token}', ConfirmEmailChangeAction::class);$router->post('/users/{user_id}/invitation', ResendInvitationAction::class);$router->delete('/users/{user_id}/invitation', DeleteInvitationAction::class);diff --git a/backend/vapor.yml b/backend/vapor.ymlindex d1872bbcc..5b0524d37 100644--- a/backend/vapor.yml+++ b/backend/vapor.yml@@ -4,7 +4,7 @@ environments:production:gateway-version: 2.0domain: api.hi.events- memory: 1408+ memory: 2048cli-memory: 512runtime: 'php-8.3:al2'warm: 3diff --git a/frontend/src/components/routes/product-widget/SelectProducts/index.tsx b/frontend/src/components/routes/product-widget/SelectProducts/index.tsxindex c57d39a8b..c22a2c60c 100644--- a/frontend/src/components/routes/product-widget/SelectProducts/index.tsx+++ b/frontend/src/components/routes/product-widget/SelectProducts/index.tsx@@ -451,24 +451,34 @@ const SelectProducts = (props: SelectProductsProps) => {</ActionIcon></div>)}++ {(showPromoCodeInput && !form.values.promo_code) && (+ <Group className={'hi-promo-code-input-wrapper'} wrap={'nowrap'} gap={'20px'}>+ {/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}+ {/*@ts-ignore*/}+ <TextInput autoFocus classNames={{input: 'hi-promo-code-input'}} onKeyDown={(event) => {+ if (event.key === 'Enter') {+ event.preventDefault();+ handleApplyPromoCode();+ }+ }} mb={0} ref={promoRef}/>+ <Button disabled={promoCodeEventRefetchMutation.isPending}+ className={'hi-apply-promo-code-button'} variant={'outline'}+ onClick={handleApplyPromoCode}>+ {t`Apply Promo Code`}+ </Button>+ <ActionIcon+ className={'hi-close-promo-code-input-button'}+ variant="transparent"+ aria-label={t`close`}+ title={t`Close`}+ onClick={() => setShowPromoCodeInput(false)}+ >+ <IconX stroke={1.5} size={20}/>+ </ActionIcon>+ </Group>+ )}</div>- {(showPromoCodeInput && !form.values.promo_code) && (- <Group className={'hi-promo-code-input-wrapper'} wrap={'nowrap'} gap={'20px'}>- {/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}- {/*@ts-ignore*/}- <TextInput autoFocus classNames={{input: 'hi-promo-code-input'}} onKeyDown={(event) => {- if (event.key === 'Enter') {- event.preventDefault();- handleApplyPromoCode();- }- }} mb={0} ref={promoRef}/>- <Button disabled={promoCodeEventRefetchMutation.isPending}- className={'hi-apply-promo-code-button'} variant={'outline'}- onClick={handleApplyPromoCode}>- {t`Apply Promo Code`}- </Button>- </Group>- )}{/*** (c) Hi.Events Ltd 2025diff --git a/frontend/src/styles/widget/default.scss b/frontend/src/styles/widget/default.scssindex 14ff30ddf..bf8d1c129 100644--- a/frontend/src/styles/widget/default.scss+++ b/frontend/src/styles/widget/default.scss@@ -177,6 +177,12 @@border: none;}+ .hi-close-promo-code-input-button {+ background-color: var(--widget-secondary-color, var(--tk-primary));+ color: var(--widget-secondary-text-color, var(--tk-color-white));+ border: none;+ }+.hi-promo-code-applied {display: flex;align-items: center;