From 20f932f935379f1c8753a313e6af93b274ccc133 Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Thu, 27 Aug 2020 16:31:22 -0400 Subject: [PATCH] add comment stats to creator analytics + fix up other minor issues and added weekly change figure to recent content app strings --- static/app-strings.json | 3 +++ ui/component/creatorAnalytics/view.jsx | 36 +++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/static/app-strings.json b/static/app-strings.json index 5d8118c91..f30fef2ff 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -1281,5 +1281,8 @@ "Not Now": "Not Now", "Enter your phone number and we will send you a verification code. We will not share your phone number with third parties.": "Enter your phone number and we will send you a verification code. We will not share your phone number with third parties.", "Number": "Number", + "%view_count% views - %view_count_change% this week": "%view_count% views - %view_count_change% this week", + "Most Commented Recent Content": "Most Commented Recent Content", + "%comment_count% comments - %comment_count_change% this week": "%comment_count% comments - %comment_count_change% this week", "--end--": "--end--" } diff --git a/ui/component/creatorAnalytics/view.jsx b/ui/component/creatorAnalytics/view.jsx index 52aa2796d..d15df8edc 100644 --- a/ui/component/creatorAnalytics/view.jsx +++ b/ui/component/creatorAnalytics/view.jsx @@ -179,10 +179,13 @@ export default function CreatorAnalytics(props: Props) {
{stats.VideoViewsTopNew === 1 - ? __('1 view', { view_count: stats.VideoViewsTopNew }) - : __('%view_count% views', { view_count: stats.VideoViewsTopNew })} + ? __('1 view') + : __('%view_count% views - %view_count_change% this week', { + view_count: stats.VideoViewsTopNew, + view_count_change: stats.VideoViewChangeTopNew, + })} - {stats.VideoViewsTopNew > 0 && } + {stats.VideoViewChangeTopNew > 0 && }
} @@ -213,6 +216,33 @@ export default function CreatorAnalytics(props: Props) { /> )} + {stats.VideoURITopCommentNew && stats.VideoCommentTopCommentNew > 0 && ( + +
+ +
+
+ + {stats.VideoCommentTopCommentNew === 1 + ? __('1 comment') + : __('%comment_count% comments - %comment_count_change% this week', { + comment_count: stats.VideoCommentTopCommentNew, + comment_count_change: stats.VideoCommentChangeTopCommentNew, + })} + + {stats.VideoCommentChangeTopCommentNew > 0 && ( + + )} +
+ + } + /> + )} +