Przeglądaj źródła

Merge branch 'app_external' of github.com:tracim/design_v2

Skylsmoi 6 lat temu
rodzic
commit
939167b9bd
58 zmienionych plików z 692 dodań i 734 usunięć
  1. 29 1
      dist/index.html
  2. 27 0
      dist/plugin/pageHtml.plugin.js
  3. 2 0
      jsonserver/server.js
  4. 46 8
      jsonserver/static_db.json
  5. 3 2
      package.json
  6. 13 1
      src/action-creator.async.js
  7. 3 0
      src/action-creator.sync.js
  8. 1 1
      src/component/Header/Logo.jsx
  9. 1 1
      src/component/Header/MenuActionListItem/DropdownLang.jsx
  10. 1 1
      src/component/Header/MenuActionListItem/Help.jsx
  11. 1 1
      src/component/Header/MenuActionListItem/MenuProfil.jsx
  12. 1 1
      src/component/Header/MenuActionListItem/Search.jsx
  13. 1 1
      src/component/Header/MenuLinkList.jsx
  14. 2 3
      src/component/Timeline.jsx
  15. 0 62
      src/component/Workspace/FileContentViewer.jsx
  16. 1 4
      src/component/Workspace/FileItem.jsx
  17. 0 16
      src/component/Workspace/FileType/PageHtml.jsx
  18. 4 2
      src/component/Workspace/Folder.jsx
  19. 1 1
      src/component/common/Card/Card.jsx
  20. 1 1
      src/component/common/Card/CardBody.jsx
  21. 1 1
      src/component/common/Card/CardHeader.jsx
  22. 1 1
      src/component/common/Input/Button.jsx
  23. 1 1
      src/component/common/Input/InputCheckbox.jsx
  24. 1 1
      src/component/common/Input/InputGroupText.jsx
  25. 9 19
      src/component/common/PopinFixed/PopinFixedContent.jsx
  26. 4 0
      src/component/common/PopinFixed/PopinFixedHeader.jsx
  27. 61 75
      src/container/AccountPage.jsx
  28. 2 4
      src/container/PrivateRoute.jsx
  29. 27 0
      src/container/ProgressBar.jsx
  30. 3 1
      src/container/Tracim.jsx
  31. 31 0
      src/container/UploadPopup.jsx
  32. 19 18
      src/container/WorkspaceContent.jsx
  33. 26 32
      src/css/AccountPage.styl
  34. 2 2
      src/css/Folder.styl
  35. 0 102
      src/css/Generic.styl
  36. 1 1
      src/css/Header.styl
  37. 0 277
      src/css/PagePreview.styl
  38. 126 0
      src/css/ProgressBar.styl
  39. 4 2
      src/css/Timeline.styl
  40. 29 0
      src/css/UploadPopup.styl
  41. 2 0
      src/css/Variable.styl
  42. 19 19
      src/css/index.styl
  43. 0 26
      src/helper.js
  44. 24 18
      src/plugin/ContentType/PageHtml/PageHtml.styl
  45. 17 0
      src/plugin/ContentType/PageHtml/PageHtmlComponent.jsx
  46. 54 0
      src/plugin/ContentType/PageHtml/PageHtmlContainer.jsx
  47. 12 0
      src/plugin/ContentType/PageHtml/index.js
  48. 15 0
      src/plugin/ContentType/PageHtml/pageHtml.js
  49. 0 0
      src/plugin/ContentType/Thread/Thread.jsx
  50. 18 5
      src/plugin/ContentType/Thread/Thread.styl
  51. 12 0
      src/plugin/ContentType/Thread/index.js
  52. 15 0
      src/plugin/ContentType/Thread/thread.js
  53. 6 0
      src/plugin/index.js
  54. 0 10
      src/reducer/fileType/index.js
  55. 0 10
      src/reducer/fileType/pageHtml.js
  56. 9 0
      src/reducer/plugin.js
  57. 2 1
      src/reducer/root.js
  58. 1 1
      webpack.config.js

+ 29 - 1
dist/index.html Wyświetl plik

@@ -24,11 +24,39 @@
24 24
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script>
25 25
     <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script>
26 26
     -->
27
+
28
+    <script src='./plugin/pageHtml.plugin.js'></script>
29
+
27 30
     <script src="./dev/jquery-3.2.1.js"></script>
28 31
     <script src="./dev/popper-1.12.3.js"></script>
29 32
     <script src="./dev/bootstrap-4.0.0-beta.2.js"></script>
30 33
 
31
-    <script type="text/javascript">
34
+    <script type='text/javascript'>
35
+      GLOBAL_renderPlugin = data => {
36
+        if (data.file.type === 'PageHtml') {
37
+          pluginPageHtml.renderPlugin('pluginContainer', data)
38
+        }
39
+      }
40
+
41
+      GLOBAL_dispatchEvent = (data) => {
42
+        var event = new CustomEvent('pluginCustomEvent', {detail: data})
43
+        document.dispatchEvent(event)
44
+      }
45
+
46
+      GLOBAL_unmountPlugin = () => {
47
+        console.log('btn close clicked')
48
+        pluginPageHtml.hidePlugin('pluginContainer')
49
+      }
50
+
51
+      // only usefull if plugin doesn't handle fileContent himself
52
+      GLOBAL_handleRequireRedraw = () => {
53
+        var rez = pluginA.destroyPlugin('plugin')
54
+        if (rez) GLOBAL_drawPlugin('redraw')
55
+        else console.log('Erreur, failed at destroying plugin')
56
+      }
57
+    </script>
58
+
59
+    <script type='text/javascript'>
32 60
       if (window.matchMedia("(min-width:1200px)").matches) {
33 61
 
34 62
         var jsScript = document.createElement("script");

Plik diff jest za duży
+ 27 - 0
dist/plugin/pageHtml.plugin.js


+ 2 - 0
jsonserver/server.js Wyświetl plik

@@ -25,6 +25,8 @@ server.post('/user/login', (req, res) => {
25 25
   else return res.jsonp('error')
26 26
 })
27 27
 
28
+server.get('/plugin/file_content', (req, res) => res.jsonp(jsonDb.file_content))
29
+
28 30
 server.get('/user/is_logged_in', (req, res) => res.jsonp(jsonDb.user_logged))
29 31
 
30 32
 server.get('/workspace/:id', (req, res) => res.jsonp(jsonDb.workspace_detail))

+ 46 - 8
jsonserver/static_db.json Wyświetl plik

@@ -9,6 +9,43 @@
9 9
       "email": "osef@algoo.fr"
10 10
     }
11 11
   },
