Skip to content

Commit

Permalink
Change the filters -- filter out resolved problems
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Dec 2, 2024
1 parent cc32923 commit c11a523
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions src/routes/route_check/problems_map/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@
let hoveringSidebar: ID | null = null;
let streetviewOn = false;
let showRoute = true;
let showExisting = true;
let showDesign = true;
let showResolved = true;
$: if (map) {
map.getCanvas().style.cursor =
Expand Down Expand Up @@ -295,18 +294,8 @@
}
}
function show(
showExisting: boolean,
showDesign: boolean,
stage: "Existing" | "Design" | "",
) {
if (!showExisting && stage == "Existing") {
return false;
}
if (!showDesign && stage == "Design") {
return false;
}
return true;
function show(showResolved: boolean, resolved: "Yes" | "No" | "") {
return showResolved || resolved != "Yes";
}
</script>

Expand All @@ -329,8 +318,7 @@
</CollapsibleCard>

<CheckboxGroup small>
<Checkbox bind:checked={showExisting}>Show existing problems</Checkbox>
<Checkbox bind:checked={showDesign}>Show design problems</Checkbox>
<Checkbox bind:checked={showResolved}>Show resolved problems</Checkbox>
</CheckboxGroup>

<div style="background-color: grey; padding: 4px">
Expand Down Expand Up @@ -447,7 +435,7 @@
{/if}

{#each $state.criticalIssues as critical, idx}
{#if show(showExisting, showDesign, critical.stage)}
{#if show(showResolved, critical.resolved)}
<Marker
draggable
bind:lngLat={critical.point}
Expand All @@ -472,7 +460,7 @@
{/each}

{#each $state.policyConflictLog as conflict, idx}
{#if show(showExisting, showDesign, conflict.stage)}
{#if show(showResolved, conflict.resolved)}
<Marker
draggable
bind:lngLat={conflict.point}
Expand Down

0 comments on commit c11a523

Please sign in to comment.