Studio: move some validation from throwing errors in LayerConfig.ts into errors in Validation

This commit is contained in:
Pieter Vander Vennet 2023-10-17 16:06:58 +02:00
parent 632dd6dfb1
commit ec79672fa6
10 changed files with 160 additions and 79 deletions

View file

@ -72,7 +72,6 @@ export default class EditLayerState {
}
}
this.messages = this.configuration.mapD((config) => {
const context = ConversionContext.construct([], ["prepare"])
const trs = Utils.NoNull(config.tagRenderings ?? [])
for (let i = 0; i < trs.length; i++) {
const tr = trs[i]
@ -98,6 +97,8 @@ export default class EditLayerState {
new PrepareLayer(state),
new ValidateLayer("dynamic", false, undefined)
)
const context = ConversionContext.construct([], ["prepare"])
prepare.convert(<LayerConfigJson>config, context)
return context.messages
})