Этот коммит содержится в:
Christopher Speller
2016-06-22 10:30:01 -04:00
коммит произвёл GitHub
родитель 00dc8e734c
Коммит 14510ce194
65 изменённых файлов: 741 добавлений и 615 удалений

Просмотреть файл

@@ -1,7 +1,7 @@
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
import * as Utils from 'utils/utils.jsx';
import TeamStore from 'stores/team_store.jsx';
import UserStore from 'stores/user_store.jsx';

Просмотреть файл

@@ -20,7 +20,7 @@ import * as I18n from 'i18n/i18n.jsx';
import {trackPage} from 'actions/analytics_actions.jsx';
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
import en from 'i18n/en.json';

Просмотреть файл

@@ -10,7 +10,7 @@ import * as AsyncClient from 'utils/async_client.jsx';
import Client from 'utils/web_client.jsx';
import AppDispatcher from 'dispatcher/app_dispatcher.jsx';
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
export function checkIfTeamExists(teamName, onSuccess, onError) {
Client.findTeamByName(teamName, onSuccess, onError);

Просмотреть файл

@@ -18,7 +18,7 @@ import * as GlobalActions from 'actions/global_actions.jsx';
import Constants from 'utils/constants.jsx';
const SocketEvents = Constants.SocketEvents;
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
const MAX_WEBSOCKET_FAILS = 7;
const WEBSOCKET_RETRY_TIME = 3000;

Просмотреть файл

@@ -10,7 +10,7 @@ import * as GlobalActions from 'actions/global_actions.jsx';
import {FormattedMessage} from 'react-intl';
import {Link} from 'react-router';
import {Link} from 'react-router/es6';
import React from 'react';

Просмотреть файл

@@ -11,7 +11,7 @@ import * as Utils from 'utils/utils.jsx';
import AdminSidebarHeader from './admin_sidebar_header.jsx';
import AdminSidebarTeam from './admin_sidebar_team.jsx';
import {FormattedMessage} from 'react-intl';
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
import {OverlayTrigger, Tooltip} from 'react-bootstrap';
import SelectTeamModal from './select_team_modal.jsx';
import AdminSidebarCategory from './admin_sidebar_category.jsx';

Просмотреть файл

@@ -3,7 +3,7 @@
import React from 'react';
import {Link} from 'react-router';
import {Link} from 'react-router/es6';
export default class AdminSidebarCategory extends React.Component {
static get propTypes() {

Просмотреть файл

@@ -3,7 +3,7 @@
import React from 'react';
import {Link} from 'react-router';
import {Link} from 'react-router/es6';
export default class AdminSidebarSection extends React.Component {
static get propTypes() {

Просмотреть файл

@@ -10,7 +10,7 @@ import TeamStore from 'stores/team_store.jsx';
import {FormattedMessage, FormattedHTMLMessage} from 'react-intl';
import React from 'react';
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
export default class UserItem extends React.Component {
constructor(props) {

Просмотреть файл

@@ -9,7 +9,7 @@ import * as Utils from 'utils/utils.jsx';
import BackstageHeader from './backstage_header.jsx';
import {FormattedMessage} from 'react-intl';
import FormError from 'components/form_error.jsx';
import {browserHistory, Link} from 'react-router';
import {browserHistory, Link} from 'react-router/es6';
import SpinnerButton from 'components/spinner_button.jsx';
import Constants from 'utils/constants.jsx';

Просмотреть файл

@@ -10,7 +10,7 @@ import BackstageHeader from './backstage_header.jsx';
import ChannelSelect from 'components/channel_select.jsx';
import {FormattedMessage} from 'react-intl';
import FormError from 'components/form_error.jsx';
import {browserHistory, Link} from 'react-router';
import {browserHistory, Link} from 'react-router/es6';
import SpinnerButton from 'components/spinner_button.jsx';
export default class AddIncomingWebhook extends React.Component {

Просмотреть файл

@@ -10,7 +10,7 @@ import BackstageHeader from './backstage_header.jsx';
import ChannelSelect from 'components/channel_select.jsx';
import {FormattedMessage} from 'react-intl';
import FormError from 'components/form_error.jsx';
import {browserHistory, Link} from 'react-router';
import {browserHistory, Link} from 'react-router/es6';
import SpinnerButton from 'components/spinner_button.jsx';
export default class AddOutgoingWebhook extends React.Component {

Просмотреть файл

@@ -3,7 +3,7 @@
import React from 'react';
import {Link} from 'react-router';
import {Link} from 'react-router/es6';
export default class BackstageCategory extends React.Component {
static get propTypes() {

Просмотреть файл

@@ -8,7 +8,7 @@ import React from 'react';
import TeamStore from 'stores/team_store.jsx';
import {FormattedMessage} from 'react-intl';
import {Link} from 'react-router';
import {Link} from 'react-router/es6';
export default class BackstageNavbar extends React.Component {
constructor(props) {

Просмотреть файл

@@ -3,7 +3,7 @@
import React from 'react';
import {Link} from 'react-router';
import {Link} from 'react-router/es6';
export default class BackstageSection extends React.Component {
static get propTypes() {

Просмотреть файл

@@ -5,7 +5,7 @@ import React from 'react';
import * as Utils from 'utils/utils.jsx';
import {Link} from 'react-router';
import {Link} from 'react-router/es6';
import LoadingScreen from 'components/loading_screen.jsx';
export default class InstalledIntegrations extends React.Component {

Просмотреть файл

@@ -3,7 +3,7 @@
import React from 'react';
import {Link} from 'react-router';
import {Link} from 'react-router/es6';
export default class IntegrationOption extends React.Component {
static get propTypes() {

Просмотреть файл

@@ -31,7 +31,7 @@ import Client from 'utils/web_client.jsx';
import Constants from 'utils/constants.jsx';
import {FormattedMessage} from 'react-intl';
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
const ActionTypes = Constants.ActionTypes;

Просмотреть файл

@@ -3,7 +3,7 @@
import React from 'react';
import {FormattedMessage} from 'react-intl';
import {Link} from 'react-router';
import {Link} from 'react-router/es6';
import logoImage from 'images/logo.png';

Просмотреть файл

@@ -7,7 +7,7 @@ import Client from 'utils/web_client.jsx';
import React from 'react';
import ReactDOM from 'react-dom';
import {FormattedMessage} from 'react-intl';
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
export default class OAuthToEmail extends React.Component {
constructor(props) {

Просмотреть файл

@@ -24,7 +24,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';
import {browserHistory} from 'react-router/es6';
const Preferences = Constants.Preferences;
const TutorialSteps = Constants.TutorialSteps;

Просмотреть файл

@@ -10,7 +10,7 @@ import logoImage from 'images/logo.png';
import React from 'react';
import ReactDOM from 'react-dom';
import {Link} from 'react-router';
import {Link} from 'react-router/es6';
import {FormattedMessage} from 'react-intl';
export default class TeamSignupDisplayNamePage extends React.Component {

Просмотреть файл

@@ -4,7 +4,7 @@
import ErrorBar from 'components/error_bar.jsx';
import {FormattedMessage} from 'react-intl';
import {browserHistory, Link} from 'react-router';
import {browserHistory, Link} from 'react-router/es6';
import React from 'react';

Просмотреть файл

@@ -9,7 +9,7 @@ import Constants from 'utils/constants.jsx';
import {FormattedMessage} from 'react-intl';
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
import React from 'react';

Просмотреть файл

@@ -5,7 +5,7 @@ import {FormattedMessage} from 'react-intl';
import Client from 'utils/web_client.jsx';
import LoadingScreen from './loading_screen.jsx';
import {browserHistory, Link} from 'react-router';
import {browserHistory, Link} from 'react-router/es6';
import React from 'react';

Просмотреть файл

@@ -4,7 +4,7 @@
import $ from 'jquery';
import React from 'react';
import {Link} from 'react-router';
import {Link} from 'react-router/es6';
import * as Utils from 'utils/utils.jsx';

Просмотреть файл

@@ -5,7 +5,7 @@ import * as Utils from 'utils/utils.jsx';
import {defineMessages} from 'react-intl';
import React from 'react';
import {Link} from 'react-router';
import {Link} from 'react-router/es6';
const holders = defineMessages({
type: {

Просмотреть файл

@@ -11,7 +11,7 @@ import * as Utils from 'utils/utils.jsx';
import * as Websockets from 'actions/websocket_actions.jsx';
import Constants from 'utils/constants.jsx';
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
const CLIENT_STATUS_INTERVAL = 30000;
const BACKSPACE_CHAR = 8;

Просмотреть файл

@@ -16,7 +16,7 @@ import * as Utils from 'utils/utils.jsx';
import Constants from 'utils/constants.jsx';
import {FormattedMessage} from 'react-intl';
import {browserHistory, Link} from 'react-router';
import {browserHistory, Link} from 'react-router/es6';
import React from 'react';
import logoImage from 'images/logo.png';

Просмотреть файл

@@ -12,7 +12,7 @@ import * as AsyncClient from 'utils/async_client.jsx';
import * as GlobalActions from 'actions/global_actions.jsx';
import {FormattedMessage} from 'react-intl';
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
import React from 'react';
import ReactDOM from 'react-dom';

Просмотреть файл

@@ -9,7 +9,7 @@ import * as Utils from 'utils/utils.jsx';
import * as GlobalActions from 'actions/global_actions.jsx';
import {FormattedMessage} from 'react-intl';
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
import SpinnerButton from 'components/spinner_button.jsx';
import LoadingScreen from 'components/loading_screen.jsx';

Просмотреть файл

@@ -33,7 +33,7 @@ import {FormattedMessage} from 'react-intl';
import {Popover, OverlayTrigger} from 'react-bootstrap';
import {Link, browserHistory} from 'react-router';
import {Link, browserHistory} from 'react-router/es6';
import React from 'react';

Просмотреть файл

@@ -16,7 +16,7 @@ import UserSettingsModal from './user_settings/user_settings_modal.jsx';
import Constants from 'utils/constants.jsx';
import {FormattedMessage} from 'react-intl';
import {Link} from 'react-router';
import {Link} from 'react-router/es6';
import React from 'react';

Просмотреть файл

@@ -5,7 +5,7 @@ import React from 'react';
import $ from 'jquery';
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
import * as Utils from 'utils/utils.jsx';
import * as AsyncClient from 'utils/async_client.jsx';
import TeamStore from 'stores/team_store.jsx';

Просмотреть файл

@@ -9,7 +9,7 @@ import NewChannelModal from './new_channel_modal.jsx';
import ChangeURLModal from './change_url_modal.jsx';
import {intlShape, injectIntl, defineMessages} from 'react-intl';
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
import AppDispatcher from '../dispatcher/app_dispatcher.jsx';
import Constants from 'utils/constants.jsx';

Просмотреть файл

@@ -7,7 +7,7 @@ import * as Utils from 'utils/utils.jsx';
import Constants from 'utils/constants.jsx';
import {FormattedMessage} from 'react-intl';
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
import React from 'react';

Просмотреть файл

@@ -9,7 +9,7 @@ import client from 'utils/web_client.jsx';
import {FormattedMessage, FormattedHTMLMessage} from 'react-intl';
import React from 'react';
import {Link} from 'react-router';
import {Link} from 'react-router/es6';
class PasswordResetSendLink extends React.Component {
constructor(props) {

Просмотреть файл

@@ -10,7 +10,7 @@ import PostFocusViewController from 'components/post_view/post_focus_view_contro
import ChannelStore from 'stores/channel_store.jsx';
import TeamStore from 'stores/team_store.jsx';
import {Link} from 'react-router';
import {Link} from 'react-router/es6';
import {FormattedMessage} from 'react-intl';
export default class PermalinkView extends React.Component {

Просмотреть файл

@@ -10,7 +10,7 @@ import Constants from 'utils/constants.jsx';
import Client from 'utils/web_client.jsx';
import {FormattedMessage} from 'react-intl';
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
import React from 'react';

Просмотреть файл

@@ -9,7 +9,7 @@ import BrowserStore from 'stores/browser_store.jsx';
import * as Utils from 'utils/utils.jsx';
import {FormattedMessage} from 'react-intl';
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
import React from 'react';

Просмотреть файл

@@ -14,7 +14,7 @@ import React from 'react';
import FastClick from 'fastclick';
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
import UserStore from 'stores/user_store.jsx';
export default class Root extends React.Component {

Просмотреть файл

@@ -16,7 +16,7 @@ const ActionTypes = Constants.ActionTypes;
import {FormattedMessage, FormattedDate} from 'react-intl';
import React from 'react';
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
export default class SearchResultsItem extends React.Component {
constructor(props) {

Просмотреть файл

@@ -9,7 +9,7 @@ import LoadingScreen from 'components/loading_screen.jsx';
import * as AsyncClient from 'utils/async_client.jsx';
import * as GlobalActions from 'actions/global_actions.jsx';
import {Link} from 'react-router';
import {Link} from 'react-router/es6';
import {FormattedMessage} from 'react-intl';

Просмотреть файл

@@ -5,7 +5,7 @@ import {FormattedMessage} from 'react-intl';
import Client from 'utils/web_client.jsx';
import React from 'react';
import {Link} from 'react-router';
import {Link} from 'react-router/es6';
export default class ShouldVerifyEmail extends React.Component {
constructor(props) {

Просмотреть файл

@@ -30,7 +30,7 @@ import {Tooltip, OverlayTrigger} from 'react-bootstrap';
import loadingGif from 'images/load.gif';
import React from 'react';
import {browserHistory, Link} from 'react-router';
import {browserHistory, Link} from 'react-router/es6';
import favicon from 'images/favicon/favicon-16x16.png';
import redFavicon from 'images/favicon/redfavicon-16x16.png';

Просмотреть файл

@@ -20,7 +20,7 @@ const Preferences = Constants.Preferences;
const TutorialSteps = Constants.TutorialSteps;
import {FormattedMessage} from 'react-intl';
import {Link} from 'react-router';
import {Link} from 'react-router/es6';
import {createMenuTip} from 'components/tutorial/tutorial_tip.jsx';
import React from 'react';

Просмотреть файл

@@ -6,7 +6,7 @@ import BrowserStore from 'stores/browser_store.jsx';
import {FormattedMessage} from 'react-intl';
import React from 'react';
import {Link, browserHistory} from 'react-router';
import {Link, browserHistory} from 'react-router/es6';
export default class SignupTeamComplete extends React.Component {
constructor(props) {

Просмотреть файл

@@ -17,7 +17,7 @@ import Constants from 'utils/constants.jsx';
import React from 'react';
import ReactDOM from 'react-dom';
import {FormattedMessage, FormattedHTMLMessage} from 'react-intl';
import {browserHistory, Link} from 'react-router';
import {browserHistory, Link} from 'react-router/es6';
import logoImage from 'images/logo.png';

Просмотреть файл

@@ -6,7 +6,7 @@ import Client from 'utils/web_client.jsx';
import {FormattedMessage} from 'react-intl';
import React from 'react';
import {Link} from 'react-router';
import {Link} from 'react-router/es6';
export default class TeamExportTab extends React.Component {
constructor(props) {

Просмотреть файл

@@ -12,7 +12,7 @@ import TeamStore from 'stores/team_store.jsx';
import {FormattedMessage} from 'react-intl';
import React from 'react';
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
export default class TeamMembersDropdown extends React.Component {
constructor(props) {

Просмотреть файл

@@ -10,7 +10,7 @@ import * as GlobalActions from 'actions/global_actions.jsx';
import Constants from 'utils/constants.jsx';
import {FormattedMessage, FormattedHTMLMessage} from 'react-intl';
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
const Preferences = Constants.Preferences;

Просмотреть файл

@@ -17,7 +17,7 @@ import * as Utils from 'utils/utils.jsx';
import Constants from 'utils/constants.jsx';
import {intlShape, injectIntl, defineMessages, FormattedMessage, FormattedHTMLMessage, FormattedTime, FormattedDate} from 'react-intl';
import {Link} from 'react-router';
import {Link} from 'react-router/es6';
const holders = defineMessages({
currentPasswordError: {

Просмотреть файл

@@ -64,7 +64,7 @@
"sass-loader": "3.2.0",
"style-loader": "0.13.1",
"url-loader": "0.5.7",
"webpack": "2.1.0-beta.7",
"webpack": "2.1.0-beta.13",
"webpack-node-externals": "1.2.0"
},
"scripts": {

Просмотреть файл

@@ -4,106 +4,21 @@
import $ from 'jquery';
require('perfect-scrollbar/jquery')($);
import React from 'react';
import ReactDOM from 'react-dom';
import {Router, browserHistory} from 'react-router/es6';
import * as GlobalActions from 'actions/global_actions.jsx';
import * as Websockets from 'actions/websocket_actions.jsx';
import BrowserStore from 'stores/browser_store.jsx';
import * as I18n from 'i18n/i18n.jsx';
// Import our styles
import 'bootstrap-colorpicker/dist/css/bootstrap-colorpicker.css';
import 'google-fonts/google-fonts.css';
import 'sass/styles.scss';
import React from 'react';
import ReactDOM from 'react-dom';
import {IndexRedirect, Router, Route, IndexRoute, Redirect, browserHistory} from 'react-router';
import Root from 'components/root.jsx';
import LoggedIn from 'components/logged_in.jsx';
import HeaderFooterTemplate from 'components/header_footer_template.jsx';
import NeedsTeam from 'components/needs_team.jsx';
import PasswordResetSendLink from 'components/password_reset_send_link.jsx';
import PasswordResetForm from 'components/password_reset_form.jsx';
import ChannelView from 'components/channel_view.jsx';
import PermalinkView from 'components/permalink_view.jsx';
import Sidebar from 'components/sidebar.jsx';
import * as AsyncClient from 'utils/async_client.jsx';
import ChannelStore from 'stores/channel_store.jsx';
import ErrorStore from 'stores/error_store.jsx';
import TeamStore from 'stores/team_store.jsx';
import BrowserStore from 'stores/browser_store.jsx';
import * as Utils from 'utils/utils.jsx';
import Client from 'utils/web_client.jsx';
import * as Websockets from 'actions/websocket_actions.jsx';
import * as GlobalActions from 'actions/global_actions.jsx';
import SignupUserComplete from 'components/signup_user_complete.jsx';
import ShouldVerifyEmail from 'components/should_verify_email.jsx';
import DoVerifyEmail from 'components/do_verify_email.jsx';
import TutorialView from 'components/tutorial/tutorial_view.jsx';
import BackstageNavbar from 'components/backstage/backstage_navbar.jsx';
import BackstageSidebar from 'components/backstage/backstage_sidebar.jsx';
import Integrations from 'components/backstage/integrations.jsx';
import InstalledIncomingWebhooks from 'components/backstage/installed_incoming_webhooks.jsx';
import InstalledOutgoingWebhooks from 'components/backstage/installed_outgoing_webhooks.jsx';
import InstalledCommands from 'components/backstage/installed_commands.jsx';
import AddIncomingWebhook from 'components/backstage/add_incoming_webhook.jsx';
import AddOutgoingWebhook from 'components/backstage/add_outgoing_webhook.jsx';
import AddCommand from 'components/backstage/add_command.jsx';
import ErrorPage from 'components/error_page.jsx';
import AppDispatcher from './dispatcher/app_dispatcher.jsx';
import Constants from './utils/constants.jsx';
const ActionTypes = Constants.ActionTypes;
import AdminConsole from 'components/admin_console/admin_console.jsx';
import SystemAnalytics from 'components/analytics/system_analytics.jsx';
import ConfigurationSettings from 'components/admin_console/configuration_settings.jsx';
import LocalizationSettings from 'components/admin_console/localization_settings.jsx';
import UsersAndTeamsSettings from 'components/admin_console/users_and_teams_settings.jsx';
import PrivacySettings from 'components/admin_console/privacy_settings.jsx';
import LogSettings from 'components/admin_console/log_settings.jsx';
import EmailAuthenticationSettings from 'components/admin_console/email_authentication_settings.jsx';
import GitLabSettings from 'components/admin_console/gitlab_settings.jsx';
import LdapSettings from 'components/admin_console/ldap_settings.jsx';
import SignupSettings from 'components/admin_console/signup_settings.jsx';
import LoginSettings from 'components/admin_console/login_settings.jsx';
import PublicLinkSettings from 'components/admin_console/public_link_settings.jsx';
import SessionSettings from 'components/admin_console/session_settings.jsx';
import ConnectionSettings from 'components/admin_console/connection_settings.jsx';
import EmailSettings from 'components/admin_console/email_settings.jsx';
import PushSettings from 'components/admin_console/push_settings.jsx';
import WebhookSettings from 'components/admin_console/webhook_settings.jsx';
import ExternalServiceSettings from 'components/admin_console/external_service_settings.jsx';
import DatabaseSettings from 'components/admin_console/database_settings.jsx';
import StorageSettings from 'components/admin_console/storage_settings.jsx';
import ImageSettings from 'components/admin_console/image_settings.jsx';
import CustomBrandSettings from 'components/admin_console/custom_brand_settings.jsx';
import CustomEmojiSettings from 'components/admin_console/custom_emoji_settings.jsx';
import LegalAndSupportSettings from 'components/admin_console/legal_and_support_settings.jsx';
import ComplianceSettings from 'components/admin_console/compliance_settings.jsx';
import RateSettings from 'components/admin_console/rate_settings.jsx';
import DeveloperSettings from 'components/admin_console/developer_settings.jsx';
import TeamUsers from 'components/admin_console/team_users.jsx';
import TeamAnalytics from 'components/analytics/team_analytics.jsx';
import LicenseSettings from 'components/admin_console/license_settings.jsx';
import Audits from 'components/admin_console/audits.jsx';
import Logs from 'components/admin_console/logs.jsx';
import ClaimController from 'components/claim/claim_controller.jsx';
import EmailToOAuth from 'components/claim/components/email_to_oauth.jsx';
import OAuthToEmail from 'components/claim/components/oauth_to_email.jsx';
import LDAPToEmail from 'components/claim/components/ldap_to_email.jsx';
import EmailToLDAP from 'components/claim/components/email_to_ldap.jsx';
import LoginController from 'components/login/login_controller.jsx';
import SelectTeam from 'components/select_team/select_team.jsx';
import CreateTeamController from 'components/create_team/create_team_controller.jsx';
import CreateTeamDisplayName from 'components/create_team/components/display_name.jsx';
import CreateTeamTeamUrl from 'components/create_team/components/team_url.jsx';
import * as I18n from 'i18n/i18n.jsx';
const notFoundParams = {
title: Utils.localizeMessage('error.not_found.title', 'Page not found'),
message: Utils.localizeMessage('error.not_found.message', 'The page you were trying to reach does not exist'),
link: '/',
linkmessage: Utils.localizeMessage('error.not_found.link_message', 'Back to Mattermost')
};
// Import the root of our routing tree
import rRoot from 'routes/route_root.jsx';
// This is for anything that needs to be done for ALL react components.
// This runs before we start to render anything.
@@ -157,470 +72,12 @@ function preRenderSetup(callwhendone) {
}
}
function preLoggedIn(nextState, replace, callback) {
ErrorStore.clearLastError();
callback();
}
function preNeedsTeam(nextState, replace, callback) {
// First check to make sure you're in the current team
// for the current url.
var teamName = Utils.getTeamNameFromUrl();
var team = TeamStore.getByName(teamName);
const oldTeamId = TeamStore.getCurrentId();
if (!team) {
browserHistory.push('/');
return;
}
GlobalActions.emitCloseRightHandSide();
TeamStore.saveMyTeam(team);
TeamStore.emitChange();
// If the old team id is null then we will already have the direct
// profiles from initial load
if (oldTeamId != null) {
AsyncClient.getDirectProfiles();
}
var d1 = $.Deferred(); //eslint-disable-line new-cap
var d2 = $.Deferred(); //eslint-disable-line new-cap
Client.getChannels(
(data) => {
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_CHANNELS,
channels: data.channels,
members: data.members
});
d1.resolve();
},
(err) => {
AsyncClient.dispatchError(err, 'getChannels');
d1.resolve();
}
);
Client.getProfiles(
(data) => {
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_PROFILES,
profiles: data
});
d2.resolve();
},
(err) => {
AsyncClient.dispatchError(err, 'getProfiles');
d2.resolve();
}
);
$.when(d1, d2).done(() => {
callback();
});
}
function onPermalinkEnter(nextState) {
const postId = nextState.params.postid;
GlobalActions.emitPostFocusEvent(postId);
}
function onChannelEnter(nextState, replace, callback) {
doChannelChange(nextState, replace, callback);
}
function doChannelChange(state, replace, callback) {
let channel;
if (state.location.query.fakechannel) {
channel = JSON.parse(state.location.query.fakechannel);
} else {
channel = ChannelStore.getByName(state.params.channel);
if (!channel) {
channel = ChannelStore.getMoreByName(state.params.channel);
}
if (!channel) {
Client.joinChannelByName(
state.params.channel,
(data) => {
GlobalActions.emitChannelClickEvent(data);
callback();
},
() => {
if (state.params.team) {
replace('/' + state.params.team + '/channels/town-square');
} else {
replace('/');
}
callback();
}
);
return;
}
}
GlobalActions.emitChannelClickEvent(channel);
callback();
}
function renderRootComponent() {
ReactDOM.render((
<Router
history={browserHistory}
>
<Route
path='/'
component={Root}
>
<Route
path='error'
component={ErrorPage}
/>
<Route component={HeaderFooterTemplate}>
<Route
path='login'
component={LoginController}
/>
<Route
path='reset_password'
component={PasswordResetSendLink}
/>
<Route
path='reset_password_complete'
component={PasswordResetForm}
/>
<Route
path='claim'
component={ClaimController}
>
<Route
path='oauth_to_email'
component={OAuthToEmail}
/>
<Route
path='email_to_oauth'
component={EmailToOAuth}
/>
<Route
path='email_to_ldap'
component={EmailToLDAP}
/>
<Route
path='ldap_to_email'
component={LDAPToEmail}
/>
</Route>
<Route
path='signup_user_complete'
component={SignupUserComplete}
/>
<Route
path='should_verify_email'
component={ShouldVerifyEmail}
/>
<Route
path='do_verify_email'
component={DoVerifyEmail}
/>
</Route>
<Route
component={LoggedIn}
onEnter={preLoggedIn}
>
<Route component={HeaderFooterTemplate}>
<Route
path='select_team'
component={SelectTeam}
/>
<Route
path='create_team'
component={CreateTeamController}
>
<IndexRoute component={CreateTeamDisplayName}/>
<Route
path='display_name'
component={CreateTeamDisplayName}
/>
<Route
path='team_url'
component={CreateTeamTeamUrl}
/>
</Route>
</Route>
<Route
path='admin_console'
component={AdminConsole}
>
<IndexRedirect to='system_analytics'/>
<Route
path='system_analytics'
component={SystemAnalytics}
/>
<Route path='general'>
<IndexRedirect to='configuration'/>
<Route
path='configuration'
component={ConfigurationSettings}
/>
<Route
path='localization'
component={LocalizationSettings}
/>
<Route
path='users_and_teams'
component={UsersAndTeamsSettings}
/>
<Route
path='privacy'
component={PrivacySettings}
/>
<Route
path='compliance'
component={ComplianceSettings}
/>
<Route
path='logging'
component={LogSettings}
/>
</Route>
<Route path='authentication'>
<IndexRedirect to='email'/>
<Route
path='email'
component={EmailAuthenticationSettings}
/>
<Route
path='gitlab'
component={GitLabSettings}
/>
<Route
path='ldap'
component={LdapSettings}
/>
</Route>
<Route path='security'>
<IndexRedirect to='sign_up'/>
<Route
path='sign_up'
component={SignupSettings}
/>
<Route
path='login'
component={LoginSettings}
/>
<Route
path='public_links'
component={PublicLinkSettings}
/>
<Route
path='sessions'
component={SessionSettings}
/>
<Route
path='connections'
component={ConnectionSettings}
/>
</Route>
<Route path='notifications'>
<IndexRedirect to='email'/>
<Route
path='email'
component={EmailSettings}
/>
<Route
path='push'
component={PushSettings}
/>
</Route>
<Route path='integrations'>
<IndexRedirect to='webhooks'/>
<Route
path='webhooks'
component={WebhookSettings}
/>
<Route
path='external'
component={ExternalServiceSettings}
/>
</Route>
<Route path='files'>
<IndexRedirect to='storage'/>
<Route
path='storage'
component={StorageSettings}
/>
<Route
path='images'
component={ImageSettings}
/>
</Route>
<Route path='customization'>
<IndexRedirect to='custom_brand'/>
<Route
path='custom_brand'
component={CustomBrandSettings}
/>
<Route
path='custom_emoji'
component={CustomEmojiSettings}
/>
<Route
path='legal_and_support'
component={LegalAndSupportSettings}
/>
</Route>
<Route path='advanced'>
<IndexRedirect to='rate'/>
<Route
path='rate'
component={RateSettings}
/>
<Route
path='database'
component={DatabaseSettings}
/>
<Route
path='developer'
component={DeveloperSettings}
/>
</Route>
<Route path='team'>
<Redirect
from=':team'
to=':team/users'
/>
<Route
path=':team/users'
component={TeamUsers}
/>
<Route
path=':team/analytics'
component={TeamAnalytics}
/>
<Redirect
from='*'
to='/error'
query={notFoundParams}
/>
</Route>
<Route
path='license'
component={LicenseSettings}
/>
<Route
path='audits'
component={Audits}
/>
<Route
path='logs'
component={Logs}
/>
</Route>
<Route
path=':team'
component={NeedsTeam}
onEnter={preNeedsTeam}
>
<IndexRedirect to='channels/town-square'/>
<Route
path='channels/:channel'
onEnter={onChannelEnter}
components={{
sidebar: Sidebar,
center: ChannelView
}}
/>
<Route
path='pl/:postid'
onEnter={onPermalinkEnter}
components={{
sidebar: Sidebar,
center: PermalinkView
}}
/>
<Route
path='tutorial'
components={{
sidebar: Sidebar,
center: TutorialView
}}
/>
<Route path='settings/integrations'>
<IndexRoute
components={{
navbar: BackstageNavbar,
sidebar: BackstageSidebar,
center: Integrations
}}
/>
<Route path='incoming_webhooks'>
<IndexRoute
components={{
navbar: BackstageNavbar,
sidebar: BackstageSidebar,
center: InstalledIncomingWebhooks
}}
/>
<Route
path='add'
components={{
navbar: BackstageNavbar,
sidebar: BackstageSidebar,
center: AddIncomingWebhook
}}
/>
</Route>
<Route path='outgoing_webhooks'>
<IndexRoute
components={{
navbar: BackstageNavbar,
sidebar: BackstageSidebar,
center: InstalledOutgoingWebhooks
}}
/>
<Route
path='add'
components={{
navbar: BackstageNavbar,
sidebar: BackstageSidebar,
center: AddOutgoingWebhook
}}
/>
</Route>
<Route path='commands'>
<IndexRoute
components={{
navbar: BackstageNavbar,
sidebar: BackstageSidebar,
center: InstalledCommands
}}
/>
<Route
path='add'
components={{
navbar: BackstageNavbar,
sidebar: BackstageSidebar,
center: AddCommand
}}
/>
</Route>
<Redirect
from='*'
to='/error'
query={notFoundParams}
/>
</Route>
</Route>
</Route>
<Redirect
from='*'
to='/error'
query={notFoundParams}
/>
</Route>
</Router>
routes={rRoot}
/>
),
document.getElementById('root'));
}

207
webapp/routes/route_admin_console.jsx Обычный файл
Просмотреть файл

@@ -0,0 +1,207 @@
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import * as RouteUtils from 'routes/route_utils.jsx';
import {Route, Redirect, IndexRedirect} from 'react-router/es6';
import React from 'react';
import SystemAnalytics from 'components/analytics/system_analytics.jsx';
import ConfigurationSettings from 'components/admin_console/configuration_settings.jsx';
import LocalizationSettings from 'components/admin_console/localization_settings.jsx';
import UsersAndTeamsSettings from 'components/admin_console/users_and_teams_settings.jsx';
import PrivacySettings from 'components/admin_console/privacy_settings.jsx';
import LogSettings from 'components/admin_console/log_settings.jsx';
import EmailAuthenticationSettings from 'components/admin_console/email_authentication_settings.jsx';
import GitLabSettings from 'components/admin_console/gitlab_settings.jsx';
import LdapSettings from 'components/admin_console/ldap_settings.jsx';
import SignupSettings from 'components/admin_console/signup_settings.jsx';
import LoginSettings from 'components/admin_console/login_settings.jsx';
import PublicLinkSettings from 'components/admin_console/public_link_settings.jsx';
import SessionSettings from 'components/admin_console/session_settings.jsx';
import ConnectionSettings from 'components/admin_console/connection_settings.jsx';
import EmailSettings from 'components/admin_console/email_settings.jsx';
import PushSettings from 'components/admin_console/push_settings.jsx';
import WebhookSettings from 'components/admin_console/webhook_settings.jsx';
import ExternalServiceSettings from 'components/admin_console/external_service_settings.jsx';
import DatabaseSettings from 'components/admin_console/database_settings.jsx';
import StorageSettings from 'components/admin_console/storage_settings.jsx';
import ImageSettings from 'components/admin_console/image_settings.jsx';
import CustomBrandSettings from 'components/admin_console/custom_brand_settings.jsx';
import CustomEmojiSettings from 'components/admin_console/custom_emoji_settings.jsx';
import LegalAndSupportSettings from 'components/admin_console/legal_and_support_settings.jsx';
import ComplianceSettings from 'components/admin_console/compliance_settings.jsx';
import RateSettings from 'components/admin_console/rate_settings.jsx';
import DeveloperSettings from 'components/admin_console/developer_settings.jsx';
import TeamUsers from 'components/admin_console/team_users.jsx';
import TeamAnalytics from 'components/analytics/team_analytics.jsx';
import LicenseSettings from 'components/admin_console/license_settings.jsx';
import Audits from 'components/admin_console/audits.jsx';
import Logs from 'components/admin_console/logs.jsx';
export default (
<Route>
<Route
path='system_analytics'
component={SystemAnalytics}
/>
<Route path='general'>
<IndexRedirect to='configuration'/>
<Route
path='configuration'
component={ConfigurationSettings}
/>
<Route
path='localization'
component={LocalizationSettings}
/>
<Route
path='users_and_teams'
component={UsersAndTeamsSettings}
/>
<Route
path='privacy'
component={PrivacySettings}
/>
<Route
path='compliance'
component={ComplianceSettings}
/>
<Route
path='logging'
component={LogSettings}
/>
</Route>
<Route path='authentication'>
<IndexRedirect to='email'/>
<Route
path='email'
component={EmailAuthenticationSettings}
/>
<Route
path='gitlab'
component={GitLabSettings}
/>
<Route
path='ldap'
component={LdapSettings}
/>
</Route>
<Route path='security'>
<IndexRedirect to='sign_up'/>
<Route
path='sign_up'
component={SignupSettings}
/>
<Route
path='login'
component={LoginSettings}
/>
<Route
path='public_links'
component={PublicLinkSettings}
/>
<Route
path='sessions'
component={SessionSettings}
/>
<Route
path='connections'
component={ConnectionSettings}
/>
</Route>
<Route path='notifications'>
<IndexRedirect to='email'/>
<Route
path='email'
component={EmailSettings}
/>
<Route
path='push'
component={PushSettings}
/>
</Route>
<Route path='integrations'>
<IndexRedirect to='webhooks'/>
<Route
path='webhooks'
component={WebhookSettings}
/>
<Route
path='external'
component={ExternalServiceSettings}
/>
</Route>
<Route path='files'>
<IndexRedirect to='storage'/>
<Route
path='storage'
component={StorageSettings}
/>
<Route
path='images'
component={ImageSettings}
/>
</Route>
<Route path='customization'>
<IndexRedirect to='custom_brand'/>
<Route
path='custom_brand'
component={CustomBrandSettings}
/>
<Route
path='custom_emoji'
component={CustomEmojiSettings}
/>
<Route
path='legal_and_support'
component={LegalAndSupportSettings}
/>
</Route>
<Route path='advanced'>
<IndexRedirect to='rate'/>
<Route
path='rate'
component={RateSettings}
/>
<Route
path='database'
component={DatabaseSettings}
/>
<Route
path='developer'
component={DeveloperSettings}
/>
</Route>
<Route path='team'>
<Redirect
from=':team'
to=':team/users'
/>
<Route
path=':team/users'
component={TeamUsers}
/>
<Route
path=':team/analytics'
component={TeamAnalytics}
/>
<Redirect
from='*'
to='/error'
query={RouteUtils.notFoundParams}
/>
</Route>
<Route
path='license'
component={LicenseSettings}
/>
<Route
path='audits'
component={Audits}
/>
<Route
path='logs'
component={Logs}
/>
</Route>
);

36
webapp/routes/route_claim.jsx Обычный файл
Просмотреть файл

@@ -0,0 +1,36 @@
import * as RouteUtils from 'routes/route_utils.jsx';
export default {
path: 'claim',
getComponents: (location, callback) => {
System.import('components/claim/claim_controller.jsx').then(RouteUtils.importComponentSuccess(callback));
},
getChildRoutes: RouteUtils.createGetChildComponentsFunction(
[
{
path: 'oauth_to_email',
getComponents: (location, callback) => {
System.import('components/claim/components/oauth_to_email.jsx').then(RouteUtils.importComponentSuccess(callback));
}
},
{
path: 'email_to_oauth',
getComponents: (location, callback) => {
System.import('components/claim/components/email_to_oauth.jsx').then(RouteUtils.importComponentSuccess(callback));
}
},
{
path: 'ldap_to_email',
getComponents: (location, callback) => {
System.import('components/claim/components/ldap_to_email.jsx').then(RouteUtils.importComponentSuccess(callback));
}
},
{
path: 'email_to_ldap',
getComponents: (location, callback) => {
System.import('components/claim/components/email_to_ldap.jsx').then(RouteUtils.importComponentSuccess(callback));
}
}
]
)
};

25
webapp/routes/route_create_team.jsx Обычный файл
Просмотреть файл

@@ -0,0 +1,25 @@
import * as RouteUtils from 'routes/route_utils.jsx';
export default {
path: 'create_team',
getComponents: (location, callback) => {
System.import('components/create_team/create_team_controller.jsx').then(RouteUtils.importComponentSuccess(callback));
},
indexRoute: {onEnter: (nextState, replace) => replace('/create_team/display_name')},
getChildRoutes: RouteUtils.createGetChildComponentsFunction(
[
{
path: 'display_name',
getComponents: (location, callback) => {
System.import('components/create_team/components/display_name.jsx').then(RouteUtils.importComponentSuccess(callback));
}
},
{
path: 'team_url',
getComponents: (location, callback) => {
System.import('components/create_team/components/team_url.jsx').then(RouteUtils.importComponentSuccess(callback));
}
}
]
)
};

84
webapp/routes/route_integrations.jsx Обычный файл
Просмотреть файл

@@ -0,0 +1,84 @@
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import * as RouteUtils from 'routes/route_utils.jsx';
import {Route, IndexRoute, Redirect} from 'react-router/es6';
import React from 'react';
import BackstageNavbar from 'components/backstage/backstage_navbar.jsx';
import BackstageSidebar from 'components/backstage/backstage_sidebar.jsx';
import Integrations from 'components/backstage/integrations.jsx';
import InstalledIncomingWebhooks from 'components/backstage/installed_incoming_webhooks.jsx';
import InstalledOutgoingWebhooks from 'components/backstage/installed_outgoing_webhooks.jsx';
import InstalledCommands from 'components/backstage/installed_commands.jsx';
import AddIncomingWebhook from 'components/backstage/add_incoming_webhook.jsx';
import AddOutgoingWebhook from 'components/backstage/add_outgoing_webhook.jsx';
import AddCommand from 'components/backstage/add_command.jsx';
export default (
<Route path='integrations'>
<IndexRoute
components={{
navbar: BackstageNavbar,
sidebar: BackstageSidebar,
center: Integrations
}}
/>
<Route path='incoming_webhooks'>
<IndexRoute
components={{
navbar: BackstageNavbar,
sidebar: BackstageSidebar,
center: InstalledIncomingWebhooks
}}
/>
<Route
path='add'
components={{
navbar: BackstageNavbar,
sidebar: BackstageSidebar,
center: AddIncomingWebhook
}}
/>
</Route>
<Route path='outgoing_webhooks'>
<IndexRoute
components={{
navbar: BackstageNavbar,
sidebar: BackstageSidebar,
center: InstalledOutgoingWebhooks
}}
/>
<Route
path='add'
components={{
navbar: BackstageNavbar,
sidebar: BackstageSidebar,
center: AddOutgoingWebhook
}}
/>
</Route>
<Route path='commands'>
<IndexRoute
components={{
navbar: BackstageNavbar,
sidebar: BackstageSidebar,
center: InstalledCommands
}}
/>
<Route
path='add'
components={{
navbar: BackstageNavbar,
sidebar: BackstageSidebar,
center: AddCommand
}}
/>
</Route>
<Redirect
from='*'
to='/error'
query={RouteUtils.notFoundParams}
/>
</Route>
);

123
webapp/routes/route_root.jsx Обычный файл
Просмотреть файл

@@ -0,0 +1,123 @@
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import * as RouteUtils from 'routes/route_utils.jsx';
import Root from 'components/root.jsx';
import claimAccountRoute from 'routes/route_claim.jsx';
import createTeamRoute from 'routes/route_create_team.jsx';
import teamRoute from 'routes/route_team.jsx';
import ErrorStore from 'stores/error_store.jsx';
function preLoggedIn(nextState, replace, callback) {
ErrorStore.clearLastError();
callback();
}
export default {
path: '/',
component: Root,
getChildRoutes: RouteUtils.createGetChildComponentsFunction(
[
{
getComponents: (location, callback) => {
System.import('components/header_footer_template.jsx').then(RouteUtils.importComponentSuccess(callback));
},
getChildRoutes: RouteUtils.createGetChildComponentsFunction(
[
{
path: 'login',
getComponents: (location, callback) => {
System.import('components/login/login_controller.jsx').then(RouteUtils.importComponentSuccess(callback));
}
},
{
path: 'reset_password',
getComponents: (location, callback) => {
System.import('components/password_reset_send_link.jsx').then(RouteUtils.importComponentSuccess(callback));
}
},
{
path: 'reset_password_complete',
getComponents: (location, callback) => {
System.import('components/password_reset_form.jsx').then(RouteUtils.importComponentSuccess(callback));
}
},
claimAccountRoute,
{
path: 'signup_user_complete',
getComponents: (location, callback) => {
System.import('components/signup_user_complete.jsx').then(RouteUtils.importComponentSuccess(callback));
}
},
{
path: 'should_verify_email',
getComponents: (location, callback) => {
System.import('components/should_verify_email.jsx').then(RouteUtils.importComponentSuccess(callback));
}
},
{
path: 'do_verify_email',
getComponents: (location, callback) => {
System.import('components/do_verify_email.jsx').then(RouteUtils.importComponentSuccess(callback));
}
}
]
)
},
{
path: 'error',
getComponents: (location, callback) => {
System.import('components/error_page.jsx').then(RouteUtils.importComponentSuccess(callback));
}
},
{
getComponents: (location, callback) => {
System.import('components/logged_in.jsx').then(RouteUtils.importComponentSuccess(callback));
},
onEnter: preLoggedIn,
getChildRoutes: RouteUtils.createGetChildComponentsFunction(
[
{
path: 'admin_console',
getComponents: (location, callback) => {
System.import('components/admin_console/admin_console.jsx').then(RouteUtils.importComponentSuccess(callback));
},
indexRoute: {onEnter: (nextState, replace) => replace('/admin_console/system_analytics')},
getChildRoutes: (location, callback) => {
System.import('routes/route_admin_console.jsx').then((comp) => callback(null, comp.default));
}
},
{
getComponents: (location, callback) => {
System.import('components/header_footer_template.jsx').then(RouteUtils.importComponentSuccess(callback));
},
getChildRoutes: RouteUtils.createGetChildComponentsFunction(
[
{
path: 'select_team',
getComponents: (location, callback) => {
System.import('components/select_team/select_team.jsx').then(RouteUtils.importComponentSuccess(callback));
}
},
createTeamRoute
]
)
},
teamRoute
]
)
},
{
path: '*',
onEnter: (nextState, replace) => {
replace({
pathname: 'error',
query: RouteUtils.notFoundParams
});
}
}
]
)
};

171
webapp/routes/route_team.jsx Обычный файл
Просмотреть файл

@@ -0,0 +1,171 @@
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import $ from 'jquery';
import * as RouteUtils from 'routes/route_utils.jsx';
import {browserHistory} from 'react-router/es6';
import TeamStore from 'stores/team_store.jsx';
import * as GlobalActions from 'actions/global_actions.jsx';
import AppDispatcher from 'dispatcher/app_dispatcher.jsx';
import Constants from 'utils/constants.jsx';
const ActionTypes = Constants.ActionTypes;
import * as AsyncClient from 'utils/async_client.jsx';
import Client from 'utils/web_client.jsx';
import * as Utils from 'utils/utils.jsx';
import ChannelStore from 'stores/channel_store.jsx';
function onChannelEnter(nextState, replace, callback) {
doChannelChange(nextState, replace, callback);
}
function doChannelChange(state, replace, callback) {
let channel;
if (state.location.query.fakechannel) {
channel = JSON.parse(state.location.query.fakechannel);
} else {
channel = ChannelStore.getByName(state.params.channel);
if (!channel) {
channel = ChannelStore.getMoreByName(state.params.channel);
}
if (!channel) {
Client.joinChannelByName(
state.params.channel,
(data) => {
GlobalActions.emitChannelClickEvent(data);
callback();
},
() => {
if (state.params.team) {
replace('/' + state.params.team + '/channels/town-square');
} else {
replace('/');
}
callback();
}
);
return;
}
}
GlobalActions.emitChannelClickEvent(channel);
callback();
}
function preNeedsTeam(nextState, replace, callback) {
// First check to make sure you're in the current team
// for the current url.
var teamName = Utils.getTeamNameFromUrl();
var team = TeamStore.getByName(teamName);
const oldTeamId = TeamStore.getCurrentId();
if (!team) {
browserHistory.push('/');
return;
}
GlobalActions.emitCloseRightHandSide();
TeamStore.saveMyTeam(team);
TeamStore.emitChange();
// If the old team id is null then we will already have the direct
// profiles from initial load
if (oldTeamId != null) {
AsyncClient.getDirectProfiles();
}
var d1 = $.Deferred(); //eslint-disable-line new-cap
var d2 = $.Deferred(); //eslint-disable-line new-cap
Client.getChannels(
(data) => {
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_CHANNELS,
channels: data.channels,
members: data.members
});
d1.resolve();
},
(err) => {
AsyncClient.dispatchError(err, 'getChannels');
d1.resolve();
}
);
Client.getProfiles(
(data) => {
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_PROFILES,
profiles: data
});
d2.resolve();
},
(err) => {
AsyncClient.dispatchError(err, 'getProfiles');
d2.resolve();
}
);
$.when(d1, d2).done(() => {
callback();
});
}
function onPermalinkEnter(nextState) {
const postId = nextState.params.postid;
GlobalActions.emitPostFocusEvent(postId);
}
export default {
path: ':team',
getComponents: (location, callback) => {
System.import('components/needs_team.jsx').then(RouteUtils.importComponentSuccess(callback));
},
onEnter: preNeedsTeam,
indexRoute: {onEnter: (nextState, replace) => replace('/' + nextState.params.team + '/channels/town-square')},
childRoutes: [
{
path: 'channels/:channel',
onEnter: onChannelEnter,
getComponents: (location, callback) => {
Promise.all([
System.import('components/sidebar.jsx'),
System.import('components/channel_view.jsx')
]).then(
(comarr) => callback(null, {sidebar: comarr[0].default, center: comarr[1].default})
);
}
},
{
path: 'pl/:postid',
onEnter: onPermalinkEnter,
getComponents: (location, callback) => {
Promise.all([
System.import('components/sidebar.jsx'),
System.import('components/permalink_view.jsx')
]).then(
(comarr) => callback(null, {sidebar: comarr[0].default, center: comarr[1].default})
);
}
},
{
path: 'tutorial',
getComponents: (location, callback) => {
Promise.all([
System.import('components/sidebar.jsx'),
System.import('components/tutorial/tutorial_view.jsx')
]).then(
(comarr) => callback(null, {sidebar: comarr[0].default, center: comarr[1].default})
);
}
},
{
path: 'settings',
getChildRoutes: (location, callback) => {
System.import('routes/route_integrations.jsx').then((comp) => callback(null, [comp.default]));
}
}
]
};

20
webapp/routes/route_utils.jsx Обычный файл
Просмотреть файл

@@ -0,0 +1,20 @@
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import * as Utils from 'utils/utils.jsx';
export function importComponentSuccess(callback) {
return (comp) => callback(null, comp.default);
}
export function createGetChildComponentsFunction(arrayOfComponents) {
return (locaiton, callback) => callback(null, arrayOfComponents);
}
export const notFoundParams = {
title: Utils.localizeMessage('error.not_found.title', 'Page not found'),
message: Utils.localizeMessage('error.not_found.message', 'The page you were trying to reach does not exist'),
link: '/',
linkmessage: Utils.localizeMessage('error.not_found.link_message', 'Back to Mattermost')
};

Просмотреть файл

@@ -1,7 +1,7 @@
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
import * as Utils from 'utils/utils.jsx';
const notSupportedParams = {

Просмотреть файл

@@ -2,7 +2,7 @@
// See License.txt for license information.
import Autolinker from 'autolinker';
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
import Constants from './constants.jsx';
import * as Emoticons from './emoticons.jsx';
import * as Markdown from './markdown.jsx';

Просмотреть файл

@@ -13,7 +13,7 @@ var ActionTypes = Constants.ActionTypes;
import * as AsyncClient from './async_client.jsx';
import Client from './web_client.jsx';
import {browserHistory} from 'react-router';
import {browserHistory} from 'react-router/es6';
import icon50 from 'images/icon50x50.png';
import bing from 'images/bing.mp3';

Просмотреть файл

@@ -105,7 +105,13 @@ var config = {
'process.env': {
NODE_ENV: JSON.stringify('production')
}
}),
new webpack.optimize.CommonsChunkPlugin({
minChunks: 2,
children: true,
name: 'main'
})
//new webpack.optimize.AggressiveMergingPlugin()
],
resolve: {
alias: {
@@ -144,9 +150,6 @@ if (!DEV) {
comments: false
})
);
config.plugins.push(
new webpack.optimize.AggressiveMergingPlugin()
);
config.plugins.push(
new webpack.optimize.OccurrenceOrderPlugin(true)
);