Skip to main content
Sign in
Snippets Groups Projects
Commit 5424686f authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Corrige les couleurs du chomage_brut et de la retraite_brute

parent f0acbd4f
No related branches found
No related tags found
No related merge requests found
...@@ -129,7 +129,9 @@ ...@@ -129,7 +129,9 @@
let svgPadding = { bottom: 20, left: 8, right: 20, top: 20 } let svgPadding = { bottom: 20, left: 8, right: 20, top: 20 }
let grapheExplanationOpen = $state(false) let grapheExplanationOpen = $state(false)
let variableCustomizations = $state(variableCustomizationsBase) let variableCustomizations = $state(
structuredClone(variableCustomizationsBase),
)
let variableValues: VariableGraph[][] = $state([]) let variableValues: VariableGraph[][] = $state([])
let variableGroups: { let variableGroups: {
css?: string css?: string
...@@ -137,7 +139,7 @@ ...@@ -137,7 +139,7 @@
name?: string name?: string
hideOpen?: boolean hideOpen?: boolean
variables: VariableGraph[] variables: VariableGraph[]
}[] = $state() }[] = $state([])
let visibleDecompositionsGraph: VisibleDecompositionForGraph[] | undefined = let visibleDecompositionsGraph: VisibleDecompositionForGraph[] | undefined =
$state(undefined) $state(undefined)
...@@ -168,8 +170,8 @@ ...@@ -168,8 +170,8 @@
) { ) {
untrack(() => { untrack(() => {
const ressourcesBrutes = [ const ressourcesBrutes = [
"remuneration_brute",
"chomage_brut", "chomage_brut",
"remuneration_brute",
"retraite_brute", "retraite_brute",
] ]
...@@ -240,10 +242,9 @@ ...@@ -240,10 +242,9 @@
] ]
const splitIndex = const splitIndex =
prelevementsValues.findIndex( prelevementsValues.findLastIndex((variable) =>
(variable) => variable.name === "remuneration_brute", ressourcesBrutes.includes(variable.name),
) + 1 ) + 1
variableGroups = [ variableGroups = [
{ {
variables: [ variables: [
...@@ -273,16 +274,13 @@ ...@@ -273,16 +274,13 @@
for (const row of variable.rows) { for (const row of variable.rows) {
const key = `${variable.name}_${row.calculationName}` const key = `${variable.name}_${row.calculationName}`
if ( if (
!Object.keys(variableCustomizations).includes(key) && variableCustomizations[variable.name] === undefined ||
((row.calculationName !== "law" && (variableCustomizations[key] === undefined &&
row.calculationName !== "revaluation") || row.calculationName !== "law" &&
!Object.keys(variableCustomizations).includes( row.calculationName !== "revaluation")
variable.name,
))
) { ) {
const types = ["base", "prelevement", "prestation"] const types = ["base", "prelevement", "prestation"]
variableCustomizations[key] = JSON.parse( variableCustomizations[key] = structuredClone(
JSON.stringify(
variableCustomizations[ variableCustomizations[
getVariableCustomizationName( getVariableCustomizationName(
variable.parent, variable.parent,
...@@ -294,7 +292,6 @@ ...@@ -294,7 +292,6 @@
? "law" ? "law"
: row.calculationName : row.calculationName
], ],
),
) )
} }
} }
...@@ -369,16 +366,13 @@ ...@@ -369,16 +366,13 @@
for (const row of variable.rows) { for (const row of variable.rows) {
const key = `${variable.name}_${row.calculationName}` const key = `${variable.name}_${row.calculationName}`
if ( if (
!Object.keys(variableCustomizations).includes(key) && variableCustomizations[variable.name] === undefined ||
((row.calculationName !== "law" && (variableCustomizations[key] === undefined &&
row.calculationName !== "revaluation") || row.calculationName !== "law" &&
!Object.keys(variableCustomizations).includes( row.calculationName !== "revaluation")
variable.name,
))
) { ) {
const types = ["base", "cotisation", "allegement"] const types = ["base", "cotisation", "allegement"]
variableCustomizations[key] = JSON.parse( variableCustomizations[key] = structuredClone(
JSON.stringify(
variableCustomizations[ variableCustomizations[
getVariableCustomizationName( getVariableCustomizationName(
variable.parent, variable.parent,
...@@ -390,7 +384,6 @@ ...@@ -390,7 +384,6 @@
? "law" ? "law"
: row.calculationName : row.calculationName
], ],
),
) )
} }
} }
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment