You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Weird validation for portfolio inputs in the setting page #49132
help wantedOpen for all. You do not need permission to work on these.platform: learnUI side of the client application that needs familiarity with React, Gatsby etc.
I do not see a bug here. The validation does what majority of the WWW uses when validating such an input - is the input a valid URL - does it match the URL spec. We already go a bit overboard with the validation, as I would have simply used the isURL validator, and left the rest.
If the goal here is to let people know that the URL they put in the Picture input does/does not link to an image then we need to make sure everyone has access to this information. Showing a small preview of the image is fine, but that only helps people who can see the image. So we will need to make sure we include text that gives the same information (it can be sr-only text).
However, since we correctly validate the Picture field in the Personal Information section, I propose we reuse that logic for the Image field of the portfolio item. That way, the a11y concerns @bbsmooth raised should be taken care of.
Hello @Sboonny
The basic aim of this issue is to preview the image to user before uploading it in the portfolio section
I am interested to work upon this issue
So it would be nice if you will let me know whether I am following right path or not in understanding the issue
Thank You!
Yes you are following the right path, if you would like to fix this issue, please make sure you read our guidelines for contributing, we prioritize contributors following the instructions in our guides. Join us in our discord or the forum if you need help contributing, our prolific contributors will guide you through this.
Hello @Sboonny
So I was working on this issue and as mentioned on uploading the image url we wanted to display the preview of image right?
So I have accordingly made changes in my code and its previewing the image after validating the url
So is there anything else required to be done in this issue or should I improve the preview css?
Hello @Sboonny
I have made the changes in code and you can see the result while adding image url in the portfolio section|
So could you please see that and also suggest the required changes
Meanwhile my tests are getting failed in the pull request, so meanwhile I am trying to solve those
Is the solution to show a preview of the image added? Or, to just follow the same logic we use in the "Personal Information" section to validate the URL?
help wantedOpen for all. You do not need permission to work on these.platform: learnUI side of the client application that needs familiarity with React, Gatsby etc.
Activity
ShaunSHamilton commentedon Jan 25, 2023
I do not see a bug here. The validation does what majority of the WWW uses when validating such an input - is the input a valid URL - does it match the URL spec. We already go a bit overboard with the validation, as I would have simply used the isURL validator, and left the rest.
The URL validation is done here:
freeCodeCamp/client/src/components/settings/portfolio.tsx
Lines 184 to 202 in 8d8a4d1
We have had similar to what you are proposing ideas before: #40050
BalanaguYashwanth commentedon Feb 9, 2023
Hey @Sboonny ,
Can you close this ticket because i am not able to reproduce this issue, refer image. Developers can save time by looking into other issues
BalanaguYashwanth commentedon Feb 9, 2023
Hello @Sboonny,
Is this issue still active ?
From above image i can see issue is solved, let me know any updates ?
Reference - #49132 (comment)
Sboonny commentedon Feb 9, 2023
Your image indicate the existence of the issue, as campers couldn't know that the link they just copied into their image, isn't a valid image.
BalanaguYashwanth commentedon Feb 9, 2023
ok
Nirajn2311 commentedon Mar 1, 2023
We need to show a small preview of the image the user enters so that they know if the link will actually display the image or not.
Sboonny commentedon Mar 1, 2023
bbsmooth commentedon Mar 1, 2023
If the goal here is to let people know that the URL they put in the Picture input does/does not link to an image then we need to make sure everyone has access to this information. Showing a small preview of the image is fine, but that only helps people who can see the image. So we will need to make sure we include text that gives the same information (it can be sr-only text).
ojeytonwilliams commentedon Mar 2, 2023
To clarify slightly, because I was confused:
This issue is about the Portfolio Settings part of https://www.freecodecamp.org/settings, specifically adding and updating new portfolio items. It is not about the Personal Information section.
However, since we correctly validate the Picture field in the Personal Information section, I propose we reuse that logic for the Image field of the portfolio item. That way, the a11y concerns @bbsmooth raised should be taken care of.
Sboonny commentedon Mar 20, 2023
I found a weird bug while trying to create styles for cards without
image.Campers can bypass validation entirely through following this:
If you have an empty portfolio item, and edit an existing one, you can have and empty portfolio item in your profile.
rec-tab.25.webm
Here is a live URL with empty portfolio item https://www.freecodecamp.org/Sboonny
Anujvaid45 commentedon Apr 15, 2023
Hello @Sboonny
The basic aim of this issue is to preview the image to user before uploading it in the portfolio section
I am interested to work upon this issue
So it would be nice if you will let me know whether I am following right path or not in understanding the issue
Thank You!
Sboonny commentedon Apr 17, 2023
Welcome, @Anujvaid45.
Yes you are following the right path, if you would like to fix this issue, please make sure you read our guidelines for contributing, we prioritize contributors following the instructions in our guides. Join us in our discord or the forum if you need help contributing, our prolific contributors will guide you through this.
Anujvaid45 commentedon Apr 18, 2023
Hello @Sboonny
So I was working on this issue and as mentioned on uploading the image url we wanted to display the preview of image right?
So I have accordingly made changes in my code and its previewing the image after validating the url
So is there anything else required to be done in this issue or should I improve the preview css?
Sboonny commentedon Apr 18, 2023
When I see the changes in a PR, I can give if there is something missing or if it needs an additional changes.
Anujvaid45 commentedon Apr 18, 2023
Hello @Sboonny
I have made the changes in code and you can see the result while adding image url in the portfolio section|
So could you please see that and also suggest the required changes
Meanwhile my tests are getting failed in the pull request, so meanwhile I am trying to solve those
ShaunSHamilton commentedon Apr 11, 2024
@ojeytonwilliams and @Nirajn2311 I am just wanting clarification:
Is the solution to show a preview of the image added? Or, to just follow the same logic we use in the "Personal Information" section to validate the URL?
ojeytonwilliams commentedon Apr 11, 2024
That should be enough.
Sembauke commentedon Oct 29, 2024
The Portfolio already seems to have image validation, are we talking about checking if the source directly links to an image by fetching the URL?
ojeytonwilliams commentedon Nov 4, 2024
Yep, same as in settings.