Skip to content

Commit

Permalink
Ajout des données de la constitution X10 (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
hvdbm authored Oct 18, 2023
1 parent b5f2990 commit a097e7f
Show file tree
Hide file tree
Showing 7 changed files with 4,098 additions and 1,989 deletions.
4,301 changes: 2,326 additions & 1,975 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@angular/platform-browser": "~13.3.11",
"@angular/platform-browser-dynamic": "~13.3.11",
"@angular/router": "~13.3.11",
"chelys": "2.11.0",
"chelys": "^2.13.0",
"node-fetch": "^3.2.10",
"rxjs": "~7.5.7",
"tslib": "^2.4.1",
Expand Down Expand Up @@ -50,4 +50,4 @@
"karma-jasmine-html-reporter": "~1.7.0",
"typescript": "~4.6.4"
}
}
}
9 changes: 4 additions & 5 deletions src/app/components/table-viewer/table-viewer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,10 @@ export class TableViewerComponent implements AfterViewInit {

platformToString(platform: SongPlatform): string {
switch (platform) {
case SongPlatform.YOUTUBE:
return "Youtube";

default:
return "Unknown";
case SongPlatform.YOUTUBE: return "Youtube";
case SongPlatform.SOUNDCLOUD: return "Soundcloud";
case SongPlatform.PEERTUBE: return "Peertube";
default: return "Inconnu";
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/app/constants/constitutions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import X7 from '../../assets/constitutions/X7.json';
import X8 from '../../assets/constitutions/X8.json';
import XM from '../../assets/constitutions/XM.json';
import X9 from '../../assets/constitutions/X9.json';
import X10 from '../../assets/constitutions/X10.json';

export type DataConstitution = {
cstName: string;
Expand All @@ -38,5 +39,5 @@ export type DataConstitution = {

export const ALL_CONSTITUTIONS_DATA: DataConstitution[] = [
C1, C2, C3, C4, C5, C6, C7, C8, C9, C10,
X1, X2, X3, X4, X5, X6, X7, X8, XM, X9
X1, X2, X3, X4, X5, X6, X7, X8, XM, X9, X10
]
10 changes: 5 additions & 5 deletions src/app/services/data-manager.service.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Injectable } from '@angular/core';
import { EMPTY_SONG, Song } from 'chelys';
import { EMPTY_SONG, Song, SongPlatform } from 'chelys';
import { ALL_CONSTITUTIONS_DATA, DataConstitution } from '../constants/constitutions';
import names from '../../assets/names.json'

export interface DataSong extends Song {
cstName: string;
date: string;
isWinner: boolean;
isWinner: boolean;
}

export const EMPTY_DATA_SONG: DataSong = {
Expand Down Expand Up @@ -41,7 +41,7 @@ export class DataManagerService {

private init() {
// Sort constitutions by date, the oldest first
this.constitutions = this.constitutions.sort(sortConstitutionByDateASC);
this.constitutions.sort(sortConstitutionByDateASC);

// Song counter (also generate unique id)
let i = 0;
Expand All @@ -56,12 +56,12 @@ export class DataManagerService {
cstName: constitution.cstName,
date: new Date(constitution.date).toISOString().slice(0, 10),
isWinner: constitution.winner === song.id,
user: this.uidToName[song.user] || "Utilisateur Inconnu"
user: this.uidToName[song.user] || "Utilisateur Inconnu",
}
}));
})

// Display most recent songs first
this.songs = this.songs.reverse();
this.songs.reverse();
}
}
Loading

0 comments on commit a097e7f

Please sign in to comment.