Commit 2db7b35d authored by Matija Obreza's avatar Matija Obreza

Minor UI fixes

- Overview page translations and layout
- PropertiesCard styles
- DatasetService rematchAccessions URL updated
parent b0ef2186
......@@ -422,11 +422,21 @@
"available": {
"true": "Available for distribution",
"false": "Not available for distribution",
"1": "Available for distribution",
"0": "Not available for distribution",
"null": "Availability not provided"
},
"sgsv": {
"true": "Backed up in SGSV",
"false": "Not in SGSV",
"1": "Backed up in SGSV",
"0": "Not in SGSV"
},
"mlsStatus": {
"true": "Accession is part of the Multi-lateral system of ITPGRFA",
"false": "Not declared in the Multi-lateral system of ITPGRFA ",
"false": "Not declared in the Multi-lateral system of ITPGRFA",
"1": "Accession is part of the Multi-lateral system of ITPGRFA",
"0": "Not declared in the Multi-lateral system of ITPGRFA",
"null": "Status not provided"
},
"coll": {
......@@ -481,6 +491,8 @@
"999": "Other"
},
"overview": {
"Other": "Other",
"Not specified": "Not specified",
"institute code": "Holding Institute",
"institute country code3": "Country of holding institute",
"crop shortName": "Crop",
......
......@@ -96,11 +96,21 @@
"available": {
"true": "Available for distribution",
"false": "Not available for distribution",
"1": "Available for distribution",
"0": "Not available for distribution",
"null": "Availability not provided"
},
"sgsv": {
"true": "Backed up in SGSV",
"false": "Not in SGSV",
"1": "Backed up in SGSV",
"0": "Not in SGSV"
},
"mlsStatus": {
"true": "Accession is part of the Multi-lateral system of ITPGRFA",
"false": "Not declared in the Multi-lateral system of ITPGRFA ",
"false": "Not declared in the Multi-lateral system of ITPGRFA",
"1": "Accession is part of the Multi-lateral system of ITPGRFA",
"0": "Not declared in the Multi-lateral system of ITPGRFA",
"null": "Status not provided"
},
"coll": {
......@@ -155,6 +165,8 @@
"999": "Other"
},
"overview": {
"Other": "Other",
"Not specified": "Not specified",
"institute code": "Holding Institute",
"institute country code3": "Country of holding institute",
"crop shortName": "Crop",
......
......@@ -5,7 +5,7 @@ import { translate } from 'react-i18next';
import { withStyles } from '@material-ui/core/styles';
// Actions
import { loadAccession } from 'accessions/actions/public';
import { loadAccession, applyFilters } from 'accessions/actions/public';
import {addAccessionToMyList, removeAccessionFromMyList} from 'list/actions/public';
// Models
......@@ -13,7 +13,6 @@ import AccessionDetails from 'model/accession/AccessionDetails';
import RepositoryFile from 'model/repository/RepositoryFile';
// UI
import { Link } from 'react-router-dom';
import PrettyDate from 'ui/common/time/PrettyDate';
import PageLayout, { PageContents, MainSection, PageSection } from 'ui/layout/PageLayout';
import ContentHeader from 'ui/common/heading/ContentHeader';
......@@ -59,6 +58,7 @@ interface IBrowsePageProps {
accessions: any;
addAccessionToMyList: any;
removeAccessionFromMyList: any;
applyFilters: any;
}
class BrowsePage extends React.Component<IBrowsePageProps, any> {
......@@ -95,6 +95,14 @@ class BrowsePage extends React.Component<IBrowsePageProps, any> {
}
}
private applyFilterForInstituteSpecies = () => {
const { accession: {details: accession}, applyFilters } = this.props;
const filter = {holder: {code: [ accession.institute.code ]}, taxa: { genus: [ accession.taxonomy.genus ], species: [ accession.taxonomy.species ] }};
applyFilters(filter);
}
public render() {
const { t, error, uuid, doi, accessions, classes } = this.props;
const { details: accession, pdci, datasets, subsets, files, imageGallery } = this.props.accession ?
......@@ -185,7 +193,7 @@ class BrowsePage extends React.Component<IBrowsePageProps, any> {
<PropertiesItem title={ t('accessions.common.species') }>
{ accession.taxonomy.species }
{ '' }
<Link to={ '/a' }>View <i>{ `${accession.taxonomy.genus} ${accession.taxonomy.species}` }</i> at { accession.institute.code }</Link>
<a onClick={ this.applyFilterForInstituteSpecies }>View <i>{ `${accession.taxonomy.genus} ${accession.taxonomy.species}` }</i> at { accession.institute.code }</a>
</PropertiesItem>
<PropertiesItem title={ t('accessions.public.p.display.scientificName') }><SciName taxa={ accession.taxonomy.taxonNameHtml } /></PropertiesItem>
{ accession.crop && <PropertiesItem title={ t('accessions.public.p.display.cropName') }><CropChips crops={ accession.crop.shortName } /></PropertiesItem> }
......@@ -311,6 +319,7 @@ const mapDispatchToProps = (dispatch) => bindActionCreators({
addAccessionToMyList,
removeAccessionFromMyList,
loadAccession,
applyFilters,
}, dispatch);
......
This diff is collapsed.
......@@ -122,7 +122,7 @@ class PartnerPage extends React.Component<IPartnerPageProps, any> {
) }
{ partnerInstitutes && partnerInstitutes.content && partnerInstitutes.content.length > 0 && (
<PropertiesItem title={ t('partners.common.wiewsCodes') }>
{ partnerInstitutes.content.map((institute) => (
{ partnerInstitutes.content.sort((a, b) => a.code.localeCompare(b.code)).map((institute) => (
<div key={ institute.code }>
<InstituteLink to={ institute }><b>{ institute.code }</b> { institute.fullName }</InstituteLink>
{ ` ` }
......@@ -133,7 +133,7 @@ class PartnerPage extends React.Component<IPartnerPageProps, any> {
) }
{ partner.countryCodes.length > 0 && (
<PropertiesItem title={ t('partners.common.countries') }>
{ partner.countryCodes.map((countryCode) => (
{ partner.countryCodes.sort().map((countryCode) => (
<div key={ countryCode }><CountryLink country={ countryCode } /></div>
)) }
</PropertiesItem>
......
......@@ -18,7 +18,7 @@ const URL_CREATE_DATASET = `/api/v1/dataset/create`;
const URL_REVIEW_DATASET = `/api/v1/dataset/for-review`;
const URL_DATASET_LIST = `/api/v1/dataset/list`;
const URL_MY_DATASETS = `/api/v1/dataset/list-mine`;
const URL_REMATCH_DATASET_ACCESSIONS = UrlTemplate.parse(`/api/v1/dataset/rematchAccessions/{uuid},{version}`);
const URL_REMATCH_DATASET_ACCESSIONS = UrlTemplate.parse(`/api/v1/dataset/rematch-accessions/{uuid},{version}`);
const URL_REJECT_DATASET = `/api/v1/dataset/reject`;
const URL_REMOVE_DESCRIPTORS = UrlTemplate.parse(`/api/v1/dataset/remove-descriptors/{uuid},{version}`);
const URL_UPDATE_DESCRIPTORS = UrlTemplate.parse(`/api/v1/dataset/set-descriptors/{uuid},{version}`);
......
......@@ -28,21 +28,24 @@ const styles = (theme) => ({
/* tslint:enable */
},
propertiesValue: {
overflowX: 'hidden' as 'hidden',
display: 'flex' as 'flex',
flexWrap: 'wrap' as 'wrap',
alignItems: 'center' as 'center',
fontSize: '1rem',
padding: '.7rem 1rem',
// display: 'flex' as 'flex',
// flexWrap: 'wrap' as 'wrap',
// alignItems: 'center' as 'center',
fontSize: '1rem',
padding: '.7rem 1rem',
},
propertiesValueSmall: {
alignItems: 'flex-end' as 'flex-end',
[theme.breakpoints.down('sm')]: {
justifyContent: 'flex-end' as 'flex-end',
},
display: 'flex' as 'flex',
overflowX: 'hidden' as 'hidden',
alignItems: 'flex-end' as 'flex-end',
[theme.breakpoints.down('sm')]: {
justifyContent: 'flex-end' as 'flex-end',
},
},
propertiesValueNumeric: {
justifyContent: 'flex-end' as 'flex-end',
display: 'flex' as 'flex',
overflowX: 'hidden' as 'hidden',
justifyContent: 'flex-end' as 'flex-end',
},
});
......
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