|
@@ -9,7 +9,7 @@ import {
|
9
|
9
|
Timeline
|
10
|
10
|
} from 'tracim_lib'
|
11
|
11
|
import { timelineDebugData } from '../timelineDebugData.js'
|
12
|
|
-import { FETCH_CONFIG } from '../helper.js'
|
|
12
|
+import { FETCH_CONFIG, MODE } from '../helper.js'
|
13
|
13
|
import i18n from '../i18n.js'
|
14
|
14
|
|
15
|
15
|
const debug = {
|
|
@@ -22,8 +22,8 @@ const debug = {
|
22
|
22
|
componentLeft: 'PageHtml',
|
23
|
23
|
componentRight: 'Timeline',
|
24
|
24
|
customClass: 'wsContentPageHtml',
|
25
|
|
- icon: 'fa fa-file-word-o',
|
26
|
|
- color: '#65c7f2',
|
|
25
|
+ icon: 'fa fa-file-text-o',
|
|
26
|
+ color: '#fdfdfd',
|
27
|
27
|
domContainer: 'appContainer',
|
28
|
28
|
apiUrl: 'http://localhost:3001'
|
29
|
29
|
},
|
|
@@ -60,7 +60,8 @@ class pageHtml extends React.Component {
|
60
|
60
|
config: props.data ? props.data.config : debug.config,
|
61
|
61
|
loggedUser: props.data ? props.data.loggedUser : debug.loggedUser,
|
62
|
62
|
content: props.data ? props.data.content : debug.content,
|
63
|
|
- timeline: props.data ? [] : debug.timeline
|
|
63
|
+ timeline: props.data ? [] : debug.timeline,
|
|
64
|
+ mode: MODE.VIEW
|
64
|
65
|
}
|
65
|
66
|
|
66
|
67
|
document.addEventListener('appCustomEvent', this.customEventReducer)
|
|
@@ -105,6 +106,16 @@ class pageHtml extends React.Component {
|
105
|
106
|
this.setState({ isVisible: false })
|
106
|
107
|
}
|
107
|
108
|
|
|
109
|
+ handleChangeTitle = e => console.log('new title : ', e.target.value)
|
|
110
|
+
|
|
111
|
+ handleClickNewVersion = () => {
|
|
112
|
+ this.setState({ mode: MODE.EDIT })
|
|
113
|
+ }
|
|
114
|
+
|
|
115
|
+ handleCloseNewVersion = () => {
|
|
116
|
+ this.setState({ mode: MODE.VIEW })
|
|
117
|
+ }
|
|
118
|
+
|
108
|
119
|
render () {
|
109
|
120
|
const { isVisible, loggedUser, content, timeline, config } = this.state
|
110
|
121
|
|
|
@@ -117,12 +128,19 @@ class pageHtml extends React.Component {
|
117
|
128
|
icon={config.icon}
|
118
|
129
|
name={content.title}
|
119
|
130
|
onClickCloseBtn={this.handleClickBtnCloseApp}
|
|
131
|
+ onChangeTitle={this.handleChangeTitle}
|
120
|
132
|
/>
|
121
|
133
|
|
122
|
|
- <PopinFixedOption customClass={`${config.customClass}`} i18n={i18n} />
|
|
134
|
+ <PopinFixedOption
|
|
135
|
+ customClass={`${config.customClass}`}
|
|
136
|
+ onClickNewVersion={this.handleClickNewVersion}
|
|
137
|
+ i18n={i18n}
|
|
138
|
+ />
|
123
|
139
|
|
124
|
140
|
<PopinFixedContent customClass={`${config.customClass}__contentpage`}>
|
125
|
141
|
<PageHtmlComponent
|
|
142
|
+ mode={this.state.mode}
|
|
143
|
+ onClickCloseNewVersion={this.handleCloseNewVersion}
|
126
|
144
|
version={content.version}
|
127
|
145
|
text={content.text}
|
128
|
146
|
key={'PageHtml'}
|