Commit f867d5df authored by Matija Obreza's avatar Matija Obreza
Browse files

Request instructions

parent 17db8fe6
......@@ -325,6 +325,9 @@
"purposeType": {
"0": "Other (please elaborate in Notes field)",
"1": "Research for food and agriculture"
},
"submit": {
"instructions": "Once you push **submit request** button your request will be validated.\n\nCheck your email and also check your SPAM folder for a validation message from Genesys.\n\nThe email address provided will be checked against ITPGRFA's Easy-SMTA database."
}
},
"institute": {
......
......@@ -5,21 +5,21 @@ import ConfirmStep from 'requests/ui/request-stepper/steps/confirm';
const steps = [
{
id: 1,
name: 'Requested accession list',
name: 'Review list of material',
path: '/create',
component: AccessionsListStep,
exact: true,
},
{
id: 2,
name: 'Personal info',
name: 'Personal information',
path: '/create/request-info',
component: RequestInfoStep,
exact: true,
},
{
id: 3,
name: 'Review and submit',
name: 'Finalize and submit',
path: '/create/submit',
component: ConfirmStep,
exact: true,
......
import * as React from 'react';
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { translate } from 'react-i18next';
// ui
import StepperTemplate from 'ui/common/stepper/StepperTemplate';
import Markdown from 'ui/common/markdown';
interface IAccessionsListStep extends React.ClassAttributes<any> {
t: any;
myList: string[];
requestInfo: any;
}
......@@ -25,18 +28,12 @@ class ConfirmStep extends StepperTemplate<IAccessionsListStep> {
}
protected renderContent = () => {
return (
<div className="p-20">
<h3>Once you push <Markdown basic source={ `"**send to review**"` }/> button your request will be send to review</h3>
<h5>
Then within a few minutes you will have received our message at the email address you
have provided with further instructions to confirm your request for germplasm.
</h5>
<h5>Make sure you also check your SPAM folder.</h5>
<h5> If the message does not arrive, please initiate the request again by going to 'My List'.</h5>
</div>
);
const { t } = this.props;
return (
<div className="p-20">
<Markdown source={ t('request.submit.instructions') } />
</div>
);
}
......@@ -52,4 +49,4 @@ const mapDispatchToProps = (dispatch) => bindActionCreators({
export default connect(
mapStateToProps, mapDispatchToProps,
)(ConfirmStep);
)(translate()(ConfirmStep));
......@@ -24,10 +24,10 @@ class RequestInfoForm extends React.Component<IPersonalInfoFormProps, any> {
<form onSubmit={ handleSubmit } className="p-20">
<Field
name="email"
label="E-mail"
label="Your e-mail address as registered in Easy-SMTA"
type="text"
component={ TextField }
validate={ [Validators.required] }
validate={ [ Validators.required, Validators.emailAddress ] }
fullWidth
/>
<Field
......@@ -47,10 +47,11 @@ class RequestInfoForm extends React.Component<IPersonalInfoFormProps, any> {
/>
<Field
name="notes"
label="Notes"
label="Additional notes to submit with your request"
type="text"
component={ TextField }
fullWidth
multiline
/>
</form>
);
......
......@@ -6,6 +6,7 @@ import Markdown from 'ui/common/markdown';
import OriginalMarkdownField from 'ui/common/markdown/MarkdownField';
import FormControl from 'ui/common/forms/FormControl';
import Input from '@material-ui/core/Input';
import FormHelperText from '@material-ui/core/FormHelperText';
class MarkdownField extends OriginalMarkdownField {
......@@ -43,9 +44,9 @@ class MarkdownField extends OriginalMarkdownField {
return (
<FormControl fullWidth required={ required } meta={ meta } label={ label }>
<Input error={ touched && error } { ...input } { ...custom } />
<h6>
<FormHelperText>
<span>Basic markdown supported: * **</span>
</h6>
</FormHelperText>
</FormControl>
);
}
......@@ -55,14 +56,14 @@ class MarkdownField extends OriginalMarkdownField {
{ ! this.state.previewMode ?
<FormControl fullWidth required={ required } meta={ meta } label={ label }>
<Input error={ touched && error } multiline { ...input } { ...custom } />
<h6><a onClick={ this.onChangePreviewMode }>Preview Markdown</a> <span> Full markdown supported</span></h6>
<FormHelperText><a onClick={ this.onChangePreviewMode }>Preview Markdown</a> <span> Full markdown supported</span></FormHelperText>
</FormControl>
:
<FormControl fullWidth required={ required } meta={ meta } label={ label }>
<div style={ { paddingTop: '1.5rem' } }>
<Markdown source={ input.value } />
</div>
<h6><a onClick={ this.onChangePreviewMode }>Edit Markdown</a></h6>
<FormHelperText><a onClick={ this.onChangePreviewMode }>Edit Markdown</a></FormHelperText>
</FormControl>
}
</div>
......
......@@ -2,6 +2,7 @@ import * as React from 'react';
import Input from '@material-ui/core/Input';
import FormControl from 'ui/common/forms/FormControl';
import Markdown from 'ui/common/markdown';
import FormHelperText from '@material-ui/core/FormHelperText';
class MarkdownField extends React.Component<any, any> {
......@@ -26,15 +27,15 @@ class MarkdownField extends React.Component<any, any> {
{ (basic || !this.state.previewMode) ?
<FormControl fullWidth required={ required } meta={ meta } label={ label }>
<Input error={ touched && error } multiline={ !basic } { ...input } />
<h6>
<FormHelperText>
{ ! basic && <a onClick={ this.onChangePreviewMode }>Preview Markdown</a> }
<span> { basic ? 'Basic markdown supported: * **' : 'Full markdown supported' }</span>
</h6>
</FormHelperText>
</FormControl>
:
<FormControl fullWidth required={ required } meta={ meta } label={ label }>
<Markdown style={ { marginTop: '2rem' } } basic={ basic } source={ input.value } />
<h6><a onClick={ this.onChangePreviewMode }>Edit Markdown</a></h6>
<FormHelperText><a onClick={ this.onChangePreviewMode }>Edit Markdown</a></FormHelperText>
</FormControl>
}
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment