diff --git a/Models/ThemeConfig/TagRenderingConfig.ts b/Models/ThemeConfig/TagRenderingConfig.ts index ae053f3a02..e43dffb733 100644 --- a/Models/ThemeConfig/TagRenderingConfig.ts +++ b/Models/ThemeConfig/TagRenderingConfig.ts @@ -48,6 +48,9 @@ export default class TagRenderingConfig { this.render = null; this.question = null; this.condition = null; + this.id = "questions" + this.group = "" + return; } diff --git a/Models/ThemeConfig/WithContextLoader.ts b/Models/ThemeConfig/WithContextLoader.ts index 04999b9d99..36948c9735 100644 --- a/Models/ThemeConfig/WithContextLoader.ts +++ b/Models/ThemeConfig/WithContextLoader.ts @@ -66,12 +66,6 @@ export default class WithContextLoader { if (renderingJson["builtin"] !== undefined) { const renderingId = renderingJson["builtin"] if (renderingId === "questions") { - if (readOnly) { - throw `A tagrendering has a question, but asking a question does not make sense here: is it a title icon or a geojson-layer? ${context}. The offending tagrendering is ${JSON.stringify( - renderingJson - )}`; - } - const tr = new TagRenderingConfig("questions", context); renderings.push(tr) continue; diff --git a/UI/Input/ValidatedTextField.ts b/UI/Input/ValidatedTextField.ts index a6aef8131c..16e2223583 100644 --- a/UI/Input/ValidatedTextField.ts +++ b/UI/Input/ValidatedTextField.ts @@ -196,7 +196,7 @@ export default class ValidatedTextField { "A basic string"), ValidatedTextField.tp( "text", - "A string, but allows input of longer strings more comfortably (a text area)", + "A string, but allows input of longer strings more comfortably and supports newlines (a text area)", undefined, undefined, undefined, @@ -473,6 +473,9 @@ export default class ValidatedTextField { options.inputMode = tp.inputmode; + if(tp.inputmode === "text") { + options.htmlType = "area" + } let input: InputElement = new TextField(options); diff --git a/Utils.ts b/Utils.ts index 2fd29533aa..21210a0869 100644 --- a/Utils.ts +++ b/Utils.ts @@ -186,7 +186,14 @@ Note that these values can be prepare with javascript in the theme by using a [c while (match) { const key = match[1] - txt = txt.replace("{" + key + "}", tags[key] ?? "") + let v = tags[key] + if(v !== undefined ){ + if(typeof v !== "string"){ + v = ""+v + } + v = v.replace(/\n/g, "
") + } + txt = txt.replace("{" + key + "}", v ?? "") match = txt.match(regex) } diff --git a/assets/layers/etymology/etymology.json b/assets/layers/etymology/etymology.json index 773addd3a1..e8e35d4ad6 100644 --- a/assets/layers/etymology/etymology.json +++ b/assets/layers/etymology/etymology.json @@ -84,7 +84,7 @@ "nl": "Zoeken op inventaris onroerend erfgoed", "en": "Search on inventaris onroerend erfgoed" }, - "conditions": "_country=be" + "condition": "_country=be" }, { "id": "simple etymology", @@ -118,6 +118,7 @@ ] } }, + "questions", { "id": "street-name-sign-image", "render": { diff --git a/assets/layers/ghost_bike/ghost_bike.json b/assets/layers/ghost_bike/ghost_bike.json index 7463a4ba5c..106b0b5ee9 100644 --- a/assets/layers/ghost_bike/ghost_bike.json +++ b/assets/layers/ghost_bike/ghost_bike.json @@ -165,7 +165,8 @@ "id": "{inscription}" }, "freeform": { - "key": "inscription" + "key": "inscription", + "type": "text" }, "id": "ghost_bike-inscription" },