From ae5d1898037be4f59bf6517ad76b13cc16f595ce Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Thu, 22 Oct 2015 18:04:06 -0700 Subject: Adding analytics tab --- web/react/utils/client.jsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'web/react/utils') diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx index f92633439..eca4f4b3e 100644 --- a/web/react/utils/client.jsx +++ b/web/react/utils/client.jsx @@ -327,6 +327,20 @@ export function getConfig(success, error) { }); } +export function getAnalytics(teamId, name, success, error) { + $.ajax({ + url: '/api/v1/admin/analytics/' + teamId + '/' + name, + dataType: 'json', + contentType: 'application/json', + type: 'GET', + success, + error: function onError(xhr, status, err) { + var e = handleError('getAnalytics', xhr, status, err); + error(e); + } + }); +} + export function saveConfig(config, success, error) { $.ajax({ url: '/api/v1/admin/save_config', -- cgit v1.2.3-1-g7c22 From 834e1a8b58496e721f086f04612658c4a22c8d7d Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Mon, 26 Oct 2015 22:13:40 -0700 Subject: adding arrow notation --- web/react/utils/client.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/react/utils') diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx index fe5797769..bf117b3b3 100644 --- a/web/react/utils/client.jsx +++ b/web/react/utils/client.jsx @@ -335,7 +335,7 @@ export function getAnalytics(teamId, name, success, error) { contentType: 'application/json', type: 'GET', success, - error: function onError(xhr, status, err) { + error: (xhr, status, err) => { var e = handleError('getAnalytics', xhr, status, err); error(e); } -- cgit v1.2.3-1-g7c22 From c91f4f8ab12c07db0ddac1de5dfda12961cf95ba Mon Sep 17 00:00:00 2001 From: Florian Orben Date: Wed, 28 Oct 2015 01:19:15 +0100 Subject: Dont display '1 minute ago' timestamps for post posted < than 1 minute ago --- web/react/utils/utils.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'web/react/utils') diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index fadab27a7..3140a5d77 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -211,11 +211,15 @@ export function displayDateTime(ticks) { } interval = Math.floor(seconds / 60); - if (interval > 1) { + if (interval >= 2) { return interval + ' minutes ago'; } - return '1 minute ago'; + if (interval >= 1) { + return '1 minute ago'; + } + + return 'just now'; } export function displayCommentDateTime(ticks) { -- cgit v1.2.3-1-g7c22