From a31af39ca8af8da06462d6d2cc3dd8d20093ca64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20V=C3=A1gner?= Date: Tue, 5 Dec 2017 13:52:20 +0100 Subject: [PATCH] Applied aria-describedby to all other dialogs that are using BaseDialog. Also added initial focus where it has not been set. --- .../views/dialogs/ChatCreateOrReuseDialog.js | 11 +++++----- src/components/views/dialogs/ErrorDialog.js | 14 +++++-------- .../views/dialogs/InteractiveAuthDialog.js | 8 +++++--- .../views/dialogs/KeyShareDialog.js | 7 ++++--- .../dialogs/SessionRestoreErrorDialog.js | 16 +++++++++++---- .../views/dialogs/SetEmailDialog.js | 5 ++++- src/components/views/dialogs/SetMxIdDialog.js | 7 ++++--- .../views/dialogs/UnknownDeviceDialog.js | 5 +++-- .../login/InteractiveAuthEntryComponents.js | 20 +++++++++++++------ 9 files changed, 57 insertions(+), 36 deletions(-) diff --git a/src/components/views/dialogs/ChatCreateOrReuseDialog.js b/src/components/views/dialogs/ChatCreateOrReuseDialog.js index e0578f3b53..0623177e1a 100644 --- a/src/components/views/dialogs/ChatCreateOrReuseDialog.js +++ b/src/components/views/dialogs/ChatCreateOrReuseDialog.js @@ -127,7 +127,7 @@ export default class ChatCreateOrReuseDialog extends React.Component {
{ _t("Start new chat") }
; - content =
+ content =
{ _t('You already have existing direct chats with this user:') }
{ this.state.tiles } @@ -144,7 +144,7 @@ export default class ChatCreateOrReuseDialog extends React.Component { if (this.state.busyProfile) { profile = ; } else if (this.state.profileError) { - profile =
+ profile =
Unable to load profile information for { this.props.userId }
; } else { @@ -160,14 +160,14 @@ export default class ChatCreateOrReuseDialog extends React.Component {
; } content =
-
+

{ _t('Click on the button below to start chatting!') }

{ profile }
-
@@ -179,6 +179,7 @@ export default class ChatCreateOrReuseDialog extends React.Component { { content } @@ -186,7 +187,7 @@ export default class ChatCreateOrReuseDialog extends React.Component { } } -ChatCreateOrReuseDialog.propTyps = { +ChatCreateOrReuseDialog.propTypes = { userId: React.PropTypes.string.isRequired, // Called when clicking outside of the dialog onFinished: React.PropTypes.func.isRequired, diff --git a/src/components/views/dialogs/ErrorDialog.js b/src/components/views/dialogs/ErrorDialog.js index 97ed47e10f..0910264cef 100644 --- a/src/components/views/dialogs/ErrorDialog.js +++ b/src/components/views/dialogs/ErrorDialog.js @@ -51,22 +51,18 @@ export default React.createClass({ }; }, - componentDidMount: function() { - if (this.props.focus) { - this.refs.button.focus(); - } - }, - render: function() { const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog'); return ( -
+ title={this.props.title || _t('Error')} + contentId='mx_Dialog_content' + > +
{ this.props.description || _t('An error has occurred.') }
-
diff --git a/src/components/views/dialogs/InteractiveAuthDialog.js b/src/components/views/dialogs/InteractiveAuthDialog.js index 59de7c7f59..d1273849ae 100644 --- a/src/components/views/dialogs/InteractiveAuthDialog.js +++ b/src/components/views/dialogs/InteractiveAuthDialog.js @@ -72,11 +72,12 @@ export default React.createClass({ let content; if (this.state.authError) { content = ( -
-
{ this.state.authError.message || this.state.authError.toString() }
+
+
{ this.state.authError.message || this.state.authError.toString() }

{ _t("Dismiss") } @@ -84,7 +85,7 @@ export default React.createClass({ ); } else { content = ( -
+
{ content } diff --git a/src/components/views/dialogs/KeyShareDialog.js b/src/components/views/dialogs/KeyShareDialog.js index 9c8be27c89..821939ff0d 100644 --- a/src/components/views/dialogs/KeyShareDialog.js +++ b/src/components/views/dialogs/KeyShareDialog.js @@ -125,11 +125,11 @@ export default React.createClass({ text = _t(text, {displayName: displayName}); return ( -
+

{ text }

- diff --git a/src/components/views/dialogs/SetEmailDialog.js b/src/components/views/dialogs/SetEmailDialog.js index 2dd996953d..5a9569c1b5 100644 --- a/src/components/views/dialogs/SetEmailDialog.js +++ b/src/components/views/dialogs/SetEmailDialog.js @@ -41,6 +41,7 @@ export default React.createClass({ }, componentDidMount: function() { + this.refs.emailInputField.focus(); }, onEmailAddressChanged: function(value) { @@ -130,6 +131,7 @@ export default React.createClass({ const emailInput = this.state.emailBusy ? :
-

+

{ _t('This will allow you to reset your password and receive notifications.') }

{ emailInput } diff --git a/src/components/views/dialogs/SetMxIdDialog.js b/src/components/views/dialogs/SetMxIdDialog.js index 6fc1d77682..5ef04f5be1 100644 --- a/src/components/views/dialogs/SetMxIdDialog.js +++ b/src/components/views/dialogs/SetMxIdDialog.js @@ -234,14 +234,14 @@ export default React.createClass({ "error": Boolean(this.state.usernameError), "success": usernameAvailable, }); - usernameIndicator =
+ usernameIndicator =
{ usernameAvailable ? _t('Username available') : this.state.usernameError }
; } let authErrorIndicator = null; if (this.state.authError) { - authErrorIndicator =
+ authErrorIndicator =
{ this.state.authError }
; } @@ -253,8 +253,9 @@ export default React.createClass({ -
+
- +

{ _t('"%(RoomName)s" contains devices that you haven\'t seen before.', {RoomName: this.props.room.name}) }

@@ -161,7 +162,7 @@ export default React.createClass({ }}> { _t("Send anyway") } -