mirror of
https://github.com/ansible/awx.git
synced 2026-01-19 21:51:26 -03:30
Merge pull request #9869 from jakemcdermott/fix-cred-validation-prop
Use validated prop in cred plugin field SUMMARY Fxes an initialization bug for cred plugin fields, introduced by this commit This pr applies the patch described below: cc @marshmalien @unlikelyzero before after Reviewed-by: John Hill <johill@redhat.com>
This commit is contained in:
commit
c7a2a1b9f6
@ -22,7 +22,7 @@ function CredentialPluginInput(props) {
|
||||
i18n,
|
||||
isDisabled,
|
||||
isRequired,
|
||||
isValid,
|
||||
validated,
|
||||
fieldOptions,
|
||||
} = props;
|
||||
|
||||
@ -52,7 +52,7 @@ function CredentialPluginInput(props) {
|
||||
{React.cloneElement(children, {
|
||||
...inputField,
|
||||
isRequired,
|
||||
validated: isValid ? 'default' : 'error',
|
||||
validated: validated ? 'default' : 'error',
|
||||
isDisabled: disableFieldAndButtons,
|
||||
onChange: (_, event) => {
|
||||
inputField.onChange(event);
|
||||
@ -96,7 +96,7 @@ function CredentialPluginInput(props) {
|
||||
}
|
||||
|
||||
function CredentialPluginField(props) {
|
||||
const { fieldOptions, isRequired, isValid } = props;
|
||||
const { fieldOptions, isRequired, validated } = props;
|
||||
|
||||
const [, meta, helpers] = useField(`inputs.${fieldOptions.id}`);
|
||||
const [passwordPromptField] = useField(`passwordPrompts.${fieldOptions.id}`);
|
||||
@ -136,7 +136,7 @@ function CredentialPluginField(props) {
|
||||
fieldId={`credential-${fieldOptions.id}`}
|
||||
helperTextInvalid={meta.error}
|
||||
isRequired={isRequired}
|
||||
validated={isValid ? 'default' : 'error'}
|
||||
validated={validated ? 'default' : 'error'}
|
||||
label={fieldOptions.label}
|
||||
labelIcon={
|
||||
fieldOptions.help_text && (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user