import React from 'react'; import { t } from '@lingui/macro'; import { useField } from 'formik'; import { Form, FormGroup, Switch } from '@patternfly/react-core'; import styled from 'styled-components'; import FormField from '../../FormField'; import { TagMultiSelect } from '../../MultiSelect'; import AnsibleSelect from '../../AnsibleSelect'; import { VariablesField } from '../../CodeEditor'; import Popover from '../../Popover'; import { VerbositySelectField } from '../../VerbositySelectField'; const FieldHeader = styled.div` display: flex; justify-content: space-between; padding-bottom: var(--pf-c-form__label--PaddingBottom); label { --pf-c-form__label--PaddingBottom: 0px; } `; function OtherPromptsStep({ launchConfig, variablesMode, onVarModeChange }) { return (
{ e.preventDefault(); }} > {launchConfig.ask_job_type_on_launch && } {launchConfig.ask_limit_on_launch && ( )} {launchConfig.ask_scm_branch_on_launch && ( )} {launchConfig.ask_verbosity_on_launch && } {launchConfig.ask_diff_mode_on_launch && } {launchConfig.ask_tags_on_launch && ( )} {launchConfig.ask_skip_tags_on_launch && ( )} {launchConfig.ask_variables_on_launch && ( )} ); } function JobTypeField() { const [field, meta, helpers] = useField('job_type'); const options = [ { value: '', key: '', label: t`Choose a job type`, isDisabled: true, }, { value: 'run', key: 'run', label: t`Run`, isDisabled: false }, { value: 'check', key: 'check', label: t`Check`, isDisabled: false, }, ]; const isValid = !(meta.touched && meta.error); return ( } isRequired validated={isValid ? 'default' : 'error'} > helpers.setValue(value)} /> ); } function VerbosityField() { const [, meta] = useField('verbosity'); const isValid = !(meta.touched && meta.error); return ( ); } function ShowChangesToggle() { const [field, , helpers] = useField('diff_mode'); return ( {' '} ); } function TagField({ id, name, label, tooltip }) { const [field, , helpers] = useField(name); return ( } > ); } export default OtherPromptsStep;