Commit a2c0b2a9 authored by Alejandro De Maria Antolinos's avatar Alejandro De Maria Antolinos

Merge branch 'issue_148' into 'master'

It fixes #148

Closes #148

See merge request !134
parents 6d12d8e2 4d3b5d54
......@@ -17,6 +17,7 @@ import Footer from './components/Footer.js';
import { BrowserRouter as Router, Route } from "react-router-dom";
import TagContainer from './containers/TagContainer';
import { TAG_MANAGER_CONTEXT } from './constants/EventTypes';
import _ from 'lodash';
class App extends Component {
render() {
......@@ -174,6 +175,14 @@ class OpenDataPage extends React.Component {
<LoginContainer />
</div>;
}
var filterNotPublications = function(data){
return _.filter(data, function(o){ return _.find(o.parameters, function(p){return (p.name=="instrumentNames" && p.value=="PUBLISHER")})});
}
var filterPublications = function(data){
return _.filter(data, function(o){ return _.find(o.parameters, function(p){return (p.name=="instrumentNames" && p.value!="PUBLISHER")})});
}
return (
<div>
<MenuContainer />
......@@ -185,10 +194,23 @@ class OpenDataPage extends React.Component {
</Panel.Heading>
<Panel.Body>
<DataCollectionsContainer openData={true} {...this.props} />
<DataCollectionsContainer filterFunction={filterPublications} datacollections={this.props.datacollections} openData={true} />
</Panel.Body>
</Panel>
<Panel bsStyle="success" style={{ marginTop: '30px', marginLeft: '30px', marginRight: '30px' }}>
<Panel.Heading >
<Panel.Title componentClass="h2"> <Glyphicon glyph="eye-open" /> Public Documents</Panel.Title>
</Panel.Heading>
<Panel.Body>
<DataCollectionsContainer filterFunction={filterNotPublications} datacollections={this.props.datacollections} openData={true} />
</Panel.Body>
</Panel>
<Panel bsStyle="primary" style={{ marginTop: '30px', marginLeft: '30px', marginRight: '30px' }}>
<Panel.Heading >
<Panel.Title componentClass="h2"> <Glyphicon glyph="eye-open" /> Open Investigations</Panel.Title>
......@@ -203,6 +225,7 @@ class OpenDataPage extends React.Component {
</Panel.Body>
</Panel>
</div>
);
}
......
import React from 'react';
import { Grid, Row, Col,Label, Glyphicon } from 'react-bootstrap';
import { Button, Grid, Row, Col,Label, Glyphicon } from 'react-bootstrap';
import { Link } from 'react-router-dom';
import DOIBadge from '../../components/doi/DOIBadge.js';
import _ from 'lodash';
......@@ -29,8 +29,8 @@ class DataCollectionTable extends React.Component {
if (names){
if (names.value){
return <Link to={`/public/${datacollection.doi}`}>
<Glyphicon glyph="circle-arrow-right" /><span style={{marginLeft:'10px'}}>{names.value} </span>
return <Link to={`/public/${datacollection.doi}`}>
<Button bsSize="xsmall" style={{width:120, textAlign:'left'}}><Glyphicon glyph="circle-arrow-right" /><span style={{marginLeft:'10px'}}>{names.value} </span></Button>
</Link>;
}
}
......
......@@ -10,11 +10,14 @@ class DataCollectionsContainer extends Component {
if ((!this.props.user) || (!this.props.user.sessionId)) {
return null;
}
var data = this.props.datacollections.data;
if (this.props.filterFunction){
data = this.props.filterFunction(this.props.datacollections.data);
}
return (
<div>
<Loader show={this.props.datacollections.fetching} >
<DataCollectionTable fetching={this.props.datacollections.fetching} datacollections={this.props.datacollections.data}></DataCollectionTable>
<DataCollectionTable fetching={this.props.datacollections.fetching} datacollections={data}></DataCollectionTable>
</Loader>
</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