generated from Code-4-Community/backend-scaffold
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial treePage commit * worked on styling and added display names for the entries * comment * changes from comments * npm run check * placeholder on submit function for stewardship activity form * removed image and moved form rules * npm run check * image was unused
- Loading branch information
1 parent
e09a33c
commit a1d32a4
Showing
8 changed files
with
828 additions
and
221 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React from 'react'; | ||
import moment from 'moment'; | ||
import { Button, Form, Checkbox, Typography, DatePicker } from 'antd'; | ||
import styled from 'styled-components'; | ||
import { activitiesDateRules, activitiesRules } from '../../utils/formRules'; | ||
|
||
const { Paragraph } = Typography; | ||
|
||
const ItemLabel = styled(Paragraph)` | ||
line-height: 0px; | ||
`; | ||
|
||
const TreeDatePicker = styled(DatePicker)` | ||
width: 50%; | ||
`; | ||
|
||
const StewardshipForm: React.FC = () => { | ||
const stewardshipOptions = [ | ||
'Watered', | ||
'Mulched', | ||
'Weeded', | ||
'Cleared Waste & Litter', | ||
]; | ||
|
||
const onFinishRecordStewardship = (values: { | ||
activityDate: moment.Moment; | ||
stewardshipActivities: string[]; | ||
}) => { | ||
/*Placeholder */ | ||
}; | ||
|
||
return ( | ||
<> | ||
<Form name="recordStewardship" onFinish={onFinishRecordStewardship}> | ||
<ItemLabel>Activity Date</ItemLabel> | ||
<Form.Item name="activityDate" rules={activitiesDateRules}> | ||
<TreeDatePicker defaultValue={moment()} format={'MM/DD/YYYY'} /> | ||
</Form.Item> | ||
<ItemLabel>Stewardship Activites</ItemLabel> | ||
<Form.Item name="stewardshipActivites" rules={activitiesRules}> | ||
<Checkbox.Group options={stewardshipOptions} /> | ||
</Form.Item> | ||
<Form.Item> | ||
<Button type="primary" htmlType="submit"> | ||
Submit | ||
</Button> | ||
</Form.Item> | ||
</Form> | ||
</> | ||
); | ||
}; | ||
|
||
export default StewardshipForm; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
export interface SiteProps { | ||
siteId: number; | ||
blockId: number; | ||
lat: number; | ||
lng: number; | ||
city: string; | ||
zip: string; | ||
address: string; | ||
entries: SiteEntry[]; | ||
} | ||
|
||
export interface SiteEntry { | ||
updatedAt: number; | ||
status?: string; | ||
genus?: string; | ||
species?: string; | ||
commonName?: string; | ||
confidence?: string; | ||
diameter?: number; | ||
circumference?: number; | ||
coverage?: string; | ||
pruning?: string; | ||
condition?: string; | ||
discoloring?: boolean; | ||
leaning?: boolean; | ||
constrictingGrate?: boolean; | ||
wounds?: boolean; | ||
pooling?: boolean; | ||
stakesWith?: boolean; | ||
stakesWithout?: boolean; | ||
light?: boolean; | ||
bicycle?: boolean; | ||
bagWith?: boolean; | ||
bagWithout?: boolean; | ||
tape?: boolean; | ||
suckerGrowth?: boolean; | ||
siteType?: string; | ||
sidewalkWidth?: string; | ||
siteWidth?: string; | ||
siteLength?: string; | ||
material?: string; | ||
raisedBed?: string; | ||
fence?: string; | ||
trash?: string; | ||
wires?: string; | ||
grate?: string; | ||
stump?: string; | ||
treeNotes?: string; | ||
siteNotes?: string; | ||
} | ||
|
||
export const SiteEntryNames: Record<string, string> = { | ||
updatedAt: 'Updated At', | ||
status: 'Status', | ||
genus: 'Genus', | ||
species: 'Species', | ||
commonName: 'Common Name', | ||
confidence: 'Confidence', | ||
diameter: 'Diameter', | ||
circumference: 'Circumference', | ||
coverage: 'Coverage', | ||
pruning: 'Pruning', | ||
condition: 'Condition', | ||
discoloring: 'Discoloring', | ||
leaning: 'Leaning', | ||
constrictingGrate: 'Constricting Grate', | ||
wounds: 'Wounds', | ||
pooling: 'Pooling', | ||
stakesWith: 'Stakes With', | ||
stakesWithout: 'Stakes Without', | ||
light: 'Light', | ||
bicycle: 'Bicycle', | ||
bagWith: 'Bag With', | ||
bagWithout: 'Bag Without', | ||
tape: 'Tape', | ||
suckerGrowth: 'Sucker Growth', | ||
siteType: 'Site Type', | ||
sidewalkWidth: 'Sidewalk Width', | ||
siteWidth: 'Site Width', | ||
siteLength: 'Site Length', | ||
material: 'Material', | ||
raisedBed: 'Raised Bed', | ||
fence: 'Fence', | ||
trash: 'Trash', | ||
wires: 'Wires', | ||
grate: 'Grate', | ||
stump: 'Stump', | ||
treeNotes: 'Tree Notes', | ||
siteNotes: 'Site Notes', | ||
}; | ||
|
||
export interface TreeCare { | ||
date: string; | ||
message: string; | ||
} |
Oops, something went wrong.