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

Refactor: link to db for stats page #51

Merged
merged 21 commits into from
Apr 7, 2022
Merged

Conversation

panadax
Copy link
Collaborator

@panadax panadax commented Mar 25, 2022

Here is a basic link to the database:

  1. I have created a database on Firebase, but only with some entities and attributes for the STATS page, please refer to here.
  2. All the added code is still stored stats_fragment.kt, which I think is not good, also, I need to know more about the code architecture of our app folders to decide.
  3. I know the code I wrote is messy, thank you for your patience in reviewing!
  4. Next step: change the opponent id to name (I am a little into trouble with this, but due to limited time, I temporarily set it aside); spinner(selector) function design; match details page linking with DB as well.

@panadax panadax linked an issue Mar 25, 2022 that may be closed by this pull request
@SilvioMueller SilvioMueller self-requested a review March 28, 2022 21:09
@@ -12,6 +13,6 @@ open class FirebaseReferences(val env: Env = Env.PROD) {
fun usersFriendRequestOfUid(uid: String): CollectionReference =
usersCollection.document(uid).collection("friend_requests")

val usersCollection = root.collection("users")
val usersCollection = FirebaseFirestore.getInstance().collection("users")
Copy link
Collaborator

Choose a reason for hiding this comment

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

You should not hardcode it like that when we have a root collection. Hardcoding it like that makes it impossible to test with an ENV different than production.

Copy link
Collaborator

@leonardopennino leonardopennino left a comment

Choose a reason for hiding this comment

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

Almost good, resolve the issues I highlighted in your files and I'll approve it

@panadax panadax changed the title link to db for stats page Refactor: link to db for stats page Apr 4, 2022
@panadax panadax self-assigned this Apr 5, 2022
@panadax
Copy link
Collaborator Author

panadax commented Apr 6, 2022

For this sprint, I have refactored the function in FirebaseHelper, which should be compatible with Game and Round Class and Database. Please have a quick check :) Thank you.

@panadax panadax added the Waiting for review This PR is waiting for review. label Apr 6, 2022
@panadax
Copy link
Collaborator Author

panadax commented Apr 6, 2022

Main issue checkpoint:

  1. The logic in FirebaseHelper.kt
  2. Should I use "viewLifecycleOwner.lifecycleScope.launch {}" to call the function in FirebaseHelper?

If the logic is correct and the code fulfilled the requirements, I will try to write the test :) I really appreciate your time to review my code!

Copy link
Collaborator

@gaetschwartz gaetschwartz left a comment

Choose a reason for hiding this comment

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

Except these few issues, LGTM.

@gaetschwartz gaetschwartz merged commit 50c0195 into main Apr 7, 2022
@gaetschwartz gaetschwartz deleted the feat/stats_firebase branch April 7, 2022 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Waiting for review This PR is waiting for review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make database for STATS module and link it to app
3 participants