Commit 3ebdef0b authored by Alejandro De Maria Antolinos's avatar Alejandro De Maria Antolinos

Merge branch 'issue_173' into 'master'

Issue 173

Closes #173

See merge request !156
parents e54ceabb 6f41c1c1
Pipeline #11620 passed with stages
in 2 minutes and 14 seconds
......@@ -3,8 +3,10 @@ import Moment from 'react-moment';
import { Grid, Row, Col, Image } from 'react-bootstrap';
import './DatasetSummary.css';
import EMDatasetSummary from './EMDatasetSummary';
import MXDatasetSummary from './MXDatasetSummary';
import GalleryDatasetThumbnail from '../GalleryDatasetThumbnail.js'
import { getDatasetParameterValueByName } from '../../../helpers/DatasetHelper.js';
import { getDatasetParameterValueByName, getDatasetParameterByPrefixName } from '../../../helpers/DatasetHelper.js';
import ParameterTableWidget from '../../Instrument/ParameterTableWidget.js';
class DatasetSummary extends React.Component {
......@@ -25,6 +27,13 @@ class DatasetSummary extends React.Component {
return <EMDatasetSummary dataset={this.props.dataset}></EMDatasetSummary>
}
}
else{
/** some MX datasets has no definition but we can figure out that it is MX because will have many MX_ parameters */
if (getDatasetParameterByPrefixName(this.props.dataset, "MX_").length > 1){
/** It is MX */
return <MXDatasetSummary dataset={this.props.dataset}></MXDatasetSummary>
}
}
return (
<Grid fluid style={{margin:'20px'}}>
......
......@@ -10,24 +10,41 @@ class EMDatasetSummary extends React.Component {
getParameters(){
return [
{name : 'Name', value : this.props.dataset.name},
{name : 'Dataset', value : this.props.dataset.name},
{name : 'Sample', value : this.props.dataset.sampleName},
{name : 'Protein', value : getDatasetParameterValueByName(this.props.dataset, "EM_protein_acronym")},
{name : 'Definition', value : getDatasetParameterValueByName(this.props.dataset, "definition")},
{name : 'Start', value : <Moment parse="YYYY-MM-DD HH:mm" format="LTS">{this.props.dataset.startDate}</Moment>},
{name : 'Sample', value : this.props.dataset.sampleName},
{name : 'Description', value : getDatasetParameterValueByName(this.props.dataset, "Sample_description")}
];
}
getTechniqueParameters(){
return [
{name : 'Amplitute', value : getDatasetParameterValueByName(this.props.dataset, "EM_amplitude_contrast") + " %" },
{name : 'Initial Dose', value : getDatasetParameterValueByName(this.props.dataset, "EM_dose_initial")},
{name : 'Dose/frame', value : getDatasetParameterValueByName(this.props.dataset, "EM_dose_per_frame")},
{name : 'Images', value : getDatasetParameterValueByName(this.props.dataset, "EM_images_count")},
{name : 'Magnification', value : getDatasetParameterValueByName(this.props.dataset, "EM_magnification")},
{name : 'Sampling Rate', value : getDatasetParameterValueByName(this.props.dataset, "EM_sampling_rate") + " Å/pixel"},
{name : 'Spherical Ab.', value : getDatasetParameterValueByName(this.props.dataset, "EM_spherical_aberration") + " mm"},
{name : 'Voltage', value : getDatasetParameterValueByName(this.props.dataset, "EM_voltage")}
];
}
render() {
return (
<Grid fluid style={{margin:'20px'}}>
<Row>
<Col xs={12} md={4}>
<ParameterTableWidget striped={true} parameters={this.getParameters()} ></ParameterTableWidget>
<Col xs={12} md={2}>
<ParameterTableWidget striped={false} parameters={this.getParameters()} ></ParameterTableWidget>
</Col>
<Col xs={12} sm={12} md={2}>
<ParameterTableWidget striped={false} parameters={this.getTechniqueParameters()} ></ParameterTableWidget>
</Col>
<Col xs={12} sm={12} md={2}>
......
......@@ -60,9 +60,13 @@ class DatasetWidget extends React.Component {
}
return null;
})}
<Tab eventKey={9} title="Instrument" disabled={ getDatasetParameterByPrefixName(this.props.dataset, "Instrument").length == 0}>
<InstrumentWidget dataset={dataset} ></InstrumentWidget>
</Tab>
{!getDatasetParameterByPrefixName(this.props.dataset, "Instrument").length == 0 &&
<Tab eventKey={9} title="Instrument" >
<InstrumentWidget dataset={dataset} ></InstrumentWidget>
</Tab>
}
<Tab eventKey={11} title={getFilesTabTitle(dataset)} mountOnEnter={true}>
<DatasetFileTree dataset={dataset} sessionId={this.props.sessionId}> ></DatasetFileTree>
</Tab>
......
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