Skip to content

Commit

Permalink
chore: add aliases for MeMi and Modell 2 chapter (#208)
Browse files Browse the repository at this point in the history
Add aliases for `MeMi` and `Modell 2` chapter
  • Loading branch information
OLILHR authored Jan 29, 2025
1 parent 91875e7 commit 97e47d9
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/lib/components/features/filter-chapter-select.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@
}
}
// map chapter aliases for "MeMi" and "Modell 2" due to their names being way too long and messing with the <select>
const chapterMapping: Record<string, string> = {
"Prozesse zur Ermittlung und Abrechnung von Mehr-/Mindermengen Strom und Gas":
"MeMi",
"Zum Modell 2 zur ladevorgangscharfen bilanziellen Energiemengenzuordnungsmöglichkeit":
"Modell 2",
};
// get chapter alias if one exists, otherwise get original chapter name
function getChapterName(chapterName: string): string {
return chapterMapping[chapterName] || chapterName;
}
onMount(() => {
if (initialChapters.length > 0) {
selectedChapters = new Set(initialChapters);
Expand Down Expand Up @@ -107,7 +120,7 @@
on:click={() => removeChapter(chapter)}
disabled={isDisabled}
>
{chapter}
{getChapterName(chapter)}
<svg
class="w-4 h-4 ml-1"
viewBox="0 0 24 24"
Expand All @@ -133,7 +146,9 @@
<option value="" class="hidden"> </option>
{#each availableChapters as chapter}
{#if !selectedChapters.has(chapter)}
<option value={chapter} class="bg-primary">{chapter}</option>
<option value={chapter} class="bg-primary" title={chapter}
>{getChapterName(chapter)}</option
>
{/if}
{/each}
</select>
Expand Down

0 comments on commit 97e47d9

Please sign in to comment.