Skip to content

feat: validate portfolio image correctly - #57084

Merged
ojeytonwilliams merged 6 commits into
freeCodeCamp:mainfrom
Sembauke:feat/validate-portfolio-image
Nov 19, 2024
Merged

ojeytonwilliams merged 6 commits into
freeCodeCamp:mainfrom
Sembauke:feat/validate-portfolio-image

Conversation

@Sembauke

@Sembauke Sembauke commented Nov 7, 2024 •

Copy link
Copy Markdown
Member

Checklist:

Closes #49132

@Sembauke
Sembauke requested a review from a team November 7, 2024 15:19
@github-actions github-actions Bot added the platform: learn UI side of the client application that needs familiarity with React, Gatsby etc. label Nov 7, 2024
@Sembauke
Sembauke marked this pull request as draft November 7, 2024 15:21
@github-actions github-actions Bot added the scope: tools/scripts Scripts for supporting dev work, generating config and build artifacts, etc. label Nov 8, 2024
@Sembauke
Sembauke marked this pull request as ready for review November 8, 2024 09:17

@ojeytonwilliams ojeytonwilliams left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This works well, but it shares a lot of code with the about page. Neither are entirely what we want, though - they're both rather verbose, when all we want is to make a query and see if it succeeds.

I do like the use of Promises, though, that makes life a lot easier. For instance, it lets us integrate with, say, React query, meaning we don't have to mess around with callbacks or effects.

Here's what I recommend (either in this PR or separately, doesn't matter, actually it's kinda complex so another PR would be good):

  1. convert these components to functions
  2. move the image validation logic into its own module
  3. use a data fetching library (the react docs have recommendations) to handle image validation requests.

@Sembauke

Sembauke commented Nov 12, 2024 •

Copy link
Copy Markdown
Member Author

I really don't feel like any abstraction is necessary right now. I am planning on changing these components to functional components anyway, Could we keep this for a future pr?

@ojeytonwilliams

Copy link
Copy Markdown
Contributor

I really don't feel like any abstraction is necessary right now. I am planning on changing these components to functional components anyway, Could we keep this for a future pr?

Yep, absolutely.

@moT01 moT01 added the status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. label Nov 19, 2024

@ojeytonwilliams ojeytonwilliams left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👍

@ojeytonwilliams
ojeytonwilliams merged commit ef25dfe into freeCodeCamp:main Nov 19, 2024
@Sembauke
Sembauke deleted the feat/validate-portfolio-image branch November 19, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform: learn UI side of the client application that needs familiarity with React, Gatsby etc. scope: tools/scripts Scripts for supporting dev work, generating config and build artifacts, etc. status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Weird validation for portfolio inputs in the setting page

4 participants