-
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
Janitorial: Refactor Domain Transfer components per code standards #16382
Conversation
'Privacy Protection has been enabled.' ) ); | ||
} else { | ||
notices.success( this.translate( 'We\'ve canceled your domain transfer. Your domain is now locked back.' ) ); | ||
notices.success( translate( 'We\'ve canceled your domain transfer. Your domain is now locked back.' ) ); | ||
} | ||
|
||
if ( this.isMounted() ) { |
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 not supported in ES6. Need to figure a way to fix this.
Occurs in locked/unlocked
a few times. Chances are the lock is enabled/disabled
and the parent component rerenders.
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.
Worst case can add a var _isMounted
and set it on mount/unmount
for now. But I'd rather fix it differently.
https://facebook.github.io/react/blog/2015/12/16/ismounted-antipattern.html
0deea5b
to
8d079f4
Compare
This reverts commit 1684bfa.
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.
Other than the unbound method and that translate
call, everything else seems to work A-OK 👍
|
||
handleClick() { | ||
handleClick = () => { | ||
this.setState( { submitting: true } ); | ||
|
||
resendIcannVerification( this.props.selectedDomainName, ( error ) => { | ||
if ( error ) { | ||
notices.error( error.message ); |
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'd be awesome if you convert the usage of these global, old-style notices to the Redux ones from state/notices/actions
(that'd get us a step closer to resolving #3396).
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.
Lemme do that in a different PR. I can fix #3396 with it.
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.
Sure 👍 I was postponing fixing that one, because I misunderstood the scope of that issue originally (context: #15880 (comment)). But it should be pretty straightforward if it's just "reduxifying" them.
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.
You mean "just". 😆 ❤️
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'm sure that will be a very straightforward and small PR 😏
</Header> | ||
{ this.renderSection() } | ||
</Main> | ||
); | ||
}, | ||
} | ||
|
||
goToEdit() { |
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 should be bound to this
.
displayRequestTransferCodeResponseNotice( error, getSelectedDomain( this.props ) ); | ||
} ); | ||
}, | ||
|
||
handleTransferClick() { |
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.
Hah, good call.
<div> | ||
<SectionHeader label={ translate( 'Transfer Domain' ) } /> | ||
<Card className="transfer-card"> | ||
<p> | ||
{ translate( | ||
{ this.props.translate( |
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 should actually stay translate
, since it's a stateless component and this.props
is probably undefined, but translate
is nicely available via the destructured parameter.
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.
Yeah, missed this one somehow, eh.
} else if ( hasPrivacyProtection ) { | ||
notices.success( this.translate( 'We\'ve canceled your domain transfer. Your domain is now locked and ' + | ||
notices.success( translate( 'We\'ve canceled your domain transfer. Your domain is now locked and ' + |
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.
Same comment as above about global notices. If you prefer not to do it in this PR, that's cool, but it's not much more work - just pass the actions to connect
and replace the call here.
submitting: false | ||
}; | ||
}, | ||
class IcannVerification extends React.Component { |
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.
Maybe we could re-use the new ICANN verification notice from domain management here?
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.
Totally a different PR. :)
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.
Hah, fair enough ;)
@klimeryk thanks! Nice 👀 as always! Will fix those two and merge. |
Migrate to ES6.
Test:
Transfer -> Transfer domain to another registrar