|
@@ -1,5 +1,6 @@
|
1
|
1
|
import React from 'react'
|
2
|
2
|
import { connect } from 'react-redux'
|
|
3
|
+import appFactory from '../appFactory.js'
|
3
|
4
|
import Folder from '../component/Workspace/Folder.jsx'
|
4
|
5
|
import FileItem from '../component/Workspace/FileItem.jsx'
|
5
|
6
|
import FileItemHeader from '../component/Workspace/FileItemHeader.jsx'
|
|
@@ -7,8 +8,6 @@ import PageWrapper from '../component/common/layout/PageWrapper.jsx'
|
7
|
8
|
import PageTitle from '../component/common/layout/PageTitle.jsx'
|
8
|
9
|
import PageContent from '../component/common/layout/PageContent.jsx'
|
9
|
10
|
import DropdownCreateButton from '../component/common/Input/DropdownCreateButton.jsx'
|
10
|
|
-import { FETCH_CONFIG } from '../helper.js'
|
11
|
|
-import { setActiveFileContentActive } from '../action-creator.sync.js'
|
12
|
11
|
import {
|
13
|
12
|
getAppList,
|
14
|
13
|
getWorkspaceContent
|
|
@@ -44,22 +43,9 @@ class WorkspaceContent extends React.Component {
|
44
|
43
|
}
|
45
|
44
|
|
46
|
45
|
handleClickContentItem = content => {
|
47
|
|
- const { user, workspace, dispatch } = this.props
|
48
|
|
-
|
49
|
|
- GLOBAL_renderApp({
|
50
|
|
- workspace: {
|
51
|
|
- id: workspace.id,
|
52
|
|
- title: workspace.title
|
53
|
|
- },
|
54
|
|
- appConfig: {
|
55
|
|
- ...this.props.app[content.type],
|
56
|
|
- apiUrl: FETCH_CONFIG.apiUrl
|
57
|
|
- },
|
58
|
|
- loggedUser: user.isLoggedIn ? user : {},
|
59
|
|
- content
|
60
|
|
- })
|
61
|
|
-
|
62
|
|
- dispatch(setActiveFileContentActive(content))
|
|
46
|
+ this.props.renderApp(this.props.user, this.props.workspace, this.props.app, content)
|
|
47
|
+ // Côme - 2018/03/08 - line bellow is useless because we cannot call the reducer again when hiding app since the call comes from the app
|
|
48
|
+ // dispatch(setActiveFileContentActive(content))
|
63
|
49
|
}
|
64
|
50
|
|
65
|
51
|
render () {
|
|
@@ -106,4 +92,4 @@ class WorkspaceContent extends React.Component {
|
106
|
92
|
}
|
107
|
93
|
|
108
|
94
|
const mapStateToProps = ({ user, workspace, workspaceList, app }) => ({ user, workspace, workspaceList, app })
|
109
|
|
-export default connect(mapStateToProps)(WorkspaceContent)
|
|
95
|
+export default connect(mapStateToProps)(appFactory(WorkspaceContent))
|