From 9222ee57a586496b191db0ca75908b26549fc3aa Mon Sep 17 00:00:00 2001 From: Harrison Reid Date: Thu, 4 Oct 2018 18:44:26 +1000 Subject: [PATCH 01/24] Update text and description in moderation configure view Rename include_comment_stream to code_of_conduct_summary, update text. Rename include_comment_stream_desc to code_of_conduct_summary_desc, update text. --- .../src/routes/Configure/components/StreamSettings.js | 4 ++-- locales/ar.yml | 4 ++-- locales/da.yml | 4 ++-- locales/de.yml | 4 ++-- locales/en.yml | 6 +++--- locales/es.yml | 4 ++-- locales/fi_FI.yml | 4 ++-- locales/fr.yml | 4 ++-- locales/nl_NL.yml | 4 ++-- locales/pt_BR.yml | 8 ++++---- locales/zh_CN.yml | 4 ++-- locales/zh_TW.yml | 4 ++-- 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/client/coral-admin/src/routes/Configure/components/StreamSettings.js b/client/coral-admin/src/routes/Configure/components/StreamSettings.js index 969155d48..5f98da3d7 100644 --- a/client/coral-admin/src/routes/Configure/components/StreamSettings.js +++ b/client/coral-admin/src/routes/Configure/components/StreamSettings.js @@ -155,9 +155,9 @@ class StreamSettings extends React.Component { -

{t('configure.include_comment_stream_desc')}

+

{t('configure.code_of_conduct_summary_desc')}

Date: Fri, 12 Oct 2018 19:13:04 +0200 Subject: [PATCH 02/24] Display avatar left of comments by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously avatars would be displayed on top of comments. Most comment and forum systems will display avatars to the left of comments/posts. The https://github.com/snorremd/talk-plugin-gravatar plugin currently renders avatars in the avatar slot which will render the avatar on top of the comments. This change modified the comment container to be displayed as a flex container with row direction. It also adds 10px top margin to the avatar slot which corresponds with the comment header. Signed-off-by: Snorre Magnus Davøen --- .../src/tabs/stream/components/Comment.css | 1 + client/coral-embed-stream/style/default.css | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/client/coral-embed-stream/src/tabs/stream/components/Comment.css b/client/coral-embed-stream/src/tabs/stream/components/Comment.css index 58ff0e731..8b7257b46 100644 --- a/client/coral-embed-stream/src/tabs/stream/components/Comment.css +++ b/client/coral-embed-stream/src/tabs/stream/components/Comment.css @@ -138,6 +138,7 @@ } .commentAvatar { + margin-top: 10px; max-width: 60px; } diff --git a/client/coral-embed-stream/style/default.css b/client/coral-embed-stream/style/default.css index b9330ba62..6cd9bd580 100644 --- a/client/coral-embed-stream/style/default.css +++ b/client/coral-embed-stream/style/default.css @@ -112,6 +112,11 @@ body { position: relative; } +.talk-stream-comment { + display: flex; + flex-direction: row; +} + /* Comment styles */ .comment { margin-bottom: 10px; From fd7114ab2ac976107319347d97177166a8e03a13 Mon Sep 17 00:00:00 2001 From: Harrison Reid Date: Thu, 18 Oct 2018 21:06:00 +1100 Subject: [PATCH 03/24] Keep question box visible when comment stream is closed --- .../src/tabs/stream/components/Stream.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/coral-embed-stream/src/tabs/stream/components/Stream.js b/client/coral-embed-stream/src/tabs/stream/components/Stream.js index b097f3d57..f430bd7b4 100644 --- a/client/coral-embed-stream/src/tabs/stream/components/Stream.js +++ b/client/coral-embed-stream/src/tabs/stream/components/Stream.js @@ -305,6 +305,14 @@ class Stream extends React.Component { ) : ( )} + {questionBoxEnable && ( + + + + )}
)} From 130dc578b3d0a9ff5b4b8b028cd5d8172a92019a Mon Sep 17 00:00:00 2001 From: Harrison Reid Date: Thu, 18 Oct 2018 21:25:36 +1100 Subject: [PATCH 04/24] Refactor Stream component, move QuestionBox render logic into seperate fn --- .../src/tabs/stream/components/Stream.js | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/client/coral-embed-stream/src/tabs/stream/components/Stream.js b/client/coral-embed-stream/src/tabs/stream/components/Stream.js index f430bd7b4..73b4fbcfd 100644 --- a/client/coral-embed-stream/src/tabs/stream/components/Stream.js +++ b/client/coral-embed-stream/src/tabs/stream/components/Stream.js @@ -206,15 +206,30 @@ class Stream extends React.Component { ); } + renderQuestionBox() { + const { + root, + asset, + asset: { + settings: { questionBoxEnable, questionBoxContent, questionBoxIcon }, + }, + } = this.props; + const slotPassthrough = { root, asset }; + if (questionBoxEnable) { + return ( + + + + ); + } + } + render() { const { root, appendItemArray, asset, - asset: { - comment: highlightedComment, - settings: { questionBoxEnable }, - }, + asset: { comment: highlightedComment }, postComment, notify, updateItem, @@ -260,14 +275,7 @@ class Stream extends React.Component { content={asset.settings.infoBoxContent} enable={asset.settings.infoBoxEnable} /> - {questionBoxEnable && ( - - - - )} + {this.renderQuestionBox()} {!banned && temporarilySuspended && ( @@ -305,14 +313,7 @@ class Stream extends React.Component { ) : ( )} - {questionBoxEnable && ( - - - - )} + {this.renderQuestionBox()} )} From 7ad3d247b5a09c6d4dd273e4509df405b98520a1 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Thu, 18 Oct 2018 14:33:45 -0600 Subject: [PATCH 05/24] feat: added base64 secret encoding --- docs/source/02-02-advanced-configuration.md | 17 +++++++++++++++-- services/jwt.js | 5 +++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/docs/source/02-02-advanced-configuration.md b/docs/source/02-02-advanced-configuration.md index 083b4bcdb..49769be0b 100644 --- a/docs/source/02-02-advanced-configuration.md +++ b/docs/source/02-02-advanced-configuration.md @@ -246,6 +246,21 @@ Refer to the documentation for [TALK_JWT_ALG](#talk-jwt-alg) for other signing methods and other forms of the `TALK_JWT_SECRET`. If you are interested in using multiple keys, then refer to [TALK_JWT_SECRETS](#talk-jwt-secrets). +You can also encode your secret as a base64 string (if you are using a symmetric +algorithm) as long as you prefix it with `base64:`. For example: + +```plain +TALK_JWT_SECRET={"secret": "base64:dGVzdA=="} +``` + +Would be the same as: + +```plain +TALK_JWT_SECRET={"secret": "test"} +``` + +As `dGVzdA==` is just `test` encoded using base64. + ## TALK_JWT_SECRETS Used when specifying multiple secrets used for key rotations. This is a JSON @@ -271,7 +286,6 @@ Note that the secret is stored in a JSON object, keyed by `secret`. This is only needed when specifying in the multiple secrets for `TALK_JWT_SECRETS`, but may be used to specify the single [TALK_JWT_SECRET](#talk-jwt-secret). - When the value of [TALK_JWT_ALG](#talk-jwt-alg) is **not** a `HS*` value, then the value of the `TALK_JWT_SECRETS` should take the form: @@ -282,7 +296,6 @@ TALK_JWT_SECRETS=[{"kid": "1", "private": "", "public": " Date: Fri, 19 Oct 2018 10:05:05 -0600 Subject: [PATCH 06/24] fix: fixes #2009 --- config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config.js b/config.js index 8987f1114..99600508a 100644 --- a/config.js +++ b/config.js @@ -30,7 +30,7 @@ const CONFIG = { ENABLE_TRACING: Boolean(process.env.APOLLO_ENGINE_KEY), // EMAIL_SUBJECT_PREFIX is the string before emails in the subject. - EMAIL_SUBJECT_PREFIX: process.env.TALK_EMAIL_SUBJECT_PREFIX || '[Talk]', + EMAIL_SUBJECT_PREFIX: process.env.TALK_EMAIL_SUBJECT_PREFIX, // DEFAULT_LANG is the default language used for server sent emails and // rendered text. @@ -271,6 +271,10 @@ const CONFIG = { // CONFIG VALIDATION //============================================================================== +if (typeof CONFIG.EMAIL_SUBJECT_PREFIX === 'undefined') { + CONFIG.EMAIL_SUBJECT_PREFIX = '[Talk]'; +} + if (process.env.NODE_ENV === 'test') { if (!CONFIG.ROOT_URL) { CONFIG.ROOT_URL = `http://${localAddress}:3001`; From fabec2c89b913c89e32755bdaeb9ecd11034c8e2 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Fri, 19 Oct 2018 16:28:13 +0000 Subject: [PATCH 07/24] review: fix invalid substring --- services/jwt.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/jwt.js b/services/jwt.js index 21045da8f..b1e444dbd 100644 --- a/services/jwt.js +++ b/services/jwt.js @@ -122,7 +122,7 @@ function SharedSecret({ kid = undefined, secret = null }, algorithm) { // If the secret is base64 encoded, then decode it! if (secret.startsWith('base64:')) { - secret = Buffer.from(secret.substring(6), 'base64').toString(); + secret = Buffer.from(secret.substring(7), 'base64').toString(); } return new Secret({ From 7f45f7e2e2a1fa14c5d0e432e73c5ac471dc9046 Mon Sep 17 00:00:00 2001 From: Harrison Reid Date: Sat, 20 Oct 2018 08:43:13 +1100 Subject: [PATCH 08/24] Add Code of Conduct Link --- .../routes/Configure/components/StreamSettings.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/client/coral-admin/src/routes/Configure/components/StreamSettings.js b/client/coral-admin/src/routes/Configure/components/StreamSettings.js index 5f98da3d7..5ce329f69 100644 --- a/client/coral-admin/src/routes/Configure/components/StreamSettings.js +++ b/client/coral-admin/src/routes/Configure/components/StreamSettings.js @@ -157,7 +157,17 @@ class StreamSettings extends React.Component { onCheckbox={this.updateInfoBoxEnable} title={t('configure.code_of_conduct_summary')} > -

{t('configure.code_of_conduct_summary_desc')}

+

+ {t('configure.code_of_conduct_summary_desc')} +   + + Code of Conduct Guide. + +

Date: Sat, 20 Oct 2018 19:01:01 +0300 Subject: [PATCH 09/24] Make ConfigureCard collapsible --- .../components/ConfigureCard.css | 63 ++++++----- .../components/ConfigureCard.js | 100 +++++++++++------- 2 files changed, 93 insertions(+), 70 deletions(-) diff --git a/client/coral-framework/components/ConfigureCard.css b/client/coral-framework/components/ConfigureCard.css index f72ea0c73..0ecabc6e5 100644 --- a/client/coral-framework/components/ConfigureCard.css +++ b/client/coral-framework/components/ConfigureCard.css @@ -1,49 +1,48 @@ .card { - margin-bottom: 20px; - align-items: flex-start; - min-height: 100px; max-width: 600px; + min-height: 100px; + flex-direction: row; + align-items: flex-start; + margin-bottom: 20px; overflow: visible; } +.collapsibleCard { + min-height: auto; +} + +.enabledCard { + border-left: 7px solid #00796b; +} + +.action { + flex-shrink: 0; + margin-right: 12px; +} + +.wrapper { + flex-grow: 1; +} + .header { - margin-top: 3px; - margin-bottom: 7px; + display: flex; + align-items: center; + justify-content: space-between; + margin-top: 2px; +} + +.title { font-size: 18px; font-weight: 500; } -.wrapper { - width: 100%; +.body { + margin-top: 7px; font-size: 14px; letter-spacing: 0; } -.action { - display: inline-block; - position: absolute; - top: 0; - left: 0; - padding: 20px; -} - -.content { - display: inline-block; - padding: 0px 30px; - box-sizing: border-box; -} - -.enabledSetting { - border-left-color: #00796b; - border-left-style: solid; - border-left-width: 7px; -} - -.disabledSetting { - padding-left: 22px; -} - -.disabledSettingText { +.disabledBody { color: #ccc; pointer-events: none; } diff --git a/client/coral-framework/components/ConfigureCard.js b/client/coral-framework/components/ConfigureCard.js index 7a2872318..4bc6bb967 100644 --- a/client/coral-framework/components/ConfigureCard.js +++ b/client/coral-framework/components/ConfigureCard.js @@ -1,46 +1,69 @@ -import React from 'react'; +import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; -import styles from './ConfigureCard.css'; +import classnames from 'classnames/bind'; import { Card } from 'coral-ui'; -import { Checkbox } from 'react-mdl'; -import cn from 'classnames'; +import { Checkbox, IconButton } from 'react-mdl'; -const ConfigureCard = ({ - title, - children, - className, - onCheckbox, - checked, - ...rest -}) => ( - - {checked !== undefined && ( -
- -
- )} -
-
{title}
-
this.setState({ isOpen: !this.state.isOpen }); + + render() { + const { + title, + children, + className, + onCheckbox, + checked, + collapsible, + ...rest + } = this.props; + + const { isOpen } = this.state; + + const iconName = isOpen ? 'keyboard_arrow_up' : 'keyboard_arrow_down'; + + return ( + - {children} -
-
-
-); + {checked !== undefined && ( +
+ +
+ )} +
+
+
{title}
+ {collapsible && ( + + )} +
+ {isOpen && ( +
+ {children} +
+ )} +
+ + ); + } +} ConfigureCard.propTypes = { title: PropTypes.string, @@ -48,6 +71,7 @@ ConfigureCard.propTypes = { onCheckbox: PropTypes.func, checked: PropTypes.bool, children: PropTypes.node, + collapsible: PropTypes.bool, }; export default ConfigureCard; From 8432df15a161c69fd17e05d1252c3bf776d1f8f7 Mon Sep 17 00:00:00 2001 From: hovoodd Date: Sat, 20 Oct 2018 19:06:03 +0300 Subject: [PATCH 10/24] Add collapsible prop to banned and suspended lists in admin --- .../coral-admin/src/routes/Configure/components/Wordlist.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/coral-admin/src/routes/Configure/components/Wordlist.js b/client/coral-admin/src/routes/Configure/components/Wordlist.js index 1a5c177d0..6acc045b8 100644 --- a/client/coral-admin/src/routes/Configure/components/Wordlist.js +++ b/client/coral-admin/src/routes/Configure/components/Wordlist.js @@ -6,7 +6,7 @@ import ConfigureCard from 'coral-framework/components/ConfigureCard'; const Wordlist = ({ suspectWords, bannedWords, onChangeWordlist }) => (
- +

{t('configure.banned_word_text')}

( onChange={tags => onChangeWordlist('banned', tags)} />
- +

{t('configure.suspect_word_text')}

Date: Sat, 20 Oct 2018 22:05:32 +0300 Subject: [PATCH 11/24] Add additional check for `usernameCanBeUpdated` condition in profile --- plugins/talk-plugin-local-auth/client/components/Profile.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/talk-plugin-local-auth/client/components/Profile.js b/plugins/talk-plugin-local-auth/client/components/Profile.js index 139949b99..521128197 100644 --- a/plugins/talk-plugin-local-auth/client/components/Profile.js +++ b/plugins/talk-plugin-local-auth/client/components/Profile.js @@ -178,10 +178,12 @@ class Profile extends React.Component { }, }, notify, + success: hasChangedUsername, } = this.props; const { editing, formData, showDialog } = this.state; - const usernameCanBeUpdated = canUsernameBeUpdated(status); + const usernameCanBeUpdated = + canUsernameBeUpdated(status) && !hasChangedUsername; return (
Date: Sat, 20 Oct 2018 22:59:13 +0300 Subject: [PATCH 12/24] Fix stream status updating --- client/coral-admin/src/routes/Stories/containers/Stories.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/coral-admin/src/routes/Stories/containers/Stories.js b/client/coral-admin/src/routes/Stories/containers/Stories.js index 144076b41..7549855c0 100644 --- a/client/coral-admin/src/routes/Stories/containers/Stories.js +++ b/client/coral-admin/src/routes/Stories/containers/Stories.js @@ -50,7 +50,7 @@ class StoriesContainer extends Component { const { updateAssetState } = this.props; try { - updateAssetState(id, closeStream ? Date.now() : null); + await updateAssetState(id, closeStream ? Date.now() : null); this.fetchAssets(); } catch (err) { console.error(err); From 41610ccf57cd0458d1889c755b7c6eefaeb2fb08 Mon Sep 17 00:00:00 2001 From: Saska Kolehmainen Date: Sun, 21 Oct 2018 17:43:58 +0300 Subject: [PATCH 13/24] Added error message to profile tab in embedded comments for when disallowed characters are added while changing the username. --- plugins/talk-plugin-local-auth/client/components/Profile.js | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/talk-plugin-local-auth/client/components/Profile.js b/plugins/talk-plugin-local-auth/client/components/Profile.js index 139949b99..a95d8c22d 100644 --- a/plugins/talk-plugin-local-auth/client/components/Profile.js +++ b/plugins/talk-plugin-local-auth/client/components/Profile.js @@ -232,6 +232,7 @@ class Profile extends React.Component { validationType="username" disabled={!usernameCanBeUpdated} columnDisplay + errorMsg={this.state.errors.newUsername} >
From cd6da751a6c7b5f480765415fa332d7d0b5e10be Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Mon, 22 Oct 2018 12:12:35 -0600 Subject: [PATCH 14/24] fix: added patch to reset form --- views/account/password/reset.njk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/account/password/reset.njk b/views/account/password/reset.njk index 6eee12dd0..bede0b9fc 100644 --- a/views/account/password/reset.njk +++ b/views/account/password/reset.njk @@ -8,7 +8,7 @@

{{ t('password_reset.set_new_password') }}

{{ t('password_reset.change_password_help') }}

-
+