From 83267a7e284900923771450213a023af145bd501 Mon Sep 17 00:00:00 2001 From: Carlos Date: Wed, 13 Mar 2019 13:09:37 +0100 Subject: [PATCH] Checkbox text alignment and override checkboxes reorganized --- client/src/campaigns/CUD.js | 9 ++++----- client/src/lib/form.js | 22 ++++++++++++++++++---- client/src/lib/styles.scss | 10 ++++++++++ client/src/send-configurations/CUD.js | 8 ++++---- 4 files changed, 36 insertions(+), 13 deletions(-) diff --git a/client/src/campaigns/CUD.js b/client/src/campaigns/CUD.js index 22039c16..cedecc4b 100644 --- a/client/src/campaigns/CUD.js +++ b/client/src/campaigns/CUD.js @@ -609,21 +609,20 @@ export default class CUD extends Component { const addOverridable = (id, label) => { if(this.state.sendConfiguration[id + '_overridable'] == 1){ - sendSettings.push(); if (this.getFormValue(id + '_overriden')) { - sendSettings.push(); + sendSettings.push(); } else { sendSettings.push( - + {this.state.sendConfiguration[id]} ); } + sendSettings.push(); } else{ - sendSettings.push(); sendSettings.push( - + {this.state.sendConfiguration[id]} ); diff --git a/client/src/lib/form.js b/client/src/lib/form.js index d14b63fd..85c9a2d5 100644 --- a/client/src/lib/form.js +++ b/client/src/lib/form.js @@ -339,7 +339,8 @@ class CheckBox extends Component { text: PropTypes.string.isRequired, label: PropTypes.string, help: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), - format: PropTypes.string + format: PropTypes.string, + overrideFormat: PropTypes.bool } render() { @@ -347,15 +348,28 @@ class CheckBox extends Component { const owner = this.getFormStateOwner(); const id = this.props.id; const htmlId = 'form_' + id; + const overrideFormat = this.props.overrideFormat; const className = owner.addFormValidationClass('form-check-input', id); - return wrapInput(id, htmlId, owner, props.format, '', props.label, props.help, + if(overrideFormat){ + return wrapInput(id, htmlId, owner, props.format, '', props.label, props.help, +
+ owner.updateFormValue(id, !owner.getFormValue(id))}/> + +
+ ); + } + else{ + return wrapInput(id, htmlId, owner, props.format, '', props.label, props.help,
owner.updateFormValue(id, !owner.getFormValue(id))}/> - +
- ); + ); + } + + } } diff --git a/client/src/lib/styles.scss b/client/src/lib/styles.scss index 6a9db9ff..59b6a676 100644 --- a/client/src/lib/styles.scss +++ b/client/src/lib/styles.scss @@ -124,6 +124,16 @@ text-align: right; } +.checkboxText{ + padding-top: 3px; +} +.overrideCheckboxForm{ + position: relative; + margin-top: -15px; + margin-bottom: 30px; + margin-left: 20px; +} + .dropZone{ padding-top: 20px; padding-bottom: 20px; diff --git a/client/src/send-configurations/CUD.js b/client/src/send-configurations/CUD.js index eff2b161..35b7ebec 100644 --- a/client/src/send-configurations/CUD.js +++ b/client/src/send-configurations/CUD.js @@ -231,13 +231,13 @@ export default class CUD extends Component {
- + - + - + - +