Skip to content

Commit

Permalink
Make the default template the default selection on the campaign form
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Nov 27, 2018
1 parent 1673cba commit 5ff0e44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/my/src/Campaign.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ class TheFormDef extends React.PureComponent {
</Form.Item>
<Form.Item {...formItemLayout} label="Template" extra="Template">
{getFieldDecorator("template_id", {
initialValue: record.template_id ? record.template_id : (this.props.data[cs.ModelTemplates].length === 1 ? this.props.data[cs.ModelTemplates][0].id : undefined),
initialValue: record.template_id ? record.template_id : (this.props.data[cs.ModelTemplates].length > 0 ? this.props.data[cs.ModelTemplates].filter(t => t.is_default)[0].id : undefined),
rules: [{ required: true }]
})(
<Select disabled={ this.props.formDisabled }>
Expand Down

0 comments on commit 5ff0e44

Please sign in to comment.