From 18f7b07198353e21eb7b1d920ac9826d1945daaa Mon Sep 17 00:00:00 2001 From: David Jay Date: Wed, 7 Dec 2016 21:12:31 -0500 Subject: [PATCH] Addressing setting bug caused by open thread feature. --- .../coral-embed-stream/src/CommentStream.js | 8 ++++---- client/coral-framework/actions/config.js | 2 +- client/coral-framework/reducers/config.js | 2 +- client/coral-framework/reducers/items.js | 3 +-- client/coral-plugin-flags/FlagButton.js | 6 +++--- client/coral-plugin-flags/translations.json | 20 ++++++++++++++++--- client/coral-ui/components/Button.css | 2 +- 7 files changed, 28 insertions(+), 15 deletions(-) diff --git a/client/coral-embed-stream/src/CommentStream.js b/client/coral-embed-stream/src/CommentStream.js index 93a2c186e..76a73171a 100644 --- a/client/coral-embed-stream/src/CommentStream.js +++ b/client/coral-embed-stream/src/CommentStream.js @@ -80,7 +80,7 @@ class CommentStream extends Component { const rootItem = this.props.items.assets && this.props.items.assets[rootItemId]; const {actions, users, comments} = this.props.items; const {loggedIn, user, showSignInDialog} = this.props.auth; - const {status} = this.props.config; + const {status, moderation} = this.props.config; const {activeTab} = this.state; return
@@ -109,7 +109,7 @@ class CommentStream extends Component { appendItemArray={this.props.appendItemArray} updateItem={this.props.updateItem} id={rootItemId} - premod={this.props.config.moderation} + premod={moderation} reply={false} author={user} /> @@ -165,7 +165,7 @@ class CommentStream extends Component { id={rootItemId} author={user} parent_id={commentId} - premod={this.props.config.moderation} + premod={moderation} showReply={comment.showReply}/> { comment.children && @@ -218,7 +218,7 @@ class CommentStream extends Component { author={user} parent_id={commentId} child_id={replyId} - premod={this.props.config.moderation} + premod={moderation} showReply={reply.showReply}/>
; }) diff --git a/client/coral-framework/actions/config.js b/client/coral-framework/actions/config.js index 6dc880434..b516ba7cd 100644 --- a/client/coral-framework/actions/config.js +++ b/client/coral-framework/actions/config.js @@ -4,7 +4,7 @@ import coralApi from '../helpers/response'; /** * Action name constants */ - +export const UPDATE_SETTINGS = 'UPDATE_SETTINGS'; export const OPEN_COMMENTS = 'OPEN_COMMENTS'; export const CLOSE_COMMENTS = 'CLOSE_COMMENTS'; export const ADD_ITEM = 'ADD_ITEM'; diff --git a/client/coral-framework/reducers/config.js b/client/coral-framework/reducers/config.js index 9620f5b97..0b7773d1c 100644 --- a/client/coral-framework/reducers/config.js +++ b/client/coral-framework/reducers/config.js @@ -12,7 +12,7 @@ export default (state = initialState, action) => { switch(action.type) { // Override config if worked case actions.UPDATE_SETTINGS: - return action.config; + return state.merge(action.config); case actions.OPEN_COMMENTS: return state.set('status', 'open'); diff --git a/client/coral-framework/reducers/items.js b/client/coral-framework/reducers/items.js index 17569c545..93388c1ab 100644 --- a/client/coral-framework/reducers/items.js +++ b/client/coral-framework/reducers/items.js @@ -6,7 +6,7 @@ import * as actions from '../actions/items'; const initialState = fromJS({ comments: {}, users: {}, - actions: {} + actions: {} }); export default (state = initialState, action) => { @@ -17,7 +17,6 @@ export default (state = initialState, action) => { return state.setIn([action.item_type, action.id, action.property], fromJS(action.value)); case actions.APPEND_ITEM_ARRAY: return state.updateIn([action.item_type, action.id, action.property], (prop) => { - console.log(prop); if (action.add_to_front) { return prop ? prop.unshift(fromJS(action.value)) : fromJS([action.value]); } else { diff --git a/client/coral-plugin-flags/FlagButton.js b/client/coral-plugin-flags/FlagButton.js index 115d1a577..8dd484604 100644 --- a/client/coral-plugin-flags/FlagButton.js +++ b/client/coral-plugin-flags/FlagButton.js @@ -58,13 +58,13 @@ export default class FlagButton extends Component { {val: 'I don\'t agree with this comment', text: lang.t('no-agree-comment')}, {val: 'This comment is offensive', text: lang.t('comment-offensive')}, {val: 'This comment reveals personally identifiable inforation without consent', text: lang.t('personal-info')}, - {val: 'Other', text: 'Other'}, + {val: 'Other', text: lang.t('other')}, ] : [ {val: 'This username is offensive', text: lang.t('username-offensive')}, {val: 'I don\'t like this username', text: lang.t('no-like-username')}, - {val: 'This looks like an ad/marketing', text: lang.t('marketing')}, - {val: 'Other', text: 'Other'}, + {val: 'This looks like an ad/marketing', text: lang.t('marketing ')}, + {val: 'Other', text: lang.t('other')}, ]; return { header: lang.t('step-2-header'), diff --git a/client/coral-plugin-flags/translations.json b/client/coral-plugin-flags/translations.json index 4cba5b40d..ac6c95523 100644 --- a/client/coral-plugin-flags/translations.json +++ b/client/coral-plugin-flags/translations.json @@ -12,17 +12,31 @@ "continue": "Continue", "no-agree-comment": "I don't agree with this comment", "comment-offensive": "This comment is offensive", - "personal-info": "This comment reveals personally identifiable inforation without consent", + "personal-info": "This comment reveals personally identifiable information", "username-offensive": "This username is offensive", "no-like-username": "I don't like this username", "marketing": "This looks like an ad/marketing", - "thank-you": "We value your safety and feedback. A moderator will review your flag." + "thank-you": "We value your safety and feedback. A moderator will review your flag.", + "other": "Other" }, "es": { "report": "Informe", "reported": "Informado", "report-notif": "Gracias por marcar este comentario. Nuestro equipo de moderación ha sido notificado y muy pronto lo va a revisar.", "report-notif-remove": "¡traduceme!", - "report-header": "¡traduceme!" + "step-1-header": "¡traduceme!", + "step-2-header": "¡traduceme!", + "step-3-header": "¡traduceme!", + "flag-username": "¡traduceme!", + "flag-comment": "¡traduceme!", + "continue": "¡traduceme!", + "no-agree-comment": "¡traduceme!", + "comment-offensive": "¡traduceme!", + "personal-info": "¡traduceme!", + "username-offensive": "¡traduceme!", + "no-like-username": "¡traduceme!", + "marketing": "¡traduceme!", + "thank-you": "¡traduceme!", + "other": "¡traduceme!" } } diff --git a/client/coral-ui/components/Button.css b/client/coral-ui/components/Button.css index 3a3a4221e..e8e41e3ab 100644 --- a/client/coral-ui/components/Button.css +++ b/client/coral-ui/components/Button.css @@ -21,7 +21,7 @@ cursor: pointer; text-decoration: none; text-align: center; - line-height: 36px; + line-height: 28px; vertical-align: middle; margin: 2px; }