Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

リーグ編成画面 Feature/#21 league #31

Merged
merged 27 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c5e23f5
fix: yarn.lock
1nayu Apr 28, 2024
d11ae3b
feat: sport list data fetch
1nayu Apr 30, 2024
cbe3346
feat: Error page, Loading screen
1nayu May 2, 2024
6002627
fix: updated Link components in navigation, buttonLarge
1nayu May 4, 2024
e37bf9a
fix: removed unused imports
1nayu May 4, 2024
fdeed85
feat: Logout
1nayu May 4, 2024
dfd0bc9
fix: dnd items can't be moved to empty container
1nayu May 6, 2024
29fa779
feat: sports component data fetch
1nayu May 6, 2024
1a50019
fix: refactor
1nayu May 6, 2024
554ffa1
fix : bug in dnd( Changes by owner)
1nayu May 6, 2024
ae961c5
fix: navigation button vertical padding
1nayu May 6, 2024
0eef7fe
fix: scrollbar width
1nayu May 6, 2024
683a4ea
fix: some styles
1nayu May 6, 2024
b481729
feat: league sport list
1nayu May 6, 2024
5c3e73a
feat: dynamic league editing
1nayu May 6, 2024
443b9b2
feat: fetch data in league Dnd
1nayu May 6, 2024
263bf12
fix: league cannot be added after deleting one
1nayu May 7, 2024
2f69160
fix: refactor
1nayu May 7, 2024
d47f327
fix: build failure (missing key in leagueDnd)
1nayu May 7, 2024
726e0f3
fix: errors
1nayu May 8, 2024
245e0dc
feat: league list with data fetching
1nayu May 8, 2024
38ca775
Merge branch 'main' into feature/#21-league
1nayu May 9, 2024
f7c6403
Merge branch 'main' into feature/#21-league
1nayu May 9, 2024
ca5fabc
fix: leagueDnd force saving
1nayu May 11, 2024
99b4290
fix: leagueDnd save changes using difference
1nayu May 12, 2024
6611841
fix: leagueDnd game rename feature, new game naming feature
1nayu May 12, 2024
95298e6
Merge branch 'main' into feature/#21-league
1nayu May 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions app/(authenticated)/league/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
import {Breadcrumbs, Link, Stack, Typography} from "@mui/material";
import CardBackground from "@/components/layout/cardBackground";
import LeagueDnd from "@/components/league/leagueDnd";
import {sportFactory} from "@/src/models/SportModel";

