diff --git a/res/css/structures/_GenericErrorPage.scss b/res/css/structures/_GenericErrorPage.scss index 44ea73444e..2b9e9f5e7d 100644 --- a/res/css/structures/_GenericErrorPage.scss +++ b/res/css/structures/_GenericErrorPage.scss @@ -12,7 +12,7 @@ right: 0; margin: auto; width: 500px; - height: 200px; + height: 125px; border: 1px solid #f22; padding: 10px 10px 20px; background-color: #fcc; diff --git a/res/css/structures/auth/_Login.scss b/res/css/structures/auth/_Login.scss index 4eff5c33e4..9ba46c09ab 100644 --- a/res/css/structures/auth/_Login.scss +++ b/res/css/structures/auth/_Login.scss @@ -62,6 +62,11 @@ limitations under the License. margin-bottom: 12px; } +.mx_Login_error.mx_Login_serverError { + text-align: left; + font-weight: normal; +} + .mx_Login_type_container { display: flex; align-items: center; diff --git a/src/components/structures/GenericErrorPage.js b/src/components/structures/GenericErrorPage.js index 3d8e68cea7..ab7d4f9311 100644 --- a/src/components/structures/GenericErrorPage.js +++ b/src/components/structures/GenericErrorPage.js @@ -16,22 +16,18 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; -import {_t} from "../../languageHandler"; export default class GenericErrorPage extends React.PureComponent { static propTypes = { + title: PropTypes.object.isRequired, // jsx for title message: PropTypes.object.isRequired, // jsx to display }; render() { return
-

{_t("Error loading Riot")}

+

{this.props.title}

{this.props.message}

-

{_t( - "If this is unexpected, please contact your system administrator " + - "or technical support representative.", - )}

; } diff --git a/src/components/structures/auth/ForgotPassword.js b/src/components/structures/auth/ForgotPassword.js index e235446b16..2daa9e2a41 100644 --- a/src/components/structures/auth/ForgotPassword.js +++ b/src/components/structures/auth/ForgotPassword.js @@ -213,9 +213,8 @@ module.exports = React.createClass({ let serverDeadSection; if (!this.state.serverIsAlive) { - // TODO: TravisR - Design from Nad serverDeadSection = ( -
+
{this.state.serverDeadError}
); diff --git a/src/components/structures/auth/Login.js b/src/components/structures/auth/Login.js index c38d59caeb..3594a00513 100644 --- a/src/components/structures/auth/Login.js +++ b/src/components/structures/auth/Login.js @@ -568,9 +568,8 @@ module.exports = React.createClass({ let serverDeadSection; if (!this.state.serverIsAlive) { - // TODO: TravisR - Design from Nad serverDeadSection = ( -
+
{this.state.serverDeadError}
); diff --git a/src/components/structures/auth/Registration.js b/src/components/structures/auth/Registration.js index bf46c7520d..cee809de13 100644 --- a/src/components/structures/auth/Registration.js +++ b/src/components/structures/auth/Registration.js @@ -485,9 +485,8 @@ module.exports = React.createClass({ let serverDeadSection; if (!this.state.serverIsAlive) { - // TODO: TravisR - Design from Nad serverDeadSection = ( -
+
{this.state.serverDeadError}
); diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 2b5efc38ee..1e88307533 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -249,8 +249,10 @@ "%(names)s and %(count)s others are typing …|other": "%(names)s and %(count)s others are typing …", "%(names)s and %(count)s others are typing …|one": "%(names)s and one other is typing …", "%(names)s and %(lastPerson)s are typing …": "%(names)s and %(lastPerson)s are typing …", - "Server failed liveliness check": "Server failed liveliness check", - "Server failed syntax check": "Server failed syntax check", + "Cannot reach homeserver": "Cannot reach homeserver", + "Ensure you have a stable internet connection, or get in touch with the server admin": "Ensure you have a stable internet connection, or get in touch with the server admin", + "Your Riot is misconfigured": "Your Riot is misconfigured", + "Ask your Riot admin to check your config for incorrect or duplicate entries.": "Ask your Riot admin to check your config for incorrect or duplicate entries.", "No homeserver URL provided": "No homeserver URL provided", "Unexpected error resolving homeserver configuration": "Unexpected error resolving homeserver configuration", "Unexpected error resolving identity server configuration": "Unexpected error resolving identity server configuration", @@ -1387,8 +1389,6 @@ "You must register to use this functionality": "You must register to use this functionality", "You must join the room to see its files": "You must join the room to see its files", "There are no visible files in this room": "There are no visible files in this room", - "Error loading Riot": "Error loading Riot", - "If this is unexpected, please contact your system administrator or technical support representative.": "If this is unexpected, please contact your system administrator or technical support representative.", "

HTML for your community's page

\n

\n Use the long description to introduce new members to the community, or distribute\n some important links\n

\n

\n You can even use 'img' tags\n

\n": "

HTML for your community's page

\n

\n Use the long description to introduce new members to the community, or distribute\n some important links\n

\n

\n You can even use 'img' tags\n

\n", "Add rooms to the community summary": "Add rooms to the community summary", "Which rooms would you like to add to this summary?": "Which rooms would you like to add to this summary?", diff --git a/src/utils/AutoDiscoveryUtils.js b/src/utils/AutoDiscoveryUtils.js index 26596bdbb8..8b13fff368 100644 --- a/src/utils/AutoDiscoveryUtils.js +++ b/src/utils/AutoDiscoveryUtils.js @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +import React from 'react'; import {AutoDiscovery} from "matrix-js-sdk"; import {_t, _td, newTranslatableError} from "../languageHandler"; import {makeType} from "./TypeUtils"; @@ -56,19 +57,33 @@ export default class AutoDiscoveryUtils { * for the component, given the error. */ static authComponentStateForError(err: Error): {serverIsAlive: boolean, serverDeadError: string} { - if (AutoDiscoveryUtils.isLivelinessError(err)) { - // TODO: TravisR - Copy from Nad - return { - serverIsAlive: false, - serverDeadError: _t("Server failed liveliness check"), - }; - } else { - // TODO: TravisR - Copy from Nad - return { - serverIsAlive: false, - serverDeadError: _t("Server failed syntax check"), - }; + let title = _t("Cannot reach homeserver"); + let body = _t("Ensure you have a stable internet connection, or get in touch with the server admin"); + if (!AutoDiscoveryUtils.isLivelinessError(err)) { + title = _t("Your Riot is misconfigured"); + body = _t( + "Ask your Riot admin to check your config for incorrect or duplicate entries.", + {}, { + a: (sub) => { + return {sub}; + } + }, + ); } + + return { + serverIsAlive: false, + serverDeadError: ( +
+ {title} +
{body}
+
+ ), + }; } /**