From 72d54e427c035162260f47b0b79864e6193861e9 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Mon, 29 Jun 2015 10:31:56 -0400 Subject: add intro text specific to off-topic channel --- web/react/components/post_list.jsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'web/react/components/post_list.jsx') diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx index 37e3faef2..e37de8d88 100644 --- a/web/react/components/post_list.jsx +++ b/web/react/components/post_list.jsx @@ -356,6 +356,7 @@ module.exports = React.createClass({ var ui_name = channel.display_name var members = ChannelStore.getCurrentExtraInfo().members; var creator_name = ""; + var userStyle = { color: UserStore.getCurrentUser().props.theme } for (var i = 0; i < members.length; i++) { if (members[i].roles.indexOf('admin') > -1) { @@ -382,8 +383,18 @@ module.exports = React.createClass({

); + } else if (channel.name === Constants.OFFTOPIC_CHANNEL) { + more_messages = ( +
+

Welcome

+

+ {"This is the start of " + ui_name + ", a channel for conversations you’d prefer out of more focused channels."} +
+ Set a description +

+
+ ); } else { - var userStyle = { color: UserStore.getCurrentUser().props.theme } var ui_type = channel.type === 'P' ? "private group" : "channel"; more_messages = (
-- cgit v1.2.3-1-g7c22 From 27eeabafe096013f1d0d368a65fe71ef230eab50 Mon Sep 17 00:00:00 2001 From: nickago Date: Wed, 1 Jul 2015 09:48:39 -0700 Subject: Facelifted "direct message" to "private message" --- web/react/components/post_list.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'web/react/components/post_list.jsx') diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx index e37de8d88..40c30539e 100644 --- a/web/react/components/post_list.jsx +++ b/web/react/components/post_list.jsx @@ -342,13 +342,13 @@ module.exports = React.createClass({
-

{"This is the start of your direct message history with " + teammate_name + "." }
{"Direct messages and files shared here are not shown to people outside this area."}

+

{"This is the start of your private message history with " + teammate_name + "." }
{"Private messages and files shared here are not shown to people outside this area."}

); } else { more_messages = (
-

{"This is the start of your direct message history with this " + strings.Team + "mate. Direct messages and files shared here are not shown to people outside this area."}

+

{"This is the start of your private message history with this " + strings.Team + "mate. Private messages and files shared here are not shown to people outside this area."}

); } -- cgit v1.2.3-1-g7c22 From fd310e382a2cc1a9779ef28dee7fea9476bb425f Mon Sep 17 00:00:00 2001 From: nickago Date: Wed, 1 Jul 2015 12:41:36 -0700 Subject: Finally fixed the git weirdness --- web/react/components/post_list.jsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'web/react/components/post_list.jsx') diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx index e37de8d88..142d7ab1c 100644 --- a/web/react/components/post_list.jsx +++ b/web/react/components/post_list.jsx @@ -324,13 +324,7 @@ module.exports = React.createClass({ if (order.length > 0 && order.length % Constants.POST_CHUNK_SIZE === 0) { more_messages = Load more messages; } else if (channel.type === 'D') { - var userIds = channel.name.split('__'); - var teammate; - if (userIds.length === 2 && userIds[0] === user_id) { - teammate = UserStore.getProfile(userIds[1]); - } else if (userIds.length === 2 && userIds[1] === user_id) { - teammate = UserStore.getProfile(userIds[0]); - } + var teammate = utils.getDirectTeammate(channel.id) if (teammate) { var teammate_name = teammate.full_name.length > 0 ? teammate.full_name : teammate.username; -- cgit v1.2.3-1-g7c22 From 483b37a64f978db84cd0d128665d2c79775c6e60 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Wed, 1 Jul 2015 16:51:26 -0700 Subject: Added logic for loading animation to appear when posts have yet to be loaded. Added markup necessary for loading animation css. Removed a file that was no longer needed for the design. --- web/react/components/post_list.jsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'web/react/components/post_list.jsx') diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx index ad8cfa20f..a860804cc 100644 --- a/web/react/components/post_list.jsx +++ b/web/react/components/post_list.jsx @@ -295,7 +295,7 @@ module.exports = React.createClass({ }, render: function() { var order = []; - var posts = {}; + var posts; var last_viewed = Number.MAX_VALUE; @@ -408,7 +408,7 @@ module.exports = React.createClass({ } var postCtls = []; - var previousPostDay = posts[order[order.length-1]] ? utils.getDateForUnixTicks(posts[order[order.length-1]].create_at): new Date(); + var previousPostDay = posts && posts[order[order.length-1]] ? utils.getDateForUnixTicks(posts[order[order.length-1]].create_at): new Date(); var currentPostDay = new Date(); for (var i = order.length-1; i >= 0; i--) { @@ -459,6 +459,19 @@ module.exports = React.createClass({ previousPostDay = utils.getDateForUnixTicks(post.create_at); } + if (posts == undefined) { + postCtls.push( +
+
+

Loading

+
+
+
+
+
+ ); + } + return (
-- cgit v1.2.3-1-g7c22 From 1a1b29ee6c1aa20a5f608f57616b078f0dbbbe51 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Thu, 2 Jul 2015 16:38:34 -0700 Subject: Restructured logic to flow more naturally and be cleaner --- web/react/components/post_list.jsx | 86 +++++++++++++++++++------------------- 1 file changed, 44 insertions(+), 42 deletions(-) (limited to 'web/react/components/post_list.jsx') diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx index a860804cc..169efc766 100644 --- a/web/react/components/post_list.jsx +++ b/web/react/components/post_list.jsx @@ -408,58 +408,60 @@ module.exports = React.createClass({ } var postCtls = []; - var previousPostDay = posts && posts[order[order.length-1]] ? utils.getDateForUnixTicks(posts[order[order.length-1]].create_at): new Date(); - var currentPostDay = new Date(); - for (var i = order.length-1; i >= 0; i--) { - var post = posts[order[i]]; - var parentPost; + if (posts != undefined) { + var previousPostDay = posts[order[order.length-1]] ? utils.getDateForUnixTicks(posts[order[order.length-1]].create_at): new Date(); + var currentPostDay = new Date(); - if (post.parent_id) { - parentPost = posts[post.parent_id]; - } else { - parentPost = null; - } + for (var i = order.length-1; i >= 0; i--) { + var post = posts[order[i]]; + var parentPost; - var sameUser = i < order.length-1 && posts[order[i+1]].user_id === post.user_id && post.create_at - posts[order[i+1]].create_at <= 1000*60*5 ? "same--user" : ""; - var sameRoot = i < order.length-1 && post.root_id != "" && (posts[order[i+1]].id === post.root_id || posts[order[i+1]].root_id === post.root_id) ? true : false; + if (post.parent_id) { + parentPost = posts[post.parent_id]; + } else { + parentPost = null; + } - // we only hide the profile pic if the previous post is not a comment, the current post is not a comment, and the previous post was made by the same user as the current post - var hideProfilePic = i < order.length-1 && posts[order[i+1]].user_id === post.user_id && posts[order[i+1]].root_id === '' && post.root_id === ''; + var sameUser = i < order.length-1 && posts[order[i+1]].user_id === post.user_id && post.create_at - posts[order[i+1]].create_at <= 1000*60*5 ? "same--user" : ""; + var sameRoot = i < order.length-1 && post.root_id != "" && (posts[order[i+1]].id === post.root_id || posts[order[i+1]].root_id === post.root_id) ? true : false; - // check if it's the last comment in a consecutive string of comments on the same post - var isLastComment = false; - if (utils.isComment(post)) { - // it is the last comment if it is last post in the channel or the next post has a different root post - isLastComment = (i === 0 || posts[order[i-1]].root_id != post.root_id); - } + // we only hide the profile pic if the previous post is not a comment, the current post is not a comment, and the previous post was made by the same user as the current post + var hideProfilePic = i < order.length-1 && posts[order[i+1]].user_id === post.user_id && posts[order[i+1]].root_id === '' && post.root_id === ''; - var postCtl = ; + // check if it's the last comment in a consecutive string of comments on the same post + var isLastComment = false; + if (utils.isComment(post)) { + // it is the last comment if it is last post in the channel or the next post has a different root post + isLastComment = (i === 0 || posts[order[i-1]].root_id != post.root_id); + } - currentPostDay = utils.getDateForUnixTicks(post.create_at); - if(currentPostDay.getDate() !== previousPostDay.getDate() || currentPostDay.getMonth() !== previousPostDay.getMonth() || currentPostDay.getFullYear() !== previousPostDay.getFullYear()) { - postCtls.push( -
-
-
{currentPostDay.toDateString()}
-
- ); - } + var postCtl = ; - if (post.create_at > last_viewed && !rendered_last_viewed) { - rendered_last_viewed = true; - postCtls.push( -
-
-
New Messages
-
- ); + currentPostDay = utils.getDateForUnixTicks(post.create_at); + if(currentPostDay.getDate() !== previousPostDay.getDate() || currentPostDay.getMonth() !== previousPostDay.getMonth() || currentPostDay.getFullYear() !== previousPostDay.getFullYear()) { + postCtls.push( +
+
+
{currentPostDay.toDateString()}
+
+ ); + } + + if (post.create_at > last_viewed && !rendered_last_viewed) { + rendered_last_viewed = true; + postCtls.push( +
+
+
New Messages
+
+ ); + } + postCtls.push(postCtl); + previousPostDay = utils.getDateForUnixTicks(post.create_at); } - postCtls.push(postCtl); - previousPostDay = utils.getDateForUnixTicks(post.create_at); } - - if (posts == undefined) { + else { postCtls.push(
-- cgit v1.2.3-1-g7c22