diff options
Diffstat (limited to 'web/react/pages')
-rw-r--r-- | web/react/pages/admin_console.jsx | 25 | ||||
-rw-r--r-- | web/react/pages/authorize.jsx | 21 | ||||
-rw-r--r-- | web/react/pages/channel.jsx | 58 | ||||
-rw-r--r-- | web/react/pages/home.jsx | 6 | ||||
-rw-r--r-- | web/react/pages/login.jsx | 7 | ||||
-rw-r--r-- | web/react/pages/password_reset.jsx | 12 | ||||
-rw-r--r-- | web/react/pages/signup_team.jsx | 10 | ||||
-rw-r--r-- | web/react/pages/signup_team_complete.jsx | 8 | ||||
-rw-r--r-- | web/react/pages/signup_user_complete.jsx | 15 | ||||
-rw-r--r-- | web/react/pages/verify.jsx | 9 |
10 files changed, 109 insertions, 62 deletions
diff --git a/web/react/pages/admin_console.jsx b/web/react/pages/admin_console.jsx new file mode 100644 index 000000000..689a6b3a2 --- /dev/null +++ b/web/react/pages/admin_console.jsx @@ -0,0 +1,25 @@ +// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. +// See License.txt for license information. + +var ErrorBar = require('../components/error_bar.jsx'); +var SelectTeamModal = require('../components/admin_console/select_team_modal.jsx'); +var AdminController = require('../components/admin_console/admin_controller.jsx'); + +export function setupAdminConsolePage() { + React.render( + <AdminController />, + document.getElementById('admin_controller') + ); + + React.render( + <SelectTeamModal />, + document.getElementById('select_team_modal') + ); + + React.render( + <ErrorBar/>, + document.getElementById('error_bar') + ); +} + +global.window.setup_admin_console_page = setupAdminConsolePage; diff --git a/web/react/pages/authorize.jsx b/web/react/pages/authorize.jsx new file mode 100644 index 000000000..db42c8266 --- /dev/null +++ b/web/react/pages/authorize.jsx @@ -0,0 +1,21 @@ +// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. +// See License.txt for license information. + +var Authorize = require('../components/authorize.jsx'); + +function setupAuthorizePage(teamName, appName, responseType, clientId, redirectUri, scope, state) { + React.render( + <Authorize + teamName={teamName} + appName={appName} + responseType={responseType} + clientId={clientId} + redirectUri={redirectUri} + scope={scope} + state={state} + />, + document.getElementById('authorize') + ); +} + +global.window.setup_authorize_page = setupAuthorizePage; diff --git a/web/react/pages/channel.jsx b/web/react/pages/channel.jsx index 71a03cde0..74259194a 100644 --- a/web/react/pages/channel.jsx +++ b/web/react/pages/channel.jsx @@ -5,7 +5,7 @@ var AppDispatcher = require('../dispatcher/app_dispatcher.jsx'); var Navbar = require('../components/navbar.jsx'); var Sidebar = require('../components/sidebar.jsx'); var ChannelHeader = require('../components/channel_header.jsx'); -var PostList = require('../components/post_list.jsx'); +var PostListContainer = require('../components/post_list_container.jsx'); var CreatePost = require('../components/create_post.jsx'); var SidebarRight = require('../components/sidebar_right.jsx'); var SidebarRightMenu = require('../components/sidebar_right_menu.jsx'); @@ -17,16 +17,16 @@ var RenameChannelModal = require('../components/rename_channel_modal.jsx'); var EditPostModal = require('../components/edit_post_modal.jsx'); var DeletePostModal = require('../components/delete_post_modal.jsx'); var MoreChannelsModal = require('../components/more_channels.jsx'); -var NewChannelModal = require('../components/new_channel.jsx'); var PostDeletedModal = require('../components/post_deleted_modal.jsx'); var ChannelNotificationsModal = require('../components/channel_notifications.jsx'); -var UserSettingsModal = require('../components/user_settings_modal.jsx'); +var UserSettingsModal = require('../components/user_settings/user_settings_modal.jsx'); var TeamSettingsModal = require('../components/team_settings_modal.jsx'); var ChannelMembersModal = require('../components/channel_members.jsx'); var ChannelInviteModal = require('../components/channel_invite_modal.jsx'); var TeamMembersModal = require('../components/team_members.jsx'); var DirectChannelModal = require('../components/more_direct_channels.jsx'); var ErrorBar = require('../components/error_bar.jsx'); +var ErrorStore = require('../stores/error_store.jsx'); var ChannelLoader = require('../components/channel_loader.jsx'); var MentionList = require('../components/mention_list.jsx'); var ChannelInfoModal = require('../components/channel_info_modal.jsx'); @@ -34,24 +34,22 @@ var AccessHistoryModal = require('../components/access_history_modal.jsx'); var ActivityLogModal = require('../components/activity_log_modal.jsx'); var RemovedFromChannelModal = require('../components/removed_from_channel_modal.jsx'); var FileUploadOverlay = require('../components/file_upload_overlay.jsx'); - -var AsyncClient = require('../utils/async_client.jsx'); +var RegisterAppModal = require('../components/register_app_modal.jsx'); +var ImportThemeModal = require('../components/user_settings/import_theme_modal.jsx'); var Constants = require('../utils/constants.jsx'); var ActionTypes = Constants.ActionTypes; -function setupChannelPage(teamName, teamType, teamId, channelName, channelId) { - AsyncClient.getConfig(); - +function setupChannelPage(props) { 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 @@ -66,14 +64,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') ); @@ -89,17 +87,22 @@ function setupChannelPage(teamName, teamType, teamId, channelName, channelId) { ); React.render( - <TeamSettingsModal teamDisplayName={teamName} />, + <ImportThemeModal />, + document.getElementById('import_theme_modal') + ); + + React.render( + <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') ); @@ -154,12 +157,7 @@ function setupChannelPage(teamName, teamType, teamId, channelName, channelId) { ); React.render( - <NewChannelModal />, - document.getElementById('new_channel_modal') - ); - - React.render( - <PostList />, + <PostListContainer />, document.getElementById('post-list') ); @@ -190,8 +188,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') ); @@ -232,6 +230,16 @@ function setupChannelPage(teamName, teamType, teamId, channelName, channelId) { />, document.getElementById('file_upload_overlay') ); + + React.render( + <RegisterAppModal />, + document.getElementById('register_app_modal') + ); + + if (global.window.config.SendEmailNotifications === 'false') { + ErrorStore.storeLastError({message: 'Preview Mode: Email notifications have not been configured'}); + ErrorStore.emitChange(); + } } global.window.setup_channel_page = setupChannelPage; diff --git a/web/react/pages/home.jsx b/web/react/pages/home.jsx index 18553542c..2299c306e 100644 --- a/web/react/pages/home.jsx +++ b/web/react/pages/home.jsx @@ -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; } } diff --git a/web/react/pages/login.jsx b/web/react/pages/login.jsx index 424ae0e84..f78e0f37a 100644 --- a/web/react/pages/login.jsx +++ b/web/react/pages/login.jsx @@ -3,12 +3,11 @@ 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} />, document.getElementById('login') ); diff --git a/web/react/pages/password_reset.jsx b/web/react/pages/password_reset.jsx index 2ca468bea..b7bfdcd5e 100644 --- a/web/react/pages/password_reset.jsx +++ b/web/react/pages/password_reset.jsx @@ -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') ); diff --git a/web/react/pages/signup_team.jsx b/web/react/pages/signup_team.jsx index e9e803aa4..d0e08f446 100644 --- a/web/react/pages/signup_team.jsx +++ b/web/react/pages/signup_team.jsx @@ -3,15 +3,9 @@ var SignupTeam = require('../components/signup_team.jsx'); -var AsyncClient = require('../utils/async_client.jsx'); - -function setupSignupTeamPage(authServices) { - AsyncClient.getConfig(); - - var services = JSON.parse(authServices); - +function setupSignupTeamPage() { React.render( - <SignupTeam services={services} />, + <SignupTeam />, document.getElementById('signup-team') ); } diff --git a/web/react/pages/signup_team_complete.jsx b/web/react/pages/signup_team_complete.jsx index 72f9992a8..ec77e6602 100644 --- a/web/react/pages/signup_team_complete.jsx +++ b/web/react/pages/signup_team_complete.jsx @@ -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') ); diff --git a/web/react/pages/signup_user_complete.jsx b/web/react/pages/signup_user_complete.jsx index eaf93a61c..cc7607187 100644 --- a/web/react/pages/signup_user_complete.jsx +++ b/web/react/pages/signup_user_complete.jsx @@ -3,16 +3,15 @@ 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} />, document.getElementById('signup-user-complete') ); diff --git a/web/react/pages/verify.jsx b/web/react/pages/verify.jsx index 7077b40b8..16a9846e5 100644 --- a/web/react/pages/verify.jsx +++ b/web/react/pages/verify.jsx @@ -3,12 +3,13 @@ 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} + resendSuccess={props.ResendSuccess} />, document.getElementById('verify') ); |