Skip to content

Commit

Permalink
Fix bug in results summary. #24
Browse files Browse the repository at this point in the history
Use placemakingOverall sums, because they plumb through the categories
and use some special multipliers.
  • Loading branch information
dabreegster committed May 15, 2024
1 parent 08c5957 commit 93c62c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
9 changes: 0 additions & 9 deletions src/routes/route_check/results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ export interface Results {
// For the summary's Overview table
safetyCheck: ResultCategory;
streetCheck: ResultCategory | null;
// TODO Now redundant with placemakingOverall
streetPlacemaking: ResultCategory | null;
pathCheck: ResultCategory | null;
pathPlacemaking: ResultCategory | null;

// For the summary's Level of Service table
levelOfService: ResultCategory[];
Expand Down Expand Up @@ -208,18 +205,12 @@ export function getResults(state: State): Results {
getResultCategory("", checkType, state.streetCheck, null),
)
: null,
streetPlacemaking: isStreet
? getResultCategory("", checkType, state.streetPlacemakingCheck, null)
: null,
pathCheck: isPath
? sumResultCategories(
safetyCheck,
getResultCategory("", checkType, state.pathCheck, null),
)
: null,
pathPlacemaking: isPath
? getResultCategory("", checkType, state.pathPlacemakingCheck, null)
: null,

levelOfService,
overall,
Expand Down
8 changes: 4 additions & 4 deletions src/routes/route_check/results_summary/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@
</tr>

<tr>
{#if results.streetPlacemaking}
{#if $state.summary.checkType == "street"}
<th>
<a href="{base}/route_check/street_placemaking_check">
Street Placemaking
</a>
</th>
<td>{yesNo(isScorecardCompleted($state.streetPlacemakingCheck))}</td>
<td>{netDifference(results.streetPlacemaking)}</td>
<td>{netDifference(results.placemakingOverall)}</td>
<td>TODO</td>
{:else}
<th>Street Placemaking</th>
Expand All @@ -138,12 +138,12 @@
</tr>

<tr>
{#if results.pathPlacemaking}
{#if $state.summary.checkType == "path"}
<th>
<a href="{base}/route_check/path_placemaking_check">Path Placemaking</a>
</th>
<td>{yesNo(isScorecardCompleted($state.pathPlacemakingCheck))}</td>
<td>{netDifference(results.pathPlacemaking)}</td>
<td>{netDifference(results.placemakingOverall)}</td>
<td>TODO</td>
{:else}
<th>Path Placemaking</th>
Expand Down

0 comments on commit 93c62c4

Please sign in to comment.