Skip to content

Commit

Permalink
Skeletons there for new public form. WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
micheal-w-wells committed Jul 17, 2024
1 parent a13ed8a commit a690d8b
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 0 deletions.
Binary file added app/public/assets/bear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions app/src/UI/Overlay/Landing/Landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ export const LandingComponent = (props) => {
}
};

const reportInvasivesPublic = async () => {
history.push('/ReportInvasive');
/*
dispatch({
type: TOGGLE_PANEL,
payload: { panelOpen: true, fullScreen: true }
});
*/
}
};

const { authenticated, workingOffline, username, displayName, email, roles } = useSelector(selectAuth);
const { loaded: userInfoLoaded, activated } = useSelector(selectUserInfo);
return (
Expand Down Expand Up @@ -172,6 +183,17 @@ export const LandingComponent = (props) => {
<InformationalLinkBox />
</>
)}
<Typography variant="h5">
<br />
<strong>To report invasive species as a member of the public, please submit a Report Invasives form</strong>
</Typography>
{connected && !activated && (
<Box mt={2} paddingBottom={'50px'}>
<Button variant="outlined" color="primary" onClick={reportInvasivesPublic}>
Report Invasives
</Button>
</Box>
)}
{roles.length === 0 && (
<Typography variant="h5">
<br />
Expand Down
Empty file.
42 changes: 42 additions & 0 deletions app/src/UI/PublicReportInvasive/ReportInvasiveForm.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
export const ReportInvasivesForm = () => {
const handleSubmit = () => {};

return (
<div>
<h1>Report Invasive Species</h1>
<form onSubmit={handleSubmit}>
<div>
<label htmlFor="email">Email:</label>
<input type="email" id="email" name="email" required />
</div>
<div>
<label htmlFor="telephone">Telephone:</label>
<input type="tel" id="telephone" name="telephone" required />
</div>
<div>
<label htmlFor="personObserving">Person Observing:</label>
<input type="text" id="personObserving" name="personObserving" required />
</div>
<div>
<label htmlFor="date_observed">Date Observed:</label>
<input type="date" id="date_observed" name="date_observed" required />
</div>
<div>
<label htmlFor="suspected_species">Suspected Species:</label>
<input type="text" id="suspected_species" name="suspected_species" required />
</div>
<div>
<label htmlFor="location">Location:</label>
<input type="text" id="location" name="location" required />
</div>
<div>
<label htmlFor="area_of_infestation_comments">Area of Infestation Comments:</label>
<textarea id="area_of_infestation_comments" name="area_of_infestation_comments" required></textarea>
</div>
<div>
<button type="submit">Submit Report</button>
</div>
</form>
</div>
);
};
15 changes: 15 additions & 0 deletions sharedAPI/src/openapi/api-doc/Activities/Plant/Observations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,18 @@ export const Activity_Observation_PlantAquatic = {
}
}
};

export const Activity_Observation_Plant_Public = {
type: 'object',
properties: {
activity_data: {
...Activity
},
activity_type_data: {
...Observation
},
activity_subtype_data: {
...Subtype_Data_Observation_PlantAquatic
}
}
};
10 changes: 10 additions & 0 deletions sharedAPI/src/openapi/api-doc/PublicReportInvasive.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export const PublicReportInvasive = {
type: 'object',
email: { type: 'string' },
telephone: { type: 'string' },
personObserving: { type: 'string' },
date_observed: { type: 'string' },
suspected_species: { type: 'string' },
location: { type: 'string' },
area_of_infestation_comments: { type: 'string' },
}
2 changes: 2 additions & 0 deletions sharedAPI/src/openapi/api-doc/api-doc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
Activity_Monitoring_ChemicalTerrestrialAquaticPlant,
Activity_Monitoring_MechanicalTerrestrialAquaticPlant
} from './Activities/Plant/Monitorings';
import { PublicReportInvasive} from './PublicReportInvasive';
import {
Activity_Observation_PlantAquatic,
Activity_Observation_PlantTerrestrial
Expand Down Expand Up @@ -166,6 +167,7 @@ export const api_doc = {
AdminDefinedShapeResultItem,

AdminDefinedShapeResponse,
PublicReportInvasive: PublicReportInvasive,

//treatments
Activity_Treatment_ChemicalPlantTerrestrial: Activity_Treatment_ChemicalPlantTerrestrial,
Expand Down

0 comments on commit a690d8b

Please sign in to comment.