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

TP_UI - Issues 137 & 148 - Adds image upload component to Profile Page #153

Merged
merged 7 commits into from
Jun 6, 2022

Conversation

wijohnst
Copy link
Owner

@wijohnst wijohnst commented May 21, 2022

FP_UI - #137 - Add Upload Component to Profile Page

FP_UI - #138 - Adds PhotoUpload story to ProfileHeader component

TL/DR
This PR adds an Upload input to the Profile Page when a user clicks the edit profile picture icon. This input will only accept image files. Currently this upload will only print a confirmation message to the console when an image is selected. Uploading the image to AWS S3 will be implemented at a later date when it is unblocked on the backend.

This PR also adds additional controls to the Profile Page. These include:

  • User can cancel photo upload
  • User can cancel edit profile action

issues_137_148
Screen capture, additional cancel action clicks

Overview of Changes
ProfilePage.tsx

  • Adds top-level state for conditional rendering in child component
  • Adds conditional check that data exists before rendering
  • Adds onCancelEdit and onCancelPhotoUploadClick event handlers

Upload.tsx

  • Adds testId prop for custom test ids

ProfilePageRender.tsx

  • Adds isPhotoUpload prop
  • Conditionally renders input when isPhotoUpload is true
  • Adds onCancelEditClick and onCancelPhotoUploadClick props

ProfilePageRender.stories.tsx

  • Adds UploadPhoto story

ProfilePageRender.test.tsx

  • Adds associated tests

CTALink.tsx

  • Adds hideUnderline prop

CTALink.style.ts

  • Adds conditional styling for hiding underline

CTALink.stories.tsx

  • Adds HideUnderline story

ProfileHeader.tsx

  • Adds photoUpload prop
  • Conditionally render icon based on isPhotoUpload prop

ProfileHeader.stories.tsx

  • Adds PhotoUpload story

Edit.tsx

  • Adds CTA Link

Edit.style.tsx

  • Updates styling

@wijohnst
Copy link
Owner Author

Closes #137

@wijohnst wijohnst self-assigned this May 21, 2022
@wijohnst wijohnst requested review from Jessicawyt and willcary May 21, 2022 17:26
@wijohnst wijohnst added enhancement New feature or request storybook 📚 labels May 21, 2022
@wijohnst wijohnst added this to the V1.0 - Beta milestone May 21, 2022
@wijohnst
Copy link
Owner Author

Closes #87

@wijohnst
Copy link
Owner Author

Closes #153

Copy link
Owner Author

@wijohnst wijohnst left a comment

Choose a reason for hiding this comment

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

Left a test comment.

src/stories/Inputs/Upload/Upload.tsx Show resolved Hide resolved
Copy link
Collaborator

@Jessicawyt Jessicawyt 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.

@wijohnst wijohnst requested a review from Jessicawyt May 22, 2022 14:16
@wijohnst wijohnst changed the title TP_UI - Issue 137 - Adds image upload component to Profile Page TP_UI - Issues 137 & 148 - Adds image upload component to Profile Page May 22, 2022
Copy link
Owner Author

@wijohnst wijohnst left a comment

Choose a reason for hiding this comment

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

Self Review

Copy link
Collaborator

@willcary willcary left a comment

Choose a reason for hiding this comment

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

One question and one small comment:

  • How were you viewing the edit profile page for the screen capture provided? I couldn't find a way to view it like that other than altering the conditional in ProfilePage.tsx. Storybook seems to provide the aesthetics but not the functionality.
  • Nit: the 'cancel' CTALink below the submit button might look better with some space between it and the EditProfileForm component. Feel free to disregard if that is the preferred look you're going for.

@wijohnst
Copy link
Owner Author

wijohnst commented Jun 1, 2022

@willcary

Great question. I can view the edit profile page because I am also running the backend locally. This is actually one of the big problems that we still need to address (with Docker containers?). Basically, how can we securely share the backend in an open source project? The BE code requires a local env file that has a lot of passwords / sensitive data and I'm wary of sharing it outright. Perhaps with Docker we could make things more secure and easier to spin up locally for contributors.

@willcary
Copy link
Collaborator

willcary commented Jun 1, 2022

@wijohnst

Ahh I see. Definitely better to keep that local or figure out a secure way to handle it. I've never used Docker but I know its very popular these days. Worth looking into.

@wijohnst wijohnst merged commit 7871e2a into main Jun 6, 2022
@wijohnst wijohnst deleted the issue-137-adds-upload-component branch June 6, 2022 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request storybook 📚
Development

Successfully merging this pull request may close these issues.

4 participants