From 4449fad360645248c174f79adef676c999f8c067 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 22 Aug 2025 15:11:05 +0200 Subject: [PATCH] Studio: fix bug in displaying tag values --- src/UI/Studio/SchemaBasedField.svelte | 3 --- src/Utils.ts | 14 +++++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/UI/Studio/SchemaBasedField.svelte b/src/UI/Studio/SchemaBasedField.svelte index 6bcac2151..1552ae587 100644 --- a/src/UI/Studio/SchemaBasedField.svelte +++ b/src/UI/Studio/SchemaBasedField.svelte @@ -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 diff --git a/src/Utils.ts b/src/Utils.ts index 277a84844..8cdecf94a 100644 --- a/src/Utils.ts +++ b/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, "
") } else { // v === undefined