diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.jsx index e7026c66b7..696809f547 100644 --- a/awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/steps/InventoryStep.jsx @@ -9,7 +9,6 @@ import useRequest from '../../../util/useRequest'; import OptionsList from '../../OptionsList'; import ContentLoading from '../../ContentLoading'; import ContentError from '../../ContentError'; -import { required } from '../../../util/validators'; const QS_CONFIG = getQSConfig('inventory', { page: 1, @@ -20,7 +19,6 @@ const QS_CONFIG = getQSConfig('inventory', { function InventoryStep({ i18n }) { const [field, , helpers] = useField({ name: 'inventory', - validate: required(null, i18n), }); const history = useHistory(); diff --git a/awx/ui_next/src/components/LaunchPrompt/steps/useInventoryStep.jsx b/awx/ui_next/src/components/LaunchPrompt/steps/useInventoryStep.jsx index aa8acbd6f6..ebc875d506 100644 --- a/awx/ui_next/src/components/LaunchPrompt/steps/useInventoryStep.jsx +++ b/awx/ui_next/src/components/LaunchPrompt/steps/useInventoryStep.jsx @@ -9,7 +9,11 @@ export default function useInventoryStep(config, resource, visitedSteps, i18n) { const [stepErrors, setStepErrors] = useState({}); const validate = values => { - if (!config.ask_inventory_on_launch) { + if ( + !config.ask_inventory_on_launch || + (['workflow_job', 'workflow_job_template'].includes(resource.type) && + !resource.inventory) + ) { return {}; } const errors = {}; diff --git a/awx/ui_next/src/screens/Template/TemplateList/TemplateListItem.jsx b/awx/ui_next/src/screens/Template/TemplateList/TemplateListItem.jsx index 716c83e608..eb0be40346 100644 --- a/awx/ui_next/src/screens/Template/TemplateList/TemplateListItem.jsx +++ b/awx/ui_next/src/screens/Template/TemplateList/TemplateListItem.jsx @@ -44,9 +44,7 @@ function TemplateListItem({ fetchTemplates, }) { const [isDisabled, setIsDisabled] = useState(false); - const labelId = `check-action-${template.id}`; - const canLaunch = template.summary_fields.user_capabilities.start; const copyTemplate = useCallback(async () => { if (template.type === 'job_template') { @@ -106,7 +104,7 @@ function TemplateListItem({ ]} /> - {canLaunch && template.type === 'job_template' && ( + {template.summary_fields.user_capabilities.start && ( {({ handleLaunch }) => (