/* eslint-disable camelcase */ import React from 'react'; import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { Form } from '@patternfly/react-core'; import { selectEffectiveUser, selectAdvancedTemplateInputs, selectJobTemplate, } from '../../JobWizardSelectors'; import { generateDefaultDescription } from '../../JobWizardHelpers'; import { EffectiveUserField, TimeoutToKillField, TimeToPickupField, PasswordField, KeyPassphraseField, EffectiveUserPasswordField, ConcurrencyLevelField, TimeSpanLevelField, TemplateInputsFields, ExecutionOrderingField, SSHUserField, } from './Fields'; import { DescriptionField } from './DescriptionField'; import { WIZARD_TITLES } from '../../JobWizardConstants'; import { WizardTitle } from '../form/WizardTitle'; export const AdvancedFields = ({ templateValues, advancedValues, setAdvancedValues, }) => { const effectiveUser = useSelector(selectEffectiveUser); const advancedTemplateInputs = useSelector(selectAdvancedTemplateInputs); const jobTemplate = useSelector(selectJobTemplate); return ( <>
setAdvancedValues({ templateValues: newValue })} defaultValue={jobTemplate} /> setAdvancedValues({ sshUser: newValue, }) } /> {effectiveUser?.overridable && ( setAdvancedValues({ effectiveUserValue: newValue, }) } /> )} setAdvancedValues({ description: newValue })} defaultValue={generateDefaultDescription({ description_format: jobTemplate.job_template.description_format, advancedInputs: jobTemplate.advanced_template_inputs, inputs: jobTemplate.template_inputs, name: jobTemplate.job_template.name, })} /> setAdvancedValues({ timeoutToKill: newValue, }) } /> setAdvancedValues({ timeToPickup: newValue, }) } /> setAdvancedValues({ password: newValue, }) } /> setAdvancedValues({ keyPassphrase: newValue, }) } /> setAdvancedValues({ effectiveUserPassword: newValue, }) } /> setAdvancedValues({ concurrencyLevel: newValue, }) } /> setAdvancedValues({ timeSpan: newValue, }) } /> setAdvancedValues({ isRandomizedOrdering: newValue, }) } /> ); }; AdvancedFields.propTypes = { advancedValues: PropTypes.object.isRequired, setAdvancedValues: PropTypes.func.isRequired, templateValues: PropTypes.object.isRequired, }; export default AdvancedFields;