From a27044b69110c08418089eefeb438e4dee934f9d Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Tue, 11 Apr 2017 15:49:10 -0300 Subject: [PATCH 01/16] =?UTF-8?q?=C3=81dding=20style=20for=20the=20infoBox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/coral-embed-stream/style/default.css | 22 +++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/client/coral-embed-stream/style/default.css b/client/coral-embed-stream/style/default.css index 2ef617593..d4e68e360 100644 --- a/client/coral-embed-stream/style/default.css +++ b/client/coral-embed-stream/style/default.css @@ -80,8 +80,8 @@ hr { .coral-plugin-infobox-info { top: 0; border: 0; - background: rgb(35,118,216); - color: white; + background: #DEEDFF; + color: #2a2a2a; width: 100%; text-align: left; padding: 10px; @@ -92,6 +92,24 @@ hr { } +.coral-plugin-infobox-info em{ + font-style: italic; +} + +.coral-plugin-infobox-info strong{ + font-weight: bold; +} + +.coral-plugin-infobox-info blockquote{ + border-left: solid 2px #536d8c; + padding-left: 10px; +} + + +.coral-plugin-infobox-info a{ + color: #012d67; +} + .commentStream .material-icons { vertical-align: middle; width: 1em; From 93358564747587020f454ef0a2e0ae874101f2e1 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Tue, 11 Apr 2017 15:55:18 -0300 Subject: [PATCH 02/16] Links style --- client/coral-embed-stream/style/default.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/coral-embed-stream/style/default.css b/client/coral-embed-stream/style/default.css index d4e68e360..89436e000 100644 --- a/client/coral-embed-stream/style/default.css +++ b/client/coral-embed-stream/style/default.css @@ -101,13 +101,13 @@ hr { } .coral-plugin-infobox-info blockquote{ - border-left: solid 2px #536d8c; + border-left: solid 2px #2a2a2a; padding-left: 10px; } .coral-plugin-infobox-info a{ - color: #012d67; + color: #2a2a2a; } .commentStream .material-icons { From a7493af979f22bfb32a8aec5db020d108efcb655 Mon Sep 17 00:00:00 2001 From: gaba Date: Tue, 11 Apr 2017 11:58:19 -0700 Subject: [PATCH 03/16] Fix search box in Community Admin. --- .../Community/CommunityContainer.js | 20 ++++++++---- .../src/containers/Community/People.js | 32 ++++++++----------- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/client/coral-admin/src/containers/Community/CommunityContainer.js b/client/coral-admin/src/containers/Community/CommunityContainer.js index 4f65303ff..ecee9336c 100644 --- a/client/coral-admin/src/containers/Community/CommunityContainer.js +++ b/client/coral-admin/src/containers/Community/CommunityContainer.js @@ -28,11 +28,12 @@ class CommunityContainer extends Component { super(props); this.state = { - searchValue: '' + searchValue: '', + timer: null }; this.onKeyDownHandler = this.onKeyDownHandler.bind(this); - this.onChangeHandler = this.onChangeHandler.bind(this); + this.onSearchChange = this.onSearchChange.bind(this); this.onHeaderClickHandler = this.onHeaderClickHandler.bind(this); this.onNewPageHandler = this.onNewPageHandler.bind(this); } @@ -48,9 +49,16 @@ class CommunityContainer extends Component { } } - onChangeHandler(e) { - this.setState({ - searchValue: e.target.value + onSearchChange(e) { + const value = e.target.value; + this.setState((prevState) => { + prevState.searchValue = value; + clearTimeout(prevState.timer); + const fetchAccounts = this.props.fetchAccounts; + prevState.timer = setTimeout(() => { + fetchAccounts({value}); + }, 350); + return prevState; }); } @@ -86,11 +94,11 @@ class CommunityContainer extends Component { isFetching={community.isFetchingPeople} commenters={community.accounts} searchValue={searchValue} + onSearchChange={this.onSearchChange} error={community.errorPeople} totalPages={community.totalPagesPeople} page={community.pagePeople} onKeyDown={this.onKeyDownHandler} - onChange={this.onChangeHandler} onHeaderClickHandler={this.onHeaderClickHandler} onNewPageHandler={this.onNewPageHandler} /> diff --git a/client/coral-admin/src/containers/Community/People.js b/client/coral-admin/src/containers/Community/People.js index b5701b5a4..0011cd704 100644 --- a/client/coral-admin/src/containers/Community/People.js +++ b/client/coral-admin/src/containers/Community/People.js @@ -5,7 +5,7 @@ import translations from 'coral-admin/src/translations.json'; import styles from './Community.css'; import Table from './Table'; import Loading from './Loading'; -import {Pager} from 'coral-ui'; +import {Pager, Icon} from 'coral-ui'; import EmptyCard from '../../components/EmptyCard'; const lang = new I18n(translations); @@ -29,28 +29,22 @@ const tableHeaders = [ } ]; -const People = ({isFetching, commenters, ...props}) => { +const People = ({isFetching, commenters, searchValue, onSearchChange, ...props}) => { const hasResults = !isFetching && !!commenters.length; return (
-
-
- -
- -
-
-
+
+ + +
{ isFetching && } From 93ca0bf79dca4652dc4b25ed10ad9449d99fc8d9 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Tue, 11 Apr 2017 16:14:02 -0300 Subject: [PATCH 04/16] fixed flash messages --- client/coral-embed/src/index.js | 4 +++- client/coral-framework/actions/notification.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/client/coral-embed/src/index.js b/client/coral-embed/src/index.js index 21c176500..722f4ca8e 100644 --- a/client/coral-embed/src/index.js +++ b/client/coral-embed/src/index.js @@ -2,6 +2,7 @@ import pym from 'pym.js'; import {stringify} from 'querystring'; +// TODO: Styles should live in a separate file const snackbarStyles = { position: 'fixed', cursor: 'default', @@ -20,7 +21,8 @@ const snackbarStyles = { opacity: 0, transform: 'translate(-50%, 20px)', bottom: 0, - boxSizing: 'border-box' + boxSizing: 'border-box', + fontFamily: 'Helvetica, \'Helvetica Neue\', Verdana, sans-serif' }; // This function should return value of window.Coral diff --git a/client/coral-framework/actions/notification.js b/client/coral-framework/actions/notification.js index cb1aee5dd..37679972d 100644 --- a/client/coral-framework/actions/notification.js +++ b/client/coral-framework/actions/notification.js @@ -1,4 +1,4 @@ -import {pym} from '../../coral-framework'; +import pym from '../services/PymConnection'; export const addNotification = (notifType, text) => { pym.sendMessage('coral-alert', `${notifType}|${text}`); From c5520e3fb66e67ac61aa9445d23a413b167ab280 Mon Sep 17 00:00:00 2001 From: gaba Date: Tue, 11 Apr 2017 12:22:05 -0700 Subject: [PATCH 05/16] Adds missing template. --- services/email/suspension.html.ejs | 1 + 1 file changed, 1 insertion(+) create mode 100644 services/email/suspension.html.ejs diff --git a/services/email/suspension.html.ejs b/services/email/suspension.html.ejs new file mode 100644 index 000000000..b36560ec5 --- /dev/null +++ b/services/email/suspension.html.ejs @@ -0,0 +1 @@ +<%= body %> From 3a3b89b03b24ba19f154c98f4da41b057540900f Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 11 Apr 2017 14:59:02 -0600 Subject: [PATCH 06/16] Fixed bugs with plugin install --- package.json | 2 +- plugins.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f4e2eb725..d974a78d4 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "e2e": "NODE_ENV=test nightwatch", "poste2e": "NODE_ENV=test scripts/poste2e.sh", "embed-start": "NODE_ENV=development yarn build && ./bin/cli serve --jobs", - "heroku-postbuild": "yarn build" + "heroku-postbuild": "./bin/cli plugins reconcile && yarn build" }, "config": { "pre-git": { diff --git a/plugins.js b/plugins.js index 02cdb58e1..65e80dee5 100644 --- a/plugins.js +++ b/plugins.js @@ -124,7 +124,12 @@ function itteratePlugins(plugins) { // Add each plugin folder to the allowed import path so that they can import our // internal dependancies. Object.keys(plugins).forEach((type) => itteratePlugins(plugins[type]).forEach((plugin) => { - amp.enableForDir(path.dirname(plugin.path)); + + // The plugin may be remote, and therefore not installed. We check here if the + // plugin path is available before trying to monkeypatch it's require path. + if (plugin.path) { + amp.enableForDir(path.dirname(plugin.path)); + } })); /** From 3c6ce7a80f8221e921f19156e7a1416ce4bc31af Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Tue, 11 Apr 2017 21:56:43 -0300 Subject: [PATCH 07/16] QuestionBox --- client/coral-embed-stream/style/default.css | 21 ++++++++++++------- .../coral-plugin-questionbox/QuestionBox.js | 4 +++- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/client/coral-embed-stream/style/default.css b/client/coral-embed-stream/style/default.css index 89436e000..41ec7a64b 100644 --- a/client/coral-embed-stream/style/default.css +++ b/client/coral-embed-stream/style/default.css @@ -129,15 +129,15 @@ hr { margin-bottom: 0px; font-weight: bold; font-size: 14px; - display: block; overflow: hidden; - height: 50px; + min-height: 50px; + display: flex; } .coral-plugin-questionbox-icon.bubble{ position: absolute; top: 11px; - left: 15px; + left: 10px; color: #949393; font-size: 20px; z-index: 0; @@ -146,7 +146,7 @@ hr { .coral-plugin-questionbox-icon.person{ z-index: 2; top: 20px; - left: 20px; + left: 15px; position: absolute; font-size: 24px; color: white; @@ -161,12 +161,19 @@ hr { margin-left: 0px !important; margin-right: 10px; display: inline-block; - width: 15px; - height: 100%; - padding: 3px 20px; + width: 10px; + min-height: 100%; + padding: 5px 20px; vertical-align: middle; } +.coral-plugin-questionbox-content { + padding: 5px; + display: flex; + align-items: center; + justify-content: center; +} + .hidden { visibility: hidden; display: none; diff --git a/client/coral-plugin-questionbox/QuestionBox.js b/client/coral-plugin-questionbox/QuestionBox.js index 3c2410d44..31ad45869 100644 --- a/client/coral-plugin-questionbox/QuestionBox.js +++ b/client/coral-plugin-questionbox/QuestionBox.js @@ -7,7 +7,9 @@ const QuestionBox = ({enable, content}) => chat_bubble person
- {content} +
+ {content} +
; export default QuestionBox; From e4aa98b87a1446d19fbf8d00d71fdbdc9d4aab42 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Tue, 11 Apr 2017 22:00:55 -0300 Subject: [PATCH 08/16] Hidding login as --- client/coral-embed-stream/src/Embed.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/coral-embed-stream/src/Embed.js b/client/coral-embed-stream/src/Embed.js index d9b5c8310..673fee69e 100644 --- a/client/coral-embed-stream/src/Embed.js +++ b/client/coral-embed-stream/src/Embed.js @@ -158,7 +158,7 @@ class Embed extends Component { this.props.data.refetch(); }}>{lang.t('showAllComments')} } - {loggedIn && this.props.logout().then(refetch)} changeTab={this.changeTab}/>} + {loggedIn && activeTab !== 1 && this.props.logout().then(refetch)} changeTab={this.changeTab}/>} { openStream From 63b630833a86d83f6845cc8d083f3e6ef7cf07ad Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Tue, 11 Apr 2017 22:12:10 -0300 Subject: [PATCH 09/16] Fake Comment Style --- client/coral-sign-in/components/FakeComment.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client/coral-sign-in/components/FakeComment.js b/client/coral-sign-in/components/FakeComment.js index b5af6bf1c..518bda5e3 100644 --- a/client/coral-sign-in/components/FakeComment.js +++ b/client/coral-sign-in/components/FakeComment.js @@ -28,10 +28,10 @@ class FakeComment extends React.Component { author={{'name': username}}/> -
+
- @@ -43,16 +43,16 @@ class FakeComment extends React.Component { banned={false} />
-
+
From 2e3021e66bd6612e10bdc27f9e19dab5b8514cfe Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Tue, 11 Apr 2017 22:17:04 -0300 Subject: [PATCH 10/16] Linting --- client/coral-sign-in/components/FakeComment.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/coral-sign-in/components/FakeComment.js b/client/coral-sign-in/components/FakeComment.js index 518bda5e3..f5926852c 100644 --- a/client/coral-sign-in/components/FakeComment.js +++ b/client/coral-sign-in/components/FakeComment.js @@ -30,8 +30,8 @@ class FakeComment extends React.Component {
- From 6ac4bcf796876865e482e7975f1e58e3a4d086fa Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 11 Apr 2017 22:25:13 -0600 Subject: [PATCH 11/16] Fixed plugin validation --- plugins.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins.js b/plugins.js index 65e80dee5..22293c975 100644 --- a/plugins.js +++ b/plugins.js @@ -47,8 +47,8 @@ const hookSchemas = { pre: Joi.func(), post: Joi.func() }))), - loaders: Joi.object().pattern(/\w/, Joi.object().pattern(/\w/, Joi.func())), - mutators: Joi.object().pattern(/\w/, Joi.object().pattern(/\w/, Joi.func())), + loaders: Joi.func().maxArity(1), + mutators: Joi.func().maxArity(1), resolvers: Joi.object().pattern(/\w/, Joi.object().pattern(/(?:__resolveType|\w+)/, Joi.func())), typeDefs: Joi.string() }; From cc0f757746c32a745abb920947b47c416b88e6b3 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Wed, 12 Apr 2017 08:16:02 -0300 Subject: [PATCH 12/16] Removing username --- client/coral-embed-stream/src/Embed.js | 2 +- client/coral-settings/containers/ProfileContainer.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/client/coral-embed-stream/src/Embed.js b/client/coral-embed-stream/src/Embed.js index 673fee69e..d9b5c8310 100644 --- a/client/coral-embed-stream/src/Embed.js +++ b/client/coral-embed-stream/src/Embed.js @@ -158,7 +158,7 @@ class Embed extends Component { this.props.data.refetch(); }}>{lang.t('showAllComments')} } - {loggedIn && activeTab !== 1 && this.props.logout().then(refetch)} changeTab={this.changeTab}/>} + {loggedIn && this.props.logout().then(refetch)} changeTab={this.changeTab}/>} { openStream diff --git a/client/coral-settings/containers/ProfileContainer.js b/client/coral-settings/containers/ProfileContainer.js index 9a8117e87..6df926c7c 100644 --- a/client/coral-settings/containers/ProfileContainer.js +++ b/client/coral-settings/containers/ProfileContainer.js @@ -44,7 +44,6 @@ class ProfileContainer extends Component { return (
- { // Hiding bio until moderation can get figured out From 1a678a0cb31525e49b001e5f21cd93f8f4d3c27b Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Wed, 12 Apr 2017 08:21:39 -0300 Subject: [PATCH 13/16] Removing username -- with lintin --- client/coral-settings/containers/ProfileContainer.js | 1 - 1 file changed, 1 deletion(-) diff --git a/client/coral-settings/containers/ProfileContainer.js b/client/coral-settings/containers/ProfileContainer.js index 6df926c7c..331069058 100644 --- a/client/coral-settings/containers/ProfileContainer.js +++ b/client/coral-settings/containers/ProfileContainer.js @@ -8,7 +8,6 @@ import {myCommentHistory} from 'coral-framework/graphql/queries'; import {link} from 'coral-framework/services/PymConnection'; import NotLoggedIn from '../components/NotLoggedIn'; import {Spinner} from 'coral-ui'; -import ProfileHeader from '../components/ProfileHeader'; import CommentHistory from 'coral-plugin-history/CommentHistory'; import translations from '../translations'; From 8e76a34631341f48f491a2c5783e47ddd43d0703 Mon Sep 17 00:00:00 2001 From: Kim Gardner Date: Wed, 12 Apr 2017 08:45:19 -0400 Subject: [PATCH 14/16] Bump version and update description --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d974a78d4..41d8732de 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "talk", - "version": "1.4.0", - "description": "A commenting platform from The Coral Project. https://coralproject.net", + "version": "1.5.0", + "description": "A better commenting experience from Mozilla, The New York Times, and the Washington Post. https://coralproject.net", "main": "app.js", "scripts": { "postinstall": "./bin/cli plugins reconcile --skip-remote", From d74cdd938f51d09a14d5e5004a5e8f4dee9c79e3 Mon Sep 17 00:00:00 2001 From: Kim Gardner Date: Wed, 12 Apr 2017 09:51:32 -0400 Subject: [PATCH 15/16] Double quotes should be single --- client/coral-sign-in/translations.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/coral-sign-in/translations.json b/client/coral-sign-in/translations.json index 824888cca..e0203e0af 100644 --- a/client/coral-sign-in/translations.json +++ b/client/coral-sign-in/translations.json @@ -25,14 +25,14 @@ "emailInUse": "Email address already in use", "emailORusernameInUse": "Email address or Username already in use", "requiredField": "This field is required", - "passwordsDontMatch": "Passwords don\"t match.", + "passwordsDontMatch": "Passwords don\'t match.", "specialCharacters": "Usernames can contain letters, numbers and _ only", "checkTheForm": "Invalid Form. Please, check the fields" }, "createdisplay": { "writeyourusername": "Edit your username", "yourusername": "Your username appears on every comment you post.", - "ifyoudontchangeyourname": "If you don\"t change your username at this step, your Facebook display name will appear alongside of all your comments.", + "ifyoudontchangeyourname": "If you don\'t change your username at this step, your Facebook display name will appear alongside of all your comments.", "username": "Username", "continue": "Continue with the same Facebook username", "save": "Save", From a19d6544a7fa15c9785b452706a578d41d0893d2 Mon Sep 17 00:00:00 2001 From: Kim Gardner Date: Wed, 12 Apr 2017 10:05:21 -0400 Subject: [PATCH 16/16] Don't need to escape single quotes within double quotes --- client/coral-sign-in/translations.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/coral-sign-in/translations.json b/client/coral-sign-in/translations.json index e0203e0af..7ae84b2ff 100644 --- a/client/coral-sign-in/translations.json +++ b/client/coral-sign-in/translations.json @@ -25,14 +25,14 @@ "emailInUse": "Email address already in use", "emailORusernameInUse": "Email address or Username already in use", "requiredField": "This field is required", - "passwordsDontMatch": "Passwords don\'t match.", + "passwordsDontMatch": "Passwords don't match.", "specialCharacters": "Usernames can contain letters, numbers and _ only", "checkTheForm": "Invalid Form. Please, check the fields" }, "createdisplay": { "writeyourusername": "Edit your username", "yourusername": "Your username appears on every comment you post.", - "ifyoudontchangeyourname": "If you don\'t change your username at this step, your Facebook display name will appear alongside of all your comments.", + "ifyoudontchangeyourname": "If you don't change your username at this step, your Facebook display name will appear alongside of all your comments.", "username": "Username", "continue": "Continue with the same Facebook username", "save": "Save",