Browse Source
Merge pull request #2587 from Budibase/fix-checklist
Fix checklist spinner and progress
pull/2588/head
Andrew Kingston
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
4 additions and
10 deletions
-
packages/bbui/src/ProgressCircle/ProgressCircle.svelte
-
packages/builder/src/stores/portal/admin.js
|
|
|
@ -42,7 +42,7 @@ |
|
|
|
|
|
|
|
<div |
|
|
|
on:click |
|
|
|
class:spectrum-ProgressCircle--indeterminate={!value} |
|
|
|
class:spectrum-ProgressCircle--indeterminate={value == null} |
|
|
|
class:spectrum-ProgressCircle--overBackground={overBackground} |
|
|
|
class="spectrum-ProgressCircle spectrum-ProgressCircle--{convertSize(size)}" |
|
|
|
> |
|
|
|
|
|
|
|
@ -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) { |
|
|
|
|