Fix Docker build failure caused by server-only import reaching client bundle #123
4 changed files with 15 additions and 14 deletions
11
app/models/scoring-event-types.ts
Normal file
11
app/models/scoring-event-types.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
export type EventType = "playoff_game" | "major_tournament" | "final_standings" | "schedule_event";
|
||||||
|
|
||||||
|
export function getEventTypeLabel(eventType: string): string {
|
||||||
|
switch (eventType) {
|
||||||
|
case "playoff_game": return "Bracket";
|
||||||
|
case "major_tournament": return "Major Tournament";
|
||||||
|
case "final_standings": return "Final Standings";
|
||||||
|
case "schedule_event": return "Non-Scoring";
|
||||||
|
default: return eventType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -5,18 +5,8 @@ import type { BracketRegion } from "~/lib/bracket-templates";
|
||||||
import { recalculateAffectedLeagues } from "./scoring-calculator";
|
import { recalculateAffectedLeagues } from "./scoring-calculator";
|
||||||
import { hasProcessedQualifyingPlacement, recalculateParticipantQP } from "./qualifying-points";
|
import { hasProcessedQualifyingPlacement, recalculateParticipantQP } from "./qualifying-points";
|
||||||
import { findParticipantNamesByIds } from "./season-participant";
|
import { findParticipantNamesByIds } from "./season-participant";
|
||||||
|
import type { EventType } from "./scoring-event-types";
|
||||||
export type EventType = "playoff_game" | "major_tournament" | "final_standings" | "schedule_event";
|
export { type EventType, getEventTypeLabel } from "./scoring-event-types";
|
||||||
|
|
||||||
export function getEventTypeLabel(eventType: string): string {
|
|
||||||
switch (eventType) {
|
|
||||||
case "playoff_game": return "Bracket";
|
|
||||||
case "major_tournament": return "Major Tournament";
|
|
||||||
case "final_standings": return "Final Standings";
|
|
||||||
case "schedule_event": return "Non-Scoring";
|
|
||||||
default: return eventType;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CreateScoringEventData {
|
export interface CreateScoringEventData {
|
||||||
sportsSeasonId: string;
|
sportsSeasonId: string;
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import {
|
||||||
} from "~/components/ui/select";
|
} from "~/components/ui/select";
|
||||||
import { Badge } from "~/components/ui/badge";
|
import { Badge } from "~/components/ui/badge";
|
||||||
import { ArrowLeft, Trophy, CheckCircle2, Pencil, Trash2, Brackets, Save } from "lucide-react";
|
import { ArrowLeft, Trophy, CheckCircle2, Pencil, Trash2, Brackets, Save } from "lucide-react";
|
||||||
import { getEventTypeLabel } from "~/models/scoring-event";
|
import { getEventTypeLabel } from "~/models/scoring-event-types";
|
||||||
import { isBracketMajor } from "~/lib/event-utils";
|
import { isBracketMajor } from "~/lib/event-utils";
|
||||||
import {
|
import {
|
||||||
Table,
|
Table,
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ import {
|
||||||
import { Calendar, Trophy, ArrowLeft, Trash2, ListPlus } from "lucide-react";
|
import { Calendar, Trophy, ArrowLeft, Trash2, ListPlus } from "lucide-react";
|
||||||
import { format, parseISO } from "date-fns";
|
import { format, parseISO } from "date-fns";
|
||||||
import { QualifyingPointsStandings } from "~/components/scoring/QualifyingPointsStandings";
|
import { QualifyingPointsStandings } from "~/components/scoring/QualifyingPointsStandings";
|
||||||
import { getEventTypeLabel } from "~/models/scoring-event";
|
import { getEventTypeLabel } from "~/models/scoring-event-types";
|
||||||
|
|
||||||
export function meta({ data }: Route.MetaArgs): Route.MetaDescriptors {
|
export function meta({ data }: Route.MetaArgs): Route.MetaDescriptors {
|
||||||
return [{ title: `Events — ${data?.sportsSeason?.name ?? "Sports Season"} - Brackt Admin` }];
|
return [{ title: `Events — ${data?.sportsSeason?.name ?? "Sports Season"} - Brackt Admin` }];
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue