Skip to content

Commit

Permalink
Salt Report Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ionwyn committed May 29, 2024
1 parent 03e1ce6 commit 603c596
Show file tree
Hide file tree
Showing 5 changed files with 292 additions and 212 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ const AddSaltReportFormFields = ({ setInitialValues, formValues, setValidationSc
<Row>
<Col sm={1}>3.1</Col>
<Col>
Indicate the number of objectives<sup>1</sup> that were identified and achieved for this year in your
salt management plan within the following areas: (refer to Appendix A for a sample list of objectives)
Provide the total quantity of material used for winter road maintenance (including sidewalks) as of May
31st 2024. (If your organization uses multi-chloride<sup>4</sup> products, see question 3.2)
</Col>
</Row>
<Row className="my-2">
Expand All @@ -408,13 +408,17 @@ const AddSaltReportFormFields = ({ setInitialValues, formValues, setValidationSc
</td>
</tr>
<tr>
<th>Magnesium chloride (MgCl2)</th>
<th>
Magnesium chloride (MgCl<sub>2</sub>)
</th>
<td>
<FormNumberInput type="number" name="sect3.deicer.mgcl2" step="0.01" />
</td>
</tr>
<tr>
<th>Calcium chloride (CaCl2)</th>
<th>
Calcium chloride (CaCl<sub>2</sub>)
</th>
<td>
<FormNumberInput type="number" name="sect3.deicer.cacl2" step="0.01" />
</td>
Expand Down Expand Up @@ -447,13 +451,17 @@ const AddSaltReportFormFields = ({ setInitialValues, formValues, setValidationSc
</td>
</tr>
<tr>
<th>Magnesium chloride (MgCl2)</th>
<th>
Magnesium chloride (MgCl<sub>2</sub>)
</th>
<td>
<FormNumberInput type="number" name="sect3.treatedAbrasives.mgcl2" step="0.01" />
</td>
</tr>
<tr>
<th>Calcium chloride (CaCl2)</th>
<th>
Calcium chloride (CaCl<sub>2</sub>)
</th>
<td>
<FormNumberInput type="number" name="sect3.treatedAbrasives.cacl2" step="0.01" />
</td>
Expand All @@ -470,19 +478,25 @@ const AddSaltReportFormFields = ({ setInitialValues, formValues, setValidationSc
</td>
</tr>
<tr>
<th>Magnesium chloride (MgCl2)</th>
<th>
Magnesium chloride (MgCl<sub>2</sub>)
</th>
<td>
<FormNumberInput type="number" name="sect3.prewetting.mgcl2" step="0.01" />
</td>
</tr>
<tr>
<th>Calcium chloride (CaCl2)</th>
<th>
Calcium chloride (CaCl<sub>2</sub>)
</th>
<td>
<FormNumberInput type="number" name="sect3.prewetting.cacl2" step="0.01" />
</td>
</tr>
<tr>
<th>Acetate2</th>
<th>
Acetate<sup>2</sup>
</th>
<td>
<FormNumberInput type="number" name="sect3.prewetting.acetate" step="0.01" />
</td>
Expand All @@ -507,19 +521,25 @@ const AddSaltReportFormFields = ({ setInitialValues, formValues, setValidationSc
</td>
</tr>
<tr>
<th>Magnesium chloride (MgCl2)</th>
<th>
Magnesium chloride (MgCl<sub>2</sub>)
</th>
<td>
<FormNumberInput type="number" name="sect3.pretreatment.mgcl2" step="0.01" />
</td>
</tr>
<tr>
<th>Calcium chloride (CaCl2)</th>
<th>
Calcium chloride (CaCl<sub>2</sub>)
</th>
<td>
<FormNumberInput type="number" name="sect3.pretreatment.cacl2" step="0.01" />
</td>
</tr>
<tr>
<th>Acetate2</th>
<th>
Acetate<sup>2</sup>
</th>
<td>
<FormNumberInput type="number" name="sect3.pretreatment.acetate" step="0.01" />
</td>
Expand All @@ -542,19 +562,25 @@ const AddSaltReportFormFields = ({ setInitialValues, formValues, setValidationSc
</td>
</tr>
<tr>
<th>Magnesium chloride (MgCl2)</th>
<th>
Magnesium chloride (MgCl<sub>2</sub>)
</th>
<td>
<FormNumberInput type="number" name="sect3.antiicing.mgcl2" step="0.01" />
</td>
</tr>
<tr>
<th>Calcium chloride (CaCl2)</th>
<th>
Calcium chloride (CaCl<sub>2</sub>)
</th>
<td>
<FormNumberInput type="number" name="sect3.antiicing.cacl2" step="0.01" />
</td>
</tr>
<tr>
<th>Acetate2</th>
<th>
Acetate<sup>2</sup>
</th>
<td>
<FormNumberInput type="number" name="sect3.antiicing.acetate" step="0.01" />
</td>
Expand Down Expand Up @@ -639,16 +665,16 @@ const AddSaltReportFormFields = ({ setInitialValues, formValues, setValidationSc
<Col sm={1}>4.1</Col>
<Col sm={7}>How many salt storage sites (locations, not stockpiles) are in your Service Area?</Col>
<Col>
<FormNumberInput type="number" name="sect4.saltStorageSitesTotal" />
<FormNumberInput type="number" name="sect4.saltStorageSitesTotal" step="1" />
</Col>
</Row>
<Row className="my-4">
<Col>
<Row>
<Col sm={1}>4.2</Col>
<Col>
Indicate the number of objectives<sup>1</sup> that were identified and achieved for this year in your
salt management plan within the following areas: (refer to Appendix A for a sample list of objectives)
Provide the number of stockpiles that are stored under the following conditions. If your organization
manages more than one site, provide the information for each site (insert additional rows as needed to table below)
</Col>
</Row>
<Row className="my-2">
Expand Down Expand Up @@ -735,7 +761,7 @@ const AddSaltReportFormFields = ({ setInitialValues, formValues, setValidationSc
</td>
<td>
<Button type="button" onClick={() => remove(index)}>
Remove row
Remove
</Button>
</td>
</tr>
Expand All @@ -762,7 +788,7 @@ const AddSaltReportFormFields = ({ setInitialValues, formValues, setValidationSc
})
}
>
Add Row
Add Stockpile
</Button>
</>
)}
Expand All @@ -776,8 +802,9 @@ const AddSaltReportFormFields = ({ setInitialValues, formValues, setValidationSc
<Row>
<Col sm={1}>4.3</Col>
<Col>
Indicate the number of objectives<sup>1</sup> that were identified and achieved for this year in your
salt management plan within the following areas: (refer to Appendix A for a sample list of objectives)
Provide the characteristics of your storage site design and the working activities that support good
housekeeping practices. If your organization manages more than one site, indicate the number of sites
with the given characteristic.
</Col>
</Row>
<Row className="my-2">
Expand Down Expand Up @@ -872,7 +899,7 @@ const AddSaltReportFormFields = ({ setInitialValues, formValues, setValidationSc
</Col>
<Col>
Frequency
<FormNumberInput type="number" name="sect5.regularCalibrationTotal" placeholder="times per year" />
<FormNumberInput type="number" name="sect5.regularCalibrationTotal" placeholder="times per year" step="1" />
</Col>
</Row>
</Col>
Expand Down Expand Up @@ -1263,7 +1290,7 @@ const AddSaltReportFormFields = ({ setInitialValues, formValues, setValidationSc
</Row>
<Row className="my-2">
<Col>
<h4>List the Vulnerable Areas</h4>
<h4>List the Vulnerable Areas in your Service Area: (insert additional rows as needed to table below)</h4>
<FieldArray name="sect7.vulnerableAreas">
{({ insert, remove }) => (
<>
Expand All @@ -1287,16 +1314,17 @@ const AddSaltReportFormFields = ({ setInitialValues, formValues, setValidationSc
<FormInput name={`sect7.vulnerableAreas.${index}.highwayNumber`} type="text" />
</td>
<td>
<FormInput name={`sect7.vulnerableAreas.${index}.latitude`} type="text" />
<FormNumberInput name={`sect7.vulnerableAreas.${index}.latitude`} type="number" />
</td>
<td>
<FormInput name={`sect7.vulnerableAreas.${index}.longitude`} type="text" />
<FormNumberInput name={`sect7.vulnerableAreas.${index}.longitude`} type="number" />
</td>
<td>
<FormInput name={`sect7.vulnerableAreas.${index}.feature`} type="text" />
</td>
<td>
<Field name={`sect7.vulnerableAreas.${index}.type`} as="select">
<option value="">Select an option</option>
<option value="drinkingwater">Drinking Water</option>
<option value="aquatic">Aquatic Life</option>
<option value="wetlands">Wetlands</option>
Expand All @@ -1319,7 +1347,7 @@ const AddSaltReportFormFields = ({ setInitialValues, formValues, setValidationSc
</td>
<td>
<Button type="button" onClick={() => remove(index)}>
Remove row
Remove
</Button>
</td>
</tr>
Expand Down
32 changes: 2 additions & 30 deletions client/src/js/components/forms/saltreport/DefaultValues.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,7 @@ export const defaultValues = {
},
sect4: {
saltStorageSitesTotal: null,
stockpiles: [
{
siteName: '',
motiOwned: false,
roadSalts: {
stockpilesTotal: null,
onImpermeableSurface: null,
underPermanentRoof: null,
underTarp: null,
},
treatedAbrasives: {
stockpilesTotal: null,
onImpermeableSurface: null,
underPermanentRoof: null,
underTarp: null,
},
},
],
stockpiles: [],
practices: {
allMaterialsHandled: {
hasPlan: false,
Expand Down Expand Up @@ -212,18 +195,7 @@ export const defaultValues = {
areasWithChloride: null,
},
},
vulnerableAreas: [
{
highwayNumber: null,
latitude: null,
longitude: null,
feature: null,
type: null,
protectionMeasures: null,
environmentalMonitoring: false,
comments: null
},
],
vulnerableAreas: [],
},
appendix: {
materialStorage: {
Expand Down
Loading

0 comments on commit 603c596

Please sign in to comment.