From aa4575c92e89d332675f43eec2cb5e393886050d Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Mon, 25 Mar 2019 20:02:13 -0400 Subject: [PATCH] update validation when input source is set --- .../features/credentials/add-edit-credentials.controller.js | 5 ++++- awx/ui/client/lib/components/input/base.controller.js | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/features/credentials/add-edit-credentials.controller.js b/awx/ui/client/features/credentials/add-edit-credentials.controller.js index 64d5c4a93c..15be0eb87d 100644 --- a/awx/ui/client/features/credentials/add-edit-credentials.controller.js +++ b/awx/ui/client/features/credentials/add-edit-credentials.controller.js @@ -128,7 +128,7 @@ function AddEditCredentialsController ( let gceFileInputPreEditValues; vm.form.inputs = { - _get ({ getSubmitData }) { + _get ({ getSubmitData, check }) { const apiConfig = ConfigService.get(); credentialType.mergeInputProperties(); @@ -152,6 +152,7 @@ function AddEditCredentialsController ( } vm.isTestable = (isEditable && credentialType.get('kind') === 'external'); vm.getSubmitData = getSubmitData; + vm.checkForm = check; return fields; }, @@ -345,7 +346,9 @@ function AddEditCredentialsController ( // We've linked this field to a credential, so display value as a credential tag vm.form[field]._value = ''; vm.form[field]._tagValue = credentialName; + vm.form[field]._isValid = true; vm.form[field].asTag = true; + vm.checkForm(); }; vm.onInputSourceTabSelect = (name) => { diff --git a/awx/ui/client/lib/components/input/base.controller.js b/awx/ui/client/lib/components/input/base.controller.js index 37d7c467f7..eabd536e34 100644 --- a/awx/ui/client/lib/components/input/base.controller.js +++ b/awx/ui/client/lib/components/input/base.controller.js @@ -51,6 +51,10 @@ function BaseInputController (strings) { let isValid = true; let message = ''; + if (scope.state.asTag) { + return (isValid, message); + } + if (scope.state._value || scope.state._displayValue) { scope.state._touched = true; }