Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public Report Invasives Form #3380

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
}
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

If you're using VSC you can enable these settings to prevent the dreaded Red circle from appearing automatically

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
Loading