diff --git a/awx/ui_next/src/screens/Credential/shared/CredentialPlugins/CredentialPluginField.jsx b/awx/ui_next/src/screens/Credential/shared/CredentialPlugins/CredentialPluginField.jsx index d69b0b32f6..63986ea0ce 100644 --- a/awx/ui_next/src/screens/Credential/shared/CredentialPlugins/CredentialPluginField.jsx +++ b/awx/ui_next/src/screens/Credential/shared/CredentialPlugins/CredentialPluginField.jsx @@ -11,6 +11,8 @@ import { Tooltip, } from '@patternfly/react-core'; import { KeyIcon } from '@patternfly/react-icons'; +import styles from '@patternfly/react-styles/css/components/Form/form'; +import { css } from '@patternfly/react-styles'; import FieldWithPrompt from '../../../../components/FieldWithPrompt'; import Popover from '../../../../components/Popover'; import { CredentialPluginPrompt } from './CredentialPluginPrompt'; @@ -101,6 +103,16 @@ function CredentialPluginField(props) { const [, meta, helpers] = useField(`inputs.${fieldOptions.id}`); const [passwordPromptField] = useField(`passwordPrompts.${fieldOptions.id}`); + const invalidHelperTextToDisplay = meta.error && meta.touched && ( +
+ {meta.error} +
+ ); + useEffect(() => { if (passwordPromptField.value) { helpers.setValue(''); @@ -121,15 +133,7 @@ function CredentialPluginField(props) { tooltip={fieldOptions.help_text} > - {meta.error && meta.touched && ( -
- {meta.error} -
- )} + {invalidHelperTextToDisplay} ) : ( + {invalidHelperTextToDisplay} )}