Merge pull request #7965 from Budibase/fix/floor-usage-metrics

Minor change to floor usage metrics to avoid misleading 100 quota messages
This commit is contained in:
Martin McKeaveney 2022-09-26 15:33:17 +01:00 committed by GitHub
commit 90e4c97004
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -12,7 +12,10 @@
$: daysRemaining = $licensing.quotaResetDaysRemaining $: daysRemaining = $licensing.quotaResetDaysRemaining
$: quotaResetDate = $licensing.quotaResetDate $: quotaResetDate = $licensing.quotaResetDate
$: dayPassesUsed = $licensing.usageMetrics?.dayPasses $: dayPassesUsed =
$licensing.usageMetrics?.dayPasses > 100
? 100
: $licensing.usageMetrics?.dayPasses
$: dayPassesTitle = $: dayPassesTitle =
dayPassesUsed >= 100 dayPassesUsed >= 100
? "You have run out of Day Passes" ? "You have run out of Day Passes"

View File

@ -87,7 +87,7 @@ export const createLicensingStore = () => {
return keys.reduce((acc, key) => { return keys.reduce((acc, key) => {
const quotaLimit = license[key].value const quotaLimit = license[key].value
const quotaUsed = (quota[key] / quotaLimit) * 100 const quotaUsed = (quota[key] / quotaLimit) * 100
acc[key] = quotaLimit > -1 ? Math.round(quotaUsed) : -1 acc[key] = quotaLimit > -1 ? Math.floor(quotaUsed) : -1
return acc return acc
}, {}) }, {})
} }