From 2aa6e1875c1813c5bf6af02d9979cd37e59ad552 Mon Sep 17 00:00:00 2001 From: Juho Haapakoski Date: Fri, 10 Nov 2023 10:39:48 +0200 Subject: [PATCH] AE-2025: Add missing column when valvonta is not active Refactored columns' code to have one column's code in the same place --- src/pages/valvonta-kaytto/valvonnat.svelte | 87 ++++++++++++++-------- 1 file changed, 55 insertions(+), 32 deletions(-) diff --git a/src/pages/valvonta-kaytto/valvonnat.svelte b/src/pages/valvonta-kaytto/valvonnat.svelte index f264d37f..017b82c9 100644 --- a/src/pages/valvonta-kaytto/valvonnat.svelte +++ b/src/pages/valvonta-kaytto/valvonnat.svelte @@ -337,7 +337,7 @@ - + + {Maybe.orSome('-', diaarinumero(valvonta))} - {#each Maybe.toArray(valvonta.lastToimenpide) as toimenpide} - - {Locales.labelForId( - $locale, - toimenpidetyypit - )(toimenpide['type-id'])} - - - {Maybe.fold( - '', - getTemplateName(templates), - toimenpide['template-id'] - )} - - - {formatDeadline(toimenpide)} - - {/each} - {#if Maybe.isNone(valvonta.lastToimenpide)} - - {i18n(i18nRoot + '.last-toimenpide-none')} - - - - {/if} + + + {Maybe.fold( + i18n(i18nRoot + '.last-toimenpide-none'), + toimenpide => + Locales.labelForId( + $locale, + toimenpidetyypit + )(toimenpide['type-id']), + valvonta.lastToimenpide + )} + + + + {Maybe.fold( + '-', + toimenpide => + Maybe.fold( + '', + getTemplateName(templates), + toimenpide['template-id'] + ), + valvonta.lastToimenpide + )} + + + + {Maybe.fold( + '-', + toimenpide => formatDeadline(toimenpide), + valvonta.lastToimenpide + )} + + {Maybe.orSome('-', valvonta.rakennustunnus)} +
+ {R.join( ', ', @@ -406,6 +428,7 @@ ) )} + {#each Maybe.toArray(valvonta.energiatodistus) as energiatodistus}