diff --git a/ui-v2/app/components/policy-selector.js b/ui-v2/app/components/policy-selector.js index 778c7296e..295afce42 100644 --- a/ui-v2/app/components/policy-selector.js +++ b/ui-v2/app/components/policy-selector.js @@ -4,6 +4,7 @@ import { inject as service } from '@ember/service'; import updateArrayObject from 'consul-ui/utils/update-array-object'; const ERROR_PARSE_RULES = 'Failed to parse ACL rules'; +const ERROR_INVALID_POLICY = 'Invalid service policy'; const ERROR_NAME_EXISTS = 'Invalid Policy: A Policy with Name'; export default ChildSelectorComponent.extend({ @@ -38,10 +39,11 @@ export default ChildSelectorComponent.extend({ const err = e.error; if (typeof err.errors !== 'undefined') { const error = err.errors[0]; - let prop; + let prop = 'Rules'; let message = error.detail; switch (true) { case message.indexOf(ERROR_PARSE_RULES) === 0: + case message.indexOf(ERROR_INVALID_POLICY) === 0: prop = 'Rules'; message = error.detail; break; diff --git a/ui-v2/app/templates/components/policy-form.hbs b/ui-v2/app/templates/components/policy-form.hbs index eeee86e85..c573ee5a1 100644 --- a/ui-v2/app/templates/components/policy-form.hbs +++ b/ui-v2/app/templates/components/policy-form.hbs @@ -28,7 +28,7 @@ {{item.error.Name.validation}} {{/if}} -