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

Show profile image for logged in user #111

Merged
merged 1 commit into from
Nov 11, 2018

Conversation

muhammad-ammar
Copy link
Contributor

@muhammad-ammar
Copy link
Contributor Author

@adamstankiewicz @georgebabey This is a new PR. Initial review was completed at #106. Needs your final review.

Copy link
Contributor

@georgebabey georgebabey left a comment

Choose a reason for hiding this comment

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

This looks great - just one small fix in the header propTypes/defaultProps

@@ -50,12 +66,18 @@ Header.propTypes = {
enterpriseLogo: PropTypes.string,
enterpriseName: PropTypes.string,
email: PropTypes.string,
username: PropTypes.string,
fetchUserProfile: () => {},
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like propTypes and defaultProps are reversed for fetchUserProfile

Copy link
Member

@adamstankiewicz adamstankiewicz left a comment

Choose a reason for hiding this comment

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

Looks good! Just one comment from me as well regarding one of the tests for the profile image.

profile: {
profile_image: {
has_image: true,
image_url_medium: 'https://raw.githubusercontent.com/edx/edx-portal/master/src/images/edx-logo.png',
Copy link
Member

Choose a reason for hiding this comment

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

We should import this image instead of using the url from Github. Don't know if I trust a https://raw.githubusercontent.com link will always stick around.

Related, the test name could just say "renders profile image correctly" as we don't really care if it's an external image or not here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't mention it as its a) in a test and b) I don't think it will actually fetch the image, would just render the snapshot with a reference to it so if it was no longer there the test would pass. But it might not hurt to make it obvious its a dummy url like https://path-to-profile-image

Copy link
Member

Choose a reason for hiding this comment

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

That's true it wouldn't actually be fetching the image in the snapshot, in which case a dummy URL would work.

But, if we decide to eventually use visual regression testing/diffing, it would be fetched so we might as well import and use the actual edx-logo.png image here.

@muhammad-ammar
Copy link
Contributor Author

@adamstankiewicz @georgebabey Addressed the feedback. Please continue the review.

@muhammad-ammar muhammad-ammar merged commit 4e3299a into master Nov 11, 2018
@muhammad-ammar muhammad-ammar deleted the ammar/ENT-1104-profile-image branch November 11, 2018 02:25
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