Commit 18382802 authored by Matija Obreza's avatar Matija Obreza

Updates to Location editor

parent 9811132b
Pipeline #7113 passed with stages
in 8 minutes and 38 seconds
......@@ -123,9 +123,9 @@ class LocationMap extends React.Component<ILocationMapProps, any> {
.join(', ')
}
</PropertiesItem>
<PropertiesItem title="Date of evaluation:"><McpdDate value={ location.startDate }/> &mdash; <McpdDate value={ location.endDate }/></PropertiesItem>
<PropertiesItem title="Description:"><Markdown source={ location.description }/></PropertiesItem>
<PropertiesItem title="ISO3 country code:">{ location.countryCode }</PropertiesItem>
{ (location.startDate || location.endDate) && <PropertiesItem title="Date of evaluation:"><McpdDate value={ location.startDate }/> &mdash; <McpdDate value={ location.endDate }/></PropertiesItem> }
{ location.description && <PropertiesItem title="Description:"><Markdown source={ location.description }/></PropertiesItem> }
{ location.countryCode && <PropertiesItem title="ISO3 country code:">{ location.countryCode }</PropertiesItem> }
</Properties>
)) }
</Grid>
......
......@@ -174,7 +174,7 @@ class LocationForm extends React.Component<ILocationFormProps, any> {
<Field
name={ `${location}.description` }
component={ MarkdownField }
label="Descriptrion"
label="Description of environment and conditions at the site of evaluation"
/>
<Field
name={ `${location}.countryCode` }
......
......@@ -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>
......
......@@ -123,7 +123,7 @@ class LangListComponent extends React.Component<ILangListComponentProps, any> {
{
// Using <a href="ru/" will reload app from server
languages.map((lang, index) => (
<a key={ (lang.short) } href={ `${lang.short}/` }><MenuItem>{ `${lang.label}` }</MenuItem></a>
<a key={ (lang.short) } href={ `${lang.short === 'en' ? '' : lang.short}/` }><MenuItem>{ `${lang.label}` }</MenuItem></a>
))
}
</Menu>
......
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