Merge branch 'develop'

This commit is contained in:
Sam Carlton 2020-11-29 19:57:56 -06:00
commit 26b8873a22
4 changed files with 36 additions and 4 deletions

View file

@ -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)

View file

@ -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

View file

@ -2,5 +2,6 @@ export default {
'✅': 'native',
'✳️': 'rosetta',
'⏹': 'no-in-progress',
'🚫': 'no'
'🚫': 'no',
'🔶': 'unreported',
}

View file

@ -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',