-
Notifications
You must be signed in to change notification settings - Fork 0
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
Store slot visibility settings on a per-Study basis #206
Conversation
…ronger typing around template names
Oops, I see I have conflicts to fix. I will get to that later today. |
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! I found the PR description very helpful, both to understand the real-world context (i.e. motivation for doing this) and to understand various aspects of the diff.
I left some comments, including at least one that is to remind myself to look into something. I will re-read and act upon that/those right after I submit this review. Edit: I'm done doing that.
Fixes #150
Summary
Currently, slot visibility is stored as an app-level setting. This means that, for a given user, all studies that use the soil template (for example) will show the same set of slots. But two users with access to the same study may see different slots depending on their app settings. During beta testing we received feedback that:
To address those pain points, these changes update slot visibility so that it is a property of a study (technically a
SubmissionMetadata
record), as opposed to a local app setting. The supporting backend changes have already been merged intonmdc-server
in microbiomedata/nmdc-server#1473.These changes also address the feedback that choosing from a long list of slots associated with a given template can be overwhelming. The solution here is to use the results of some manual curation of slots by team members to group and prioritize slots that are often collected at sampling time (and thus while using the app) versus slots that might be collected at sampling time vs all other slots.
Details
src/Store.tsx
, functions for setting and getting slot visibility state have been removed since that information will no longer be stored there.src/pages/FieldVisibilitySettingsPage/FieldVisibilitySettingsPage.tsx
) has been removed, along with the routing and links to the that page (src/Router.tsx
,src/components/SettingsAppearanceList/SettingsAppearanceList.tsx
,src/paths.ts
)StudyView
component (src/components/StudyView/StudyView.tsx
) now explicitly lists which template was selected for the study, along with the number of visible slots chosen. TheStudyView
is also now responsible for presenting theSlotSelectorModal
component when tapping on the template name. This design decision has an eye toward the fact that more than one template will be allowed in the near future. Previously, theSlotSelectorModal
was presented by theSampleView
component. Since the visible slots are now managed at the study level, this list of slots is passed toSlotSelectorModal
byStudyView
.useNavigateWithState
exposes anavigate
function which uses ahistory
object to navigate to a new route with state. ThenuseNavigationState
is used to access and optionally clear that state. TheStudyCreatePage
component usesuseNavigateWithState
to navigate to the newly created study page with aopenSlotSelectorModalOnEnter
flag set. Then theStudyViewPage
component usesuseNavigationState
to get that flag and pass it along to theStudyView
component. The flag is also cleared after it is used so that navigating away from theStudyViewPage
and then back to it does not re-trigger the slot selector modal.groupTemplateSlots
insrc/components/SlotSelectorModal/SlotSelectorModal.tsx
andsortSlots
insrc/utils.ts
) and their usage have been updated to reflect that we are not using the grouping and sorting indicated by the submission schema itself anymore, which was designed for the Submission Portal. Instead, we are using a more simplified grouping and sorting that is more user-friendly for the Field Notes app. The filesrc/components/SlotSelectorModal/slotVisibilities.ts
was created as a result of a manual assessment of slots by NMDC team members and is used to drive the new grouping logic.--nmdc-font-size-*
) have been added in order to standardize font sizes. These are also wrapped in new utility CSS classes (.nmdc-text-*
insrc/theme/global.css
)TEMPLATES
object insrc/api.ts
-- as opposed to an arbitrary string) have been tighten up.