diff --git a/src/components/FormField/index.jsx b/src/components/FormField/index.jsx index e7b281cc..857cda80 100644 --- a/src/components/FormField/index.jsx +++ b/src/components/FormField/index.jsx @@ -46,6 +46,7 @@ const FormField = ({ field, isGroupField }) => { = props.minValue) { props.onChange(event.target.value); } else { - props.onChange(props.minValue); + if (props.isRequired) { + props.onChange(props.minValue); + } else { + // can delete the number + props.onChange(""); + } } } else { props.onChange(event.target.value); diff --git a/src/routes/JobDetails/index.jsx b/src/routes/JobDetails/index.jsx index 293d9269..16990483 100644 --- a/src/routes/JobDetails/index.jsx +++ b/src/routes/JobDetails/index.jsx @@ -64,8 +64,8 @@ const JobDetails = ({ teamId, jobId }) => { }> {formatDate(job.startDate)} - }> - {formatDate(job.endDate)} + }> + {job.duration || "TBD"} }> {job.resourceType} diff --git a/src/routes/JobForm/index.jsx b/src/routes/JobForm/index.jsx index 2ca9ea19..92a6987e 100644 --- a/src/routes/JobForm/index.jsx +++ b/src/routes/JobForm/index.jsx @@ -66,7 +66,7 @@ const JobForm = ({ teamId, jobId }) => { description: values.description, title: values.title, startDate: values.startDate, - endDate: values.endDate, + duration: values.duration, numPositions: values.numPositions, resourceType: values.resourceType, rateType: values.rateType, diff --git a/src/routes/JobForm/utils.js b/src/routes/JobForm/utils.js index 365c64e9..55f61f6e 100644 --- a/src/routes/JobForm/utils.js +++ b/src/routes/JobForm/utils.js @@ -14,7 +14,7 @@ const CREATE_JOB_ROWS = [ { type: FORM_ROW_TYPE.SINGLE, fields: ["description"] }, { type: FORM_ROW_TYPE.SINGLE, fields: ["numPositions"] }, { type: FORM_ROW_TYPE.SINGLE, fields: ["skills"] }, - { type: FORM_ROW_TYPE.GROUP, fields: ["startDate", "endDate"] }, + { type: FORM_ROW_TYPE.GROUP, fields: ["startDate", "duration"] }, { type: FORM_ROW_TYPE.SINGLE, fields: ["resourceType"] }, { type: FORM_ROW_TYPE.SINGLE, fields: ["rateType"] }, { type: FORM_ROW_TYPE.SINGLE, fields: ["workload"] }, @@ -26,7 +26,7 @@ const EDIT_JOB_ROWS = [ { type: FORM_ROW_TYPE.SINGLE, fields: ["description"] }, { type: FORM_ROW_TYPE.SINGLE, fields: ["numPositions"] }, { type: FORM_ROW_TYPE.SINGLE, fields: ["skills"] }, - { type: FORM_ROW_TYPE.GROUP, fields: ["startDate", "endDate"] }, + { type: FORM_ROW_TYPE.GROUP, fields: ["startDate", "duration"] }, { type: FORM_ROW_TYPE.SINGLE, fields: ["resourceType"] }, { type: FORM_ROW_TYPE.SINGLE, fields: ["rateType"] }, { type: FORM_ROW_TYPE.SINGLE, fields: ["workload"] }, @@ -79,10 +79,11 @@ export const getEditJobConfig = (skillOptions, onSubmit) => { placeholder: "Start Date", }, { - label: "End Date", - type: FORM_FIELD_TYPE.DATE, - name: "endDate", - placeholder: "End Date", + label: "Duration", + type: FORM_FIELD_TYPE.NUMBER, + name: "duration", + minValue: 1, + placeholder: "Duration", }, { label: "Resource Type", @@ -163,10 +164,11 @@ export const getCreateJobConfig = (skillOptions, onSubmit) => { placeholder: "Start Date", }, { - label: "End Date", - type: FORM_FIELD_TYPE.DATE, - name: "endDate", - placeholder: "End Date", + label: "Duration", + type: FORM_FIELD_TYPE.NUMBER, + name: "duration", + minValue: 1, + placeholder: "Duration", }, { label: "Resource Type",