From c76127aff95870e6ce805ceea5dbcdab8317caf9 Mon Sep 17 00:00:00 2001 From: monsieurswag Date: Thu, 11 Apr 2024 09:08:15 +0200 Subject: [PATCH 1/2] Improve user detail view and edit view breadcrumbs --- .../lib/components/Breadcrumbs/Breadcrumbs.svelte | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/Breadcrumbs/Breadcrumbs.svelte b/frontend/src/lib/components/Breadcrumbs/Breadcrumbs.svelte index 742e254fc..4480f1c83 100644 --- a/frontend/src/lib/components/Breadcrumbs/Breadcrumbs.svelte +++ b/frontend/src/lib/components/Breadcrumbs/Breadcrumbs.svelte @@ -29,8 +29,16 @@ crumbs = tokens.map((t) => { tokenPath += '/' + t; if (t === $breadcrumbObject.id) { - if ($breadcrumbObject.name) t = $breadcrumbObject.name; - else t = $breadcrumbObject.email; + if ($breadcrumbObject.name) { + t = $breadcrumbObject.name; + } else if ($breadcrumbObject.first_name) { + t = $breadcrumbObject.first_name; + if ($breadcrumbObject.last_name) { + t = `${t} ${$breadcrumbObject.last_name}`; + } + } else { + t = $breadcrumbObject.email; + } } else if (t === 'folders') { t = 'domains'; } From dc5b6f81e5c8349c9510025ca30618304963fc1c Mon Sep 17 00:00:00 2001 From: monsieurswag Date: Mon, 15 Apr 2024 17:07:34 +0200 Subject: [PATCH 2/2] Only display the first_name+last_name combination for the user views breadcrumb --- frontend/src/lib/components/Breadcrumbs/Breadcrumbs.svelte | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/frontend/src/lib/components/Breadcrumbs/Breadcrumbs.svelte b/frontend/src/lib/components/Breadcrumbs/Breadcrumbs.svelte index 4480f1c83..7a537f57b 100644 --- a/frontend/src/lib/components/Breadcrumbs/Breadcrumbs.svelte +++ b/frontend/src/lib/components/Breadcrumbs/Breadcrumbs.svelte @@ -31,11 +31,8 @@ if (t === $breadcrumbObject.id) { if ($breadcrumbObject.name) { t = $breadcrumbObject.name; - } else if ($breadcrumbObject.first_name) { - t = $breadcrumbObject.first_name; - if ($breadcrumbObject.last_name) { - t = `${t} ${$breadcrumbObject.last_name}`; - } + } else if ($breadcrumbObject.first_name && $breadcrumbObject.last_name) { + t = `${$breadcrumbObject.first_name} ${$breadcrumbObject.last_name}`; } else { t = $breadcrumbObject.email; }