Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #974 from solita/bugfix/AE-2025-valvonnat-table-fix
Browse files Browse the repository at this point in the history
AE-2025: Add missing column when valvonta is not active
  • Loading branch information
solita-juhohaa authored Nov 14, 2023
2 parents f2e161e + 2aa6e18 commit 91e131c
Showing 1 changed file with 55 additions and 32 deletions.
87 changes: 55 additions & 32 deletions src/pages/valvonta-kaytto/valvonnat.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@
<tr
class="etp-table--tr etp-table--tr__link"
on:click={toValvontaView(valvonta)}>
<!-- valvonta -->
<!-- Valvonta -->
<td
class="etp-table--td"
class:font-bold={Valvojat.isSelfInValvonta(
Expand All @@ -354,49 +354,71 @@
valvonta['valvoja-id']
)}
</td>
<!-- Diaarinumero -->
<td class="etp-table--td">
{Maybe.orSome('-', diaarinumero(valvonta))}
</td>
{#each Maybe.toArray(valvonta.lastToimenpide) as toimenpide}
<td class="etp-table--td">
{Locales.labelForId(
$locale,
toimenpidetyypit
)(toimenpide['type-id'])}
</td>
<td class="etp-table--td">
{Maybe.fold(
'',
getTemplateName(templates),
toimenpide['template-id']
)}
</td>
<td
class="etp-table--td"
class:font-bold={R.anyPass([
isTodayDeadline,
isPastDeadline
])(toimenpide)}
class:text-primary={isTodayDeadline(toimenpide)}
class:text-error={isPastDeadline(toimenpide)}>
{formatDeadline(toimenpide)}
</td>
{/each}
{#if Maybe.isNone(valvonta.lastToimenpide)}
<td class="etp-table--td">
{i18n(i18nRoot + '.last-toimenpide-none')}
</td>
<td class="etp-table--td">-</td>
{/if}
<!-- Edellinen tapahtuma -->
<td class="etp-table--td">
{Maybe.fold(
i18n(i18nRoot + '.last-toimenpide-none'),
toimenpide =>
Locales.labelForId(
$locale,
toimenpidetyypit
)(toimenpide['type-id']),
valvonta.lastToimenpide
)}
</td>
<!-- Asiakirjapohja -->
<td class="etp-table--td">
{Maybe.fold(
'-',
toimenpide =>
Maybe.fold(
'',
getTemplateName(templates),
toimenpide['template-id']
),
valvonta.lastToimenpide
)}
</td>
<!-- Määräaika -->
<td
class="etp-table--td"
class:text-error={Maybe.fold(
false,
isPastDeadline,
valvonta.lastToimenpide
)}
class:text-primary={Maybe.fold(
false,
isTodayDeadline,
valvonta.lastToimenpide
)}
class:font-bold={Maybe.fold(
false,
R.anyPass([isTodayDeadline, isPastDeadline]),
valvonta.lastToimenpide
)}>
{Maybe.fold(
'-',
toimenpide => formatDeadline(toimenpide),
valvonta.lastToimenpide
)}
</td>
<!-- Rakennustunnus -->
<td class="etp-table--td">
{Maybe.orSome('-', valvonta.rakennustunnus)}
</td>
<!-- Osoite -->
<td class="etp-table--td">
<Address
{postinumerot}
katuosoite={Maybe.Some(valvonta.katuosoite)}
postinumero={valvonta.postinumero} />
</td>
<!-- Omistajat -->
<td class="etp-table--td">
{R.join(
', ',
Expand All @@ -406,6 +428,7 @@
)
)}
</td>
<!-- Energiatodistus -->
<td class="etp-table--td" on:click|stopPropagation>
{#each Maybe.toArray(valvonta.energiatodistus) as energiatodistus}
<Link
Expand Down

0 comments on commit 91e131c

Please sign in to comment.