forked from MapComplete/MapComplete
Studio: UX improvements after usertest
This commit is contained in:
parent
44c1548e89
commit
a9bfe4f37b
11 changed files with 173 additions and 122 deletions
|
|
@ -5,7 +5,7 @@ import { UIEventSource } from "../../../Logic/UIEventSource";
|
|||
import type { TagConfigJson } from "../../../Models/ThemeConfig/Json/TagConfigJson";
|
||||
import FullTagInput from "../../Studio/TagInput/FullTagInput.svelte";
|
||||
|
||||
export let value: UIEventSource<undefined | string>;
|
||||
export let value: UIEventSource<TagConfigJson>;
|
||||
export let uploadableOnly: boolean;
|
||||
export let overpassSupportNeeded: boolean;
|
||||
|
||||
|
|
@ -14,18 +14,7 @@ export let overpassSupportNeeded: boolean;
|
|||
*/
|
||||
export let silent: boolean = false;
|
||||
|
||||
let tag: UIEventSource<string | TagConfigJson> = value.sync(s => {
|
||||
try {
|
||||
return JSON.parse(s);
|
||||
} catch (e) {
|
||||
return s;
|
||||
}
|
||||
}, [], t => {
|
||||
if(typeof t === "string"){
|
||||
return t
|
||||
}
|
||||
return JSON.stringify(t);
|
||||
});
|
||||
let tag: UIEventSource<string | TagConfigJson> = value
|
||||
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
import OpeningHoursInput from "./Helpers/OpeningHoursInput.svelte";
|
||||
|
||||
export let type: ValidatorType;
|
||||
export let value: UIEventSource<string>;
|
||||
export let value: UIEventSource<string | object>;
|
||||
|
||||
export let feature: Feature;
|
||||
export let args: (string | number | boolean)[] = undefined;
|
||||
|
|
|
|||
|
|
@ -74,7 +74,12 @@
|
|||
}
|
||||
|
||||
feedback?.setData(undefined)
|
||||
value.setData(v + (selectedUnit.data ?? ""))
|
||||
if(selectedUnit.data){
|
||||
value.setData(v + selectedUnit.data)
|
||||
|
||||
}else{
|
||||
value.setData(v)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue