-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add Log Entry / Calendar Symptom Shark Components #110
Merged
Conversation
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
9 tasks
greinard
reviewed
Sep 27, 2023
greinard
reviewed
Sep 27, 2023
greinard
reviewed
Sep 27, 2023
greinard
reviewed
Sep 27, 2023
greinard
reviewed
Sep 27, 2023
greinard
reviewed
Sep 27, 2023
greinard
reviewed
Sep 27, 2023
greinard
reviewed
Sep 27, 2023
greinard
reviewed
Sep 27, 2023
greinard
reviewed
Sep 27, 2023
greinard
reviewed
Sep 27, 2023
import language from "./language"; | ||
|
||
export function daysInMonth(iYear: number, iMonth: number) { | ||
return 32 - new Date(iYear, iMonth, 32).getDate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is clever.
greinard
reviewed
Sep 27, 2023
greinard
reviewed
Sep 27, 2023
src/components/symptom-shark/presentational/SymptomSeverityChart/SymptomSeverityChart.tsx
Outdated
Show resolved
Hide resolved
greinard
reviewed
Sep 27, 2023
src/components/symptom-shark/presentational/OverallExperienceChart/OverallExperienceChart.tsx
Outdated
Show resolved
Hide resolved
greinard
reviewed
Sep 27, 2023
...nts/symptom-shark/presentational/SymptomTreatmentFilters/SymptomTreatmentFilters.stories.tsx
Show resolved
Hide resolved
greinard
reviewed
Sep 27, 2023
greinard
reviewed
Sep 27, 2023
src/components/symptom-shark/view/SymptomDetailView/SymptomDetailView.stories.tsx
Show resolved
Hide resolved
greinard
reviewed
Sep 27, 2023
src/components/symptom-shark/view/LogEntryEditView/LogEntryEditView.stories.tsx
Outdated
Show resolved
Hide resolved
greinard
approved these changes
Sep 27, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I played around in a story book quite a bit too. Everything seems to be working as expected.
Thanks @greinard ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This is a start to hopefully enable new MyDataHelps projects to incorporate Symptom Logging (Symptom Shark) more easily. Much of this has been copied from Symptom Shark and re-worked a bit to generalize it (and of course stories were added)
I organized these in storybook under a "SymptomShark" section that has presentation/container/view subsections. Stuff that felt functionally specific to Symptom Shark was put there (which is most of this) but some stuff (like NotesInput) was general enough that it was placed outside that library.
For basic reverse chronological logging and editing of logs there is:
For visualization, I brought in all the functionality of the Symptom Shark "Calendar" view, including:
I wanted these components to be easily drag/drop reorderable via the upcoming view builder. However, it doesn't really work from an efficiency/perf perspective for these components to fetch their own data - that would be very redundant since there could be a lot of these components on the page.
So I followed the "DateRangeCoordinator" pattern and created a "SymptomSharkVisualizationCoordinator" for the overall experience chart, symptom severity chart, calendar, and histograms to sit inside. SymptomSharkVisualizationCoordinator has a flag for "AllowFilters" which will show/hide the filters at the top as well.
SymptomSharkVisualizationCoordinator does the data fetching and renders it's child viz components when the data has been fetched. The visualization components get the data from the context.
Notable pieces of Symptom Shark not yet included (future PR):
All the strings here are localized.
Some other notable tweaks / additions:
TODO:
Security
REMINDER: All file contents are public.
Describe briefly what security risks you considered, why they don't apply, or how they've been mitigated.
Checklist
Testing
Documentation
Consider "Squash and merge" as needed to keep the commit history reasonable on
main
.Reviewers
Assign to the appropriate reviewer(s). Minimally, a second set of eyes is needed ensure no non-public information is published. Consider also including: