From 29db5c8c29c157503b1411c9bb10cf1866baa85c Mon Sep 17 00:00:00 2001 From: nickago Date: Fri, 24 Jul 2015 14:41:42 -0700 Subject: Removed popover on channel name and added ability to set channel descritption for 1-1 channels --- web/react/components/channel_header.jsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'web/react') diff --git a/web/react/components/channel_header.jsx b/web/react/components/channel_header.jsx index 7a129f200..76dbe370b 100644 --- a/web/react/components/channel_header.jsx +++ b/web/react/components/channel_header.jsx @@ -153,7 +153,7 @@ module.exports = React.createClass({ if (isDirect) { if (this.state.users.length > 1) { var contact = this.state.users[((this.state.users[0].id === currentId) ? 1 : 0)]; - channelTitle = ; + channelTitle = contact.nickname || contact.username; } } @@ -161,13 +161,13 @@ module.exports = React.createClass({ -- cgit v1.2.3-1-g7c22 From 52bf726ddfaa0d5010ce7a80fe1f03a485df9279 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Fri, 24 Jul 2015 14:13:19 -0700 Subject: Fixes issue with images not displaying due to window.origin not being defined in IE10 --- web/react/components/file_preview.jsx | 2 +- web/react/components/post_body.jsx | 4 ++-- web/react/components/post_right.jsx | 4 ++-- web/react/components/view_image.jsx | 6 +++--- web/react/utils/utils.jsx | 10 ++++++++-- 5 files changed, 16 insertions(+), 10 deletions(-) (limited to 'web/react') diff --git a/web/react/components/file_preview.jsx b/web/react/components/file_preview.jsx index fdd12feec..7c1db3e10 100644 --- a/web/react/components/file_preview.jsx +++ b/web/react/components/file_preview.jsx @@ -24,7 +24,7 @@ module.exports = React.createClass({ if (filename.indexOf("/api/v1/files/get") != -1) { filename = filename.split("/api/v1/files/get")[1]; } - filename = window.location.origin + "/api/v1/files/get" + filename; + filename = utils.getWindowLocationOrigin() + "/api/v1/files/get" + filename; if (type === "image") { previews.push( diff --git a/web/react/components/post_body.jsx b/web/react/components/post_body.jsx index 7871f52b7..a71fa9e8f 100644 --- a/web/react/components/post_body.jsx +++ b/web/react/components/post_body.jsx @@ -32,7 +32,7 @@ module.exports = React.createClass({ if (fileInfo.path.indexOf("/api/v1/files/get") != -1) { fileInfo.path = fileInfo.path.split("/api/v1/files/get")[1]; } - fileInfo.path = window.location.origin + "/api/v1/files/get" + fileInfo.path; + fileInfo.path = utils.getWindowLocationOrigin() + "/api/v1/files/get" + fileInfo.path; if (type === "image") { $('').attr('src', fileInfo.path+'_thumb.jpg').load(function(path, name){ return function() { @@ -112,7 +112,7 @@ module.exports = React.createClass({ if (fileInfo.path.indexOf("/api/v1/files/get") != -1) { fileInfo.path = fileInfo.path.split("/api/v1/files/get")[1]; } - fileInfo.path = window.location.origin + "/api/v1/files/get" + fileInfo.path; + fileInfo.path = utils.getWindowLocationOrigin() + "/api/v1/files/get" + fileInfo.path; if (type === "image") { if (i < Constants.MAX_DISPLAY_FILES) { diff --git a/web/react/components/post_right.jsx b/web/react/components/post_right.jsx index 567be1962..8097a181e 100644 --- a/web/react/components/post_right.jsx +++ b/web/react/components/post_right.jsx @@ -98,7 +98,7 @@ RootPost = React.createClass({ if (fileInfo.path.indexOf("/api/v1/files/get") != -1) { fileInfo.path = fileInfo.path.split("/api/v1/files/get")[1]; } - fileInfo.path = window.location.origin + "/api/v1/files/get" + fileInfo.path; + fileInfo.path = utils.getWindowLocationOrigin() + "/api/v1/files/get" + fileInfo.path; if (ftype === "image") { var url = fileInfo.path.replace(re1, '%20').replace(re2, '%28').replace(re3, '%29'); @@ -208,7 +208,7 @@ CommentPost = React.createClass({ if (fileInfo.path.indexOf("/api/v1/files/get") != -1) { fileInfo.path = fileInfo.path.split("/api/v1/files/get")[1]; } - fileInfo.path = window.location.origin + "/api/v1/files/get" + fileInfo.path; + fileInfo.path = utils.getWindowLocationOrigin() + "/api/v1/files/get" + fileInfo.path; if (type === "image") { var url = fileInfo.path.replace(re1, '%20').replace(re2, '%28').replace(re3, '%29'); diff --git a/web/react/components/view_image.jsx b/web/react/components/view_image.jsx index c107de4d7..7b096c629 100644 --- a/web/react/components/view_image.jsx +++ b/web/react/components/view_image.jsx @@ -40,7 +40,7 @@ module.exports = React.createClass({ if (fileInfo.path.indexOf("/api/v1/files/get") !== -1) { fileInfo.path = fileInfo.path.split("/api/v1/files/get")[1]; } - fileInfo.path = window.location.origin + "/api/v1/files/get" + fileInfo.path; + fileInfo.path = utils.getWindowLocationOrigin() + "/api/v1/files/get" + fileInfo.path; src = fileInfo['path'] + '_preview.jpg'; } @@ -148,7 +148,7 @@ module.exports = React.createClass({ if (info.path.indexOf("/api/v1/files/get") !== -1) { info.path = info.path.split("/api/v1/files/get")[1]; } - info.path = window.location.origin + "/api/v1/files/get" + info.path; + info.path = utils.getWindowLocationOrigin() + "/api/v1/files/get" + info.path; preview_filename = info['path'] + '_preview.jpg'; } @@ -166,7 +166,7 @@ module.exports = React.createClass({ if (download_link.indexOf("/api/v1/files/get") !== -1) { download_link = download_link.split("/api/v1/files/get")[1]; } - download_link = window.location.origin + "/api/v1/files/get" + download_link; + download_link = utils.getWindowLocationOrigin() + "/api/v1/files/get" + download_link; return ( ); @@ -461,14 +475,16 @@ SendInivtesPage = React.createClass({ return (
- -

Send Invitations

- { emails } -
-
 
- -

{"If you'd prefer, you can send invitations after you finish setting up the "+ strings.Team + "."}

-
Skip this step
+ +

Invite Team Members

+ { emails } +
Add Invitation
+
+ +

if you prefer, you can invite team members later
and skip this step for now.

+
+ Back to previous step +
); } @@ -512,19 +528,24 @@ UsernamePage = React.createClass({
-

Choose a username

-
-
-
- +

Your username

+
Select a memorable username that makes it easy for teammates to identify you:
+
+
+
+
+
Choose your username
+ +
Usernames must begin with a letter and contain 3 to 15 characters made up of lowercase letters, numbers, and the symbols '.', '-' and '_'
+
+
+ { name_error }
- { name_error } + + -

{"Pick something " + strings.Team + "mates will recognize. Your username is how you will appear to others."}

-

It can be made of lowercase letters and numbers.

-   -
); @@ -600,24 +621,32 @@ PasswordPage = React.createClass({
-

Choose a password

-

You'll use your email address ({this.props.state.team.email}) and password to log into {config.SiteName}.

-
-
-
- +

Your password

+
Select a password that you'll use to login with your email address:
+
+
Email
+
{this.props.state.team.email}
+
+
+
+
Choose your password
+ +
Passwords must contain 5 to 50 characters. Your password will be strongest if it contains a mix of symbols, numbers, and upper and lowercase characters.
+
+
+ { name_error }
-
- { name_error }
-   - +

By proceeding to create your account and use { config.SiteName }, you agree to our Terms of Service and Privacy Policy. If you do not agree, you cannot use {config.SiteName}.

+
); diff --git a/web/react/components/signup_user_complete.jsx b/web/react/components/signup_user_complete.jsx index bbf1f670c..36fa27ad7 100644 --- a/web/react/components/signup_user_complete.jsx +++ b/web/react/components/signup_user_complete.jsx @@ -104,8 +104,8 @@ module.exports = React.createClass({ var yourEmailIs = this.state.user.email == "" ? "" : Your email address is { this.state.user.email }. var email = ( -
- +
+
What's your email address?
{ email_error } @@ -124,29 +124,34 @@ module.exports = React.createClass({ return (
-

Signup to { config.SiteName }

-
- -
+
Welcome to:
+

"teamDisplayName"

+

on { config.SiteName }

+

Let's create your account

{ signup_message } - -
- - { name_error } -

Your username can be made of lowercase letters and numbers.

-

{"Pick something " + strings.Team + "mates will recognize. Your username is how you will appear to others"}

-
- { email } - -
- - { password_error } -
-

{ yourEmailIs } You’ll use this address to sign in to {config.SiteName}.

-
-

+
+ { email } +

{ yourEmailIs } You’ll use this address to sign in to {config.SiteName}.

+
+
Choose your username
+
+ + { name_error } +

Username must begin with a letter, and contain between 3 to 15 lowercase characters made up of numbers, letters, and the symbols '.', '-' and '_'"

+
+
+
+
Choose your password
+
+ + { password_error } +
+
+
+
+

{ server_error } -

By proceeding to create your account and use { config.SiteName }, you agree to our Terms of Service and Privacy Policy. If you do not agree, you cannot use {config.SiteName}.

+

By creating an account and using Mattermost you are agreeing to our Terms of Service. If you do not agree, you cannot use this service.

); } -- cgit v1.2.3-1-g7c22 From ff362b77929cbb65f941e14144472f7d6ca9d430 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Tue, 28 Jul 2015 11:36:33 -0400 Subject: updates to sign-up flow, remove company name and marketing checkbox --- web/react/components/signup_team.jsx | 16 +--------------- web/react/components/signup_team_complete.jsx | 23 ++++++++++------------- web/react/pages/signup_team_complete.jsx | 4 ++-- web/react/utils/client.jsx | 4 ++-- 4 files changed, 15 insertions(+), 32 deletions(-) (limited to 'web/react') diff --git a/web/react/components/signup_team.jsx b/web/react/components/signup_team.jsx index 6fde7f8b5..edd48e0b9 100644 --- a/web/react/components/signup_team.jsx +++ b/web/react/components/signup_team.jsx @@ -20,21 +20,12 @@ module.exports = React.createClass({ state.email_error = ""; } - team.display_name = this.refs.name.getDOMNode().value.trim(); - if (!team.display_name) { - state.name_error = "This field is required"; - state.inValid = true; - } - else { - state.name_error = ""; - } - if (state.inValid) { this.setState(state); return; } - client.signupTeam(team.email, team.display_name, + client.signupTeam(team.email, function(data) { if (data["follow_link"]) { window.location.href = data["follow_link"]; @@ -55,7 +46,6 @@ module.exports = React.createClass({ render: function() { var email_error = this.state.email_error ? : null; - var name_error = this.state.name_error ? : null; var server_error = this.state.server_error ?
: null; return ( @@ -64,10 +54,6 @@ module.exports = React.createClass({ { email_error }
-
- - { name_error } -
{ server_error }
diff --git a/web/react/components/signup_team_complete.jsx b/web/react/components/signup_team_complete.jsx index ee85342ce..450a95dd0 100644 --- a/web/react/components/signup_team_complete.jsx +++ b/web/react/components/signup_team_complete.jsx @@ -134,6 +134,7 @@ TeamDisplayNamePage = React.createClass({ this.props.state.wizard = "team_url"; this.props.state.team.display_name = display_name; + this.props.state.team.name = utils.cleanUpUrlable(display_name); this.props.updateParent(this.props.state); }, getInitialState: function() { @@ -563,15 +564,15 @@ PasswordPage = React.createClass({ var password = this.refs.password.getDOMNode().value.trim(); if (!password || password.length < 5) { - this.setState({name_error: "Please enter at least 5 characters"}); + this.setState({password_error: "Please enter at least 5 characters"}); return; } - this.setState({name_error: ""}); + this.setState({password_error: null, server_error: null}); $('#finish-button').button('loading'); var teamSignup = JSON.parse(JSON.stringify(this.props.state)); teamSignup.user.password = password; - teamSignup.user.allow_marketing = this.refs.email_service.getDOMNode().checked; + teamSignup.user.allow_marketing = true; delete teamSignup.wizard; var ctl = this; @@ -603,7 +604,7 @@ PasswordPage = React.createClass({ }, 5000); }.bind(this), function(err) { - this.setState({name_error: err.message}); + this.setState({server_error: err.message}); $('#sign-up-button').button('reset'); }.bind(this) ); @@ -615,7 +616,8 @@ PasswordPage = React.createClass({ client.track('signup', 'signup_team_07_password'); - var name_error = this.state.name_error ? : null; + var password_error = this.state.password_error ? : null; + var server_error = this.state.server_error ? : null; return (
@@ -626,7 +628,7 @@ PasswordPage = React.createClass({
Email
{this.props.state.team.email}
-
+
Choose your password
@@ -634,12 +636,10 @@ PasswordPage = React.createClass({
Passwords must contain 5 to 50 characters. Your password will be strongest if it contains a mix of symbols, numbers, and upper and lowercase characters.
- { name_error } + { password_error } + { server_error }
-
- -
@@ -669,9 +669,6 @@ module.exports = React.createClass({ props.wizard = "welcome"; props.team = {}; props.team.email = this.props.email; - props.team.display_name = this.props.name; - props.team.company_name = this.props.name; - props.team.name = utils.cleanUpUrlable(this.props.name); props.team.allowed_domains = ""; props.invites = []; props.invites.push(""); diff --git a/web/react/pages/signup_team_complete.jsx b/web/react/pages/signup_team_complete.jsx index 346f2ab5a..71806c2ea 100644 --- a/web/react/pages/signup_team_complete.jsx +++ b/web/react/pages/signup_team_complete.jsx @@ -3,9 +3,9 @@ var SignupTeamComplete =require('../components/signup_team_complete.jsx'); -global.window.setup_signup_team_complete_page = function(email, name, data, hash) { +global.window.setup_signup_team_complete_page = function(email, data, hash) { React.render( - , + , document.getElementById('signup-team-complete') ); }; diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx index 1c31dc5ed..b8eda0075 100644 --- a/web/react/utils/client.jsx +++ b/web/react/utils/client.jsx @@ -341,13 +341,13 @@ module.exports.updateTeamDisplayName = function(data, success, error) { module.exports.track('api', 'api_teams_update_name'); }; -module.exports.signupTeam = function(email, display_name, success, error) { +module.exports.signupTeam = function(email, success, error) { $.ajax({ url: "/api/v1/teams/signup", dataType: 'json', contentType: 'application/json', type: 'POST', - data: JSON.stringify({email: email, display_name: display_name}), + data: JSON.stringify({email: email}), success: success, error: function(xhr, status, err) { e = handleError("singupTeam", xhr, status, err); -- cgit v1.2.3-1-g7c22 From 0bfc769b4dc03538b5ee1897a33febf7a45226a2 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Tue, 28 Jul 2015 11:41:44 -0400 Subject: updated user sign up page and login page with new UI details --- web/react/components/login.jsx | 2 +- web/react/components/signup_user_complete.jsx | 5 ++--- web/react/pages/signup_user_complete.jsx | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'web/react') diff --git a/web/react/components/login.jsx b/web/react/components/login.jsx index 45b558dca..fe0a47777 100644 --- a/web/react/components/login.jsx +++ b/web/react/components/login.jsx @@ -105,7 +105,7 @@ module.exports = React.createClass({
Sign in to:

{ teamDisplayName }

-

on { teamName }

+

on { config.SiteName }

{ server_error } diff --git a/web/react/components/signup_user_complete.jsx b/web/react/components/signup_user_complete.jsx index 36fa27ad7..670aab943 100644 --- a/web/react/components/signup_user_complete.jsx +++ b/web/react/components/signup_user_complete.jsx @@ -40,7 +40,7 @@ module.exports = React.createClass({ this.setState({name_error: "", email_error: "", password_error: "", server_error: ""}); - this.state.user.allow_marketing = this.refs.email_service.getDOMNode().checked; + this.state.user.allow_marketing = true; client.createUser(this.state.user, this.state.data, this.state.hash, function(data) { @@ -125,7 +125,7 @@ module.exports = React.createClass({
Welcome to:
-

"teamDisplayName"

+

{ this.props.teamDisplayName }

on { config.SiteName }

Let's create your account

{ signup_message } @@ -147,7 +147,6 @@ module.exports = React.createClass({ { password_error }
-

{ server_error } diff --git a/web/react/pages/signup_user_complete.jsx b/web/react/pages/signup_user_complete.jsx index 60c3a609a..8f9be1f94 100644 --- a/web/react/pages/signup_user_complete.jsx +++ b/web/react/pages/signup_user_complete.jsx @@ -1,7 +1,7 @@ // Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. // See License.txt for license information. -var SignupUserComplete =require('../components/signup_user_complete.jsx'); +var SignupUserComplete = require('../components/signup_user_complete.jsx'); global.window.setup_signup_user_complete_page = function(email, name, ui_name, id, data, hash, auth_services) { React.render( -- cgit v1.2.3-1-g7c22 From 95123302419c2ea73e239ef5a62d1a0148d801dc Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Tue, 28 Jul 2015 11:49:45 -0400 Subject: updated changing email in sign up flow to work properly --- web/react/components/signup_team_complete.jsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'web/react') diff --git a/web/react/components/signup_team_complete.jsx b/web/react/components/signup_team_complete.jsx index 450a95dd0..559009f44 100644 --- a/web/react/components/signup_team_complete.jsx +++ b/web/react/components/signup_team_complete.jsx @@ -42,11 +42,15 @@ WelcomePage = React.createClass({ state.email_error = ""; } - client.signupTeam(email, this.props.state.team.name, + client.signupTeam(email, function(data) { - this.props.state.wizard = "finished"; - this.props.updateParent(this.props.state); - window.location.href = "/signup_team_confirm/?email=" + encodeURI(email); + if (data["follow_link"]) { + window.location.href = data["follow_link"]; + } else { + this.props.state.wizard = "finished"; + this.props.updateParent(this.props.state); + window.location.href = "/signup_team_confirm/?email=" + encodeURIComponent(team.email); + } }.bind(this), function(err) { this.state.server_error = err.message; -- cgit v1.2.3-1-g7c22 From 2e4d51b08f22b74802d4897a127685c162a2bef0 Mon Sep 17 00:00:00 2001 From: nickago Date: Tue, 28 Jul 2015 09:20:07 -0700 Subject: Fixed typo in delete_post_modal --- web/react/components/delete_post_modal.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/react') diff --git a/web/react/components/delete_post_modal.jsx b/web/react/components/delete_post_modal.jsx index 11970bc2b..f0cb809af 100644 --- a/web/react/components/delete_post_modal.jsx +++ b/web/react/components/delete_post_modal.jsx @@ -98,7 +98,7 @@ module.exports = React.createClass({ : "" }
- +
-- cgit v1.2.3-1-g7c22 From f084188010ccc0b82f17b99e5cacde74e732c318 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Wed, 29 Jul 2015 07:52:11 -0400 Subject: added use of strings.Team to replace hardcoded mentions of 'team' --- web/react/components/signup_team_complete.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'web/react') diff --git a/web/react/components/signup_team_complete.jsx b/web/react/components/signup_team_complete.jsx index 559009f44..ebb40f17f 100644 --- a/web/react/components/signup_team_complete.jsx +++ b/web/react/components/signup_team_complete.jsx @@ -481,12 +481,12 @@ SendInivtesPage = React.createClass({
-

Invite Team Members

+

{"Invite " + utils.toTitleCase(strings.Team) + " Members"}

{ emails }
-

if you prefer, you can invite team members later
and skip this step for now.

+

{"if you prefer, you can invite " + strings.Team + " members later"}
and skip this step for now.

@@ -534,7 +534,7 @@ UsernamePage = React.createClass({

Your username

-
Select a memorable username that makes it easy for teammates to identify you:
+
{"Select a memorable username that makes it easy for " + strings.Team + "mates to identify you:"}
-- cgit v1.2.3-1-g7c22 From b0105bc1ed034af76fa2289e7a54920c56039e63 Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Wed, 29 Jul 2015 19:29:57 +0500 Subject: mm-1762 - Search improvements with some other minor Ui changes --- web/react/components/search_bar.jsx | 11 ++++++++--- web/react/components/sidebar_header.jsx | 10 ++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) (limited to 'web/react') diff --git a/web/react/components/search_bar.jsx b/web/react/components/search_bar.jsx index f21f0cd58..e39cf5d46 100644 --- a/web/react/components/search_bar.jsx +++ b/web/react/components/search_bar.jsx @@ -36,6 +36,9 @@ module.exports = React.createClass({ } } }, + clearFocus: function(e) { + $('.search-bar__container').removeClass('focused'); + }, handleClose: function(e) { e.preventDefault(); @@ -57,6 +60,7 @@ module.exports = React.createClass({ }, handleUserFocus: function(e) { e.target.select(); + $('.search-bar__container').addClass('focused'); }, performSearch: function(terms, isMentionSearch) { if (terms.length) { @@ -92,13 +96,14 @@ module.exports = React.createClass({ render: function() { return (
-
Cancel
- +
+ Cancel + -
  • +
  • @@ -107,6 +107,12 @@ module.exports = React.createClass({ }; }, + toggleDropdown: function(e) { + e.preventDefault(); + e.stopPropagation(); + $('.team__header').find('.dropdown-toggle').trigger('click'); + }, + render: function() { var me = UserStore.getCurrentUser(); @@ -116,7 +122,7 @@ module.exports = React.createClass({ return (
    - + { me.last_picture_update ? { this.state.password_error } : null; - var server_error = this.state.server_error ? : null; + var password_error = this.state.password_error ?
    : null; + var server_error = this.state.server_error ?
    : null; return (
    -- cgit v1.2.3-1-g7c22 From 1e0abf74a3cfea6a540e922abf6e038018160fc4 Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Wed, 29 Jul 2015 20:24:28 +0500 Subject: Removing unused id on LHS dropdown --- web/react/components/sidebar_header.jsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'web/react') diff --git a/web/react/components/sidebar_header.jsx b/web/react/components/sidebar_header.jsx index b6ca8c1a5..0156dc01a 100644 --- a/web/react/components/sidebar_header.jsx +++ b/web/react/components/sidebar_header.jsx @@ -75,7 +75,7 @@ var NavbarDropdown = React.createClass({ return (
      -
    • +
    • @@ -108,8 +108,6 @@ module.exports = React.createClass({ }, toggleDropdown: function(e) { - e.preventDefault(); - e.stopPropagation(); $('.team__header').find('.dropdown-toggle').trigger('click'); }, -- cgit v1.2.3-1-g7c22 From 7b776fbb781e89670273283e82614aa9c5954040 Mon Sep 17 00:00:00 2001 From: nickago Date: Mon, 27 Jul 2015 14:29:49 -0700 Subject: Removed timeout originally set on team creation --- web/react/components/signup_team_complete.jsx | 36 +++++++++++++-------------- 1 file changed, 17 insertions(+), 19 deletions(-) (limited to 'web/react') diff --git a/web/react/components/signup_team_complete.jsx b/web/react/components/signup_team_complete.jsx index 21f9edef1..238714502 100644 --- a/web/react/components/signup_team_complete.jsx +++ b/web/react/components/signup_team_complete.jsx @@ -587,25 +587,23 @@ PasswordPage = React.createClass({ var props = this.props; - setTimeout(function() { - $('#sign-up-button').button('reset'); - props.state.wizard = "finished"; - props.updateParent(props.state, true); - - window.location.href = utils.getWindowLocationOrigin() + '/' + props.state.team.name + '/login?email=' + encodeURIComponent(teamSignup.team.email); - - // client.loginByEmail(teamSignup.team.domain, teamSignup.team.email, teamSignup.user.password, - // function(data) { - // TeamStore.setLastName(teamSignup.team.domain); - // UserStore.setLastEmail(teamSignup.team.email); - // UserStore.setCurrentUser(data); - // window.location.href = '/channels/town-square'; - // }.bind(ctl), - // function(err) { - // this.setState({name_error: err.message}); - // }.bind(ctl) - // ); - }, 5000); + $('#sign-up-button').button('reset'); + props.state.wizard = "finished"; + props.updateParent(props.state, true); + + window.location.href = window.location.origin + '/' + props.state.team.name + '/login?email=' + encodeURIComponent(teamSignup.team.email); + + // client.loginByEmail(teamSignup.team.domain, teamSignup.team.email, teamSignup.user.password, + // function(data) { + // TeamStore.setLastName(teamSignup.team.domain); + // UserStore.setLastEmail(teamSignup.team.email); + // UserStore.setCurrentUser(data); + // window.location.href = '/channels/town-square'; + // }.bind(ctl), + // function(err) { + // this.setState({name_error: err.message}); + // }.bind(ctl) + // ); }.bind(this), function(err) { this.setState({server_error: err.message}); -- cgit v1.2.3-1-g7c22 From 2775225e0dba77ab2c47286d5c225575cadc8834 Mon Sep 17 00:00:00 2001 From: nickago Date: Wed, 29 Jul 2015 08:32:26 -0700 Subject: Added IE friendly window origin function in place of unwrapped call --- web/react/components/signup_team_complete.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/react') diff --git a/web/react/components/signup_team_complete.jsx b/web/react/components/signup_team_complete.jsx index 238714502..b342f3a3c 100644 --- a/web/react/components/signup_team_complete.jsx +++ b/web/react/components/signup_team_complete.jsx @@ -591,7 +591,7 @@ PasswordPage = React.createClass({ props.state.wizard = "finished"; props.updateParent(props.state, true); - window.location.href = window.location.origin + '/' + props.state.team.name + '/login?email=' + encodeURIComponent(teamSignup.team.email); + window.location.href = utils.getWindowLocationOrigin() + '/' + props.state.team.name + '/login?email=' + encodeURIComponent(teamSignup.team.email); // client.loginByEmail(teamSignup.team.domain, teamSignup.team.email, teamSignup.user.password, // function(data) { -- cgit v1.2.3-1-g7c22 From 8c14a16d0126a32c0f45f9d9a172cc06f867cc23 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Tue, 28 Jul 2015 09:28:00 -0700 Subject: Access History and Active Sessions are now lazy-loaded upon opening instead of loaded at start; added loading screens to Access History and Active Sessions --- web/react/components/access_history_modal.jsx | 16 +++++++++++++--- web/react/components/activity_log_modal.jsx | 17 +++++++++++++++-- web/react/stores/user_store.jsx | 4 ++-- 3 files changed, 30 insertions(+), 7 deletions(-) (limited to 'web/react') diff --git a/web/react/components/access_history_modal.jsx b/web/react/components/access_history_modal.jsx index 462f046f6..6cc8ec8a9 100644 --- a/web/react/components/access_history_modal.jsx +++ b/web/react/components/access_history_modal.jsx @@ -3,7 +3,8 @@ var UserStore = require('../stores/user_store.jsx'); var AsyncClient = require('../utils/async_client.jsx'); -var Utils = require('../utils/utils.jsx'); +var LoadingScreen = require('./loading_screen.jsx'); +var utils = require('../utils/utils.jsx'); function getStateFromStoresForAudits() { return { @@ -14,7 +15,9 @@ function getStateFromStoresForAudits() { module.exports = React.createClass({ componentDidMount: function() { UserStore.addAuditsChangeListener(this._onChange); - AsyncClient.getAudits(); + $(this.refs.modal.getDOMNode()).on('shown.bs.modal', function (e) { + AsyncClient.getAudits(); + }); var self = this; $(this.refs.modal.getDOMNode()).on('hidden.bs.modal', function(e) { @@ -25,7 +28,10 @@ module.exports = React.createClass({ UserStore.removeAuditsChangeListener(this._onChange); }, _onChange: function() { - this.setState(getStateFromStoresForAudits()); + var newState = getStateFromStoresForAudits(); + if (!utils.areStatesEqual(newState.audits, this.state.audits)) { + this.setState(newState); + } }, handleMoreInfo: function(index) { var newMoreInfo = this.state.moreInfo; @@ -87,9 +93,13 @@ module.exports = React.createClass({

      Access History

    + { !this.state.audits.loading ? { accessList } + : + + }
  • diff --git a/web/react/components/activity_log_modal.jsx b/web/react/components/activity_log_modal.jsx index 90f139e8b..f28f0d5f1 100644 --- a/web/react/components/activity_log_modal.jsx +++ b/web/react/components/activity_log_modal.jsx @@ -4,6 +4,8 @@ var UserStore = require('../stores/user_store.jsx'); var Client = require('../utils/client.jsx'); var AsyncClient = require('../utils/async_client.jsx'); +var LoadingScreen = require('./loading_screen.jsx'); +var utils = require('../utils/utils.jsx'); function getStateFromStoresForSessions() { return { @@ -29,7 +31,9 @@ module.exports = React.createClass({ }, componentDidMount: function() { UserStore.addSessionsChangeListener(this._onChange); - AsyncClient.getSessions(); + $(this.refs.modal.getDOMNode()).on('shown.bs.modal', function (e) { + AsyncClient.getSessions(); + }); var self = this; $(this.refs.modal.getDOMNode()).on('hidden.bs.modal', function(e) { @@ -40,7 +44,10 @@ module.exports = React.createClass({ UserStore.removeSessionsChangeListener(this._onChange); }, _onChange: function() { - this.setState(getStateFromStoresForSessions()); + var newState = getStateFromStoresForSessions(); + if (!utils.areStatesEqual(newState.sessions, this.state.sessions)) { + this.setState(newState); + } }, handleMoreInfo: function(index) { var newMoreInfo = this.state.moreInfo; @@ -106,10 +113,16 @@ module.exports = React.createClass({

    Sessions are created when you log in with your email and password to a new browser on a device. Sessions let you use Mattermost for up to 30 days without having to log in again. If you want to log out sooner, use the "Logout" button below to end a session.

    + { !this.state.sessions.loading ? +
    { activityList } { server_error } +
    + : + + }
    diff --git a/web/react/stores/user_store.jsx b/web/react/stores/user_store.jsx index 001162f47..aff5a0bed 100644 --- a/web/react/stores/user_store.jsx +++ b/web/react/stores/user_store.jsx @@ -164,13 +164,13 @@ var UserStore = assign({}, EventEmitter.prototype, { BrowserStore.setItem("sessions", sessions); }, getSessions: function() { - return BrowserStore.getItem("sessions", []); + return BrowserStore.getItem("sessions", {loading: true}); }, setAudits: function(audits) { BrowserStore.setItem("audits", audits); }, getAudits: function() { - return BrowserStore.getItem("audits", []); + return BrowserStore.getItem("audits", {loading: true}); }, setTeams: function(teams) { BrowserStore.setItem("teams", teams); -- cgit v1.2.3-1-g7c22
    - { !isDirect ?
    {channelTitle} + { !isDirect ?
    • View Info
    • { !ChannelStore.isDefault(channel) ? @@ -193,12 +193,14 @@ module.exports = React.createClass({ : null }
    + : + + }
    {description}
    - : - {channelTitle} - }