Skip to content

Commit

Permalink
Two fixes for #6:
Browse files Browse the repository at this point in the history
1) Point mode's finish button doesn't do anything yet, so remove it.
   Will replace with markers and make more intuitive next.
2) Save edits when only a form is updated, not geometry.
  • Loading branch information
dabreegster committed Nov 5, 2024
1 parent 800aade commit 98f9c2e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/lib/draw/EditMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
return gj;
});
let feature = maybeFeature!;
// Immediately copy the feature, so that if no geometry edits happen and
// only form updates (through $featureProps), the edit is still used.
unsavedFeature = JSON.parse(JSON.stringify(feature));
if (feature.geometry.type == "LineString") {
// TODO Update route-snapper-ts to use Except<route_name> or otherwise pick the important properties
Expand Down
4 changes: 1 addition & 3 deletions src/lib/draw/point/PointControls.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { HelpButton } from "$lib/common";
import { DefaultButton, SecondaryButton } from "govuk-svelte";
import { SecondaryButton } from "govuk-svelte";
import FixedButtonGroup from "../FixedButtonGroup.svelte";
export let editingExisting: boolean;
Expand All @@ -9,8 +9,6 @@

<div style="float: right">
<FixedButtonGroup>
<DefaultButton style="margin-bottom: 0px">Finish</DefaultButton>

<SecondaryButton on:click={cancel} noBottomMargin>Cancel</SecondaryButton>

<HelpButton>
Expand Down

0 comments on commit 98f9c2e

Please sign in to comment.