From c0bdcbe7a38312cb2e4286a7a9d8b103acbef5f6 Mon Sep 17 00:00:00 2001 From: Dean Date: Mon, 26 Sep 2022 09:44:45 +0100 Subject: [PATCH 1/2] Minor change to floor usage metrics to avoid misleading 100 quota usage messaging. --- packages/builder/src/stores/portal/licensing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/stores/portal/licensing.js b/packages/builder/src/stores/portal/licensing.js index d927555ceb..179dac9689 100644 --- a/packages/builder/src/stores/portal/licensing.js +++ b/packages/builder/src/stores/portal/licensing.js @@ -87,7 +87,7 @@ export const createLicensingStore = () => { return keys.reduce((acc, key) => { const quotaLimit = license[key].value const quotaUsed = (quota[key] / quotaLimit) * 100 - acc[key] = quotaLimit > -1 ? Math.round(quotaUsed) : -1 + acc[key] = quotaLimit > -1 ? Math.floor(quotaUsed) : -1 return acc }, {}) } From 30622a53bf028a344158e42f16f6842d27e7f8e5 Mon Sep 17 00:00:00 2001 From: Dean Date: Mon, 26 Sep 2022 09:52:20 +0100 Subject: [PATCH 2/2] Ensure display values for metrics are capped at 100% in the day pass modal --- .../components/portal/licensing/DayPassWarningModal.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/portal/licensing/DayPassWarningModal.svelte b/packages/builder/src/components/portal/licensing/DayPassWarningModal.svelte index b1aade2ca5..341e427bf0 100644 --- a/packages/builder/src/components/portal/licensing/DayPassWarningModal.svelte +++ b/packages/builder/src/components/portal/licensing/DayPassWarningModal.svelte @@ -12,7 +12,10 @@ $: daysRemaining = $licensing.quotaResetDaysRemaining $: quotaResetDate = $licensing.quotaResetDate - $: dayPassesUsed = $licensing.usageMetrics?.dayPasses + $: dayPassesUsed = + $licensing.usageMetrics?.dayPasses > 100 + ? 100 + : $licensing.usageMetrics?.dayPasses $: dayPassesTitle = dayPassesUsed >= 100 ? "You have run out of Day Passes"