fix(engine): minor bug fixes

This commit is contained in:
Gervwyk 2020-11-13 14:36:01 +02:00
parent 1c5bd0c473
commit 8937087274
3 changed files with 4 additions and 4 deletions

View File

@ -344,7 +344,7 @@ class Actions {
this.context.showValidationErrors = true;
let validationErrors = this.context.RootBlocks.validate();
if (params) {
const blockIds = type.isString(blockId) ? [params] : params;
const blockIds = type.isString(params) ? [params] : params;
validationErrors = validationErrors.filter((block) => {
return blockIds.includes(block.blockId);
});

View File

@ -496,7 +496,7 @@ class Blocks {
getValidateRec(result) {
this.loopBlocks((block) => {
if (block.validationEval.output.status === 'error' && block.visibleEval.output) {
if (block.visibleEval.output && block.validationEval.output.status === 'error') {
result.push({
blockId: block.blockId,
validation: block.validationEval.output,

View File

@ -56,8 +56,8 @@ class State {
unset(this.context.state, field);
// remove all empty objects from state as an effect of deleted values
const fields = field.split('.');
if (fields.length > 0) {
const parent = ''.join(fields.slice(0, fields.length - 1));
if (fields.length > 1) {
const parent = fields.slice(0, fields.length - 1).join('.');
const parentValue = get(this.context.state, parent);
if (type.isObject(parentValue) && Object.keys(parentValue).length === 0) {
this.del(parent);