Skip to content
Snippets Groups Projects
Commit 96c8dc2a authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Waterfall non-leaf & non-trunk nodes are now clickables.

parent 7398a7ba
Branches
Tags
No related merge requests found
......@@ -3,6 +3,7 @@
import { createEventDispatcher, getContext } from "svelte"
import type { Writable } from "svelte/store"
import { goto } from "$app/navigation"
import { session } from "$app/stores"
import type {
DecompositionByName,
......@@ -319,7 +320,9 @@
</button>
{/if}
<div
{#if ["test_case", "test_case_with_variable_inputs"].includes(editionMode?.mode)}
<!-- Non-lead decomposition node in variable inputs mode => no-link -->
<span
class="hover:bg-white cursor-pointer font-serif overflow-ellipsis overflow-x-hidden hover:overflow-x-visible text-black hover:text-black text-base hover:underline hover:z-20"
on:click={() => {
if (decomposition.open) {
......@@ -330,7 +333,43 @@
}}
>
{decomposition.ux_name ?? decomposition.label}
</div>
</span>
{:else if variable === undefined}
<!-- Leaf decomposition without variable, in parameters mode => no link -->
<span
class="hover:bg-white cursor-pointer font-serif overflow-ellipsis overflow-x-hidden hover:overflow-x-visible text-black hover:text-black text-base hover:underline hover:z-20"
on:click={() => {
if (decomposition.open) {
zoomOut(index)
} else {
zoomIn(index)
}
}}>{decomposition.ux_name ?? decomposition.label}</span
>
{:else}
<!-- Leaf decomposition node with parameters in parameters mode => link -->
<a
class="hover:bg-white cursor-pointer font-serif overflow-ellipsis overflow-x-hidden hover:overflow-x-visible hover:text-le-gris-dispositif text-base hover:underline hover:z-20"
href="/?action={encodeURIComponent(
`variables/${decomposition.name}/parameters`,
)}"
on:click|preventDefault={() => {
if (decomposition.open) {
zoomOut(index)
} else {
zoomIn(index)
}
goto(
`/?action=${encodeURIComponent(
`variables/${decomposition.name}/parameters`,
)}`,
{ noscroll: true },
)
}}
sveltekit:noscroll
>{decomposition.ux_name ?? decomposition.label}</a
>
{/if}
{/if}
{/if}
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment