forked from MapComplete/MapComplete
Studio: improve error handling, fix renumbering
This commit is contained in:
parent
7afe58e6a5
commit
079a3f8694
10 changed files with 187 additions and 62 deletions
|
|
@ -11,9 +11,11 @@
|
|||
import { Utils } from "../../Utils"
|
||||
import ToSvelte from "../Base/ToSvelte.svelte"
|
||||
import { VariableUiElement } from "../Base/VariableUIElement"
|
||||
import { ExclamationTriangle } from "@babeard/svelte-heroicons/solid/ExclamationTriangle"
|
||||
|
||||
export let state: EditLayerState
|
||||
export let path: (string | number)[]
|
||||
let messages = state.messagesFor(path)
|
||||
let tag: UIEventSource<TagConfigJson> = state.getStoreFor([...path, "if"])
|
||||
let parsedTag = tag.map((t) => (t ? TagUtils.Tag(t) : undefined))
|
||||
let exampleTags = parsedTag.map((pt) => {
|
||||
|
|
@ -27,7 +29,6 @@
|
|||
}
|
||||
return o
|
||||
})
|
||||
let uploadableOnly: boolean = true
|
||||
|
||||
let thenText: UIEventSource<Record<string, string>> = state.getStoreFor([...path, "then"])
|
||||
let thenTextEn = thenText.mapD((translation) =>
|
||||
|
|
@ -71,5 +72,11 @@
|
|||
<i>No then is set</i>
|
||||
{/if}
|
||||
<FromHtml src={$parsedTag?.asHumanString(false, false, $exampleTags)} />
|
||||
{#if $messages.length > 0}
|
||||
<div class="alert m-2 flex">
|
||||
<ExclamationTriangle class="w-6 h-6"/>
|
||||
{$messages.length} errors
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue