From e2eb4e620f26e59141dba235ffc4c4db845b7d41 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Mon, 8 Aug 2022 11:12:40 +0100 Subject: [PATCH] ui: Ensure we dispatch validation state (#14021) * ui: Ensure we dispatch validation state * Changelog --- .changelog/14021.txt | 3 +++ ui/packages/consul-ui/app/modifiers/validate.js | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 .changelog/14021.txt diff --git a/.changelog/14021.txt b/.changelog/14021.txt new file mode 100644 index 0000000000..af10a467b9 --- /dev/null +++ b/.changelog/14021.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: Fixes an issue where client side validation errors were not showing in certain areas +``` diff --git a/ui/packages/consul-ui/app/modifiers/validate.js b/ui/packages/consul-ui/app/modifiers/validate.js index 5a74598b47..72c0b8bb93 100644 --- a/ui/packages/consul-ui/app/modifiers/validate.js +++ b/ui/packages/consul-ui/app/modifiers/validate.js @@ -34,10 +34,10 @@ export default class ValidateModifier extends Modifier { } if(Object.keys(errors).length > 0) { state.context.errors = errors; - this.hash.chart.dispatch("ERROR"); + this.hash.chart.dispatch("ERROR", state.context); } else { state.context.errors = null; - this.hash.chart.dispatch("RESET"); + this.hash.chart.dispatch("RESET", state.context); } } @@ -61,7 +61,7 @@ export default class ValidateModifier extends Modifier { }); if(Object.keys(state.context.errors).length === 0) { state.context.errors = null; - this.hash.chart.dispatch("RESET"); + this.hash.chart.dispatch("RESET", state.context); } } }