Fixed error +warning in UI

Error - didn't use deep copy and caused error
Warning - 2 events might have the same timestamp
This commit is contained in:
Shay Nehmad 2019-08-22 11:21:52 +03:00
parent 4581376d8d
commit 7f98f55e64
2 changed files with 3 additions and 3 deletions

View File

@ -15,10 +15,10 @@ export default class EventsTimeline extends Component {
<div>
<Timeline>
{
this.props.events.map(event => {
this.props.events.map((event, index) => {
const event_time = new Date(event.timestamp['$date']).toString();
return (<TimelineEvent
key={event.timestamp['$date']}
key={index}
createdAt={event_time}
title={event.title}
icon={<i className={eventTypeToIcon[event.event_type]} />}>

View File

@ -21,7 +21,7 @@ const columns = [
class PillarOverview extends Component {
render() {
const data = this.props.grades.map((grade) => {
const newGrade = grade;
const newGrade = JSON.parse(JSON.stringify(grade));
newGrade.pillar = {name: grade.pillar, status: this.props.pillarsToStatuses[grade.pillar]};
return newGrade;
});