diff --git a/src/app/games/game-summaries/external-game/external-game.component.html b/src/app/games/game-summaries/external-game-summary/external-game-summary.component.html similarity index 100% rename from src/app/games/game-summaries/external-game/external-game.component.html rename to src/app/games/game-summaries/external-game-summary/external-game-summary.component.html diff --git a/src/app/games/game-summaries/external-game/external-game.component.scss b/src/app/games/game-summaries/external-game-summary/external-game-summary.component.scss similarity index 100% rename from src/app/games/game-summaries/external-game/external-game.component.scss rename to src/app/games/game-summaries/external-game-summary/external-game-summary.component.scss diff --git a/src/app/games/game-summaries/external-game/external-game.component.spec.ts b/src/app/games/game-summaries/external-game-summary/external-game-summary.component.spec.ts similarity index 100% rename from src/app/games/game-summaries/external-game/external-game.component.spec.ts rename to src/app/games/game-summaries/external-game-summary/external-game-summary.component.spec.ts diff --git a/src/app/games/game-summaries/external-game/external-game.component.ts b/src/app/games/game-summaries/external-game-summary/external-game-summary.component.ts similarity index 60% rename from src/app/games/game-summaries/external-game/external-game.component.ts rename to src/app/games/game-summaries/external-game-summary/external-game-summary.component.ts index dd02a4a..af5c34f 100644 --- a/src/app/games/game-summaries/external-game/external-game.component.ts +++ b/src/app/games/game-summaries/external-game-summary/external-game-summary.component.ts @@ -5,14 +5,14 @@ import { faChartLine, faExternalLinkAlt } from '@fortawesome/free-solid-svg-icon import { GamesService } from '../../games.service'; /** - * Displays a game's name, decomp progress, and links. + * Displays an externally-linked game's name, decomp progress, and links. */ @Component({ - selector: 'external-game', - templateUrl: './external-game.component.html', - styleUrls: ['./external-game.component.scss'] + selector: 'external-game-summary', + templateUrl: './external-game-summary.component.html', + styleUrls: ['./external-game-summary.component.scss'] }) -export class ExternalGameComponent implements OnChanges { +export class ExternalGameSummaryComponent implements OnChanges { constructor(private gamesService: GamesService) { } @@ -36,10 +36,13 @@ export class ExternalGameComponent implements OnChanges { chart = faChartLine; ngOnChanges(): void { - this.gamesService.getGameShield(`${this.data.shieldURL}`).subscribe( - res => this.total = res.message, - err => console.error(err) - ); + + if (this.data.shieldURL) { + this.gamesService.getGameShield(`${this.data.shieldURL}`).subscribe( + res => this.total = res.message, + err => console.error(err) + ); + } } } diff --git a/src/app/games/game-summaries/game-summaries.component.html b/src/app/games/game-summaries/game-summaries.component.html index 7aa4298..546f1f5 100644 --- a/src/app/games/game-summaries/game-summaries.component.html +++ b/src/app/games/game-summaries/game-summaries.component.html @@ -1,4 +1,4 @@
- +
diff --git a/src/app/games/game-summaries/game-summaries.component.scss b/src/app/games/game-summaries/game-summaries.component.scss index cdb99cc..06eb588 100644 --- a/src/app/games/game-summaries/game-summaries.component.scss +++ b/src/app/games/game-summaries/game-summaries.component.scss @@ -7,13 +7,7 @@ h2 { width: max-content; } -game-summary { - flex-grow: 0; - margin-bottom: 12px; - margin-right: 1em; -} - -external-game { +game-summary, external-game-summary { flex-grow: 0; margin-bottom: 12px; margin-right: 1em; diff --git a/src/app/games/game-summaries/game-summaries.component.ts b/src/app/games/game-summaries/game-summaries.component.ts index 3c73382..18bad9f 100644 --- a/src/app/games/game-summaries/game-summaries.component.ts +++ b/src/app/games/game-summaries/game-summaries.component.ts @@ -19,7 +19,7 @@ export class GameSummariesComponent implements OnInit { */ games: IGame[] = []; /** - * List of external games to use for "ExternalGame" components. + * List of external games to use for "ExternalGameSummary" components. */ externalGames: IExternalGame[] = []; diff --git a/src/app/games/game-summaries/game-summary/game-summary.component.ts b/src/app/games/game-summaries/game-summary/game-summary.component.ts index 3cf5d61..36bb79a 100644 --- a/src/app/games/game-summaries/game-summary/game-summary.component.ts +++ b/src/app/games/game-summaries/game-summary/game-summary.component.ts @@ -24,19 +24,18 @@ export class GameSummaryComponent implements OnChanges { */ total?: string; /** - * Icon definition. + * Icon definitions. */ github = faGithub; - /** - * Icon definition. - */ trello = faTrello; ngOnChanges(): void { - this.gamesService.getGameShield(`${this.data.shieldURL}`).subscribe( - res => this.total = res.message, - err => console.error(err) - ); + if (this.data.shieldURL) { + this.gamesService.getGameShield(`${this.data.shieldURL}`).subscribe( + res => this.total = res.message, + err => console.error(err) + ); + } } } diff --git a/src/app/games/game/game.component.ts b/src/app/games/game/game.component.ts index 8cb1f55..726613c 100644 --- a/src/app/games/game/game.component.ts +++ b/src/app/games/game/game.component.ts @@ -39,13 +39,15 @@ export class GameComponent implements OnInit { } else { this.game = res[index]; - forkJoin([ - this.gamesService.getGameCSV(this.game.csvs.nonmatching), - this.gamesService.getGameCSV(this.game.csvs.matching) - ]).subscribe( - res => this.csvData = res, - err => console.error(err) - ); + if (this.game.progressMeta.length > 0) { + forkJoin([ + this.gamesService.getGameCSV(this.game.csvs.nonmatching), + this.gamesService.getGameCSV(this.game.csvs.matching) + ]).subscribe( + res => this.csvData = res, + err => console.error(err) + ); + } } }, err => { diff --git a/src/app/games/games.module.ts b/src/app/games/games.module.ts index ae5622d..b4120fa 100644 --- a/src/app/games/games.module.ts +++ b/src/app/games/games.module.ts @@ -5,7 +5,7 @@ import { GamesService } from './games.service'; import { GameSummariesComponent } from './game-summaries/game-summaries.component'; import { GameSummaryComponent } from './game-summaries/game-summary/game-summary.component'; import { GameComponent } from './game/game.component'; -import { ExternalGameComponent } from './game-summaries/external-game/external-game.component' +import { ExternalGameSummaryComponent } from './game-summaries/external-game-summary/external-game-summary.component' import { MatButtonModule } from '@angular/material/button'; import { MatCardModule } from '@angular/material/card'; import { MatGridListModule } from '@angular/material/grid-list'; @@ -52,7 +52,7 @@ export function markedOptionsFactory(): MarkedOptions { GameProgressComponent, GameChartComponent, GameFAQComponent, - ExternalGameComponent + ExternalGameSummaryComponent ], imports: [ CommonModule, diff --git a/src/app/games/games.service.interface.ts b/src/app/games/games.service.interface.ts index b61d857..05c40f9 100644 --- a/src/app/games/games.service.interface.ts +++ b/src/app/games/games.service.interface.ts @@ -167,10 +167,6 @@ export interface ISubdivision { * Describes a game's shield output. */ export interface IShield { - /** - * Always 1. - */ - schemaVersion: number; /** * Static label in left half. */