Commit a2fd73cd authored by Maxime Chaillet's avatar Maxime Chaillet

Merge branch 'issue178' into 'master'

Issue178

Closes #178

See merge request !169
parents abef2ad8 eccfec51
Pipeline #13825 passed with stages
in 6 minutes and 17 seconds
import { SET_AVAILABLE_TAGS, CLEAR_AVAILABLE_TAGS } from '../constants/ActionTypes';
import { SET_AVAILABLE_TAGS, CLEAR_AVAILABLE_TAGS, SET_LOGBOOK_CONTEXT } from '../constants/ActionTypes';
/**
* Action used to set available tags
......@@ -16,4 +16,18 @@ export function clearAvailableTagAction() {
return {
type: CLEAR_AVAILABLE_TAGS,
};
}
/**
* Set the logbook context ie the context in which the logbook is used. Here the context corresponds to :
* - 'proposal': indicating that the logbook is associated to a proposal
* - 'dataCollection': indicating that the logbook is associated to a dataCollection
* - 'dataset': indicating that the logbook is associated to a dataset
* @param {*} context the context object for which the logbook is run.
*/
export function setLogbookContextAction(context) {
return {
type: SET_LOGBOOK_CONTEXT,
context: context,
};
}
\ No newline at end of file
......@@ -8,8 +8,6 @@ class InvestigationWidget extends React.Component {
constructor(props) {
super(props);
this.state = {
investigationUsers : [],
fetched: false,
......@@ -17,7 +15,6 @@ class InvestigationWidget extends React.Component {
}
}
componentDidMount() {
axios.get(getInvestigationUsersByInvestigationId(this.props.sessionId, this.props.investigation.id))
.then(res => {
......
......@@ -7,41 +7,44 @@ import PropTypes from 'prop-types'
*/
class EventFooter extends React.Component {
render() {
let { cancelButtonLabel, isSaveButtonVisible } = this.props;
return (
<div style={{ position: 'relative', height: '37px' }}>
&nbsp;
<div className="noUnderlinedLink" style={{ position: 'absolute', right: '10px', top: '5px' }}>
<ButtonToolbar>
<ButtonGroup style={{ height: '30px' }}>
{this.props.isSaveButtonEnabled === true ?
<OverlayTrigger
placement="left"
overlay={<Tooltip id="tooltip">
<p> Save the event. </p>
</Tooltip>}>
<Button className="btn btn-primary" bsSize="small" onClick={() => this.props.onSaveButtonClicked()}> Save </Button>
</OverlayTrigger>
:
<OverlayTrigger
placement="left"
overlay={<Tooltip id="tooltip2">
<p> First add a comment before you can save the event. </p>
</Tooltip>}>
<div>
{/* the following div is a workaround to the abscence of tooltip on a disabled button */}
<div style={{ position: 'relative', height: '30px', zIndex: '2' }}> &nbsp; </div>
<Button style={{ position: 'relative', top: '-30px', zIndex: '1' }}
className="btn btn-primary"
bsSize="small"
onClick={() => this.props.onSaveButtonClicked()}
disabled>
Save
{isSaveButtonVisible === true ?
this.props.isSaveButtonEnabled === true ?
<OverlayTrigger
placement="left"
overlay={<Tooltip id="tooltip">
<p> Save the event. </p>
</Tooltip>}>
<Button className="btn btn-primary" bsSize="small" onClick={() => this.props.onSaveButtonClicked()}> Save </Button>
</OverlayTrigger>
: <OverlayTrigger
placement="left"
overlay={<Tooltip id="tooltip2">
<p> First add a comment before you can save the event. </p>
</Tooltip>}>
<div>
{/* the following div is a workaround to the abscence of tooltip on a disabled button */}
<div style={{ position: 'relative', height: '30px', zIndex: '2' }}> &nbsp; </div>
<Button style={{ position: 'relative', top: '-30px', zIndex: '1' }}
className="btn btn-primary"
bsSize="small"
onClick={() => this.props.onSaveButtonClicked()}
disabled>
Save
</Button>
</div>
</OverlayTrigger>}
</div>
</OverlayTrigger>
: null}
</ButtonGroup>
<ButtonGroup>
<Button className="btn btn-primary" bsSize='small' onClick={(e) => this.props.onCancelButtonClicked(e)} > Cancel </Button>
<Button className="btn btn-primary" bsSize='small' onClick={(e) => this.props.onCancelButtonClicked(e)} > {cancelButtonLabel ? cancelButtonLabel : 'Cancel'} </Button>
</ButtonGroup>
</ButtonToolbar>
</div>
......@@ -51,11 +54,22 @@ class EventFooter extends React.Component {
}
EventFooter.PropType = {
/** a custom text displayed in the button. 'Cancel' when not provided */
cancelButtonLabel: PropTypes.string,
/** the callback function executed when the cancel button is clicked */
onCancelButtonClicked: PropTypes.func.isRequired,
/** the callback function executed when the save button is clicked */
onSaveButtonClicked: PropTypes.func.isRequired,
/** whether the save button must be enabled or disabled */
isSaveButtonEnabled: PropTypes.bool
isSaveButtonEnabled: PropTypes.bool,
/** whether the save button is visible or not */
isSaveButtonVisible: PropTypes.bool,
}
EventFooter.defaultProps = {
/** Default text displayed in the button */
cancelButtonLabel: 'Cancel',
isSaveButtonVisible: true,
}
export default EventFooter;
\ No newline at end of file
......@@ -2,7 +2,7 @@ import React from 'react'
import { Row, Panel } from 'react-bootstrap'
import PropTypes from 'prop-types'
import { getEventIcon, getEventHistoryCreationDate } from '../../helpers/EventHelpers'
import { NEW_EVENT_CONTEXT, EVENT_HISTORY_ORIGINAL_VERSION_CONTEXT, EVENT_HISTORY_MIDDLE_VERSION_CONTEXT, EVENT_HISTORY_LATEST_VERSION_CONTEXT, EDIT_EVENT_CONTEXT } from '../../constants/EventTypes';
import { NEW_EVENT_CONTEXT, ORIGINAL_EVENT_VERSION, EVENT_HISTORY_MIDDLE_VERSION_CONTEXT, LATEST_EVENT_VERSION, EDIT_EVENT_CONTEXT, MIDDLE_EVENT_VERSION } from '../../constants/EventTypes';
/**
* A class which represents the event header. This component renders something different in the header based on the context prop.
......@@ -18,25 +18,25 @@ class EventHeader extends React.Component {
if (event) {
//happens during the visualisation or edition an event
if (context === EVENT_HISTORY_ORIGINAL_VERSION_CONTEXT) {
return (<Panel.Heading >
<Row>
{/* <div className="pull-right"> <p> Tags not shown </p> </div> */}
<div style={{ paddingLeft: '10px' }}> {getEventIcon(event.category)}
&nbsp; On {getEventHistoryCreationDate(event)}, the original message was:
</div>
</Row>
</Panel.Heading>)
} else if (context === EVENT_HISTORY_LATEST_VERSION_CONTEXT) {
return (<Panel.Heading >
<Row>
{/* <div className="pull-right"> <p> Tags not shown </p> </div> */}
<div style={{ paddingLeft: '10px' }}> {getEventIcon("previousVersion")}
&nbsp; Written on {getEventHistoryCreationDate(event)} (latest version), the current comment is:
</div>
</Row>
</Panel.Heading>)
} else if (context === EVENT_HISTORY_MIDDLE_VERSION_CONTEXT) {
if (context === ORIGINAL_EVENT_VERSION) {
// return (<Panel.Heading >
// <Row>
// {/* <div className="pull-right"> <p> Tags not shown </p> </div> */}
// <div style={{ paddingLeft: '10px' }}> {getEventIcon(event.category)}
// &nbsp; On {getEventHistoryCreationDate(event)}, the original message was:
// </div>
// </Row>
// </Panel.Heading>)
} else if (context === LATEST_EVENT_VERSION) {
// return (<Panel.Heading >
// <Row>
// {/* <div className="pull-right"> <p> Tags not shown </p> </div> */}
// <div style={{ paddingLeft: '10px' }}> {getEventIcon("previousVersion")}
// &nbsp; Written on {getEventHistoryCreationDate(event)} (latest version), the current comment is:
// </div>
// </Row>
// </Panel.Heading>)
} else if (context === MIDDLE_EVENT_VERSION) {
return (<Panel.Heading >
<Row>
{/* <div className="pull-right"> <p> Tags not shown </p> </div> */}
......@@ -49,11 +49,15 @@ class EventHeader extends React.Component {
} else if (context === NEW_EVENT_CONTEXT) {
// happens when a new event is created
return (<Panel.Heading >
<b> New comment </b>
</Panel.Heading>)
// return (<Panel.Heading >
// <b> New comment </b>
//</Panel.Heading>)
} else if (context === EDIT_EVENT_CONTEXT) {
return (<Panel.Heading> <b> Edit </b> </Panel.Heading>);
//return (<Panel.Heading> <b> Edit </b> </Panel.Heading>);
} else {
// simple ussage with text property
return (<Panel.Heading> <b> {this.props.text} </b> </Panel.Heading>);
}
}
}
......@@ -62,6 +66,7 @@ EventHeader.propTypes = {
/** the event object as received from the ICAT+ server. (optional: not present when a new comment is being created.) */
event: PropTypes.object,
/* the context indicating what needs to be displayed.*/
context: PropTypes.string.isRequired,
context: PropTypes.string,
text: PropTypes.string
}
export default EventHeader;
......@@ -3,13 +3,14 @@ import { Row, Col, OverlayTrigger, Popover, Button, Well, Label } from 'react-bo
import { getPreviousVersionNumber, } from '../../helpers/EventHelpers';
import Popup from 'reactjs-popup';
import Moment from 'moment';
import EventVersion from './EventVersion';
import EventVersionPanel from './EventVersionPanel';
import LabeledElement from './LabeledElement';
import { LATEST_EVENT_VERSION, ORIGINAL_EVENT_VERSION, MIDDLE_EVENT_VERSION } from '../../constants/EventTypes';
/**
* React component which renders event history label and the correwsponding modal.
* React component which renders event history label and the corresponding modal.
*/
class EventHistory extends React.Component {
class EventHistoryLabel extends React.Component {
render() {
if (this.props.event) {
return (
......@@ -62,11 +63,9 @@ function eventVersionsPopover(event) {
<div className='fullPage'>
<a className='close' onClick={close}> &times; </a>
<div className='content'>
<EventVersion
<EventVersionPanel
event={item.props.event}
isLatestVersion={(index === 1) ? true : false}
isOriginalVersion={(index === lines.length - 1) ? true : false}
/>
version={index === 0 ? LATEST_EVENT_VERSION : index === lines.length - 1 ? ORIGINAL_EVENT_VERSION : MIDDLE_EVENT_VERSION} />
</div>
</div>
)}
......@@ -126,9 +125,8 @@ const CompleteEventHistory = (props) => {
let { event } = props;
let eventVersions = [];
/* first push the current event which is the latest version of the event*/
//eventHistoryItems.push(<EventListViewExpanded event={event} isFullPage={true} />)
eventVersions.push(<EventVersion event={event} isLatestVersion={true} />);
/* first push the current event which is the latest version of the event */
eventVersions.push(<EventVersionPanel event={event} version={LATEST_EVENT_VERSION} />);
/* then display the previous version of this event */
while (event.previousVersionEvent != null) {
event = event.previousVersionEvent;
......@@ -136,7 +134,7 @@ const CompleteEventHistory = (props) => {
<Row>
<Col xs={1}> </Col>
<Col xs={11}>
<EventVersion event={event} isOriginalVersion={event.previousVersionEvent === null ? true : false} />
<EventVersionPanel event={event} version={event.previousVersionEvent === null ? ORIGINAL_EVENT_VERSION : MIDDLE_EVENT_VERSION} />
</Col>
</Row>
</div>);
......@@ -145,4 +143,4 @@ const CompleteEventHistory = (props) => {
return eventVersions;
};
export default EventHistory;
\ No newline at end of file
export default EventHistoryLabel;
\ No newline at end of file
import React from 'react'
/**
* This represents event properties such as authorship, tags updating time for example
*/
class EventProperty extends React.Component {
render() {
const propertyName = this.props.propertyName;
const propertyValue = this.props.propertyValue;
function leftPart() {
// if (propertyName === 'creationAuthorship') {
// return <Glyphicon glyph='user' />
// }
}
function middlePart() {
if (propertyName === 'creationAuthorship') {
return <span className='padding-left-5' style={{ fontStyle: 'italic' }}> Created by {propertyValue} </span>
}
if (propertyName === 'updateAuthorship') {
return <span className='padding-left-5' style={{ fontStyle: 'italic' }}> Updated by {propertyValue} </span>
}
if (propertyName === 'historyAuthorship') {
return <span className='padding-left-5' style={{ fontStyle: 'italic' }}> Commented by {propertyValue} </span>
}
}
function rightPart() {
/* this is temporarily desactivated because there is yet no action associated to the ...*/
// if (propertyName === 'creationAuthorship') {
// return (<span style={{ backgroundColor: '#FFFFFF' }}>...</span>)
// }
// if (propertyName === 'updateAuthorship') {
// return (<span style={{ backgroundColor: '#FFFFFF' }}>...</span>)
// }
return <span> &nbsp; </span>
}
return (
<span style={{ border: 'solid 1px #FFFFFF' }} >
{leftPart()}
{middlePart()}
{rightPart()}
</ span>
)
}
}
export default EventProperty
\ No newline at end of file
import React from 'react'
import PropTypes from 'prop-types';
import { Row, Col, Panel } from 'react-bootstrap'
import EventProperty from './EventProperty'
import EventHeader from './EventHeader'
import EventContentDisplayer from './EventContentDisplayer';
import { EVENT_HISTORY_ORIGINAL_VERSION_CONTEXT, EVENT_HISTORY_LATEST_VERSION_CONTEXT, EVENT_HISTORY_MIDDLE_VERSION_CONTEXT } from '../../constants/EventTypes';
// import Moment from 'moment'
/*
* This class represents an event version.
*/
class EventVersion extends React.Component {
render() {
let { event, isOriginalVersion, isLatestVersion } = this.props;
return (
<div class='margin-bottom-10'>
<Panel>
<EventHeader event={event} context={(isOriginalVersion) ? EVENT_HISTORY_ORIGINAL_VERSION_CONTEXT : (isLatestVersion) ? EVENT_HISTORY_LATEST_VERSION_CONTEXT : EVENT_HISTORY_MIDDLE_VERSION_CONTEXT} />
<Panel.Body>
<Row>
<Col xs={12}>
<EventContentDisplayer
content={event.content}
useRichTextEditor={false}
isEditionMode={false}
// user={this.props.user}
/>
</Col>
</Row>
</Panel.Body>
<Panel.Footer>
<EventProperty propertyName={(isOriginalVersion) ? "creationAuthorship" : "historyAuthorship"} propertyValue={event.username} />
</Panel.Footer>
</Panel>
</div>)
}
}
EventVersion.PropTypes = {
/** the user who is currently logged in */
user: PropTypes.string.isRequired,
}
export default EventVersion
\ No newline at end of file
import React from 'react'
import PropTypes from 'prop-types';
import { Grid, Row, Col, Panel } from 'react-bootstrap'
import EventHeader from './EventHeader'
import EventContentDisplayer from './EventContentDisplayer';
import { ORIGINAL_EVENT_VERSION, LATEST_EVENT_VERSION, MIDDLE_EVENT_VERSION } from '../../constants/EventTypes';
import { getEventHistoryCreationDate, getTags } from '../../helpers/EventHelpers';
import TagListInLine from './Tag/TagListInLine';
/*
* React component which renders a panel showing the provided event details using version context provided by the version property.
*/
class EventVersionPanel extends React.Component {
constructor(props) {
super(props);
this.getEventHeaderTextByVersion = this.getEventHeaderTextByVersion.bind(this);
this.getEventFooterTextByVersion = this.getEventFooterTextByVersion.bind(this);
}
render() {
let { availableTags, event, version } = this.props;
return (
<div class='margin-bottom-10'>
<Panel>
<EventHeader text={this.getEventHeaderTextByVersion(event, version)} />
<Panel.Body>
<Row>
<Col xs={12}>
<EventContentDisplayer content={event.content} useRichTextEditor={false} isEditionMode={false} />
</Col>
</Row>
</Panel.Body>
<Panel.Footer>
<Grid>
<Row>
<Col xs={12} md={6}>
<span className='padding-left-5' style={{ fontStyle: 'italic' }}>
{this.getEventFooterTextByVersion(event, version)}
</span>
</Col >
<Col xs={12} md={6}>
<TagListInLine tags={getTags(event, availableTags)} />
</Col>
</Row>
</Grid>
</Panel.Footer>
</Panel>
</div>)
}
getEventHeaderTextByVersion(event, version) {
if (event && version) {
if (version === ORIGINAL_EVENT_VERSION) {
return 'On ' + getEventHistoryCreationDate(event) + ', the original message was: ';
}
if (version === LATEST_EVENT_VERSION) {
return 'Written on ' + getEventHistoryCreationDate(event) + ', the latest version of the comment is:'
}
if (version === MIDDLE_EVENT_VERSION) {
return 'Written on ' + getEventHistoryCreationDate(event) + ', the comment was:'
}
} else return '';
}
getEventFooterTextByVersion(event, version) {
if (event && version) {
if (version === ORIGINAL_EVENT_VERSION) {
return 'Created by ' + event.username;
}
if (version === LATEST_EVENT_VERSION || MIDDLE_EVENT_VERSION) {
return 'Commented by ' + event.username;
}
} else { return '' };
}
}
EventVersionPanel.propTypes = {
/** the event */
event: PropTypes.object,
/** event version */
version: PropTypes.string
}
export default EventVersionPanel
\ No newline at end of file
......@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
import _ from 'lodash'
import Moment from 'moment'
import { Table, OverlayTrigger, Tooltip, Glyphicon, Button, Label } from 'react-bootstrap'
import { getContent, convertImagesToThumbnails, getPreviousVersionNumber } from '../../../helpers/EventHelpers';
import { getContent, convertImagesToThumbnails, getPreviousVersionNumber, getTags } from '../../../helpers/EventHelpers';
import { getOriginalEvent } from '../../../helpers/EventHelpers'
import EventIcon from './EventIcon.js';
import LazyLoad from 'react-lazyload';
......@@ -62,7 +62,7 @@ class EventList extends React.Component {
if (event.type === "date") {
return <tr key={index}><td style={{ borderTop: '1px solid #f2f2f2', textAlign: 'center', fontSize: '18px', fontWeight: 'bold' }} colSpan={5} ><a name={event.anchor}></a> {event.text}</td></tr>;
}
return <Event key={index} availableTags={this.props.availableTags} event={event} onEventClicked={this.props.onEventClicked} ></Event>
return <Event key={index} availableTags={this.props.availableTags} event={event} logbookContext={this.props.logbookContext} onEventClicked={this.props.onEventClicked} ></Event>
})}
</tbody>
</Table>
......@@ -70,56 +70,38 @@ class EventList extends React.Component {
}
EventList.propTypes = {
/** available tags for that logbook */
availableTags: PropTypes.array,
/** the array of unsorted events as provided by the ICAT+ server */
events: PropTypes.array.isRequired,
/** the logbook context */
logbookContext: PropTypes.object,
/** Callback function triggered when the user clicks the edit icon */
onEventCliked: PropTypes.func
}
export default EventList;
class Event extends React.Component {
/** React componnent which renders an event. Here 'event can be the classical event as found in the logbook but
* could also be a list of event corresponding to a collapsed line containing several events
*/
export class Event extends React.Component {
constructor(props) {
super(props)
this.state = {
collapsed: true
}
this.handleClick = this.handleClick.bind(this);
this.getTags = this.getTags.bind(this);
}
handleClick(e) {
this.setState({ collapsed: !this.state.collapsed });
}
getUncollapsedEvents() {
return (<tbody> {this.props.event.events.map((event, index) => {
return this.getEventContentBody(event);
})}</tbody>);
}
/**
* Get the corresponding tags objects for that event
*/
getTags(event) {
let eventTags = [];
if (event && event.tag && event.tag.length !== 0) {
event.tag.forEach(tagId => {
let tag = _.find(this.props.availableTags, (availableTag) => _.isEqual(availableTag._id, tagId))
if (tag) { eventTags.push(tag); };
});
return eventTags;
}
return null;
}
render() {
let events = [this.props.event];
if (this.props.event.events && !this.state.collapsed) {
events = events.concat(this.props.event.events);
};
return events.map((event, index) => {
return <tr key={index} id='contentDocList'>
<td style={{ width: '16px', borderTop: '0' }}>
......@@ -135,16 +117,37 @@ class Event extends React.Component {
{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={{ width: '200px', border: 0 }}>
<TagListInLine tags={this.getTags(event)} />
<TagListInLine tags={getTags(event, this.props.availableTags)} />
</td>
<td style={{ width: '50px', border: 0 }}>
<Button bsStyle="link" bsSize="small" style={{ padding: '0px' }} onClick={() => this.props.onEventClicked(event)}>
<Glyphicon glyph={getPreviousVersionNumber(event) === 0 ? 'plus' : 'edit'} style={{ width: '40px', position: 'static' }} />
<Glyphicon glyph={this.props.logbookContext.isReleased === true ? 'eye-open' : getPreviousVersionNumber(event) === 0 ? 'plus' : 'edit'} style={{ width: '40px', position: 'static' }} />
</Button>
</td>
</tr>;
});
}
handleClick(e) {
this.setState({ collapsed: !this.state.collapsed });
}
getUncollapsedEvents() {
return (<tbody> {this.props.event.events.map((event, index) => {
return this.getEventContentBody(event);
})}</tbody>);
}
}
Event.protypes = {
/** Available tag objects for the proposal */
availableTags: PropTypes.array,
/** A classical event or a structure representing a collapsed line containing several similar events */
event: PropTypes.object,
/** Context in which the logbook is run */
logbookContext: PropTypes.object,
/** Callback function triggered which the user clicks a link to edit/consult the detailed event */
onEventClicked: PropTypes.func,
}
......
......@@ -33,7 +33,7 @@ class EventListMenu extends React.Component {
render() {
const { investigationId,
isNewEventVisible,
isNewButtonEnabled,
numberOfMatchingEventsFound,
selectionFilter,
sessionId,
......@@ -43,10 +43,10 @@ class EventListMenu extends React.Component {
view } = this.props;
function getCurrentlyPressedSortButton() {
if (sortingFilter && sortingFilter.createdAt) {
return sortingFilter.createdAt;
}
if (sortingFilter && sortingFilter.createdAt) { return sortingFilter.createdAt; }
}
let test = _.clone(this.props.isEventListAutorefreshEnabled)
return (
<Navbar
fluid
......@@ -58,12 +58,12 @@ class EventListMenu extends React.Component {
<Navbar.Header>
<Navbar.Toggle />
<Nav style={{ marginLeft: '0px' }}>
<NavItem eventKey={1} href="#" className="logbookNavItem" onClick={() => setNewEventVisibility(NEW_EVENT_VISIBLE)}>
<EventListMenuButton text='New' glyph='plus' tooltipText='Create a new event' isEnabled={!isNewEventVisible} />
<NavItem eventKey={1} href="#" className="logbookNavItem" >
<EventListMenuButton text='New' glyph='plus' tooltipText='Create a new event' isEnabled={isNewButtonEnabled} isVisible={!this.props.logbookContext.isReleased} />
</NavItem>
<NavItem eventKey={2} href={'/investigation/' + this.props.investigationId + '/camera'} target='_blank' className="logbookNavItem" >
<EventListMenuButton text='Take a photo' glyph='camera' tooltipText='Take a photo' isEnabled={true} />
<EventListMenuButton text='Take a photo' glyph='camera' tooltipText='Take a photo' isEnabled={true} isVisible={!this.props.logbookContext.isReleased} />
</NavItem>
</Nav>
</Navbar.Header>
......@@ -76,13 +76,15 @@ class EventListMenu extends React.Component {
<MenuItem divider />
<MenuItem eventKey={3.3} onSelect={() => this.sortByDate(SORT_EVENTS_FROM_OLDEST)} > {getCurrentlyPressedSortButton() === SORT_EVENTS_FROM_OLDEST ? <Radio checked readOnly> Oldest log on top</Radio> : <Radio checked={false} readOnly> Oldest log on top</Radio>} </MenuItem>
<MenuItem eventKey={3.4} onSelect={() => this.sortByDate(SORT_EVENTS_FROM_YOUNGEST)} > {getCurrentlyPressedSortButton() === SORT_EVENTS_FROM_YOUNGEST ? <Radio checked readOnly> Latest log on top</Radio> : <Radio checked={false} readOnly> Latest log on top</Radio>} </MenuItem>
<MenuItem divider />
<MenuItem eventKey={3.5} onSelect={() => this.props.setEventListAutorefresh(!this.props.isEventListAutorefreshEnabled)}>
<Checkbox checked={this.props.isEventListAutorefreshEnabled} readOnly > Refresh logs automatically</Checkbox>
</MenuItem>
{this.props.logbookContext.isReleased === false ? <MenuItem divider /> : null}
{this.props.logbookContext.isReleased === false ?
<MenuItem eventKey={3.5}>
<span style={{ paddingLeft: '20px' }} >{this.props.isEventListAutorefreshEnabled ? 'Stop refreshing logs' : 'Start refreshing logs'}</span>
</MenuItem> : null}
</NavDropdown>
<NavItem eventKey={4} href={getPDF(sessionId, investigationId, selectionFilter)} target='_blank' className="logbookNavItem" >
<EventListMenuButton text='PDF' glyph='download' tooltipText='Download as PDF' isEnabled={!(isNewEventVisible === undefined || isNewEventVisible === true || numberOfMatchingEventsFound === 0)} />
<NavItem eventKey={4} href={isNewButtonEnabled === false || numberOfMatchingEventsFound === 0 ? null : getPDF(sessionId, investigationId, selectionFilter)} target='_blank' className="logbookNavItem" >
<EventListMenuButton text='PDF' glyph='download' tooltipText='Download as PDF' isEnabled={!(isNewButtonEnabled === false || numberOfMatchingEventsFound === 0)} />
</NavItem>
<NavItem eventKey={5} className="logbookNavItem">
<NewlyAvailableEventsDialogue isEventListAutorefreshEnabled={this.props.isEventListAutorefreshEnabled} latestEvents={this.props.periodicdata} eventCountSinceLastRefresh={this.props.eventCountSinceLastRefresh} onIconClicked={this.props.getEvents} />
......@@ -138,8 +140,17 @@ class EventListMenu extends React.Component {
* @param {*} eventKey key of the element
*/
onSelectNavbar(eventKey) {
if (eventKey != 6) {
this.onToggleNavbar();
// if (eventKey != 6) {
// this.onToggleNavbar();
// }