Merge pull request #2529 from mattermost/plt-2383

PLT-2383 Fixed system console login page flash.
This commit is contained in:
Harrison Healey
2016-03-24 12:45:12 -04:00
35 changed files with 152 additions and 177 deletions

View File

@@ -63,8 +63,8 @@ export default class AdminNavbarDropdown extends React.Component {
role='menu'
>
<li>
<a
href={Utils.getWindowLocationOrigin() + '/' + this.state.currentTeam.name}
<Link
to={Utils.getWindowLocationOrigin() + '/' + this.state.currentTeam.name + '/channels/town-square'}
>
<FormattedMessage
id='admin.nav.switch'
@@ -73,7 +73,7 @@ export default class AdminNavbarDropdown extends React.Component {
display_name: this.state.currentTeam.display_name
}}
/>
</a>
</Link>
</li>
<li>
<Link to={Utils.getTeamURLFromAddressBar() + '/logout'}>
@@ -83,29 +83,6 @@ export default class AdminNavbarDropdown extends React.Component {
/>
</Link>
</li>
<li className='divider'></li>
<li>
<a
target='_blank'
href='/static/help/help.html'
>
<FormattedMessage
id='admin.nav.help'
defaultMessage='Help'
/>
</a>
</li>
<li>
<a
target='_blank'
href='/static/help/report_problem.html'
>
<FormattedMessage
id='admin.nav.report'
defaultMessage='Report a Problem'
/>
</a>
</li>
</ul>
</li>
</ul>

View File

@@ -10,6 +10,7 @@ import TeamStore from 'stores/team_store.jsx';
import {FormattedMessage} from 'react-intl';
import React from 'react';
import {browserHistory} from 'react-router';
export default class UserItem extends React.Component {
constructor(props) {
@@ -158,9 +159,9 @@ export default class UserItem extends React.Component {
const teamUrl = TeamStore.getCurrentTeamUrl();
if (teamUrl) {
window.location.href = teamUrl;
browserHistory.push(teamUrl);
} else {
window.location.href = '/';
browserHistory.push('/');
}
},
(err) => {

View File

@@ -22,6 +22,7 @@ const TutorialSteps = Constants.TutorialSteps;
const Preferences = Constants.Preferences;
import React from 'react';
import {Link} from 'react-router';
export default class CenterPanel extends React.Component {
constructor(props) {
@@ -83,13 +84,13 @@ export default class CenterPanel extends React.Component {
id='archive-link-home'
onClick={handleClick}
>
<a href=''>
<Link to=''>
<FormattedMessage
id='center_panel.recent'
defaultMessage='Click here to jump to recent messages. '
/>
<i className='fa fa-arrow-down'></i>
</a>
</Link>
</div>
);
} else {

View File

@@ -5,6 +5,7 @@ import TeamStore from 'stores/team_store.jsx';
import React from 'react';
import {FormattedMessage} from 'react-intl';
import {Link} from 'react-router';
import logoImage from 'images/logo.png';
@@ -50,12 +51,12 @@ export default class Claim extends React.Component {
return (
<div>
<div className='signup-header'>
<a href='/'>
<Link to='/'>
<span className='fa fa-chevron-left'/>
<FormattedMessage
id='web.header.back'
/>
</a>
</Link>
</div>
<div className='col-sm-12'>
<div className='signup-team__container'>

View File

@@ -7,6 +7,7 @@ import * as Client from 'utils/client.jsx';
import React from 'react';
import ReactDOM from 'react-dom';
import {FormattedMessage} from 'react-intl';
import {browserHistory} from 'react-router';
export default class EmailToLDAP extends React.Component {
constructor(props) {
@@ -54,7 +55,7 @@ export default class EmailToLDAP extends React.Component {
Client.emailToLDAP(postData,
(data) => {
if (data.follow_link) {
window.location.href = data.follow_link;
browserHistory.push(data.follow_link);
}
},
(error) => {

View File

@@ -7,6 +7,7 @@ import * as Client from 'utils/client.jsx';
import React from 'react';
import ReactDOM from 'react-dom';
import {FormattedMessage} from 'react-intl';
import {browserHistory} from 'react-router';
export default class EmailToOAuth extends React.Component {
constructor(props) {
@@ -39,7 +40,7 @@ export default class EmailToOAuth extends React.Component {
Client.emailToOAuth(postData,
(data) => {
if (data.follow_link) {
window.location.href = data.follow_link;
browserHistory.push(data.follow_link);
}
},
(error) => {

View File

@@ -7,6 +7,7 @@ import * as Client from 'utils/client.jsx';
import React from 'react';
import ReactDOM from 'react-dom';
import {FormattedMessage} from 'react-intl';
import {browserHistory} from 'react-router';
export default class LDAPToEmail extends React.Component {
constructor(props) {
@@ -53,7 +54,7 @@ export default class LDAPToEmail extends React.Component {
Client.ldapToEmail(postData,
(data) => {
if (data.follow_link) {
window.location.href = data.follow_link;
browserHistory.push(data.follow_link);
}
},
(error) => {

View File

@@ -7,6 +7,7 @@ import * as Client from 'utils/client.jsx';
import React from 'react';
import ReactDOM from 'react-dom';
import {FormattedMessage} from 'react-intl';
import {browserHistory} from 'react-router';
export default class OAuthToEmail extends React.Component {
constructor(props) {
@@ -45,7 +46,7 @@ export default class OAuthToEmail extends React.Component {
Client.oauthToEmail(postData,
(data) => {
if (data.follow_link) {
window.location.href = data.follow_link;
browserHistory.push(data.follow_link);
}
},
(error) => {

View File

@@ -23,6 +23,7 @@ import PreferenceStore from 'stores/preference_store.jsx';
import Constants from 'utils/constants.jsx';
import {intlShape, injectIntl, defineMessages, FormattedHTMLMessage} from 'react-intl';
import {browserHistory} from 'react-router';
const Preferences = Constants.Preferences;
const TutorialSteps = Constants.TutorialSteps;
@@ -136,7 +137,7 @@ class CreatePost extends React.Component {
this.setState({messageText: '', submitting: false, postError: null, previews: [], serverError: null});
if (data.goto_location && data.goto_location.length > 0) {
window.location.href = data.goto_location;
browserHistory.push(data.goto_location);
}
},
(err) => {

View File

@@ -5,7 +5,7 @@ import {FormattedMessage} from 'react-intl';
import * as Client from 'utils/client.jsx';
import LoadingScreen from './loading_screen.jsx';
import {browserHistory} from 'react-router';
import {browserHistory, Link} from 'react-router';
import React from 'react';
@@ -43,12 +43,12 @@ export default class DoVerifyEmail extends React.Component {
return (
<div>
<div className='signup-header'>
<a href='/'>
<Link to='/'>
<span className='fa fa-chevron-left'/>
<FormattedMessage
id='web.header.back'
/>
</a>
</Link>
</div>
<div className='col-sm-12'>
<div className='signup-team__container'>

View File

@@ -5,6 +5,7 @@ import * as Utils from 'utils/utils.jsx';
import {defineMessages} from 'react-intl';
import React from 'react';
import {Link} from 'react-router';
const holders = defineMessages({
type: {
@@ -33,14 +34,14 @@ export default function FileInfoPreview({filename, fileUrl, fileInfo, formatMess
return (
<div className='file-details__container'>
<a
<Link
className={'file-details__preview'}
href={fileUrl}
to={fileUrl}
target='_blank'
>
<span className='file-details__preview-helper'/>
<img src={Utils.getPreviewImagePath(filename)}/>
</a>
</Link>
<div className='file-details'>
<div className='file-details__name'>{name}</div>
<div className='file-details__info'>{infoString}</div>

View File

@@ -11,7 +11,7 @@ import Constants from 'utils/constants.jsx';
import TeamStore from 'stores/team_store.jsx';
import {FormattedMessage} from 'react-intl';
import {browserHistory} from 'react-router';
import {browserHistory, Link} from 'react-router';
import React from 'react';
@@ -29,6 +29,8 @@ export default class Login extends React.Component {
Client.getMeLoggedIn((data) => {
if (data && data.logged_in !== 'false') {
browserHistory.push('/' + this.props.params.team + '/channels/town-square');
} else {
this.setState({doneCheckLogin: true}); //eslint-disable-line react/no-did-mount-set-state
}
});
}
@@ -37,7 +39,8 @@ export default class Login extends React.Component {
}
getStateFromStores() {
return {
currentTeam: TeamStore.getByName(this.props.params.team)
currentTeam: TeamStore.getByName(this.props.params.team),
doneCheckLogin: false
};
}
onTeamChange() {
@@ -45,7 +48,7 @@ export default class Login extends React.Component {
}
render() {
const currentTeam = this.state.currentTeam;
if (currentTeam == null) {
if (currentTeam == null || !this.state.doneCheckLogin) {
return <div/>;
}
@@ -57,10 +60,10 @@ export default class Login extends React.Component {
let loginMessage = [];
if (global.window.mm_config.EnableSignUpWithGitLab === 'true') {
loginMessage.push(
<a
<Link
className='btn btn-custom-login gitlab'
key='gitlab'
href={'/api/v1/oauth/gitlab/login?team=' + encodeURIComponent(teamName)}
to={'/api/v1/oauth/gitlab/login?team=' + encodeURIComponent(teamName)}
>
<span className='icon'/>
<span>
@@ -69,16 +72,16 @@ export default class Login extends React.Component {
defaultMessage='with GitLab'
/>
</span>
</a>
</Link>
);
}
if (global.window.mm_config.EnableSignUpWithGoogle === 'true') {
loginMessage.push(
<a
<Link
className='btn btn-custom-login google'
key='google'
href={'/api/v1/oauth/google/login?team=' + encodeURIComponent(teamName)}
to={'/api/v1/oauth/google/login?team=' + encodeURIComponent(teamName)}
>
<span className='icon'/>
<span>
@@ -87,7 +90,7 @@ export default class Login extends React.Component {
defaultMessage='with Google Apps'
/>
</span>
</a>
</Link>
);
}
@@ -154,12 +157,12 @@ export default class Login extends React.Component {
if (emailSignup) {
forgotPassword = (
<div className='form-group'>
<a href={'/' + teamName + '/reset_password'}>
<Link to={'/' + teamName + '/reset_password'}>
<FormattedMessage
id='login.forgot'
defaultMessage='I forgot my password'
/>
</a>
</Link>
</div>
);
}
@@ -173,15 +176,15 @@ export default class Login extends React.Component {
id='login.noAccount'
defaultMessage="Don't have an account? "
/>
<a
href={'/signup_user_complete/?id=' + currentTeam.invite_id}
<Link
to={'/signup_user_complete/?id=' + currentTeam.invite_id}
className='signup-team-login'
>
<FormattedMessage
id='login.create'
defaultMessage='Create one now'
/>
</a>
</Link>
</span>
</div>
);
@@ -191,15 +194,15 @@ export default class Login extends React.Component {
if (global.window.mm_config.EnableTeamCreation === 'true' && !Utils.isMobileApp()) {
teamSignUp = (
<div className='margin--extra'>
<a
href='/'
<Link
to='/'
className='signup-team-login'
>
<FormattedMessage
id='login.createTeam'
defaultMessage='Create a new team'
/>
</a>
</Link>
</div>
);
}
@@ -257,12 +260,12 @@ export default class Login extends React.Component {
return (
<div>
<div className='signup-header'>
<a href='/'>
<Link to='/'>
<span className='fa fa-chevron-left'/>
<FormattedMessage
id='web.header.back'
/>
</a>
</Link>
</div>
<div className='col-sm-12'>
<div className='signup-team__container'>

View File

@@ -79,7 +79,7 @@ class LoginEmail extends React.Component {
},
(err) => {
if (err.id === 'api.user.login.not_verified.app_error') {
window.location.href = '/verify_email?teamname=' + encodeURIComponent(name) + '&email=' + encodeURIComponent(email);
browserHistory.push('/verify_email?teamname=' + encodeURIComponent(name) + '&email=' + encodeURIComponent(email));
return;
}
state.serverError = err.message;

View File

@@ -5,6 +5,7 @@ import * as Utils from 'utils/utils.jsx';
import * as Client from 'utils/client.jsx';
import {injectIntl, intlShape, defineMessages, FormattedMessage} from 'react-intl';
import {browserHistory} from 'react-router';
const holders = defineMessages({
badTeam: {
@@ -74,9 +75,9 @@ class LoginLdap extends React.Component {
() => {
const redirect = Utils.getUrlParameter('redirect');
if (redirect) {
window.location.href = decodeURIComponent(redirect);
browserHistory.push(decodeURIComponent(redirect));
} else {
window.location.href = '/' + teamName + '/channels/town-square';
browserHistory.push('/' + teamName + '/channels/town-square');
}
},
(err) => {
@@ -141,4 +142,4 @@ LoginLdap.propTypes = {
teamName: React.PropTypes.string.isRequired
};
export default injectIntl(LoginLdap);
export default injectIntl(LoginLdap);

View File

@@ -6,6 +6,7 @@ import * as Client from 'utils/client.jsx';
import UserStore from 'stores/user_store.jsx';
import {injectIntl, intlShape, defineMessages, FormattedMessage} from 'react-intl';
import {browserHistory} from 'react-router';
var holders = defineMessages({
badTeam: {
@@ -85,9 +86,9 @@ export default class LoginUsername extends React.Component {
const redirect = Utils.getUrlParameter('redirect');
if (redirect) {
window.location.href = decodeURIComponent(redirect);
browserHistory.push(decodeURIComponent(redirect));
} else {
window.location.href = '/' + name + '/channels/town-square';
browserHistory.push('/' + name + '/channels/town-square');
}
},
(err) => {

View File

@@ -30,6 +30,8 @@ import {FormattedMessage} from 'react-intl';
import {Popover, OverlayTrigger} from 'react-bootstrap';
import {Link, browserHistory} from 'react-router';
import React from 'react';
export default class Navbar extends React.Component {
@@ -81,7 +83,7 @@ export default class Navbar extends React.Component {
Client.leaveChannel(this.state.channel.id,
() => {
AsyncClient.getChannels(true);
window.location.href = TeamStore.getCurrentTeamUrl() + '/channels/town-square';
browserHistory.push(TeamStore.getCurrentTeamUrl() + '/channels/town-square');
},
(err) => {
AsyncClient.dispatchError(err, 'handleLeave');
@@ -349,12 +351,12 @@ export default class Navbar extends React.Component {
return (
<div className='navbar-brand'>
<a
href={TeamStore.getCurrentTeamUrl() + '/channels/town-square'}
<Link
to={TeamStore.getCurrentTeamUrl() + '/channels/town-square'}
className='heading'
>
{channelTitle}
</a>
</Link>
</div>
);
}

View File

@@ -128,14 +128,14 @@ export default class NavbarDropdown extends React.Component {
if (isSystemAdmin) {
sysAdminLink = (
<li>
<a
href={'/admin_console'}
<Link
to={'/admin_console'}
>
<FormattedMessage
id='navbar_dropdown.console'
defaultMessage='System Console'
/>
</a>
</Link>
</li>
);
}
@@ -145,16 +145,16 @@ export default class NavbarDropdown extends React.Component {
if (global.window.mm_config.EnableTeamCreation === 'true') {
teams.push(
<li key='newTeam_li'>
<a
<Link
key='newTeam_a'
target='_blank'
href={Utils.getWindowLocationOrigin() + '/signup_team'}
to={Utils.getWindowLocationOrigin() + '/signup_team'}
>
<FormattedMessage
id='navbar_dropdown.create'
defaultMessage='Create a New Team'
/>
</a>
</Link>
</li>
);
}
@@ -163,15 +163,15 @@ export default class NavbarDropdown extends React.Component {
if (global.window.mm_config.HelpLink) {
helpLink = (
<li>
<a
<Link
target='_blank'
href={global.window.mm_config.HelpLink}
to={global.window.mm_config.HelpLink}
>
<FormattedMessage
id='navbar_dropdown.help'
defaultMessage='Help'
/>
</a>
</Link>
</li>
);
}
@@ -180,15 +180,15 @@ export default class NavbarDropdown extends React.Component {
if (global.window.mm_config.ReportAProblemLink) {
reportLink = (
<li>
<a
<Link
target='_blank'
href={global.window.mm_config.ReportAProblemLink}
to={global.window.mm_config.ReportAProblemLink}
>
<FormattedMessage
id='navbar_dropdown.report'
defaultMessage='Report a Problem'
/>
</a>
</Link>
</li>
);
}

View File

@@ -5,6 +5,7 @@ import $ from 'jquery';
import {FormattedMessage} from 'react-intl';
import React from 'react';
import {Link} from 'react-router';
export default class NotLoggedIn extends React.Component {
componentDidMount() {
@@ -29,34 +30,34 @@ export default class NotLoggedIn extends React.Component {
</div>
<div className='col-xs-12'>
<span className='pull-right footer-link copyright'>{'© 2015 Mattermost, Inc.'}</span>
<a
<Link
id='help_link'
className='pull-right footer-link'
href={global.window.mm_config.HelpLink}
to={global.window.mm_config.HelpLink}
>
<FormattedMessage id='web.footer.help'/>
</a>
<a
</Link>
<Link
id='terms_link'
className='pull-right footer-link'
href={global.window.mm_config.TermsOfServiceLink}
to={global.window.mm_config.TermsOfServiceLink}
>
<FormattedMessage id='web.footer.terms'/>
</a>
<a
</Link>
<Link
id='privacy_link'
className='pull-right footer-link'
href={global.window.mm_config.PrivacyPolicyLink}
to={global.window.mm_config.PrivacyPolicyLink}
>
<FormattedMessage id='web.footer.privacy'/>
</a>
<a
</Link>
<Link
id='about_link'
className='pull-right footer-link'
href={global.window.mm_config.AboutLink}
to={global.window.mm_config.AboutLink}
>
<FormattedMessage id='web.footer.about'/>
</a>
</Link>
</div>
</div>
</div>

View File

@@ -9,6 +9,7 @@ import * as client from 'utils/client.jsx';
import {FormattedMessage, FormattedHTMLMessage} from 'react-intl';
import React from 'react';
import {Link} from 'react-router';
class PasswordResetSendLink extends React.Component {
constructor(props) {
@@ -87,12 +88,12 @@ class PasswordResetSendLink extends React.Component {
return (
<div>
<div className='signup-header'>
<a href='/'>
<Link to='/'>
<span className='fa fa-chevron-left'/>
<FormattedMessage
id='web.header.back'
/>
</a>
</Link>
</div>
<div className='col-sm-12'>
<div className='signup-team__container'>

View File

@@ -5,6 +5,7 @@ import {FormattedMessage} from 'react-intl';
import * as Client from 'utils/client.jsx';
import React from 'react';
import {Link} from 'react-router';
export default class ShouldVerifyEmail extends React.Component {
constructor(props) {
@@ -63,12 +64,12 @@ export default class ShouldVerifyEmail extends React.Component {
return (
<div>
<div className='signup-header'>
<a href='/'>
<Link to='/'>
<span className='fa fa-chevron-left'/>
<FormattedMessage
id='web.header.back'
/>
</a>
</Link>
</div>
<div className='col-sm-12'>
<div className='signup-team__container'>

View File

@@ -29,6 +29,7 @@ import {Tooltip, OverlayTrigger} from 'react-bootstrap';
import loadingGif from 'images/load.gif';
import React from 'react';
import {browserHistory} from 'react-router';
import favicon from 'images/favicon/favicon-16x16.png';
import redFavicon from 'images/favicon/redfavicon-16x16.png';
@@ -407,7 +408,6 @@ export default class Sidebar extends React.Component {
// set up click handler to switch channels (or create a new channel for non-existant ones)
var handleClick = null;
var href = '#';
if (!channel.fake) {
handleClick = function clickHandler(e) {
@@ -440,7 +440,7 @@ export default class Sidebar extends React.Component {
},
() => {
this.setState({loadingDMChannel: -1});
window.location.href = '/' + this.state.currentTeam.name;
browserHistory('/' + this.state.currentTeam.name);
}
);
}
@@ -489,7 +489,7 @@ export default class Sidebar extends React.Component {
>
<a
className={rowClass}
href={href}
href={'#'}
onClick={handleClick}
>
{icon}

View File

@@ -101,15 +101,15 @@ export default class SidebarRightMenu extends React.Component {
if (isSystemAdmin && !Utils.isMobile()) {
consoleLink = (
<li>
<a
href={'/admin_console'}
<Link
to={'/admin_console'}
>
<i className='fa fa-wrench'></i>
<FormattedMessage
id='sidebar_right_menu.console'
defaultMessage='System Console'
/>
</a>
</Link>
</li>
);
}
@@ -127,16 +127,16 @@ export default class SidebarRightMenu extends React.Component {
if (global.window.mm_config.HelpLink) {
helpLink = (
<li>
<a
<Link
target='_blank'
href={global.window.mm_config.HelpLink}
to={global.window.mm_config.HelpLink}
>
<i className='fa fa-question'></i>
<FormattedMessage
id='sidebar_right_menu.help'
defaultMessage='Help'
/>
</a>
</Link>
</li>
);
}
@@ -145,16 +145,16 @@ export default class SidebarRightMenu extends React.Component {
if (global.window.mm_config.ReportAProblemLink) {
reportLink = (
<li>
<a
<Link
target='_blank'
href={global.window.mm_config.ReportAProblemLink}
to={global.window.mm_config.ReportAProblemLink}
>
<i className='fa fa-phone'></i>
<FormattedMessage
id='sidebar_right_menu.report'
defaultMessage='Report a Problem'
/>
</a>
</Link>
</li>
);
}
@@ -164,10 +164,12 @@ export default class SidebarRightMenu extends React.Component {
id='sidebar-menu'
>
<div className='team__header theme'>
<a
<Link
className='team__name'
href='/channels/town-square'
>{teamDisplayName}</a>
to='/channels/town-square'
>
{teamDisplayName}
</Link>
</div>
<div className='nav-pills__container'>

View File

@@ -12,6 +12,7 @@ import * as AsyncClient from 'utils/async_client.jsx';
import {FormattedMessage} from 'react-intl';
import React from 'react';
import {Link} from 'react-router';
import logoImage from 'images/logo.png';
@@ -109,15 +110,15 @@ export default class TeamSignUp extends React.Component {
key={'team_' + team.name}
className='signup-team-dir'
>
<a
href={'/' + team.name}
<Link
to={'/' + team.name}
>
<span className='signup-team-dir__name'>{team.display_name}</span>
<span
className='glyphicon glyphicon-menu-right right signup-team-dir__arrow'
aria-hidden='true'
/>
</a>
</Link>
</div>
);
}

View File

@@ -8,6 +8,7 @@ import {FormattedMessage} from 'react-intl';
import {browserHistory} from 'react-router';
import React from 'react';
import Link from 'react-router';
export default class SignupTeamComplete extends React.Component {
constructor(props) {
@@ -53,10 +54,10 @@ export default class SignupTeamComplete extends React.Component {
return (
<div>
<div className='signup-header'>
<a href='/'>
<Link to='/'>
<span classNameName='fa fa-chevron-left'/>
<FormattedMessage id='web.header.back'/>
</a>
</Link>
</div>
<div className='col-sm-12'>
<div className='signup-team__container'>

View File

@@ -76,7 +76,7 @@ class TeamSignupWelcomePage extends React.Component {
Client.signupTeam(email,
function success(data) {
if (data.follow_link) {
window.location.href = data.follow_link;
browserHistory.push(data.follow_link);
} else {
this.props.state.wizard = 'finished';
this.props.updateParent(this.props.state);

View File

@@ -2,6 +2,7 @@
// See License.txt for license information.
import {FormattedMessage, FormattedHTMLMessage} from 'react-intl';
import {Link} from 'react-router';
import React from 'react';
@@ -10,12 +11,12 @@ export default class SignupTeamConfirm extends React.Component {
return (
<div>
<div className='signup-header'>
<a href='/'>
<Link to='/'>
<span className='fa fa-chevron-left'/>
<FormattedMessage
id='web.header.back'
/>
</a>
</Link>
</div>
<div className='col-sm-12'>
<div classNameName='signup-team__container'>

View File

@@ -10,7 +10,7 @@ import Constants from 'utils/constants.jsx';
import LoadingScreen from 'components/loading_screen.jsx';
import {FormattedMessage, FormattedHTMLMessage} from 'react-intl';
import {browserHistory} from 'react-router';
import {browserHistory, Link} from 'react-router';
import React from 'react';
@@ -317,10 +317,10 @@ class SignupUserComplete extends React.Component {
var signupMessage = [];
if (global.window.mm_config.EnableSignUpWithGitLab === 'true') {
signupMessage.push(
<a
<Link
className='btn btn-custom-login gitlab'
key='gitlab'
href={'/api/v1/oauth/gitlab/signup' + window.location.search + '&team=' + encodeURIComponent(this.state.teamName)}
to={'/api/v1/oauth/gitlab/signup' + window.location.search + '&team=' + encodeURIComponent(this.state.teamName)}
>
<span className='icon'/>
<span>
@@ -329,16 +329,16 @@ class SignupUserComplete extends React.Component {
defaultMessage='with GitLab'
/>
</span>
</a>
</Link>
);
}
if (global.window.mm_config.EnableSignUpWithGoogle === 'true') {
signupMessage.push(
<a
<Link
className='btn btn-custom-login google'
key='google'
href={'/api/v1/oauth/google/signup' + window.location.search + '&team=' + encodeURIComponent(this.state.teamName)}
to={'/api/v1/oauth/google/signup' + window.location.search + '&team=' + encodeURIComponent(this.state.teamName)}
>
<span className='icon'/>
<span>
@@ -347,7 +347,7 @@ class SignupUserComplete extends React.Component {
defaultMessage='with Google'
/>
</span>
</a>
</Link>
);
}
@@ -442,10 +442,10 @@ class SignupUserComplete extends React.Component {
return (
<div>
<div className='signup-header'>
<a href='/'>
<Link to='/'>
<span classNameNameName='fa fa-chevron-left'/>
<FormattedMessage id='web.header.back'/>
</a>
</Link>
</div>
<div className='col-sm-12'>
<div className='signup-team__container padding--less'>

View File

@@ -6,6 +6,7 @@ import * as Client from 'utils/client.jsx';
import {FormattedMessage} from 'react-intl';
import React from 'react';
import {Link} from 'react-router';
export default class TeamExportTab extends React.Component {
constructor(props) {
@@ -54,15 +55,15 @@ export default class TeamExportTab extends React.Component {
id='team_export_tab.ready'
defaultMessage=' Ready for '
/>
<a
href={this.state.link}
<Link
to={this.state.link}
download={true}
>
<FormattedMessage
id='team_export_tab.download'
defaultMessage='download'
/>
</a>
</Link>
</p>
);
break;

View File

@@ -12,6 +12,7 @@ import TeamStore from 'stores/team_store.jsx';
import {FormattedMessage} from 'react-intl';
import React from 'react';
import {browserHistory} from 'react-router';
export default class TeamMembersDropdown extends React.Component {
constructor(props) {
@@ -119,9 +120,9 @@ export default class TeamMembersDropdown extends React.Component {
() => {
const teamUrl = TeamStore.getCurrentTeamUrl();
if (teamUrl) {
window.location.href = teamUrl;
browserHistory.push(teamUrl);
} else {
window.location.href = '/';
browserHistory.push('/');
}
},
(err) => {

View File

@@ -122,14 +122,6 @@ export default class ChooseAuthPage extends React.Component {
return (
<div>
{buttons}
<div className='form-group margin--extra-2x'>
<span><a href='/find_team'>
<FormattedMessage
id='choose_auth_page.find'
defaultMessage='Find my teams'
/>
</a></span>
</div>
</div>
);
}

View File

@@ -102,14 +102,6 @@ class EmailSignUpPage extends React.Component {
</button>
{serverError}
</div>
<div className='form-group margin--extra-2x'>
<span><a href='/find_team'>
<FormattedMessage
id='email_signup.find'
defaultMessage='Find my teams'
/>
</a></span>
</div>
</form>
);
}

View File

@@ -7,6 +7,7 @@ import * as utils from 'utils/utils.jsx';
import * as Client from 'utils/client.jsx';
import {injectIntl, intlShape, defineMessages, FormattedMessage} from 'react-intl';
import {browserHistory} from 'react-router';
const holders = defineMessages({
team_error: {
@@ -112,7 +113,7 @@ class LdapSignUpPage extends React.Component {
Client.loginByLdap(teamSignup.team.name, id, password,
() => {
window.location.href = '/' + teamSignup.team.name + '/channels/town-square';
browserHistory.push('/' + teamSignup.team.name + '/channels/town-square');
},
(err) => {
$('#ldap-button').button('reset');
@@ -218,14 +219,6 @@ class LdapSignUpPage extends React.Component {
</a>
{serverError}
</div>
<div className='form-group margin--extra-2x'>
<span><a href='/find_team'>
<FormattedMessage
id='ldap_signup.find'
defaultMessage='Find my teams'
/>
</a></span>
</div>
</form>
);
}
@@ -235,4 +228,4 @@ LdapSignUpPage.propTypes = {
intl: intlShape.isRequired
};
export default injectIntl(LdapSignUpPage);
export default injectIntl(LdapSignUpPage);

View File

@@ -24,6 +24,7 @@ const holders = defineMessages({
});
import React from 'react';
import {browserHistory} from 'react-router';
class SSOSignUpPage extends React.Component {
constructor(props) {
@@ -63,9 +64,9 @@ class SSOSignUpPage extends React.Component {
this.props.service,
(data) => {
if (data.follow_link) {
window.location.href = data.follow_link;
browserHistory.push(data.follow_link);
} else {
window.location.href = '/' + team.name + '/channels/town-square';
browserHistory.push('/' + team.name + '/channels/town-square');
}
},
(err) => {
@@ -157,14 +158,6 @@ class SSOSignUpPage extends React.Component {
{button}
{serverError}
</div>
<div className='form-group margin--extra-2x'>
<span><a href='/find_team'>
<FormattedMessage
id='sso_signup.find'
defaultMessage='Find my teams'
/>
</a></span>
</div>
</form>
);
}
@@ -178,4 +171,4 @@ SSOSignUpPage.propTypes = {
service: React.PropTypes.string
};
export default injectIntl(SSOSignUpPage);
export default injectIntl(SSOSignUpPage);

View File

@@ -7,6 +7,7 @@ import ChannelStore from 'stores/channel_store.jsx';
const ytRegex = /(?:http|https):\/\/(?:www\.)?(?:(?:youtube\.com\/(?:(?:v\/)|(\/u\/\w\/)|(?:(?:watch|embed\/watch)(?:\/|.*v=))|(?:embed\/)|(?:user\/[^\/]+\/u\/[0-9]\/)))|(?:youtu\.be\/))([^#\&\?]*)/;
import React from 'react';
import {Link} from 'react-router';
export default class YoutubeVideo extends React.Component {
constructor(props) {
@@ -156,7 +157,7 @@ export default class YoutubeVideo extends React.Component {
<div>
<h4>
<span className='video-type'>{header}</span>
<span className='video-title'><a href={this.props.link}>{this.state.title}</a></span>
<span className='video-title'><Link to={this.props.link}>{this.state.title}</Link></span>
</h4>
<div
className='video-div embed-responsive-item'

View File

@@ -17,6 +17,7 @@ import * as client from './client.jsx';
import Autolinker from 'autolinker';
import React from 'react';
import {browserHistory} from 'react-router';
import {FormattedTime} from 'react-intl';
import icon50 from 'images/icon50x50.png';
@@ -170,7 +171,7 @@ export function notifyMe(title, body, channel) {
if (channel) {
switchChannel(channel);
} else {
window.location.href = TeamStore.getCurrentTeamUrl() + '/channels/town-square';
browserHistory.push(TeamStore.getCurrentTeamUrl() + '/channels/town-square');
}
};
setTimeout(() => {
@@ -1303,7 +1304,7 @@ export function openDirectChannelToUser(user, successCb, errorCb) {
}
},
() => {
window.location.href = TeamStore.getCurrentTeamUrl() + '/channels/' + channelName;
browserHistory.push(TeamStore.getCurrentTeamUrl() + '/channels/' + channelName);
if ($.isFunction(errorCb)) {
errorCb();
}