From 2384ae4baab616443faf360539099bc98c9f4680 Mon Sep 17 00:00:00 2001 From: Riley Davis Date: Tue, 6 Jun 2017 14:49:07 -0600 Subject: [PATCH] move edit comment config --- .../routes/Configure/components/Configure.css | 4 +-- .../components/ModerationSettings.js | 27 ------------------- .../Configure/components/StreamSettings.js | 26 ++++++++++++++++++ 3 files changed, 28 insertions(+), 29 deletions(-) diff --git a/client/coral-admin/src/routes/Configure/components/Configure.css b/client/coral-admin/src/routes/Configure/components/Configure.css index 3d5750693..22e46518c 100644 --- a/client/coral-admin/src/routes/Configure/components/Configure.css +++ b/client/coral-admin/src/routes/Configure/components/Configure.css @@ -99,7 +99,7 @@ .inlineTextfield { border-color: #ccc; border-style: solid; - border-width: 0px 0px 1px 0px; + border-width: 0px 0px 1px 0px; text-align: center; font-size: inherit; } @@ -108,7 +108,7 @@ outline: none; } -.charCountTexfield { +.charCountTexfield, .editCommentTimeframeTextfield { width: 4em; padding: 0px; } diff --git a/client/coral-admin/src/routes/Configure/components/ModerationSettings.js b/client/coral-admin/src/routes/Configure/components/ModerationSettings.js index 6b4795721..99f3435e2 100644 --- a/client/coral-admin/src/routes/Configure/components/ModerationSettings.js +++ b/client/coral-admin/src/routes/Configure/components/ModerationSettings.js @@ -25,12 +25,6 @@ const ModerationSettings = ({settings, updateSettings, onChangeWordlist}) => { const on = styles.enabledSetting; const off = styles.disabledSetting; - const onChangeEditCommentWindowLength = (e) => { - const value = e.target.value; - const valueAsNumber = parseFloat(value); - const milliseconds = (!isNaN(valueAsNumber)) && (valueAsNumber * 1000); - updateSettings({editCommentWindowLength: milliseconds || value}); - }; return (
@@ -76,27 +70,6 @@ const ModerationSettings = ({settings, updateSettings, onChangeWordlist}) => { bannedWords={settings.wordlist.banned} suspectWords={settings.wordlist.suspect} onChangeWordlist={onChangeWordlist} /> - - {/* Edit Comment Timeframe */} - -
{t('configure.edit_comment_timeframe_heading')}
-

- {t('configure.edit_comment_timeframe_text_pre')} -   - -   - {t('configure.edit_comment_timeframe_text_post')} -

-
); }; diff --git a/client/coral-admin/src/routes/Configure/components/StreamSettings.js b/client/coral-admin/src/routes/Configure/components/StreamSettings.js index 41c62c153..2de82ec1f 100644 --- a/client/coral-admin/src/routes/Configure/components/StreamSettings.js +++ b/client/coral-admin/src/routes/Configure/components/StreamSettings.js @@ -61,6 +61,13 @@ const updateClosedTimeout = (updateSettings, ts, isMeasure) => (event) => { } }; +const updateEditCommentWindowLength = (updateSettings) => (e) => { + const value = e.target.value; + const valueAsNumber = parseFloat(value); + const milliseconds = (!isNaN(valueAsNumber)) && (valueAsNumber * 1000); + updateSettings({editCommentWindowLength: milliseconds || value}); +}; + const StreamSettings = ({updateSettings, settingsError, settings, errors}) => { // just putting this here for shorthand below @@ -132,6 +139,25 @@ const StreamSettings = ({updateSettings, settingsError, settings, errors}) => { + {/* Edit Comment Timeframe */} + +
{t('configure.edit_comment_timeframe_heading')}
+

+ {t('configure.edit_comment_timeframe_text_pre')} +   + +   + {t('configure.edit_comment_timeframe_text_post')} +

+