From 4e10e21bc30cdd0f7e49f7e439dc92ba582129b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Landr=C3=A9?= Date: Thu, 5 Sep 2024 15:50:02 +0200 Subject: [PATCH 01/14] fix: front questions link --- src/app/help/page.tsx | 2 +- src/app/help/style.module.scss | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/help/page.tsx b/src/app/help/page.tsx index 82ed03bf..e76ac158 100644 --- a/src/app/help/page.tsx +++ b/src/app/help/page.tsx @@ -273,7 +273,7 @@ const Help = () => { .normalize('NFD') .replace(/[\u0300-\u036f]/g, '')}-${index}` }> -

{question.answer}

+
{question.answer}
))} diff --git a/src/app/help/style.module.scss b/src/app/help/style.module.scss index f96b9886..2b679d84 100644 --- a/src/app/help/style.module.scss +++ b/src/app/help/style.module.scss @@ -29,6 +29,10 @@ font-family: $kanit; margin: 1rem 0; } + + .answer { + padding-bottom: 0.5rem; + } } } } From 876947016d83ad6a53036bd82791d5647234e584 Mon Sep 17 00:00:00 2001 From: Antoine Dufils Date: Mon, 9 Sep 2024 13:15:41 +0200 Subject: [PATCH 02/14] fix: Change favicon.ico --- public/favicon.ico | Bin 15086 -> 2324 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/public/favicon.ico b/public/favicon.ico index 988dc185f3c2cdd883db20ac5e7a370b7ad308eb..a9a9130409461d5da1d1a8696ebd0b73898bd8c9 100644 GIT binary patch literal 2324 zcmV+v3G4O%0096205C8B0096X0R9L702TlM0EtjeM-2)Z3IG5A4M|8uQUCw|FaQ7m zFbD5`b{v`3qOf*8?&s9_0~3Is7OBy0k* z3ep&MkbOr4EGWaG28JzcGJvcz3^NSOn*~7@Sp+0Nl3G&jlA5NrCy`WYtjO*Co->x5 z#NZ%9{wVjH-+AzucjtG%d*9tyv0_=4Wm%Sm$cC3}o>N(CwH~o`>nl#%@cJr31Mwna z{!`_4BKSKaPKrefe+1=)f zVf4a$&-Q#Idj5DXdp|xmE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;QLl*A)>EH!tsXNcDOt=~6W?g(! ze*ffb*|)Om;Z`N_?p=z7jK!uAT?|JL?Y$UvWdDV?d~NloWL%zK*%YDmnf#nX31 z?)+fG?RhKW Date: Mon, 9 Sep 2024 13:52:17 +0200 Subject: [PATCH 03/14] fix: change issues --- src/app/help/page.tsx | 5 +++++ src/app/tournaments/[id]/content.tsx | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/app/help/page.tsx b/src/app/help/page.tsx index e76ac158..80acabe5 100644 --- a/src/app/help/page.tsx +++ b/src/app/help/page.tsx @@ -241,6 +241,11 @@ const Help = () => { setEmail(''); setMessage(''); setSubject(''); + + if (user) { + setName(user.firstname + ' ' + user.lastname); + setEmail(user.email); + } } }; diff --git a/src/app/tournaments/[id]/content.tsx b/src/app/tournaments/[id]/content.tsx index dd237c20..35b8164d 100644 --- a/src/app/tournaments/[id]/content.tsx +++ b/src/app/tournaments/[id]/content.tsx @@ -9,7 +9,7 @@ import TournamentSwitcherAnimation from '@/components/landing/TournamentSwitcher import { useEffect, useState } from 'react'; import { useAppDispatch, useAppSelector } from '@/lib/hooks'; // import Table from '@/components/UI/Table'; -import { getTournamentBackgroundLink } from '@/utils/uploadLink'; +import { getTournamentBackgroundLink, getTournamentRulesLink } from '@/utils/uploadLink'; import { IconName } from '@/components/UI/Icon'; import logoUA from '@/../public/images/logo-notext.webp'; import FillingBar from '@/components/UI/FillingBar'; @@ -56,11 +56,11 @@ export function TournamentInformation({ tournamentId, animate = true }: { tourna {tournament.name} - {/*{loginAllowed && ( + {loginAllowed && ( - )}*/} + )}
Date: Tue, 10 Sep 2024 18:07:43 +0200 Subject: [PATCH 04/14] UA rules open new window --- src/app/(dashboard)/dashboard/register/page.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/(dashboard)/dashboard/register/page.tsx b/src/app/(dashboard)/dashboard/register/page.tsx index bac21309..714a0db5 100644 --- a/src/app/(dashboard)/dashboard/register/page.tsx +++ b/src/app/(dashboard)/dashboard/register/page.tsx @@ -275,8 +275,11 @@ const Register = () => { <> En cochant cette case je certifie avoir lu et accepté{' '} {userType !== UserType.spectator && 'le règlement du tournoi (disponible sur la page du tournoi), '}{' '} - le règlement de l'UTT Arena et autorise la prise de vue - comme indiqué dans celui-ci + le{' '} + + règlement de l'UTT Arena + {' '} + et autorise la prise de vue comme indiqué dans celui-ci } value={acceptedRules} From b3be5dcad6511226c178a14a6fa0fad7eb4caaba Mon Sep 17 00:00:00 2001 From: Antoine D <106921102+Suboyyy@users.noreply.github.com> Date: Thu, 12 Sep 2024 01:26:24 +0200 Subject: [PATCH 05/14] Fix/items logo (#375) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix/adding logo for items * fix: null attribute if empty * pnpm lint * fix: display logo * fix: build * fix: build 2.0 --------- Co-authored-by: Antoine Dufils Co-authored-by: Antoine D Co-authored-by: Noé Landré <68849024+DevNono@users.noreply.github.com> --- src/app/(dashboard)/admin/shop/page.tsx | 3 ++- src/app/(dashboard)/dashboard/shop/page.tsx | 9 +++++---- src/components/dashboard/Cart.stories.tsx | 2 +- src/components/dashboard/ItemModal.tsx | 15 +++++++-------- .../dashboard/SupplementList.stories.tsx | 2 +- src/components/dashboard/SupplementList.tsx | 4 ++-- src/modules/admin.ts | 9 ++++++++- src/types.ts | 2 +- src/utils/uploadLink.ts | 10 ++++++++++ 9 files changed, 37 insertions(+), 19 deletions(-) diff --git a/src/app/(dashboard)/admin/shop/page.tsx b/src/app/(dashboard)/admin/shop/page.tsx index 6cd113ea..5d95ef7a 100644 --- a/src/app/(dashboard)/admin/shop/page.tsx +++ b/src/app/(dashboard)/admin/shop/page.tsx @@ -6,6 +6,7 @@ import { AdminItem } from '@/types'; import { useEffect, useRef, useState } from 'react'; import styles from './style.module.scss'; import { fetchAdminItems, reorderItems } from '@/modules/admin'; +import { getItemLogoLink } from '@/utils/uploadLink'; const Shop = () => { const shopItems = useAppSelector((state) => state.admin.items); @@ -27,7 +28,7 @@ const Shop = () => { shopItems?.map((item, index) => ( { if ((e!.target as ChildNode).parentElement?.parentElement?.classList.contains('dragging')) return; diff --git a/src/app/(dashboard)/dashboard/shop/page.tsx b/src/app/(dashboard)/dashboard/shop/page.tsx index 18b8fa45..f9c0b34d 100644 --- a/src/app/(dashboard)/dashboard/shop/page.tsx +++ b/src/app/(dashboard)/dashboard/shop/page.tsx @@ -14,6 +14,7 @@ import { getTicketPrice } from '@/modules/users'; import { useAppDispatch, useAppSelector } from '@/lib/hooks'; import { AttendantInfo, CartItem, Item, Permission, User, UserAge, UserType } from '@/types'; import { IconName } from '@/components/UI/Icon'; +import { getItemLogoLink } from '@/utils/uploadLink'; // Hello there ! This is a big file (and it's not the only one :P), I commented it as well as I could, I hope you'll understand :) @@ -42,8 +43,8 @@ const Shop = () => { // The item that is beeing previewed. This is a string containing the relative path to the image, starting from public/ // If itemPreview is null, then there is nothing to preview, and thus the modal for the preview is not displayed const [itemPreview, setItemPreview] = useState<{ - image: string; visible: boolean; + id: string; } | null>(null); // The members of the team who didn't buy a ticket const [teamMembersWithoutTicket, setTeamMembersWithoutTicket] = useState([]); @@ -282,8 +283,8 @@ const Shop = () => { // Callback of SupplementList. It is called when the user wants to preview an item // newItemPreview is the new value of itemPreview. - const onItemPreview = (newItemPreview: string) => { - setItemPreview({ image: newItemPreview, visible: true }); + const onItemPreview = (id: string) => { + setItemPreview({ id: id, visible: true }); }; // Called when the user clicks on the pay button @@ -428,7 +429,7 @@ const Shop = () => { {itemPreview && ( Preview image diff --git a/src/components/dashboard/Cart.stories.tsx b/src/components/dashboard/Cart.stories.tsx index 966a1f3e..c603ce05 100644 --- a/src/components/dashboard/Cart.stories.tsx +++ b/src/components/dashboard/Cart.stories.tsx @@ -34,7 +34,7 @@ export const Default: Story = { id: '1', name: 'Item 1', price: 100, - image: 'https://via.placeholder.com/150', + image: true, infos: 'test', left: 10, }, diff --git a/src/components/dashboard/ItemModal.tsx b/src/components/dashboard/ItemModal.tsx index 530c2930..1116a73a 100644 --- a/src/components/dashboard/ItemModal.tsx +++ b/src/components/dashboard/ItemModal.tsx @@ -1,8 +1,9 @@ import { useState } from 'react'; -import { Modal, Button, Input, Textarea, Checkbox, Select } from '@/components/UI'; +import { Modal, Button, Input, Textarea, Checkbox, Select, FileInput } from '@/components/UI'; import { useAppDispatch } from '@/lib/hooks'; import { AdminItem } from '@/types'; import { updateItem } from '@/modules/admin'; +import { getItemLogoLink } from '@/utils/uploadLink'; /** The partner modal */ const ItemModal = ({ @@ -23,6 +24,7 @@ const ItemModal = ({ const [endDate, setEndDate] = useState(item?.availableUntil || null); const [quantity, setQuantity] = useState(item?.stock || null); const [infos, setInfos] = useState(item?.infos || null); + const [logo, setLogo] = useState(null); const [display, setDisplay] = useState(item?.display || false); const [attribute, setAttribute] = useState(item?.attribute || null); @@ -59,7 +61,7 @@ const ItemModal = ({ id: id ?? '', name: name ?? '', category: category ?? '', - attribute: attribute ?? '', + attribute: attribute ? attribute : null, price: price ?? 0, reducedPrice: reducedPrice ?? 0, availableFrom: startDate ?? '', @@ -67,15 +69,11 @@ const ItemModal = ({ // we update the stock through a difference between the current stock and the quantity in order to avoid conflicts if an order is made at the same time left: quantity! - item!.stock! ?? item!.stock!, infos: infos ?? '', - display, + display: display ?? false, } as AdminItem; - if (attribute === '') { - delete body.attribute; - } - dispatch( - updateItem(body, () => { + updateItem(body, logo, () => { onClose!(); }), ); @@ -125,6 +123,7 @@ const ItemModal = ({ onChange={(value) => setQuantity(value as unknown as number)} />