Skip to content

Commit

Permalink
fix(competition): show placeholder for team names in planning
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsandoz committed Oct 7, 2024
1 parent e772941 commit 222ad81
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions models/competition-edition.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export default class CompetitionEdition {
faceoff.setTeams(this.teams);
}
faceoff.matches = this.matches?.filter((match) => match.faceoff_id === faceoff.id);
faceoff.matches?.forEach((match) => (match.faceoff = { ...faceoff, matches: undefined }));
return faceoff;
});
}
Expand Down
2 changes: 2 additions & 0 deletions models/faceoff.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ export default class Faceoff {
}
}
}

export type FaceoffWithoutMatches = Omit<Faceoff, 'matches' | 'setTeams'>;
3 changes: 2 additions & 1 deletion models/match.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type {
LeveradeResult,
LeveradeTeam,
} from '~/plugins/07.leverade';
import type { FaceoffWithoutMatches } from '~/models/faceoff.model';

export interface Facility {
id: string;
Expand Down Expand Up @@ -40,7 +41,7 @@ export default class Match {
datetime: string | null;
round_id: string;
faceoff_id: string | null;
faceoff?: Faceoff;
faceoff?: Faceoff | FaceoffWithoutMatches;
home_team_id: string | null;
leverade_home_team?: LeveradeTeam;
home_team?: Team;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
:src="match.home_team.avatarMediumUrl"
class="c-planning__match-team-avatar"
/>
<div v-else class="c-planning__match-team-avatar c-planning__match-team-avatar--placeholder"></div>
{{ match.homeTeamName }}
</div>

Expand All @@ -30,7 +29,6 @@
:src="match.away_team.avatarMediumUrl"
class="c-planning__match-team-avatar"
/>
<div v-else class="c-planning__match-team-avatar c-planning__match-team-avatar--placeholder"></div>
{{ match.awayTeamName }}
</div>
</h4>
Expand Down

0 comments on commit 222ad81

Please sign in to comment.