From 87ff631eedcf23256184c482920960cc3c8b90e1 Mon Sep 17 00:00:00 2001 From: Leandro Date: Mon, 19 Feb 2018 09:50:07 +0100 Subject: [PATCH 1/7] fix translations keys and add germna translations to facebook plugin --- .../client/translations.yml | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/plugins/talk-plugin-facebook-auth/client/translations.yml b/plugins/talk-plugin-facebook-auth/client/translations.yml index 35a5c255c..ab72134f4 100644 --- a/plugins/talk-plugin-facebook-auth/client/translations.yml +++ b/plugins/talk-plugin-facebook-auth/client/translations.yml @@ -4,17 +4,21 @@ en: sign_up: "Sign up with Facebook" es: talk-plugin-facebook-auth: - facebook_sign_in: "Entrar con Facebook" - facebook_sign_up: "Registrarse con Facebook" + sign_in: "Entrar con Facebook" + sign_up: "Registrarse con Facebook" fr: talk-plugin-facebook-auth: - facebook_sign_in: "Connectez-vous avec Facebook" - facebook_sign_up: "Inscrivez-vous avec Facebook" + sign_in: "Connectez-vous avec Facebook" + sign_up: "Inscrivez-vous avec Facebook" zh_CN: talk-plugin-facebook-auth: - facebook_sign_in: "使用 Facebook 帐号" - facebook_sign_up: "使用 Facebook 帐号" + sign_in: "使用 Facebook 帐号" + sign_up: "使用 Facebook 帐号" zh_TW: talk-plugin-facebook-auth: - facebook_sign_in: "使用 Facebook 帳號" - facebook_sign_up: "使用 Facebook 帳號" + sign_in: "使用 Facebook 帳號" + sign_up: "使用 Facebook 帳號" +de: + talk-plugin-facebook-auth: + sign_in: "Mit Facebook anmelden" + sign_up: "Mit Facebook registrieren" \ No newline at end of file From 12497a1331cacf25367bbd5e4197f17213834307 Mon Sep 17 00:00:00 2001 From: okbel Date: Mon, 19 Feb 2018 12:07:57 -0300 Subject: [PATCH 2/7] Adding duration asHours and asDays --- .../src/components/AccountHistory.js | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/client/coral-admin/src/components/AccountHistory.js b/client/coral-admin/src/components/AccountHistory.js index 04df552be..73add8120 100644 --- a/client/coral-admin/src/components/AccountHistory.js +++ b/client/coral-admin/src/components/AccountHistory.js @@ -19,14 +19,30 @@ const buildUserHistory = (userState = {}) => { ); }; -const buildActionResponse = (typename, until, status) => { +/** readaebleDuration returns a readaeble duration of the suspension/ban in hours or days + * @param {} startDate + * @param {} endDate + */ +const readaebleDuration = (startDate, endDate) => { + const dur = moment.duration(moment(endDate).diff(moment(startDate))); + const durAsDays = dur.asDays().toFixed(0); + const durAsHours = dur.asHours().toFixed(0); + + return durAsHours > 23 + ? `${durAsDays} ${durAsDays > 1 ? 'days' : 'day'}` + : `${durAsHours} ${durAsHours > 1 ? 'hours' : 'hour'}`; +}; + +const buildActionResponse = (typename, created_at, until, status) => { switch (typename) { case 'UsernameStatusHistory': return `Username ${status}`; case 'BannedStatusHistory': return status ? 'User banned' : 'Ban removed'; case 'SuspensionStatusHistory': - return until ? 'Account Suspended' : 'Suspension removed'; + return until + ? `Suspended, ${readaebleDuration(created_at, until)}` + : 'Suspension removed'; default: return '-'; } @@ -77,7 +93,7 @@ class AccountHistory extends React.Component { 'talk-admin-account-history-row-status' )} > - {buildActionResponse(__typename, until, status)} + {buildActionResponse(__typename, created_at, until, status)}
Date: Mon, 19 Feb 2018 12:23:36 -0300 Subject: [PATCH 3/7] trim dates, style tooltip --- client/coral-admin/src/components/UserInfoTooltip.css | 8 ++++---- client/coral-admin/src/components/UserInfoTooltip.js | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/coral-admin/src/components/UserInfoTooltip.css b/client/coral-admin/src/components/UserInfoTooltip.css index 6b68e5cdf..10712273f 100644 --- a/client/coral-admin/src/components/UserInfoTooltip.css +++ b/client/coral-admin/src/components/UserInfoTooltip.css @@ -28,8 +28,8 @@ box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 1px 5px 0 rgba(0,0,0,0.12), 0 3px 1px -2px rgba(0,0,0,0.2); z-index: 10; top: 32px; - right: 0px; - width: 140px; + left: -10px; + width: 200px; text-align: left; color: #616161; } @@ -39,7 +39,7 @@ border: 10px solid transparent; border-top-color: #999; position: absolute; - right: 0px; + left: 8px; top: -20px; transform: rotate(180deg); } @@ -49,7 +49,7 @@ border: 10px solid transparent; border-top-color: white; position: absolute; - right: 0px; + left: 8px; top: -19px; transform: rotate(180deg); } diff --git a/client/coral-admin/src/components/UserInfoTooltip.js b/client/coral-admin/src/components/UserInfoTooltip.js index a5ff365fd..7af675d2c 100644 --- a/client/coral-admin/src/components/UserInfoTooltip.js +++ b/client/coral-admin/src/components/UserInfoTooltip.js @@ -67,7 +67,7 @@ class UserInfoTooltip extends React.Component { new Date( this.getLastHistoryItem(user, 'banned').created_at ) - ).format('MMMM Do YYYY, h:mm:ss a')} + ).format('MMM Do YYYY, h:mm:ss a')}
  • From 846df0a5e0dde53cd5ade3acbca3517aca54875e Mon Sep 17 00:00:00 2001 From: okbel Date: Mon, 19 Feb 2018 12:27:55 -0300 Subject: [PATCH 4/7] trim dates, style tooltip --- client/coral-admin/src/components/UserInfoTooltip.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/coral-admin/src/components/UserInfoTooltip.css b/client/coral-admin/src/components/UserInfoTooltip.css index 10712273f..3a766859e 100644 --- a/client/coral-admin/src/components/UserInfoTooltip.css +++ b/client/coral-admin/src/components/UserInfoTooltip.css @@ -28,7 +28,7 @@ box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 1px 5px 0 rgba(0,0,0,0.12), 0 3px 1px -2px rgba(0,0,0,0.2); z-index: 10; top: 32px; - left: -10px; + left: -100px; width: 200px; text-align: left; color: #616161; @@ -39,7 +39,7 @@ border: 10px solid transparent; border-top-color: #999; position: absolute; - left: 8px; + left: 96px; top: -20px; transform: rotate(180deg); } @@ -49,7 +49,7 @@ border: 10px solid transparent; border-top-color: white; position: absolute; - left: 8px; + left: 96px; top: -19px; transform: rotate(180deg); } From 233c514251358a59f8749d5913ab7c655d9a42e1 Mon Sep 17 00:00:00 2001 From: Kim Gardner Date: Tue, 20 Feb 2018 10:37:36 -0500 Subject: [PATCH 5/7] Fix small typo --- client/coral-admin/src/components/AccountHistory.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/coral-admin/src/components/AccountHistory.js b/client/coral-admin/src/components/AccountHistory.js index 73add8120..52f3af92d 100644 --- a/client/coral-admin/src/components/AccountHistory.js +++ b/client/coral-admin/src/components/AccountHistory.js @@ -19,11 +19,11 @@ const buildUserHistory = (userState = {}) => { ); }; -/** readaebleDuration returns a readaeble duration of the suspension/ban in hours or days +/** readableDuration returns a readable duration of the suspension/ban in hours or days * @param {} startDate * @param {} endDate */ -const readaebleDuration = (startDate, endDate) => { +const readableDuration = (startDate, endDate) => { const dur = moment.duration(moment(endDate).diff(moment(startDate))); const durAsDays = dur.asDays().toFixed(0); const durAsHours = dur.asHours().toFixed(0); @@ -41,7 +41,7 @@ const buildActionResponse = (typename, created_at, until, status) => { return status ? 'User banned' : 'Ban removed'; case 'SuspensionStatusHistory': return until - ? `Suspended, ${readaebleDuration(created_at, until)}` + ? `Suspended, ${readableDuration(created_at, until)}` : 'Suspension removed'; default: return '-'; From a16640434701c5230aa47e775ac5a43be35c8fcb Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 20 Feb 2018 09:31:08 -0700 Subject: [PATCH 6/7] fix for action count null --- graph/loaders/actions.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/graph/loaders/actions.js b/graph/loaders/actions.js index b5ea31a3f..77cc7138d 100644 --- a/graph/loaders/actions.js +++ b/graph/loaders/actions.js @@ -1,6 +1,6 @@ const DataLoader = require('dataloader'); const util = require('./util'); -const { first, get, merge, remove, groupBy, reduce } = require('lodash'); +const { first, get, merge, remove, groupBy, reduce, isNil } = require('lodash'); /** * Gets actions based on their item id's. @@ -35,10 +35,12 @@ const genActionsAuthoredWithID = ( * @param {Object} action_counts the action count object */ const iterateActionCounts = action_counts => - Object.keys(action_counts).map(action_type => ({ - count: action_counts[action_type], - action_type: action_type.toUpperCase(), - })); + !isNil(action_counts) + ? Object.keys(action_counts).map(action_type => ({ + count: action_counts[action_type], + action_type: action_type.toUpperCase(), + })) + : []; /** * getUserActions will get the actions made by the user for this specific From f918bbea20c47ea5f29013758d1edc6f7f5a237e Mon Sep 17 00:00:00 2001 From: Kim Gardner Date: Tue, 20 Feb 2018 11:45:36 -0500 Subject: [PATCH 7/7] Update version to 4.2.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4b1fd68cf..c61a5db45 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "talk", - "version": "4.2.1", + "version": "4.2.2", "description": "A better commenting experience from Mozilla, The New York Times, and the Washington Post. https://coralproject.net", "main": "app.js", "private": true,