12
+  "file_content": [{
13
+    "name": "PageHtml",
14
+    "componentLeft": "PageHtml",
15
+    "componentRight": "Timeline",
16
+    "customClass": "wsFilePageHtml",
17
+    "icon": "fa fa-file-word-o"
18
+  }, {
19
+    "name": "PageMarkdown",
20
+    "componentLeft": "PageMarkdown",
21
+    "componentRight": "undefined",
22
+    "customClass": "wsFilePageMarkdown",
23
+    "icon": "fa fa-file-code-o"
24
+  }, {
25
+    "name": "File",
26
+    "componentLeft": "File",
27
+    "componentRight": "undefined",
28
+    "customClass": "wsFileFile",
29
+    "icon": "fa fa-file-text-o"
30
+  }, {
31
+    "name": "Thread",
32
+    "componentLeft": "Thread",
33
+    "componentRight": "undefined",
34
+    "customClass": "wsFileThread",
35
+    "icon": "fa fa-comments-o"
36
+  }, {
37
+    "name": "Task",
38
+    "componentLeft": "Task",
39
+    "componentRight": "undefined",
40
+    "customClass": "wsFileTask",
41
+    "icon": "fa fa-list-ul"
42
+  }, {
43
+    "name": "Issue",
44
+    "componentLeft": "Issue",
45
+    "componentRight": "undefined",
46
+    "customClass": "wsFileIssue",
47
+    "icon": "fa fa-ticket"
48
+  }],
12 49
   "workspace_detail": {
13 50
     "id": 1,
14 51
     "title": "Mission interne - développement",
@@ -17,38 +54,39 @@
17 54
       {
18 55
         "id": 1,
19 56
         "title": "La programmation fonctionnelle",
20
-        "type": "pageHtml",
57
+        "type": "PageHtml",
21 58
         "status": "validated",
59
+        "version": "3",
22 60
         "text": "<h1>Mon titre nul</h1>Je suis le contenu de cette fameuse <b>page HTML</b><br /> sur la programmation fonctionnelle"
23 61
       },
24 62
       {
25 63
         "id": 2,
26 64
         "title": "La prommation fonctionnelle est-elle vraiment utile ?",
27
-        "type": "thread",
65
+        "type": "Thread",
28 66
         "status": "current"
29 67
       },
30 68
       {
31 69
         "id": 6,
32 70
         "title": "Une photo moche",
33
-        "type": "file",
71
+        "type": "File",
34 72
         "status": "current"
35 73
       },
36 74
       {
37 75
         "id": 10,
38 76
         "title": "le README.md d'un random repo github",
39
-        "type": "pageMarkdown",
77
+        "type": "PageMarkdown",
40 78
         "status": "current"
41 79
       },
42 80
       {
43 81
         "id": 7,
44 82
         "title": "Une liste de truc à faire que je ferai jamais",
45
-        "type": "task",
83
+        "type": "Task",
46 84
         "status": "current"
47 85
       },
48 86
       {
49 87
         "id": 8,
50 88
         "title": "Ça, ça marche pas. Merci de le fix",
51
-        "type": "issue",
89
+        "type": "Issue",
52 90
         "status": "current"
53 91
       },
54 92
       {
@@ -59,13 +97,13 @@
59 97
           {
60 98
             "id": 4,
61 99
             "title": "des trucs de backend",
62
-            "type": "file",
100
+            "type": "File",
63 101
             "status": "outdated"
64 102
           },
65 103
           {
66 104
             "id": 5,
67 105
             "title": "on s'emmerde",
68
-            "type": "pageHtml",
106
+            "type": "PageHtml",
69 107
             "status": "outdated"
70 108
           }
71 109
         ]

+ 3 - 2
package.json Wyświetl plik

@@ -15,7 +15,7 @@
15 15
   "license": "ISC",
16 16
   "dependencies": {
17 17
     "babel-core": "^6.26.0",
18
-    "babel-eslint": "^8.0.1",
18
+    "babel-eslint": "^8.2.1",
19 19
     "babel-loader": "^7.1.2",
20 20
     "babel-plugin-transform-class-properties": "^6.24.1",
21 21
     "babel-plugin-transform-object-assign": "^6.22.0",
@@ -34,11 +34,12 @@
34 34
     "redux": "^3.7.2",
35 35
     "redux-logger": "^3.0.6",
36 36
     "redux-thunk": "^2.2.0",
37
-    "standard": "^10.0.3",
37
+    "standard": "^11.0.0",
38 38
     "standard-loader": "^6.0.1",
39 39
     "style-loader": "^0.19.0",
40 40
     "stylus": "^0.54.5",
41 41
     "stylus-loader": "^3.0.1",
42
+    "tracim_lib": "git://github.com/tracim/tracim_lib.git",
42 43
     "url-loader": "^0.6.2",
43 44
     "webpack": "^3.8.1",
44 45
     "whatwg-fetch": "^2.0.3"

+ 13 - 1
src/action-creator.async.js Wyświetl plik

@@ -6,7 +6,9 @@ import {
6 6
   updateUserConnected,
7 7
   updateUserData,
8 8
   WORKSPACE,
9
-  updateWorkspaceData
9
+  updateWorkspaceData,
10
+  PLUGIN_LIST,
11
+  setPluginList
10 12
 } from './action-creator.sync.js'
11 13
 
12 14
 /*
@@ -114,3 +116,13 @@ export const getWorkspaceContent = workspaceId => async dispatch => {
114 116
   })
115 117
   if (fetchGetWorkspaceContent.status === 200) dispatch(updateWorkspaceData(fetchGetWorkspaceContent.json))
116 118
 }
119
+
120
+export const getPluginList = () => async dispatch => {
121
+  const fetchGetPluginList = await fetchWrapper({
122
+    url: `http://localhost:3001/plugin/file_content`,
123
+    param: {...FETCH_CONFIG, method: 'GET'},
124
+    actionName: PLUGIN_LIST,
125
+    dispatch
126
+  })
127
+  if (fetchGetPluginList.status === 200) dispatch(setPluginList(fetchGetPluginList.json))
128
+}

+ 3 - 0
src/action-creator.sync.js Wyświetl plik

@@ -11,3 +11,6 @@ export const updateWorkspaceData = workspace => ({ type: `Update/${WORKSPACE}`,
11 11
 export const FILE_CONTENT = 'FileContent'
12 12
 export const setActiveFileContent = file => ({ type: `Set/${FILE_CONTENT}/Active`, file })
13 13
 export const hideActiveFileContent = () => ({ type: `Set/${FILE_CONTENT}/Hide` })
14
+
15
+export const PLUGIN_LIST = 'Plugin/List'
16
+export const setPluginList = pluginList => ({ type: `Set/${PLUGIN_LIST}`, pluginList })

+ 1 - 1
src/component/Header/Logo.jsx Wyświetl plik

@@ -10,7 +10,7 @@ const Logo = props => {
10 10
 }
11 11
 export default Logo
12 12
 
13
-Logo.PropTypes = {
13
+Logo.propTypes = {
14 14
   logoSrc: PropTypes.string.isRequired,
15 15
   onClickImg: PropTypes.func.isRequired
16 16
 }

+ 1 - 1
src/component/Header/MenuActionListItem/DropdownLang.jsx Wyświetl plik

@@ -30,7 +30,7 @@ const DropdownLang = props => {
30 30
 }
31 31
 export default DropdownLang
32 32
 
33
-DropdownLang.PropTypes = {
33
+DropdownLang.propTypes = {
34 34
   langList: PropTypes.array.isRequired,
35 35
   onChangeLang: PropTypes.func.isRequired
36 36
 }

+ 1 - 1
src/component/Header/MenuActionListItem/Help.jsx Wyświetl plik

@@ -16,6 +16,6 @@ const Help = props => {
16 16
 }
17 17
 export default Help
18 18
 
19
-Help.PropTypes = {
19
+Help.propTypes = {
20 20
   onClickHelp: PropTypes.func.isRequired
21 21
 }

+ 1 - 1
src/component/Header/MenuActionListItem/MenuProfil.jsx Wyświetl plik

@@ -24,7 +24,7 @@ const MenuProfil = props => {
24 24
 }
25 25
 export default MenuProfil
26 26
 
27
-MenuProfil.PropTypes = {
27
+MenuProfil.propTypes = {
28 28
   user: PropTypes.object.isRequired,
29 29
   onClickMyProfil: PropTypes.func.isRequired,
30 30
   onClickLogout: PropTypes.func.isRequired

+ 1 - 1
src/component/Header/MenuActionListItem/Search.jsx Wyświetl plik

@@ -25,7 +25,7 @@ const Search = props => {
25 25
 }
26 26
 export default Search
27 27
 
28
-Search.PropTypes = {
28
+Search.propTypes = {
29 29
   onChangeInput: PropTypes.func.isRequired,
30 30
   onClickSubmit: PropTypes.func.isRequired
31 31
 }

+ 1 - 1
src/component/Header/MenuLinkList.jsx Wyświetl plik

@@ -18,7 +18,7 @@ const MenuLinkList = props => {
18 18
 }
19 19
 export default MenuLinkList
20 20
 
21
-MenuLinkList.PropTypes = {
21
+MenuLinkList.propTypes = {
22 22
   onClickFeature: PropTypes.func.isRequired,
23 23
   onClickExplore: PropTypes.func.isRequired,
24 24
   onClickAbout: PropTypes.func.isRequired

+ 2 - 3
src/component/Timeline.jsx Wyświetl plik

@@ -1,7 +1,6 @@
1 1
 import React from 'react'
2 2
 import classnames from 'classnames'
3 3
 import imgProfil from '../img/imgProfil.png'
4
-import imgProfilReverse from '../img/imgProfil-reverse.png'
5 4
 
6 5
 const Timeline = props => {
7 6
   return (
@@ -28,7 +27,7 @@ const Timeline = props => {
28 27
 
29 28
         <li className={classnames(`${props.customClass}__messagelist__item`, 'timeline__messagelist__item received')}>
30 29
           <div className={classnames(`${props.customClass}__messagelist__item__avatar`, 'timeline__messagelist__item__avatar')}>
31
-            <img src={imgProfilReverse} alt='avatar' />
30
+            <img src={imgProfil} alt='avatar' />
32 31
           </div>
33 32
           <div
34 33
             className={classnames(`${props.customClass}__messagelist__item__createhour`, 'timeline__messagelist__item__createhour')}>
@@ -70,7 +69,7 @@ const Timeline = props => {
70 69
 
71 70
         <li className={classnames(`${props.customClass}__messagelist__item`, 'timeline__messagelist__item received')}>
72 71
           <div className={classnames(`${props.customClass}__messagelist__item__avatar`, 'timeline__messagelist__item__avatar')}>
73
-            <img src={imgProfilReverse} alt='avatar' />
72
+            <img src={imgProfil} alt='avatar' />
74 73
           </div>
75 74
           <div
76 75
             className={classnames(`${props.customClass}__messagelist__item__createhour`, 'timeline__messagelist__item__createhour')}>

+ 0 - 62
src/component/Workspace/FileContentViewer.jsx Wyświetl plik

@@ -1,62 +0,0 @@
1
-import React from 'react'
2
-import PropTypes from 'prop-types'
3
-import PopinFixed from '../common/PopinFixed/PopinFixed'
4
-import PopinFixedHeader from '../common/PopinFixed/PopinFixedHeader.jsx'
5
-import PopinFixedOption from '../common/PopinFixed/PopinFixedOption.jsx'
6
-import PopinFixedContent from '../common/PopinFixed/PopinFixedContent.jsx'
7
-import PageHtml from './FileType/PageHtml.jsx'
8
-import Thread from './FileType/Thread.jsx'
9
-import Preview from './FileType/File.jsx'
10
-import Timeline from '../Timeline.jsx'
11
-import { FILE_TYPE } from '../../helper.js'
12
-
13
-const FileContentViewer = props => {
14
-  const { customClass, icon } = FILE_TYPE.find(f => f.name === props.file.type) || {customClass: '', icon: ''}
15
-
16
-  const [leftPart, rightPart] = (() => {
17
-    switch (props.file.type) {
18
-      case FILE_TYPE[0].name: // pageHtml
19
-        return [
20
-          <PageHtml version={props.file.version} text={props.file.text} />,
21
-          <Timeline customClass={`${customClass}__contentpage`} />
22
-        ]
23
-      case FILE_TYPE[2].name: // file (preview)
24
-        return [
25
-          <Preview />,
26
-          <Timeline customClass={`${customClass}__contentpage`} />
27
-        ]
28
-      case FILE_TYPE[3].name: // thread
29
-        return [
30
-          <Thread />
31
-        ]
32
-    }
33
-  })()
34
-
35
-  return (
36
-    <PopinFixed customClass={`${customClass}`}>
37
-      <PopinFixedHeader
38
-        customClass={`${customClass}`}
39
-        icon={icon}
40
-        name={props.file.title}
41
-        onClickCloseBtn={props.onClose}
42
-      />
43
-
44
-      <PopinFixedOption customClass={`${customClass}`} />
45
-
46
-      <PopinFixedContent customClass={`${customClass}__contentpage`}>
47
-        { leftPart }
48
-        { rightPart }
49
-      </PopinFixedContent>
50
-    </PopinFixed>
51
-  )
52
-}
53
-
54
-export default FileContentViewer
55
-
56
-FileContentViewer.PropTypes = {
57
-  file: PropTypes.shape({
58
-    type: PropTypes.oneOf(FILE_TYPE.map(f => f.name)).isRequired,
59
-    title: PropTypes.string.isRequired
60
-  }).isRequired,
61
-  onClose: PropTypes.func.isRequired
62
-}

+ 1 - 4
src/component/Workspace/FileItem.jsx Wyświetl plik

@@ -1,11 +1,8 @@
1 1
 import React from 'react'
2 2
 import PropTypes from 'prop-types'
3 3
 import classnames from 'classnames'
4
-import { FILE_TYPE } from '../../helper.js'
5 4
 
6 5
 const FileItem = props => {
7
-  const iconType = (FILE_TYPE.find(f => f.name === props.type) || {icon: ''}).icon
8
-
9 6
   const iconStatus = (() => {
10 7
     switch (props.status) {
11 8
       case 'current':
@@ -23,7 +20,7 @@ const FileItem = props => {
23 20
     <div className={classnames('file', 'align-items-center', props.customClass)} onClick={props.onClickItem}>
24 21
       <div className='col-2 col-sm-2 col-md-2 col-lg-2 col-xl-1'>
25 22
         <div className='file__type'>
26
-          <i className={iconType} />
23
+          <i className={props.icon} />
27 24
         </div>
28 25
       </div>
29 26
       <div className='col-8 col-sm-8 col-md-8 col-lg-8 col-xl-10'>

+ 0 - 16
src/component/Workspace/FileType/PageHtml.jsx Wyświetl plik

@@ -1,16 +0,0 @@
1
-import React from 'react'
2
-
3
-const PageHtml = props => {
4
-  return (
5
-    <div className='wsFilePageHtml__contentpage__textnote'>
6
-      <div className='wsFilePageHtml__contentpage__textnote__latestversion'>
7
-        { props.version }
8
-      </div>
9
-      <div className='wsFilePageHtml__contentpage__textnote__text'>
10
-        { props.text }
11
-      </div>
12
-    </div>
13
-  )
14
-}
15
-
16
-export default PageHtml

+ 4 - 2
src/component/Workspace/Folder.jsx Wyświetl plik

@@ -21,7 +21,7 @@ class Folder extends Component {
21 21
   }
22 22
 
23 23
   render () {
24
-    const { title, content } = this.props.folderData
24
+    const { plugin, folderData: { title, content } } = this.props
25 25
     return (
26 26
       <div className={classnames('folder', {'active': this.state.open})}>
27 27
         <div className='folder__header' onClick={this.handleClickToggleFolder}>
@@ -57,6 +57,7 @@ class Folder extends Component {
57 57
           { content.map(c => c.type === 'folder'
58 58
             ? <Folder folderData={c} key={c.id} />
59 59
             : <FileItem
60
+              icon={(plugin[c.type] || {icon: ''}).icon}
60 61
               name={c.title}
61 62
               type={c.type}
62 63
               status={c.status}
@@ -76,5 +77,6 @@ Folder.propTypes = {
76 77
   folderData: PropTypes.shape({
77 78
     title: PropTypes.string.isRequired,
78 79
     content: PropTypes.array
79
-  })
80
+  }),
81
+  plugin: PropTypes.object
80 82
 }

+ 1 - 1
src/component/common/Card/Card.jsx Wyświetl plik

@@ -22,7 +22,7 @@ Card.propTypes = {
22 22
       children[1].type !== CardBody
23 23
       // children.some(p => p.type !== CardHeader && p.type !== CardBody)
24 24
     ) {
25
-      return new Error(`PropType Error: childrens of ${componentName} must be: 1 CardHeader and 1 CardBody.`)
25
+      return new Error(`PropType Error: children of ${componentName} must be: 1 CardHeader and 1 CardBody.`)
26 26
     }
27 27
   }).isRequired,
28 28
   customClass: PropTypes.string

+ 1 - 1
src/component/common/Card/CardBody.jsx Wyświetl plik

@@ -14,7 +14,7 @@ const CardBody = props => {
14 14
 
15 15
 export default CardBody
16 16
 
17
-CardBody.PropTypes = {
17
+CardBody.propTypes = {
18 18
   children: PropTypes.element.isRequired,
19 19
   formClass: PropTypes.string
20 20
 }

+ 1 - 1
src/component/common/Card/CardHeader.jsx Wyświetl plik

@@ -12,7 +12,7 @@ const CardHeader = props => {
12 12
 
13 13
 export default CardHeader
14 14
 
15
-CardHeader.PropTypes = {
15
+CardHeader.propTypes = {
16 16
   children: PropTypes.element.isRequired,
17 17
   customClass: PropTypes.string
18 18
 }

+ 1 - 1
src/component/common/Input/Button.jsx Wyświetl plik

@@ -16,7 +16,7 @@ const Button = props => {
16 16
 
17 17
 export default Button
18 18
 
19
-Button.PropTypes = {
19
+Button.propTypes = {
20 20
   htmlType: PropTypes.oneOf(['button', 'submit', 'reset']).isRequired,
21 21
   bootstrapType: PropTypes.oneOf(
22 22
     ['primary', 'default', 'default', 'success', 'danger', 'warning', 'info', 'light', 'dark']

+ 1 - 1
src/component/common/Input/InputCheckbox.jsx Wyświetl plik

@@ -21,7 +21,7 @@ const InputGroupText = props => {
21 21
 
22 22
 export default InputGroupText
23 23
 
24
-InputGroupText.PropTypes = {
24
+InputGroupText.propTypes = {
25 25
   parentClassName: PropTypes.string.isRequired,
26 26
   checked: PropTypes.bool.isRequired,
27 27
   onChange: PropTypes.func.isRequired,

+ 1 - 1
src/component/common/Input/InputGroupText.jsx Wyświetl plik

@@ -24,7 +24,7 @@ const InputGroupText = props => {
24 24
 
25 25
 export default InputGroupText
26 26
 
27
-InputGroupText.PropTypes = {
27
+InputGroupText.propTypes = {
28 28
   parentClassName: PropTypes.string.isRequired,
29 29
   value: PropTypes.string.isRequired,
30 30
   type: PropTypes.oneOf(['text', 'email', 'password', 'tel']).isRequired,

+ 9 - 19
src/component/common/PopinFixed/PopinFixedContent.jsx Wyświetl plik

@@ -1,23 +1,22 @@
1 1
 import React from 'react'
2 2
 import classnames from 'classnames'
3 3
 import PropTypes from 'prop-types'
4
-import PageHtml from '../../Workspace/FileType/PageHtml.jsx'
5
-import Thread from '../../Workspace/FileType/Thread.jsx'
6
-import Timeline from '../../Timeline.jsx'
7 4
 
8 5
 const PopinFixedContent = props => {
9 6
   return props.children.length === 2
10 7
     ? (
11
-      <div className={classnames('wsFileGeneric__contentpage', `${props.customClass}`)}>
12
-        {props.children[0]}
8
+      <div className={classnames('wsFileGeneric__content', `${props.customClass}__content`)}>
9
+        <div className={classnames('wsFileGeneric__content__left', `${props.customClass}__content__left`)}>
10
+          {props.children[0]}
11
+        </div>
13 12
 
14
-        <div className={classnames('wsFileGeneric__wrapper', `${props.customClass}__wrapper`)}>
13
+        <div className={classnames('wsFileGeneric__content__right', `${props.customClass}__content__right`)}>
15 14
           {props.children[1]}
16 15
         </div>
17 16
       </div>
18 17
     )
19 18
     : (
20
-      <div className={classnames('wsFileGeneric__contentpage', `${props.customClass}`)}>
19
+      <div className={classnames('wsFileGeneric__content', `${props.customClass}__content`)}>
21 20
         { props.children }
22 21
       </div>
23 22
     )
@@ -27,16 +26,7 @@ export default PopinFixedContent
27 26
 
28 27
 PopinFixedContent.propTypes = {
29 28
   customClass: PropTypes.string,
30
-  // from http://www.mattzabriskie.com/blog/react-validating-children
31
-  children: PropTypes.arrayOf((children, key, componentName /* , location, propFullName */) => {
32
-    if (
33
-      (Array.isArray(children.length) && (
34
-        children.length > 2 ||
35
-        (children.length === 2 && children.some(c => ![PageHtml, Thread, Timeline].includes(c.type)))
36
-      )) ||
37
-      (children.type === Timeline)
38
-    ) {
39
-      return new Error(`PropType Error: childrens of ${componentName} must be one of [PageHtml, Thread, Timeline, undefined].`)
40
-    }
41
-  }).isRequired
29
+  children: PropTypes.arrayOf((children, key, componentName /* , location, propFullName */) =>
30
+    children.length !== 2 && new Error(`PropType Error: ${componentName} must have 2 children.`)
31
+  ).isRequired
42 32
 }

