From 23ba3091667df9f26af36a293c3e49fb98063c19 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Thu, 28 Jul 2022 23:51:31 +0300 Subject: [PATCH] Don't add Badge prizes tag in seeding --- TODO.md | 1 + app/db/models/calendar.server.ts | 2 +- app/db/seed.ts | 2 +- app/routes/calendar/$id.tsx | 2 +- app/routes/calendar/tags.json | 2 +- public/locales/en/calendar.json | 4 ++-- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/TODO.md b/TODO.md index 0ec85a497..161e5db88 100644 --- a/TODO.md +++ b/TODO.md @@ -20,6 +20,7 @@ Calendar ## Other +- [ ] Event page layout shift with time not taking space before mount (only if one day) - [x] WeekLinks make opaque blocks not take space on mobile - [x] Type problem with Avatar - [x] Maybe classNames that do nothing on calendar event page? diff --git a/app/db/models/calendar.server.ts b/app/db/models/calendar.server.ts index 07f8aaa6b..67f7d3ca6 100644 --- a/app/db/models/calendar.server.ts +++ b/app/db/models/calendar.server.ts @@ -45,7 +45,7 @@ function addTagArray< const { hasBadge, ...row } = arg; const tags = (row.tags ? row.tags.split(",") : []) as Array; - if (hasBadge) tags.push("BADGE_PRIZE"); + if (hasBadge) tags.push("BADGE"); return { ...row, tags }; } diff --git a/app/db/seed.ts b/app/db/seed.ts index 6fb43fe13..d65c4c4ed 100644 --- a/app/db/seed.ts +++ b/app/db/seed.ts @@ -321,7 +321,7 @@ function calendarEvents() { .map((u) => u.id); for (let id = 1; id <= AMOUNT_OF_CALENDAR_EVENTS; id++) { - const tags = shuffle(Object.keys(allTags)); + const tags = shuffle(Object.keys(allTags)).filter((tag) => tag !== "BADGE"); sql .prepare( diff --git a/app/routes/calendar/$id.tsx b/app/routes/calendar/$id.tsx index 767d4d3fd..32ea92ddf 100644 --- a/app/routes/calendar/$id.tsx +++ b/app/routes/calendar/$id.tsx @@ -131,7 +131,7 @@ function PrizeBadges() { return (
Win!
diff --git a/app/routes/calendar/tags.json b/app/routes/calendar/tags.json index ef327c24f..072c41237 100644 --- a/app/routes/calendar/tags.json +++ b/app/routes/calendar/tags.json @@ -1,5 +1,5 @@ { - "BADGE_PRIZE": { + "BADGE": { "color": "#FDFD96" }, "SPECIAL": { diff --git a/public/locales/en/calendar.json b/public/locales/en/calendar.json index 76bc9501f..ff4f6c554 100644 --- a/public/locales/en/calendar.json +++ b/public/locales/en/calendar.json @@ -1,5 +1,5 @@ { - "tag.name.BADGE_PRIZE": "Badge prize", + "tag.name.BADGE": "Badge prizes", "tag.name.SPECIAL": "Special rules", "tag.name.ART": "Art prizes", "tag.name.MONEY": "Money prizes", @@ -8,7 +8,7 @@ "tag.name.COUNT": "Entry limit", "tag.name.LAN": "LAN", "tag.name.QUALIFIER": "Qualifier", - "tag.desc.BADGE_PRIZE": "Winner of this event gets a sendou.ink badge.", + "tag.desc.BADGE": "Winner of this event gets a sendou.ink badge.", "tag.desc.SPECIAL": "Ruleset that differ from the standard e.g. limited what weapons can be used.", "tag.desc.ART": "You can win art by playing in this tournament.", "tag.desc.MONEY": "You can win money by playing in this tournament.",