Commit 96b99fda authored by Maxime Chaillet's avatar Maxime Chaillet

remove horizontal scrolls when unnecessary.

parent ac83717f
......@@ -116,7 +116,6 @@ class MySearchPage extends React.Component {
</div>
);
}
}
class MyDataPage extends React.Component {
......@@ -132,7 +131,6 @@ class MyDataPage extends React.Component {
</div>
);
}
}
class ClosedDataPage extends React.Component {
......@@ -159,8 +157,6 @@ class ClosedDataPage extends React.Component {
</Panel.Body>
</Panel>
</Panel>
</div>
);
}
......@@ -175,14 +171,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 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")})});
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 />
......@@ -194,11 +190,11 @@ class OpenDataPage extends React.Component {
</Panel.Heading>
<Panel.Body>
<DataCollectionsContainer filterFunction={filterPublications} datacollections={this.props.datacollections} openData={true} />
<DataCollectionsContainer filterFunction={filterPublications} datacollections={this.props.datacollections} openData={true} />
</Panel.Body>
</Panel>
<Panel bsStyle="success" style={{ marginTop: '30px', marginLeft: '30px', marginRight: '30px' }}>
<Panel.Heading >
......@@ -206,7 +202,7 @@ class OpenDataPage extends React.Component {
</Panel.Heading>
<Panel.Body>
<DataCollectionsContainer filterFunction={filterNotPublications} datacollections={this.props.datacollections} openData={true} />
<DataCollectionsContainer filterFunction={filterNotPublications} datacollections={this.props.datacollections} openData={true} />
</Panel.Body>
</Panel>
......@@ -219,7 +215,7 @@ class OpenDataPage extends React.Component {
<Panel.Body>
<InvestigationsContainer
linkProposal={false}
investigations={this.props.releasedInvestigations}
investigations={this.props.releasedInvestigations}
closedData={false}
/>
</Panel.Body>
......
......@@ -42,7 +42,6 @@ class HTMLEditor extends Component {
const { editorContent } = this.state;
const config = (isEditionMode === true) ? new EditionModeConfig() : new ViewModeConfig();
//debugger;
return (
<Editor
id={this.props.text ? EDITOR_ID_FOR_EDITION : EDITOR_ID_FOR_CREATION}
......
......@@ -37,7 +37,6 @@ class EventList extends React.Component {
if (!lastEvent.events) {
lastEvent.events = [event];
}
lastEvent.type = COLLAPSED_EVENT_TYPES;
lastEvent.events.push(event);
continue;
}
......@@ -68,7 +67,7 @@ class EventList extends React.Component {
}
return <Table responsive style={{ fontSize: '12px' }} >
<tbody style={{ borderRight: '1px solid #F9F9F9' }}>
<tbody>
{this.state.items.map((event, index) => {
if (event.type === "date") {
return <tr><td style={{ borderTop: '1px solid #f2f2f2', textAlign: 'center', fontSize: '18px', fontWeight: 'bold' }} colSpan={3} ><a name={event.anchor}></a> {event.text}</td></tr>;
......@@ -125,7 +124,7 @@ class Event extends React.Component {
<LazyContentEvent event={event} />
{event.events && this.state.collapsed ? <Label style={{ color: "blue", backgroundColor: "white", cursor: "pointer" }} onClick={this.handleClick} >.... {event.events.length} command lines more</Label> : null}
</td>
<td style={{ border: 0 }}>
<td style={{ width: '50px', border: 0 }}>
<Button bsStyle="link" bsSize="small" style={{ padding: '0px' }} onClick={() => this.props.onEventClicked(event)}>
<Glyphicon glyph='edit' style={{ width: '40px' }} />
</Button>
......@@ -144,7 +143,7 @@ class LazyContentEvent extends React.Component {
var content = this.getHTMLContent(this.props.event);
if (content) {
/** For performance only events with images are lazy loaded */
if ((this.props.event.type === NOTIFICATION || (this.props.event.type === COLLAPSED_EVENT_TYPES)) && this.props.event.previousVersionEvent) {
if ((this.props.event.type === NOTIFICATION) && this.props.event.previousVersionEvent) {
return <LazyLoad>
<div dangerouslySetInnerHTML={{ __html: this.getHTMLContent(getOriginalEvent(this.props.event)) }} />
<div dangerouslySetInnerHTML={{ __html: content }} />
......
......@@ -26,7 +26,6 @@ class NewOrEditEventPanel extends React.Component {
}
render() {
let { event, user, context, investigationId, setEditEventVisibility } = this.props;
return (
<Panel bsStyle='primary' style={{ marginBottom: '0px', height: '100%', position: 'relative' }}>
<EventHeader context={context} />
......
......@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types'
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { Row, Col, Tab, Glyphicon, Badge, Nav, NavItem } from 'react-bootstrap';
import { Grid, Row, Col, Tab, Glyphicon, Badge, Nav, NavItem } from 'react-bootstrap';
import DatasetTable from '../../components/Dataset/DatasetTable.js';
import { PERSPECTIVE } from '../../constants/Perspectives.js';
import { addDatasetById, removeDatasetById } from '../../actions/selection.js';
......@@ -30,30 +30,30 @@ class InvestigationContainer extends Component {
loadDatasetsByInvestigationId() {
let { investigationId } = this.props;
if (investigationId) {
if (this.props.user.sessionId) {
this.props.fetchDatasetsByInvestigationId(this.props.user.sessionId, investigationId);
let investigation = _.find(this.props.myInvestigations, (investigation) => { return investigation.id === Number(investigationId) });
if (investigation) {
// investigation was found in my Data
this.props.setBreadCrumbs([
{ name: 'My Data', link: '/investigations' },
{ name: 'My Data', link: '/investigations' },
{ name: investigation.visitId.toUpperCase(), link: '/investigations' },
{ badge: investigation.name, name: investigation.summary, link: '/investigation/' + investigation.id + '/datasets' }
]);
} else {
// investion not found in my data, it can be among closed data
investigation = _.find(this.props.investigations, (investigation) => { return investigation.id === Number(investigationId) });
if (investigation) {
// investigation was found in my Data
this.props.setBreadCrumbs([
{ name: 'Closed Data', link: '/closed' },
{ name: 'Closed Data', link: '/closed' },
{ name: investigation.visitId.toUpperCase(), link: '/investigations' },
{ name: investigation.name + ": " + investigation.summary, link: '/investigation/' + investigation.id + '/datasets' }
{ name: investigation.name + ": " + investigation.summary, link: '/investigation/' + investigation.id + '/datasets' }
]);
}
......@@ -63,29 +63,29 @@ class InvestigationContainer extends Component {
}
}
setDOIBreadCrumbs(doi){
this.props.setBreadCrumbs([{ name: 'Open Data', link: '/public' }, { badge: doi, name: '', link: '/public/' + doi }]);
setDOIBreadCrumbs(doi) {
this.props.setBreadCrumbs([{ name: 'Open Data', link: '/public' }, { badge: doi, name: '', link: '/public/' + doi }]);
}
componentWillReceiveProps(nextProps) {
/** If component was mounted when sessionId was still not ready */
/** If component was mounted when sessionId was still not ready */
if (!this.props.user.sessionId) {
if (nextProps.user.sessionId) {
if (nextProps.user.sessionId !== this.props.user.sessionId) {
this.fetchData(nextProps.user.sessionId);
this.setDOIBreadCrumbs( this.props.doi);
this.setDOIBreadCrumbs(this.props.doi);
}
}
}
if (this.props.doi){
this.setDOIBreadCrumbs( this.props.doi);
if (this.props.doi) {
this.setDOIBreadCrumbs(this.props.doi);
}
}
fetchData(sessionId) {
if (this.props.doi != null) {
if (sessionId) {
if (sessionId) {
this.props.fetchDatasetsByDOI(sessionId, this.props.doi);
}
}
......@@ -127,10 +127,10 @@ class InvestigationContainer extends Component {
/** Search proposal */
var _this = this;
var investigation = _.find(this.props.releasedInvestigations.concat(this.props.myInvestigations).concat(this.props.investigations), function(i){return i.id === _this.props.investigationId;});
if (investigation){
if (investigation.visitId === "publisher"){
expanded = _.map(this.props.datasets.data, function(d){return d.id;});
var investigation = _.find(this.props.releasedInvestigations.concat(this.props.myInvestigations).concat(this.props.investigations), function (i) { return i.id === _this.props.investigationId; });
if (investigation) {
if (investigation.visitId === "publisher") {
expanded = _.map(this.props.datasets.data, function (d) { return d.id; });
}
}
/** If no user or sessionId return nothing */
......@@ -138,7 +138,7 @@ class InvestigationContainer extends Component {
return null;
}
return (< div>
return (<Grid fluid>
<Tab.Container id="tabs" activeKey={this.state.activeTab} onSelect={this.handleSelect}>
<Row className="clearfix">
<TabContainerMenu isLogBookTabDisplayed={!this.props.isDOI} datasetCount={this.props.datasets.data.length} />
......@@ -164,13 +164,10 @@ class InvestigationContainer extends Component {
</Col>
</Row>
</Tab.Container>
</div >)
</Grid>)
}
}
function TabContainerMenu(props) {
var logbookClassName = "";
if (!props.isLogBookTabDisplayed) {
......@@ -199,7 +196,6 @@ function TabContainerMenu(props) {
)
}
function mapStateToProps(state) {
return {
datasets: state.datasets,
......
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