TTCErembodegem / TTC-React-Front

Gulp! It's the materialization of the React-Redux-Hotloaded-Webpacked-Expressly-Bootstrapped-and-Babelified-brand-new front end for the new website
http://ttc-erembodegem.be/
MIT License
3 stars 0 forks source link

Code (match.degradationMatch) is visible on the 'Vandaag' page when there is a thriller (matches from 22/11/2017 -> 3 thrillers) #143

Closed JornHeyvaert closed 6 years ago

JornHeyvaert commented 6 years ago

There were three thriller matches on this day:

JornHeyvaert commented 6 years ago

Bug wanneer niet ingelogd:

image

Bug wanneer ingelogd:

image

Bug = match.degradationMatch is visible next to the thriller icon

JornHeyvaert commented 6 years ago

@Laoujin Can you confirm it's a bug?

JornHeyvaert commented 6 years ago

Only on big screen (Desktop/Laptop size) -> Not on tablet size or mobile size

JornHeyvaert commented 6 years ago

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?