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

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> { ...@@ -123,9 +123,9 @@ class LocationMap extends React.Component<ILocationMapProps, any> {
.join(', ') .join(', ')
} }
</PropertiesItem> </PropertiesItem>
<PropertiesItem title="Date of evaluation:"><McpdDate value={ location.startDate }/> &mdash; <McpdDate value={ location.endDate }/></PropertiesItem> { (location.startDate || location.endDate) && <PropertiesItem title="Date of evaluation:"><McpdDate value={ location.startDate }/> &mdash; <McpdDate value={ location.endDate }/></PropertiesItem> }
<PropertiesItem title="Description:"><Markdown source={ location.description }/></PropertiesItem> { location.description && <PropertiesItem title="Description:"><Markdown source={ location.description }/></PropertiesItem> }
<PropertiesItem title="ISO3 country code:">{ location.countryCode }</PropertiesItem> { location.countryCode && <PropertiesItem title="ISO3 country code:">{ location.countryCode }</PropertiesItem> }
</Properties> </Properties>
)) } )) }
</Grid> </Grid>
......
...@@ -174,7 +174,7 @@ class LocationForm extends React.Component<ILocationFormProps, any> { ...@@ -174,7 +174,7 @@ class LocationForm extends React.Component<ILocationFormProps, any> {
<Field <Field
name={ `${location}.description` } name={ `${location}.description` }
component={ MarkdownField } component={ MarkdownField }
label="Descriptrion" label="Description of environment and conditions at the site of evaluation"
/> />
<Field <Field
name={ `${location}.countryCode` } name={ `${location}.countryCode` }
......
...@@ -2,6 +2,7 @@ import * as React from 'react'; ...@@ -2,6 +2,7 @@ import * as React from 'react';
import Input from '@material-ui/core/Input'; import Input from '@material-ui/core/Input';
import FormControl from 'ui/common/forms/FormControl'; import FormControl from 'ui/common/forms/FormControl';
import Markdown from 'ui/common/markdown'; import Markdown from 'ui/common/markdown';
import FormHelperText from '@material-ui/core/FormHelperText';
class MarkdownField extends React.Component<any, any> { class MarkdownField extends React.Component<any, any> {
...@@ -26,15 +27,15 @@ class MarkdownField extends React.Component<any, any> { ...@@ -26,15 +27,15 @@ class MarkdownField extends React.Component<any, any> {
{ (basic || !this.state.previewMode) ? { (basic || !this.state.previewMode) ?
<FormControl fullWidth required={ required } meta={ meta } label={ label }> <FormControl fullWidth required={ required } meta={ meta } label={ label }>
<Input error={ touched && error } multiline={ !basic } { ...input } /> <Input error={ touched && error } multiline={ !basic } { ...input } />
<h6> <FormHelperText>
{ ! basic && <a onClick={ this.onChangePreviewMode }>Preview Markdown</a> } { ! basic && <a onClick={ this.onChangePreviewMode }>Preview Markdown</a> }
<span> { basic ? 'Basic markdown supported: * **' : 'Full markdown supported' }</span> <span> { basic ? 'Basic markdown supported: * **' : 'Full markdown supported' }</span>
</h6> </FormHelperText>
</FormControl> </FormControl>
: :
<FormControl fullWidth required={ required } meta={ meta } label={ label }> <FormControl fullWidth required={ required } meta={ meta } label={ label }>
<Markdown style={ { marginTop: '2rem' } } basic={ basic } source={ input.value } /> <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> </FormControl>
} }
</div> </div>
......
...@@ -123,7 +123,7 @@ class LangListComponent extends React.Component<ILangListComponentProps, any> { ...@@ -123,7 +123,7 @@ class LangListComponent extends React.Component<ILangListComponentProps, any> {
{ {
// Using <a href="ru/" will reload app from server // Using <a href="ru/" will reload app from server
languages.map((lang, index) => ( 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> </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