forked from MapComplete/MapComplete
Themes: improve ability of 'rewrite' config
This commit is contained in:
parent
5da895276c
commit
f015604000
5 changed files with 335 additions and 161 deletions
|
@ -3,6 +3,7 @@ import { Utils } from "../../../Utils"
|
|||
import SpecialVisualizations from "../../../UI/SpecialVisualizations"
|
||||
import { RenderingSpecification, SpecialVisualization } from "../../../UI/SpecialVisualization"
|
||||
import { QuestionableTagRenderingConfigJson } from "../Json/QuestionableTagRenderingConfigJson"
|
||||
import { render } from "sass"
|
||||
|
||||
export default class ValidationUtils {
|
||||
public static getAllSpecialVisualisations(
|
||||
|
@ -43,6 +44,14 @@ export default class ValidationUtils {
|
|||
if (renderingConfig[cacheName]) {
|
||||
return renderingConfig[cacheName]
|
||||
}
|
||||
if (!Array.isArray(renderingConfig.mappings ?? [])) {
|
||||
throw (
|
||||
"Mappings of renderingconfig " +
|
||||
(renderingConfig["id"] ?? renderingConfig.render ?? "") +
|
||||
" are supposed to be an array but it is: " +
|
||||
JSON.stringify(renderingConfig.mappings)
|
||||
)
|
||||
}
|
||||
const translations: any[] = Utils.NoNull([
|
||||
renderingConfig.render,
|
||||
...(renderingConfig.mappings ?? []).map((m) => m.then),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue