From 219fcdddea9f87d6315c67437caf3f2d1a321d6a Mon Sep 17 00:00:00 2001 From: Nat Welch Date: Thu, 1 Feb 2018 13:26:34 -0500 Subject: [PATCH 1/6] Change text wrapping of Stories table --- client/coral-admin/src/routes/Stories/components/Stories.css | 1 + 1 file changed, 1 insertion(+) diff --git a/client/coral-admin/src/routes/Stories/components/Stories.css b/client/coral-admin/src/routes/Stories/components/Stories.css index e8e2b8474..63a05ab6a 100644 --- a/client/coral-admin/src/routes/Stories/components/Stories.css +++ b/client/coral-admin/src/routes/Stories/components/Stories.css @@ -56,6 +56,7 @@ width: 100%; border-left: none; border-right: none; + white-space: pre-wrap; a { color: rgb(44, 44, 44); From edac21a4f47f8c8c3a866c761b8e1ecf6adf1451 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Fri, 2 Feb 2018 11:52:42 +0100 Subject: [PATCH 2/6] Fix Flag Menu not working --- .../src/tabs/stream/components/FlagButton.js | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/client/coral-embed-stream/src/tabs/stream/components/FlagButton.js b/client/coral-embed-stream/src/tabs/stream/components/FlagButton.js index bc673ba28..b1974db36 100644 --- a/client/coral-embed-stream/src/tabs/stream/components/FlagButton.js +++ b/client/coral-embed-stream/src/tabs/stream/components/FlagButton.js @@ -8,6 +8,7 @@ import ClickOutside from 'coral-framework/components/ClickOutside'; import cn from 'classnames'; import styles from './FlagButton.css'; import * as REASONS from 'coral-framework/graphql/flagReasons'; +import PropTypes from 'prop-types'; import { getErrorMessages, forEachError } from 'coral-framework/utils'; @@ -77,9 +78,8 @@ export default class FlagButton extends Component { return; } break; - case this.props.getPopupMenu.length: - this.closeMenu(); - return; + default: + throw new Error(`Unexpected step ${step}`); } // If itemType and reason are both set, post the action @@ -92,6 +92,8 @@ export default class FlagButton extends Component { case 'USERS': item_id = author_id; break; + default: + throw new Error(`Unexpected itemType ${itemType}`); } let action = { @@ -132,6 +134,10 @@ export default class FlagButton extends Component { } if (!failed) { + if (step === this.props.getPopupMenu.length - 1) { + this.closeMenu(); + return; + } this.setState({ step: step + 1 }); } }; @@ -272,3 +278,12 @@ export default class FlagButton extends Component { ); } } + +FlagButton.propTypes = { + currentUser: PropTypes.object, + showSignInDialog: PropTypes.func, + notify: PropTypes.func, + getPopupMenu: PropTypes.array, + flaggedByCurrentUser: PropTypes.bool, + banned: PropTypes.bool, +}; From ac67b0484b283cc7a1c06316130ff6ec66e6f348 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Fri, 2 Feb 2018 12:12:58 +0100 Subject: [PATCH 3/6] Better fix --- .../src/tabs/stream/components/FlagButton.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/client/coral-embed-stream/src/tabs/stream/components/FlagButton.js b/client/coral-embed-stream/src/tabs/stream/components/FlagButton.js index b1974db36..002297415 100644 --- a/client/coral-embed-stream/src/tabs/stream/components/FlagButton.js +++ b/client/coral-embed-stream/src/tabs/stream/components/FlagButton.js @@ -78,6 +78,8 @@ export default class FlagButton extends Component { return; } break; + case 2: + return this.closeMenu(); default: throw new Error(`Unexpected step ${step}`); } @@ -134,10 +136,6 @@ export default class FlagButton extends Component { } if (!failed) { - if (step === this.props.getPopupMenu.length - 1) { - this.closeMenu(); - return; - } this.setState({ step: step + 1 }); } }; From aec0251c4fb8e1f8e604e7b7ebb6964bd8633741 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Fri, 2 Feb 2018 15:50:43 +0100 Subject: [PATCH 4/6] Fix zen mode --- .../src/routes/Moderation/components/ModerationQueue.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/coral-admin/src/routes/Moderation/components/ModerationQueue.js b/client/coral-admin/src/routes/Moderation/components/ModerationQueue.js index ce957b82d..93786013f 100644 --- a/client/coral-admin/src/routes/Moderation/components/ModerationQueue.js +++ b/client/coral-admin/src/routes/Moderation/components/ModerationQueue.js @@ -397,6 +397,13 @@ class ModerationQueue extends React.Component { const index = comments.findIndex( comment => comment.id === selectedCommentId ); + + // This can happen temporarily when we call redux to change the selected comment + // but it didn't fully take effect yet. + if (index === -1) { + return null; + } + const comment = comments[index]; return (
From 6b5a690c4f21b67656275aa328df226a6ef30be2 Mon Sep 17 00:00:00 2001 From: Matt Montgomery Date: Fri, 2 Feb 2018 17:04:01 -0700 Subject: [PATCH 5/6] Changes node requirement notation This changes the notation for the `node` requirement. Solves #1342 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6a3b1b447..1c801db93 100644 --- a/package.json +++ b/package.json @@ -218,7 +218,7 @@ "yaml-lint": "^1.0.0" }, "engines": { - "node": "^8" + "node": ">=8" }, "pre-commit": { "silent": false, From cb077a87dc05d5d2781c6018d2ccb86418c60b79 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 5 Feb 2018 17:22:13 +0100 Subject: [PATCH 6/6] Remove semicolon --- .../src/routes/Moderation/components/ModerationQueue.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/coral-admin/src/routes/Moderation/components/ModerationQueue.js b/client/coral-admin/src/routes/Moderation/components/ModerationQueue.js index 93786013f..0e7cbe347 100644 --- a/client/coral-admin/src/routes/Moderation/components/ModerationQueue.js +++ b/client/coral-admin/src/routes/Moderation/components/ModerationQueue.js @@ -421,7 +421,7 @@ class ModerationQueue extends React.Component { dangling={ !this.props.commentBelongToQueue(this.props.activeTab, comment) } - />; + />
); }