Skip to content

Conversation

@priime0
Copy link
Contributor

@priime0 priime0 commented Nov 12, 2022

Why

ClickUp Ticket

Allows admins to specify the date a tree was planted. This affects the icon used when displaying the tree on the map.

This PR

  • Update EditSiteRequest to include a plantingDate field
  • Add component to Add New Site form
  • Attach plantingDate field to onSubmitAddSite method/function

Screenshots

image

Verification Steps

Planted a tree with a plantingDate 3 years + 1 day ago and a tree with a plantingDate 3 years - 1 day ago. Trees show the correct icon. The database reflects the correct date assigned.

Signed-off-by: Lucas Sta Maria lucas@priime.dev

Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
We use `moment.Moment` because the form uses a `DatePicker`, which
expects the value to be a `moment.Moment`.

Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
@priime0 priime0 added frontend Requires changes to frontend backend Requires changes to backend labels Nov 12, 2022
readonly lat: number;
readonly lng: number;
readonly neighborhoodId: number;
readonly plantingDate?: moment.Moment;
Copy link
Member

Choose a reason for hiding this comment

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

🔧 Import and use Moment directly from moment

</TitleStack>
<TitleStack
title={'Planting Date'}
minWidth={'45%'}
Copy link
Member

Choose a reason for hiding this comment

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

❓ Why min-width? Why use percent of parent?

@chromium-52 chromium-52 force-pushed the site-entry-form-planting-date branch from e0a7aba to 5761cae Compare April 13, 2023 19:46
@chromium-52 chromium-52 merged commit 8a90d14 into master Apr 13, 2023
@chromium-52 chromium-52 deleted the site-entry-form-planting-date branch April 13, 2023 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Requires changes to backend frontend Requires changes to frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants