mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 01:57:35 -03:30
Merge pull request #7851 from mabashian/5910-workflow-prompt
Support workflow prompting on launch
Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
https://github.com/jakemcdermott
This commit is contained in:
commit
a659b9d994
@ -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();
|
||||
|
||||
|
||||
@ -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 = {};
|
||||
|
||||
@ -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({
|
||||
]}
|
||||
/>
|
||||
<DataListAction aria-label="actions" aria-labelledby={labelId}>
|
||||
{canLaunch && template.type === 'job_template' && (
|
||||
{template.summary_fields.user_capabilities.start && (
|
||||
<Tooltip content={i18n._(t`Launch Template`)} position="top">
|
||||
<LaunchButton resource={template}>
|
||||
{({ handleLaunch }) => (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user