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
Use AlertsList React component in /alerts_list (try #2) #3481
Use AlertsList React component in /alerts_list (try #2) #3481
Conversation
6874941
to
85ba860
Compare
fix for WikiEducationFoundation#1803 * Refactors AlertsList component into seperate CampaignAlerts and AdminAlerts components with shared functionality * Allows for asynchronous 'resolving' for AdminAlerts * Campaign alerts functionality not changed * Sort options determined from available alerts to sort
85ba860
to
b09049a
Compare
Any thoughts/concerns/changes needed here? |
Apologies for our slow response on this @chrisnorwood, and that you've had to solve merge request issues consistently. On the whole, this looks great. It is a much better flow for admin. My only suggestion would be to change the |
No worries, @bwreid . Yes, I can absolutely do that for both CampaignAlerts and AdminAlerts actually. The couple merge conflicts here I resolved with the Github GUI, because on my last PR I tried to do it locally, but ended up muddying up the PR with dozens of other people's commits (if that makes sense?). If I |
Hey @chrisnorwood . Sorry about the git troubles! Instead of merging, you could likely rebase. If you want to fix the changes locally, I think the easiest thing to do would be to likely delete your local branch (assuming you have no new commits on there) and then just re-pull this branch. |
Excellent suggestion, thanks for the insight. I'll hop on that this evening and force push the new changes with the ES6 classes! |
4c69947
to
145b5c8
Compare
Thanks for the tips @bwreid, that worked great. |
@ragesoss Any additional comments you have on this? |
No problems jump out in the code. I'm planning to try it out locally today as a final check. |
LGTM! |
What this PR does
fix for #1803
Screenshots
Before:
After:
Open questions and concerns
Note 1: CampaignAlerts and AdminAlerts both still using
UNSAFE_componentWillMount
instead ofcomponentDidMount
. I attempted the switch, and I found out the MultiSelectField component would break when given its default values from a Redux state that was dispatched in "DidMount" instead of a "WillMount". As numerous other components rely on MultiSelectField, I think this is better solved in another issue/PR.Note 2: @ragesoss : You suggested earlier today that the admin view could use the AlertType names instead of the "friendly" versions. In this PR, both campaign and admin alert lists use the friendly name, as computed in the
transformAlertsIntoOptions
helper function defined in AlertsHandler. I found it easier to have them both work the same. If you strongly prefer that to be different, let me know.