From 3402e5db3514200774713a0b1229b2e47ed77bb7 Mon Sep 17 00:00:00 2001 From: Alex Corey Date: Wed, 2 Sep 2020 11:09:25 -0400 Subject: [PATCH] updates tooltip component, fixes formik configuration on ad hoc qizard --- .../AdHocCommands/AdHocDetailsStep.jsx | 10 ++-- .../shared/CustomMessagesSubForm.jsx | 50 +++++++++---------- 2 files changed, 29 insertions(+), 31 deletions(-) diff --git a/awx/ui_next/src/components/AdHocCommands/AdHocDetailsStep.jsx b/awx/ui_next/src/components/AdHocCommands/AdHocDetailsStep.jsx index 8984e9fa9a..8d9e118dda 100644 --- a/awx/ui_next/src/components/AdHocCommands/AdHocDetailsStep.jsx +++ b/awx/ui_next/src/components/AdHocCommands/AdHocDetailsStep.jsx @@ -32,10 +32,7 @@ function CredentialStep({ i18n, verbosityOptions, moduleOptions }) { name: 'module_name', validate: required(null, i18n), }); - const [module_argsField] = useField({ - name: 'module_args', - validate: required(null, i18n), - }); + const [variablesField] = useField('extra_vars'); const [diff_modeField, , diff_modeHelpers] = useField('diff_mode'); const [become_enabledField, , become_enabledHelpers] = useField( @@ -82,6 +79,7 @@ function CredentialStep({ i18n, verbosityOptions, moduleOptions }) { name="module_args" type="text" label={i18n._(t`Arguments`)} + validate={required(null, i18n)} isRequired={ module_nameField.value === 'command' || module_nameField.value === 'shell' @@ -90,10 +88,10 @@ function CredentialStep({ i18n, verbosityOptions, moduleOptions }) { module_nameField.value ? ( <> {i18n._( - t`These arguments are used with the specified module. You can find information about the ${module_argsField.value} by clicking ` + t`These arguments are used with the specified module. You can find information about the ${module_nameField.value} by clicking ` )} diff --git a/awx/ui_next/src/screens/NotificationTemplate/shared/CustomMessagesSubForm.jsx b/awx/ui_next/src/screens/NotificationTemplate/shared/CustomMessagesSubForm.jsx index 3d1620a6b9..044c5adafd 100644 --- a/awx/ui_next/src/screens/NotificationTemplate/shared/CustomMessagesSubForm.jsx +++ b/awx/ui_next/src/screens/NotificationTemplate/shared/CustomMessagesSubForm.jsx @@ -1,7 +1,7 @@ import 'styled-components/macro'; import React, { useEffect, useRef } from 'react'; import { withI18n } from '@lingui/react'; -import { t, Trans } from '@lingui/macro'; +import { t } from '@lingui/macro'; import { useField, useFormikContext } from 'formik'; import { Switch, Text } from '@patternfly/react-core'; import { @@ -69,30 +69,30 @@ function CustomMessagesSubForm({ defaultMessages, type, i18n }) { css="margin-bottom: var(--pf-c-content--MarginBottom)" > - Use custom messages to change the content of notifications sent - when a job starts, succeeds, or fails. Use curly braces to - access information about the job:{' '} - - {'{{'} job_friendly_name {'}}'} - - ,{' '} - - {'{{'} url {'}}'} - - , or attributes of the job such as{' '} - - {'{{'} job.status {'}}'} - - . You may apply a number of possible variables in the message. - Refer to the{' '} - - Ansible Tower documentation - {' '} - for more details. + Use custom messages to change the content of notifications sent + when a job starts, succeeds, or fails. Use curly braces to access + information about the job:{' '} + + {'{{'} job_friendly_name {'}}'} + + ,{' '} + + {'{{'} url {'}}'} + + , or attributes of the job such as{' '} + + {'{{'} job.status {'}}'} + + . You may apply a number of possible variables in the message. + Refer to the{' '} + + Ansible Tower documentation + {' '} + for more details.