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'; ...@@ -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. * This class displays a event history item. As such it does not have any knowledge of history.
*/ */
class EventHistoryItem extends React.Component { class EventHistoryItem extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.visuals = { this.visuals = {
paddingLeft: this.props.paddingLeft ? this.props.paddingLeft : 0, paddingLeft: this.props.paddingLeft ? this.props.paddingLeft : 0,
toggleHistoryButton: this.props.toggleHistoryButton ? true : false, toggleHistoryButton: this.props.toggleHistoryButton ? true : false,
quitHistoryButton: this.props.quitHistoryButton ? 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() { render() {
return ( let htmlContent = { __html: this.props.item.content };
<div style={{ 'padding-left': this.visuals.paddingLeft }}>
<Panel id="collapsible-panel-example-1" expanded={this.state.expanded}> return (
<Panel.Heading className="padding-top-5 padding-bottom-5"> <div style={{ 'padding-left': this.visuals.paddingLeft }}>
<Row> <Panel id="collapsible-panel-example-1" expanded={this.state.expanded}>
<Col xs={6}> <Panel.Heading className="padding-top-5 padding-bottom-5">
<span className="glyphicon glyphicon-time padding-right-5"> </span> {this.props.createdAt} {this.props.dateMsg} <Row>
</Col> <Col xs={6}>
<Col xs={6}> <span className="glyphicon glyphicon-time padding-right-5"> </span> {this.props.createdAt} {this.props.dateMsg}
<div className="pull-right"> </Col>
<span className="glyphicon glyphicon-user"> </span> {this.props.item.logger} | &nbsp; <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 })}> <Button className="noPadding" bsStyle="link" onClick={() => this.setState({ expanded: !this.state.expanded })}>
<span className="glyphicon glyphicon-zoom-in"></span> <span className="glyphicon glyphicon-zoom-in"></span>
</Button> </Button>
{this.visuals.toggleHistoryButton ? {this.visuals.toggleHistoryButton ?
<Button className="noPadding" bsStyle="link" onClick={() => this.props.toggleHistory()}> <Button className="noPadding" bsStyle="link" onClick={() => this.props.toggleHistory()}>
<span className="glyphicon glyphicon-time noPadding"></span> <span className="glyphicon glyphicon-time noPadding"></span>
</Button> : ""} </Button> : ""}
{this.visuals.quitHistoryButton ? {this.visuals.quitHistoryButton ?
< Button className="noPadding" bsStyle="link" onClick={() => this.props.toggleHistory()}> < Button className="noPadding" bsStyle="link" onClick={() => this.props.toggleHistory()}>
<span className="glyphicon glyphicon-remove-circle noPadding"></span> <span className="glyphicon glyphicon-remove-circle noPadding"></span>
</Button > : ""} </Button > : ""}
</div> </div>
</Col> </Col>
</Row> </Row>
</Panel.Heading> </Panel.Heading>
<Panel.Collapse> <Panel.Collapse>
<Panel.Body> <Panel.Body>
<Row> <Row>
<Col xs={12}> <Col xs={12}>
<p> {this.props.item.content} </p> {/*<p> {this.props.item.content} </p> */}
</Col>
</Row> {<div dangerouslySetInnerHTML={htmlContent} />}
</Panel.Body> </Col>
</Panel.Collapse> </Row>
</Panel> </Panel.Body>
</div> </Panel.Collapse>
) </Panel>
} </div>
)
}
} }
export default EventHistoryItem; export default EventHistoryItem;
...@@ -40,8 +40,8 @@ export class Menu extends React.Component { ...@@ -40,8 +40,8 @@ export class Menu extends React.Component {
<NavItem eventKey={2} href="/investigations" disabled> <NavItem eventKey={2} href="/investigations" disabled>
DOI DOI
</NavItem> </NavItem>
<NavItem eventKey={4} href="/wallelog"> <NavItem eventKey={4} href="/events">
WallElog <Link to='/events/new'> New annotation </Link> WalleLog
</NavItem> </NavItem>
</Nav> </Nav>
<Nav pullRight> <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 = { const initialState = {
page: null, page: null,
...@@ -6,6 +7,7 @@ const initialState = { ...@@ -6,6 +7,7 @@ const initialState = {
} }
const events = (state = initialState, action) => { const events = (state = initialState, action) => {
switch (action.type) { switch (action.type) {
...@@ -91,16 +93,120 @@ const events = (state = initialState, action) => { ...@@ -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; default: break;
} }
return state return state
} }
export default events; 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