fix(client): give useful error in solutionform#40225
fix(client): give useful error in solutionform#40225raisedadead merged 1 commit intofreeCodeCamp:mainfrom
Conversation
|
What about |
|
@nhcarrigan It would need to be shorter than it already is, not longer; I do not want it wrapping on smaller screens. |
|
Currently, this is at a point where I could see it being merged. All it would help with is warnings about invalid URLs, and I have set up the ground work I would expect for better error handling, and URL validation. EDIT: I need to handle the tests... |
|
I cannot seem to pass the Cypress test. Here is the failure: I am still busy trying to setup tests for GitPod, so cannot test this locally (laptop is struggling). Otherwise, I do not think I touched anything related in this PR, anyway. |
|
Hey @SKY020, there's one issue stemming from the change to |
The message is descriptive. I would add a dot to the end of the message for consistency 👍 |
|
Since only SolutionForm sets the DisplayError and only FormFields gets it and FormFields is the direct descendent of SolutionForm (SolutionForm > Form > FormFields), I think it would be better to have DisplayError as a state on SolutionForm and pass it down as props. We could use Context to avoid passing it down one component at a time. That way FormFields does not need to be a connected component and we can free up some space on the redux store. Additional suggestions: |
|
Considerations: Since we already have all the info we need for opening the completion modal in execute-challenge-saga, I cannot think of a good reason to have challenge-modal-epic, what do you think?
I am not fan of how we communicate validation information from FormFields --> Form --> SolutionForm --> Form (shows the error), but I see how it would help to keep form stateless. |
|
We are setting Since Also, what do you think of |
|
@ahmadabdolsaheb I have compromised on the name of the variable - now Also, I have passed it as an argument directly (bypassing the store). However, it is currently in the payload as |
|
Quick note (we don't have to fix it on this pr IIMHO) : unvalidated (localhost) submissions to the legacy cert section of the settings page would go through, and the hints would show up for all previous submissions. |
|
I have tested submitting front/backend projects with this pr and it works as expected. Other than the nit-picks mentioned above it is LGMT. |
For the most part, this looks like wanted behaviour. I think we do have an issue up which intends to add checks to submissions from the settings page. So, this would be resolved in that PR (perhaps, I can take a look). |
|
@ahmadabdolsaheb Thanks a tonne, for the suggestion about removing the |
8d9a4a4 to
4427439
Compare
raisedadead
left a comment
There was a problem hiding this comment.
Hi @ahmadabdolsaheb can you sanity check this again. I just rebased/squashed a lot of commits here.
If it looks good please merge.



Checklist:
Update index.md)masterbranch of freeCodeCamp.Closes #39729
This PR includes a bit of groundwork for better error handling, but would require a bit too much refactoring. So, I would prefer this to be a PR relating more to helping with the case where Campers try to pass the incorrect URLs.
QUESTION: Should I expand this to validate whether the camper has submitted the example URLs? It would remove the need to keep updating the first user-story tests for each project.