Skip to content
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

Switch Bios #55

Merged
merged 46 commits into from
Apr 26, 2024
Merged

Switch Bios #55

merged 46 commits into from
Apr 26, 2024

Conversation

MatthewTurk247
Copy link
Collaborator

Switch Bios

♻️ Current situation & Problem

Provides support for switching the list of contacts featured in the app, depending on whether the user is enrolled in the pediatric study or the adult study. Each patient is assigned an age group in Firebase when they sign up.

⚙️ Release Notes

  • Uses a Boolean variable (based on account environment variable) indicating whether the logged-in user is in the pediatric age group or the adult age group.
  • Adds new localized strings and if statements to switch between text.
  • Adds UI tests for said switches.

📚 Documentation

See #52.

✅ Testing

Included in code changes.

Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

Copy link
Member

@PSchmiedmayer PSchmiedmayer left a comment

Choose a reason for hiding this comment

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

@MatthewTurk247 Thank you for the first PR for this feature!

I would suggest the following: Instead of doing this in every View it might be good if we can separate this in a small Observable class that is injected in the environment. We could even make it a Spezi Module. You can probably just use EnvironmentAccessible.
This module can then cache that information (and pull it right on the first login, it could even get the user ID from Firebase directly without using Spezi Account) and then have that injected in the View hierarch to access it from every view were we might need to make these changes.

Copy link

codecov bot commented Mar 27, 2024

Codecov Report

Attention: Patch coverage is 84.93151% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 58.60%. Comparing base (0859e0e) to head (d34951a).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #55      +/-   ##
==========================================
+ Coverage   54.97%   58.60%   +3.63%     
==========================================
  Files          37       39       +2     
  Lines        1370     1379       +9     
==========================================
+ Hits          753      808      +55     
+ Misses        617      571      -46     
Files Coverage Δ
PAWS/PAWSDelegate.swift 96.91% <100.00%> (+0.04%) ⬆️
PAWS/Study Information/EnrollmentGroup.swift 100.00% <100.00%> (ø)
PAWS/Contacts/Contacts.swift 97.15% <90.00%> (+30.86%) ⬆️
PAWS/Helper/Contact+PersonNameComponents.swift 64.29% <64.29%> (ø)

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0859e0e...d34951a. Read the comment docs.

@MatthewTurk247
Copy link
Collaborator Author

@PSchmiedmayer, do we need the additional code for Firebase, or will what I have already written suffice? Specifically, here is what we talked about earlier today:

  • Within configure method, query user and store as a user property in Firestore.
  • Is date of birth stored in there and study enrollment time?
  • If yes, calculate and store in studyType property.
  • Write sign-in snapshot listeners to observe changes to user document.
  • Consider getting the date of birth from Firestore directly.

So far, I used Task to get account.details?.dateOfBrith and then the rest is taken care of by looking at the time between then and Auth.auth().currentUser?.metadata.creationDate.

Copy link
Member

@PSchmiedmayer PSchmiedmayer left a comment

Choose a reason for hiding this comment

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

@MatthewTurk247 Thank you for the improvements and moving this to the SwiftUI environment! I had some initial comments, let me know if you have any follow-up questions! 🚀

PAWS/Study Information/EnrollmentGroup.swift Outdated Show resolved Hide resolved
PAWS/Study Information/EnrollmentGroup.swift Outdated Show resolved Hide resolved
PAWS/Study Information/EnrollmentGroup.swift Outdated Show resolved Hide resolved
Copy link
Member

@PSchmiedmayer PSchmiedmayer left a comment

Choose a reason for hiding this comment

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

Thank you for the further improvements @MatthewTurk247; I had a few follow-up comments and suggestions. Thank you for also working on the UI tests, will be great to see this in this PR 🚀

PAWS/Study Information/EnrollmentGroup.swift Show resolved Hide resolved
PAWS/Study Information/EnrollmentGroup.swift Outdated Show resolved Hide resolved
PAWS/Study Information/EnrollmentGroup.swift Outdated Show resolved Hide resolved
PAWS/Contacts/Contacts.swift Outdated Show resolved Hide resolved
MatthewTurk247 and others added 4 commits April 11, 2024 10:40
Co-authored-by: Paul Schmiedmayer <PSchmiedmayer@users.noreply.github.com>
Co-authored-by: Paul Schmiedmayer <PSchmiedmayer@users.noreply.github.com>
@MatthewTurk247
Copy link
Collaborator Author

For some reason, the automated UI test appears to be getting stuck loading on the screen for redeeming the invitation code. However, when I run the test locally, it works just fine. Still trying to figure out why.

Copy link
Member

@PSchmiedmayer PSchmiedmayer left a comment

Choose a reason for hiding this comment

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

Sounds good; let me know once you could identify the issue @MatthewTurk247.

In the meantime; here are a few smaller comments on the current state.

PAWS/Contacts/Contacts.swift Outdated Show resolved Hide resolved
PAWS/Study Information/EnrollmentGroup.swift Outdated Show resolved Hide resolved
PSchmiedmayer added a commit to StanfordBDHG/.github that referenced this pull request Apr 17, 2024
# Improve Automated Firebase Emulator Selection for Fastlane Builds


## ⚙️ Release Notes 
- Improve Automated Firebase Emulator Selection for Fastlane Builds
- Fixes an issue where cloud functions were not properly executed as
they required a fully configured Admin SDK including permissions of a
service account
(StanfordBDHG/PediatricAppleWatchStudy#55)


### Code of Conduct & Contributing Guidelines 

By submitting creating this pull request, you agree to follow our [Code
of
Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md):
- [x] I agree to follow the [Code of
Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md).
Copy link
Member

@PSchmiedmayer PSchmiedmayer left a comment

Choose a reason for hiding this comment

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

@MatthewTurk247 The PR looks great; last steps would be to sync up about the changes with @aydinzahedi and Scott to ensure that we have correct information in there and to see in what other parts of the app we might need to change the UI to incorporate the adult study.

Would be important to ensure that all other text parts are applicable to both studies.

functions/index.js Outdated Show resolved Hide resolved
PAWS/Study Information/EnrollmentGroup.swift Show resolved Hide resolved
PAWS/Study Information/EnrollmentGroup.swift Show resolved Hide resolved
PAWS/Contacts/Contacts.swift Show resolved Hide resolved
MatthewTurk247 and others added 4 commits April 17, 2024 12:55
Co-authored-by: Paul Schmiedmayer <PSchmiedmayer@users.noreply.github.com>
Co-authored-by: Paul Schmiedmayer <PSchmiedmayer@users.noreply.github.com>
@MatthewTurk247 MatthewTurk247 merged commit f21cfc9 into main Apr 26, 2024
8 checks passed
@MatthewTurk247 MatthewTurk247 deleted the contacts branch April 26, 2024 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants