diff --git a/src/lib/components/WaterfallPlainView.svelte b/src/lib/components/WaterfallPlainView.svelte index 0a7395b5edd6aaad3b3b3f41d7b00785db0387f0..c5d3697fbc7ff943a0f3b4689cb06ce50104b95c 100644 --- a/src/lib/components/WaterfallPlainView.svelte +++ b/src/lib/components/WaterfallPlainView.svelte @@ -109,6 +109,7 @@ } </script> +<!--Version du composant avec chaque waterfall séparé (vue accueil simulateur)--> {#if !compact} {#each waterfallsDecompositions as { waterfall, visibleDecompositions }} {#if visibleDecompositions.length > 0} @@ -203,6 +204,7 @@ {/if} {/each} {:else} + <!--Version du composant sous forme d'un onglet par waterfall (vue simulateur sans dispositif sélectionné)--> <div class="overflow-hidden rounded-lg border shadow-lg"> <div class="flex divide-x-2"> {#each waterfallsDecompositions as { waterfall, visibleDecompositions }} diff --git a/src/lib/components/test_cases/TestCaseView.svelte b/src/lib/components/test_cases/TestCaseView.svelte index 589ce3dc3ade27cea1bff44ddb73ea87b34d656a..dfbe17f9b864b823dd52b4ac3f539484532d6ee9 100644 --- a/src/lib/components/test_cases/TestCaseView.svelte +++ b/src/lib/components/test_cases/TestCaseView.svelte @@ -7,7 +7,6 @@ import type { DisplayMode } from "$lib/displays" import type { Situation } from "$lib/situations" import { billName, shared } from "$lib/shared.svelte" - import type { TabsConfig } from "$lib/tabs" import { newSimulationUrl } from "$lib/urls" import { oilTypes, @@ -21,7 +20,6 @@ highlightDecomposition?: boolean situation: Situation situationIndex: number - tabsConfig: TabsConfig valuesByCalculationNameByVariableName: ValuesByCalculationNameByVariableName year: number } diff --git a/src/lib/components/variables/VariableDetail.svelte b/src/lib/components/variables/VariableDetail.svelte index b6386e0aa839219db29d9818c2f9f362b76a597e..71cbec6e74abcb7a1857989e51f91c6b920924ce 100644 --- a/src/lib/components/variables/VariableDetail.svelte +++ b/src/lib/components/variables/VariableDetail.svelte @@ -322,6 +322,7 @@ <a class="mx-auto mt-4 flex w-fit items-center gap-2 rounded-md bg-le-vert-400 px-4 py-1.5 text-sm font-bold uppercase tracking-[0.085em] text-white shadow-lg hover:bg-le-vert-500 active:bg-le-vert-600 xl:text-base" href={newSimulationUrl({ + ...displayMode, budget: true, parametersVariableName: name, })} @@ -368,10 +369,12 @@ <a class="lx-card-bg-gray-underline-le-vert group flex flex-col gap-2 px-4 py-2" href={newSimulationUrl({ + ...displayMode, + budget: false, parametersVariableName: name, testCasesIndex: indices, - tab: "dispositif", })} + onclick={() => dispatch("close")} > <div class="flex flex-1 items-center gap-3" @@ -447,7 +450,6 @@ ...displayMode, parametersVariableName: name, testCasesIndex: [detail], - tab: "dispositif", }), )} showOnlyDeciles={false} diff --git a/src/lib/displays.ts b/src/lib/displays.ts index 631817b829936d7896870eb0a69a5b9d3b33b952..f0cc9f51752560bb3fe36a22fb888ec1c9531ed5 100644 --- a/src/lib/displays.ts +++ b/src/lib/displays.ts @@ -7,6 +7,5 @@ export interface DisplayMode { testCasesIndex: number[] // Contains at least the index of a single test case. variableName?: string waterfallName: string - tab?: string parameterHash?: string } diff --git a/src/lib/tabs.ts b/src/lib/tabs.ts deleted file mode 100644 index cdbd0845b6549bf71ab2c62a16399dde895f84ad..0000000000000000000000000000000000000000 --- a/src/lib/tabs.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface TabsConfig { - defaultTab: string - tabs: TabItem[] -} - -export interface TabItem { - disabled?: boolean - icon?: string - picto?: string - tab: string - title: string -} diff --git a/src/lib/urls.ts b/src/lib/urls.ts index 0d6a6d30d6b7f50129513c9504d1bccf0be63585..8a690919699c6a6557e5d33497ba4a93c659cb20 100644 --- a/src/lib/urls.ts +++ b/src/lib/urls.ts @@ -43,9 +43,6 @@ export function newSimulationUrl(displayMode: DisplayMode): string { ) { parametersQuery.append("waterfall", displayMode.waterfallName) } - if (displayMode.tab !== undefined) { - parametersQuery.append("tab", displayMode.tab) - } const parametersQueryString = parametersQuery.toString() const hashesQuery: URLSearchParams = new URLSearchParams() diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 89d5b0882aa531b2a2e9f6f4321d1468d497eb9c..e05a3eddc0e43ec767aa983ef96a917984b49723 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -75,7 +75,6 @@ } from "$lib/shared.svelte" import { publishTestCaseSimulation } from "$lib/simulations" import { getPopulationReservedKeys, type Situation } from "$lib/situations" - import type { TabsConfig } from "$lib/tabs" import { newSimulationUrl, type SelfTargetAProps } from "$lib/urls" import { budgetEditableParametersName, @@ -241,27 +240,6 @@ ]) setContext("newSelfTargetAProps", newSelfTargetAProps) const ordinalPluralRules = new Intl.PluralRules("fr-FR", { type: "ordinal" }) - const tabsConfig = $state({ - defaultTab: "fiche_de_paie", - tabs: [ - { - title: "Dispositif", - icon: "ri:zoom-in-line", - tab: "dispositif", - }, - // { - // title: "Impacts directs", - // icon: "ri:mastercard-line", - // tab: "impacts_directs", - // disabled: true, - // }, - { - title: "Fiche de paie", - picto: "PictoFicheDePaie", - tab: "fiche_de_paie", - }, - ], - } as TabsConfig) let testCaseSharingModal: { open: boolean; token?: string } = $state({ open: false, }) @@ -385,14 +363,6 @@ auditSetNullish(waterfalls[0].name), ), ) - audit.attribute( - data, - "tab", - true, - errors, - remainingKeys, - auditQuerySingleton(auditTrimString), - ) if ( data.edit !== undefined && @@ -618,7 +588,6 @@ newSimulationUrl({ ...displayMode, parametersVariableName: variableName, - tab: "dispositif", }), { noScroll: true }, ) @@ -867,10 +836,6 @@ Object.keys(shared.parametricReform).length > 0 && shared.budgetSimulation?.result?.amendement !== undefined, ) - run(() => { - tabsConfig.tabs[0].disabled = - displayMode.parametersVariableName === undefined - }) </script> <svelte:window bind:innerWidth={windowInnerWidth} onkeydown={onKeyDown} /> @@ -1109,7 +1074,6 @@ newSimulationUrl({ ...displayMode, parametersVariableName: parameterParentName, - tab: "fiche_de_paie", }), ) }} @@ -1486,7 +1450,6 @@ }} situation={shared.testCases[shared.testCasesIndex[0]]} situationIndex={shared.testCasesIndex[0]} - {tabsConfig} valuesByCalculationNameByVariableName={shared .valuesByCalculationNameByVariableNameArray[ shared.testCasesIndex[0]