From 1c65e2b63ae29d7bf3043f9695a3f61c40ce7f41 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 27 Jul 2022 12:55:20 +0100 Subject: [PATCH 01/30] Fix issue showing selected component indicators on initial load sometimes due to null reference --- packages/client/src/components/preview/IndicatorSet.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/client/src/components/preview/IndicatorSet.svelte b/packages/client/src/components/preview/IndicatorSet.svelte index bbd03aa974..662741d100 100644 --- a/packages/client/src/components/preview/IndicatorSet.svelte +++ b/packages/client/src/components/preview/IndicatorSet.svelte @@ -72,6 +72,7 @@ // Sanity limit of 100 active indicators const children = Array.from(parents) .map(parent => parent?.children?.[0]) + .filter(x => x != null) .slice(0, 100) // If there aren't any nodes then reset From e47fbf2df18c6b7f8d4b7f807b5d53b891379587 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 29 Jul 2022 14:04:31 +0100 Subject: [PATCH 02/30] Fix name showing undefined in users tab and fix initials always being PC --- .../portal/manage/users/[userId].svelte | 42 ++++++++++++++++--- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte b/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte index 28c5aa2593..fcab9be06a 100644 --- a/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte +++ b/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte @@ -44,6 +44,8 @@ $: hasGroupsLicense = $auth.user?.license.features.includes( Constants.Features.USER_GROUPS ) + $: nameLabel = getNameLabel($userFetch) + $: initials = getInitials(nameLabel, $userFetch) $: allAppList = $apps .filter(x => { @@ -86,6 +88,38 @@ const userFetch = fetchData(`/api/global/users/${userId}`) + const getNameLabel = userFetch => { + const { firstName, lastName } = userFetch?.data || {} + if (!firstName && !lastName) { + return "Name unavailable" + } + let label + if (firstName) { + label = firstName + if (lastName) { + label += ` ${lastName}` + } + } else { + label = lastName + } + return label + } + + const getInitials = (nameLabel, userFetch) => { + if (nameLabel !== "Name unavailable") { + return nameLabel + .split(" ") + .slice(0, 2) + .map(x => x[0]) + .join("") + } + const { email } = userFetch?.data || {} + if (!email) { + return "PC" + } + return email.substring(0, 2) + } + function getHighestRole(roles) { let highestRole let highestRoleNumber = 0 @@ -186,13 +220,9 @@
- +
- {$userFetch?.data?.firstName + - " " + - $userFetch?.data?.lastName} + {nameLabel} {$userFetch?.data?.email}
From 219842248a1cbf561eb6a7603a87582a8682372b Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 29 Jul 2022 14:07:42 +0100 Subject: [PATCH 03/30] Remove global style rules that set top left border radius to 0 for all pickers --- .../portal/manage/users/_components/AddUserModal.svelte | 6 ------ .../portal/manage/users/_components/ImportUsersModal.svelte | 4 ---- .../portal/manage/users/_components/PasswordModal.svelte | 4 ---- 3 files changed, 14 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/manage/users/_components/AddUserModal.svelte b/packages/builder/src/pages/builder/portal/manage/users/_components/AddUserModal.svelte index 1997d4292a..89ead7f3d2 100644 --- a/packages/builder/src/pages/builder/portal/manage/users/_components/AddUserModal.svelte +++ b/packages/builder/src/pages/builder/portal/manage/users/_components/AddUserModal.svelte @@ -78,9 +78,3 @@ /> {/if} - - diff --git a/packages/builder/src/pages/builder/portal/manage/users/_components/ImportUsersModal.svelte b/packages/builder/src/pages/builder/portal/manage/users/_components/ImportUsersModal.svelte index 64334b4ab2..bc8a0d1f1f 100644 --- a/packages/builder/src/pages/builder/portal/manage/users/_components/ImportUsersModal.svelte +++ b/packages/builder/src/pages/builder/portal/manage/users/_components/ImportUsersModal.svelte @@ -108,10 +108,6 @@