From 6d9e07580bab42722e3d0c89bd7e13720845682b Mon Sep 17 00:00:00 2001
From: David Baker
Date: Fri, 27 Apr 2018 12:38:49 +0100
Subject: [PATCH 01/10] UI fixes in SessionRestoreErrorDialog
* Make the 'delete my data' button not the default
* Make it red
* Give it a confirmation dialog
* Remove the 'cancel' button: what does it mean to cancel an error?
In this case, it tried again and almost certainly got the same error.
* Remove the top-right 'x' and don't cancel on esc for the same reason.
* Move 'send bug report' to a button rather than a 'click here' link
* Add a 'refresh' button which, even if it's no more likely to work,
will at least look like it's doing something (it's mostly so if you
don't have a bug report endpoint, there's still a button other
than the one that deletes all your data).
---
res/css/_common.scss | 1 +
src/components/views/dialogs/BaseDialog.js | 20 +++++-
.../dialogs/SessionRestoreErrorDialog.js | 70 +++++++++++--------
.../views/elements/DialogButtons.js | 18 +++--
src/i18n/strings/en_EN.json | 13 ++--
5 files changed, 79 insertions(+), 43 deletions(-)
diff --git a/res/css/_common.scss b/res/css/_common.scss
index e81c228430..c4cda6821e 100644
--- a/res/css/_common.scss
+++ b/res/css/_common.scss
@@ -250,6 +250,7 @@ textarea {
.mx_Dialog button.danger, .mx_Dialog input[type="submit"].danger {
background-color: $warning-color;
border: solid 1px $warning-color;
+ color: $accent-fg-color;
}
.mx_Dialog button:disabled, .mx_Dialog input[type="submit"]:disabled {
diff --git a/src/components/views/dialogs/BaseDialog.js b/src/components/views/dialogs/BaseDialog.js
index 7959e7cb10..fb116cdffe 100644
--- a/src/components/views/dialogs/BaseDialog.js
+++ b/src/components/views/dialogs/BaseDialog.js
@@ -1,5 +1,6 @@
/*
Copyright 2017 Vector Creations Ltd
+Copyright 2018 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -41,6 +42,13 @@ export default React.createClass({
// cancelled (from BaseDialog, this is always false).
onFinished: PropTypes.func.isRequired,
+ // Whether the dialog should have a 'close' button that will
+ // cause the dialog to be cancelled. This should only be set
+ // to true if there is nothing the app can sensibly do if the
+ // dialog is cancelled, eg. "We can't restore your session and
+ // the app cannot work".
+ hasCancel: PropTypes.bool,
+
// called when a key is pressed
onKeyDown: PropTypes.func,
@@ -59,6 +67,12 @@ export default React.createClass({
contentId: React.PropTypes.string,
},
+ getDefaultProps: function() {
+ return {
+ hasCancel: true,
+ };
+ },
+
childContextTypes: {
matrixClient: PropTypes.instanceOf(MatrixClient),
},
@@ -77,7 +91,7 @@ export default React.createClass({
if (this.props.onKeyDown) {
this.props.onKeyDown(e);
}
- if (e.keyCode === KeyCode.ESCAPE) {
+ if (this.props.hasCancel && e.keyCode === KeyCode.ESCAPE) {
e.stopPropagation();
e.preventDefault();
this.props.onFinished(false);
@@ -104,11 +118,11 @@ export default React.createClass({
// AT users can skip its presentation.
aria-describedby={this.props.contentId}
>
-
-
+ : null }
{ _t("We encountered an error trying to restore your previous session. If " +
- "you continue, you will need to log in again, and encrypted chat " +
- "history will be unreadable.") }
+
{ _t("We encountered an error trying to restore your previous session.") }
{ _t("If you have previously used a more recent version of Riot, your session " +
"may be incompatible with this version. Close this window and return " +
"to the more recent version.") }
- { bugreport }
+
{ _t("Clearing your browser's storage may fix the problem, but will sign you " +
+ "out and cause any encrypted chat history to become unreadable.") }
-
+ { dialogButtons }
);
},
diff --git a/src/components/views/elements/DialogButtons.js b/src/components/views/elements/DialogButtons.js
index 537f906a74..73e47cbde2 100644
--- a/src/components/views/elements/DialogButtons.js
+++ b/src/components/views/elements/DialogButtons.js
@@ -1,5 +1,6 @@
/*
Copyright 2017 Aidan Gauland
+Copyright 2018 New Vector Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,8 +15,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-"use strict";
-
import React from "react";
import PropTypes from "prop-types";
import { _t } from '../../../languageHandler';
@@ -33,12 +32,21 @@ module.exports = React.createClass({
// onClick handler for the primary button.
onPrimaryButtonClick: PropTypes.func.isRequired,
+ // should there be a cancel button? default: true
+ hasCancel: PropTypes.bool,
+
// onClick handler for the cancel button.
- onCancel: PropTypes.func.isRequired,
+ onCancel: PropTypes.func,
focus: PropTypes.bool,
},
+ getDefaultProps: function() {
+ return {
+ hasCancel: true,
+ }
+ },
+
_onCancelClick: function() {
this.props.onCancel();
},
@@ -57,9 +65,9 @@ module.exports = React.createClass({
{ this.props.primaryButton }
{ this.props.children }
- : null }
);
},
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index 33f18e47a4..3c8dd5b66f 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -103,7 +103,6 @@
"You need to be logged in.": "You need to be logged in.",
"You need to be able to invite users to do that.": "You need to be able to invite users to do that.",
"Unable to create widget.": "Unable to create widget.",
- "Popout widget": "Popout widget",
"Missing roomId.": "Missing roomId.",
"Failed to send request.": "Failed to send request.",
"This room is not recognised.": "This room is not recognised.",
@@ -655,6 +654,7 @@
"Delete widget": "Delete widget",
"Revoke widget access": "Revoke widget access",
"Minimize apps": "Minimize apps",
+ "Popout widget": "Popout widget",
"Picture": "Picture",
"Edit": "Edit",
"Create new room": "Create new room",
@@ -807,11 +807,15 @@
"Ignore request": "Ignore request",
"Loading device info...": "Loading device info...",
"Encryption key request": "Encryption key request",
- "Otherwise, click here to send a bug report.": "Otherwise, click here to send a bug report.",
+ "Sign out": "Sign out",
+ "Log out and remove encryption keys?": "Log out and remove encryption keys?",
+ "Send Logs": "Send Logs",
+ "Clear Storage and Sign Out": "Clear Storage and Sign Out",
+ "Refresh": "Refresh",
"Unable to restore session": "Unable to restore session",
- "We encountered an error trying to restore your previous session. If you continue, you will need to log in again, and encrypted chat history will be unreadable.": "We encountered an error trying to restore your previous session. If you continue, you will need to log in again, and encrypted chat history will be unreadable.",
+ "We encountered an error trying to restore your previous session.": "We encountered an error trying to restore your previous session.",
"If you have previously used a more recent version of Riot, your session may be incompatible with this version. Close this window and return to the more recent version.": "If you have previously used a more recent version of Riot, your session may be incompatible with this version. Close this window and return to the more recent version.",
- "Continue anyway": "Continue anyway",
+ "Clearing your browser's storage may fix the problem, but will sign you out and cause any encrypted chat history to become unreadable.": "Clearing your browser's storage may fix the problem, but will sign you out and cause any encrypted chat history to become unreadable.",
"Invalid Email Address": "Invalid Email Address",
"This doesn't appear to be a valid email address": "This doesn't appear to be a valid email address",
"Verification Pending": "Verification Pending",
@@ -1015,7 +1019,6 @@
"Status.im theme": "Status.im theme",
"Can't load user settings": "Can't load user settings",
"Server may be unavailable or overloaded": "Server may be unavailable or overloaded",
- "Sign out": "Sign out",
"For security, logging out will delete any end-to-end encryption keys from this browser. If you want to be able to decrypt your conversation history from future Riot sessions, please export your room keys for safe-keeping.": "For security, logging out will delete any end-to-end encryption keys from this browser. If you want to be able to decrypt your conversation history from future Riot sessions, please export your room keys for safe-keeping.",
"Success": "Success",
"Your password was successfully changed. You will not receive push notifications on other devices until you log back in to them": "Your password was successfully changed. You will not receive push notifications on other devices until you log back in to them",
From efd29193b7e32445c65e0bd396e3a6767f28ead8 Mon Sep 17 00:00:00 2001
From: David Baker
Date: Fri, 27 Apr 2018 15:19:08 +0100
Subject: [PATCH 02/10] Fix UX issues with bug report dialog
* Make it use BaseDialog / DialogButtons (also gives it has a top-right 'x' &
escape to cancel works)
* Stop misusing the 'danger' CSS class on the buttons. There is nothing dangerous
about submitting logs.
* Continued campaign against 'Click here' links.
Fixes https://github.com/vector-im/riot-web/issues/6622
---
src/components/structures/UserSettings.js | 4 +-
.../views/dialogs/BugReportDialog.js | 42 +++++++------------
.../views/elements/DialogButtons.js | 14 +++++--
src/i18n/strings/en_EN.json | 2 +-
4 files changed, 30 insertions(+), 32 deletions(-)
diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js
index 7948f4fb5d..44e2f93d63 100644
--- a/src/components/structures/UserSettings.js
+++ b/src/components/structures/UserSettings.js
@@ -1,7 +1,7 @@
/*
Copyright 2015, 2016 OpenMarket Ltd
Copyright 2017 Vector Creations Ltd
-Copyright 2017 New Vector Ltd
+Copyright 2017, 2018 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -804,7 +804,7 @@ module.exports = React.createClass({
"other users. They do not contain messages.",
)
}
- { _t('Submit debug logs') }
diff --git a/src/components/views/dialogs/BugReportDialog.js b/src/components/views/dialogs/BugReportDialog.js
index 2025b6fc81..83cdb1f07f 100644
--- a/src/components/views/dialogs/BugReportDialog.js
+++ b/src/components/views/dialogs/BugReportDialog.js
@@ -1,5 +1,6 @@
/*
Copyright 2017 OpenMarket Ltd
+Copyright 2018 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -105,6 +106,8 @@ export default class BugReportDialog extends React.Component {
render() {
const Loader = sdk.getComponent("elements.Spinner");
+ const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
+ const DialogButtons = sdk.getComponent('views.elements.DialogButtons');
let error = null;
if (this.state.err) {
@@ -113,13 +116,6 @@ export default class BugReportDialog extends React.Component {
;
}
- let cancelButton = null;
- if (!this.state.busy) {
- cancelButton =
- { _t("Cancel") }
- ;
- }
-
let progress = null;
if (this.state.busy) {
progress = (
@@ -131,11 +127,11 @@ export default class BugReportDialog extends React.Component {
}
return (
-
-
- { _t("Submit debug logs") }
-
-
+
+
{ _t(
"Debug logs contain application usage data including your " +
@@ -146,7 +142,7 @@ export default class BugReportDialog extends React.Component {
);
},
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index 3c8dd5b66f..daf0ce605d 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -745,7 +745,7 @@
"Failed to send logs: ": "Failed to send logs: ",
"Submit debug logs": "Submit debug logs",
"Debug logs contain application usage data including your username, the IDs or aliases of the rooms or groups you have visited and the usernames of other users. They do not contain messages.": "Debug logs contain application usage data including your username, the IDs or aliases of the rooms or groups you have visited and the usernames of other users. They do not contain messages.",
- "Click here to create a GitHub issue.": "Click here to create a GitHub issue.",
+ "Riot bugs are tracked on GitHub: create a GitHub issue.": "Riot bugs are tracked on GitHub: create a GitHub issue.",
"GitHub issue link:": "GitHub issue link:",
"Notes:": "Notes:",
"Send logs": "Send logs",
From 27b18c457e31605b7d86c4e0b82f463ed60005cf Mon Sep 17 00:00:00 2001
From: David Baker
Date: Fri, 27 Apr 2018 15:56:28 +0100
Subject: [PATCH 03/10] Lint
---
src/components/views/dialogs/SessionRestoreErrorDialog.js | 4 ++--
src/components/views/elements/DialogButtons.js | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/components/views/dialogs/SessionRestoreErrorDialog.js b/src/components/views/dialogs/SessionRestoreErrorDialog.js
index 2e152df4b0..779e54cfba 100644
--- a/src/components/views/dialogs/SessionRestoreErrorDialog.js
+++ b/src/components/views/dialogs/SessionRestoreErrorDialog.js
@@ -68,7 +68,7 @@ export default React.createClass({
{ _t("Clear Storage and Sign Out") }
-
+ ;
} else {
dialogButtons =
{ _t("Clear Storage and Sign Out") }
-
+ ;
}
return (
diff --git a/src/components/views/elements/DialogButtons.js b/src/components/views/elements/DialogButtons.js
index 73e47cbde2..c99ea10143 100644
--- a/src/components/views/elements/DialogButtons.js
+++ b/src/components/views/elements/DialogButtons.js
@@ -44,7 +44,7 @@ module.exports = React.createClass({
getDefaultProps: function() {
return {
hasCancel: true,
- }
+ };
},
_onCancelClick: function() {
From fc136607f107a24351bd44893a370413453dbaea Mon Sep 17 00:00:00 2001
From: David Baker
Date: Fri, 27 Apr 2018 12:38:49 +0100
Subject: [PATCH 04/10] UI fixes in SessionRestoreErrorDialog
* Make the 'delete my data' button not the default
* Make it red
* Give it a confirmation dialog
* Remove the 'cancel' button: what does it mean to cancel an error?
In this case, it tried again and almost certainly got the same error.
* Remove the top-right 'x' and don't cancel on esc for the same reason.
* Move 'send bug report' to a button rather than a 'click here' link
* Add a 'refresh' button which, even if it's no more likely to work,
will at least look like it's doing something (it's mostly so if you
don't have a bug report endpoint, there's still a button other
than the one that deletes all your data).
---
res/css/_common.scss | 1 +
src/components/views/dialogs/BaseDialog.js | 20 +++++-
.../dialogs/SessionRestoreErrorDialog.js | 70 +++++++++++--------
.../views/elements/DialogButtons.js | 18 +++--
src/i18n/strings/en_EN.json | 13 ++--
5 files changed, 79 insertions(+), 43 deletions(-)
diff --git a/res/css/_common.scss b/res/css/_common.scss
index e81c228430..c4cda6821e 100644
--- a/res/css/_common.scss
+++ b/res/css/_common.scss
@@ -250,6 +250,7 @@ textarea {
.mx_Dialog button.danger, .mx_Dialog input[type="submit"].danger {
background-color: $warning-color;
border: solid 1px $warning-color;
+ color: $accent-fg-color;
}
.mx_Dialog button:disabled, .mx_Dialog input[type="submit"]:disabled {
diff --git a/src/components/views/dialogs/BaseDialog.js b/src/components/views/dialogs/BaseDialog.js
index 51d9180885..2f2d6fe8cb 100644
--- a/src/components/views/dialogs/BaseDialog.js
+++ b/src/components/views/dialogs/BaseDialog.js
@@ -1,5 +1,6 @@
/*
Copyright 2017 Vector Creations Ltd
+Copyright 2018 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -41,6 +42,13 @@ export default React.createClass({
// cancelled (BaseDialog itself only calls this with false).
onFinished: PropTypes.func.isRequired,
+ // Whether the dialog should have a 'close' button that will
+ // cause the dialog to be cancelled. This should only be set
+ // to true if there is nothing the app can sensibly do if the
+ // dialog is cancelled, eg. "We can't restore your session and
+ // the app cannot work".
+ hasCancel: PropTypes.bool,
+
// called when a key is pressed
onKeyDown: PropTypes.func,
@@ -59,6 +67,12 @@ export default React.createClass({
contentId: React.PropTypes.string,
},
+ getDefaultProps: function() {
+ return {
+ hasCancel: true,
+ };
+ },
+
childContextTypes: {
matrixClient: PropTypes.instanceOf(MatrixClient),
},
@@ -77,7 +91,7 @@ export default React.createClass({
if (this.props.onKeyDown) {
this.props.onKeyDown(e);
}
- if (e.keyCode === KeyCode.ESCAPE) {
+ if (this.props.hasCancel && e.keyCode === KeyCode.ESCAPE) {
e.stopPropagation();
e.preventDefault();
this.props.onFinished(false);
@@ -104,11 +118,11 @@ export default React.createClass({
// AT users can skip its presentation.
aria-describedby={this.props.contentId}
>
-
-
+ : null }
{ _t("We encountered an error trying to restore your previous session. If " +
- "you continue, you will need to log in again, and encrypted chat " +
- "history will be unreadable.") }
+
{ _t("We encountered an error trying to restore your previous session.") }
{ _t("If you have previously used a more recent version of Riot, your session " +
"may be incompatible with this version. Close this window and return " +
"to the more recent version.") }
- { bugreport }
+
{ _t("Clearing your browser's storage may fix the problem, but will sign you " +
+ "out and cause any encrypted chat history to become unreadable.") }
-
+ { dialogButtons }
);
},
diff --git a/src/components/views/elements/DialogButtons.js b/src/components/views/elements/DialogButtons.js
index 537f906a74..73e47cbde2 100644
--- a/src/components/views/elements/DialogButtons.js
+++ b/src/components/views/elements/DialogButtons.js
@@ -1,5 +1,6 @@
/*
Copyright 2017 Aidan Gauland
+Copyright 2018 New Vector Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,8 +15,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-"use strict";
-
import React from "react";
import PropTypes from "prop-types";
import { _t } from '../../../languageHandler';
@@ -33,12 +32,21 @@ module.exports = React.createClass({
// onClick handler for the primary button.
onPrimaryButtonClick: PropTypes.func.isRequired,
+ // should there be a cancel button? default: true
+ hasCancel: PropTypes.bool,
+
// onClick handler for the cancel button.
- onCancel: PropTypes.func.isRequired,
+ onCancel: PropTypes.func,
focus: PropTypes.bool,
},
+ getDefaultProps: function() {
+ return {
+ hasCancel: true,
+ }
+ },
+
_onCancelClick: function() {
this.props.onCancel();
},
@@ -57,9 +65,9 @@ module.exports = React.createClass({
{ this.props.primaryButton }
{ this.props.children }
-
+ { this.props.hasCancel ?
{ _t("Cancel") }
-
+ : null }
);
},
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index 33f18e47a4..3c8dd5b66f 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -103,7 +103,6 @@
"You need to be logged in.": "You need to be logged in.",
"You need to be able to invite users to do that.": "You need to be able to invite users to do that.",
"Unable to create widget.": "Unable to create widget.",
- "Popout widget": "Popout widget",
"Missing roomId.": "Missing roomId.",
"Failed to send request.": "Failed to send request.",
"This room is not recognised.": "This room is not recognised.",
@@ -655,6 +654,7 @@
"Delete widget": "Delete widget",
"Revoke widget access": "Revoke widget access",
"Minimize apps": "Minimize apps",
+ "Popout widget": "Popout widget",
"Picture": "Picture",
"Edit": "Edit",
"Create new room": "Create new room",
@@ -807,11 +807,15 @@
"Ignore request": "Ignore request",
"Loading device info...": "Loading device info...",
"Encryption key request": "Encryption key request",
- "Otherwise, click here to send a bug report.": "Otherwise, click here to send a bug report.",
+ "Sign out": "Sign out",
+ "Log out and remove encryption keys?": "Log out and remove encryption keys?",
+ "Send Logs": "Send Logs",
+ "Clear Storage and Sign Out": "Clear Storage and Sign Out",
+ "Refresh": "Refresh",
"Unable to restore session": "Unable to restore session",
- "We encountered an error trying to restore your previous session. If you continue, you will need to log in again, and encrypted chat history will be unreadable.": "We encountered an error trying to restore your previous session. If you continue, you will need to log in again, and encrypted chat history will be unreadable.",
+ "We encountered an error trying to restore your previous session.": "We encountered an error trying to restore your previous session.",
"If you have previously used a more recent version of Riot, your session may be incompatible with this version. Close this window and return to the more recent version.": "If you have previously used a more recent version of Riot, your session may be incompatible with this version. Close this window and return to the more recent version.",
- "Continue anyway": "Continue anyway",
+ "Clearing your browser's storage may fix the problem, but will sign you out and cause any encrypted chat history to become unreadable.": "Clearing your browser's storage may fix the problem, but will sign you out and cause any encrypted chat history to become unreadable.",
"Invalid Email Address": "Invalid Email Address",
"This doesn't appear to be a valid email address": "This doesn't appear to be a valid email address",
"Verification Pending": "Verification Pending",
@@ -1015,7 +1019,6 @@
"Status.im theme": "Status.im theme",
"Can't load user settings": "Can't load user settings",
"Server may be unavailable or overloaded": "Server may be unavailable or overloaded",
- "Sign out": "Sign out",
"For security, logging out will delete any end-to-end encryption keys from this browser. If you want to be able to decrypt your conversation history from future Riot sessions, please export your room keys for safe-keeping.": "For security, logging out will delete any end-to-end encryption keys from this browser. If you want to be able to decrypt your conversation history from future Riot sessions, please export your room keys for safe-keeping.",
"Success": "Success",
"Your password was successfully changed. You will not receive push notifications on other devices until you log back in to them": "Your password was successfully changed. You will not receive push notifications on other devices until you log back in to them",
From 37cb8abf13008362875f64fd853e5e17d9b83594 Mon Sep 17 00:00:00 2001
From: David Baker
Date: Fri, 27 Apr 2018 15:19:08 +0100
Subject: [PATCH 05/10] Fix UX issues with bug report dialog
* Make it use BaseDialog / DialogButtons (also gives it has a top-right 'x' &
escape to cancel works)
* Stop misusing the 'danger' CSS class on the buttons. There is nothing dangerous
about submitting logs.
* Continued campaign against 'Click here' links.
Fixes https://github.com/vector-im/riot-web/issues/6622
---
src/components/structures/UserSettings.js | 4 +-
.../views/dialogs/BugReportDialog.js | 42 +++++++------------
.../views/elements/DialogButtons.js | 14 +++++--
src/i18n/strings/en_EN.json | 2 +-
4 files changed, 30 insertions(+), 32 deletions(-)
diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js
index 7948f4fb5d..44e2f93d63 100644
--- a/src/components/structures/UserSettings.js
+++ b/src/components/structures/UserSettings.js
@@ -1,7 +1,7 @@
/*
Copyright 2015, 2016 OpenMarket Ltd
Copyright 2017 Vector Creations Ltd
-Copyright 2017 New Vector Ltd
+Copyright 2017, 2018 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -804,7 +804,7 @@ module.exports = React.createClass({
"other users. They do not contain messages.",
)
}
- { _t('Submit debug logs') }
diff --git a/src/components/views/dialogs/BugReportDialog.js b/src/components/views/dialogs/BugReportDialog.js
index 2025b6fc81..83cdb1f07f 100644
--- a/src/components/views/dialogs/BugReportDialog.js
+++ b/src/components/views/dialogs/BugReportDialog.js
@@ -1,5 +1,6 @@
/*
Copyright 2017 OpenMarket Ltd
+Copyright 2018 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -105,6 +106,8 @@ export default class BugReportDialog extends React.Component {
render() {
const Loader = sdk.getComponent("elements.Spinner");
+ const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
+ const DialogButtons = sdk.getComponent('views.elements.DialogButtons');
let error = null;
if (this.state.err) {
@@ -113,13 +116,6 @@ export default class BugReportDialog extends React.Component {
;
}
- let cancelButton = null;
- if (!this.state.busy) {
- cancelButton =
- { _t("Cancel") }
- ;
- }
-
let progress = null;
if (this.state.busy) {
progress = (
@@ -131,11 +127,11 @@ export default class BugReportDialog extends React.Component {
}
return (
-
-
- { _t("Submit debug logs") }
-
-
+
+
{ _t(
"Debug logs contain application usage data including your " +
@@ -146,7 +142,7 @@ export default class BugReportDialog extends React.Component {
);
},
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index 3c8dd5b66f..daf0ce605d 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -745,7 +745,7 @@
"Failed to send logs: ": "Failed to send logs: ",
"Submit debug logs": "Submit debug logs",
"Debug logs contain application usage data including your username, the IDs or aliases of the rooms or groups you have visited and the usernames of other users. They do not contain messages.": "Debug logs contain application usage data including your username, the IDs or aliases of the rooms or groups you have visited and the usernames of other users. They do not contain messages.",
- "Click here to create a GitHub issue.": "Click here to create a GitHub issue.",
+ "Riot bugs are tracked on GitHub: create a GitHub issue.": "Riot bugs are tracked on GitHub: create a GitHub issue.",
"GitHub issue link:": "GitHub issue link:",
"Notes:": "Notes:",
"Send logs": "Send logs",
From a9b6db3f2ecbd2a9f27d3d2b9f033a95bf303709 Mon Sep 17 00:00:00 2001
From: David Baker
Date: Fri, 27 Apr 2018 15:56:28 +0100
Subject: [PATCH 06/10] Lint
---
src/components/views/dialogs/SessionRestoreErrorDialog.js | 4 ++--
src/components/views/elements/DialogButtons.js | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/components/views/dialogs/SessionRestoreErrorDialog.js b/src/components/views/dialogs/SessionRestoreErrorDialog.js
index 2e152df4b0..779e54cfba 100644
--- a/src/components/views/dialogs/SessionRestoreErrorDialog.js
+++ b/src/components/views/dialogs/SessionRestoreErrorDialog.js
@@ -68,7 +68,7 @@ export default React.createClass({
{ _t("Clear Storage and Sign Out") }
-
+ ;
} else {
dialogButtons =
{ _t("Clear Storage and Sign Out") }
-
+ ;
}
return (
diff --git a/src/components/views/elements/DialogButtons.js b/src/components/views/elements/DialogButtons.js
index c8c90ddc47..267127568d 100644
--- a/src/components/views/elements/DialogButtons.js
+++ b/src/components/views/elements/DialogButtons.js
@@ -47,7 +47,7 @@ module.exports = React.createClass({
return {
hasCancel: true,
disabled: false,
- }
+ };
},
_onCancelClick: function() {
From 5d46efc3e82a33d02158a7da66fbba5a2f3eb4d0 Mon Sep 17 00:00:00 2001
From: David Baker
Date: Mon, 30 Apr 2018 14:17:21 +0100
Subject: [PATCH 07/10] Get docs right on hasCancel
---
src/components/views/dialogs/BaseDialog.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/components/views/dialogs/BaseDialog.js b/src/components/views/dialogs/BaseDialog.js
index 2f2d6fe8cb..71a5da224c 100644
--- a/src/components/views/dialogs/BaseDialog.js
+++ b/src/components/views/dialogs/BaseDialog.js
@@ -44,9 +44,9 @@ export default React.createClass({
// Whether the dialog should have a 'close' button that will
// cause the dialog to be cancelled. This should only be set
- // to true if there is nothing the app can sensibly do if the
+ // to false if there is nothing the app can sensibly do if the
// dialog is cancelled, eg. "We can't restore your session and
- // the app cannot work".
+ // the app cannot work". Default: true.
hasCancel: PropTypes.bool,
// called when a key is pressed
From 54cccab0c78de06eb89cfb23a711d266390af115 Mon Sep 17 00:00:00 2001
From: David Baker
Date: Mon, 30 Apr 2018 14:22:18 +0100
Subject: [PATCH 08/10] Factor out clearStorageButton
---
.../views/dialogs/SessionRestoreErrorDialog.js | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/components/views/dialogs/SessionRestoreErrorDialog.js b/src/components/views/dialogs/SessionRestoreErrorDialog.js
index 779e54cfba..808c12712f 100644
--- a/src/components/views/dialogs/SessionRestoreErrorDialog.js
+++ b/src/components/views/dialogs/SessionRestoreErrorDialog.js
@@ -58,6 +58,12 @@ export default React.createClass({
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
const DialogButtons = sdk.getComponent('views.elements.DialogButtons');
+ const clearStorageButton = (
+
+ { _t("Clear Storage and Sign Out") }
+
+ );
+
let dialogButtons;
if (SdkConfig.get().bug_report_endpoint_url) {
dialogButtons =
-
- { _t("Clear Storage and Sign Out") }
-
+ {clearStorageButton}
;
} else {
dialogButtons =
-
- { _t("Clear Storage and Sign Out") }
-
+ {clearStorageButton}
;
}
From c3420c37fd5ab748394f6fe55c4a368b586b9a8a Mon Sep 17 00:00:00 2001
From: David Baker
Date: Mon, 30 Apr 2018 14:25:42 +0100
Subject: [PATCH 09/10] Indentation
---
.../views/dialogs/SessionRestoreErrorDialog.js | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/components/views/dialogs/SessionRestoreErrorDialog.js b/src/components/views/dialogs/SessionRestoreErrorDialog.js
index 808c12712f..bc90788a28 100644
--- a/src/components/views/dialogs/SessionRestoreErrorDialog.js
+++ b/src/components/views/dialogs/SessionRestoreErrorDialog.js
@@ -92,12 +92,16 @@ export default React.createClass({
{ _t("We encountered an error trying to restore your previous session.") }
-
{ _t("If you have previously used a more recent version of Riot, your session " +
- "may be incompatible with this version. Close this window and return " +
- "to the more recent version.") }
+
{ _t(
+ "If you have previously used a more recent version of Riot, your session " +
+ "may be incompatible with this version. Close this window and return " +
+ "to the more recent version."
+ ) }
-
{ _t("Clearing your browser's storage may fix the problem, but will sign you " +
- "out and cause any encrypted chat history to become unreadable.") }
+
{ _t(
+ "Clearing your browser's storage may fix the problem, but will sign you " +
+ "out and cause any encrypted chat history to become unreadable."
+ ) }
{ _t(
"If you have previously used a more recent version of Riot, your session " +
"may be incompatible with this version. Close this window and return " +
- "to the more recent version."
+ "to the more recent version.",
) }
{ _t(
"Clearing your browser's storage may fix the problem, but will sign you " +
- "out and cause any encrypted chat history to become unreadable."
+ "out and cause any encrypted chat history to become unreadable.",
) }