Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
5d370e47d3
7 changed files with 27 additions and 37 deletions
13
src/Login.js
13
src/Login.js
|
@ -178,11 +178,18 @@ export default class Login {
|
||||||
}
|
}
|
||||||
|
|
||||||
redirectToCas() {
|
redirectToCas() {
|
||||||
var client = this._createTemporaryClient();
|
const client = this._createTemporaryClient();
|
||||||
var parsedUrl = url.parse(window.location.href, true);
|
const parsedUrl = url.parse(window.location.href, true);
|
||||||
|
|
||||||
|
// XXX: at this point, the fragment will always be #/login, which is no
|
||||||
|
// use to anyone. Ideally, we would get the intended fragment from
|
||||||
|
// MatrixChat.screenAfterLogin so that you could follow #/room links etc
|
||||||
|
// through a CAS login.
|
||||||
|
parsedUrl.hash = "";
|
||||||
|
|
||||||
parsedUrl.query["homeserver"] = client.getHomeserverUrl();
|
parsedUrl.query["homeserver"] = client.getHomeserverUrl();
|
||||||
parsedUrl.query["identityServer"] = client.getIdentityServerUrl();
|
parsedUrl.query["identityServer"] = client.getIdentityServerUrl();
|
||||||
var casUrl = client.getCasLoginUrl(url.format(parsedUrl));
|
const casUrl = client.getCasLoginUrl(url.format(parsedUrl));
|
||||||
window.location.href = casUrl;
|
window.location.href = casUrl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -239,7 +239,6 @@ export default React.createClass({
|
||||||
page_element = <UserSettings
|
page_element = <UserSettings
|
||||||
onClose={this.props.onUserSettingsClose}
|
onClose={this.props.onUserSettingsClose}
|
||||||
brand={this.props.config.brand}
|
brand={this.props.config.brand}
|
||||||
collapsedRhs={this.props.collapse_rhs}
|
|
||||||
enableLabs={this.props.config.enableLabs}
|
enableLabs={this.props.config.enableLabs}
|
||||||
referralBaseUrl={this.props.config.referralBaseUrl}
|
referralBaseUrl={this.props.config.referralBaseUrl}
|
||||||
teamToken={this.props.teamToken}
|
teamToken={this.props.teamToken}
|
||||||
|
@ -270,7 +269,6 @@ export default React.createClass({
|
||||||
this.props.config.teamServerConfig.teamServerURL : null;
|
this.props.config.teamServerConfig.teamServerURL : null;
|
||||||
|
|
||||||
page_element = <HomePage
|
page_element = <HomePage
|
||||||
collapsedRhs={this.props.collapse_rhs}
|
|
||||||
teamServerUrl={teamServerUrl}
|
teamServerUrl={teamServerUrl}
|
||||||
teamToken={this.props.teamToken}
|
teamToken={this.props.teamToken}
|
||||||
homePageUrl={this.props.config.welcomePageUrl}
|
homePageUrl={this.props.config.welcomePageUrl}
|
||||||
|
|
|
@ -93,6 +93,7 @@ module.exports = React.createClass({
|
||||||
roomId: null,
|
roomId: null,
|
||||||
roomLoading: true,
|
roomLoading: true,
|
||||||
peekLoading: false,
|
peekLoading: false,
|
||||||
|
shouldPeek: true,
|
||||||
|
|
||||||
// The event to be scrolled to initially
|
// The event to be scrolled to initially
|
||||||
initialEventId: null,
|
initialEventId: null,
|
||||||
|
@ -168,8 +169,13 @@ module.exports = React.createClass({
|
||||||
initialEventId: RoomViewStore.getInitialEventId(),
|
initialEventId: RoomViewStore.getInitialEventId(),
|
||||||
initialEventPixelOffset: RoomViewStore.getInitialEventPixelOffset(),
|
initialEventPixelOffset: RoomViewStore.getInitialEventPixelOffset(),
|
||||||
isInitialEventHighlighted: RoomViewStore.isInitialEventHighlighted(),
|
isInitialEventHighlighted: RoomViewStore.isInitialEventHighlighted(),
|
||||||
|
shouldPeek: RoomViewStore.shouldPeek(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// finished joining, start waiting for a room and show a spinner. See onRoom.
|
||||||
|
newState.waitingForRoom = this.state.joining && !newState.joining &&
|
||||||
|
!RoomViewStore.getJoinError();
|
||||||
|
|
||||||
// Temporary logging to diagnose https://github.com/vector-im/riot-web/issues/4307
|
// Temporary logging to diagnose https://github.com/vector-im/riot-web/issues/4307
|
||||||
console.log(
|
console.log(
|
||||||
'RVS update:',
|
'RVS update:',
|
||||||
|
@ -177,12 +183,11 @@ module.exports = React.createClass({
|
||||||
newState.roomAlias,
|
newState.roomAlias,
|
||||||
'loading?', newState.roomLoading,
|
'loading?', newState.roomLoading,
|
||||||
'joining?', newState.joining,
|
'joining?', newState.joining,
|
||||||
|
'initial?', initial,
|
||||||
|
'waiting?', newState.waitingForRoom,
|
||||||
|
'shouldPeek?', newState.shouldPeek,
|
||||||
);
|
);
|
||||||
|
|
||||||
// finished joining, start waiting for a room and show a spinner. See onRoom.
|
|
||||||
newState.waitingForRoom = this.state.joining && !newState.joining &&
|
|
||||||
!RoomViewStore.getJoinError();
|
|
||||||
|
|
||||||
// NB: This does assume that the roomID will not change for the lifetime of
|
// NB: This does assume that the roomID will not change for the lifetime of
|
||||||
// the RoomView instance
|
// the RoomView instance
|
||||||
if (initial) {
|
if (initial) {
|
||||||
|
@ -238,7 +243,7 @@ module.exports = React.createClass({
|
||||||
if (!this.state.joining && this.state.roomId) {
|
if (!this.state.joining && this.state.roomId) {
|
||||||
if (this.props.autoJoin) {
|
if (this.props.autoJoin) {
|
||||||
this.onJoinButtonClicked();
|
this.onJoinButtonClicked();
|
||||||
} else if (!room) {
|
} else if (!room && this.state.shouldPeek) {
|
||||||
console.log("Attempting to peek into room %s", this.state.roomId);
|
console.log("Attempting to peek into room %s", this.state.roomId);
|
||||||
this.setState({
|
this.setState({
|
||||||
peekLoading: true,
|
peekLoading: true,
|
||||||
|
|
|
@ -169,9 +169,6 @@ module.exports = React.createClass({
|
||||||
// The base URL to use in the referral link. Defaults to window.location.origin.
|
// The base URL to use in the referral link. Defaults to window.location.origin.
|
||||||
referralBaseUrl: React.PropTypes.string,
|
referralBaseUrl: React.PropTypes.string,
|
||||||
|
|
||||||
// true if RightPanel is collapsed
|
|
||||||
collapsedRhs: React.PropTypes.bool,
|
|
||||||
|
|
||||||
// Team token for the referral link. If falsy, the referral section will
|
// Team token for the referral link. If falsy, the referral section will
|
||||||
// not appear
|
// not appear
|
||||||
teamToken: React.PropTypes.string,
|
teamToken: React.PropTypes.string,
|
||||||
|
@ -1164,7 +1161,6 @@ module.exports = React.createClass({
|
||||||
<div className="mx_UserSettings">
|
<div className="mx_UserSettings">
|
||||||
<SimpleRoomHeader
|
<SimpleRoomHeader
|
||||||
title={ _t("Settings") }
|
title={ _t("Settings") }
|
||||||
collapsedRhs={ this.props.collapsedRhs }
|
|
||||||
onCancelClick={ this.props.onClose }
|
onCancelClick={ this.props.onClose }
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,7 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import dis from '../../../dispatcher';
|
|
||||||
import AccessibleButton from '../elements/AccessibleButton';
|
import AccessibleButton from '../elements/AccessibleButton';
|
||||||
import sdk from '../../../index';
|
import sdk from '../../../index';
|
||||||
import { _t } from '../../../languageHandler';
|
import { _t } from '../../../languageHandler';
|
||||||
|
@ -45,17 +42,10 @@ export default React.createClass({
|
||||||
title: React.PropTypes.string,
|
title: React.PropTypes.string,
|
||||||
onCancelClick: React.PropTypes.func,
|
onCancelClick: React.PropTypes.func,
|
||||||
|
|
||||||
// is the RightPanel collapsed?
|
|
||||||
collapsedRhs: React.PropTypes.bool,
|
|
||||||
|
|
||||||
// `src` to a TintableSvg. Optional.
|
// `src` to a TintableSvg. Optional.
|
||||||
icon: React.PropTypes.string,
|
icon: React.PropTypes.string,
|
||||||
},
|
},
|
||||||
|
|
||||||
onShowRhsClick: function(ev) {
|
|
||||||
dis.dispatch({ action: 'show_right_panel' });
|
|
||||||
},
|
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
let cancelButton;
|
let cancelButton;
|
||||||
let icon;
|
let icon;
|
||||||
|
@ -70,25 +60,12 @@ export default React.createClass({
|
||||||
/>;
|
/>;
|
||||||
}
|
}
|
||||||
|
|
||||||
let showRhsButton;
|
|
||||||
/* // don't bother cluttering things up with this for now.
|
|
||||||
const TintableSvg = sdk.getComponent("elements.TintableSvg");
|
|
||||||
|
|
||||||
if (this.props.collapsedRhs) {
|
|
||||||
showRhsButton =
|
|
||||||
<div className="mx_RoomHeader_button" style={{ float: 'right' }} onClick={this.onShowRhsClick} title=">">
|
|
||||||
<TintableSvg src="img/minimise.svg" width="10" height="16"/>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mx_RoomHeader" >
|
<div className="mx_RoomHeader" >
|
||||||
<div className="mx_RoomHeader_wrapper">
|
<div className="mx_RoomHeader_wrapper">
|
||||||
<div className="mx_RoomHeader_simpleHeader">
|
<div className="mx_RoomHeader_simpleHeader">
|
||||||
{ icon }
|
{ icon }
|
||||||
{ this.props.title }
|
{ this.props.title }
|
||||||
{ showRhsButton }
|
|
||||||
{ cancelButton }
|
{ cancelButton }
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -100,6 +100,7 @@ function createRoom(opts) {
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: 'view_room',
|
action: 'view_room',
|
||||||
room_id: roomId,
|
room_id: roomId,
|
||||||
|
should_peek: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return roomId;
|
return roomId;
|
||||||
|
|
|
@ -129,6 +129,8 @@ class RoomViewStore extends Store {
|
||||||
isInitialEventHighlighted: payload.highlighted,
|
isInitialEventHighlighted: payload.highlighted,
|
||||||
roomLoading: false,
|
roomLoading: false,
|
||||||
roomLoadError: null,
|
roomLoadError: null,
|
||||||
|
// should peek by default
|
||||||
|
shouldPeek: payload.should_peek === undefined ? true : payload.should_peek,
|
||||||
};
|
};
|
||||||
|
|
||||||
// If an event ID wasn't specified, default to the one saved for this room
|
// If an event ID wasn't specified, default to the one saved for this room
|
||||||
|
@ -276,6 +278,10 @@ class RoomViewStore extends Store {
|
||||||
getJoinError() {
|
getJoinError() {
|
||||||
return this._state.joinError;
|
return this._state.joinError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shouldPeek() {
|
||||||
|
return this._state.shouldPeek;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let singletonRoomViewStore = null;
|
let singletonRoomViewStore = null;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue