Improvements to studio and layer handling

This commit is contained in:
Pieter Vander Vennet 2024-01-13 01:51:19 +01:00
parent 3166918551
commit b3b226d34c
6 changed files with 20 additions and 4 deletions

View file

@ -95,6 +95,9 @@ class SubstituteLayer extends Conversion<string | LayerConfigJson, LayerConfigJs
}
if (json["hideTagRenderingsWithLabels"]) {
if(typeof json["hideTagRenderingsWithLabels"] === "string"){
throw "At "+context+".hideTagRenderingsWithLabels should be a list containing strings, you specified a string"
}
const hideLabels: Set<string> = new Set(json["hideTagRenderingsWithLabels"])
// These labels caused at least one deletion
const usedLabels: Set<string> = new Set<string>()

View file

@ -178,6 +178,9 @@ export class ValidateTheme extends DesugaringStep<LayoutConfigJson> {
if (!json.title) {
context.enter("title").err(`The theme ${json.id} does not have a title defined.`)
}
if(!json.icon){
context.enter("icon").err("A theme should have an icon")
}
if (this._isBuiltin && this._extractImages !== undefined) {
// Check images: are they local, are the licenses there, is the theme icon square, ...
const images = this._extractImages.convert(json, context.inOperation("ValidateTheme"))
@ -244,7 +247,8 @@ export class ValidateTheme extends DesugaringStep<LayoutConfigJson> {
new ValidateLanguageCompleteness("en").convert(theme, context)
}
} catch (e) {
context.err(e)
console.error(e)
context.err("Could not validate the theme due to: " + e)
}
if (theme.id !== "personal") {
@ -412,7 +416,7 @@ export class DetectConflictingAddExtraTags extends DesugaringStep<TagRenderingCo
return json
} catch (e) {
context.err(e)
context.err("Could not check for conflicting extra tags due to: " + e)
return undefined
}
}

View file

@ -106,8 +106,12 @@ export interface MappingConfigJson {
hideInAnswer?: boolean | TagConfigJson
/**
* question: In what other cases should this item be rendered?
*
* Also show this 'then'-option if the feature matches these tags.
* Ideal for outdated tags.
* Ideal for outdated tags or default assumptions. The tags from this options will <b>not</b> be set if the option is chosen!
*
* ifunset: No other cases when this text is shown
*/
alsoShowIf?: TagConfigJson