|
|
@@ -26,80 +26,85 @@ class Timeline extends React.Component {
|
|
26
|
26
|
}
|
|
27
|
27
|
|
|
28
|
28
|
return (
|
|
29
|
|
- <div className='timeline'>
|
|
|
29
|
+ <div className={classnames('timeline')}>
|
|
30
|
30
|
{props.showHeader &&
|
|
31
|
|
- <div className={classnames(`${props.customClass}__header`, 'timeline__header')}>
|
|
32
|
|
- Timeline
|
|
|
31
|
+ <div
|
|
|
32
|
+ className={classnames(`${props.customClass}__header`, 'timeline__header')}
|
|
|
33
|
+ onClick={props.toggleRightPart}
|
|
|
34
|
+ >
|
|
|
35
|
+ <span className='timeline__header__text'>Timeline</span>
|
|
33
|
36
|
</div>
|
|
34
|
37
|
}
|
|
35
|
38
|
|
|
36
|
|
- <ul className={classnames(`${props.customClass}__messagelist`, 'timeline__messagelist')}>
|
|
37
|
|
- {props.timelineData.map(content => {
|
|
38
|
|
- switch (content.timelineType) {
|
|
39
|
|
- case 'comment':
|
|
40
|
|
- return <Comment
|
|
41
|
|
- customClass={props.customClass}
|
|
42
|
|
- avatar={content.author.avatar_url}
|
|
43
|
|
- createdAt={content.created}
|
|
44
|
|
- text={content.raw_content}
|
|
45
|
|
- fromMe={props.loggedUser.user_id === content.author.user_id}
|
|
46
|
|
- key={`comment_${content.content_id}`}
|
|
47
|
|
- />
|
|
|
39
|
+ <div className='timeline__body'>
|
|
|
40
|
+ <ul className={classnames(`${props.customClass}__messagelist`, 'timeline__body__messagelist')}>
|
|
|
41
|
+ {props.timelineData.map(content => {
|
|
|
42
|
+ switch (content.timelineType) {
|
|
|
43
|
+ case 'comment':
|
|
|
44
|
+ return <Comment
|
|
|
45
|
+ customClass={props.customClass}
|
|
|
46
|
+ avatar={content.author.avatar_url}
|
|
|
47
|
+ createdAt={content.created}
|
|
|
48
|
+ text={content.raw_content}
|
|
|
49
|
+ fromMe={props.loggedUser.user_id === content.author.user_id}
|
|
|
50
|
+ key={`comment_${content.content_id}`}
|
|
|
51
|
+ />
|
|
48
|
52
|
|
|
49
|
|
- case 'revision':
|
|
50
|
|
- return <Revision
|
|
51
|
|
- customClass={props.customClass}
|
|
52
|
|
- createdAt={content.created}
|
|
53
|
|
- number={content.number}
|
|
54
|
|
- key={`revision_${content.revision_id}`}
|
|
55
|
|
- onClickRevision={() => props.onClickRevisionBtn(content)}
|
|
56
|
|
- />
|
|
57
|
|
- }
|
|
58
|
|
- })}
|
|
59
|
|
- <li style={{visibility: 'hidden'}} ref={el => { this.timelineBottom = el }} />
|
|
60
|
|
- </ul>
|
|
|
53
|
+ case 'revision':
|
|
|
54
|
+ return <Revision
|
|
|
55
|
+ customClass={props.customClass}
|
|
|
56
|
+ createdAt={content.created}
|
|
|
57
|
+ number={content.number}
|
|
|
58
|
+ key={`revision_${content.revision_id}`}
|
|
|
59
|
+ onClickRevision={() => props.onClickRevisionBtn(content)}
|
|
|
60
|
+ />
|
|
|
61
|
+ }
|
|
|
62
|
+ })}
|
|
|
63
|
+ <li style={{visibility: 'hidden'}} ref={el => { this.timelineBottom = el }} />
|
|
|
64
|
+ </ul>
|
|
61
|
65
|
|
|
62
|
|
- <form className={classnames(`${props.customClass}__texteditor`, 'timeline__texteditor')}>
|
|
63
|
|
- <div className={classnames(`${props.customClass}__texteditor__textinput`, 'timeline__texteditor__textinput')}>
|
|
64
|
|
- <textarea
|
|
65
|
|
- id='wysiwygTimelineComment'
|
|
66
|
|
- placeholder='Taper votre message ici'
|
|
67
|
|
- value={props.newComment}
|
|
68
|
|
- onChange={props.onChangeNewComment}
|
|
69
|
|
- disabled={props.disableComment}
|
|
70
|
|
- />
|
|
71
|
|
- </div>
|
|
72
|
|
-
|
|
73
|
|
- <div className={classnames(`${props.customClass}__texteditor__wrapper`, 'timeline__texteditor__wrapper')}>
|
|
74
|
|
- <div className={classnames(`${props.customClass}__texteditor__advancedtext`, 'timeline__texteditor__advancedtext')}>
|
|
75
|
|
- <button
|
|
76
|
|
- type='button'
|
|
77
|
|
- className={classnames(
|
|
78
|
|
- `${props.customClass}__texteditor__advancedtext__btn timeline__texteditor__advancedtext__btn btn btn-outline-primary`
|
|
79
|
|
- )}
|
|
80
|
|
- onClick={props.onClickWysiwygBtn}
|
|
|
66
|
+ <form className={classnames(`${props.customClass}__texteditor`, 'timeline__body__texteditor')}>
|
|
|
67
|
+ <div className={classnames(`${props.customClass}__texteditor__textinput`, 'timeline__body__texteditor__textinput')}>
|
|
|
68
|
+ <textarea
|
|
|
69
|
+ id='wysiwygTimelineComment'
|
|
|
70
|
+ placeholder='Taper votre message ici'
|
|
|
71
|
+ value={props.newComment}
|
|
|
72
|
+ onChange={props.onChangeNewComment}
|
|
81
|
73
|
disabled={props.disableComment}
|
|
82
|
|
- >
|
|
83
|
|
- {props.wysiwyg ? 'Texte Simple' : 'Texte Avancé'}
|
|
84
|
|
- </button>
|
|
|
74
|
+ />
|
|
85
|
75
|
</div>
|
|
86
|
76
|
|
|
87
|
|
- <div className={classnames(`${props.customClass}__texteditor__submit`, 'timeline__texteditor__submit')}>
|
|
88
|
|
- <button
|
|
89
|
|
- type='button'
|
|
90
|
|
- className={classnames(`${props.customClass}__texteditor__submit__btn`, 'timeline__texteditor__submit__btn btn')}
|
|
91
|
|
- onClick={props.onClickValidateNewCommentBtn}
|
|
92
|
|
- disabled={props.disableComment}
|
|
93
|
|
- >
|
|
94
|
|
- Envoyer
|
|
95
|
|
- <div
|
|
96
|
|
- className={classnames(`${props.customClass}__texteditor__submit__btn__icon`, 'timeline__texteditor__submit__btn__icon')}>
|
|
97
|
|
- <i className='fa fa-paper-plane-o' />
|
|
98
|
|
- </div>
|
|
99
|
|
- </button>
|
|
|
77
|
+ <div className={classnames(`${props.customClass}__texteditor__wrapper`, 'timeline__body__texteditor__wrapper')}>
|
|
|
78
|
+ <div className={classnames(`${props.customClass}__texteditor__advancedtext`, 'timeline__body__texteditor__advancedtext')}>
|
|
|
79
|
+ <button
|
|
|
80
|
+ type='button'
|
|
|
81
|
+ className={classnames(
|
|
|
82
|
+ `${props.customClass}__texteditor__advancedtext__btn timeline__body__texteditor__advancedtext__btn btn btn-outline-primary`
|
|
|
83
|
+ )}
|
|
|
84
|
+ onClick={props.onClickWysiwygBtn}
|
|
|
85
|
+ disabled={props.disableComment}
|
|
|
86
|
+ >
|
|
|
87
|
+ {props.wysiwyg ? 'Texte Simple' : 'Texte Avancé'}
|
|
|
88
|
+ </button>
|
|
|
89
|
+ </div>
|
|
|
90
|
+
|
|
|
91
|
+ <div className={classnames(`${props.customClass}__texteditor__submit`, 'timeline__body__texteditor__submit')}>
|
|
|
92
|
+ <button
|
|
|
93
|
+ type='button'
|
|
|
94
|
+ className={classnames(`${props.customClass}__texteditor__submit__btn`, 'timeline__body__texteditor__submit__btn btn')}
|
|
|
95
|
+ onClick={props.onClickValidateNewCommentBtn}
|
|
|
96
|
+ disabled={props.disableComment}
|
|
|
97
|
+ >
|
|
|
98
|
+ Envoyer
|
|
|
99
|
+ <div
|
|
|
100
|
+ className={classnames(`${props.customClass}__texteditor__submit__btn__icon`, 'timeline__body__texteditor__submit__btn__icon')}>
|
|
|
101
|
+ <i className='fa fa-paper-plane-o' />
|
|
|
102
|
+ </div>
|
|
|
103
|
+ </button>
|
|
|
104
|
+ </div>
|
|
100
|
105
|
</div>
|
|
101
|
|
- </div>
|
|
102
|
|
- </form>
|
|
|
106
|
+ </form>
|
|
|
107
|
+ </div>
|
|
103
|
108
|
</div>
|
|
104
|
109
|
)
|
|
105
|
110
|
}
|