+
Date: Tue, 12 Nov 2024 21:15:25 -0500
Subject: [PATCH 13/17] fix(644): remove alt text value from test
---
components/WeeklyPickButton/WeeklyPickButton.test.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/components/WeeklyPickButton/WeeklyPickButton.test.tsx b/components/WeeklyPickButton/WeeklyPickButton.test.tsx
index 408470b2..155bf77e 100644
--- a/components/WeeklyPickButton/WeeklyPickButton.test.tsx
+++ b/components/WeeklyPickButton/WeeklyPickButton.test.tsx
@@ -8,7 +8,7 @@ const weeklyPickData = {
src: '/path/to/ravens.svg',
height: '48',
width: '48',
- alt: 'Ravens',
+ alt: '',
};
describe('WeeklyPickButton', () => {
From 2c784f38e4d3f71e73cca18003066e9cbbef68cb Mon Sep 17 00:00:00 2001
From: Cor-Ina <115652409+Cor-Ina@users.noreply.github.com>
Date: Fri, 15 Nov 2024 13:29:58 -0500
Subject: [PATCH 14/17] fix(644): add comment to inflteam interface
---
api/apiFunctions.interface.ts | 3 +++
1 file changed, 3 insertions(+)
diff --git a/api/apiFunctions.interface.ts b/api/apiFunctions.interface.ts
index be82539a..0cbeb69b 100644
--- a/api/apiFunctions.interface.ts
+++ b/api/apiFunctions.interface.ts
@@ -41,6 +41,9 @@ export interface IWeeklyPicks {
gameWeekId: string;
userResults: IUserPicksData;
}
+// Currently, the pick history section on the
+// Picks page uses this interface without requiring the teamId. Future
+// accessibility fixes will most likely make use of the teamId.
export interface INFLTeam {
teamId?: string;
teamLogo: string;
From 3318d553be78b9fa06edb68d033b77c49bf732aa Mon Sep 17 00:00:00 2001
From: Cor-Ina <115652409+Cor-Ina@users.noreply.github.com>
Date: Mon, 18 Nov 2024 17:26:51 -0500
Subject: [PATCH 15/17] fix(644): replace sr-only span with alt text for logos
of previous weeks picks
---
app/(main)/league/[leagueId]/entry/[entryId]/week/Week.tsx | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/app/(main)/league/[leagueId]/entry/[entryId]/week/Week.tsx b/app/(main)/league/[leagueId]/entry/[entryId]/week/Week.tsx
index dce15d4e..91273fca 100644
--- a/app/(main)/league/[leagueId]/entry/[entryId]/week/Week.tsx
+++ b/app/(main)/league/[leagueId]/entry/[entryId]/week/Week.tsx
@@ -323,9 +323,8 @@ const Week = ({ entry, league, NFLTeams, week }: IWeekProps): JSX.Element => {
height={64}
data-testid="league-history-logo"
src={team.teamLogo}
- alt=""
+ alt={team.teamName}
/>
- {team.teamName}
>
) : (
Date: Tue, 19 Nov 2024 21:09:00 -0500
Subject: [PATCH 16/17] fix(644): create interface for previous weeks picks
---
api/apiFunctions.interface.ts | 6 ++----
app/(main)/league/[leagueId]/entry/[entryId]/week/Week.tsx | 6 +++---
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/api/apiFunctions.interface.ts b/api/apiFunctions.interface.ts
index 0cbeb69b..8685e2f9 100644
--- a/api/apiFunctions.interface.ts
+++ b/api/apiFunctions.interface.ts
@@ -41,14 +41,12 @@ export interface IWeeklyPicks {
gameWeekId: string;
userResults: IUserPicksData;
}
-// Currently, the pick history section on the
-// Picks page uses this interface without requiring the teamId. Future
-// accessibility fixes will most likely make use of the teamId.
export interface INFLTeam {
- teamId?: string;
+ teamId: string;
teamLogo: string;
teamName: string;
}
+export interface IEntryHistoryTeam extends Omit {}
export interface IUserPicksData extends IUserPick {}
export interface ILeague {
leagueId: string;
diff --git a/app/(main)/league/[leagueId]/entry/[entryId]/week/Week.tsx b/app/(main)/league/[leagueId]/entry/[entryId]/week/Week.tsx
index 91273fca..ca9b32ba 100644
--- a/app/(main)/league/[leagueId]/entry/[entryId]/week/Week.tsx
+++ b/app/(main)/league/[leagueId]/entry/[entryId]/week/Week.tsx
@@ -22,7 +22,7 @@ import {
getGameWeek,
} from '@/api/apiFunctions';
import { ILeague } from '@/api/apiFunctions.interface';
-import { INFLTeam } from '@/api/apiFunctions.interface';
+import { IEntryHistoryTeam } from '@/api/apiFunctions.interface';
import WeekTeams from './WeekTeams';
import GlobalSpinner from '@/components/GlobalSpinner/GlobalSpinner';
import { onWeeklyPickChange } from './WeekHelper';
@@ -44,7 +44,7 @@ import Heading from '@/components/Heading/Heading';
*/
// eslint-disable-next-line no-unused-vars
const Week = ({ entry, league, NFLTeams, week }: IWeekProps): JSX.Element => {
- const [pickHistory, setPickHistory] = useState([]);
+ const [pickHistory, setPickHistory] = useState([]);
const [entryName, setEntryName] = useState('');
const [error, setError] = useState(null);
const [schedule, setSchedule] = useState([]);
@@ -163,7 +163,7 @@ const Week = ({ entry, league, NFLTeams, week }: IWeekProps): JSX.Element => {
setEntryName(currentEntry.name);
const entryHistory = currentEntry?.selectedTeams || [];
- let entryHistoryObject: INFLTeam[] = [];
+ let entryHistoryObject: IEntryHistoryTeam[] = [];
if (entryHistory.length > 0) {
entryHistoryObject = entryHistory.map((teamName) => ({
From 192ad24cf69139d57bf9047fc897e2f975ffa81a Mon Sep 17 00:00:00 2001
From: Cor-Ina <115652409+Cor-Ina@users.noreply.github.com>
Date: Tue, 19 Nov 2024 23:02:16 -0500
Subject: [PATCH 17/17] fix(644): remove comments, refactor entryHistoryObject
---
api/apiFunctions.interface.ts | 4 +++-
.../league/[leagueId]/entry/[entryId]/week/Week.tsx | 12 +++++-------
.../[leagueId]/entry/[entryId]/week/WeekTeams.tsx | 11 +++++------
3 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/api/apiFunctions.interface.ts b/api/apiFunctions.interface.ts
index 8685e2f9..516c9bf8 100644
--- a/api/apiFunctions.interface.ts
+++ b/api/apiFunctions.interface.ts
@@ -46,8 +46,10 @@ export interface INFLTeam {
teamLogo: string;
teamName: string;
}
-export interface IEntryHistoryTeam extends Omit {}
+export interface IPickHistoryTeam extends Omit {}
+
export interface IUserPicksData extends IUserPick {}
+
export interface ILeague {
leagueId: string;
leagueName: string;
diff --git a/app/(main)/league/[leagueId]/entry/[entryId]/week/Week.tsx b/app/(main)/league/[leagueId]/entry/[entryId]/week/Week.tsx
index ca9b32ba..d9a28a8b 100644
--- a/app/(main)/league/[leagueId]/entry/[entryId]/week/Week.tsx
+++ b/app/(main)/league/[leagueId]/entry/[entryId]/week/Week.tsx
@@ -22,7 +22,7 @@ import {
getGameWeek,
} from '@/api/apiFunctions';
import { ILeague } from '@/api/apiFunctions.interface';
-import { IEntryHistoryTeam } from '@/api/apiFunctions.interface';
+import { IPickHistoryTeam } from '@/api/apiFunctions.interface';
import WeekTeams from './WeekTeams';
import GlobalSpinner from '@/components/GlobalSpinner/GlobalSpinner';
import { onWeeklyPickChange } from './WeekHelper';
@@ -44,7 +44,7 @@ import Heading from '@/components/Heading/Heading';
*/
// eslint-disable-next-line no-unused-vars
const Week = ({ entry, league, NFLTeams, week }: IWeekProps): JSX.Element => {
- const [pickHistory, setPickHistory] = useState([]);
+ const [pickHistory, setPickHistory] = useState([]);
const [entryName, setEntryName] = useState('');
const [error, setError] = useState(null);
const [schedule, setSchedule] = useState([]);
@@ -162,17 +162,15 @@ const Week = ({ entry, league, NFLTeams, week }: IWeekProps): JSX.Element => {
setEntryName(currentEntry.name);
const entryHistory = currentEntry?.selectedTeams || [];
-
- let entryHistoryObject: IEntryHistoryTeam[] = [];
- if (entryHistory.length > 0) {
- entryHistoryObject = entryHistory.map((teamName) => ({
+ if (currentEntry?.selectedTeams.length > 0) {
+ const entryHistoryObject = entryHistory.map((teamName) => ({
teamName: teamName,
teamLogo: getNFLTeamLogo(NFLTeams, teamName),
}));
+ setPickHistory(entryHistoryObject);
}
- setPickHistory(entryHistoryObject);
} catch (error) {
throw new Error("Error fetching user's pick history");
} finally {
diff --git a/app/(main)/league/[leagueId]/entry/[entryId]/week/WeekTeams.tsx b/app/(main)/league/[leagueId]/entry/[entryId]/week/WeekTeams.tsx
index 274ca8db..756bbae4 100644
--- a/app/(main)/league/[leagueId]/entry/[entryId]/week/WeekTeams.tsx
+++ b/app/(main)/league/[leagueId]/entry/[entryId]/week/WeekTeams.tsx
@@ -104,12 +104,11 @@ const WeekTeams = ({
homeAway={competition.homeAway}
team={competition.team.name}
src={competition.team.logo}
- isDisabled={false}
- // isDisabled={
- // disableGame ||
- // Boolean(loadingTeamName) ||
- // hasTeamBeenPicked(competition.team.name, selectedTeams)
- // }
+ isDisabled={
+ disableGame ||
+ Boolean(loadingTeamName) ||
+ hasTeamBeenPicked(competition.team.name, selectedTeams)
+ }
/>