mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 19:30:39 -03:30
Fixes console errors thrown about isValid on the credential form
This commit is contained in:
parent
7bec29bac7
commit
e6e79227e5
@ -208,8 +208,10 @@ describe('<CredentialForm />', () => {
|
||||
});
|
||||
wrapper.update();
|
||||
expect(
|
||||
wrapper.find('FormGroup[fieldId="credential-gce-file"]').prop('isValid')
|
||||
).toBe(false);
|
||||
wrapper
|
||||
.find('FormGroup[fieldId="credential-gce-file"]')
|
||||
.prop('validated')
|
||||
).toBe('error');
|
||||
|
||||
expect(
|
||||
wrapper
|
||||
|
||||
@ -41,7 +41,7 @@ function BecomeMethodField({ fieldOptions, isRequired }) {
|
||||
)
|
||||
}
|
||||
isRequired={isRequired}
|
||||
isValid={!(meta.touched && meta.error)}
|
||||
validated={!(meta.touched && meta.error) ? 'default' : 'error'}
|
||||
>
|
||||
<Select
|
||||
maxHeight={200}
|
||||
|
||||
@ -29,7 +29,7 @@ function CredentialInput({ fieldOptions, credentialKind, ...rest }) {
|
||||
onChange={(value, event) => {
|
||||
subFormField.onChange(event);
|
||||
}}
|
||||
isValid={isValid}
|
||||
validated={isValid ? 'default' : 'error'}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -38,7 +38,6 @@ function CredentialInput({ fieldOptions, credentialKind, ...rest }) {
|
||||
<PasswordInput
|
||||
{...subFormField}
|
||||
id={`credential-${fieldOptions.id}`}
|
||||
isValid={isValid}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
@ -55,7 +54,7 @@ function CredentialInput({ fieldOptions, credentialKind, ...rest }) {
|
||||
onChange={(value, event) => {
|
||||
subFormField.onChange(event);
|
||||
}}
|
||||
isValid={isValid}
|
||||
validated={isValid ? 'default' : 'error'}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -107,7 +106,7 @@ function CredentialField({ credentialType, fieldOptions, i18n }) {
|
||||
helperTextInvalid={meta.error}
|
||||
label={fieldOptions.label}
|
||||
isRequired={isRequired}
|
||||
isValid={isValid}
|
||||
validated={isValid ? 'default' : 'error'}
|
||||
>
|
||||
<AnsibleSelect
|
||||
{...subFormField}
|
||||
@ -132,7 +131,7 @@ function CredentialField({ credentialType, fieldOptions, i18n }) {
|
||||
)
|
||||
}
|
||||
isRequired={isRequired}
|
||||
isValid={isValid}
|
||||
validated={isValid ? 'default' : 'error'}
|
||||
>
|
||||
<CredentialInput
|
||||
credentialKind={credentialType.kind}
|
||||
@ -150,7 +149,7 @@ function CredentialField({ credentialType, fieldOptions, i18n }) {
|
||||
<CredentialPluginField
|
||||
fieldOptions={fieldOptions}
|
||||
isRequired={isRequired}
|
||||
isValid={isValid}
|
||||
validated={isValid ? 'default' : 'error'}
|
||||
>
|
||||
<CredentialInput fieldOptions={fieldOptions} />
|
||||
</CredentialPluginField>
|
||||
|
||||
@ -43,7 +43,7 @@ function CredentialPluginInput(props) {
|
||||
{React.cloneElement(children, {
|
||||
...inputField,
|
||||
isRequired,
|
||||
isValid,
|
||||
validated: isValid ? 'default' : 'error',
|
||||
isDisabled: !!passwordPromptField.value,
|
||||
onChange: (_, event) => {
|
||||
inputField.onChange(event);
|
||||
@ -125,7 +125,7 @@ function CredentialPluginField(props) {
|
||||
fieldId={`credential-${fieldOptions.id}`}
|
||||
helperTextInvalid={meta.error}
|
||||
isRequired={isRequired}
|
||||
isValid={isValid}
|
||||
validated={isValid ? 'default' : 'error'}
|
||||
label={fieldOptions.label}
|
||||
labelIcon={
|
||||
fieldOptions.help_text && (
|
||||
|
||||
@ -20,7 +20,7 @@ function GceFileUploadField({ i18n }) {
|
||||
return (
|
||||
<FormGroup
|
||||
fieldId="credential-gce-file"
|
||||
isValid={!fileError}
|
||||
validated={!fileError ? 'default' : 'error'}
|
||||
label={i18n._(t`Service account JSON file`)}
|
||||
helperText={i18n._(
|
||||
t`Select a JSON formatted service account key to autopopulate the following fields.`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user