Closed rajadain closed 5 years ago
Alright, that took a while, but I've managed to switch to a Prop Type corresponding to our survey model in the back-end:
export const Survey = shape({
id: number,
month_year: string.isRequired,
num_colonies: number,
created_at: string,
survey_type: string.isRequired,
apiary: number.isRequired,
completed: bool.isRequired,
});
id
, num_colonies
, and created_at
are optional fields, because they'll only have values for submitted surveys. Now, when compiling the list of surveys, we go over every calculated month_year
value, and if a corresponding survey is found we use that (after settings its completed=true
). Otherwise, we make a new one with month_year
, survey_type
, apiary
, and completed = false
. The various commits have been rebased and fixed up to reflect this.
Ready for another review.
Thanks for reviewing again. Will merge when green.
Overview
Updates the Survey Listing for each apiary to list November, April, and Monthly surveys separately, with explicit marking. Pro users see all three kinds of listings, and Light users see only November and April listings. We begin counting from November 2018 for November and April surveys, and from the date of the apiary's creation for the Monthly surveys.
We still show the four most recent survey listings in a survey card, with the rest hidden behind a "View full history" button. Clicking that button opens a popup that lists all the surveys for that apiary.
Connects #398 Connects #378
Demo
For Pro Users:
For Light Users:
Notes
The Survey Detail dialog needs styling. I've made a note in #393.
Testing Instructions
beekeepers start