PLT-93 cleaing up client side configs

Этот коммит содержится в:
=Corey Hulen
2015-09-15 18:59:14 -07:00
родитель 788fc4373b
Коммит b2a679c25d
82 изменённых файлов: 429 добавлений и 375 удалений

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

@@ -39,18 +39,18 @@ var AsyncClient = require('../utils/async_client.jsx');
var Constants = require('../utils/constants.jsx');
var ActionTypes = Constants.ActionTypes;
function setupChannelPage(teamName, teamType, teamId, channelName, channelId) {
function setupChannelPage(props) {
AsyncClient.getConfig();
AppDispatcher.handleViewAction({
type: ActionTypes.CLICK_CHANNEL,
name: channelName,
id: channelId
name: props.ChannelName,
id: props.ChannelId
});
AppDispatcher.handleViewAction({
type: ActionTypes.CLICK_TEAM,
id: teamId
id: props.TeamId
});
// ChannelLoader must be rendered first
@@ -65,14 +65,14 @@ function setupChannelPage(teamName, teamType, teamId, channelName, channelId) {
);
React.render(
<Navbar teamDisplayName={teamName} />,
<Navbar teamDisplayName={props.TeamDisplayName} />,
document.getElementById('navbar')
);
React.render(
<Sidebar
teamDisplayName={teamName}
teamType={teamType}
teamDisplayName={props.TeamDisplayName}
teamType={props.TeamType}
/>,
document.getElementById('sidebar-left')
);
@@ -88,17 +88,17 @@ function setupChannelPage(teamName, teamType, teamId, channelName, channelId) {
);
React.render(
<TeamSettingsModal teamDisplayName={teamName} />,
<TeamSettingsModal teamDisplayName={props.TeamDisplayName} />,
document.getElementById('team_settings_modal')
);
React.render(
<TeamMembersModal teamDisplayName={teamName} />,
<TeamMembersModal teamDisplayName={props.TeamDisplayName} />,
document.getElementById('team_members_modal')
);
React.render(
<MemberInviteModal teamType={teamType} />,
<MemberInviteModal teamType={props.TeamType} />,
document.getElementById('invite_member_modal')
);
@@ -184,8 +184,8 @@ function setupChannelPage(teamName, teamType, teamId, channelName, channelId) {
React.render(
<SidebarRightMenu
teamDisplayName={teamName}
teamType={teamType}
teamDisplayName={props.TeamDisplayName}
teamType={props.TeamType}
/>,
document.getElementById('sidebar-menu')
);

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

@@ -4,12 +4,12 @@
var ChannelStore = require('../stores/channel_store.jsx');
var Constants = require('../utils/constants.jsx');
function setupHomePage(teamURL) {
function setupHomePage(props) {
var last = ChannelStore.getLastVisitedName();
if (last == null || last.length === 0) {
window.location = teamURL + '/channels/' + Constants.DEFAULT_CHANNEL;
window.location = props.TeamURL + '/channels/' + Constants.DEFAULT_CHANNEL;
} else {
window.location = teamURL + '/channels/' + last;
window.location = props.TeamURL + '/channels/' + last;
}
}

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

@@ -3,12 +3,12 @@
var Login = require('../components/login.jsx');
function setupLoginPage(teamDisplayName, teamName, authServices) {
function setupLoginPage(props) {
React.render(
<Login
teamDisplayName={teamDisplayName}
teamName={teamName}
authServices={authServices}
teamDisplayName={props.TeamDisplayName}
teamName={props.TeamName}
authServices={props.AuthServices}
/>,
document.getElementById('login')
);

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

@@ -3,14 +3,14 @@
var PasswordReset = require('../components/password_reset.jsx');
function setupPasswordResetPage(isReset, teamDisplayName, teamName, hash, data) {
function setupPasswordResetPage(props) {
React.render(
<PasswordReset
isReset={isReset}
teamDisplayName={teamDisplayName}
teamName={teamName}
hash={hash}
data={data}
isReset={props.IsReset}
teamDisplayName={props.TeamDisplayName}
teamName={props.TeamName}
hash={props.Hash}
data={props.Data}
/>,
document.getElementById('reset')
);

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

@@ -5,10 +5,10 @@ var SignupTeam = require('../components/signup_team.jsx');
var AsyncClient = require('../utils/async_client.jsx');
function setupSignupTeamPage(authServices) {
function setupSignupTeamPage(props) {
AsyncClient.getConfig();
var services = JSON.parse(authServices);
var services = JSON.parse(props.AuthServices);
React.render(
<SignupTeam services={services} />,

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

@@ -3,12 +3,12 @@
var SignupTeamComplete = require('../components/signup_team_complete.jsx');
function setupSignupTeamCompletePage(email, data, hash) {
function setupSignupTeamCompletePage(props) {
React.render(
<SignupTeamComplete
email={email}
hash={hash}
data={data}
email={props.Email}
hash={props.Hash}
data={props.Data}
/>,
document.getElementById('signup-team-complete')
);

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

@@ -3,16 +3,16 @@
var SignupUserComplete = require('../components/signup_user_complete.jsx');
function setupSignupUserCompletePage(email, name, uiName, id, data, hash, authServices) {
function setupSignupUserCompletePage(props) {
React.render(
<SignupUserComplete
teamId={id}
teamName={name}
teamDisplayName={uiName}
email={email}
hash={hash}
data={data}
authServices={authServices}
teamId={props.TeamId}
teamName={props.TeamName}
teamDisplayName={props.TeamDisplayName}
email={props.Email}
hash={props.Hash}
data={props.Data}
authServices={props.AuthServices}
/>,
document.getElementById('signup-user-complete')
);

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

@@ -3,12 +3,12 @@
var EmailVerify = require('../components/email_verify.jsx');
global.window.setupVerifyPage = function setupVerifyPage(isVerified, teamURL, userEmail) {
global.window.setupVerifyPage = function setupVerifyPage(props) {
React.render(
<EmailVerify
isVerified={isVerified}
teamURL={teamURL}
userEmail={userEmail}
isVerified={props.IsVerified}
teamURL={props.TeamURL}
userEmail={props.UserEmail}
/>,
document.getElementById('verify')
);