From c257379846f2308c69c6546efa6319aecb4fc67f Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Thu, 18 Oct 2018 10:14:42 -0400 Subject: [PATCH 1/3] Add * to comments from staff on preview This requires the API to include the `is_staff` flag, but it will not change functionality if it is not there, everyone would be considered not staff, which is the current behavior. --- src/views/preview/comment/comment.jsx | 5 ++++- src/views/preview/comment/top-level-comment.jsx | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/views/preview/comment/comment.jsx b/src/views/preview/comment/comment.jsx index bcd5a6e33..a4405d219 100644 --- a/src/views/preview/comment/comment.jsx +++ b/src/views/preview/comment/comment.jsx @@ -111,7 +111,9 @@ class Comment extends React.Component { {author.username} + > + {author.username}{author.is_staff ? '*' : ''} +
{visible ? ( @@ -214,6 +216,7 @@ Comment.propTypes = { author: PropTypes.shape({ id: PropTypes.number, image: PropTypes.string, + is_staff: PropTypes.bool, username: PropTypes.string }), canDelete: PropTypes.bool, diff --git a/src/views/preview/comment/top-level-comment.jsx b/src/views/preview/comment/top-level-comment.jsx index ad09eabbe..c21b1d37b 100644 --- a/src/views/preview/comment/top-level-comment.jsx +++ b/src/views/preview/comment/top-level-comment.jsx @@ -142,6 +142,7 @@ TopLevelComment.propTypes = { author: PropTypes.shape({ id: PropTypes.number, image: PropTypes.string, + is_staff: PropTypes.bool, username: PropTypes.string }), canDelete: PropTypes.bool, From 61947f23908c47177240424abea8bb9d6accfd18 Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Thu, 18 Oct 2018 13:09:08 -0400 Subject: [PATCH 2/3] Use scratchteam instead of is_staff --- src/views/preview/comment/comment.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/preview/comment/comment.jsx b/src/views/preview/comment/comment.jsx index a4405d219..2626b653e 100644 --- a/src/views/preview/comment/comment.jsx +++ b/src/views/preview/comment/comment.jsx @@ -112,7 +112,7 @@ class Comment extends React.Component { className="username" href={`/users/${author.username}`} > - {author.username}{author.is_staff ? '*' : ''} + {author.username}{author.scratchteam ? '*' : ''}
{visible ? ( @@ -216,7 +216,7 @@ Comment.propTypes = { author: PropTypes.shape({ id: PropTypes.number, image: PropTypes.string, - is_staff: PropTypes.bool, + scratchteam: PropTypes.bool, username: PropTypes.string }), canDelete: PropTypes.bool, From 4f6f7502ae72a9fb5877fed825dad13722081326 Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Thu, 18 Oct 2018 13:09:43 -0400 Subject: [PATCH 3/3] Use scratchteam instead of is_staff --- src/views/preview/comment/top-level-comment.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/preview/comment/top-level-comment.jsx b/src/views/preview/comment/top-level-comment.jsx index c21b1d37b..4fc184a85 100644 --- a/src/views/preview/comment/top-level-comment.jsx +++ b/src/views/preview/comment/top-level-comment.jsx @@ -142,7 +142,7 @@ TopLevelComment.propTypes = { author: PropTypes.shape({ id: PropTypes.number, image: PropTypes.string, - is_staff: PropTypes.bool, + scratchteam: PropTypes.bool, username: PropTypes.string }), canDelete: PropTypes.bool,