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

- Si un filtre est décoché, seulement exclure le cas type si TOUS les individus sont concernés

parent e0ebae6d
No related branches found
No related tags found
No related merge requests found
Pipeline #14504 passed
......@@ -249,7 +249,7 @@
if (filterValueByName["celibataire"] || filterValueByName["couple"]) {
if (filterValueByName["celibataire"] === false) {
if (
Object.keys(familySituation).some(
Object.keys(familySituation).every(
(populationId) =>
`${getVariableValue(situation, "en_couple", populationId)}` ===
"false",
......@@ -260,7 +260,7 @@
}
if (filterValueByName["couple"] === false) {
if (
Object.keys(familySituation).some(
Object.keys(familySituation).every(
(populationId) =>
`${getVariableValue(situation, "en_couple", populationId)}` ===
"true",
......@@ -276,7 +276,7 @@
) {
if (filterValueByName["sans_enfant"] === false) {
if (
Object.values(familySituation).some(
Object.values(familySituation).every(
({ enfants }) => (enfants ?? []).length === 0,
)
) {
......@@ -285,7 +285,7 @@
}
if (filterValueByName["avec_enfant"] === false) {
if (
Object.values(familySituation).some(
Object.values(familySituation).every(
({ enfants }) => (enfants ?? []).length > 0,
)
) {
......@@ -301,7 +301,7 @@
) {
if (filterValueByName["salarie_prive"] === false) {
if (
adultsPopulationIds.some(
adultsPopulationIds.every(
(populationId) =>
getVariableValue(situation, "activite", populationId) ===
"actif" &&
......@@ -315,7 +315,7 @@
}
if (filterValueByName["salarie_public"] === false) {
if (
adultsPopulationIds.some(
adultsPopulationIds.every(
(populationId) =>
getVariableValue(situation, "activite", populationId) ===
"actif" &&
......@@ -329,7 +329,7 @@
}
if (filterValueByName["retraite"] === false) {
if (
adultsPopulationIds.some(
adultsPopulationIds.every(
(populationId) =>
getVariableValue(situation, "activite", populationId) ===
"retraite",
......@@ -340,7 +340,7 @@
}
if (filterValueByName["chomeur_inactif"] === false) {
if (
adultsPopulationIds.some((populationId) =>
adultsPopulationIds.every((populationId) =>
["chomeur", "inactif"].includes(
getVariableValue(situation, "activite", populationId),
),
......@@ -356,7 +356,7 @@
) {
if (filterValueByName["locataire"] === false) {
if (
Object.keys(householdSituation).some(
Object.keys(householdSituation).every(
(populationId) =>
getVariableValue(
situation,
......@@ -370,7 +370,7 @@
}
if (filterValueByName["proprietaire"] === false) {
if (
Object.keys(householdSituation).some(
Object.keys(householdSituation).every(
(populationId) =>
!/^locataire_/.test(
`${getVariableValue(situation, "statut_occupation_logement", populationId)}`,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment