-
Notifications
You must be signed in to change notification settings - Fork 169
validation added to NumericalInput to just accept numerical values on block creation form #2615
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
Open
jesusbalderramawgu
wants to merge
8
commits into
openedx:master
Choose a base branch
from
WGU-Open-edX:OEXCOM-245/AUTH-BLOCK-FORM-VALIDATION
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
740a7b8
feat(form): add validation to NumericalInput to accept only numeric v…
jesusbalderramawgu d669d7e
style(format): fix spaces and update message to camelCase
jesusbalderramawgu 14d2c72
fix(content): update text for clarity
jesusbalderramawgu c24cb0d
feat(validation): validation added to numeric input with new endpoint…
jesusbalderramawgu 49ac070
fix(content): change in input validation to use react query instead o…
jesusbalderramawgu 0b72cd9
fix(content): change in types to avoid ci errors
jesusbalderramawgu 9b57066
fix(content): remove unnecessary code after changing to react query
jesusbalderramawgu f9ce381
fix(content): change numeric input validation path to new url and loa…
jesusbalderramawgu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i remember here in authoring in some places they are now using react-query, if its a complete new implementation/endpoint/etc, maybe will be best to use react query from start to avoid the re-work when we move from redux to react-query 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for your comment, I did it this way because this page is really linked to redux and didn't wanna make a mix.
should I change this then to react-query?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not an expert here, but I think it could get complex to have a mix of Redux and RQ on the same page, so my inclination is to stay consistent and use Redux when we're just making small additions to existing things. Do you agree @diana-villalvazo-wgu or do you think it'd be better to put his part in RQ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It really depends on the separation of concerns. If this numeric input validation is a fairly isolated piece of code that checks some input value via an API and then displays a message, it's probably pretty easy to implement using React Query and mix-and-match is with redux. But if there are interactions between this validation state and other parts of the existing redux state, then it's probably more trouble than it's worth. Either way is fine with me.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 Same as Braden, i suggested it because i saw that it wasn't really interacting with other things, was a new endpoint call and just appended the result, and just to avoid future re-work, but if it causes any trouble im ok with it too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks everyone for your comments. I've updated the PR to use react query instead of redux given that this validation is isolated.
I've made a file called "apiHooks.ts" inside ProblemEditors/Data folder given that the ProblemEditor wasn't using react query and to follow the same nomenclature as the other folders with react query.
the only thing that is left is the change in the API with Kyle's suggestion. I'll check that tomorrow.
thanks for your feedback
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jesusbalderramawgu I realized that my validation endpoint suggestion is flawed because it requires that a ProblemBlock be saved :)
I like your approach. I have some thoughts on the details--I'll leave a review tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
regarding the new endpoint, I've left a review on: openedx/edx-platform#37677