-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Sharing: Refactor sharing buttons to use Redux instead of Flux Stores #10278
Conversation
c2dd34c
to
98cc4b1
Compare
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.
This is testing out well for me on both JP and wpcom sites. I was unable to trigger the IP address notif - I tried malformed IP addresses but it always said "Settings Saved" and indeed upon a hard refresh the settings were still shown
site: site, | ||
buttons: sharingButtonsList, | ||
postTypes: postTypesList | ||
site: site |
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.
Why are we still passing in site
and not getting it from the state tree?
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.
One nice to have enhancement (that could be done in another PR) is to avoid using the site Prop. This would require refactoring the underlying components.
Nevermind :)
let text; | ||
switch ( nextProps.saveRequestError.error ) { | ||
case 'invalid_ip': | ||
text = nextProps.translate( 'One of your IP Addresses was invalid. Please try again.' ); |
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.
By chance do you know how to trigger this error so we can test it out?
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 don't really know, I searched and found the error key on the API side but I'm not sure how to reproduce.
This is error was here in the first place, that's why I did not touch it, but maybe worth removing since I don't think the user wants to know about this. We could even drop the "error" and the corresponding selector from the redux state. What do you think?
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.
grok'ed it - and it looks like invalid_ip
error code is part of the domains/DNS logic - I'll try to test out in that area.
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 can't seem to trigger this error in the DNS manager. There is some inline validation that requires xxx.xxx.xxx.xxx format, entering in a bogus IP seems to persist like 255.255.255.0 - anyhow, thinking it is fine to leave as-is
After resolving merge conflict this should be good to merge |
98cc4b1
to
dd6053b
Compare
dd6053b
to
0ac330a
Compare
In this PR I'm refactoring the Sharing Buttons Component to use Redux Actions instead of Flux Stores. This PR includes:
notices
middleware for SiteSettings notices, this would have the effect of triggering multiple notices for the same "save". So, I moved this behaviour to the component instead.One nice to have enhancement (that could be done in another PR) is to avoid using the
site
Prop. This would require refactoring the underlying components.Testing instructions
/sharing/buttons/$site