Make it clearer which HS you're logging into
Otherwise there's no indication without clicking 'custom server'
This commit is contained in:
parent
2ba0a801c4
commit
92be3af990
4 changed files with 26 additions and 2 deletions
|
@ -290,6 +290,7 @@ module.exports = React.createClass({
|
||||||
onPhoneNumberChanged={this.onPhoneNumberChanged}
|
onPhoneNumberChanged={this.onPhoneNumberChanged}
|
||||||
onForgotPasswordClick={this.props.onForgotPasswordClick}
|
onForgotPasswordClick={this.props.onForgotPasswordClick}
|
||||||
loginIncorrect={this.state.loginIncorrect}
|
loginIncorrect={this.state.loginIncorrect}
|
||||||
|
hsUrl={this.state.enteredHomeserverUrl}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
case 'm.login.cas':
|
case 'm.login.cas':
|
||||||
|
|
|
@ -26,6 +26,12 @@ class MenuOption extends React.Component {
|
||||||
this._onClick = this._onClick.bind(this);
|
this._onClick = this._onClick.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getDefaultProps() {
|
||||||
|
return {
|
||||||
|
disabled: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_onMouseEnter() {
|
_onMouseEnter() {
|
||||||
this.props.onMouseEnter(this.props.dropdownKey);
|
this.props.onMouseEnter(this.props.dropdownKey);
|
||||||
}
|
}
|
||||||
|
@ -153,6 +159,8 @@ export default class Dropdown extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
_onInputClick(ev) {
|
_onInputClick(ev) {
|
||||||
|
if (this.props.disabled) return;
|
||||||
|
|
||||||
if (!this.state.expanded) {
|
if (!this.state.expanded) {
|
||||||
this.setState({
|
this.setState({
|
||||||
expanded: true,
|
expanded: true,
|
||||||
|
@ -329,4 +337,6 @@ Dropdown.propTypes = {
|
||||||
// in the dropped-down menu.
|
// in the dropped-down menu.
|
||||||
getShortOption: React.PropTypes.func,
|
getShortOption: React.PropTypes.func,
|
||||||
value: React.PropTypes.string,
|
value: React.PropTypes.string,
|
||||||
|
// negative for consistency with HTML
|
||||||
|
disabled: React.PropTypes.bool,
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,6 +186,17 @@ class PasswordLogin extends React.Component {
|
||||||
|
|
||||||
const loginField = this.renderLoginField(this.state.loginType);
|
const loginField = this.renderLoginField(this.state.loginType);
|
||||||
|
|
||||||
|
let matrixIdText = '';
|
||||||
|
if (this.props.hsUrl) {
|
||||||
|
try {
|
||||||
|
const parsedHsUrl = new URL(this.props.hsUrl);
|
||||||
|
matrixIdText = _t('%(serverName)s Matrix ID', {serverName: parsedHsUrl.hostname});
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
// pass
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<form onSubmit={this.onSubmitForm}>
|
<form onSubmit={this.onSubmitForm}>
|
||||||
|
@ -194,8 +205,9 @@ class PasswordLogin extends React.Component {
|
||||||
<Dropdown
|
<Dropdown
|
||||||
className="mx_Login_type_dropdown"
|
className="mx_Login_type_dropdown"
|
||||||
value={this.state.loginType}
|
value={this.state.loginType}
|
||||||
|
disabled={matrixIdText === ''}
|
||||||
onOptionChange={this.onLoginTypeChange}>
|
onOptionChange={this.onLoginTypeChange}>
|
||||||
<span key={PasswordLogin.LOGIN_FIELD_MXID}>{ _t('my Matrix ID') }</span>
|
<span key={PasswordLogin.LOGIN_FIELD_MXID}>{matrixIdText}</span>
|
||||||
<span key={PasswordLogin.LOGIN_FIELD_EMAIL}>{ _t('Email address') }</span>
|
<span key={PasswordLogin.LOGIN_FIELD_EMAIL}>{ _t('Email address') }</span>
|
||||||
<span key={PasswordLogin.LOGIN_FIELD_PHONE}>{ _t('Phone') }</span>
|
<span key={PasswordLogin.LOGIN_FIELD_PHONE}>{ _t('Phone') }</span>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
|
|
|
@ -906,5 +906,6 @@
|
||||||
"Related Groups": "Related Groups",
|
"Related Groups": "Related Groups",
|
||||||
"Related groups for this room:": "Related groups for this room:",
|
"Related groups for this room:": "Related groups for this room:",
|
||||||
"This room has no related groups": "This room has no related groups",
|
"This room has no related groups": "This room has no related groups",
|
||||||
"New group ID (e.g. +foo:%(localDomain)s)": "New group ID (e.g. +foo:%(localDomain)s)"
|
"New group ID (e.g. +foo:%(localDomain)s)": "New group ID (e.g. +foo:%(localDomain)s)",
|
||||||
|
"%(serverName)s Matrix ID": "%(serverName)s Matrix ID"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue