Skip to content

Commit

Permalink
Display user-friendly field names for auto-generated forms
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Jul 14, 2023
1 parent 77a933b commit 3c36ac7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
26 changes: 26 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"@types/geojson": "^7946.0.10",
"comlink": "^4.4.1",
"govuk-frontend": "^4.6.0",
"humanize-string": "^3.0.0",
"maplibre-gl": "^3.1.0",
"route-snapper": "^0.1.14",
"svelte": "^4.0.0"
Expand Down
3 changes: 2 additions & 1 deletion src/lib/forms/AutogenerateForm.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import humanizeString from 'humanize-string';
import { slide } from "svelte/transition";
import {
isBarewordEnumCase,
Expand Down Expand Up @@ -57,7 +58,7 @@
{#if isStruct(spec)}
{#each spec.members as x}
<div>
<h3>{x.name}</h3>
<h3>{humanizeString(x.name)}</h3>
<svelte:self spec={x} bind:value={value[x.name]} />
</div>
{/each}
Expand Down

0 comments on commit 3c36ac7

Please sign in to comment.