Merge and cleanup of PR #564

The namespace filter in campaigns was dropped (i.e. "Work with campaign's namespace"). Instead, we need a universal solution. For instance a namespace slector somewhere in the top-right corner, which should apply to everything (not just campaigns).

Nevertheless, I kept the ...-by-namespace rest endpoints and related functions in models because they will be useful for implementing the universal namespace selection feature.
This commit is contained in:
Tomas Bures 2019-03-27 00:41:18 +01:00
parent dcb7168322
commit 2fe7f82be3
18 changed files with 1104 additions and 1143 deletions

View file

@ -340,7 +340,7 @@ class CheckBox extends Component {
label: PropTypes.string,
help: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
format: PropTypes.string,
overrideFormat: PropTypes.bool
className: PropTypes.string
}
render() {
@ -348,28 +348,15 @@ 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);
const inputClassName = owner.addFormValidationClass('form-check-input', id);
if(overrideFormat){
return wrapInput(id, htmlId, owner, props.format, '', props.label, props.help,
<div className={styles.overrideCheckboxForm}>
<input className={className} type="checkbox" checked={owner.getFormValue(id)} id={htmlId} aria-describedby={htmlId + '_help'} onChange={evt => owner.updateFormValue(id, !owner.getFormValue(id))}/>
return wrapInput(id, htmlId, owner, props.format, '', props.label, props.help,
<div className={`form-group form-check my-2 ${this.props.className}`}>
<input className={inputClassName} type="checkbox" checked={owner.getFormValue(id)} id={htmlId} aria-describedby={htmlId + '_help'} onChange={evt => owner.updateFormValue(id, !owner.getFormValue(id))}/>
<label className={styles.checkboxText} htmlFor={htmlId}>{props.text}</label>
</div>
);
}
else{
return wrapInput(id, htmlId, owner, props.format, '', props.label, props.help,
<div className="form-group form-check my-2">
<input className={className} type="checkbox" checked={owner.getFormValue(id)} id={htmlId} aria-describedby={htmlId + '_help'} onChange={evt => owner.updateFormValue(id, !owner.getFormValue(id))}/>
<label className={styles.checkboxText} htmlFor={htmlId}>{props.text}</label>
</div>
);
}
);
}
}