From 8012fcd92bf67e1f928de5bb3a781abeb9e48de8 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sat, 28 Nov 2020 17:54:32 -0600 Subject: [PATCH 1/4] Add unreported status --- components/list-summary.vue | 12 +++++++++++- helpers/statuses.js | 3 ++- tailwind.config.js | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/components/list-summary.vue b/components/list-summary.vue index 1596b75..c4d9413 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: `are not yet reported, ` + }, { textColor: 'text-red', bgColor: 'bg-red', @@ -113,7 +121,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/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', From 704a71a85554a74e48d3b11545f371f10641e6d0 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sat, 28 Nov 2020 18:07:10 -0600 Subject: [PATCH 2/4] Ennable unreported games --- helpers/build-game-list.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 From e47a0ac3db3e6592645fa8431fc754231fc744db Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sat, 28 Nov 2020 18:08:36 -0600 Subject: [PATCH 3/4] Update unreported summary to need more info --- components/list-summary.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/list-summary.vue b/components/list-summary.vue index c4d9413..7ef2ab5 100644 --- a/components/list-summary.vue +++ b/components/list-summary.vue @@ -76,7 +76,7 @@ export default { bgColor: 'bg-orange-500', emoji: '🔶', percent: this.unreportedPercent, - verbiage: `are not yet reported, ` + verbiage: `need more info, ` }, { textColor: 'text-red', From 0de1752884ded5e9cb0fb481f3eaa01629889620 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sat, 28 Nov 2020 18:14:58 -0600 Subject: [PATCH 4/4] Filter out unreported if there are none --- components/list-summary.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/components/list-summary.vue b/components/list-summary.vue index 7ef2ab5..da1e767 100644 --- a/components/list-summary.vue +++ b/components/list-summary.vue @@ -85,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 => {