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
2 changed files with 8 additions and 1 deletions

View File

@@ -128,7 +128,7 @@ function AddEditCredentialsController (
let gceFileInputPreEditValues; let gceFileInputPreEditValues;
vm.form.inputs = { vm.form.inputs = {
_get ({ getSubmitData }) { _get ({ getSubmitData, check }) {
const apiConfig = ConfigService.get(); const apiConfig = ConfigService.get();
credentialType.mergeInputProperties(); credentialType.mergeInputProperties();
@@ -152,6 +152,7 @@ function AddEditCredentialsController (
} }
vm.isTestable = (isEditable && credentialType.get('kind') === 'external'); vm.isTestable = (isEditable && credentialType.get('kind') === 'external');
vm.getSubmitData = getSubmitData; vm.getSubmitData = getSubmitData;
vm.checkForm = check;
return fields; return fields;
}, },
@@ -345,7 +346,9 @@ function AddEditCredentialsController (
// We've linked this field to a credential, so display value as a credential tag // We've linked this field to a credential, so display value as a credential tag
vm.form[field]._value = ''; vm.form[field]._value = '';
vm.form[field]._tagValue = credentialName; vm.form[field]._tagValue = credentialName;
vm.form[field]._isValid = true;
vm.form[field].asTag = true; vm.form[field].asTag = true;
vm.checkForm();
}; };
vm.onInputSourceTabSelect = (name) => { vm.onInputSourceTabSelect = (name) => {

View File

@@ -51,6 +51,10 @@ function BaseInputController (strings) {
let isValid = true; let isValid = true;
let message = ''; let message = '';
if (scope.state.asTag) {
return (isValid, message);
}
if (scope.state._value || scope.state._displayValue) { if (scope.state._value || scope.state._displayValue) {
scope.state._touched = true; scope.state._touched = true;
} }