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

Fix user image show on dashboard/* routes #918

Merged

Conversation

saadman-galib
Copy link
Contributor

@saadman-galib saadman-galib commented May 18, 2024

Pull Request Details

Description

The problem was with firebase createUserWithEmailandPassword. When a user was signing up using email and password. There wasn't setting any photourl. Thats why after login in /dashboard/* routes, for google auth users. it was showing the image because it is already set but for users signed up with email and password. It wasn't showing the user image as expected

Fixes

fixes #907

Type of PR

  • Bug fix
  • Feature enhancement
  • Documentation update
  • Refactoring
  • Other (specify): _______________

Summary

  • Added photoUrl to firebase after creating user with email and pass

Screenshots (if applicable)

image

Additional Notes

[Include any additional information or context that might be helpful for reviewers.]

Checklist

  • I have read and followed the Pull Requests and Issues guidelines.
  • The code has been properly linted and formatted using npm run lint:fix and npm run format:fix.
  • I have tested the changes thoroughly before submitting this pull request.
  • I have provided relevant issue numbers, snapshots, and videos after making the changes.
  • I have not borrowed code without disclosing it, if applicable.
  • This pull request is not a Work In Progress (WIP), and only completed and tested changes are included.
  • I have tested these changes locally.
  • My code follows the project's style guidelines.
  • I have updated the documentation accordingly.
  • This PR has a corresponding issue in the issue tracker.

Summary by CodeRabbit

  • New Features
    • Enhanced user profile update functionality to include updating the profile photo URL.

Copy link

netlify bot commented May 18, 2024

👷 Deploy request for v2-digitomize pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit b5c1549

Copy link

netlify bot commented May 18, 2024

👷 Deploy request for digitomize pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit b5c1549

Copy link
Contributor

coderabbitai bot commented May 18, 2024

Walkthrough

The UserAuthContextProvider function in the UserAuthContext.jsx file has been updated to include the photoURL parameter in the updateProfile function call. This change ensures that the user's profile picture URL is properly handled during profile updates.

Changes

File Change Summary
client/src/context/UserAuthContext.jsx Modified UserAuthContextProvider to update photoURL in updateProfile

In fields of code, where changes grow,
A photo URL now does show.
With profiles bright and faces clear,
The users smile from ear to ear.
🌸✨👩‍💻👨‍💻✨🌸


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 5130365 and b5c1549.
Files selected for processing (1)
  • client/src/context/UserAuthContext.jsx (1 hunks)
Additional comments not posted (1)
client/src/context/UserAuthContext.jsx (1)

31-31: Ensure the default photoURL is appropriate for all users.

While the hardcoded URL ensures that all users have a profile image, consider if this generic image is suitable for all contexts. It might be better to allow users to set their own image or provide a more neutral placeholder.

@pranshugupta54
Copy link
Member

I think we should handle this on the backend, we do have some default image being added on the backend for null images. This part should be fixed there itself

@saadman-galib
Copy link
Contributor Author

saadman-galib commented May 20, 2024

I think we should handle this on the backend, we do have some default image being added on the backend for null images. This part should be fixed there itself

In backend, Have you handled it for MongoDB or firebase also?

@pranshugupta54
Copy link
Member

You gotta check it, I think we've done it for mongodb only - can implement for firebase their itself

@saadman-galib
Copy link
Contributor Author

saadman-galib commented May 20, 2024

@pranshugupta54
The problem is occurring for firebase. after signup using email and password. on MongoDB the image is updated.
image
image
Should I update the firebase photoUrl from server side or from client side. For client side right after create user with email and password, the display name in firebase is updated.
image
The photoUrl can be updated in client side. right after creating user with email and password for only creating user with email and pass

@pranshugupta54
Copy link
Member

Actually doing it on frontend is gonna be fine too. Please make sure to check if it works for other cases too - than - emailPass. Maybe when google/github auth doesn't send a picture?

@pranshugupta54 pranshugupta54 merged commit 865d345 into digitomize:main May 22, 2024
11 of 17 checks passed
@pranshugupta54
Copy link
Member

@holopin-bot @saadman-galib c-st

Copy link

holopin-bot bot commented May 22, 2024

Congratulations @saadman-galib, you just earned a holobyte! Here it is: https://holopin.io/holobyte/clwifvu1a19330cl48afdxgxq

This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account.
Or if you're new to Holopin, you can simply sign up with GitHub, which will do the trick!

@saadman-galib saadman-galib deleted the bug/user-image-show-dashboard branch May 23, 2024 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: User Image is not showing on dashboard/ratings page
2 participants