Commit 8e07349e authored by Maxime Chaillet's avatar Maxime Chaillet

add the annotations as text from andy's logbook

parent 90009d96
......@@ -6,62 +6,66 @@ import { Grid, Col, Row, Table } from 'react-bootstrap';
* This class displays a event history item. As such it does not have any knowledge of history.
*/
class EventHistoryItem extends React.Component {
constructor(props) {
super(props);
constructor(props) {
super(props);
this.visuals = {
paddingLeft: this.props.paddingLeft ? this.props.paddingLeft : 0,
toggleHistoryButton: this.props.toggleHistoryButton ? true : false,
quitHistoryButton: this.props.quitHistoryButton ? true : false,
this.visuals = {
paddingLeft: this.props.paddingLeft ? this.props.paddingLeft : 0,
toggleHistoryButton: this.props.toggleHistoryButton ? true : false,
quitHistoryButton: this.props.quitHistoryButton ? true : false,
}
this.state = {
expanded: this.props.expanded ? true : false,
}
}
this.state = {
expanded: this.props.expanded ? true : false,
}
}
render() {
return (
<div style={{ 'padding-left': this.visuals.paddingLeft }}>
<Panel id="collapsible-panel-example-1" expanded={this.state.expanded}>
<Panel.Heading className="padding-top-5 padding-bottom-5">
<Row>
<Col xs={6}>
<span className="glyphicon glyphicon-time padding-right-5"> </span> {this.props.createdAt} {this.props.dateMsg}
</Col>
<Col xs={6}>
<div className="pull-right">
<span className="glyphicon glyphicon-user"> </span> {this.props.item.logger} | &nbsp;
render() {
let htmlContent = { __html: this.props.item.content };
return (
<div style={{ 'padding-left': this.visuals.paddingLeft }}>
<Panel id="collapsible-panel-example-1" expanded={this.state.expanded}>
<Panel.Heading className="padding-top-5 padding-bottom-5">
<Row>
<Col xs={6}>
<span className="glyphicon glyphicon-time padding-right-5"> </span> {this.props.createdAt} {this.props.dateMsg}
</Col>
<Col xs={6}>
<div className="pull-right">
<span className="glyphicon glyphicon-user"> </span> {this.props.item.logger} | &nbsp;
<Button className="noPadding" bsStyle="link" onClick={() => this.setState({ expanded: !this.state.expanded })}>
<span className="glyphicon glyphicon-zoom-in"></span>
</Button>
<span className="glyphicon glyphicon-zoom-in"></span>
</Button>
{this.visuals.toggleHistoryButton ?
<Button className="noPadding" bsStyle="link" onClick={() => this.props.toggleHistory()}>
<span className="glyphicon glyphicon-time noPadding"></span>
</Button> : ""}
{this.visuals.toggleHistoryButton ?
<Button className="noPadding" bsStyle="link" onClick={() => this.props.toggleHistory()}>
<span className="glyphicon glyphicon-time noPadding"></span>
</Button> : ""}
{this.visuals.quitHistoryButton ?
< Button className="noPadding" bsStyle="link" onClick={() => this.props.toggleHistory()}>
<span className="glyphicon glyphicon-remove-circle noPadding"></span>
</Button > : ""}
{this.visuals.quitHistoryButton ?
< Button className="noPadding" bsStyle="link" onClick={() => this.props.toggleHistory()}>
<span className="glyphicon glyphicon-remove-circle noPadding"></span>
</Button > : ""}
</div>
</Col>
</Row>
</Panel.Heading>
<Panel.Collapse>
<Panel.Body>
<Row>
<Col xs={12}>
<p> {this.props.item.content} </p>
</Col>
</Row>
</Panel.Body>
</Panel.Collapse>
</Panel>
</div>
)
}
</div>
</Col>
</Row>
</Panel.Heading>
<Panel.Collapse>
<Panel.Body>
<Row>
<Col xs={12}>
{/*<p> {this.props.item.content} </p> */}
{<div dangerouslySetInnerHTML={htmlContent} />}
</Col>
</Row>
</Panel.Body>
</Panel.Collapse>
</Panel>
</div>
)
}
}
export default EventHistoryItem;
......@@ -40,8 +40,8 @@ export class Menu extends React.Component {
<NavItem eventKey={2} href="/investigations" disabled>
DOI
</NavItem>
<NavItem eventKey={4} href="/wallelog">
WallElog <Link to='/events/new'> New annotation </Link>
<NavItem eventKey={4} href="/events">
WalleLog
</NavItem>
</Nav>
<Nav pullRight>
......
This diff is collapsed.
import { LOAD_EVENTS } from '../constants/ActionTypes'
import { LOAD_EVENTS } from '../constants/ActionTypes';
import {annotationAndy1, annotationAndy2, annotationAndy3, annotationAndy4, annotationAndy5, annotationAndy6, annotationAndy7, annotationAndy8 } from './annotationAndy.js';
const initialState = {
page: null,
......@@ -6,6 +7,7 @@ const initialState = {
}
const events = (state = initialState, action) => {
switch (action.type) {
......@@ -91,16 +93,120 @@ const events = (state = initialState, action) => {
},
]
},
{
id: 8,
createdAt: "2006-03-07T15:35:01.000",
type: "Annotation",
lastTimestamp: "2006-03-07T15:35:01.000",
history: [
{
updatedOn: "2006-03-07T15:35:01.000",
logger: "Andy Goetz",
content: annotationAndy8(),
},
]
},
{
id: 7,
createdAt: "2006-03-07T15:35:00.000",
type: "Annotation",
lastTimestamp: "2006-03-07T15:35:00.000",
history: [
{
updatedOn: "2006-03-07T15:35:00.000",
logger: "Andy Goetz",
content: annotationAndy7(),
},
]
},
{
id: 6,
createdAt: "2006-03-07T13:18:00.000",
type: "Annotation",
lastTimestamp: "2006-03-07T13:18:00.000",
history: [
{
updatedOn: "2006-03-07T13:18:00.000",
logger: "Andy Goetz",
content: annotationAndy6(),
},
]
},
{
id: 5,
createdAt: "2006-03-05T21:56:00.000",
type: "Annotation",
lastTimestamp: "2006-03-05T21:56:00.000",
history: [
{
updatedOn: "2006-03-05T21:56:00.000",
logger: "Andy Goetz",
content: annotationAndy5(),
},
]
},
{
id: 4,
createdAt: "2006-03-05T21:11:00.000",
type: "Annotation",
lastTimestamp: "2006-03-05T21:11:00.000",
history: [
{
updatedOn: "2006-03-05T21:11:00.000",
logger: "Andy Goetz",
content: annotationAndy4(),
},
]
},
{
id: 3,
createdAt: "2006-03-05T18:37:00.000",
type: "Annotation",
lastTimestamp: "2006-03-05T18:37:00.000",
history: [
{
updatedOn: "2006-03-05T18:37:00.000",
logger: "Andy Goetz",
content: annotationAndy3(),
},
]
},
{
id: 2,
createdAt: "2006-03-05T15:42:00.000",
type: "Annotation",
lastTimestamp: "2006-03-05T15:42:00.000",
history: [
{
updatedOn: "2006-03-05T15:42:00.000",
logger: "Andy Goetz",
content: annotationAndy2(),
},
]
},
{
id: 1,
createdAt: "2006-03-05T9:00:00.000",
type: "Annotation",
lastTimestamp: "2006-03-05T9:00:00.000",
history: [
{
updatedOn: "2006-03-05T9:00:00.000",
logger: "Andy Goetz",
content: annotationAndy1(),
},
]
},
]
}
break;
break;
}
default: break;
}
return state
return state
}
export default events;
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