X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=resources%2Fjs%2Fcomponents%2Fprotocol%2FItem.js;h=dba32f52a67533df289eb8ff9dd057d0b81c7976;hb=b920a71120fd8211cacf82aa3d31b0fdfc257fd3;hp=9fcc7e5c6e09b539b837a2056513714dae8af359;hpb=cd36cb0ba2718e6bfa08765e7702d57dfe7fd733;p=alttp.git diff --git a/resources/js/components/protocol/Item.js b/resources/js/components/protocol/Item.js index 9fcc7e5..dba32f5 100644 --- a/resources/js/components/protocol/Item.js +++ b/resources/js/components/protocol/Item.js @@ -25,6 +25,13 @@ const getEntryDetailsUsername = entry => { const getEntryRoundNumber = entry => (entry && entry.details && entry.details.round && entry.details.round.number) || '?'; +const getEntryResultComment = entry => { + if (!entry || !entry.details || !entry.details.result || !entry.details.result.comment) { + return ''; + } + return entry.details.result.comment; +}; + const getEntryResultTime = entry => { if (!entry || !entry.details || !entry.details.result) return 'ERROR'; const result = entry.details.result; @@ -44,14 +51,25 @@ const getEntryDescription = entry => { username: getEntryDetailsUsername(entry), }, ); + case 'result.comment': { + const comment = getEntryResultComment(entry); + const number = getEntryRoundNumber(entry); + return + {{number}} + {{comment}}, + ; + } case 'result.report': { + const number = getEntryRoundNumber(entry); const time = getEntryResultTime(entry); return + {{number}} {{time}}, ; } case 'round.create': case 'round.lock': + case 'round.seed': case 'round.unlock': return i18n.t( `protocol.description.${entry.type}`, @@ -60,8 +78,11 @@ const getEntryDescription = entry => { number: getEntryRoundNumber(entry), }, ); - case 'result.comment': + case 'tournament.close': + case 'tournament.discord': case 'tournament.lock': + case 'tournament.open': + case 'tournament.unlock': return i18n.t( `protocol.description.${entry.type}`, entry, @@ -78,10 +99,15 @@ const getEntryIcon = entry => { case 'round.create': return ; case 'round.lock': + case 'tournament.close': case 'tournament.lock': return ; case 'round.unlock': + case 'tournament.open': + case 'tournament.unlock': return ; + case 'tournament.discord': + return ; default: return ; }