From 22affb8d5ff8c8a2e0bdc70d8aab7888bef0bed7 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 13 Jan 2023 08:39:52 +0000 Subject: [PATCH] Improve users page loading experience --- .../builder/portal/users/users/index.svelte | 112 +++++++++--------- 1 file changed, 55 insertions(+), 57 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/users/users/index.svelte b/packages/builder/src/pages/builder/portal/users/users/index.svelte index c8f736e465..3bc18f5ddb 100644 --- a/packages/builder/src/pages/builder/portal/users/users/index.svelte +++ b/packages/builder/src/pages/builder/portal/users/users/index.svelte @@ -35,7 +35,7 @@ }, }) - let loaded = false + let groupsLoaded = !$licensing.groupsEnabled || $groups?.length let enrichedUsers = [] let createUserModal, inviteConfirmationModal, @@ -206,69 +206,67 @@ onMount(async () => { try { - loaded = false await groups.actions.init() - loaded = true + groupsLoaded = true } catch (error) { - notifications.error("Error fetching User Group data") + notifications.error("Error fetching user group data") } }) -{#if loaded && $fetch.loaded} - - - Users - Add users and control who gets access to your published apps - - -
- - - - -
- - {#if selectedRows.length > 0} - - {/if} -
-
- $goto(`./${detail._id}`)} - {schema} - bind:selectedRows - data={enrichedUsers} - allowEditColumns={false} - allowEditRows={false} - allowSelectRows={!readonly} - {customRenderers} - /> - + + + Users + Add users and control who gets access to your published apps -{/if} + +
+ + + + +
+ + {#if selectedRows.length > 0} + + {/if} +
+
+
$goto(`./${detail._id}`)} + {schema} + bind:selectedRows + data={enrichedUsers} + allowEditColumns={false} + allowEditRows={false} + allowSelectRows={!readonly} + {customRenderers} + loading={!$fetch.loaded || !groupsLoaded} + /> + +