Studio: Fix some usability errors

This commit is contained in:
Pieter Vander Vennet 2023-10-17 00:32:54 +02:00
parent 80b7a038cf
commit 2f8cb91d31
9 changed files with 43 additions and 30 deletions

View file

@ -986,6 +986,9 @@ export default class SpecialVisualizations {
constr: (state, tagsSource) =>
new VariableUiElement(
tagsSource.map((tags) => {
if (state.layout === undefined) {
return "<feature title>"
}
const layer = state.layout.getMatchingLayer(tags)
const title = layer?.title?.GetRenderValue(tags)
if (title === undefined) {
@ -1335,10 +1338,10 @@ export default class SpecialVisualizations {
tagSource.map((tags) => {
const v = tags[argument[0] ?? "value"]
try {
const tr = JSON.parse(v)
const tr = typeof v === "string" ? JSON.parse(v) : v
return new Translation(tr).SetClass("font-bold")
} catch (e) {
return v
return JSON.stringify(v)
}
})
)