From b16bdafc1ab6d0e34a4fe39f9228e0dc1b816c27 Mon Sep 17 00:00:00 2001 From: gaba Date: Mon, 13 Feb 2017 12:22:05 -0800 Subject: [PATCH 01/12] Adds plugin for question box. --- client/coral-embed-stream/src/Embed.js | 4 ++++ client/coral-plugin-questionbox/QuestionBox.js | 10 ++++++++++ models/setting.js | 8 ++++++++ 3 files changed, 22 insertions(+) create mode 100644 client/coral-plugin-questionbox/QuestionBox.js diff --git a/client/coral-embed-stream/src/Embed.js b/client/coral-embed-stream/src/Embed.js index 6cc783746..d33fbfce9 100644 --- a/client/coral-embed-stream/src/Embed.js +++ b/client/coral-embed-stream/src/Embed.js @@ -112,6 +112,10 @@ class Embed extends Component { content={asset.settings.infoBoxContent} enable={asset.settings.infoBoxEnable} /> + +
+ {content} +
; + +export default QuestionBox; diff --git a/models/setting.js b/models/setting.js index adbf60d83..4e5aa4476 100644 --- a/models/setting.js +++ b/models/setting.js @@ -28,6 +28,14 @@ const SettingSchema = new Schema({ type: String, default: '' }, + questionBoxEnable: { + type: Boolean, + default: false + }, + questionBoxContent: { + type: String, + default: '' + }, organizationName: { type: String }, From 5a2e4b708b8a047ff645dc3b5cbeacb9ff489508 Mon Sep 17 00:00:00 2001 From: gaba Date: Mon, 13 Feb 2017 13:48:03 -0800 Subject: [PATCH 02/12] Adds question box --- client/coral-embed-stream/src/Embed.js | 1 + 1 file changed, 1 insertion(+) diff --git a/client/coral-embed-stream/src/Embed.js b/client/coral-embed-stream/src/Embed.js index d33fbfce9..e8a7859af 100644 --- a/client/coral-embed-stream/src/Embed.js +++ b/client/coral-embed-stream/src/Embed.js @@ -16,6 +16,7 @@ import {Notification, notificationActions, authActions, assetActions, pym} from import Stream from './Stream'; import InfoBox from 'coral-plugin-infobox/InfoBox'; +import QuestionBox from 'coral-plugin-questionbox/QuestionBox'; import Count from 'coral-plugin-comment-count/CommentCount'; import CommentBox from 'coral-plugin-commentbox/CommentBox'; import UserBox from 'coral-sign-in/components/UserBox'; From 1b788b98c601ef9f4132bbbe304f211222b83238 Mon Sep 17 00:00:00 2001 From: gaba Date: Mon, 13 Feb 2017 14:12:32 -0800 Subject: [PATCH 03/12] Adds questionBox to the gl query --- client/coral-framework/graphql/queries/streamQuery.graphql | 2 ++ client/coral-plugin-stream/Stream.js | 2 +- graph/typeDefs.graphql | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/client/coral-framework/graphql/queries/streamQuery.graphql b/client/coral-framework/graphql/queries/streamQuery.graphql index 583a2db13..31e125d81 100644 --- a/client/coral-framework/graphql/queries/streamQuery.graphql +++ b/client/coral-framework/graphql/queries/streamQuery.graphql @@ -11,6 +11,8 @@ query AssetQuery($asset_url: String!) { moderation infoBoxEnable infoBoxContent + questionBoxEnable + questionBoxContent closeTimeout closedMessage charCountEnable diff --git a/client/coral-plugin-stream/Stream.js b/client/coral-plugin-stream/Stream.js index c62ef7081..2796f1247 100644 --- a/client/coral-plugin-stream/Stream.js +++ b/client/coral-plugin-stream/Stream.js @@ -51,7 +51,7 @@ class Stream extends Component { } } -// Initialize GraphQL queries or mutations with the `gql` tag +// Initialize GraphQL queries or mutations with the gql tag const StreamQuery = gql`fragment commentView on Comment { id body diff --git a/graph/typeDefs.graphql b/graph/typeDefs.graphql index ddffcd708..728cead8f 100644 --- a/graph/typeDefs.graphql +++ b/graph/typeDefs.graphql @@ -271,6 +271,8 @@ type Settings { infoBoxEnable: Boolean infoBoxContent: String + questionBoxEnable: Boolean + questionBoxContent: String closeTimeout: Int closedMessage: String charCountEnable: Boolean From 1d70ae0decb689240b870221acaa64ae064f90d8 Mon Sep 17 00:00:00 2001 From: gaba Date: Mon, 13 Feb 2017 14:31:56 -0800 Subject: [PATCH 04/12] Adds question enable checkbox. --- .../components/ConfigureCommentStream.js | 12 ++++++++++++ .../containers/ConfigureStreamContainer.js | 8 +++++++- client/coral-configure/translations.json | 8 ++++++-- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/client/coral-configure/components/ConfigureCommentStream.js b/client/coral-configure/components/ConfigureCommentStream.js index bf4ebe3e6..e986e8d0d 100644 --- a/client/coral-configure/components/ConfigureCommentStream.js +++ b/client/coral-configure/components/ConfigureCommentStream.js @@ -49,6 +49,18 @@ export default ({handleChange, handleApply, changed, ...props}) => ( */} +
  • + +
  • diff --git a/client/coral-configure/containers/ConfigureStreamContainer.js b/client/coral-configure/containers/ConfigureStreamContainer.js index dfe94de42..54dd31f4e 100644 --- a/client/coral-configure/containers/ConfigureStreamContainer.js +++ b/client/coral-configure/containers/ConfigureStreamContainer.js @@ -27,12 +27,14 @@ class ConfigureStreamContainer extends Component { e.preventDefault(); const {elements} = e.target; const premod = elements.premod.checked; + const questionBoxEnable = elements.qboxenable.checked; // const premodLinks = elements.premodLinks.checked; const {changed} = this.state; const newConfig = { - moderation: premod ? 'PRE' : 'POST' + moderation: premod ? 'PRE' : 'POST', + questionBoxEnable: questionBoxEnable }; if (changed) { @@ -66,6 +68,8 @@ class ConfigureStreamContainer extends Component { render () { const status = this.props.asset.closedAt === null ? 'open' : 'closed'; const premod = this.props.asset.settings.moderation === 'PRE'; + const questionBoxEnable = this.props.asset.settings.questionBoxEnable; + const questionBoxContent = this.props.asset.settings.questionBoxContent; return (
    @@ -75,6 +79,8 @@ class ConfigureStreamContainer extends Component { changed={this.state.changed} premodLinks={false} premod={premod} + questionBoxEnable={questionBoxEnable} + questionBoxContent={questionBoxContent} />

    {status === 'open' ? 'Close' : 'Open'} Comment Stream

    diff --git a/client/coral-configure/translations.json b/client/coral-configure/translations.json index 5aa7f72b6..fe1045662 100644 --- a/client/coral-configure/translations.json +++ b/client/coral-configure/translations.json @@ -7,7 +7,9 @@ "enablePremod": "Enable Premoderation", "enablePremodDescription": "Moderators must approve any comment before its published.", "enablePremodLinks": "Pre-Moderate Comments Containing Links", - "enablePremodLinksDescription": "Moderators must approve any comment containing a link before its published." + "enablePremodLinksDescription": "Moderators must approve any comment containing a link before its published.", + "enableQuestionBox": "Enable Question Box", + "enableQuestionBoxDescription": "Commenters will see the next question at the top of the comments stream." } }, "es": { @@ -18,7 +20,9 @@ "enablePremod": "Activar Pre Moderación", "enablePremodDescription": "Los Moderadores deben aprobar cualquier comentario antes de su publicación", "enablePremodLinks": "Pre-Moderar Commentarios que contienen Links", - "enablePremodLinksDescription": "Los Moderadores deben probar cualquier comentario que contengan links antes de su publicación." + "enablePremodLinksDescription": "Los Moderadores deben probar cualquier comentario que contengan links antes de su publicación.", + "enableQuestionBox": "Activar Caja de Pregunta", + "enableQuestionBoxDescription": "La siguiente pregunta estara en la parte de arriba del hilo de comentarios." } } } From d4109c8fcac50fd42bbe697f4a3fb9c153c7a2fe Mon Sep 17 00:00:00 2001 From: gaba Date: Mon, 13 Feb 2017 16:51:31 -0800 Subject: [PATCH 05/12] Adds textfield to coral-UI. --- .../components/ConfigureCommentStream.css | 14 ++++++++++++++ .../components/ConfigureCommentStream.js | 6 +++++- .../containers/ConfigureStreamContainer.js | 6 +++++- client/coral-configure/translations.json | 6 ++++-- client/coral-ui/components/TextField.js | 11 +++++++++++ 5 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 client/coral-ui/components/TextField.js diff --git a/client/coral-configure/components/ConfigureCommentStream.css b/client/coral-configure/components/ConfigureCommentStream.css index 8526edc09..dfa860995 100644 --- a/client/coral-configure/components/ConfigureCommentStream.css +++ b/client/coral-configure/components/ConfigureCommentStream.css @@ -35,3 +35,17 @@ p { .wrapper { margin-bottom: 20px; } + +.configSettingQuestionBox { + min-height: 100px; + margin-bottom: 20px; + cursor: pointer; + width: auto; + height: auto; + text-align: left; + overflow: visible; +} + +.hidden { + display: none; +} diff --git a/client/coral-configure/components/ConfigureCommentStream.js b/client/coral-configure/components/ConfigureCommentStream.js index e986e8d0d..4298384e0 100644 --- a/client/coral-configure/components/ConfigureCommentStream.js +++ b/client/coral-configure/components/ConfigureCommentStream.js @@ -60,9 +60,13 @@ export default ({handleChange, handleApply, changed, ...props}) => ( title: lang.t('configureCommentStream.enableQuestionBox'), description: lang.t('configureCommentStream.enableQuestionBoxDescription') }} /> +
    +
    + Pepe +
    +
    - ); diff --git a/client/coral-configure/containers/ConfigureStreamContainer.js b/client/coral-configure/containers/ConfigureStreamContainer.js index 54dd31f4e..2f0b01800 100644 --- a/client/coral-configure/containers/ConfigureStreamContainer.js +++ b/client/coral-configure/containers/ConfigureStreamContainer.js @@ -28,13 +28,17 @@ class ConfigureStreamContainer extends Component { const {elements} = e.target; const premod = elements.premod.checked; const questionBoxEnable = elements.qboxenable.checked; + const questionBoxContent = ''; // elements.qboxcontent.value; + + console.log('debug ', questionBoxContent); // const premodLinks = elements.premodLinks.checked; const {changed} = this.state; const newConfig = { moderation: premod ? 'PRE' : 'POST', - questionBoxEnable: questionBoxEnable + questionBoxEnable, + questionBoxContent }; if (changed) { diff --git a/client/coral-configure/translations.json b/client/coral-configure/translations.json index fe1045662..bd45d6159 100644 --- a/client/coral-configure/translations.json +++ b/client/coral-configure/translations.json @@ -9,7 +9,8 @@ "enablePremodLinks": "Pre-Moderate Comments Containing Links", "enablePremodLinksDescription": "Moderators must approve any comment containing a link before its published.", "enableQuestionBox": "Enable Question Box", - "enableQuestionBoxDescription": "Commenters will see the next question at the top of the comments stream." + "enableQuestionBoxDescription": "Commenters will see a question at the top of the comments stream.", + "includeQuestionHere": "Include your question here." } }, "es": { @@ -22,7 +23,8 @@ "enablePremodLinks": "Pre-Moderar Commentarios que contienen Links", "enablePremodLinksDescription": "Los Moderadores deben probar cualquier comentario que contengan links antes de su publicación.", "enableQuestionBox": "Activar Caja de Pregunta", - "enableQuestionBoxDescription": "La siguiente pregunta estara en la parte de arriba del hilo de comentarios." + "enableQuestionBoxDescription": "Una pregunta estara en la parte de arriba del hilo de comentarios.", + "includeQuestionHere": "Escribir la pregunta aquí." } } } diff --git a/client/coral-ui/components/TextField.js b/client/coral-ui/components/TextField.js new file mode 100644 index 000000000..9cdddf5c8 --- /dev/null +++ b/client/coral-ui/components/TextField.js @@ -0,0 +1,11 @@ +import React from 'react'; +import {Textfield as TextFieldMDL} from 'react-mdl'; + +const TextField = ({onChange, label, rows}) => ( + +); + +export default TextField; From b1d90dfd8768c488be4040eac7ed28803198428c Mon Sep 17 00:00:00 2001 From: gaba Date: Tue, 14 Feb 2017 15:31:12 -0800 Subject: [PATCH 06/12] Fix TextField for the Configure Stream. --- .../components/ConfigureCommentStream.css | 18 +++++++++++ .../components/ConfigureCommentStream.js | 32 +++++++------------ .../containers/ConfigureStreamContainer.js | 11 ++++--- client/coral-configure/translations.json | 16 +++++----- client/coral-ui/components/TextField.js | 28 ++++++++++------ client/coral-ui/index.js | 1 + 6 files changed, 63 insertions(+), 43 deletions(-) diff --git a/client/coral-configure/components/ConfigureCommentStream.css b/client/coral-configure/components/ConfigureCommentStream.css index dfa860995..cbe2ba715 100644 --- a/client/coral-configure/components/ConfigureCommentStream.css +++ b/client/coral-configure/components/ConfigureCommentStream.css @@ -49,3 +49,21 @@ p { .hidden { display: none; } + +/* Question Box Styles */ + +.configSettingQuestionBox { + background: white; +} + +.configSettingQuestionBoxInfo { + top: 0; + border: 10px; + background: white; + color: inherit; + width: 100%; + text-align: left; + padding: 5px; + font-weight: bold; + display: block; +} diff --git a/client/coral-configure/components/ConfigureCommentStream.js b/client/coral-configure/components/ConfigureCommentStream.js index 4298384e0..3afd1336c 100644 --- a/client/coral-configure/components/ConfigureCommentStream.js +++ b/client/coral-configure/components/ConfigureCommentStream.js @@ -1,5 +1,6 @@ import React from 'react'; -import {Button, Checkbox} from 'coral-ui'; +import {Button, Checkbox, TextField} from 'coral-ui'; + import styles from './ConfigureCommentStream.css'; import I18n from 'coral-framework/modules/i18n/i18n'; @@ -32,22 +33,6 @@ export default ({handleChange, handleApply, changed, ...props}) => ( title: lang.t('configureCommentStream.enablePremod'), description: lang.t('configureCommentStream.enablePremodDescription') }} /> - {/* To be implimented -
      -
    • - -
    • -
    - */}
  • ( title: lang.t('configureCommentStream.enableQuestionBox'), description: lang.t('configureCommentStream.enableQuestionBoxDescription') }} /> -
    -
    - Pepe -
    + +
    +
  • + diff --git a/client/coral-configure/containers/ConfigureStreamContainer.js b/client/coral-configure/containers/ConfigureStreamContainer.js index 2f0b01800..9092a2673 100644 --- a/client/coral-configure/containers/ConfigureStreamContainer.js +++ b/client/coral-configure/containers/ConfigureStreamContainer.js @@ -28,9 +28,7 @@ class ConfigureStreamContainer extends Component { const {elements} = e.target; const premod = elements.premod.checked; const questionBoxEnable = elements.qboxenable.checked; - const questionBoxContent = ''; // elements.qboxcontent.value; - - console.log('debug ', questionBoxContent); + const questionBoxContent = elements.qboxcontent.value; // const premodLinks = elements.premodLinks.checked; const {changed} = this.state; @@ -51,7 +49,10 @@ class ConfigureStreamContainer extends Component { } } - handleChange () { + handleChange (e) { + if (e.target && e.target.id === 'qboxenable') { + this.props.asset.settings.questionBoxEnable = e.target.checked; + } this.setState({ changed: true }); @@ -104,7 +105,7 @@ const mapStateToProps = (state) => ({ const mapDispatchToProps = dispatch => ({ updateStatus: status => dispatch(updateOpenStatus(status)), - updateConfiguration: newConfig => dispatch(updateConfiguration(newConfig)) + updateConfiguration: newConfig => dispatch(updateConfiguration(newConfig)), }); export default compose( diff --git a/client/coral-configure/translations.json b/client/coral-configure/translations.json index bd45d6159..a40c12bc1 100644 --- a/client/coral-configure/translations.json +++ b/client/coral-configure/translations.json @@ -8,22 +8,22 @@ "enablePremodDescription": "Moderators must approve any comment before its published.", "enablePremodLinks": "Pre-Moderate Comments Containing Links", "enablePremodLinksDescription": "Moderators must approve any comment containing a link before its published.", - "enableQuestionBox": "Enable Question Box", - "enableQuestionBoxDescription": "Commenters will see a question at the top of the comments stream.", - "includeQuestionHere": "Include your question here." + "enableQuestionBox": "Ask readers a question", + "enableQuestionBoxDescription": "This question will appear at the top of this comment stram. Ask readers about a certain issue in the article or pose discussion questions, etc.", + "includeQuestionHere": "Write your question here." } }, "es": { "configureCommentStream": { "apply": "Aplicar", "title": "Configurar los comentarios", - "description": "Como Administrador puedes modificar las opciones de los comentarios en este artículo", + "description": "Como Administrador/a puedes modificar las opciones de los comentarios en este artículo", "enablePremod": "Activar Pre Moderación", - "enablePremodDescription": "Los Moderadores deben aprobar cualquier comentario antes de su publicación", + "enablePremodDescription": "Los y las Moderadoras deben aprobar cualquier comentario antes de su publicación", "enablePremodLinks": "Pre-Moderar Commentarios que contienen Links", - "enablePremodLinksDescription": "Los Moderadores deben probar cualquier comentario que contengan links antes de su publicación.", - "enableQuestionBox": "Activar Caja de Pregunta", - "enableQuestionBoxDescription": "Una pregunta estara en la parte de arriba del hilo de comentarios.", + "enablePremodLinksDescription": "Los y las Moderadoras deben probar cualquier comentario que contengan links antes de su publicación.", + "enableQuestionBox": "Hacer una pregunta a los y las lectoras.", + "enableQuestionBoxDescription": "Esta pregunta aparecera en la parte de arriba del hilo de comentarios.", "includeQuestionHere": "Escribir la pregunta aquí." } } diff --git a/client/coral-ui/components/TextField.js b/client/coral-ui/components/TextField.js index 9cdddf5c8..80855dbf1 100644 --- a/client/coral-ui/components/TextField.js +++ b/client/coral-ui/components/TextField.js @@ -1,11 +1,21 @@ -import React from 'react'; +import React, {Component} from 'react'; import {Textfield as TextFieldMDL} from 'react-mdl'; +import 'material-design-lite'; -const TextField = ({onChange, label, rows}) => ( - -); - -export default TextField; +export default class TextField extends Component { + render() { + const {className, onChange, rows, questionBoxContent} = this.props; + return ( + + ); + } +} diff --git a/client/coral-ui/index.js b/client/coral-ui/index.js index beb2396f5..bfc5acb16 100644 --- a/client/coral-ui/index.js +++ b/client/coral-ui/index.js @@ -14,6 +14,7 @@ export {default as List} from './components/List'; export {default as Item} from './components/Item'; export {default as Card} from './components/Card'; export {default as FormField} from './components/FormField'; +export {default as TextField} from './components/TextField'; export {default as Success} from './components/Success'; export {default as Pager} from './components/Pager'; export {default as Wizard} from './components/Wizard'; From d3f81353a6309acd13eb54441f9c6399fca6caae Mon Sep 17 00:00:00 2001 From: gaba Date: Tue, 14 Feb 2017 16:51:57 -0800 Subject: [PATCH 07/12] Fix TextField for coral-ui and setting configure stream, question box. --- .../components/ConfigureCommentStream.js | 8 +++++--- .../containers/ConfigureStreamContainer.js | 7 +++++++ client/coral-ui/components/TextField.js | 10 ++++------ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/client/coral-configure/components/ConfigureCommentStream.js b/client/coral-configure/components/ConfigureCommentStream.js index 3afd1336c..e621f85f1 100644 --- a/client/coral-configure/components/ConfigureCommentStream.js +++ b/client/coral-configure/components/ConfigureCommentStream.js @@ -7,7 +7,7 @@ import I18n from 'coral-framework/modules/i18n/i18n'; import translations from '../translations.json'; const lang = new I18n(translations); -export default ({handleChange, handleApply, changed, ...props}) => ( +export default ({handleChange, handleApply, changed, updateQuestionBoxContent, ...props}) => (
    @@ -48,10 +48,12 @@ export default ({handleChange, handleApply, changed, ...props}) => (
    diff --git a/client/coral-configure/containers/ConfigureStreamContainer.js b/client/coral-configure/containers/ConfigureStreamContainer.js index 9092a2673..219e4d99e 100644 --- a/client/coral-configure/containers/ConfigureStreamContainer.js +++ b/client/coral-configure/containers/ConfigureStreamContainer.js @@ -21,6 +21,7 @@ class ConfigureStreamContainer extends Component { this.toggleStatus = this.toggleStatus.bind(this); this.handleChange = this.handleChange.bind(this); this.handleApply = this.handleApply.bind(this); + this.updateQuestionBoxContent = this.updateQuestionBoxContent.bind(this); } handleApply (e) { @@ -58,6 +59,11 @@ class ConfigureStreamContainer extends Component { }); } + updateQuestionBoxContent(e) { + this.props.asset.settings.questionBoxContent = e.target.value; + this.handleChange(e); + } + toggleStatus () { this.props.updateStatus( this.props.asset.closedAt === null ? 'closed' : 'open' @@ -84,6 +90,7 @@ class ConfigureStreamContainer extends Component { changed={this.state.changed} premodLinks={false} premod={premod} + updateQuestionBoxContent={this.updateQuestionBoxContent} questionBoxEnable={questionBoxEnable} questionBoxContent={questionBoxContent} /> diff --git a/client/coral-ui/components/TextField.js b/client/coral-ui/components/TextField.js index 80855dbf1..6c7b30ad1 100644 --- a/client/coral-ui/components/TextField.js +++ b/client/coral-ui/components/TextField.js @@ -4,17 +4,15 @@ import 'material-design-lite'; export default class TextField extends Component { render() { - const {className, onChange, rows, questionBoxContent} = this.props; + const {id, className, onChange, label, rows, value} = this.props; return ( ); } From 0f074dc034e78b900dfbccc521ea25851b4bb682 Mon Sep 17 00:00:00 2001 From: gaba Date: Tue, 14 Feb 2017 17:13:08 -0800 Subject: [PATCH 08/12] Changes styles for Emma and Sam's design. --- client/coral-embed-stream/style/default.css | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/client/coral-embed-stream/style/default.css b/client/coral-embed-stream/style/default.css index 2d7f478c1..a33dcf940 100644 --- a/client/coral-embed-stream/style/default.css +++ b/client/coral-embed-stream/style/default.css @@ -62,7 +62,7 @@ hr { .coral-plugin-infobox-info { top: 0; border: 0; - background: rgb(105,105,105); + background: rgb(35,118,216); color: white; width: 100%; text-align: center; @@ -72,6 +72,21 @@ hr { display: block; } +/* Question Box Styles */ +.coral-plugin-questionbox-info { + top: 0; + border: 0; + background: rgb(105,105,105); + color: white; + width: 100%; + text-align: center; + padding: 10px; + margin-bottom: 0px; + font-weight: bold; + display: block; +} + + .hidden { visibility: hidden; display: none; From d7469d648de86e6c811d82a14ece42d92e2e4472 Mon Sep 17 00:00:00 2001 From: gaba Date: Tue, 14 Feb 2017 17:48:10 -0800 Subject: [PATCH 09/12] Replace element with name instead of id. Add style to textfield from coral-ui. --- client/coral-configure/components/ConfigureCommentStream.js | 2 +- client/coral-ui/components/TextField.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/coral-configure/components/ConfigureCommentStream.js b/client/coral-configure/components/ConfigureCommentStream.js index e621f85f1..67f959390 100644 --- a/client/coral-configure/components/ConfigureCommentStream.js +++ b/client/coral-configure/components/ConfigureCommentStream.js @@ -48,7 +48,7 @@ export default ({handleChange, handleApply, changed, updateQuestionBoxContent, .
    ); } From 1d1b1b3391faa159c0885f56599377e73cb1901d Mon Sep 17 00:00:00 2001 From: gaba Date: Wed, 15 Feb 2017 11:37:39 -0800 Subject: [PATCH 10/12] Move to use FormField the right way. --- .../components/ConfigureCommentStream.css | 28 ------------------- .../components/ConfigureCommentStream.js | 9 +++--- client/coral-ui/components/TextField.js | 20 ------------- client/coral-ui/index.js | 1 - 4 files changed, 4 insertions(+), 54 deletions(-) delete mode 100644 client/coral-ui/components/TextField.js diff --git a/client/coral-configure/components/ConfigureCommentStream.css b/client/coral-configure/components/ConfigureCommentStream.css index cbe2ba715..ea20e4c05 100644 --- a/client/coral-configure/components/ConfigureCommentStream.css +++ b/client/coral-configure/components/ConfigureCommentStream.css @@ -36,34 +36,6 @@ p { margin-bottom: 20px; } -.configSettingQuestionBox { - min-height: 100px; - margin-bottom: 20px; - cursor: pointer; - width: auto; - height: auto; - text-align: left; - overflow: visible; -} - .hidden { display: none; } - -/* Question Box Styles */ - -.configSettingQuestionBox { - background: white; -} - -.configSettingQuestionBoxInfo { - top: 0; - border: 10px; - background: white; - color: inherit; - width: 100%; - text-align: left; - padding: 5px; - font-weight: bold; - display: block; -} diff --git a/client/coral-configure/components/ConfigureCommentStream.js b/client/coral-configure/components/ConfigureCommentStream.js index 67f959390..cc5be6832 100644 --- a/client/coral-configure/components/ConfigureCommentStream.js +++ b/client/coral-configure/components/ConfigureCommentStream.js @@ -1,5 +1,5 @@ import React from 'react'; -import {Button, Checkbox, TextField} from 'coral-ui'; +import {Button, Checkbox, FormField} from 'coral-ui'; import styles from './ConfigureCommentStream.css'; @@ -46,10 +46,9 @@ export default ({handleChange, handleApply, changed, updateQuestionBoxContent, . description: lang.t('configureCommentStream.enableQuestionBoxDescription') }} /> -
    - + - ); - } -} diff --git a/client/coral-ui/index.js b/client/coral-ui/index.js index bfc5acb16..beb2396f5 100644 --- a/client/coral-ui/index.js +++ b/client/coral-ui/index.js @@ -14,7 +14,6 @@ export {default as List} from './components/List'; export {default as Item} from './components/Item'; export {default as Card} from './components/Card'; export {default as FormField} from './components/FormField'; -export {default as TextField} from './components/TextField'; export {default as Success} from './components/Success'; export {default as Pager} from './components/Pager'; export {default as Wizard} from './components/Wizard'; From 68c764fd43a3e4d518608ca45effb9b1f21aa503 Mon Sep 17 00:00:00 2001 From: gaba Date: Wed, 15 Feb 2017 11:50:21 -0800 Subject: [PATCH 11/12] Rename coral-ui/FormField with TextField. --- .../src/components/BanUserDialog.css | 6 +++--- .../components/Steps/AddOrganizationName.js | 6 +++--- .../components/Steps/CreateYourAccount.js | 18 +++++++++--------- .../components/Steps/InviteTeamMembers.js | 12 ++++++------ .../Install/components/Steps/style.css | 2 +- .../components/ConfigureCommentStream.js | 4 ++-- .../components/CreateDisplayNameDialog.js | 4 ++-- .../coral-sign-in/components/ForgotContent.js | 2 +- .../coral-sign-in/components/SignInContent.js | 8 ++++---- .../coral-sign-in/components/SignUpContent.js | 10 +++++----- .../{FormField.css => TextField.css} | 6 +++--- .../components/{FormField.js => TextField.js} | 10 +++++----- client/coral-ui/index.js | 2 +- 13 files changed, 45 insertions(+), 45 deletions(-) rename client/coral-ui/components/{FormField.css => TextField.css} (93%) rename client/coral-ui/components/{FormField.js => TextField.js} (70%) diff --git a/client/coral-admin/src/components/BanUserDialog.css b/client/coral-admin/src/components/BanUserDialog.css index 054c343dd..a46b9da32 100644 --- a/client/coral-admin/src/components/BanUserDialog.css +++ b/client/coral-admin/src/components/BanUserDialog.css @@ -22,17 +22,17 @@ } } -.formField { +.textField { margin-top: 15px; } -.formField label { +.textField label { font-size: 1.08em; font-weight: bold; margin-bottom: 5px; } -.formField input { +.textField input { width: 100%; display: block; border: none; diff --git a/client/coral-admin/src/containers/Install/components/Steps/AddOrganizationName.js b/client/coral-admin/src/containers/Install/components/Steps/AddOrganizationName.js index 0f85bbad4..ae23d0048 100644 --- a/client/coral-admin/src/containers/Install/components/Steps/AddOrganizationName.js +++ b/client/coral-admin/src/containers/Install/components/Steps/AddOrganizationName.js @@ -1,6 +1,6 @@ import React from 'react'; import styles from './style.css'; -import {FormField, Button} from 'coral-ui'; +import {TextField, Button} from 'coral-ui'; const AddOrganizationName = props => { const {handleSettingsChange, handleSettingsSubmit, install} = props; @@ -12,8 +12,8 @@ const AddOrganizationName = props => {

    - { const {handleUserChange, handleUserSubmit, install} = props; @@ -8,8 +8,8 @@ const InitialStep = props => {
    - { noValidate /> - { errorMsg={install.errors.username} /> - { errorMsg={install.errors.password} /> - { const {nextStep} = props; @@ -14,19 +14,19 @@ const InviteTeamMembers = props => {
    - - -
    +
    this.emailInput = input} diff --git a/client/coral-sign-in/components/SignInContent.js b/client/coral-sign-in/components/SignInContent.js index eebaf960b..1f339979b 100644 --- a/client/coral-sign-in/components/SignInContent.js +++ b/client/coral-sign-in/components/SignInContent.js @@ -1,6 +1,6 @@ import React, {PropTypes} from 'react'; import Alert from './Alert'; -import {Button, FormField, Spinner, Success} from 'coral-ui'; +import {Button, TextField, Spinner, Success} from 'coral-ui'; import styles from './styles.css'; import I18n from 'coral-framework/modules/i18n/i18n'; import translations from '../translations'; @@ -32,7 +32,7 @@ const SignInContent = ({ auth.emailVerificationFailure ?

    {lang.t('signIn.requestNewVerifyEmail')}

    -
    - -
    - - - { errors.password && Password must be at least 8 characters. } - ( -
    +const TextField = ({className, showErrors = false, errorMsg, label, ...props}) => ( +
    @@ -15,7 +15,7 @@ const FormField = ({className, showErrors = false, errorMsg, label, ...props}) =
    ); -FormField.propTypes = { +TextField.propTypes = { label: PropTypes.string, value: PropTypes.string, onChange: PropTypes.func, @@ -23,4 +23,4 @@ FormField.propTypes = { type: PropTypes.string }; -export default FormField; +export default TextField; diff --git a/client/coral-ui/index.js b/client/coral-ui/index.js index beb2396f5..255259c32 100644 --- a/client/coral-ui/index.js +++ b/client/coral-ui/index.js @@ -13,7 +13,7 @@ export {default as Icon} from './components/Icon'; export {default as List} from './components/List'; export {default as Item} from './components/Item'; export {default as Card} from './components/Card'; -export {default as FormField} from './components/FormField'; +export {default as TextField} from './components/TextField'; export {default as Success} from './components/Success'; export {default as Pager} from './components/Pager'; export {default as Wizard} from './components/Wizard'; From da1a931a403103f89ae705d18cb2bc15beaefdf1 Mon Sep 17 00:00:00 2001 From: Riley Davis Date: Wed, 15 Feb 2017 15:13:54 -0700 Subject: [PATCH 12/12] remove a comma --- client/coral-plugin-questionbox/QuestionBox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/coral-plugin-questionbox/QuestionBox.js b/client/coral-plugin-questionbox/QuestionBox.js index ce9a51b9d..7ae680a09 100644 --- a/client/coral-plugin-questionbox/QuestionBox.js +++ b/client/coral-plugin-questionbox/QuestionBox.js @@ -3,7 +3,7 @@ const packagename = 'coral-plugin-questionbox'; const QuestionBox = ({enable, content}) =>
    + className={`${packagename}-info ${enable ? null : 'hidden'}` }> {content}
    ;