diff --git a/components/list-summary.vue b/components/list-summary.vue index 1596b75..da1e767 100644 --- a/components/list-summary.vue +++ b/components/list-summary.vue @@ -47,6 +47,7 @@ export default { return { nativePercent: null, rosettaPercent: null, + unreportedPercent: null, unsupportedPercent: null } }, @@ -70,6 +71,13 @@ export default { percent: this.rosettaPercent, verbiage: `run via Rosetta 2, ` }, + { + textColor: 'text-orange-500', + bgColor: 'bg-orange-500', + emoji: '🔶', + percent: this.unreportedPercent, + verbiage: `need more info, ` + }, { textColor: 'text-red', bgColor: 'bg-red', @@ -77,7 +85,15 @@ export default { percent: this.unsupportedPercent, verbiage: `are not working. ` }, - ] + ].filter( percentage => { + const isZero = (percentage.percent === 0) + const isUnreported = (percentage.emoji === '🔶') + + // Filter out + if (isUnreported && isZero) return false + + return true + }) }, nonEmptyPercentages () { return this.percentages.filter(percentage => { @@ -113,7 +129,9 @@ export default { this.nativePercent = Number((( totals['native'] / this.total ) * 100).toFixed(1)) this.rosettaPercent = Number((( totals['rosetta'] / this.total ) * 100).toFixed(1)) - this.unsupportedPercent = Number((100 - (this.nativePercent + this.rosettaPercent)).toFixed(1)) + this.unreportedPercent = Number((( totals['unreported'] / this.total ) * 100).toFixed(1)) + + this.unsupportedPercent = Number((100 - (this.nativePercent + this.rosettaPercent + this.unreportedPercent)).toFixed(1)) // console.log('this.nativePercent', this.nativePercent) // console.log('this.unsupportedPercent', this.unsupportedPercent) diff --git a/helpers/build-game-list.js b/helpers/build-game-list.js index 8380e6d..7c04288 100644 --- a/helpers/build-game-list.js +++ b/helpers/build-game-list.js @@ -18,6 +18,7 @@ import axios from 'axios' const statusesTranslations = { 'Native': 'native', 'Rosetta': 'rosetta', + '': 'unreported' // 'CrossOver': 'rosetta', // '': 'no' } @@ -29,6 +30,14 @@ const statusesMessages = { // 'no': '🚫 No, not yet supported only works on Intel-based Macs' } +function isUnknown(game) { + const playableStatus = game.Playable.toLowerCase() + return ![ + 'yes', + 'no' + ].includes(playableStatus) +} + function isPlayable(game) { return game.Playable.toLowerCase() === 'yes' } @@ -39,6 +48,8 @@ function environmentName(game) { function getStatusText(game) { + if (isUnknown(game)) return '🔶 Unknown, more info needed' + if (isPlayable(game) === false) return '🚫 No, not yet supported only works on Intel-based Macs' // Match status to Sheet Status @@ -47,6 +58,8 @@ function getStatusText(game) { function parseStatus(game) { + if (isUnknown(game)) return 'unreported' + if (isPlayable(game) === false) return 'no' // Match status to Sheet Status diff --git a/helpers/statuses.js b/helpers/statuses.js index 4fe284b..c8f61ca 100644 --- a/helpers/statuses.js +++ b/helpers/statuses.js @@ -2,5 +2,6 @@ export default { '✅': 'native', '✳️': 'rosetta', '⏹': 'no-in-progress', - '🚫': 'no' + '🚫': 'no', + '🔶': 'unreported', } diff --git a/tailwind.config.js b/tailwind.config.js index a71e88d..8c3268d 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -40,7 +40,7 @@ module.exports = { 'gold': 'rgb(255, 167, 102)', // 'gold': 'rgb(222, 115, 90)', - 'orange': 'rgb(222, 115, 90)', + // 'orange': '#ed8936', 'off_white': '#ecebe6',