forked from MapComplete/MapComplete
Studio: fix bug in displaying tag values
This commit is contained in:
parent
2889cbe382
commit
4449fad360
2 changed files with 11 additions and 6 deletions
|
@ -56,9 +56,6 @@
|
|||
if (schema.type === "boolean") {
|
||||
rendervalue = undefined
|
||||
}
|
||||
if (schema.hints.typehint === "tag" || schema.hints.typehint === "simple_tag") {
|
||||
rendervalue = "{tags()}"
|
||||
}
|
||||
|
||||
let helperArgs = schema.hints.typehelper?.split(",")
|
||||
let inline = schema.hints.inline !== undefined
|
||||
|
|
14
src/Utils.ts
14
src/Utils.ts
|
@ -424,6 +424,16 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
|
|||
v = date.toISOString()
|
||||
}
|
||||
|
||||
if (typeof v !== "string") {
|
||||
if(v["asHumanString"]){
|
||||
v = v.asHumanString(true, false)
|
||||
}else if(typeof v === "object"){
|
||||
v = JSON.stringify(v)
|
||||
} else{
|
||||
v = "" + v
|
||||
}
|
||||
}
|
||||
|
||||
if (useLang !== undefined && v?.translations !== undefined) {
|
||||
v = v.translations[useLang] ?? v.translations["*"] ?? v?.textFor(useLang) ?? v
|
||||
}
|
||||
|
@ -438,9 +448,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
|
|||
v = v.InnerConstructElement()?.textContent
|
||||
}
|
||||
|
||||
if (typeof v !== "string") {
|
||||
v = "" + v
|
||||
}
|
||||
|
||||
v = v.replace(/\n/g, "<br/>")
|
||||
} else {
|
||||
// v === undefined
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue