diff --git a/example.env b/example.env index 593a054ecccafcdfd040a3c6c9848c66b6f25f78..42dd53018c93c4fea61201cf03a4344f30bf13ac 100644 --- a/example.env +++ b/example.env @@ -79,16 +79,10 @@ PROXY=false # Reform name must belong to a name of an OpenFisca reform in metadata.json # REFORM=reforme_test_1 -# Whether reform has mock values or not -# REFORM_MOCK_VALUES=false - # Optional name of revaluation reform to use # Reform name must belong to a name of an OpenFisca reform in metadata.json # REFORM_REVALUATION=contrefactuel_plf -# Indique que la réforme PLF est fausse si cette variable est à true. -REFORM_MOCK_VALUES=false - # Show intro balloons. SHOW_TUTORIAL=true diff --git a/src/lib/components/IntroWarningBillModal.svelte b/src/lib/components/IntroWarningBillModal.svelte deleted file mode 100644 index fa5b305929696f470074c74743b06fa8dd0af1b4..0000000000000000000000000000000000000000 --- a/src/lib/components/IntroWarningBillModal.svelte +++ /dev/null @@ -1,146 +0,0 @@ -<script lang="ts"> - import { - Dialog, - DialogDescription, - DialogOverlay, - Transition, - TransitionChild, - } from "@rgossiaux/svelte-headlessui" - import { getContext } from "svelte" - import type { Writable } from "svelte/store" - - export let isOpen = false - - const yearPLF = getContext("yearPLF") as Writable<number> - - function onClose() { - isOpen = false - } -</script> - -<Transition appear show={isOpen}> - <Dialog - as="div" - class="fixed inset-0 z-50 overflow-y-auto" - on:close={onClose} - > - <div class="min-h-screen px-4 text-center"> - <TransitionChild - enter="ease-out duration-300" - enterFrom="opacity-0" - enterTo="opacity-100" - leave="ease-in duration-200" - leaveFrom="opacity-100" - leaveTo="opacity-0" - > - <DialogOverlay - class="fixed inset-0 bg-gray-500 opacity-50 transition-opacity" - /> - </TransitionChild> - - <!-- This element is to trick the browser into centering the modal contents. --> - <span class="inline-block h-[10vh] align-middle" aria-hidden="true"> - ​ - </span> - - <TransitionChild - enter="ease-out duration-300" - enterFrom="opacity-0 scale-95" - enterTo="opacity-100 scale-100" - leave="ease-in duration-200" - leaveFrom="opacity-100 scale-100" - leaveTo="opacity-0 scale-95" - > - <div - class="inline-block align-middle my-8 w-full max-w-4xl transform overflow-hidden rounded-md bg-white text-left shadow-xl transition-all" - > - <div - class="flex items-center justify-between bg-orange-200 border-b border-orange-700 p-4 px-10" - > - <span - class="text-orange-800 font-bold uppercase tracking-wider text-xl" - > - Important : Hypothèses dans l'attente des PLF/PLFSS {$yearPLF} - </span> - <button - type="button" - class="focus:outline-none whitespace-normal rounded-lg focus:ring-2 p-1.5 focus:ring-orange-200 hover:bg-orange-100 active:bg-orange-300 ml-auto" - aria-label="Close modal" - on:click={onClose} - ><span class="sr-only">Close modal</span> - <iconify-icon class="block text-4xl" icon="ri-close-line" /> - </button> - </div> - <DialogDescription - as="div" - class="flex flex-col gap-5 px-10 pb-10 pt-5" - > - <p class="w-full text-left text-lg"> - Le simulateur est désormais configuré pour {$yearPLF}. - <span class="font-bold" - >⚠️ Le droit attendu pour {$yearPLF} actuellement affiché doit être - confirmé en octobre</span - > - avec le projet de loi de finances et le projet de loi de financement - de la sécurité sociale. - </p> - <div - class="grid grid-cols-1 md:grid-cols-3 justify-between items-start gap-8" - > - <div class="flex flex-col col-span-1 text-center justify-center"> - <p> - <iconify-icon - class="text-6xl text-le-gris-dispositif-dark text-center scale-x-[-1]" - icon="ri-history-fill" - /> - </p> - <p> - <span class="font-bold" - >Le simulateur estime une situation en {$yearPLF}</span - > - (et non plus en {$yearPLF - 1}).<br /> Vos réformes sont donc - comparées au - <span class="font-bold italic" - >"droit attendu en {$yearPLF}"</span - > - </p> - </div> - <div class="col-span-1 text-center"> - <p> - <iconify-icon - class="text-6xl text-le-gris-dispositif-dark text-center" - icon="ri-funds-line" - /> - </p> - <p> - <span class="font-bold" - ><span class="italic">Droit attendu {$yearPLF} ?</span> - <br />Les paramètres sont revalorisés - </span> <br />lorsqu'il est d'usage que leurs montants soient - indexés sur l'inflation. - </p> - </div> - <div class="col-span-1 text-center"> - <p class="text-5xl text-center mb-4">⚠️</p> - <p> - Le <span class="font-bold italic" - >"droit attendu en {$yearPLF}"</span - > - actuellement affiché utilise des - <span class="text-orange-800 bg-orange-200 px-1 font-bold" - >hypothèses d'inflation qui doivent être confirmées</span - > - avec le PLF* et le PLFSS** en octobre {$yearPLF - 1}. - </p> - </div> - </div> - <p class="text-xs text-gray-600"> - *PLF : Projet de loi de finances<br />**PLFSS : Projet de loi de - financement de la sécurité sociale - </p> - </DialogDescription> - </div> - </TransitionChild> - </div> - </Dialog> -</Transition> diff --git a/src/lib/components/ValueChange.svelte b/src/lib/components/ValueChange.svelte index c879396640cc1eec26e7e26a1d7b3a5b25140437..1c646090490e058f6f47c203bbb3808137b1b64c 100644 --- a/src/lib/components/ValueChange.svelte +++ b/src/lib/components/ValueChange.svelte @@ -2,7 +2,6 @@ import { getContext } from "svelte" import type { Writable } from "svelte/store" - import IntroWarningBillModal from "$lib/components/IntroWarningBillModal.svelte" import type { ParametricReform } from "$lib/reforms" import { type CalculationByName } from "$lib/situations" import { valueFormatter } from "$lib/values" @@ -17,11 +16,9 @@ export let valueByCalculationName: VariableValueByCalculationName const billActive = getContext("billActive") as Writable<boolean> - const billMockValues = getContext("billMockValues") as Writable<boolean> const calculationByName = getContext( "calculationByName", ) as Writable<CalculationByName> - let introWarningBillModalOpen = false const parametricReform = getContext( "parametricReform", ) as Writable<ParametricReform> @@ -169,18 +166,6 @@ > PLF/PLFSS {$yearPLF} <br /> - {#if $billMockValues} - <!-- FAUX PLF--> - <span class="bg-orange-200 px-1"> - ⚠️ - <button - class="italic text-orange-800 hover:underline cursor-pointer" - on:click={() => (introWarningBillModalOpen = true)} - > - à confirmer avec PLF/PLFSS - </button> - </span> - {/if} </span> {/if} </span> @@ -200,18 +185,6 @@ > PLF/PLFSS {$yearPLF} <br /> - {#if $billMockValues} - <!-- FAUX PLF--> - <span class="bg-orange-200 px-1"> - ⚠️ - <button - class="italic text-orange-800 hover:underline cursor-pointer" - on:click={() => (introWarningBillModalOpen = true)} - > - à confirmer avec PLF/PLFSS - </button> - </span> - {/if} </span> {/if} </span> @@ -248,5 +221,3 @@ {/if} </span> {/if} - -<IntroWarningBillModal bind:isOpen={introWarningBillModalOpen} /> diff --git a/src/lib/components/ValueChangeCompare.svelte b/src/lib/components/ValueChangeCompare.svelte index 4ffbe2a7f236e2ade76dca752aa7916cad9906a4..4c812c73ad1247cb741fc0be83aac552a12d99e5 100644 --- a/src/lib/components/ValueChangeCompare.svelte +++ b/src/lib/components/ValueChangeCompare.svelte @@ -2,7 +2,6 @@ import { getContext } from "svelte" import type { Writable } from "svelte/store" - import IntroWarningBillModal from "$lib/components/IntroWarningBillModal.svelte" import type { ParametricReform } from "$lib/reforms" import type { CalculationByName } from "$lib/situations" import { valueFormatter } from "$lib/values" @@ -15,11 +14,9 @@ export let valueByCalculationName1: VariableValueByCalculationName const billActive = getContext("billActive") as Writable<boolean> - const billMockValues = getContext("billMockValues") as Writable<boolean> const calculationByName = getContext( "calculationByName", ) as Writable<CalculationByName> - let introWarningBillModalOpen = false const parametricReform = getContext( "parametricReform", ) as Writable<ParametricReform> @@ -243,25 +240,13 @@ {#if showLoader && runningCalculationNames.includes("bill")} <br /> <div class="flex flex-col items-center"> - <div class="bg-le-rouge-bill blur-xs px-1 text-black animate-pulse-2"> - <span class="blur text-white text-2xl">value €</span> + <div class="animate-pulse-2 bg-le-rouge-bill px-1 text-black blur-xs"> + <span class="text-2xl text-white blur">value €</span> </div> {#if legend} <div class="ml-1 text-xs font-normal text-le-rouge-bill"> PLF/PLFSS {$yearPLF} <br /> - {#if $billMockValues} - <!-- FAUX PLF --> - <span class="bg-orange-200 px-1"> - ⚠️ - <button - class="italic text-orange-800 hover:underline cursor-pointer" - on:click={() => (introWarningBillModalOpen = true)} - > - à confirmer avec PLF/PLFSS - </button> - </span> - {/if} </div> {/if} </div> @@ -280,18 +265,6 @@ <div class="ml-1 text-xs font-normal text-le-rouge-bill"> PLF/PLFSS {$yearPLF} <br /> - {#if $billMockValues} - <!-- FAUX PLF --> - <span class="bg-orange-200 px-1"> - ⚠️ - <button - class="italic text-orange-800 hover:underline cursor-pointer" - on:click={() => (introWarningBillModalOpen = true)} - > - à confirmer avec PLF/PLFSS - </button> - </span> - {/if} </div> {/if} </div> @@ -310,18 +283,6 @@ > PLF/PLFSS {$yearPLF} <br /> - {#if $billMockValues} - <!-- FAUX PLF --> - <span class="bg-orange-200 px-1"> - ⚠️ - <button - class="italic text-orange-800 hover:underline cursor-pointer" - on:click={() => (introWarningBillModalOpen = true)} - > - à confirmer avec PLF/PLFSS - </button> - </span> - {/if} </div> {/if} </div> @@ -338,18 +299,6 @@ > PLF/PLFSS {$yearPLF} <br /> - {#if $billMockValues} - <!-- FAUX PLF --> - <span class="bg-orange-200 px-1"> - ⚠️ - <button - class="italic text-orange-800 hover:underline cursor-pointer" - on:click={() => (introWarningBillModalOpen = true)} - > - à confirmer avec PLF/PLFSS - </button> - </span> - {/if} </div> {/if} </div> @@ -411,5 +360,3 @@ {/if} {/if} </div> - -<IntroWarningBillModal bind:isOpen={introWarningBillModalOpen} /> diff --git a/src/lib/components/variables/InflationLawButton.svelte b/src/lib/components/variables/InflationLawButton.svelte index f0044d98953681b1186c0d367f24e1422e35867b..20a9d047896cb69decbcc4b1f5ad99ea585ac35b 100644 --- a/src/lib/components/variables/InflationLawButton.svelte +++ b/src/lib/components/variables/InflationLawButton.svelte @@ -10,7 +10,6 @@ | undefined export let parameterName: string | undefined - const billMockValues = getContext("billMockValues") as Writable<boolean> const billName = getContext("billName") as Writable<string | undefined> const yearPLF = getContext("yearPLF") as Writable<number> @@ -211,12 +210,6 @@ {#if !parameterName?.startsWith("impot_revenu.bareme_ir_depuis_1945.bareme") && !parameterName?.startsWith("impot_revenu.calcul_impot_revenu.plaf_qf.decote.seuil_couple") && !parameterName?.startsWith("impot_revenu.calcul_impot_revenu.plaf_qf.decote.seuil_celib") && !parameterName?.startsWith("impot_revenu.calcul_impot_revenu.plaf_qf.plafond_avantages_procures_par_demi_part") && !parameterName?.startsWith("impot_revenu.calcul_revenus_imposables.abat_rni.enfant_marie.montant") && !parameterName?.startsWith("impot_revenu.calcul_reductions_impots.dons.dons_coluche.plafond") && !parameterName?.startsWith("impot_revenu.calcul_revenus_imposables.abat_rni.personne_agee_ou_invalide") && !parameterName?.startsWith("impot_revenu.calcul_revenus_imposables.charges_deductibles.accueil_personne_agee.plafond") && !parameterName?.startsWith("impot_revenu.calcul_revenus_imposables.rpns.micro.microentreprise.regime_micro_bnc.marchandises.plafond") && !parameterName?.startsWith("impot_revenu.calcul_revenus_imposables.deductions.abatpen") && !parameterName?.startsWith("impot_revenu.calcul_revenus_imposables.deductions.abatpro") && !parameterName?.startsWith("impot_revenu.calcul_revenus_imposables.rpns.micro.microentreprise.regime_micro_ba.plafond_recettes") && !parameterName?.startsWith("impot_revenu.calcul_revenus_imposables.rpns.micro.microentreprise.regime_micro_bnc.services.plafond") && !parameterName?.startsWith("impot_revenu.calcul_revenus_imposables.charges_deductibles.pensions_alimentaires.plafond")} sur l'inflation à {billInflatorValueFormatted}<br /> - {#if $billMockValues} - <span class="bg-orange-200 text-orange-800 px-1" - >⚠️ - <span class="italic">à confirmer avec PLF/PLFSS</span></span - > - {/if} {/if} <!--<span class="text-le-rouge-bill border-le-rouge-bill border rounded-md px-1" diff --git a/src/lib/components/variables/InflationLawDetails.svelte b/src/lib/components/variables/InflationLawDetails.svelte index 18dcee63fb2c57be9de4b659b21fd444a50df91f..ae31dec44995cf718e665897723bb3b9d648d911 100644 --- a/src/lib/components/variables/InflationLawDetails.svelte +++ b/src/lib/components/variables/InflationLawDetails.svelte @@ -7,7 +7,6 @@ import { getContext } from "svelte" import type { Writable } from "svelte/store" - import IntroWarningBillModal from "$lib/components/IntroWarningBillModal.svelte" import { getUnitAtDate } from "$lib/units" import { formatValue, removeNegativeZero } from "$lib/values" @@ -18,9 +17,7 @@ export let lawParameter: ScaleParameter | ValueParameter | undefined export let revaluationParameter: ScaleParameter | ValueParameter - const billMockValues = getContext("billMockValues") as Writable<boolean> const billName = getContext("billName") as Writable<string | undefined> - let introWarningBillModalOpen = false const revaluationName = getContext("revaluationName") as Writable< string | undefined > @@ -147,8 +144,6 @@ billInflatorValueFormatted !== revaluationInflatorValueFormatted </script> -<IntroWarningBillModal bind:isOpen={introWarningBillModalOpen} /> - <div class="border-b pb-4 mb-4"> {#if !parameterIsScale} <p class="text-le-gris-dispositif-dark text-lg normal-case font-light"> @@ -180,15 +175,6 @@ > {/if} </span> - {#if $billMockValues} - <!-- MONTRER WARNING --> - <button - class="mt-2 font-sans text-base bg-orange-200 px-1 italic text-orange-800 hover:underline cursor-pointer" - on:click={() => (introWarningBillModalOpen = true)} - > - <span class="not-italic">⚠️</span> taux à confirmer avec PLF/PLFSS - </button> - {/if} </p> {:else} <p class="text-le-gris-dispositif-dark text-lg normal-case font-light"> @@ -213,15 +199,6 @@ />En {$yearPLF}, les seuils augmentent de {revaluationInflatorValueFormatted}. </p> {/if} - {#if $billMockValues} - <!-- MONTRER WARNING --> - <button - class="mt-2 font-sans text-base bg-orange-200 px-1 italic text-orange-800 hover:underline cursor-pointer" - on:click={() => (introWarningBillModalOpen = true)} - > - <span class="not-italic">⚠️</span>à confirmer avec PLF/PLFSS - </button> - {/if} {/if} </div> {#if parameterName?.startsWith("impot_revenu.bareme_ir_depuis_1945.bareme")} diff --git a/src/lib/server/auditors/config.ts b/src/lib/server/auditors/config.ts index 55f963eaa968bdf7e262c0753c3dde31dbba4b97..823d0299714aa9f7793281815650df4537438087 100644 --- a/src/lib/server/auditors/config.ts +++ b/src/lib/server/auditors/config.ts @@ -31,13 +31,7 @@ export function auditConfig( const errors: { [key: string]: unknown } = {} const remainingKeys = new Set(Object.keys(data)) - for (const key of [ - "advanced", - "allowRobots", - "proxy", - "reformMockValues", - "showTutorial", - ]) { + for (const key of ["advanced", "allowRobots", "proxy", "showTutorial"]) { audit.attribute( data, key, diff --git a/src/lib/server/config.ts b/src/lib/server/config.ts index befdbb6be29fa6b73216df71a308e595cb338b1f..c586df34a54cab2e1b21f0acc55aeb55bf763104 100644 --- a/src/lib/server/config.ts +++ b/src/lib/server/config.ts @@ -33,7 +33,6 @@ export interface Config { } portalUrl: string proxy: boolean - reformMockValues?: boolean reformName?: string revaluationName?: string showTutorial?: boolean @@ -85,7 +84,6 @@ const [validConfig, error] = validateConfig({ : null, portalUrl: process.env["PORTAL_URL"], proxy: process.env["PROXY"], - reformMockValues: process.env["REFORM_MOCK_VALUES"], reformName: process.env["REFORM"], revaluationName: process.env["REFORM_REVALUATION"], showTutorial: process.env["SHOW_TUTORIAL"], diff --git a/src/routes/+layout.server.ts b/src/routes/+layout.server.ts index f6bc0f01fd1f23e85316b7e3fb873324729647e3..9d94316fd72e2255144c6ae9270d94d4cf11d648 100644 --- a/src/routes/+layout.server.ts +++ b/src/routes/+layout.server.ts @@ -28,7 +28,6 @@ export const load: LayoutServerLoad = async ( } openfiscaRepository: RepositoryConfig portalUrl: string - reformMockValues?: boolean reformName?: string revaluationName?: string showTutorial?: boolean @@ -63,7 +62,6 @@ export const load: LayoutServerLoad = async ( urlTemplate: openfiscaRepository.urlTemplate, }, portalUrl: config.portalUrl, - reformMockValues: config.reformMockValues, reformName: config.reformName, revaluationName: config.revaluationName, showTutorial: config.showTutorial, diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 6adb6f95622d3a0a52a008d866de8e91750c3115..54608472736c09df28a9938cb486953a6917872a 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -105,8 +105,6 @@ setContext("billName", billName) const billActive: Writable<boolean> = writable(currentBillName !== undefined) setContext("billActive", billActive) - const billMockValues: Writable<boolean> = writable(data.reformMockValues) - setContext("billMockValues", billMockValues) let currentRevaluationName: string | undefined = data.revaluationName === undefined