From aeaad59a6b1d77342b05445101abac9e0acce85a Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Thu, 9 May 2024 11:20:56 +0100 Subject: [PATCH] Use govuk table styles, at least partly. #24 --- src/lib/import.ts | 79 ++++++++++--------- .../route_check/results_analysis/+page.svelte | 41 +++++----- .../route_check/results_summary/+page.svelte | 39 ++++----- .../LevelOfServiceTable.svelte | 16 +--- src/style/main.sass | 10 +++ 5 files changed, 90 insertions(+), 95 deletions(-) diff --git a/src/lib/import.ts b/src/lib/import.ts index ead1313b13..11ef4e2e27 100644 --- a/src/lib/import.ts +++ b/src/lib/import.ts @@ -1,5 +1,10 @@ import ExcelJS, { type CellValue } from "exceljs"; -import { emptyState, type State, type Score, type Position } from "../routes/route_check/data"; +import { + emptyState, + type State, + type Score, + type Position, +} from "../routes/route_check/data"; export function importDalog(workbook: ExcelJS.Workbook): State { return dalogToState(getDalog(workbook)); @@ -142,48 +147,48 @@ function dalogToState(dalog: { } for (let i = 0; i < 35; i++) { - let prefix = `${num(i)}PC`; - if (dalog[`${prefix}Ref`] == null) { - break; - } - state.policyConflictLog.push({ - conflict: normalString(`${prefix}Typ`).substr(0, 1), - stage: normalString(`${prefix}Sta`), - point: point(`${prefix}LaL`), - locationName: normalString(`${prefix}Loc`), - resolved: yesNoBlank(`${prefix}Res`), - notes: normalString(`${prefix}Com`), - }); + let prefix = `${num(i)}PC`; + if (dalog[`${prefix}Ref`] == null) { + break; + } + state.policyConflictLog.push({ + conflict: normalString(`${prefix}Typ`).substr(0, 1), + stage: normalString(`${prefix}Sta`), + point: point(`${prefix}LaL`), + locationName: normalString(`${prefix}Loc`), + resolved: yesNoBlank(`${prefix}Res`), + notes: normalString(`${prefix}Com`), + }); } for (let i = 0; i < 35; i++) { - let prefix = `${num(i)}PC`; - if (dalog[`${prefix}Ref`] == null) { - break; - } - state.policyConflictLog.push({ - conflict: normalString(`${prefix}Typ`).substr(0, 1), - stage: normalString(`${prefix}Sta`), - point: point(`${prefix}LaL`), - locationName: normalString(`${prefix}Loc`), - resolved: yesNoBlank(`${prefix}Res`), - notes: normalString(`${prefix}Com`), - }); + let prefix = `${num(i)}PC`; + if (dalog[`${prefix}Ref`] == null) { + break; + } + state.policyConflictLog.push({ + conflict: normalString(`${prefix}Typ`).substr(0, 1), + stage: normalString(`${prefix}Sta`), + point: point(`${prefix}LaL`), + locationName: normalString(`${prefix}Loc`), + resolved: yesNoBlank(`${prefix}Res`), + notes: normalString(`${prefix}Com`), + }); } // TODO Pretty much the same for (let i = 0; i < 35; i++) { - let prefix = `${num(i)}SA`; - if (dalog[`${prefix}Ref`] == null) { - break; - } - state.criticalIssues.push({ - criticalIssue: normalString(`${prefix}Typ`).substr(0, 1), - stage: normalString(`${prefix}Sta`), - point: point(`${prefix}LaL`), - locationName: normalString(`${prefix}Loc`), - resolved: yesNoBlank(`${prefix}Res`), - notes: normalString(`${prefix}Com`), - }); + let prefix = `${num(i)}SA`; + if (dalog[`${prefix}Ref`] == null) { + break; + } + state.criticalIssues.push({ + criticalIssue: normalString(`${prefix}Typ`).substr(0, 1), + stage: normalString(`${prefix}Sta`), + point: point(`${prefix}LaL`), + locationName: normalString(`${prefix}Loc`), + resolved: yesNoBlank(`${prefix}Res`), + notes: normalString(`${prefix}Com`), + }); } // TODO JAT diff --git a/src/routes/route_check/results_analysis/+page.svelte b/src/routes/route_check/results_analysis/+page.svelte index a27ce5d496..8e1a32ef9a 100644 --- a/src/routes/route_check/results_analysis/+page.svelte +++ b/src/routes/route_check/results_analysis/+page.svelte @@ -19,8 +19,10 @@ }; -

1. Summary of Scheme

+ @@ -43,8 +45,10 @@
+ 1. Summary of Scheme +
Scheme Name {$state.summary.schemeName}
-

2. Policy Check Results

+ @@ -66,8 +70,10 @@
+ 2. Policy Check Results +
Potential Policy Conflicts Existing Route
-

3. Safety Check Results (Critical Issues only)

+ @@ -91,22 +97,22 @@

4. Street Check Results

{#if $state.summary.checkType == "street"} -

Street Level of Service

-

Street Level of Service by Transport Mode

-

Street Placemaking

5. Path Check Results {#if $state.summary.checkType == "path"} -

Path Level of Service

-

Path Level of Service by Transport Mode

-

Path Placemaking

This isn't a Path Check

{/if} -

6. Junction Assessment Tool Check

-
+ 3. Safety Check Results (Critical Issues only) +
Critical Issues Existing Route
+ @@ -176,15 +183,3 @@
+ 6. Junction Assessment Tool Check +
Junction Name Modes
TODO: overall JAT - - diff --git a/src/routes/route_check/results_summary/+page.svelte b/src/routes/route_check/results_summary/+page.svelte index 656b71aac6..2020f72bf4 100644 --- a/src/routes/route_check/results_summary/+page.svelte +++ b/src/routes/route_check/results_summary/+page.svelte @@ -32,9 +32,10 @@ } -

Overview

- + @@ -163,30 +164,22 @@
+ Overview +
Complete
{#if $state.summary.checkType == "street"} -

Street Check Level of Service

+ {:else if $state.summary.checkType == "path"} -

Path Check Level of Service

+ {:else} -

Select Street Check or Path Check to calculate the table below

+

Select Street Check or Path Check for further results

{/if} - -