Fix the preview button in the new template form
This commit is contained in:
parent
0849dc491b
commit
9582e20cd7
|
@ -93,11 +93,13 @@ class CreateFormDef extends React.PureComponent {
|
||||||
<Input.TextArea autosize={{ minRows: 10, maxRows: 30 }} />
|
<Input.TextArea autosize={{ minRows: 10, maxRows: 30 }} />
|
||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
{ this.props.form.getFieldValue("body") !== "" &&
|
||||||
<Form.Item {...formItemLayout} colon={ false } label=" ">
|
<Form.Item {...formItemLayout} colon={ false } label=" ">
|
||||||
<Button icon="search" onClick={ () =>
|
<Button icon="search" onClick={ () =>
|
||||||
this.handlePreview(this.props.form.getFieldValue("name"), this.props.form.getFieldValue("body"))
|
this.handlePreview(this.props.form.getFieldValue("name"), this.props.form.getFieldValue("body"))
|
||||||
}>Preview</Button>
|
}>Preview</Button>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
}
|
||||||
</Form>
|
</Form>
|
||||||
</Spin>
|
</Spin>
|
||||||
<Row>
|
<Row>
|
||||||
|
@ -111,7 +113,7 @@ class CreateFormDef extends React.PureComponent {
|
||||||
{ this.state.previewBody &&
|
{ this.state.previewBody &&
|
||||||
<ModalPreview
|
<ModalPreview
|
||||||
title={ this.state.previewName ? this.state.previewName : "Template preview" }
|
title={ this.state.previewName ? this.state.previewName : "Template preview" }
|
||||||
previewURL={ cs.Routes.PreviewTemplate }
|
previewURL={ cs.Routes.PreviewNewTemplate }
|
||||||
body={ this.state.previewBody }
|
body={ this.state.previewBody }
|
||||||
onCancel={() => {
|
onCancel={() => {
|
||||||
this.setState({ previewBody: null, previewName: null })
|
this.setState({ previewBody: null, previewName: null })
|
||||||
|
|
Loading…
Reference in New Issue