export default function LeagueTestPage() {
export default async function LeagueTestPage({params}: { params: { id: string } }) {
const sportId = parseInt(params.id, 10)
const sport = await sportFactory().show(sportId)
return (
<Stack spacing={2} mx={2} my={3}>
<Breadcrumbs aria-label="breadcrumb" sx={{pl:2}}>
<Link underline="hover" color="inherit" href="/">
管理者のダッシュボード
</Link>
<Link underline="hover" color="inherit" href="/league">
<Link underline="hover" color="inherit" href="../../league">
リーグ管理
</Link>
<Typography color="text.primary">競技名</Typography>
<Typography color="text.primary">{sport.name}</Typography>
</Breadcrumbs>
<CardBackground title={"どの競技のリーグを管理しますか?"}>
<LeagueDnd/>
<CardBackground title={`${sport.name}のリーグ`}>
<LeagueDnd sport={sport} sportId={sportId}/>
</CardBackground>
</Stack>
);
Expand Down
27 changes: 6 additions & 21 deletions app/(authenticated)/league/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import {Stack, Grid, Typography, Link, Breadcrumbs} from "@mui/material";
import CardBackground from "@/components/layout/cardBackground";
import CardLarge from "@/components/layout/cardLarge";
import {ButtonLarge} from "@/components/layout/buttonLarge";
import {sportFactory} from "@/src/models/SportModel";
import LeagueSportsList from "@/components/league/leagueSportsList";

export default function LeaguePage() {

export default async function LeaguePage() {
const sports = await sportFactory().index()
return (
<Stack spacing={2} mx={2} my={3}>
<Breadcrumbs aria-label="breadcrumb" sx={{pl:2}}>
Expand All @@ -14,24 +16,7 @@ export default function LeaguePage() {
</Breadcrumbs>
<CardBackground title={"どの競技のリーグを管理しますか?"}>
<Grid container spacing={1}>
<ButtonLarge img={"a"}>
バスケットボール
</ButtonLarge>
<ButtonLarge img={"a"}>
ドッジビー
</ButtonLarge>
<ButtonLarge img={"a"}>
フットサル
</ButtonLarge>
<ButtonLarge img={"a"}>
ビーチボール
</ButtonLarge>
<ButtonLarge img={"a"}>
ペタンク
</ButtonLarge>
<ButtonLarge img={"a"}>
ストラックアウト
</ButtonLarge>
<LeagueSportsList sports={sports}/>
</Grid>
</CardBackground>
</Stack>
Expand Down
26 changes: 26 additions & 0 deletions app/(authenticated)/loading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
'use client'
import {useEffect, useState} from "react";
import {Stack, Skeleton, Box, LinearProgress, Backdrop} from "@mui/material";
import CardBackground from "@/components/layout/cardBackground";

export default function Loading() {
const [backdropOpen, setBackdropOpen] = useState<boolean>(false)

useEffect(() => {
setBackdropOpen(true)
}, [])

return(
<>
<Backdrop open={backdropOpen} sx={{backgroundColor:"rgba(239,240,248, 0.4)", zIndex: 1}}/>
<Stack spacing={2} mx={2} my={3}>
<Skeleton animation="wave" variant="text" width={300} height={18} />
<CardBackground>
<Box width="100%">
<LinearProgress/>
</Box>
</CardBackground>
</Stack>
</>
)
}
19 changes: 19 additions & 0 deletions app/(authenticated)/locations/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {Breadcrumbs, Link, Stack, Typography} from "@mui/material";
import CardBackground from "@/components/layout/cardBackground";
import TeamsAgGrid from "@/components/teams/teamsTable";

export default function LocationPage() {
return (
<Stack spacing={1} mx={2} my={3}>
<Breadcrumbs aria-label="breadcrumb" sx={{pl:2}}>
<Link underline="hover" color="inherit" href="/public">
管理者のダッシュボード
</Link>
<Typography color="text.primary">場所管理</Typography>
</Breadcrumbs>
<CardBackground title={"すべての場所"} button={"場所を新規作成"}>
none
</CardBackground>
</Stack>
)
}
31 changes: 8 additions & 23 deletions app/(authenticated)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,25 @@
import {Breadcrumbs, Grid, Link, Stack, Typography} from "@mui/material";
import {Breadcrumbs, Grid, Stack, Typography} from "@mui/material";
import CardBackground from "@/components/layout/cardBackground";
import {ButtonLarge} from "@/components/layout/buttonLarge";
import CardLarge from "@/components/layout/cardLarge";
import CardList from "@/components/layout/cardList";
import SportsList from "@/components/sports/sportsList";
import {sportFactory} from "@/src/models/SportModel";

export default function Home() {
export default async function Home() {
const sports = await sportFactory().index()
return (
<Stack spacing={2} mx={2} my={3}>
<Breadcrumbs aria-label="breadcrumb" sx={{pl:2}}>
<Typography color="text.primary">管理者のダッシュボード</Typography>
</Breadcrumbs>
<CardBackground title={"競技を選ぶ"} button={"競技を作成・編集する"} link={"users"}>
<CardBackground title={"競技を選ぶ"} button={"競技を作成・編集する"} link={"/sports"}>
<Grid container spacing={1}>
<ButtonLarge img={"a"}>
バスケットボール
</ButtonLarge>
<ButtonLarge img={"a"}>
ドッジビー
</ButtonLarge>
<ButtonLarge img={"a"}>
フットサル
</ButtonLarge>
<ButtonLarge img={"a"}>
ビーチボール
</ButtonLarge>
<ButtonLarge img={"a"}>
ペタンク
</ButtonLarge>
<ButtonLarge img={"a"}>
ストラックアウト
</ButtonLarge>
<SportsList sports={sports}/>
</Grid>
</CardBackground>
<CardBackground title={"配信中のお知らせ"} button={"お知らせを作成・編集"}>
<CardLarge>
現在集計中です。教室で放送による結果発表をお待ちください。
この機能は開発中です
</CardLarge>
</CardBackground>
<CardBackground title={"現在進行中の試合"}>
Expand Down
36 changes: 16 additions & 20 deletions app/(authenticated)/sports/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,39 +1,35 @@
import CardBackground from "@/components/layout/cardBackground";
import {SportInfoField} from "@/components/sports/sportInfoField";
import {Accordion, AccordionSummary, AccordionDetails, Stack, Grid, Link, Typography, Breadcrumbs} from "@mui/material";
import {Stack, Grid, Link, Typography, Breadcrumbs} from "@mui/material";
import {ButtonLarge} from "@/components/layout/buttonLarge";
import {HiChevronDown} from "react-icons/hi2";
import CardList from "@/components/layout/cardList";
import {sportFactory} from "@/src/models/SportModel";
import SportEditor from "@/components/sports/sportEditor";
import LeagueList from "@/components/sports/leagueList";
import {gameFactory} from "@/src/models/GameModel";

export default async function SportPage({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)

export default function SportPage() {
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 underline="hover" color="inherit" href="../../sports">
競技管理
</Link>
<Typography color="text.primary">競技名</Typography>
<Typography color="text.primary">{sport.name}</Typography>
</Breadcrumbs>
<CardBackground title={"競技名"}>
<Accordion sx={{backgroundColor:"primary.main", color:"secondary.main", borderRadius:"10px"}}>
<AccordionSummary
aria-controls="panel-content"
id="panel-header"
>
<Typography>詳細を見る・編集する</Typography>
</AccordionSummary>
<AccordionDetails>
<SportInfoField/>
</AccordionDetails>
</Accordion>
<CardBackground title={`${sport.name}`}>
<SportEditor sport={sport}/>
</CardBackground>
<CardBackground title={"リーグ一覧"} button={"編集"}>
<Grid container spacing={1}>
<ButtonLarge>Aリーグ</ButtonLarge>
<ButtonLarge>Bリーグ</ButtonLarge>
<LeagueList games={filteredGames}/>
</Grid>
</CardBackground>
<CardBackground title={"競技名の現在進行中の試合"}>
Expand Down
23 changes: 23 additions & 0 deletions app/(authenticated)/sports/create/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import {Stack, Breadcrumbs, Link, Typography} from "@mui/material";
import CardBackground from "@/components/layout/cardBackground";
import SportCreator from "@/components/sports/sportCreator";

export default async function CreateSport() {
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>
<Typography color="text.primary">競技を新規作成</Typography>
</Breadcrumbs>

<CardBackground title={"競技を新規作成"} link={"/sports/create"}>
<SportCreator/>
</CardBackground>
</Stack>
);
}
37 changes: 7 additions & 30 deletions app/(authenticated)/sports/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import {Breadcrumbs, Grid, Link, Stack, Typography} from "@mui/material";
import CardBackground from "@/components/layout/cardBackground";
import CardLarge from "@/components/layout/cardLarge";
import {ButtonLarge} from "@/components/layout/buttonLarge";
import {SportInfoField} from "@/components/sports/sportInfoField";
import SportsList from "@/components/sports/sportsList";
import {sportFactory} from "@/src/models/SportModel";

export default async function SportsPage() {
const sports = await sportFactory().index()

export default function SportsPage() {
return (
<Stack spacing={2} mx={2} my={3}>
<Breadcrumbs aria-label="breadcrumb" sx={{pl:2}}>
Expand All @@ -13,33 +14,9 @@ export default function SportsPage() {
</Link>
<Typography color="text.primary">競技管理</Typography>
</Breadcrumbs>
<CardBackground title={"競技一覧"}>
<Grid container spacing={1}>
<ButtonLarge img={"a"}>
バスケットボール
</ButtonLarge>
<ButtonLarge img={"a"}>
ドッジビー
</ButtonLarge>
<ButtonLarge img={"a"}>
フットサル
</ButtonLarge>
<ButtonLarge img={"a"}>
ビーチボール
</ButtonLarge>
<ButtonLarge img={"a"}>
ペタンク
</ButtonLarge>
<ButtonLarge img={"a"}>
ストラックアウト
</ButtonLarge>
</Grid>
</CardBackground>
<CardBackground title={"競技を管理"} button={"競技を追加"}>
<CardBackground title={"競技一覧"} button={"競技を新規作成"} link={"/sports/create"}>
<Grid container spacing={1}>
<SportInfoField/>
<SportInfoField/>
<SportInfoField/>
<SportsList sports={sports}/>
</Grid>
</CardBackground>
</Stack>
Expand Down
2 changes: 1 addition & 1 deletion app/(authenticated)/users/csv/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import CardBackground from "@/components/layout/cardBackground";
import {classFactory} from "@/src/models/ClassModel";
import UserCreatingAutomation from "@/components/users/csv/userCreatingAutomation";

export default async function UsersPage() {
export default async function UsersCsv() {
const classes = await classFactory().index()

return (
Expand Down
51 changes: 51 additions & 0 deletions app/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
'use client'
import {useEffect} from "react";
import {Stack, Typography, Button} from "@mui/material";
import WiderLogo from "@/components/svg/wider";

export default function Error({
error,
reset,
}: {
error: Error & { digest?: string }
reset: () => void
}) {
useEffect(() => {
// Log the error to an error reporting service
console.error(error)
}, [error])

return (
<Stack height="100vh" width="100vw" justifyContent="center" alignItems="center" sx={{background:"radial-gradient(ellipse at left, #5F6DC2, #3E4EB3)"}}>
<Stack maxWidth={"500px"} mx={2} justifyContent="center" alignItems="center" spacing={1.5}>
<Typography fontSize={"25px"} fontWeight={"400"} color={"#c7cbe5"}>(T . T)</Typography>
<Typography pb={3} fontSize={"25px"} fontWeight={"600"} color={"#EFF0F8"}>問題が発生しました</Typography>
<Typography fontSize={"18px"} fontWeight={"400"} color={"#c7cbe5"}>詳細はコンソールから確認してください。繰り返し発生している場合は、開発者に連絡してください。</Typography>
<Button
variant="contained"
color="primary"
href={"/"}
sx={{py:1.5, width:"100%"}}
disableElevation
>
トップに戻る
</Button>
<Button
variant="contained"
color="primary"
onClick = { () => reset()}
sx={{py:1.5, width:"100%"}}
disableElevation
>
再試行
</Button>
<Button>
<Stack direction={"row"} spacing={0.5}>
<Typography fontWeight={"600"} color={"#99a5d6"}>(C)2024</Typography>
<WiderLogo/>
</Stack>
</Button>
</Stack>
</Stack>
)
}
29 changes: 29 additions & 0 deletions app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import {Stack, Typography, Button} from "@mui/material";
import WiderLogo from "@/components/svg/wider";

export default function NotFound(){
return (
<Stack height="100vh" width="100vw" justifyContent="center" alignItems="center" sx={{background:"radial-gradient(ellipse at left, #5F6DC2, #3E4EB3)"}}>
<Stack maxWidth={"500px"} mx={2} justifyContent="center" alignItems="center" spacing={1.5}>
<Typography fontSize={"25px"} fontWeight={"400"} color={"#c7cbe5"}>(T . T)</Typography>
<Typography pb={3} fontSize={"25px"} fontWeight={"600"} color={"#EFF0F8"}>404 - Not Found</Typography>
<Typography fontSize={"18px"} fontWeight={"400"} color={"#c7cbe5"}>ページが存在しません。存在するはずのページで繰り返し発生している場合は、開発者に連絡してください。</Typography>
<Button
variant="contained"
color="primary"
href={"/"}
sx={{py:1.5, width:"100%"}}
disableElevation
>
トップに戻る
</Button>
<Button>
<Stack direction={"row"} spacing={0.5}>
<Typography fontWeight={"600"} color={"#99a5d6"}>(C)2024</Typography>
<WiderLogo/>
</Stack>
</Button>
</Stack>
</Stack>
)
}
Loading
Loading