From 4da58241b30e74e30f42a1fa1fa82eb6defd7027 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 10 Sep 2021 08:25:14 +0100 Subject: [PATCH 1/3] Fix issue with nullish progress value in progress circle component --- packages/bbui/src/ProgressCircle/ProgressCircle.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/bbui/src/ProgressCircle/ProgressCircle.svelte b/packages/bbui/src/ProgressCircle/ProgressCircle.svelte index 9c8181ec7c..5938827617 100644 --- a/packages/bbui/src/ProgressCircle/ProgressCircle.svelte +++ b/packages/bbui/src/ProgressCircle/ProgressCircle.svelte @@ -17,6 +17,8 @@ export let minValue = 0 export let maxValue = 100 + $: console.log(value) + let subMask1Style let subMask2Style $: calculateSubMasks(value) @@ -42,7 +44,7 @@
From 2f986bedf1c7fc14d2db6ce65febade5b7ff9bfe Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 10 Sep 2021 08:25:30 +0100 Subject: [PATCH 2/3] Fix bug with determining checklist progress --- packages/builder/src/stores/portal/admin.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/builder/src/stores/portal/admin.js b/packages/builder/src/stores/portal/admin.js index 24b8c31aab..152a7c6e3b 100644 --- a/packages/builder/src/stores/portal/admin.js +++ b/packages/builder/src/stores/portal/admin.js @@ -25,20 +25,14 @@ export function createAdminStore() { `/api/global/configs/checklist?tenantId=${tenantId}` ) const json = await response.json() - - const onboardingSteps = Object.keys(json) - - const stepsComplete = onboardingSteps.reduce( - (score, step) => (score + step.checked ? 1 : 0), - 0 - ) + const totalSteps = Object.keys(json).length + const completedSteps = Object.values(json).filter(x => x?.checked).length await getFlags() admin.update(store => { store.loaded = true store.checklist = json - store.onboardingProgress = - (stepsComplete / onboardingSteps.length) * 100 + store.onboardingProgress = (completedSteps / totalSteps) * 100 return store }) } catch (err) { From ed5cb41d63c15d2da6bb42e5243a8e9bc3801916 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 10 Sep 2021 08:30:20 +0100 Subject: [PATCH 3/3] Remove log --- packages/bbui/src/ProgressCircle/ProgressCircle.svelte | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/bbui/src/ProgressCircle/ProgressCircle.svelte b/packages/bbui/src/ProgressCircle/ProgressCircle.svelte index 5938827617..a86de55423 100644 --- a/packages/bbui/src/ProgressCircle/ProgressCircle.svelte +++ b/packages/bbui/src/ProgressCircle/ProgressCircle.svelte @@ -17,8 +17,6 @@ export let minValue = 0 export let maxValue = 100 - $: console.log(value) - let subMask1Style let subMask2Style $: calculateSubMasks(value)