-
Notifications
You must be signed in to change notification settings - Fork 176
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
Fixes #7021 - Refactoring Edit Events React code #7025
Conversation
…der with new React code
…ubeassociation.org into 7021-refactor-edit-events
Hey @coder13, I was just passing by to see how painful it was to migrate that old code, and I noticed you had to create some "results" input (for times, points, etc...). I don't know if it will integrate well in the "edit event" modals and stuff, but I'd figure it's a quick thing to try to re-use some components. |
I was thinking this might be good for a follow-up PR. @gregorbg said to copy it exactly as it was so that was my main focus but I agree to reuse code and especcially this attemptResultField input. It might integrate well. |
My intention behind the "copy as it is" instruction was to limit the scope of this PR, so that you can get a clear sense of what you have to do. I didn't want to give you the feeling that you'd have to reinvent the wheel as your first task. |
Gotcha, I'll keep this in mind. |
I've updated the cutoff and advancement conditions to both accept just points for multi, just like the qualification result already did.
The largest value you can type in now is 99. I think this is ready for a full review now. There will probably be some failing tests which I'll need help with since I still seem to get different results when testing locally. |
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.
Magnificent refactor, and a great culmination of the joint effort between you and Cailyn! Frankly, I didn't have the opportunity to look through every single JS file. Overall, one theme I noticed were inconsistencies with
- inline-CSS vs. separate CSS files via selectors
- naming conventions:
.round-row__scramble-set-count
uses double-underscore and snake-case (or rather, dash-case) whereas.round-row_advancementCondition
in the same file uses one underscore and camelCase
I didn't bother marking every single one of those occurences, but is there a reasoning behind this choice?
Other than that, I am generally fine with this PR once we test it on staging and automated CI tests pass.
WcaOnRails/app/webpacker/components/EditEvents/EventPanel/RoundRow.js
Outdated
Show resolved
Hide resolved
WcaOnRails/app/webpacker/components/EditEvents/EventPanel/RoundRow.js
Outdated
Show resolved
Hide resolved
WcaOnRails/app/webpacker/components/EditEvents/EventPanel/RoundsTable.js
Outdated
Show resolved
Hide resolved
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.
Magnificent refactor, and a great culmination of the joint effort between you and Cailyn! Frankly, I didn't have the opportunity to look through every single JS file. Overall, one theme I noticed were inconsistencies with
- inline-CSS vs. separate CSS files via selectors
- naming conventions:
.round-row__scramble-set-count
uses double-underscore and snake-case (or rather, dash-case) whereas.round-row_advancementCondition
in the same file uses one underscore and camelCase
I didn't bother marking every single one of those occurences, but is there a reasoning behind this choice?
Other than that, I am generally fine with this PR once we test it on staging and automated CI tests pass.
@gregorbg I've addressed a couple of your comments, but most of them are parts that @coder13 wrote and I didn't touch at all, and I don't know the answer to. If those questions get answered/decided then I can make the necessary changes. As I've mentioned, I'll probably need some help with the failing tests. When would be a good time to test on staging? (Presumably after the above comments are sorted out.) |
I believe I've addressed all the specific comments. Unfortunately there's a bug with shared cumulative time limits. The same bug that we had on the previous (well, current) edit events page, which I fixed over a year ago :( So I'll have to deal with that. |
Fixed. |
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.
LGTM - have looked through test cases and QA'd on staging. Will merge and deploy on Monday (no deployments on Friday :P )
Wanted to create this draft PR to get started.
My first mission was to start cleaning up the code.
My next will be to start migrating these class components to functional components. This will, for most of them, completely redo their logic and how they pass around data, but it does it in a strategic way where react knows what has updated and will make the
rootRender
call redundant. I also want to make sure we're maximizing code-reuse to potential reuse some of these components in other parts of the website where relevant.Checklist
Figure out autofocus again as well as keyboard navigation