-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
List users and patients #14
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14 +/- ##
==========================================
- Coverage 61.47% 55.87% -5.60%
==========================================
Files 73 99 +26
Lines 558 938 +380
Branches 90 169 +79
==========================================
+ Hits 343 524 +181
- Misses 204 390 +186
- Partials 11 24 +13
Continue to review full report in Codecov by Sentry.
|
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.
Thank you for working on these features @arkadiuszbachorski!
I had a very quick first look!
It would be great to get the new components into the storyboard to inspect more closely but everything already looks cool on the video you shared on Slack!
I have also tried to run the current setup locally but unfortunately get the following error once logging in:
Could be that this is an issue with the backend authentication, I at least used a user with admin permission according to the Firebase datastore. Let me know what setup you use at the moment to render the components and to inspect the setup.
We should setup a Firebase-Emulator enabled testing environment to make sure that we can easily test the mobile apps & web dashboard in a reproducible manner. CC @pauljohanneskraft.
package.json
Outdated
"@tanstack/react-table": "^8.19.2", | ||
"firebase": "^10.12.2", | ||
"firebase-admin": "^12.2.0", |
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.
TODO to ensure that we remove the admin SDK before we merge the PR; we should ensure that we don't use the admin SDK in the client-facing web dashboard.
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.
firebase-admin
is used for retrieving user's auth data. We can't get it through Firestore. For example, to retrieve patients data, we need to combine data from user's auth and user
collection.
User can access other users data only if authenticated, for their respective roles and firebase-admin
is executed on the server only. I agree it probably would be better if it was separate Firebase function, but that shouldn't be blocking for now.
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.
@pauljohanneskraft Would it make sense & doable to extract that functionality in a cloud function so we can avoid that work in the frontend codebase & ensure that we don't need to embed admin SDK keys?
On a general level: I think we should generally use the firebase queries using the client SDK when possible to ensure that we build on top of the Security Rules but in some edge cases we should selectively use cloud functions if needed.
Everything will have their Storybooks, WIP!
This was caused by wrong permission rules, the thing I raised on Slack. I just rollbacked to previous rules, it should work correctly now.
Agree, now I am just using live Firebase data. |
134e034
to
863971a
Compare
Thank you for continuing to improve this @arkadiuszbachorski! Sounds good; let's sync up with @pauljohanneskraft so we can combine this with the firebase setup to have a nice emulator testing environment. |
@PSchmiedmayer I updated this PR with:
There is drop in coverage, because I didn't cover users and patients listing flow. It will be a separate E2E effort. Functions types are copied from Firebase repository temporarily, it will be a shared package in the future |
116fe7e
to
024e9f2
Compare
81e7452
to
ac66690
Compare
List users and patients
♻️ Current situation & Problem
Users and patients need to be listed.
⚙️ Release Notes
✅ Testing
Patients and users views will be covered with E2E tests later, hence drop in code coverage
Code of Conduct & Contributing Guidelines
By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: