Skip to content

Commit

Permalink
Address most of type checker's issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter York committed Nov 1, 2023
1 parent 2447f11 commit 7fe6050
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/lib/forms/PipelineForm.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script lang="ts">
import { Radio, Select, TextArea, TextInput } from "lib/govuk";
import { onMount } from "svelte";
import type { InterventionProps, Subscheme } from "types";
export let subschemes: Subscheme[];
Expand All @@ -16,12 +15,14 @@
props.pipelineIntervention = {
schemeId: subschemes[0].id,
type: "",
description: "",
};
} else {
selectedSchemeId = props.pipelineIntervention.schemeId.toString();
}
function subschemeSelected(e: any) {
// @ts-ignore since this is only called by something that checks for existence of pipelineIntervention it is guaranteed to exist.
props.pipelineIntervention.schemeId = parseInt(selectedSchemeId);
}
</script>
Expand Down
1 change: 0 additions & 1 deletion src/lib/sidebar/EntireSubscheme.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script lang="ts">
import { feature } from "@turf/helpers";
import { CollapsibleCard, Modal } from "lib/common";
import {
ButtonGroup,
Expand Down
7 changes: 3 additions & 4 deletions src/lib/sidebar/ListMode.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<script lang="ts">
import { Legend, WarningIcon } from "lib/common";
import { bbox } from "lib/maplibre";
import { Legend } from "lib/common";
import { schemaLegend } from "schemas";
import { gjScheme, map, mode, sidebarHover } from "stores";
import { gjScheme, sidebarHover } from "stores";
import { onDestroy } from "svelte";
import type { Schema } from "types";
import ListedIntervention from "./ListedIntervention.svelte";
import PipelineListMode from "./PipelineListMode.svelte";
import { interventionName, interventionWarning } from "./scheme_data";
import { interventionWarning } from "./scheme_data";
export let schema: Schema;
Expand Down
2 changes: 0 additions & 2 deletions src/lib/sidebar/Superscheme.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<script lang="ts">
import { feature } from "@turf/helpers";
import { CollapsibleCard, FileInput, Modal } from "lib/common";
import {
ButtonGroup,
DefaultButton,
ErrorMessage,
SecondaryButton,
TextInput,
Expand Down
3 changes: 3 additions & 0 deletions src/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export function schemaTitle(schema: Schema): string {
v2: "Experimental Scheme Design",
planning: "Development Planning",
atf4: "ATF4 Scheme",
pipeline: "Transport Authority Active Travel Pipeline",
}[schema];
}

Expand All @@ -19,6 +20,7 @@ export function schemaSingularNoun(schema: Schema): string {
v2: "an intervention",
planning: "a development",
atf4: "an intervention",
pipeline: "an intervention",
}[schema];
}

Expand All @@ -29,6 +31,7 @@ export function schemaPluralNoun(schema: Schema): string {
v2: "interventions",
planning: "developments",
atf4: "interventions",
pipeline: "interventions",
}[schema];
}

Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export interface Waypoint {
export interface PipelineIntervention {
name?: string;
schemeId: number;
description?: string;
description: string;
type: string;
}

Expand Down

0 comments on commit 7fe6050

Please sign in to comment.