Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Added database querying #106

Merged
merged 4 commits into from
Mar 24, 2022
Merged

Conversation

laurislopata
Copy link
Collaborator

No description provided.

@codeclimate
Copy link

codeclimate bot commented Mar 24, 2022

Code Climate has analyzed commit 5e8b60a and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 90.4% (80% is the threshold).

This pull request will bring the total coverage in the repository to 94.3% (-0.4% change).

View more on Code Climate.

@laurislopata laurislopata marked this pull request as ready for review March 24, 2022 22:16
@laurislopata
Copy link
Collaborator Author

laurislopata commented Mar 24, 2022

I spent a lot of time looking into how the FireBase works and tried to make it work but for some reason it could not automatically convert the values to the UserProfile class that's why I had to do some "hacking" which doesn't look good and I will review it again over the weekend. Also the structure of our classes is not very good for quering databases as they are asynchronous (good explanation: https://stackoverflow.com/questions/47847694/how-to-return-datasnapshot-value-as-a-result-of-a-method/47853774), that's why for now I commented out unnecessary parts and fully refactor it next week.

Copy link
Collaborator

@Tsathogguaa Tsathogguaa left a comment

Choose a reason for hiding this comment

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

Good code! Would be amazing if you could refactor the commented parts next week.

* @param requestCode a request code
* @param resultCode a result code
* @param data intent returned from google sign in
*/
fun googleActivityResult(requestCode: Int, resultCode: Int, data: Intent?): String? {
return if(requestCode == 1000) {
val task = GoogleSignIn.getSignedInAccountFromIntent(data)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good documentation on this file.

// }
//
//}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe delete this file instead of commenting it if it won't be used anymore, unless the functions in it will be replaced by some other functions?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just in case, I left it here for now since I'll be doing the refactoring of our class structure for DB queries next week but I'll take note of your proposal :)

* @param id id of the dialog
* @param textId id of the text in the dialog
*/

Copy link
Collaborator

@zwierski zwierski Mar 24, 2022

Choose a reason for hiding this comment

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

Careful in the Javadoc, title and hint are not parameters of the function. Does textId correspond to the "name" parameter?

Copy link
Collaborator

@zwierski zwierski left a comment

Choose a reason for hiding this comment

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

Good code, some minor modifications in the Javadoc would be good, and maybe refactor the code related to ProfileDataProvider instead of commenting it if it's unused.

@laurislopata
Copy link
Collaborator Author

Advices noted!

@laurislopata laurislopata merged commit 83265b7 into main Mar 24, 2022
@laurislopata laurislopata deleted the laurislopata/saving-data-in-Firebase branch March 24, 2022 22:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants