Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit

Permalink
Merge pull request #42 from Sports-day/feature/legacy-automation-comp…
Browse files Browse the repository at this point in the history
…onents
  • Loading branch information
testusuke authored May 20, 2024
2 parents 1909743 + d833ba8 commit b3f8bb7
Show file tree
Hide file tree
Showing 11 changed files with 1,058 additions and 236 deletions.
34 changes: 34 additions & 0 deletions app/(authenticated)/sports/[id]/automatic-match-editor/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import CardBackground from "@/components/layout/cardBackground";
import {Stack, Link, Typography, Breadcrumbs} from "@mui/material";
import {sportFactory} from "@/src/models/SportModel";
import {gameFactory} from "@/src/models/GameModel";
import {CrossGameAutomaticMatchEditor} from "@/components/automation/CrossGameAutomaticMatchEditor";

export default async function CrossGameAutomaticMatchEditorPage({params}: { params: { id: string } }) {
const sportId = parseInt(params.id, 10)
const sport = await sportFactory().show(sportId)
const games = await gameFactory().index()
const filteredGames = games.filter((game) => game.sportId == sportId)

return(
<Stack spacing={1} mx={2} my={3}>
<Breadcrumbs aria-label="breadcrumb" sx={{pl:2}}>
<Link underline="hover" color="inherit" href="/">
管理者のダッシュボード
</Link>
<Link underline="hover" color="inherit" href={"/sports"}>
競技管理
</Link>
<Link underline="hover" color="inherit" href={`/sports/${sportId}`}>
{sport.name}
</Link>
<Typography color="text.primary">一括試合編集(Cross Game)</Typography>
</Breadcrumbs>
<CardBackground title={"一括編集"}>
<CrossGameAutomaticMatchEditor
games={filteredGames}
/>
</CardBackground>
</Stack>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import CardBackground from "@/components/layout/cardBackground";
import {Stack, Link, Typography, Breadcrumbs} from "@mui/material";
import {sportFactory} from "@/src/models/SportModel";
import {gameFactory} from "@/src/models/GameModel";
import {AutomaticMatchEditor} from "@/components/automation/AutomaticMatchEditor";

export default async function AutomaticMatchEditorPage({params}: { params: { gameId:string, id: string } }) {
const gameId = parseInt(params.gameId, 10)
const game = await gameFactory().show(gameId)
const sportId = parseInt(params.id, 10)
const sport = await sportFactory().show(sportId)

return(
<Stack spacing={1} mx={2} my={3}>
<Breadcrumbs aria-label="breadcrumb" sx={{pl:2}}>
<Link underline="hover" color="inherit" href="/">
管理者のダッシュボード
</Link>
<Link underline="hover" color="inherit" href={"/sports"}>
競技管理
</Link>
<Link underline="hover" color="inherit" href={`/sports/${sport.id}`}>
{sport.name}
</Link>
<Link underline="hover" color="inherit" href={`/sports/${sport.id}/games/${game.id}`}>
{game.name}(ID:{gameId})
</Link>
<Typography color="text.primary">試合一括編集</Typography>
</Breadcrumbs>
<CardBackground title={`試合一括編集`}>
<AutomaticMatchEditor game={game} />
</CardBackground>
</Stack>
)
}
2 changes: 1 addition & 1 deletion app/(authenticated)/sports/[id]/games/[gameId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default async function GamePage({params}: { params: { gameId:string, id:
<CardBackground title={`${game.name}のリーグ表`}>
<LeagueTable game={game} sport={sport} />
</CardBackground>
<CardBackground title={`${game.name}試合一覧`}>
<CardBackground title={`${game.name}試合一覧`} button={"一括変更"} link={`/sports/${sportId}/games/${gameId}/automatic-match-editor`}>
<MatchList
matches={matchList}
/>
Expand Down
2 changes: 1 addition & 1 deletion app/(authenticated)/sports/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default async function SportPage({params}: { params: { id: string } }) {
<CardBackground title={`${sport.name}`}>
<SportEditor sport={sport}/>
</CardBackground>
<CardBackground title={`${sport.name}の進行中の試合`}>
<CardBackground title={`${sport.name}の進行中の試合`} button={"一括編集(Cross Game)"} link={`/sports/${sportId}/automatic-match-editor`}>
<SportInProgressMatchList sport={sport}/>
</CardBackground>
</Stack>
Expand Down
Loading

0 comments on commit b3f8bb7

Please sign in to comment.