Closed JornHeyvaert closed 6 years ago
Bug wanneer niet ingelogd:
Bug wanneer ingelogd:
Bug = match.degradationMatch is visible next to the thriller icon
@Laoujin Can you confirm it's a bug?
Only on big screen (Desktop/Laptop size) -> Not on tablet size or mobile size
Oplossing voor de bug:
Thrillerbadge wordt gegenereerd in de file ThrillerIcon.js in het volgende stuk code:
`export const ThrillerBadge = ({t, match}) => { const team = match.getTeam(); const thrillerType = team.getThriller(match); if (thrillerType) { const thrillerStyle = { position: 'absolute', top: 60, left: 15, fontSize: 16, paddingRight: 13, }; return (
{t('match.' + thrillerType)}
</span>
);
} return
; };`{t('match.' + thrillerType)}
genereerd het stuk tekst dat wordt voorzien in de thrillerbadge
team.getThriller(match)
genereert de juiste soort vertaling
Configuratie van getThriller() methode in TeamModel.js:
`getThriller(match) { if (match.date.isBefore(moment())) { return; } const ourRanking = this.getDivisionRanking(); const theirRankingPosition = this.getDivisionRanking(match.opponent).position; const teamsInDivision = this.ranking.length;
const gamesPlayed = ourRanking.gamesWon + ourRanking.gamesLost + ourRanking.gamesDraw;
if (gamesPlayed < 5) {
return;
}
if (ourRanking.position <= 3 && theirRankingPosition <= 3) {
return 'topMatch';
} else if (ourRanking.position >= teamsInDivision - 2 && theirRankingPosition >= teamsInDivision - 2) {
return 'degradationMatch';
}
return;
}`
match.degradationMatch
is niet te vinden in locales-nl.js. match.topMatch wel:
`match: { scoreHomeUp: 'Score thuisploeg verhogen', scoreHomeDown: 'Score thuisploeg verlagen', scoreOutUp: 'Score bezoekers verhogen', scoreOutDown: 'Score bezoekers verlagen', scoreComment: 'Match met wedstrijdverslag', block: { Captain: 'Geblokkeerd door de kapitein', Major: 'Geblokkeerd door Jelle' }, plys: { saveAndBlockAll: 'Bewaren en Blokkeren', choiceCaptain: 'OPGESTELD', choicePlayers: 'Keuze spelers', blockMatchTitle: 'Opstelling',
snackbarSaved: 'Opstelling bewaard',
snackbarBlocked: 'Bewaard en geblokkeerd',
tooltipSaveAndBlock: 'Opstelling bewaren en match blokkeren',
tooltipSave: 'Opstelling bewaren ZONDER blokkeren',
tooltipOpenForm: 'Match opstelling bewerken',
extraComment: 'Extra info bij de match',
},
week: 'Week',
todayMatches: 'vandaag',
nextMatches: 'volgende matchen',
playedMatches: 'gespeelde matchen',
date: '${}u',
vs: 'vs',
topMatch: 'TOPPER',
thrillerMatch: '!! THRILLER !!',
previousEncounterScore: 'Uitslag heenronde',
gotoPreviousEncounter: 'Details heenronde',
gotoNextEncounter: 'Details terugronde',
details: 'Details',
tabs: {
players: 'Spelers',
playersTitle: 'Onze opstelling',
matches: 'Individueel',
matchesTitle: 'Individuele matchuitslagen',
report: 'Verslag',
reportTitle: 'Het wedstrijdverslag',
club: 'Lokaal',
clubTitle: 'Hun clublokaal',
scoresheet: 'Wedstrijdblad',
opponentsRanking: 'Tegenstanders',
opponentsRankingTitle: 'Hun laatste uitslagen',
opponentsFormationTitle: 'Hun opstelling',
admin: 'Dev',
},
report: {
title: 'Wedstrijdverslag',
viewFull: 'Volledig wedstrijdblad bekijken',
viewDetails: 'Wedstrijdblad sluiten',
editTooltip: 'Wedstrijdverslag wijzigen',
noReport: 'Nog niets te bespeuren...',
placeHolder: 'Vertel...',
reportPosted: 'Wedstrijdverslag bewaard',
reportWrittenBy: 'door ${}',
commentsTitle: 'Opvolging',
commentsOpenForm: 'Reageren',
commentsOpenFormConfirm: 'Reactie plaatsen',
commentsPhoto: 'Foto plaatsen',
commentsPhotoTooltip: 'Foto aan de match toevoegen',
commentPosted: 'Verklarende aantekening toegevoegd',
commentDeleted: 'Verklarende aantekening verwijderd',
commentVisible: 'Voor iedereen zichtbaar',
commentHidden: 'Enkel zichtbaar voor leden van TTC Erembodegem',
},
hasNewComments: 'Het wedstrijdverslag is gewijzigd!',
playersVictoryTitle: 'Overwinningen',
playersOpponentsTitle: 'Tegenstanders',
double: 'Dubbel',
doubles: 'Dubbels',
individual: {
matchTitle: 'Match',
setsTitle: 'Sets',
resultTitle: 'Uitslag',
},
opponents: {
homeTeam: 'Thuis',
awayTeam: 'Uit',
vsTeam: 'Tegen',
outcome: 'Uitslag',
timesPlayed: 'Aantredingen',
player: 'Speler',
victories: 'Overwinningen',
noMatchesPlayed: 'Nog niet aangetreden',
},
enemyVictory: '${}ov.',
club: {
locationTitle: 'Clublokaal',
locationUnknown: 'Niet gekend',
websiteKnown: 'Ga naar website'
},
chooseOtherPlayer: 'Andere speler opstellen'
},`
Oplossing volgens mij: Vertaling voorzien voor match.degradationMatch in locales-nl.js @Laoujin Welke vertaling gaan we hieraan geven? DEGRADATIETOPPER fzo?
There were three thriller matches on this day: