Merge pull request #1969 from mattermost/PLT-7-client-infa2
PLT-7 client side infra for loc
Этот коммит содержится в:
@@ -2,20 +2,69 @@
|
|||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
import Authorize from '../components/authorize.jsx';
|
import Authorize from '../components/authorize.jsx';
|
||||||
|
import * as Client from '../utils/client.jsx';
|
||||||
|
|
||||||
function setupAuthorizePage(props) {
|
var IntlProvider = ReactIntl.IntlProvider;
|
||||||
ReactDOM.render(
|
|
||||||
<Authorize
|
class Root extends React.Component {
|
||||||
teamName={props.TeamName}
|
constructor() {
|
||||||
appName={props.AppName}
|
super();
|
||||||
responseType={props.ResponseType}
|
this.state = {
|
||||||
clientId={props.ClientId}
|
translations: null,
|
||||||
redirectUri={props.RedirectUri}
|
loaded: false
|
||||||
scope={props.Scope}
|
};
|
||||||
state={props.State}
|
}
|
||||||
/>,
|
|
||||||
document.getElementById('authorize')
|
static propTypes() {
|
||||||
);
|
return {
|
||||||
|
map: React.PropTypes.object.isRequired
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillMount() {
|
||||||
|
Client.getTranslations(
|
||||||
|
this.props.map.Locale,
|
||||||
|
(data) => {
|
||||||
|
this.setState({
|
||||||
|
translations: data,
|
||||||
|
loaded: true
|
||||||
|
});
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
this.setState({
|
||||||
|
loaded: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
if (!this.state.loaded) {
|
||||||
|
return <div></div>;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<IntlProvider
|
||||||
|
locale={this.props.map.Locale}
|
||||||
|
messages={this.state.translations}
|
||||||
|
>
|
||||||
|
<Authorize
|
||||||
|
teamName={this.props.map.TeamName}
|
||||||
|
appName={this.props.map.AppName}
|
||||||
|
responseType={this.props.map.ResponseType}
|
||||||
|
clientId={this.props.map.ClientId}
|
||||||
|
redirectUri={this.props.map.RedirectUri}
|
||||||
|
scope={this.props.map.Scope}
|
||||||
|
state={this.props.map.State}
|
||||||
|
/>
|
||||||
|
</IntlProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
global.window.setup_authorize_page = setupAuthorizePage;
|
global.window.setup_authorize_page = function setup(props) {
|
||||||
|
ReactDOM.render(
|
||||||
|
<Root map={props} />,
|
||||||
|
document.getElementById('authorize')
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|||||||
@@ -2,18 +2,67 @@
|
|||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
import ClaimAccount from '../components/claim/claim_account.jsx';
|
import ClaimAccount from '../components/claim/claim_account.jsx';
|
||||||
|
import * as Client from '../utils/client.jsx';
|
||||||
|
|
||||||
function setupClaimAccountPage(props) {
|
var IntlProvider = ReactIntl.IntlProvider;
|
||||||
ReactDOM.render(
|
|
||||||
<ClaimAccount
|
class Root extends React.Component {
|
||||||
email={props.Email}
|
constructor() {
|
||||||
currentType={props.CurrentType}
|
super();
|
||||||
newType={props.NewType}
|
this.state = {
|
||||||
teamName={props.TeamName}
|
translations: null,
|
||||||
teamDisplayName={props.TeamDisplayName}
|
loaded: false
|
||||||
/>,
|
};
|
||||||
document.getElementById('claim')
|
}
|
||||||
);
|
|
||||||
|
static propTypes() {
|
||||||
|
return {
|
||||||
|
map: React.PropTypes.object.isRequired
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillMount() {
|
||||||
|
Client.getTranslations(
|
||||||
|
this.props.map.Locale,
|
||||||
|
(data) => {
|
||||||
|
this.setState({
|
||||||
|
translations: data,
|
||||||
|
loaded: true
|
||||||
|
});
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
this.setState({
|
||||||
|
loaded: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
if (!this.state.loaded) {
|
||||||
|
return <div></div>;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<IntlProvider
|
||||||
|
locale={this.props.map.Locale}
|
||||||
|
messages={this.state.translations}
|
||||||
|
>
|
||||||
|
<ClaimAccount
|
||||||
|
email={this.props.map.Email}
|
||||||
|
currentType={this.props.map.CurrentType}
|
||||||
|
newType={this.props.map.NewType}
|
||||||
|
teamName={this.props.map.TeamName}
|
||||||
|
teamDisplayName={this.props.map.TeamDisplayName}
|
||||||
|
/>
|
||||||
|
</IntlProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
global.window.setup_claim_account_page = setupClaimAccountPage;
|
global.window.setup_claim_account_page = function setup(props) {
|
||||||
|
ReactDOM.render(
|
||||||
|
<Root map={props} />,
|
||||||
|
document.getElementById('claim')
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -2,15 +2,63 @@
|
|||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
import Docs from '../components/docs.jsx';
|
import Docs from '../components/docs.jsx';
|
||||||
|
import * as Client from '../utils/client.jsx';
|
||||||
|
|
||||||
function setupDocumentationPage(props) {
|
var IntlProvider = ReactIntl.IntlProvider;
|
||||||
ReactDOM.render(
|
|
||||||
<Docs
|
class Root extends React.Component {
|
||||||
site={props.Site}
|
constructor() {
|
||||||
/>,
|
super();
|
||||||
document.getElementById('docs')
|
this.state = {
|
||||||
);
|
translations: null,
|
||||||
|
loaded: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static propTypes() {
|
||||||
|
return {
|
||||||
|
map: React.PropTypes.object.isRequired
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillMount() {
|
||||||
|
Client.getTranslations(
|
||||||
|
this.props.map.Locale,
|
||||||
|
(data) => {
|
||||||
|
this.setState({
|
||||||
|
translations: data,
|
||||||
|
loaded: true
|
||||||
|
});
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
this.setState({
|
||||||
|
loaded: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
if (!this.state.loaded) {
|
||||||
|
return <div></div>;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<IntlProvider
|
||||||
|
locale={this.props.map.Locale}
|
||||||
|
messages={this.state.translations}
|
||||||
|
>
|
||||||
|
<Docs site={this.props.map.Site} />
|
||||||
|
</IntlProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
global.window.mm_user = global.window.mm_user || {};
|
global.window.mm_user = global.window.mm_user || {};
|
||||||
global.window.setup_documentation_page = setupDocumentationPage;
|
|
||||||
|
global.window.setup_documentation_page = function setup(props) {
|
||||||
|
ReactDOM.render(
|
||||||
|
<Root map={props} />,
|
||||||
|
document.getElementById('docs')
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|||||||
@@ -2,18 +2,67 @@
|
|||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
import PasswordReset from '../components/password_reset.jsx';
|
import PasswordReset from '../components/password_reset.jsx';
|
||||||
|
import * as Client from '../utils/client.jsx';
|
||||||
|
|
||||||
function setupPasswordResetPage(props) {
|
var IntlProvider = ReactIntl.IntlProvider;
|
||||||
ReactDOM.render(
|
|
||||||
<PasswordReset
|
class Root extends React.Component {
|
||||||
isReset={props.IsReset}
|
constructor() {
|
||||||
teamDisplayName={props.TeamDisplayName}
|
super();
|
||||||
teamName={props.TeamName}
|
this.state = {
|
||||||
hash={props.Hash}
|
translations: null,
|
||||||
data={props.Data}
|
loaded: false
|
||||||
/>,
|
};
|
||||||
document.getElementById('reset')
|
}
|
||||||
);
|
|
||||||
|
static propTypes() {
|
||||||
|
return {
|
||||||
|
map: React.PropTypes.object.isRequired
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillMount() {
|
||||||
|
Client.getTranslations(
|
||||||
|
this.props.map.Locale,
|
||||||
|
(data) => {
|
||||||
|
this.setState({
|
||||||
|
translations: data,
|
||||||
|
loaded: true
|
||||||
|
});
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
this.setState({
|
||||||
|
loaded: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
if (!this.state.loaded) {
|
||||||
|
return <div></div>;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<IntlProvider
|
||||||
|
locale={this.props.map.Locale}
|
||||||
|
messages={this.state.translations}
|
||||||
|
>
|
||||||
|
<PasswordReset
|
||||||
|
isReset={this.props.map.IsReset}
|
||||||
|
teamDisplayName={this.props.map.TeamDisplayName}
|
||||||
|
teamName={this.props.map.TeamName}
|
||||||
|
hash={this.props.map.Hash}
|
||||||
|
data={this.props.map.Data}
|
||||||
|
/>
|
||||||
|
</IntlProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
global.window.setup_password_reset_page = setupPasswordResetPage;
|
global.window.setup_password_reset_page = function setup(props) {
|
||||||
|
ReactDOM.render(
|
||||||
|
<Root map={props} />,
|
||||||
|
document.getElementById('reset')
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|||||||
@@ -2,8 +2,60 @@
|
|||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
import SignupTeam from '../components/signup_team.jsx';
|
import SignupTeam from '../components/signup_team.jsx';
|
||||||
|
import * as Client from '../utils/client.jsx';
|
||||||
|
|
||||||
function setupSignupTeamPage(props) {
|
var IntlProvider = ReactIntl.IntlProvider;
|
||||||
|
|
||||||
|
class Root extends React.Component {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.state = {
|
||||||
|
translations: null,
|
||||||
|
loaded: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static propTypes() {
|
||||||
|
return {
|
||||||
|
map: React.PropTypes.object.isRequired,
|
||||||
|
teams: React.PropTypes.object.isRequired
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillMount() {
|
||||||
|
Client.getTranslations(
|
||||||
|
this.props.map.Locale,
|
||||||
|
(data) => {
|
||||||
|
this.setState({
|
||||||
|
translations: data,
|
||||||
|
loaded: true
|
||||||
|
});
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
this.setState({
|
||||||
|
loaded: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
if (!this.state.loaded) {
|
||||||
|
return <div></div>;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<IntlProvider
|
||||||
|
locale={this.props.map.Locale}
|
||||||
|
messages={this.state.translations}
|
||||||
|
>
|
||||||
|
<SignupTeam teams={this.props.teams} />
|
||||||
|
</IntlProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
global.window.setup_signup_team_page = function setup(props) {
|
||||||
var teams = [];
|
var teams = [];
|
||||||
|
|
||||||
for (var prop in props) {
|
for (var prop in props) {
|
||||||
@@ -15,9 +67,10 @@ function setupSignupTeamPage(props) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<SignupTeam teams={teams} />,
|
<Root
|
||||||
|
map={props}
|
||||||
|
teams={teams}
|
||||||
|
/>,
|
||||||
document.getElementById('signup-team')
|
document.getElementById('signup-team')
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
global.window.setup_signup_team_page = setupSignupTeamPage;
|
|
||||||
@@ -2,16 +2,65 @@
|
|||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
import SignupTeamComplete from '../components/signup_team_complete.jsx';
|
import SignupTeamComplete from '../components/signup_team_complete.jsx';
|
||||||
|
import * as Client from '../utils/client.jsx';
|
||||||
|
|
||||||
function setupSignupTeamCompletePage(props) {
|
var IntlProvider = ReactIntl.IntlProvider;
|
||||||
ReactDOM.render(
|
|
||||||
<SignupTeamComplete
|
class Root extends React.Component {
|
||||||
email={props.Email}
|
constructor() {
|
||||||
hash={props.Hash}
|
super();
|
||||||
data={props.Data}
|
this.state = {
|
||||||
/>,
|
translations: null,
|
||||||
document.getElementById('signup-team-complete')
|
loaded: false
|
||||||
);
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static propTypes() {
|
||||||
|
return {
|
||||||
|
map: React.PropTypes.object.isRequired
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillMount() {
|
||||||
|
Client.getTranslations(
|
||||||
|
this.props.map.Locale,
|
||||||
|
(data) => {
|
||||||
|
this.setState({
|
||||||
|
translations: data,
|
||||||
|
loaded: true
|
||||||
|
});
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
this.setState({
|
||||||
|
loaded: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
if (!this.state.loaded) {
|
||||||
|
return <div></div>;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<IntlProvider
|
||||||
|
locale={this.props.map.Locale}
|
||||||
|
messages={this.state.translations}
|
||||||
|
>
|
||||||
|
<SignupTeamComplete
|
||||||
|
email={this.props.map.Email}
|
||||||
|
hash={this.props.map.Hash}
|
||||||
|
data={this.props.map.Data}
|
||||||
|
/>
|
||||||
|
</IntlProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
global.window.setup_signup_team_complete_page = setupSignupTeamCompletePage;
|
global.window.setup_signup_team_complete_page = function setup(props) {
|
||||||
|
ReactDOM.render(
|
||||||
|
<Root map={props} />,
|
||||||
|
document.getElementById('signup-team-complete')
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -2,19 +2,68 @@
|
|||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
import SignupUserComplete from '../components/signup_user_complete.jsx';
|
import SignupUserComplete from '../components/signup_user_complete.jsx';
|
||||||
|
import * as Client from '../utils/client.jsx';
|
||||||
|
|
||||||
function setupSignupUserCompletePage(props) {
|
var IntlProvider = ReactIntl.IntlProvider;
|
||||||
ReactDOM.render(
|
|
||||||
<SignupUserComplete
|
class Root extends React.Component {
|
||||||
teamId={props.TeamId}
|
constructor() {
|
||||||
teamName={props.TeamName}
|
super();
|
||||||
teamDisplayName={props.TeamDisplayName}
|
this.state = {
|
||||||
email={props.Email}
|
translations: null,
|
||||||
hash={props.Hash}
|
loaded: false
|
||||||
data={props.Data}
|
};
|
||||||
/>,
|
}
|
||||||
document.getElementById('signup-user-complete')
|
|
||||||
);
|
static propTypes() {
|
||||||
|
return {
|
||||||
|
map: React.PropTypes.object.isRequired
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillMount() {
|
||||||
|
Client.getTranslations(
|
||||||
|
this.props.map.Locale,
|
||||||
|
(data) => {
|
||||||
|
this.setState({
|
||||||
|
translations: data,
|
||||||
|
loaded: true
|
||||||
|
});
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
this.setState({
|
||||||
|
loaded: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
if (!this.state.loaded) {
|
||||||
|
return <div></div>;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<IntlProvider
|
||||||
|
locale={this.props.map.Locale}
|
||||||
|
messages={this.state.translations}
|
||||||
|
>
|
||||||
|
<SignupUserComplete
|
||||||
|
teamId={this.props.map.TeamId}
|
||||||
|
teamName={this.props.map.TeamName}
|
||||||
|
teamDisplayName={this.props.map.TeamDisplayName}
|
||||||
|
email={this.props.map.Email}
|
||||||
|
hash={this.props.map.Hash}
|
||||||
|
data={this.props.map.Data}
|
||||||
|
/>
|
||||||
|
</IntlProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
global.window.setup_signup_user_complete_page = setupSignupUserCompletePage;
|
global.window.setup_signup_user_complete_page = function setup(props) {
|
||||||
|
ReactDOM.render(
|
||||||
|
<Root map={props} />,
|
||||||
|
document.getElementById('signup-user-complete')
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -2,15 +2,66 @@
|
|||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
import EmailVerify from '../components/email_verify.jsx';
|
import EmailVerify from '../components/email_verify.jsx';
|
||||||
|
import * as Client from '../utils/client.jsx';
|
||||||
|
|
||||||
global.window.setupVerifyPage = function setupVerifyPage(props) {
|
var IntlProvider = ReactIntl.IntlProvider;
|
||||||
|
|
||||||
|
class Root extends React.Component {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.state = {
|
||||||
|
translations: null,
|
||||||
|
loaded: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static propTypes() {
|
||||||
|
return {
|
||||||
|
map: React.PropTypes.object.isRequired
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillMount() {
|
||||||
|
Client.getTranslations(
|
||||||
|
this.props.map.Locale,
|
||||||
|
(data) => {
|
||||||
|
this.setState({
|
||||||
|
translations: data,
|
||||||
|
loaded: true
|
||||||
|
});
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
this.setState({
|
||||||
|
loaded: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
if (!this.state.loaded) {
|
||||||
|
return <div></div>;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<IntlProvider
|
||||||
|
locale={this.props.map.Locale}
|
||||||
|
messages={this.state.translations}
|
||||||
|
>
|
||||||
|
<EmailVerify
|
||||||
|
isVerified={this.props.map.IsVerified}
|
||||||
|
teamURL={this.props.map.TeamURL}
|
||||||
|
userEmail={this.props.map.UserEmail}
|
||||||
|
resendSuccess={this.props.map.ResendSuccess}
|
||||||
|
/>
|
||||||
|
</IntlProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
global.window.setupVerifyPage = function setup(props) {
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<EmailVerify
|
<Root map={props} />,
|
||||||
isVerified={props.IsVerified}
|
|
||||||
teamURL={props.TeamURL}
|
|
||||||
userEmail={props.UserEmail}
|
|
||||||
resendSuccess={props.ResendSuccess}
|
|
||||||
/>,
|
|
||||||
document.getElementById('verify')
|
document.getElementById('verify')
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user