Address review request comments

This commit is contained in:
Peter Vágner 2017-12-14 10:31:28 +01:00
parent ab0ff9b781
commit 642675c96d
3 changed files with 43 additions and 15 deletions

View file

@ -73,7 +73,7 @@ export default React.createClass({
if (this.state.authError) {
content = (
<div id='mx_Dialog_content'>
<div role={(this.state.authError.message || this.state.authError.toString()) ? "alert" : ""}>{ this.state.authError.message || this.state.authError.toString() }</div>
<div role="alert">{ this.state.authError.message || this.state.authError.toString() }</div>
<br />
<AccessibleButton onClick={this._onDismissClick}
className="mx_UserSettings_button"

View file

@ -60,6 +60,7 @@ export default React.createClass({
</p>
);
}
const shouldFocusContinueButton =!(bugreport==true);
return (
<BaseDialog className="mx_ErrorDialog" onFinished={this.props.onFinished}
@ -77,8 +78,8 @@ export default React.createClass({
{ bugreport }
</div>
<div className="mx_Dialog_buttons" autoFocus={SdkConfig.get().bug_report_endpoint_url ? false : true}>
<button className="mx_Dialog_primary" onClick={this._continueClicked}>
<div className="mx_Dialog_buttons">
<button className="mx_Dialog_primary" onClick={this._continueClicked} autoFocus={shouldFocusContinueButton}>
{ _t("Continue anyway") }
</button>
</div>

View file

@ -127,6 +127,15 @@ export const PasswordAuthEntry = React.createClass({
);
}
let errorSection;
if (this.props.errorText) {
errorSection = (
<div className="error" role="alert">
{ this.props.errorText }
</div>
);
}
return (
<div>
<p>{ _t("To continue, please enter your password.") }</p>
@ -143,9 +152,7 @@ export const PasswordAuthEntry = React.createClass({
{ submitButtonOrSpinner }
</div>
</form>
<div className="error" role={ this.props.errorText ? "alert" : ""}>
{ this.props.errorText }
</div>
{ errorSection }
</div>
);
},
@ -180,14 +187,22 @@ export const RecaptchaAuthEntry = React.createClass({
const CaptchaForm = sdk.getComponent("views.login.CaptchaForm");
const sitePublicKey = this.props.stageParams.public_key;
let errorSection;
if (this.props.errorText) {
errorSection = (
<div className="error" role="alert">
{ this.props.errorText }
</div>
);
}
return (
<div>
<CaptchaForm sitePublicKey={sitePublicKey}
onCaptchaResponse={this._onCaptchaResponse}
/>
<div className="error" role={ this.props.errorText ? "alert" : ""}>
{ this.props.errorText }
</div>
{ errorSection }
</div>
);
},
@ -372,6 +387,14 @@ export const MsisdnAuthEntry = React.createClass({
mx_InteractiveAuthEntryComponents_msisdnSubmit: true,
mx_UserSettings_button: true, // XXX button classes
});
let errorSection;
if (this.state.errorText) {
errorSection = (
<div className="error" role="alert">
{ this.state.errorText }
</div>
);
}
return (
<div>
<p>{ _t("A text message has been sent to %(msisdn)s",
@ -393,9 +416,7 @@ export const MsisdnAuthEntry = React.createClass({
disabled={!enableSubmit}
/>
</form>
<div className="error" role={this.state.errorText ? "alert" : ""}>
{ this.state.errorText }
</div>
{errorSection}
</div>
</div>
);
@ -452,12 +473,18 @@ export const FallbackAuthEntry = React.createClass({
},
render: function() {
let errorSection;
if (this.props.errorText) {
errorSection = (
<div className="error" role="alert">
{ this.props.errorText }
</div>
);
}
return (
<div>
<a ref="fallbackButton" onClick={this._onShowFallbackClick}>{ _t("Start authentication") }</a>
<div className="error" role={ this.props.errorText ? "alert" : ""}>
{ this.props.errorText }
</div>
{errorSection}
</div>
);
},