update validation when input source is set

This commit is contained in:
Jake McDermott 2019-03-25 20:02:13 -04:00
parent f0f4f487fb
commit aa4575c92e
No known key found for this signature in database
GPG Key ID: 9A6F084352C3A0B7
2 changed files with 8 additions and 1 deletions

View File

@ -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) => {

View File

@ -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;
}