Skip to content
Snippets Groups Projects
Commit b3c7c1d8 authored by Toufic Batache's avatar Toufic Batache
Browse files

Fix filters for virtual variables

parent f4f74317
No related branches found
No related tags found
No related merge requests found
Pipeline #14579 passed
<script lang="ts">
import { scaleByInstantFromBrackets } from "@openfisca/json-model"
import {
scaleByInstantFromBrackets,
type Variable,
} from "@openfisca/json-model"
import { createEventDispatcher, getContext } from "svelte"
import type { Writable } from "svelte/store"
......@@ -179,6 +182,7 @@
filterValueByName,
showOnlyDeciles,
filterNiveauDeVieValue,
variableSummary,
)
$: filterValueByName = Object.fromEntries(
......@@ -222,6 +226,7 @@
},
showOnlyDeciles: boolean,
filterNiveauDeVie: string | undefined,
variableSummary: Variable | undefined,
): [Situation, number][] {
const filtered: [Situation, number][] = []
for (const [index, situation] of testCases.entries()) {
......@@ -377,7 +382,7 @@
}
}
}
if (filterValueByName["dispositif"]) {
if (filterValueByName["dispositif"] && variableSummary !== undefined) {
const latestCalculationValue = getLatestCalculation(
$evaluationByNameArray[index][variableName]
?.calculationEvaluationByName,
......@@ -423,7 +428,7 @@
<div class="mt-2 flex flex-wrap gap-2">
{#each filters as filter}
{#if filter.name !== "dispositif" || shortLabel}
{#if filter.name !== "dispositif" || variableSummary !== undefined}
<button
class="relative flex items-center gap-1 px-3 py-1 rounded-full overflow-hidden transition after:absolute after:inset-0 after:rounded-full after:transition hover:after:bg-black/5 active:after:bg-black/10"
class:bg-gray-200={filter.value === false}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment