summaryrefslogtreecommitdiffstats
path: root/webapp/utils
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2017-01-30 11:49:00 -0500
committerGitHub <noreply@github.com>2017-01-30 11:49:00 -0500
commit39ee5737b7aa84833a1dc5b03c492b46e22209bd (patch)
tree61736473b9d62cd9aa9a4575198022b063711c55 /webapp/utils
parent63d68b3e36c2deaaeb7174edc1950fab3752d887 (diff)
downloadchat-39ee5737b7aa84833a1dc5b03c492b46e22209bd.tar.gz
chat-39ee5737b7aa84833a1dc5b03c492b46e22209bd.tar.bz2
chat-39ee5737b7aa84833a1dc5b03c492b46e22209bd.zip
PLT-2555/PLT-5009/PLT-5225 Changed system messages to be rendered by the client (#5209)
* Moved rendering of (message deleted) into PostMessageView * Added additional post types to constants on client * Changed system messages to be rendered in the client's language * Updated new system messages to have relevant usernames highlighted and have markdown rendered in header change messages
Diffstat (limited to 'webapp/utils')
-rw-r--r--webapp/utils/constants.jsx17
-rw-r--r--webapp/utils/post_utils.jsx2
-rw-r--r--webapp/utils/utils.jsx2
3 files changed, 16 insertions, 5 deletions
diff --git a/webapp/utils/constants.jsx b/webapp/utils/constants.jsx
index 646adbd15..dd9a4486e 100644
--- a/webapp/utils/constants.jsx
+++ b/webapp/utils/constants.jsx
@@ -228,6 +228,19 @@ export const TutorialSteps = {
MENU_POPOVER: 3
};
+export const PostTypes = {
+ JOIN_LEAVE: 'system_join_leave',
+ JOIN_CHANNEL: 'system_join_channel',
+ LEAVE_CHANNEL: 'system_leave_channel',
+ ADD_TO_CHANNEL: 'system_add_to_channel',
+ REMOVE_FROM_CHANNEL: 'system_remove_from_channel',
+ HEADER_CHANGE: 'system_header_change',
+ DISPLAYNAME_CHANGE: 'system_displayname_change',
+ PURPOSE_CHANGE: 'system_purpose_change',
+ CHANNEL_DELETED: 'system_channel_deleted',
+ EPHEMERAL: 'system_ephemeral'
+};
+
export const Constants = {
Preferences,
SocketEvents,
@@ -236,6 +249,7 @@ export const Constants = {
UserStatuses,
UserSearchOptions,
TutorialSteps,
+ PostTypes,
PayloadSources: keyMirror({
SERVER_ACTION: null,
@@ -349,9 +363,6 @@ export const Constants = {
POST_LOADING: 'loading',
POST_FAILED: 'failed',
POST_DELETED: 'deleted',
- POST_TYPE_EPHEMERAL: 'system_ephemeral',
- POST_TYPE_JOIN_LEAVE: 'system_join_leave',
- POST_TYPE_ATTACHMENT: 'slack_attachment',
SYSTEM_MESSAGE_PREFIX: 'system_',
SYSTEM_MESSAGE_PROFILE_NAME: 'System',
SYSTEM_MESSAGE_PROFILE_IMAGE: logoImage,
diff --git a/webapp/utils/post_utils.jsx b/webapp/utils/post_utils.jsx
index 20993b95c..0b908c55b 100644
--- a/webapp/utils/post_utils.jsx
+++ b/webapp/utils/post_utils.jsx
@@ -73,4 +73,4 @@ export function canEditPost(post, editDisableAction) {
}
}
return canEdit;
-} \ No newline at end of file
+}
diff --git a/webapp/utils/utils.jsx b/webapp/utils/utils.jsx
index 815e78e53..4e8a05075 100644
--- a/webapp/utils/utils.jsx
+++ b/webapp/utils/utils.jsx
@@ -1170,7 +1170,7 @@ export function clearFileInput(elm) {
}
export function isPostEphemeral(post) {
- return post.type === Constants.POST_TYPE_EPHEMERAL || post.state === Constants.POST_DELETED;
+ return post.type === Constants.PostTypes.EPHEMERAL || post.state === Constants.POST_DELETED;
}
export function getRootId(post) {