+ 4 - 0
src/component/common/PopinFixed/PopinFixedHeader.jsx Wyświetl plik

@@ -13,6 +13,10 @@ const PopinFixedHeader = props => {
13 13
         {props.name}
14 14
       </div>
15 15
 
16
+      <div className={classnames('editiontitle mr-auto', `${props.customClass}__header__editionmode`)}>
17
+        <input className='editiontitle__input form-control' placeholder='Titre du fichier' />
18
+      </div>
19
+
16 20
       <div className={classnames('wsFileGeneric__header__edittitle', `${props.customClass}__header__changetitle`)}>
17 21
         <i className='fa fa-pencil' />
18 22
       </div>

+ 61 - 75
src/container/AccountPage.jsx Wyświetl plik

@@ -1,6 +1,6 @@
1 1
 import React, { Component } from 'react'
2 2
 import imgProfil from '../img/imgProfil.png'
3
-import BtnSwitch from '../component/common/Input/BtnSwitch.jsx'
3
+import { BtnSwitch } from 'tracim_lib'
4 4
 
5 5
 class AccountPage extends Component {
6 6
   render () {
@@ -69,33 +69,33 @@ class AccountPage extends Component {
69 69
             <div className='account__userpreference__setting'>
70 70
 
71 71
               <div className='account__userpreference__setting__personaldata d-none'>
72
-                <div className='account__userpreference__setting__personaldata__title subTitle ml-2 ml-sm-0'>
72
+                <div className='personaldata__title subTitle ml-2 ml-sm-0'>
73 73
                   Mes informations personnelles
74 74
                 </div>
75 75
 
76
-                <div className='account__userpreference__setting__personaldata__text ml-2 ml-sm-0'>
76
+                <div className='personaldata__text ml-2 ml-sm-0'>
77 77
                   Ut consectetur dolor et sunt nisi officia ut magna. Ut consectetur dolor et sunt nisi officia ut magna.
78 78
                   Ut consectetur dolor et sunt nisi officia ut magna.
79 79
                 </div>
80 80
 
81
-                <div className='account__userpreference__setting__personaldata__changeinfo'>
82
-                  <div className='account__userpreference__setting__personaldata__changeinfo__infotitle'>
81
+                <div className='personaldata__form'>
82
+                  <div className='personaldata__form__title'>
83 83
                     Changer le mot de passe :
84 84
                   </div>
85
-                  <input className='account__userpreference__setting__personaldata__changeinfo__txtinput form-control' type='password' placeholder='Ancien mot de passe' />
86
-                  <input className='account__userpreference__setting__personaldata__changeinfo__txtinput form-control' type='password' placeholder='Nouveau mot de passe' />
87
-                  <div className='account__userpreference__setting__personaldata__changeinfo__button btn btn-primary'>
85
+                  <input className='personaldata__form__txtinput form-control' type='password' placeholder='Ancien mot de passe' />
86
+                  <input className='personaldata__form__txtinput form-control' type='password' placeholder='Nouveau mot de passe' />
87
+                  <div className='personaldata__form__button btn btn-primary'>
88 88
                     Envoyer
89 89
                   </div>
90 90
                 </div>
91 91
 
92
-                <div className='account__userpreference__setting__personaldata__changeinfo'>
93
-                  <div className='account__userpreference__setting__personaldata__changeinfo__infotitle'>
92
+                <div className='personaldata__form'>
93
+                  <div className='personaldata__form__title'>
94 94
                     Changer d'adresse mail :
95 95
                   </div>
96
-                  <input className='account__userpreference__setting__personaldata__changeinfo__txtinput form-control' type='email' placeholder='Ancienne adresse mail' />
97
-                  <input className='account__userpreference__setting__personaldata__changeinfo__txtinput form-control' type='email' placeholder='Nouvelle adresse mail' />
98
-                  <div className='account__userpreference__setting__personaldata__changeinfo__button btn btn-primary'>
96
+                  <input className='personaldata__form__txtinput form-control' type='email' placeholder='Ancienne adresse mail' />
97
+                  <input className='personaldata__form__txtinput form-control' type='email' placeholder='Nouvelle adresse mail' />
98
+                  <div className='personaldata__form__button btn btn-primary'>
99 99
                     Envoyer
100 100
                   </div>
101 101
                 </div>
@@ -103,34 +103,34 @@ class AccountPage extends Component {
103 103
 
104 104
               <div className='account__userpreference__setting__calendar d-none'>
105 105
 
106
-                <div className='account__userpreference__setting__calendar__title subTitle ml-2 ml-sm-0'>
106
+                <div className='calendar__title subTitle ml-2 ml-sm-0'>
107 107
                   Calendrier
108 108
                 </div>
109 109
 
110
-                <div className='account__userpreference__setting__calendar__text ml-2 ml-sm-0'>
110
+                <div className='calendar__text ml-2 ml-sm-0'>
111 111
                   Ut consectetur dolor et sunt nisi officia ut magna. Ut consectetur dolor et sunt nisi officia ut magna.
112 112
                   Ut consectetur dolor et sunt nisi officia ut magna.
113 113
                 </div>
114 114
 
115
-                <div className='account__userpreference__setting__calendar__infotitle'>
115
+                <div className='calendar__title ml-2 ml-sm-0'>
116 116
                   Accèder à votre Calendrier personnel
117 117
                 </div>
118
-                <div className='account__userpreference__setting__calendar__link'>
118
+                <div className='calendar__link ml-2 ml-sm-0'>
119 119
                   http://algoo.trac.im/caldav/user/262.ics/
120 120
                 </div>
121 121
 
122
-                <div className='account__userpreference__setting__calendar__infotitle'>
122
+                <div className='calendar__title ml-2 ml-sm-0'>
123 123
                   Changer de Fuseau Horaire :
124 124
                 </div>
125 125
 
126
-                <div className='account__userpreference__setting__calendar__timezone dropdown'>
127
-                  <button className='account__userpreference__setting__calendar__timezone__btn btn dropdown-toggle' type='button' id='dropdownMenuButton' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
126
+                <div className='calendar__timezone ml-2 ml-sm-0 dropdown'>
127
+                  <button className='calendar__timezone__btn btn dropdown-toggle' type='button' id='dropdownMenuButton' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
128 128
                     Fuseau Horaire
129 129
                   </button>
130
-                  <div className='account__userpreference__setting__calendar__timezone__submenu dropdown-menu'>
131
-                    <div className='account__userpreference__setting__calendar__timezone__submenu__item dropdown-item'> Paris GMT +1
130
+                  <div className='calendar__timezone__submenu dropdown-menu'>
131
+                    <div className='calendar__timezone__submenu__item dropdown-item'> Paris GMT +1
132 132
                     </div>
133
-                    <div className='account__userpreference__setting__calendar__timezone__submenu__item dropdown-item dropdown-item'> Londres GMT +0
133
+                    <div className='calendar__timezone__submenu__item dropdown-item dropdown-item'> Londres GMT +0
134 134
                     </div>
135 135
                   </div>
136 136
                 </div>
@@ -138,16 +138,16 @@ class AccountPage extends Component {
138 138
 
139 139
               <div className='account__userpreference__setting__notification'>
140 140
 
141
-                <div className='account__userpreference__setting__notification__title subTitle ml-2 ml-sm-0'>
141
+                <div className='notification__title subTitle ml-2 ml-sm-0'>
142 142
                   Mes Espaces de Travail
143 143
                 </div>
144 144
 
145
-                <div className='account__userpreference__setting__notification__text ml-2 ml-sm-0'>
145
+                <div className='notification__text ml-2 ml-sm-0'>
146 146
                   Ut consectetur dolor et sunt nisi officia ut magna. Ut consectetur dolor et sunt nisi officia ut magna.
147 147
                   Ut consectetur dolor et sunt nisi officia ut magna.
148 148
                 </div>
149 149
 
150
-                <div className='account__userpreference__setting__notification__tableau'>
150
+                <div className='notification__table'>
151 151
                   <table className='table'>
152 152
                     <thead>
153 153
                       <tr>
@@ -159,156 +159,142 @@ class AccountPage extends Component {
159 159
                     <tbody>
160 160
                       <tr>
161 161
                         <td>
162
-                          <div className='account__userpreference__setting__notification__tableau__wksname'>
162
+                          <div className='notification__table__wksname'>
163 163
                             Nouvelle ligne directrice du nouveau design de Tracim v2 en date du 10 Octobre 2017
164 164
                           </div>
165 165
                         </td>
166 166
                         <td>
167
-                          <div className='account__userpreference__setting__notification__tableau__role'>
168
-                            <div className='account__userpreference__setting__notification__tableau__role__icon'>
167
+                          <div className='notification__table__role'>
168
+                            <div className='notification__table__role__icon'>
169 169
                               <i className='fa fa-graduation-cap' />
170 170
                             </div>
171
-                            <div className='account__userpreference__setting__notification__tableau__role__text'>
171
+                            <div className='notification__table__role__text d-none d-sm-flex'>
172 172
                               Gestionnaire de Contenu
173 173
                             </div>
174 174
                           </div>
175 175
                         </td>
176 176
                         <td>
177
-                          <div className='account__userpreference__setting__notification__tableau__btnswitch'>
178
-                            <BtnSwitch />
179
-                          </div>
177
+                          <BtnSwitch />
180 178
                         </td>
181 179
                       </tr>
182 180
                       <tr>
183 181
                         <td>
184
-                          <div className='account__userpreference__setting__notification__tableau__wksname'>
182
+                          <div className='notification__table__wksname'>
185 183
                             Nouvelle ligne directrice du nouveau design de Tracim v2 en date du 10 Octobre 2017
186 184
                           </div>
187 185
                         </td>
188 186
                         <td>
189
-                          <div className='account__userpreference__setting__notification__tableau__role'>
190
-                            <div className='account__userpreference__setting__notification__tableau__role__icon'>
187
+                          <div className='notification__table__role'>
188
+                            <div className='notification__table__role__icon'>
191 189
                               <i className='fa fa-eye' />
192 190
                             </div>
193
-                            <div className='account__userpreference__setting__notification__tableau__role__text'>
191
+                            <div className='notification__table__role__text d-none d-sm-flex'>
194 192
                               Lecteur
195 193
                             </div>
196 194
                           </div>
197 195
                         </td>
198 196
                         <td>
199
-                          <div className='account__userpreference__setting__notification__tableau__btnswitch'>
200
-                            <BtnSwitch />
201
-                          </div>
197
+                          <BtnSwitch />
202 198
                         </td>
203 199
                       </tr>
204 200
                       <tr>
205 201
                         <td>
206
-                          <div className='account__userpreference__setting__notification__tableau__wksname'>
202
+                          <div className='notification__table__wksname'>
207 203
                             Nouvelle ligne directrice du nouveau design de Tracim v2 en date du 10 Octobre 2017
208 204
                           </div>
209 205
                         </td>
210 206
                         <td>
211
-                          <div className='account__userpreference__setting__notification__tableau__role'>
212
-                            <div className='account__userpreference__setting__notification__tableau__role__icon'>
207
+                          <div className='notification__table__role'>
208
+                            <div className='notification__table__role__icon'>
213 209
                               <i className='fa fa-pencil' />
214 210
                             </div>
215
-                            <div className='account__userpreference__setting__notification__tableau__role__text'>
211
+                            <div className='notification__table__role__text d-none d-sm-flex'>
216 212
                               Contributeur
217 213
                             </div>
218 214
                           </div>
219 215
                         </td>
220 216
                         <td>
221
-                          <div className='account__userpreference__setting__notification__tableau__btnswitch'>
222
-                            <BtnSwitch />
223
-                          </div>
217
+                          <BtnSwitch />
224 218
                         </td>
225 219
                       </tr>
226 220
                       <tr>
227 221
                         <td>
228
-                          <div className='account__userpreference__setting__notification__tableau__wksname'>
222
+                          <div className='notification__table__wksname'>
229 223
                             Nouvelle ligne directrice du nouveau design de Tracim v2 en date du 10 Octobre 2017
230 224
                           </div>
231 225
                         </td>
232 226
                         <td>
233
-                          <div className='account__userpreference__setting__notification__tableau__role'>
234
-                            <div className='account__userpreference__setting__notification__tableau__role__icon'>
227
+                          <div className='notification__table__role'>
228
+                            <div className='notification__table__role__icon'>
235 229
                               <i className='fa fa-gavel' />
236 230
                             </div>
237
-                            <div className='account__userpreference__setting__notification__tableau__role__text'>
231
+                            <div className='notification__table__role__text d-none d-sm-flex'>
238 232
                               Responsable
239 233
                             </div>
240 234
                           </div>
241 235
                         </td>
242 236
                         <td>
243
-                          <div className='account__userpreference__setting__notification__tableau__btnswitch'>
244
-                            <BtnSwitch />
245
-                          </div>
237
+                          <BtnSwitch />
246 238
                         </td>
247 239
                       </tr>
248 240
                       <tr>
249 241
                         <td>
250
-                          <div className='account__userpreference__setting__notification__tableau__wksname'>
242
+                          <div className='notification__table__wksname'>
251 243
                             Nouvelle ligne directrice du nouveau design de Tracim v2 en date du 10 Octobre 2017
252 244
                           </div>
253 245
                         </td>
254 246
                         <td>
255
-                          <div className='account__userpreference__setting__notification__tableau__role'>
256
-                            <div className='account__userpreference__setting__notification__tableau__role__icon'>
247
+                          <div className='notification__table__role'>
248
+                            <div className='notification__table__role__icon'>
257 249
                               <i className='fa fa-graduation-cap' />
258 250
                             </div>
259
-                            <div className='account__userpreference__setting__notification__tableau__role__text'>
251
+                            <div className='notification__table__role__text d-none d-sm-flex'>
260 252
                               Gestionnaire de Contenu
261 253
                             </div>
262 254
                           </div>
263 255
                         </td>
264 256
                         <td>
265
-                          <div className='account__userpreference__setting__notification__tableau__btnswitch'>
266
-                            <BtnSwitch />
267
-                          </div>
257
+                          <BtnSwitch />
268 258
                         </td>
269 259
                       </tr>
270 260
                       <tr>
271 261
                         <td>
272
-                          <div className='account__userpreference__setting__notification__tableau__wksname'>
262
+                          <div className='notification__table__wksname'>
273 263
                             Nouvelle ligne directrice du nouveau design de Tracim v2 en date du 10 Octobre 2017
274 264
                           </div>
275 265
                         </td>
276 266
                         <td>
277
-                          <div className='account__userpreference__setting__notification__tableau__role'>
278
-                            <div className='account__userpreference__setting__notification__tableau__role__icon'>
267
+                          <div className='notification__table__role'>
268
+                            <div className='notification__table__role__icon'>
279 269
                               <i className='fa fa-graduation-cap' />
280 270
                             </div>
281
-                            <div className='account__userpreference__setting__notification__tableau__role__text'>
271
+                            <div className='notification__table__role__text d-none d-sm-flex'>
282 272
                               Gestionnaire de Contenu
283 273
                             </div>
284 274
                           </div>
285 275
                         </td>
286 276
                         <td>
287
-                          <div className='account__userpreference__setting__notification__tableau__btnswitch'>
288
-                            <BtnSwitch />
289
-                          </div>
277
+                          <BtnSwitch />
290 278
                         </td>
291 279
                       </tr>
292 280
                       <tr>
293 281
                         <td>
294
-                          <div className='account__userpreference__setting__notification__tableau__wksname'>
282
+                          <div className='notification__table__wksname'>
295 283
                             Nouvelle ligne directrice du nouveau design de Tracim v2 en date du 10 Octobre 2017
296 284
                           </div>
297 285
                         </td>
298 286
                         <td>
299
-                          <div className='account__userpreference__setting__notification__tableau__role'>
300
-                            <div className='account__userpreference__setting__notification__tableau__role__icon'>
287
+                          <div className='notification__table__role'>
288
+                            <div className='notification__table__role__icon'>
301 289
                               <i className='fa fa-graduation-cap' />
302 290
                             </div>
303
-                            <div className='account__userpreference__setting__notification__tableau__role__text'>
291
+                            <div className='notification__table__role__text d-none d-sm-flex'>
304 292
                               Gestionnaire de Contenu
305 293
                             </div>
306 294
                           </div>
307 295
                         </td>
308 296
                         <td>
309
-                          <div className='account__userpreference__setting__notification__tableau__btnswitch'>
310
-                            <BtnSwitch />
311
-                          </div>
297
+                          <BtnSwitch />
312 298
                         </td>
313 299
                       </tr>
314 300
                     </tbody>

+ 2 - 4
src/container/PrivateRoute.jsx Wyświetl plik

@@ -17,10 +17,8 @@ const PrivateRoute = ({ component: Component, ...rest }) => (
17 17
 const mapStateToProps = ({ user }) => ({ user })
18 18
 export default withRouter(connect(mapStateToProps)(PrivateRoute))
19 19
 
20
-PrivateRoute.PropTypes = {
21
-  component: PropTypes.shape({
22
-    Component: PropTypes.object.isRequired
23
-  }),
20
+PrivateRoute.propTypes = {
21
+  component: PropTypes.func.isRequired,
24 22
   user: PropTypes.shape({ // user is get with redux connect
25 23
     isLoggedIn: PropTypes.bool.isRequired
26 24
   })

+ 27 - 0
src/container/ProgressBar.jsx Wyświetl plik

@@ -0,0 +1,27 @@
1
+import React, { Component } from 'react'
2
+
3
+class ProgressBar extends Component {
4
+  render () {
5
+    return (
6
+      <div className='container-fluid'>
7
+        <div className='row'>
8
+          <div className='col-md-3 col-sm-6'>
9
+            <div className='progress blue'>
10
+              <span className='progress-left'>
11
+                <span className='progress-bar' />
12
+              </span>
13
+              <span className='progress-right'>
14
+                <span className='progress-bar' />
15
+              </span>
16
+              <div className='progress-value'>
17
+                90%
18
+              </div>
19
+            </div>
20
+          </div>
21
+        </div>
22
+      </div>
23
+    )
24
+  }
25
+}
26
+
27
+export default ProgressBar

+ 3 - 1
src/container/Tracim.jsx Wyświetl plik

@@ -45,7 +45,9 @@ class Tracim extends React.Component {
45 45
 
46 46
               <SidebarWrapper locationPath={location.pathname}>
47 47
 
48
-                <PrivateRoute exact path='/' component={AccountPage} />
48
+                <PrivateRoute exact path='/' component={WorkspaceContent} />
49
+                <PrivateRoute exact path='/account' component={AccountPage} />
50
+                <PrivateRoute exact path='/dashboard' component={Dashboard} />
49 51
 
50 52
               </SidebarWrapper>
51 53
 

+ 31 - 0
src/container/UploadPopup.jsx Wyświetl plik

@@ -0,0 +1,31 @@
1
+import React, { Component } from 'react'
2
+import ProgressBar from './ProgressBar.jsx'
3
+
4
+class UploadPopup extends Component {
5
+  render () {
6
+    return (
7
+      <div className='uploadpopup'>
8
+        <div className='uploadpopup__wrapper card'>
9
+          <div className='card-body'>
10
+
11
+            <div className='uploadpopup__closepopup'>
12
+              <i className='fa fa-times' />
13
+            </div>
14
+
15
+            <div className='uploadpopup__progress'>
16
+              <div className='uploadpopup__progress__bar'>
17
+                <ProgressBar />
18
+              </div>
19
+
20
+              <div className='uploadpopup__progress__filename'>
21
+                Nom du Fichier
22
+              </div>
23
+            </div>
24
+          </div>
25
+        </div>
26
+      </div>
27
+    )
28
+  }
29
+}
30
+
31
+export default UploadPopup

+ 19 - 18
src/container/WorkspaceContent.jsx Wyświetl plik

@@ -7,9 +7,11 @@ import PageWrapper from '../component/common/layout/PageWrapper.jsx'
7 7
 import PageTitle from '../component/common/layout/PageTitle.jsx'
8 8
 import PageContent from '../component/common/layout/PageContent.jsx'
9 9
 import DropdownCreateButton from '../component/common/Input/DropdownCreateButton.jsx'
10
-import FileContentViewer from '../component/Workspace/FileContentViewer.jsx'
11
-import { getWorkspaceContent } from '../action-creator.async.js'
12
-import { setActiveFileContent, hideActiveFileContent } from '../action-creator.sync.js'
10
+import {
11
+  getPluginList,
12
+  getWorkspaceContent
13
+} from '../action-creator.async.js'
14
+// import pluginDatabase from '../plugin/index.js'
13 15
 
14 16
 class WorkspaceContent extends React.Component {
15 17
   constructor (props) {
@@ -21,18 +23,20 @@ class WorkspaceContent extends React.Component {
21 23
 
22 24
   componentDidMount () {
23 25
     this.props.dispatch(getWorkspaceContent(/* this.props.workspace.id */1))
26
+    this.props.dispatch(getPluginList())
24 27
   }
25 28
 
26 29
   handleClickFileItem = file => {
27
-    this.props.dispatch(setActiveFileContent(file))
28
-  }
29
-
30
-  handleClickCloseBtn = () => {
31
-    this.props.dispatch(hideActiveFileContent())
30
+    GLOBAL_renderPlugin({
31
+      file,
32
+      pluginData: this.props.plugin[file.type]
33
+    })
32 34
   }
33 35
 
34 36
   render () {
35
-    const { workspace, activeFileContent } = this.props
37
+    const { workspace, plugin } = this.props
38
+
39
+    // const PluginContainer = (pluginDatabase.find(p => p.name === activeFileContent.type) || {container: '<div>unknow</div>'}).container
36 40
 
37 41
     return (
38 42
       <PageWrapper customeClass='workspace'>
@@ -45,16 +49,16 @@ class WorkspaceContent extends React.Component {
45 49
         </PageTitle>
46 50
 
47 51
         <PageContent parentClass='workspace__content'>
48
-
49 52
           <div className='workspace__content__fileandfolder folder__content active'>
50 53
             <FileItemHeader />
51 54
 
52 55
             { workspace.content.map(c => c.type === 'folder'
53
-              ? <Folder folderData={c} key={c.id} />
56
+              ? <Folder plugin={plugin} folderData={c} key={c.id} />
54 57
               : (
55 58
                 <FileItem
56 59
                   name={c.title}
57 60
                   type={c.type}
61
+                  icon={(plugin[c.type] || {icon: ''}).icon}
58 62
                   status={c.status}
59 63
                   onClickItem={() => this.handleClickFileItem(c)}
60 64
                   key={c.id}
@@ -65,12 +69,9 @@ class WorkspaceContent extends React.Component {
65 69
 
66 70
           <DropdownCreateButton customClass='workspace__content__button mb-5' />
67 71
 
68
-          { activeFileContent.display &&
69
-            <FileContentViewer
70
-              file={activeFileContent}
71
-              onClose={this.handleClickCloseBtn}
72
-            />
73
-          }
72
+          <div id='pluginContainer'>
73
+            {/* activeFileContent.display && <PluginContainer /> */}
74
+          </div>
74 75
         </PageContent>
75 76
 
76 77
       </PageWrapper>
@@ -78,5 +79,5 @@ class WorkspaceContent extends React.Component {
78 79
   }
79 80
 }
80 81
 
81
-const mapStateToProps = ({ workspace, activeFileContent }) => ({ workspace, activeFileContent })
82
+const mapStateToProps = ({ workspace, activeFileContent, plugin }) => ({ workspace, activeFileContent, plugin })
82 83
 export default connect(mapStateToProps)(WorkspaceContent)

+ 26 - 32
src/css/AccountPage.styl Wyświetl plik

@@ -5,7 +5,14 @@ settingText()
5 5
   margin 15px 0
6 6
   font-size 18px
7 7
 
8
+.table td
9
+  vertical-align middle
10
+
11
+.table tr:nth-child(even)
12
+  background-color grey-hover
13
+
8 14
 .account
15
+  width 100%
9 16
   &__userinformation
10 17
     display flex
11 18
     justify-content center
@@ -56,12 +63,11 @@ settingText()
56 63
           font-size 20px
57 64
           cursor pointer
58 65
         &__disabled
59
-          padding 25px 20px 20px 20px
66
+          padding 25px 20px 20px 16px
60 67
           color grey
61 68
           font-size 18px
62 69
         &__item
63 70
           margin-top 10px
64
-          padding-left 5px
65 71
           font-weight 500
66 72
           font-size 18px
67 73
           cursor pointer
@@ -73,51 +79,43 @@ settingText()
73 79
       padding 20px
74 80
       width 80%
75 81
       background-color off-white
76
-      &__personaldata
82
+      .personaldata
77 83
         &__text
78 84
           settingText()
79
-        &__changeinfo
85
+        &__form
80 86
           margin 25px 0
81
-          &__infotitle
87
+          &__title
82 88
             margin-bottom 15px
83 89
             font-size 18px
84 90
           &__txtinput
85 91
             display inline-flex
86
-            display ms-inline-flex
87 92
             width auto
88 93
             margin 0 15px 15px 0
89 94
             border 1px solid blue
90
-            border-radius 10px
95
+            border-radius 5px
91 96
             padding 8px 15px
92 97
           &__button
93 98
             vertical-align top
94 99
             border 1px solid blue
95
-            border-radius 10px
100
+            border-radius 5px
96 101
             padding 8px 25px
97
-            background-color transparent
98
-            color blue
99 102
             cursor pointer
100
-            &:hover, &:focus
101
-              background-color blue
102
-              color white
103
-      &__calendar
104
-        &__title
105
-          settingTitle()
103
+      .calendar
106 104
         &__text
107 105
           settingText()
108
-        &__infotitle
106
+        &__title
109 107
           margin 15px 0
110 108
           font-size 18px
111 109
         &__link
112 110
           display inline-block
113 111
           border 1px solid grey
114
-          border-radius 10px
112
+          border-radius 5px
115 113
           padding 10px 25px
116 114
         &__timezone
117 115
           margin 15px 0 30px 0
118 116
           &__btn
119 117
             border 1px solid blue
120
-            border-radius 10px
118
+            border-radius 5px
121 119
             padding 10px 35px
122 120
             color blue
123 121
             background-color transparent
@@ -134,13 +132,11 @@ settingText()
134 132
               &:hover, &:focus
135 133
                 background-color blue
136 134
                 color white
137
-      &__notification
138
-        &__title
139
-          settingTitle()
135
+      .notification
140 136
         &__text
141 137
           settingText()
142 138
           margin-bottom 30px
143
-        &__tableau
139
+        &__table
144 140
           border 1px solid lightGrey
145 141
           &__role
146 142
             display flex
@@ -148,13 +144,8 @@ settingText()
148 144
             &__icon
149 145
               margin-right 10px
150 146
 
151
-.account__userpreference__setting__notification__table__line:nth-last-child(1)
152
-  border-bottom 0
153
-
154
-
155 147
 /***** MEDIAQUERIES *****/
156 148
 
157
-
158 149
 /**** MEDIA 576px & 1199px ****/
159 150
 
160 151
 // Regroup the common rules
@@ -260,16 +251,19 @@ settingText()
260 251
         border-radius 0
261 252
         padding 10px 0
262 253
         width 100%
263
-        &__calendar
254
+        .personaldata
255
+          &__form
256
+            margin-left 10px
257
+        .calendar
264 258
           &__link
265 259
             padding 10px 15px
266
-        &__notification
267
-          &__tableau
260
+        .notification
261
+          &__table
268 262
             &__wksname
269 263
               text-overflow ellipsis
270 264
               white-space nowrap
271 265
               overflow hidden
272
-              width 100px
266
+              width 310px
273 267
               &:focus
274 268
                 overflow visible
275 269
                 width auto

+ 2 - 2
src/css/Folder.styl Wyświetl plik

@@ -53,11 +53,11 @@ folderopen()
53 53
     &:hover
54 54
       background-color folder-hover
55 55
       .folder__header__triangleborder__triangle
56
-        border-color hover-folder transparent transparent transparent
56
+        border-color folder-hover transparent transparent transparent
57 57
     &__triangleborder
58 58
       display none
59 59
       position absolute
60
-      top 62px
60
+      top 61px
61 61
       left -1px
62 62
       border-style solid
63 63
       border-width 25px 30px 0 30px

+ 0 - 102
src/css/Generic.styl Wyświetl plik

@@ -161,105 +161,3 @@
161 161
       border 1px solid grey
162 162
       border-radius 10px
163 163
       padding 15px 25px
164
-
165
-/********************/
166
-
167
-/*** PAGE FILE, THREAD, HTML, MARKDOWN, ISSUE ***/
168
-
169
-.wsFileGeneric
170
-  position fixed
171
-  top 85px
172
-  right 0
173
-  border 1px solid grey
174
-  height 100%
175
-  background-color lightGrey
176
-  box-shadow shadow-page
177
-  visibility hidden
178
-  z-index 1
179
-  &.visible
180
-    visibility visible
181
-  &__header
182
-    display flex
183
-    align-items center
184
-    padding 15px
185
-    height 64px
186
-    &__icon
187
-      margin-right 15px
188
-      font-size 22px
189
-      color white
190
-    &__title
191
-      margin-right 15px
192
-      color white
193
-      text-overflow ellipsis
194
-      overflow hidden
195
-      white-space nowrap
196
-    &__edittitle
197
-      margin 0 15px
198
-      color white
199
-      font-size 20px
200
-      cursor pointer
201
-      &:hover , &:focus
202
-        border 1px solid off-white
203
-        padding 0 10px
204
-        border-radius 5px
205
-    &__close
206
-      border 1px solid white
207
-      border-radius 5px
208
-      padding 2px 5px
209
-      cursor pointer
210
-      & > i
211
-        color white
212
-        font-size 20px
213
-  &__option
214
-    border-bottom 1px solid grey
215
-    padding 10px
216
-    height 58px
217
-    background-color off-white
218
-    & > i
219
-      vertical-align middle
220
-      margin-right 15px
221
-      font-size 25px
222
-      cursor pointer
223
-    &__menu
224
-      display flex
225
-      align-items center
226
-      &__status
227
-        margin-right 20px
228
-        .current
229
-          color blue
230
-        .check
231
-          color green
232
-        .invalid
233
-          color red
234
-        .ban
235
-          color grey
236
-        &__dropdownbtn
237
-          border 1px solid grey
238
-          width 150px
239
-          background-color transparent
240
-          cursor pointer
241
-          &::after
242
-            color fontColor
243
-          &:hover
244
-            background-color transparent
245
-          &__icon
246
-            display inline-block
247
-            margin 0 15px
248
-        &__submenu
249
-          &__item
250
-            display flex
251
-            justify-content space-between
252
-            margin 5px 0
253
-            cursor pointer
254
-            &:active
255
-              background-color transparent
256
-      &__action
257
-        margin 5px 10px 0 0
258
-        font-size 18px
259
-        cursor pointer
260
-        &:hover , &:focus
261
-          font-size 22px
262
-          color blue
263
-  &__wrapper
264
-    display flex
265
-    flex-direction column

+ 1 - 1
src/css/Header.styl Wyświetl plik

@@ -86,7 +86,7 @@
86 86
               margin-right 10px
87 87
               color darkGrey
88 88
           .profilgroup__sub
89
-            color dark-grey
89
+            color darkGrey
90 90
             cursor pointer
91 91
             &:focus
92 92
               box-shadow none

+ 0 - 277
src/css/PagePreview.styl Wyświetl plik

@@ -1,277 +0,0 @@
1
-.wsFilePreview
2
-  width 1200px
3
-  height calc(100% - 85px)
4
-  &__header
5
-    background-color previewColor
6
-    .fa-file-image-o
7
-      color white
8
-  &__option
9
-    &__menu
10
-      display flex
11
-      &__addversion
12
-        padding 8px 15px
13
-        border 1px solid previewColor
14
-        border-radius 5px
15
-        background-color transparent
16
-        color previewColor
17
-        cursor pointer
18
-        & > i
19
-          margin-left 10px
20
-        &:hover
21
-          background-color previewColor
22
-          border none
23
-          color white
24
-  &__contentpage
25
-    display flex
26
-    height 100%
27
-    &__visualizer
28
-      position relative
29
-      margin 10px
30
-      border-radius 10px
31
-      width 70%
32
-      height calc(100% - 150px)
33
-      background-color off-white
34
-      &__sidebar
35
-        position absolute
36
-        top 0
37
-        right 0
38
-        width 50px
39
-        height 100%
40
-        transition width 1s ease
41
-        &__visiblepart
42
-          display flex
43
-          flex-direction column
44
-          align-items center
45
-          border-top-right-radius 10px
46
-          border-bottom-right-radius 10px
47
-          width 50px
48
-          height 100%
49
-          background-color grey
50
-          cursor pointer
51
-          &:hover
52
-            background-color previewColor
53
-          &__icon
54
-            justify-content flex-start
55
-            font-size 30px
56
-            color white
57
-          &__title
58
-            margin-top 45px
59
-            color white
60
-            transform rotate(-90deg)
61
-        &__propertydetail
62
-          display none
63
-      &__dloption
64
-        display flex
65
-        margin-left calc(50% - 50px) // 50px => width/2 of the div
66
-        padding-top 10px
67
-        width 100px
68
-        &__icon
69
-          margin-right 20px
70
-          font-size 20px
71
-          cursor pointer
72
-      &__slidecontainer
73
-        display flex
74
-        align-items center
75
-        width calc(100% - 50px) // 50px => width of sidebar
76
-        height calc(100% - 40px) // 40px => height of dloption
77
-        &__fileimg
78
-          display flex
79
-          padding 30px
80
-          width 100%
81
-          height 100%
82
-          & > img
83
-            max-height 100%
84
-            max-width 100%
85
-        &__chevron
86
-          margin 0 5px
87
-          font-size 20px
88
-          cursor pointer
89
-    .timeline
90
-      margin 10px
91
-      border-radius 10px
92
-      width 45%
93
-      height calc(100% - 150px)
94
-      background-color off-white
95
-      overflow scroll
96
-      &__header
97
-        border-top-left-radius 10px
98
-        border-top-right-radius 10px
99
-        padding 10px 0
100
-        text-align center
101
-        font-size 20px
102
-        color dark-grey
103
-        background-color grey-hover
104
-      &__messagelist
105
-        min-height 300px
106
-        &__item
107
-          &__content
108
-            color dark-grey
109
-        &__version
110
-          margin-top 40px
111
-          background-color grey-hover
112
-          &__btn
113
-            padding 5px 25px
114
-            border-radius 5px
115
-            width 145px
116
-            color white
117
-            font-size 17px
118
-            background-color previewColor
119
-            & > i
120
-              margin-right 10px
121
-              color dark-grey
122
-              font-size 22px
123
-            &:hover
124
-              background-color lightPreviewColor
125
-            &:focus
126
-              background-color lightPreviewColor
127
-          &__date
128
-            color fontColor
129
-            font-size 17px
130
-      &__texteditor
131
-        &__simpletext
132
-          &__input
133
-            &:focus
134
-              color htmlColor
135
-              border-color htmlColor
136
-        &__submit
137
-          &__btn
138
-            border-color htmlColor
139
-            background-color htmlColor
140
-            color white
141
-            &:hover
142
-              border-color htmlColor
143
-              background-color htmlColor
144
-            &:focus
145
-              border-color htmlColor
146
-              background-color htmlColor
147
-
148
-/***** SENDER RECEIVER *****/
149
-
150
-.received
151
-  .wsFilePreview__contentpage__messagelist__item__content
152
-      background-color previewColor
153
-
154
-/***** ACTIVE SIDEBAR *****/
155
-
156
-.activesidebar
157
-  .wsFilePreview__contentpage__visualizer
158
-    &__sidebar
159
-      display flex
160
-      border-top-right-radius 10px
161
-      border-bottom-right-radius 10px
162
-      width 500px
163
-      background-color off-white
164
-      &__visiblepart
165
-        order 1
166
-        border-top-left-radius 10px
167
-        border-bottom-left-radius 10px
168
-        border-top-right-radius 0
169
-        border-bottom-right-radius 0
170
-        background-color previewColor
171
-      &__propertydetail
172
-        display flex
173
-        order 2
174
-        padding 20px
175
-        overflow-Y auto
176
-        color previewColor
177
-
178
-/****** MEDIA QUERIES ********/
179
-
180
-@media (min-width: max-xs) and (max-width: max-lg)
181
-
182
-  .wsFilePreview
183
-    overflow-Y auto
184
-    &__contentpage
185
-      display block
186
-      &__visualizer
187
-        display flex
188
-        flex-direction column
189
-        width calc(100% - 30px) // 20px => margin
190
-      .timeline
191
-        width calc(100% - 30px) // 20px => margin
192
-        &__texteditor
193
-          &__simpletext
194
-            display inline-flex
195
-            display ms-inline-flex
196
-            width 60%
197
-          &__submit
198
-            display inline-flex
199
-            display ms-inline-flex
200
-            margin 10px 0
201
-            &__btn
202
-              display flex
203
-              margin-left 35px
204
-              &__icon
205
-                margin-left 15px
206
-
207
-/**** MEDIA 992px & 1199px ****/
208
-
209
-@media (min-width: min-lg) and (max-width: max-lg)
210
-
211
-  .wsFilePreview
212
-    width 900px
213
-    overflow-Y auto
214
-
215
-/******************************/
216
-
217
-/**** MEDIA 768px & 991px ****/
218
-
219
-@media (min-width: min-md) and (max-width: max-md)
220
-
221
-  .wsFilePreview
222
-    width 100%
223
-
224
-/******************************/
225
-
226
-/**** MEDIA 576px & 767px ****/
227
-
228
-@media (min-width: min-sm) and (max-width: max-sm)
229
-
230
-  .wsFilePreview
231
-    top 69px
232
-    width 100%
233
-    height calc(100% - 69px)
234
-    overflow-Y scroll
235
-
236
-/******************************/
237
-
238
-/**** MEDIA 575px ****/
239
-
240
-@media (max-width: max-xs)
241
-
242
-  .activesidebar
243
-    .wsFilePreview__contentpage__visualizer
244
-      &__sidebar
245
-        width 350px
246
-
247
-  .wsFilePreview
248
-    top 69px
249
-    width 100%
250
-    height calc(100% - 69px)
251
-    overflow-Y scroll
252
-    &__option__menu__addversion
253
-        padding 8px 5px
254
-        & > i
255
-          display none
256
-    &__contentpage
257
-      display block
258
-      &__visualizer
259
-        display flex
260
-        flex-direction column
261
-        width calc(100% - 30px) // 20px => margin
262
-      .timeline
263
-        width calc(100% - 30px) // 20px => margin
264
-        &__texteditor
265
-          &__simpletext
266
-            display inline-flex
267
-            display ms-inline-flex
268
-            width 60%
269
-          &__submit
270
-            display inline-flex
271
-            display ms-inline-flex
272
-            margin 10px 0
273
-            &__btn
274
-              display flex
275
-              margin-left 35px
276
-              &__icon
277
-                margin-left 15px

+ 126 - 0
src/css/ProgressBar.styl Wyświetl plik

@@ -0,0 +1,126 @@
1
+.progress
2
+    width 150px
3
+    height 150px
4
+    line-height 150px
5
+    background none
6
+    margin 0 auto
7
+    position relative
8
+
9
+.progressafter
10
+    content ""
11
+    width 100%
12
+    height 100%
13
+    border-radius 50%
14
+    border 12px solid off-white
15
+    position absolute
16
+    top 0
17
+    left 0
18
+
19
+.progress > span
20
+    width 50%
21
+    height 100%
22
+    overflow hidden
23
+    position absolute
24
+    top 0
25
+    z-index 1
26
+
27
+.progress .progress-left
28
+    left 0
29
+
30
+.progress .progress-bar
31
+    width 100%
32
+    height 100%
33
+    background none
34
+    border-width 12px
35
+    border-style solid
36
+    position absolute
37
+    top 0
38
+
39
+.progress .progress-left .progress-bar
40
+    left 100%
41
+    border-top-right-radius 80px
42
+    border-bottom-right-radius 80px
43
+    border-left 0
44
+    -webkit-transform-origin center left
45
+    transform-origin center left
46
+
47
+.progress .progress-right
48
+    right 0
49
+
50
+.progress .progress-right .progress-bar
51
+    left -100%
52
+    border-top-left-radius 80px
53
+    border-bottom-left-radius 80px
54
+    border-right 0
55
+    -webkit-transform-origin center right
56
+    transform-origin center right
57
+    animation loading-1 1.8s linear forwards
58
+
59
+.progress .progress-value
60
+    display flex
61
+    justify-content center
62
+    align-items center
63
+    width 90%
64
+    height 90%
65
+    border 10px solid off-white
66
+    border-radius 50%
67
+    background darkBlue
68
+    font-size 24px
69
+    color off-white
70
+    line-height 135px
71
+    text-align center
72
+    position absolute
73
+    top 5%
74
+    left 5%
75
+
76
+
77
+.progress.blue .progress-bar
78
+    border-color blue
79
+
80
+.progress.blue .progress-left .progress-bar
81
+    animation loading-2 1.5s linear forwards 1.8s
82
+
83
+@keyframes loading-1
84
+    0%
85
+        -webkit-transform rotate(0deg)
86
+        transform rotate(0deg)
87
+
88
+    100%
89
+        -webkit-transform rotate(180deg)
90
+        transform rotate(180deg)
91
+
92
+@keyframes loading-2
93
+    0%
94
+        -webkit-transform rotate(0deg)
95
+        transform rotate(0deg)
96
+
97
+    100%
98
+        -webkit-transform rotate(144deg)
99
+        transform rotate(144deg)
100
+
101
+@keyframes loading-3
102
+    0%
103
+        -webkit-transform rotate(0deg)
104
+        transform rotate(0deg)
105
+
106
+    100%
107
+        -webkit-transform rotate(90deg)
108
+        transform rotate(90deg)
109
+
110
+@keyframes loading-4
111
+    0%
112
+        -webkit-transform rotate(0deg)
113
+        transform rotate(0deg)
114
+
115
+    100%
116
+        -webkit-transform rotate(36deg)
117
+        transform rotate(36deg)
118
+
119
+@keyframes loading-5
120
+    0%
121
+        -webkit-transform rotate(0deg)
122
+        transform rotate(0deg)
123
+
124
+    100%
125
+        -webkit-transform rotate(126deg)
126
+        transform rotate(126deg)

+ 4 - 2
src/css/Timeline.styl Wyświetl plik

@@ -2,12 +2,14 @@
2 2
   display flex
3 3
   flex-direction column
4 4
   margin 10px
5
+  border-radius 10px
6
+  height 100%
5 7
   &__header
6 8
     border-radius 10px 10px 0 0
7 9
     padding 15px
8 10
     text-align center
9 11
     font-size 20px
10
-    color dark-grey
12
+    color darkGrey
11 13
     background-color grey-hover
12 14
   &__messagelist
13 15
     flex 1 1 0
@@ -51,7 +53,7 @@
51 53
         font-size 17px
52 54
         & > i
53 55
           margin-right 10px
54
-          color dark-grey
56
+          color darkGrey
55 57
           font-size 22px
56 58
       &__date
57 59
         color fontColor

+ 29 - 0
src/css/UploadPopup.styl Wyświetl plik

@@ -0,0 +1,29 @@
1
+.uploadpopup
2
+  position fixed
3
+  top 0
4
+  left 0
5
+  display flex
6
+  justify-content center
7
+  width 100%
8
+  height 100%
9
+  z-index 3
10
+  &__wrapper
11
+    margin-top 120px
12
+    width 400px
13
+    height 350px
14
+    background off-white
15
+    box-shadow shadow-all
16
+  &__closepopup
17
+    display flex
18
+    justify-content flex-end
19
+    cursor pointer
20
+  &__progress
21
+    display flex
22
+    flex-direction column
23
+    align-items center
24
+    padding 40px 0
25
+    &__filename
26
+      margin-top 30px
27
+      font-size 25px
28
+
29
+

+ 2 - 0
src/css/Variable.styl Wyświetl plik

@@ -1,3 +1,5 @@
1
+// Côme - 2018/02/27 - DEPRECATED : now using Variable.styl from tracim_lib
2
+
1 3
 /**** VARIABLES ****/
2 4
 /*** COULEURS ****/
3 5
 

+ 19 - 19
src/css/index.styl Wyświetl plik

@@ -3,28 +3,28 @@ body
3 3
 html, body, #content, #content > div
4 4
   height 100%
5 5
 
6
-@import 'Variable'
7
-@import 'Generic'
6
+@import 'Variable.styl' // Côme - this comes from node_modules/tracim_lib
8 7
 
9
-@import 'Sidebar'
10
-@import 'Header'
11
-@import 'Footer'
8
+@import 'Generic.styl'
12 9
 
13
-@import 'Login'
14
-@import 'Workspace'
10
+@import 'Sidebar.styl'
11
+@import 'Header.styl'
12
+@import 'Footer.styl'
15 13
 
16
-@import 'FileItem'
17
-@import 'FileItemHeader'
18
-@import 'Folder'
14
+@import 'Login.styl'
15
+@import 'Workspace.styl'
19 16
 
20
-@import 'Thread'
21
-@import 'PageHtml'
22
-@import 'Timeline'
23
-@import 'File'
17
+@import 'FileItem.styl'
18
+@import 'FileItemHeader.styl'
19
+@import 'Folder.styl'
24 20
 
25
-@import 'Dashboard'
26
-@import 'AccountPage'
27
-@import 'btnSwtich'
21
+@import 'Timeline.styl'
22
+@import 'File.styl'
23
+
24
+@import 'Dashboard.styl'
25
+@import 'AccountPage.styl'
26
+@import 'btnSwtich.styl'
27
+
28
+@import 'UploadPopup'
29
+@import 'ProgressBar'
28 30
 
29
-// @import 'UploadPopup'
30
-// @import 'ProgressBar'

+ 0 - 26
src/helper.js Wyświetl plik

@@ -4,29 +4,3 @@ export const FETCH_CONFIG = {
4 4
     'Content-Type': 'application/json'
5 5
   }
6 6
 }
7
-
8
-export const FILE_TYPE = [{
9
-  name: 'pageHtml',
10
-  customClass: 'wsFilePageHtml',
11
-  icon: 'fa fa-file-word-o'
12
-}, {
13
-  name: 'pageMarkdown',
14
-  customClass: 'wsFilePageMarkdown',
15
-  icon: 'fa fa-file-code-o'
16
-}, {
17
-  name: 'file',
18
-  customClass: 'wsFileFile',
19
-  icon: 'fa fa-file-image-o'
20
-}, {
21
-  name: 'thread',
22
-  customClass: 'wsFileThread',
23
-  icon: 'fa fa-comments-o'
24
-}, {
25
-  name: 'task',
26
-  customClass: 'wsFileTask',
27
-  icon: 'fa fa-list-ul'
28
-}, {
29
-  name: 'issue',
30
-  customClass: 'wsFileIssue',
31
-  icon: 'fa fa-ticket'
32
-}]

src/css/PageHtml.styl → src/plugin/ContentType/PageHtml/PageHtml.styl Wyświetl plik

@@ -1,20 +1,21 @@
1
+@import '../../../css/Variable.styl'
2
+
1 3
 .wsFilePageHtml
2 4
   width 1200px
3 5
   height calc(100% - 85px)
4 6
   overflow-Y auto
5 7
   &__header
6 8
     background-color htmlColor
9
+    &__editionmode
10
+      display none
7 11
     &__icon
8 12
       .fa-file-word-o
9 13
         color white
10 14
   &__contentpage
11
-    display flex
12
-    overflow-Y auto
13 15
     &__textnote
14 16
       margin 10px
15 17
       border-radius 10px
16 18
       padding 25px
17
-      width 55%
18 19
       height 100%
19 20
       background-color off-white
20 21
       &__latestversion
@@ -22,23 +23,13 @@
22 23
         opacity 0.7
23 24
       &__text
24 25
         font-size 14px
25
-    &__wrapper
26
-      border-radius 10px
27
-      width 45%
28
-      height 100%
29
-    &__header
30
-      border-top-left-radius 10px
31
-      border-top-right-radius 10px
32
-      padding 10px 0
33
-      text-align center
34
-      font-size 20px
35
-      color dark-grey
36
-      background-color grey-hover
26
+      &__edition
27
+        display none
37 28
     &__messagelist
38 29
       min-height 300px
39 30
       &__item
40 31
         &__content
41
-          color dark-grey
32
+          color darkGrey
42 33
       &__version
43 34
         margin-top 40px
44 35
         background-color grey-hover
@@ -51,7 +42,7 @@
51 42
           background-color htmlColor
52 43
           & > i
53 44
             margin-right 10px
54
-            color dark-grey
45
+            color darkGrey
55 46
             font-size 22px
56 47
           &:hover
57 48
             background-color darkHtmlColor
@@ -85,7 +76,22 @@
85 76
 
86 77
 .received
87 78
   .wsFilePageHtml__contentpage__messagelist__item__content
88
-      background-color htmlColor
79
+    background-color htmlColor
80
+
81
+.activeEditionTitle
82
+  .wsFilePageHtml
83
+    &__header
84
+      &__editionmode
85
+        display block
86
+      &__title
87
+        display none
88
+
89
+.activeEditionText
90
+  .wsFilePageHtml__contentpage__textnote
91
+    &__edition
92
+      display flex
93
+    &__text
94
+      display none
89 95
 
90 96
 @media (min-width: max-xs) and (max-width: max-lg)
91 97
   .wsFilePageHtml

+ 17 - 0
src/plugin/ContentType/PageHtml/PageHtmlComponent.jsx Wyświetl plik

@@ -0,0 +1,17 @@
1
+import React from 'react'
2
+
3
+const PageHtml = props => {
4
+  return (
5
+    <div className='wsFilePageHtml__contentpage__textnote'>
6
+      <div className='wsFilePageHtml__contentpage__textnote__latestversion' dangerouslySetInnerHTML={{__html: props.version}} />
7
+      <div className='wsFilePageHtml__contentpage__textnote__text' dangerouslySetInnerHTML={{__html: props.text}} />
8
+
9
+      <form className='wsFilePageHtml__contentpage__textnote__edition editionmode'>
10
+        <textarea className='wsFilePageHtml__contentpage__textnote__edition__text editionmode__text' />
11
+        <input type='submit' className='wsFilePageHtml__contentpage__textnote__edition__submit editionmode__submit' value='Valider' />
12
+      </form>
13
+    </div>
14
+  )
15
+}
16
+
17
+export default PageHtml

+ 54 - 0
src/plugin/ContentType/PageHtml/PageHtmlContainer.jsx Wyświetl plik

@@ -0,0 +1,54 @@
1
+import React from 'react'
2
+import { connect } from 'react-redux'
3
+// import PopinFixed from '../../../component/common/PopinFixed/PopinFixed.jsx'
4
+// import PopinFixedHeader from '../../../component/common/PopinFixed/PopinFixedHeader.jsx'
5
+// import PopinFixedOption from '../../../component/common/PopinFixed/PopinFixedOption.jsx'
6
+// import PopinFixedContent from '../../../component/common/PopinFixed/PopinFixedContent.jsx'
7
+import {
8
+  PopinFixed,
9
+  PopinFixedHeader,
10
+  PopinFixedOption,
11
+  PopinFixedContent
12
+} from 'tracim_lib'
13
+import PageHtmlComponent from './PageHtmlComponent.jsx'
14
+import Timeline from '../../../component/Timeline.jsx'
15
+import { hideActiveFileContent } from '../../../action-creator.sync.js'
16
+
17
+require('./PageHtml.styl')
18
+
19
+class PageHtmlContainer extends React.Component {
20
+  handleClickBtnClose = () => this.props.dispatch(hideActiveFileContent())
21
+
22
+  render () {
23
+    const { activeFileContent, plugin: { PageHtml } } = this.props
24
+
25
+    return (
26
+      <PopinFixed customClass={`${PageHtml.customClass}`}>
27
+        <PopinFixedHeader
28
+          customClass={`${PageHtml.customClass}`}
29
+          icon={PageHtml.icon}
30
+          name={activeFileContent.title}
31
+          onClickCloseBtn={this.handleClickBtnClose}
32
+        />
33
+
34
+        <PopinFixedOption customClass={`${PageHtml.customClass}`} />
35
+
36
+        <PopinFixedContent customClass={`${PageHtml.customClass}__contentpage`}>
37
+          <PageHtmlComponent
38
+            version={activeFileContent.version}
39
+            text={activeFileContent.text}
40
+            key={'PageHtml'}
41
+          />
42
+
43
+          <Timeline
44
+            customClass={`${PageHtml.customClass}__contentpage`}
45
+            key={'pageHtml__timeline'}
46
+          />
47
+        </PopinFixedContent>
48
+      </PopinFixed>
49
+    )
50
+  }
51
+}
52
+
53
+const mapStateToProps = ({ activeFileContent, plugin }) => ({ activeFileContent, plugin })
54
+export default connect(mapStateToProps)(PageHtmlContainer)

+ 12 - 0
src/plugin/ContentType/PageHtml/index.js Wyświetl plik

@@ -0,0 +1,12 @@
1
+import reducer from './pageHtml.js'
2
+// import container from './PageHtmlContainer.jsx'
3
+// import component from './PageHtmlComponent.jsx'
4
+
5
+const PageHtml = {
6
+  name: 'PageHtml',
7
+  // container,
8
+  // component,
9
+  reducer
10
+}
11
+
12
+export default PageHtml

+ 15 - 0
src/plugin/ContentType/PageHtml/pageHtml.js Wyświetl plik

@@ -0,0 +1,15 @@
1
+import { PLUGIN_LIST } from '../../../action-creator.sync.js'
2
+
3
+export default function pageHtml (state = {
4
+  title: '',
5
+  version: 0,
6
+  icon: ''
7
+}, action) {
8
+  switch (action.type) {
9
+    case `Set/${PLUGIN_LIST}`:
10
+      return action.pluginList.find(p => p.name === 'PageHtml')
11
+
12
+    default:
13
+      return state
14
+  }
15
+}

src/component/Workspace/FileType/Thread.jsx → src/plugin/ContentType/Thread/Thread.jsx Wyświetl plik


src/css/Thread.styl → src/plugin/ContentType/Thread/Thread.styl Wyświetl plik

@@ -1,8 +1,13 @@
1
-.wsFileThread
1
+.wsContentThread
2 2
   width 550px
3 3
   &__header
4 4
     color white
5 5
     background-color threadColor
6
+    &__editionmode
7
+      display none
8
+    &__icon
9
+      .fa-comments-o
10
+        color white
6 11
   &__wrapper
7 12
     height calc(100% - 209px) /* height of chat__header + height of option + top of chat */
8 13
   &__messagelist
@@ -21,12 +26,20 @@
21 26
         color darkBlue
22 27
 
23 28
 .received
24
-  .wsFileThread__messagelist__item__content
29
+  .wsContentThread__messagelist__item__content
25 30
       background-color darkBlue
26 31
       color white
27 32
 
28
-@media (min-width: max-xs) and (max-width: max-lg)
33
+.activeEditionTitle
29 34
   .wsFileThread
35
+    &__header
36
+      &__editionmode
37
+        display block
38
+      &__title
39
+        display none
40
+
41
+@media (min-width: max-xs) and (max-width: max-lg)
42
+  .wsContentThread
30 43
     &__texteditor
31 44
       padding 7px
32 45
       &__simpletext
@@ -36,11 +49,11 @@
36 49
         width 80px
37 50
 
38 51
 @media (min-width: min-sm) and (max-width: max-sm)
39
-  .wsFileThread
52
+  .wsContentThread
40 53
     top 69px
41 54
 
42 55
 @media (max-width: max-xs)
43
-  .wsFileThread
56
+  .wsContentThread
44 57
     top 69px
45 58
     width 100%
46 59
     box-shadow none

+ 12 - 0
src/plugin/ContentType/Thread/index.js Wyświetl plik

@@ -0,0 +1,12 @@
1
+import reducer from './thread.js'
2
+// import container from './ThreadContainer.jsx'
3
+// import component from './ThreadComponent.jsx'
4
+
5
+const Thread = {
6
+  name: 'Thread',
7
+  // container,
8
+  // component,
9
+  reducer
10
+}
11
+
12
+export default Thread

+ 15 - 0
src/plugin/ContentType/Thread/thread.js Wyświetl plik

@@ -0,0 +1,15 @@
1
+import { PLUGIN_LIST } from '../../../action-creator.sync.js'
2
+
3
+export default function thread (state = {
4
+  title: '',
5
+  version: 0,
6
+  icon: ''
7
+}, action) {
8
+  switch (action.type) {
9
+    case `Set/${PLUGIN_LIST}`:
10
+      return action.pluginList.find(p => p.name === 'Thread')
11
+
12
+    default:
13
+      return state
14
+  }
15
+}

+ 6 - 0
src/plugin/index.js Wyświetl plik

@@ -0,0 +1,6 @@
1
+import pageHtml from '../plugin/ContentType/PageHtml/index.js'
2
+import thread from '../plugin/ContentType/Thread/index.js'
3
+
4
+const pluginDatabase = [pageHtml, thread]
5
+
6
+export default pluginDatabase

+ 0 - 10
src/reducer/fileType/index.js Wyświetl plik

@@ -1,10 +0,0 @@
1
-import { combineReducers } from 'redux'
2
-
3
-// import color from './color.js'
4
-// import size from './size.js'
5
-// import price from './price.js'
6
-// import multicolor from './multicolor.js'
7
-
8
-export default combineReducers({
9
-
10
-})

+ 0 - 10
src/reducer/fileType/pageHtml.js Wyświetl plik

@@ -1,10 +0,0 @@
1
-export default function pageHtml (state = {
2
-  title: '',
3
-  version: 0,
4
-  text: ''
5
-}, action) {
6
-  switch (action.type) {
7
-    default:
8
-      return state
9
-  }
10
-}

+ 9 - 0
src/reducer/plugin.js Wyświetl plik

@@ -0,0 +1,9 @@
1
+import { combineReducers } from 'redux'
2
+import pluginDatabase from '../plugin/index.js'
3
+
4
+const reducerList = {}
5
+pluginDatabase.forEach(p => (reducerList[p.name] = p.reducer))
6
+
7
+export default combineReducers({
8
+  ...reducerList
9
+})

+ 2 - 1
src/reducer/root.js Wyświetl plik

@@ -2,7 +2,8 @@ import { combineReducers } from 'redux'
2 2
 import user from './user.js'
3 3
 import workspace from './workspace.js'
4 4
 import activeFileContent from './activeFileContent.js'
5
+import plugin from './plugin.js'
5 6
 
6
-const rootReducer = combineReducers({ user, workspace, activeFileContent })
7
+const rootReducer = combineReducers({ user, workspace, activeFileContent, plugin })
7 8
 
8 9
 export default rootReducer

+ 1 - 1
webpack.config.js Wyświetl plik

@@ -76,7 +76,7 @@ module.exports = {
76 76
     }]
77 77
   },
78 78
   resolve: {
79
-    extensions: ['.js', '.jsx']
79
+    extensions: ['.js', '.jsx', '.styl']
80 80
   },
81 81
   plugins:[
82 82
     ...[ // generic plugins always present