mirror of
https://github.com/ansible/awx.git
synced 2026-05-09 18:37:36 -02: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:
@@ -22,7 +22,7 @@ function CredentialPluginInput(props) {
|
|||||||
i18n,
|
i18n,
|
||||||
isDisabled,
|
isDisabled,
|
||||||
isRequired,
|
isRequired,
|
||||||
isValid,
|
validated,
|
||||||
fieldOptions,
|
fieldOptions,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ function CredentialPluginInput(props) {
|
|||||||
{React.cloneElement(children, {
|
{React.cloneElement(children, {
|
||||||
...inputField,
|
...inputField,
|
||||||
isRequired,
|
isRequired,
|
||||||
validated: isValid ? 'default' : 'error',
|
validated: validated ? 'default' : 'error',
|
||||||
isDisabled: disableFieldAndButtons,
|
isDisabled: disableFieldAndButtons,
|
||||||
onChange: (_, event) => {
|
onChange: (_, event) => {
|
||||||
inputField.onChange(event);
|
inputField.onChange(event);
|
||||||
@@ -96,7 +96,7 @@ function CredentialPluginInput(props) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function CredentialPluginField(props) {
|
function CredentialPluginField(props) {
|
||||||
const { fieldOptions, isRequired, isValid } = props;
|
const { fieldOptions, isRequired, validated } = props;
|
||||||
|
|
||||||
const [, meta, helpers] = useField(`inputs.${fieldOptions.id}`);
|
const [, meta, helpers] = useField(`inputs.${fieldOptions.id}`);
|
||||||
const [passwordPromptField] = useField(`passwordPrompts.${fieldOptions.id}`);
|
const [passwordPromptField] = useField(`passwordPrompts.${fieldOptions.id}`);
|
||||||
@@ -136,7 +136,7 @@ function CredentialPluginField(props) {
|
|||||||
fieldId={`credential-${fieldOptions.id}`}
|
fieldId={`credential-${fieldOptions.id}`}
|
||||||
helperTextInvalid={meta.error}
|
helperTextInvalid={meta.error}
|
||||||
isRequired={isRequired}
|
isRequired={isRequired}
|
||||||
validated={isValid ? 'default' : 'error'}
|
validated={validated ? 'default' : 'error'}
|
||||||
label={fieldOptions.label}
|
label={fieldOptions.label}
|
||||||
labelIcon={
|
labelIcon={
|
||||||
fieldOptions.help_text && (
|
fieldOptions.help_text && (
|
||||||
|
|||||||
Reference in New Issue
Block a user