Browse Source

[https://github.com/tracim/tracim/issues/787] added link to admin pages in top right user dropdown

Skylsmoi 5 years ago
parent
commit
6b5207af88

+ 19 - 2
frontend/src/component/Header/MenuActionListItem/MenuProfil.jsx View File

@@ -1,7 +1,7 @@
1 1
 import React from 'react'
2 2
 import { Link } from 'react-router-dom'
3 3
 import PropTypes from 'prop-types'
4
-import { PAGE } from '../../../helper.js'
4
+import { PAGE, PROFILE } from '../../../helper.js'
5 5
 import { translate } from 'react-i18next'
6 6
 
7 7
 const MenuProfil = props => {
@@ -11,15 +11,32 @@ const MenuProfil = props => {
11 11
         <div className='profilgroup dropdown'>
12 12
           <button className='profilgroup__name btn btn-outline-primary dropdown-toggle' type='button' id='dropdownMenuButton' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
13 13
             <img className='profilgroup__name__imgprofil' src={props.user.avatar_url} />
14
+
14 15
             <div className='profilgroup__name__text'>
15
-              {props.user.name}
16
+              {props.user.public_name}
16 17
             </div>
17 18
           </button>
19
+
18 20
           <div className='profilgroup__setting dropdown-menu' aria-labelledby='dropdownMenuButton'>
21
+            {props.user.profile === PROFILE.ADMINISTRATOR &&
22
+              <Link className='setting__link dropdown-item' to={PAGE.ADMIN.WORKSPACE}>
23
+                <i className='fa fa-fw fa-space-shuttle mr-2' />
24
+                {props.t('Admin workspace')}
25
+              </Link>
26
+            }
27
+
28
+            {props.user.profile === PROFILE.ADMINISTRATOR &&
29
+              <Link className='setting__link dropdown-item' to={PAGE.ADMIN.USER}>
30
+                <i className='fa fa-fw fa-users mr-2' />
31
+                {props.t('Admin user')}
32
+              </Link>
33
+            }
34
+
19 35
             <Link className='setting__link dropdown-item' to={PAGE.ACCOUNT}>
20 36
               <i className='fa fa-fw fa-user-o mr-2' />
21 37
               {props.t('My Account')}
22 38
             </Link>
39
+
23 40
             {/* <div className='setting__link dropdown-item'>Mot de passe</div> */}
24 41
             <div className='setting__link dropdown-item' onClick={props.onClickLogout}>
25 42
               <i className='fa fa-fw fa-sign-out mr-2' />

+ 158 - 163
frontend/src/container/AdminWorkspacePage.jsx View File

@@ -1,5 +1,4 @@
1 1
 import React from 'react'
2
-import Sidebar from './Sidebar.jsx'
3 2
 import {
4 3
   Delimiter,
5 4
   PageWrapper,
@@ -11,188 +10,184 @@ import { translate } from 'react-i18next'
11 10
 class AdminWorkspacePage extends React.Component {
12 11
   render () {
13 12
     return (
14
-      <div className='sidebarpagecontainer'>
15
-        <Sidebar />
13
+      <PageWrapper customClass='adminWorkspacePage'>
14
+        <PageTitle
15
+          parentClass={'adminWorkspacePage'}
16
+          title={'Workspace management'}
17
+        />
16 18
 
17
-        <PageWrapper customClass='adminWorkspacePage'>
18
-          <PageTitle
19
-            parentClass={'adminWorkspacePage'}
20
-            title={'Workspace management'}
21
-          />
19
+        <PageContent parentClass='adminWorkspacePage'>
22 20
 
23
-          <PageContent parentClass='adminWorkspacePage'>
21
+          <div className='adminWorkspacePage__description'>
22
+            This page informs all workspaces of the instances
23
+          </div>
24 24
 
25
-            <div className='adminWorkspacePage__description'>
26
-              This page informs all workspaces of the instances
27
-            </div>
28
-
29
-            { /*
30
-              Alexi Cauvin 08/08/2018 => desactivate create workspace button due to redundancy
25
+          { /*
26
+            Alexi Cauvin 08/08/2018 => desactivate create workspace button due to redundancy
31 27
 
32
-              <div className='adminWorkspacePage__createworkspace'>
33
-                <button className='adminWorkspacePage__createworkspace__btncreate btn btn-primary primaryColorBg primaryColorBorder primaryColorBorderDarkenHover'>
34
-                  {this.props.t('Create a workspace')}
35
-                </button>
36
-              </div>
37
-            */ }
28
+            <div className='adminWorkspacePage__createworkspace'>
29
+              <button className='adminWorkspacePage__createworkspace__btncreate btn btn-primary primaryColorBg primaryColorBorder primaryColorBorderDarkenHover'>
30
+                {this.props.t('Create a workspace')}
31
+              </button>
32
+            </div>
33
+          */ }
38 34
 
39
-            <Delimiter customClass={'adminWorkspacePage__delimiter'} />
35
+          <Delimiter customClass={'adminWorkspacePage__delimiter'} />
40 36
 
41
-            <div className='adminWorkspacePage__workspaceTable'>
37
+          <div className='adminWorkspacePage__workspaceTable'>
42 38
 
43
-              <table className='table'>
44
-                <thead>
45
-                  <tr>
46
-                    <th scope='col'>ID</th>
47
-                    <th scope='col'>Workspace</th>
48
-                    <th scope='col'>Description</th>
49
-                    <th scope='col'>Member's number</th>
50
-                    { /*
51
-                      <th scope='col'>Calendar</th>
52
-                    */ }
53
-                    <th scope='col'>Delete workspace</th>
54
-                  </tr>
55
-                </thead>
56
-                <tbody>
57
-                  <tr>
58
-                    <th>1</th>
59
-                    <td>Design v_2</td>
60
-                    <td>Workspace about tracim v2 design</td>
61
-                    { /*
62
-                      <td className='d-flex align-items-center flex-wrap'>
63
-                        <div className='adminWorkspacePage__workspaceTable__calendaricon mr-2'>
64
-                          <i className='fa fa-fw fa-check-square-o' />
65
-                        </div>
66
-                        Enable
67
-                      </td>
68
-                    */ }
69
-                    <td>8</td>
70
-                    <td>
71
-                      <div className='adminWorkspacePage__workspaceTable__deleteworkspace primaryColorFont primaryColorFontDarkenHover'>
72
-                        <div className='adminWorkspacePage__workspaceTable__deleteworkspace__removalicon mr-3'>
73
-                          <i className='fa fa-fw fa-trash-o' />
74
-                        </div>
75
-                        Delete
39
+            <table className='table'>
40
+              <thead>
41
+                <tr>
42
+                  <th scope='col'>ID</th>
43
+                  <th scope='col'>Workspace</th>
44
+                  <th scope='col'>Description</th>
45
+                  <th scope='col'>Member's number</th>
46
+                  { /*
47
+                    <th scope='col'>Calendar</th>
48
+                  */ }
49
+                  <th scope='col'>Delete workspace</th>
50
+                </tr>
51
+              </thead>
52
+              <tbody>
53
+                <tr>
54
+                  <th>1</th>
55
+                  <td>Design v_2</td>
56
+                  <td>Workspace about tracim v2 design</td>
57
+                  { /*
58
+                    <td className='d-flex align-items-center flex-wrap'>
59
+                      <div className='adminWorkspacePage__workspaceTable__calendaricon mr-2'>
60
+                        <i className='fa fa-fw fa-check-square-o' />
76 61
                       </div>
62
+                      Enable
77 63
                     </td>
78
-                  </tr>
79
-                  <tr>
80
-                    <th>2</th>
81
-                    <td>New features</td>
82
-                    <td>Add a new features : Annotated files</td>
83
-                    { /*
84
-                      <td className='d-flex align-items-center flex-wrap'>
85
-                        <div className='adminWorkspacePage__workspaceTable__calendaricon mr-2'>
86
-                          <i className='fa fa-fw fa-square-o' />
87
-                        </div>
88
-                        Disable
89
-                      </td>
90
-                    */ }
91
-                    <td>5</td>
92
-                    <td>
93
-                      <div className='adminWorkspacePage__workspaceTable__deleteworkspace primaryColorFont primaryColorFontDarkenHover'>
94
-                        <div className='adminWorkspacePage__workspaceTable__deleteworkspace__removalicon mr-3'>
95
-                          <i className='fa fa-fw fa-trash-o' />
96
-                        </div>
97
-                        Delete
64
+                  */ }
65
+                  <td>8</td>
66
+                  <td>
67
+                    <div className='adminWorkspacePage__workspaceTable__deleteworkspace primaryColorFont primaryColorFontDarkenHover'>
68
+                      <div className='adminWorkspacePage__workspaceTable__deleteworkspace__removalicon mr-3'>
69
+                        <i className='fa fa-fw fa-trash-o' />
98 70
                       </div>
71
+                      Delete
72
+                    </div>
73
+                  </td>
74
+                </tr>
75
+                <tr>
76
+                  <th>2</th>
77
+                  <td>New features</td>
78
+                  <td>Add a new features : Annotated files</td>
79
+                  { /*
80
+                    <td className='d-flex align-items-center flex-wrap'>
81
+                      <div className='adminWorkspacePage__workspaceTable__calendaricon mr-2'>
82
+                        <i className='fa fa-fw fa-square-o' />
83
+                      </div>
84
+                      Disable
99 85
                     </td>
100
-                  </tr>
101
-                  <tr>
102
-                    <th>3</th>
103
-                    <td>Fix Backend</td>
104
-                    <td>workspace referring to multiple issues on the backend </td>
105
-                    { /*
106
-                      <td className='d-flex align-items-center flex-wrap'>
107
-                        <div className='adminWorkspacePage__workspaceTable__calendaricon mr-2'>
108
-                          <i className='fa fa-fw fa-check-square-o' />
109
-                        </div>
110
-                        Enable
111
-                      </td>
112
-                    */ }
113
-                    <td>3</td>
114
-                    <td>
115
-                      <div className='adminWorkspacePage__workspaceTable__deleteworkspace primaryColorFont primaryColorFontDarkenHover'>
116
-                        <div className='adminWorkspacePage__workspaceTable__deleteworkspace__removalicon mr-3'>
117
-                          <i className='fa fa-fw fa-trash-o' />
118
-                        </div>
119
-                        Delete
86
+                  */ }
87
+                  <td>5</td>
88
+                  <td>
89
+                    <div className='adminWorkspacePage__workspaceTable__deleteworkspace primaryColorFont primaryColorFontDarkenHover'>
90
+                      <div className='adminWorkspacePage__workspaceTable__deleteworkspace__removalicon mr-3'>
91
+                        <i className='fa fa-fw fa-trash-o' />
92
+                      </div>
93
+                      Delete
94
+                    </div>
95
+                  </td>
96
+                </tr>
97
+                <tr>
98
+                  <th>3</th>
99
+                  <td>Fix Backend</td>
100
+                  <td>workspace referring to multiple issues on the backend </td>
101
+                  { /*
102
+                    <td className='d-flex align-items-center flex-wrap'>
103
+                      <div className='adminWorkspacePage__workspaceTable__calendaricon mr-2'>
104
+                        <i className='fa fa-fw fa-check-square-o' />
120 105
                       </div>
106
+                      Enable
121 107
                     </td>
122
-                  </tr>
123
-                  <tr>
124
-                    <th>4</th>
125
-                    <td>Design v_2</td>
126
-                    <td>Workspace about tracim v2 design</td>
127
-                    { /*
128
-                      <td className='d-flex align-items-center flex-wrap'>
129
-                        <div className='adminWorkspacePage__workspaceTable__calendaricon mr-2'>
130
-                          <i className='fa fa-fw fa-square-o' />
131
-                        </div>
132
-                        Disable
133
-                      </td>
134
-                    */ }
135
-                    <td>8</td>
136
-                    <td>
137
-                      <div className='adminWorkspacePage__workspaceTable__deleteworkspace primaryColorFont primaryColorFontDarkenHover'>
138
-                        <div className='adminWorkspacePage__workspaceTable__deleteworkspace__removalicon mr-3'>
139
-                          <i className='fa fa-fw fa-trash-o' />
140
-                        </div>
141
-                        Delete
108
+                  */ }
109
+                  <td>3</td>
110
+                  <td>
111
+                    <div className='adminWorkspacePage__workspaceTable__deleteworkspace primaryColorFont primaryColorFontDarkenHover'>
112
+                      <div className='adminWorkspacePage__workspaceTable__deleteworkspace__removalicon mr-3'>
113
+                        <i className='fa fa-fw fa-trash-o' />
142 114
                       </div>
115
+                      Delete
116
+                    </div>
117
+                  </td>
118
+                </tr>
119
+                <tr>
120
+                  <th>4</th>
121
+                  <td>Design v_2</td>
122
+                  <td>Workspace about tracim v2 design</td>
123
+                  { /*
124
+                    <td className='d-flex align-items-center flex-wrap'>
125
+                      <div className='adminWorkspacePage__workspaceTable__calendaricon mr-2'>
126
+                        <i className='fa fa-fw fa-square-o' />
127
+                      </div>
128
+                      Disable
143 129
                     </td>
144
-                  </tr>
145
-                  <tr>
146
-                    <th>5</th>
147
-                    <td>New features</td>
148
-                    <td>Add a new features : Annotated files</td>
149
-                    { /*
150
-                      <td className='d-flex align-items-center flex-wrap'>
151
-                        <div className='adminWorkspacePage__workspaceTable__calendaricon mr-2'>
152
-                          <i className='fa fa-fw fa-square-o' />
153
-                        </div>
154
-                        Disable
155
-                      </td>
156
-                    */ }
157
-                    <td>5</td>
158
-                    <td>
159
-                      <div className='adminWorkspacePage__workspaceTable__deleteworkspace primaryColorFont primaryColorFontDarkenHover'>
160
-                        <div className='adminWorkspacePage__workspaceTable__deleteworkspace__removalicon mr-3'>
161
-                          <i className='fa fa-fw fa-trash-o' />
162
-                        </div>
163
-                        Delete
130
+                  */ }
131
+                  <td>8</td>
132
+                  <td>
133
+                    <div className='adminWorkspacePage__workspaceTable__deleteworkspace primaryColorFont primaryColorFontDarkenHover'>
134
+                      <div className='adminWorkspacePage__workspaceTable__deleteworkspace__removalicon mr-3'>
135
+                        <i className='fa fa-fw fa-trash-o' />
136
+                      </div>
137
+                      Delete
138
+                    </div>
139
+                  </td>
140
+                </tr>
141
+                <tr>
142
+                  <th>5</th>
143
+                  <td>New features</td>
144
+                  <td>Add a new features : Annotated files</td>
145
+                  { /*
146
+                    <td className='d-flex align-items-center flex-wrap'>
147
+                      <div className='adminWorkspacePage__workspaceTable__calendaricon mr-2'>
148
+                        <i className='fa fa-fw fa-square-o' />
164 149
                       </div>
150
+                      Disable
165 151
                     </td>
166
-                  </tr>
167
-                  <tr>
168
-                    <th>6</th>
169
-                    <td>Fix Backend</td>
170
-                    <td>workspace referring to multiple issues on the backend </td>
171
-                    { /*
172
-                      <td className='d-flex align-items-center flex-wrap'>
173
-                        <div className='adminWorkspacePage__workspaceTable__calendaricon mr-2'>
174
-                          <i className='fa fa-fw fa-check-square-o' />
175
-                        </div>
176
-                        Enable
177
-                      </td>
178
-                    */ }
179
-                    <td>3</td>
180
-                    <td>
181
-                      <div className='adminWorkspacePage__workspaceTable__deleteworkspace primaryColorFont primaryColorFontDarkenHover'>
182
-                        <div className='adminWorkspacePage__workspaceTable__deleteworkspace__removalicon mr-3'>
183
-                          <i className='fa fa-fw fa-trash-o' />
184
-                        </div>
185
-                        Delete
152
+                  */ }
153
+                  <td>5</td>
154
+                  <td>
155
+                    <div className='adminWorkspacePage__workspaceTable__deleteworkspace primaryColorFont primaryColorFontDarkenHover'>
156
+                      <div className='adminWorkspacePage__workspaceTable__deleteworkspace__removalicon mr-3'>
157
+                        <i className='fa fa-fw fa-trash-o' />
158
+                      </div>
159
+                      Delete
160
+                    </div>
161
+                  </td>
162
+                </tr>
163
+                <tr>
164
+                  <th>6</th>
165
+                  <td>Fix Backend</td>
166
+                  <td>workspace referring to multiple issues on the backend </td>
167
+                  { /*
168
+                    <td className='d-flex align-items-center flex-wrap'>
169
+                      <div className='adminWorkspacePage__workspaceTable__calendaricon mr-2'>
170
+                        <i className='fa fa-fw fa-check-square-o' />
186 171
                       </div>
172
+                      Enable
187 173
                     </td>
188
-                  </tr>
189
-                </tbody>
190
-              </table>
191
-            </div>
174
+                  */ }
175
+                  <td>3</td>
176
+                  <td>
177
+                    <div className='adminWorkspacePage__workspaceTable__deleteworkspace primaryColorFont primaryColorFontDarkenHover'>
178
+                      <div className='adminWorkspacePage__workspaceTable__deleteworkspace__removalicon mr-3'>
179
+                        <i className='fa fa-fw fa-trash-o' />
180
+                      </div>
181
+                      Delete
182
+                    </div>
183
+                  </td>
184
+                </tr>
185
+              </tbody>
186
+            </table>
187
+          </div>
192 188
 
193
-          </PageContent>
194
-        </PageWrapper>
195
-      </div>
189
+        </PageContent>
190
+      </PageWrapper>
196 191
     )
197 192
   }
198 193
 }

frontend/src/container/AppFullscreenManager.jsx → frontend/src/container/AppFullscreenRouter.jsx View File

@@ -1,11 +1,11 @@
1 1
 import React from 'react'
2 2
 import { connect } from 'react-redux'
3 3
 import { withRouter } from 'react-router'
4
-import { Route } from 'react-router-dom'
5
-import { PAGE } from '../helper.js'
4
+import { Route, Redirect } from 'react-router-dom'
5
+import { PAGE, PROFILE } from '../helper.js'
6 6
 import appFactory from '../appFactory.js'
7 7
 
8
-class AppFullscreenManager extends React.Component {
8
+class AppFullscreenRouter extends React.Component {
9 9
   constructor (props) {
10 10
     super(props)
11 11
     this.state = {
@@ -23,13 +23,17 @@ class AppFullscreenManager extends React.Component {
23 23
         <div id='appFullscreenContainer' />
24 24
 
25 25
         {this.state.isMounted && (// we must wait for the component to be fully mounted to be sure the div#appFullscreenContainer exists in DOM
26
-          <div className='emptyDiForRoute'>
26
+          <div className='emptyDivForRoute'>
27 27
             <Route path={PAGE.ADMIN.WORKSPACE} render={() => {
28
+              if (props.user.profile !== PROFILE.ADMINISTRATOR) return <Redirect to={{pathname: '/'}} />
29
+
28 30
               props.renderAppFullscreen({slug: 'admin_workspace_user', hexcolor: '#7d4e24', type: 'workspace'}, props.user, {})
29 31
               return null
30 32
             }} />
31 33
 
32 34
             <Route path={PAGE.ADMIN.USER} render={() => {
35
+              if (props.user.profile !== PROFILE.ADMINISTRATOR) return <Redirect to={{pathname: '/'}} />
36
+
33 37
               props.renderAppFullscreen({slug: 'admin_workspace_user', hexcolor: '#7d4e24', type: 'user'}, props.user, {})
34 38
               return null
35 39
             }} />
@@ -41,4 +45,4 @@ class AppFullscreenManager extends React.Component {
41 45
 }
42 46
 
43 47
 const mapStateToProps = ({ user }) => ({ user })
44
-export default connect(mapStateToProps)(withRouter(appFactory(AppFullscreenManager)))
48
+export default withRouter(connect(mapStateToProps)(appFactory(AppFullscreenRouter)))

+ 3 - 5
frontend/src/container/Tracim.jsx View File

@@ -5,8 +5,7 @@ import Sidebar from './Sidebar.jsx'
5 5
 import Header from './Header.jsx'
6 6
 import Login from './Login.jsx'
7 7
 import Account from './Account.jsx'
8
-import AdminWorkspacePage from './AdminWorkspacePage.jsx'
9
-import AppFullscreenManager from './AppFullscreenManager.jsx'
8
+import AppFullscreenRouter from './AppFullscreenRouter.jsx'
10 9
 import FlashMessage from '../component/FlashMessage.jsx'
11 10
 import WorkspaceContent from './WorkspaceContent.jsx'
12 11
 import WIPcomponent from './WIPcomponent.jsx'
@@ -130,12 +129,11 @@ class Tracim extends React.Component {
130 129
           <Route path={PAGE.ADMIN.ROOT} render={() =>
131 130
             <div className='sidebarpagecontainer'>
132 131
               <Sidebar />
133
-              <AppFullscreenManager />
132
+
133
+              <AppFullscreenRouter />
134 134
             </div>
135 135
           } />
136 136
 
137
-          <Route path='/admin_temp/workspace' component={AdminWorkspacePage} />
138
-
139 137
           <Route path={'/wip/:cp'} component={WIPcomponent} /> {/* for testing purpose only */}
140 138
 
141 139
           <div id='appFeatureContainer' />

+ 0 - 21
frontend/src/css/AdminWorkspacePage.styl View File

@@ -1,21 +0,0 @@
1
-.table th
2
-  vertical-align middle
3
-
4
-.adminWorkspacePage
5
-  &__createworkspace
6
-    &__btncreate
7
-      margin 25px 15px
8
-  &__description
9
-    margin 25px 0
10
-    font-size 20px
11
-  &__delimiter
12
-    margin 65px auto
13
-  &__workspaceTable
14
-    margin 25px 15px
15
-    &__deleteworkspace
16
-      display flex
17
-      align-items center
18
-      flex-wrap wrap
19
-      cursor pointer
20
-
21
-

+ 0 - 2
frontend/src/css/index.styl View File

@@ -30,5 +30,3 @@ html, body, #content
30 30
 @import 'HomepageCard'
31 31
 
32 32
 @import 'ExtandedAction'
33
-
34
-@import 'AdminWorkspacePage'

+ 6 - 1
frontend/src/helper.js View File

@@ -37,7 +37,7 @@ export const PAGE = {
37 37
   ADMIN: {
38 38
     ROOT: '/admin',
39 39
     WORKSPACE: '/admin/workspace',
40
-    USEr: '/admin/user'
40
+    USER: '/admin/user'
41 41
   }
42 42
 }
43 43
 
@@ -67,4 +67,9 @@ export const ROLE = [{
67 67
   label: 'Workspace manager'
68 68
 }]
69 69
 
70
+export const PROFILE = {
71
+  ADMINISTRATOR: 'administrators',
72
+  USER: 'users'
73
+}
74
+
70 75
 export const handleRouteFromApi = route => route.startsWith('/#') ? route.slice(2) : route

+ 194 - 0
frontend_app_admin_workspace_user/src/component/AdminWorkspace.jsx View File

@@ -0,0 +1,194 @@
1
+import React from 'react'
2
+import {
3
+  Delimiter,
4
+  PageWrapper,
5
+  PageTitle,
6
+  PageContent
7
+} from 'tracim_frontend_lib'
8
+
9
+export class AdminWorkspace extends React.Component {
10
+  render () {
11
+    return (
12
+      <PageWrapper customClass='adminWorkspacePage'>
13
+        <PageTitle
14
+          parentClass={'adminWorkspacePage'}
15
+          title={'Workspace management'}
16
+        />
17
+
18
+        <PageContent parentClass='adminWorkspacePage'>
19
+
20
+          <div className='adminWorkspacePage__description'>
21
+            List of every workspaces
22
+          </div>
23
+
24
+          { /*
25
+            Alexi Cauvin 08/08/2018 => desactivate create workspace button due to redundancy
26
+
27
+            <div className='adminWorkspacePage__createworkspace'>
28
+              <button className='adminWorkspacePage__createworkspace__btncreate btn btn-primary primaryColorBg primaryColorBorder primaryColorBorderDarkenHover'>
29
+                {this.props.t('Create a workspace')}
30
+              </button>
31
+            </div>
32
+          */ }
33
+
34
+          <Delimiter customClass={'adminWorkspacePage__delimiter'} />
35
+
36
+          <div className='adminWorkspacePage__workspaceTable'>
37
+
38
+            <table className='table'>
39
+              <thead>
40
+                <tr>
41
+                  <th scope='col'>ID</th>
42
+                  <th scope='col'>Workspace</th>
43
+                  <th scope='col'>Description</th>
44
+                  <th scope='col'>Member count</th>
45
+                  { /*
46
+                      <th scope='col'>Calendar</th>
47
+                    */ }
48
+                  <th scope='col'>Delete workspace</th>
49
+                </tr>
50
+              </thead>
51
+              <tbody>
52
+                <tr>
53
+                  <th>1</th>
54
+                  <td>Design v_2</td>
55
+                  <td>Workspace about tracim v2 design</td>
56
+                  { /*
57
+                      <td className='d-flex align-items-center flex-wrap'>
58
+                        <div className='adminWorkspacePage__workspaceTable__calendaricon mr-2'>
59
+                          <i className='fa fa-fw fa-check-square-o' />
60
+                        </div>
61
+                        Enable
62
+                      </td>
63
+                    */ }
64
+                  <td>8</td>
65
+                  <td>
66
+                    <div className='adminWorkspacePage__workspaceTable__deleteworkspace primaryColorFont primaryColorFontDarkenHover'>
67
+                      <div className='adminWorkspacePage__workspaceTable__deleteworkspace__removalicon mr-3'>
68
+                        <i className='fa fa-fw fa-trash-o' />
69
+                      </div>
70
+                      Delete
71
+                    </div>
72
+                  </td>
73
+                </tr>
74
+                <tr>
75
+                  <th>2</th>
76
+                  <td>New features</td>
77
+                  <td>Add a new features : Annotated files</td>
78
+                  { /*
79
+                      <td className='d-flex align-items-center flex-wrap'>
80
+                        <div className='adminWorkspacePage__workspaceTable__calendaricon mr-2'>
81
+                          <i className='fa fa-fw fa-square-o' />
82
+                        </div>
83
+                        Disable
84
+                      </td>
85
+                    */ }
86
+                  <td>5</td>
87
+                  <td>
88
+                    <div className='adminWorkspacePage__workspaceTable__deleteworkspace primaryColorFont primaryColorFontDarkenHover'>
89
+                      <div className='adminWorkspacePage__workspaceTable__deleteworkspace__removalicon mr-3'>
90
+                        <i className='fa fa-fw fa-trash-o' />
91
+                      </div>
92
+                      Delete
93
+                    </div>
94
+                  </td>
95
+                </tr>
96
+                <tr>
97
+                  <th>3</th>
98
+                  <td>Fix Backend</td>
99
+                  <td>workspace referring to multiple issues on the backend </td>
100
+                  { /*
101
+                      <td className='d-flex align-items-center flex-wrap'>
102
+                        <div className='adminWorkspacePage__workspaceTable__calendaricon mr-2'>
103
+                          <i className='fa fa-fw fa-check-square-o' />
104
+                        </div>
105
+                        Enable
106
+                      </td>
107
+                    */ }
108
+                  <td>3</td>
109
+                  <td>
110
+                    <div className='adminWorkspacePage__workspaceTable__deleteworkspace primaryColorFont primaryColorFontDarkenHover'>
111
+                      <div className='adminWorkspacePage__workspaceTable__deleteworkspace__removalicon mr-3'>
112
+                        <i className='fa fa-fw fa-trash-o' />
113
+                      </div>
114
+                      Delete
115
+                    </div>
116
+                  </td>
117
+                </tr>
118
+                <tr>
119
+                  <th>4</th>
120
+                  <td>Design v_2</td>
121
+                  <td>Workspace about tracim v2 design</td>
122
+                  { /*
123
+                      <td className='d-flex align-items-center flex-wrap'>
124
+                        <div className='adminWorkspacePage__workspaceTable__calendaricon mr-2'>
125
+                          <i className='fa fa-fw fa-square-o' />
126
+                        </div>
127
+                        Disable
128
+                      </td>
129
+                    */ }
130
+                  <td>8</td>
131
+                  <td>
132
+                    <div className='adminWorkspacePage__workspaceTable__deleteworkspace primaryColorFont primaryColorFontDarkenHover'>
133
+                      <div className='adminWorkspacePage__workspaceTable__deleteworkspace__removalicon mr-3'>
134
+                        <i className='fa fa-fw fa-trash-o' />
135
+                      </div>
136
+                      Delete
137
+                    </div>
138
+                  </td>
139
+                </tr>
140
+                <tr>
141
+                  <th>5</th>
142
+                  <td>New features</td>
143
+                  <td>Add a new features : Annotated files</td>
144
+                  { /*
145
+                      <td className='d-flex align-items-center flex-wrap'>
146
+                        <div className='adminWorkspacePage__workspaceTable__calendaricon mr-2'>
147
+                          <i className='fa fa-fw fa-square-o' />
148
+                        </div>
149
+                        Disable
150
+                      </td>
151
+                    */ }
152
+                  <td>5</td>
153
+                  <td>
154
+                    <div className='adminWorkspacePage__workspaceTable__deleteworkspace primaryColorFont primaryColorFontDarkenHover'>
155
+                      <div className='adminWorkspacePage__workspaceTable__deleteworkspace__removalicon mr-3'>
156
+                        <i className='fa fa-fw fa-trash-o' />
157
+                      </div>
158
+                      Delete
159
+                    </div>
160
+                  </td>
161
+                </tr>
162
+                <tr>
163
+                  <th>6</th>
164
+                  <td>Fix Backend</td>
165
+                  <td>workspace referring to multiple issues on the backend </td>
166
+                  { /*
167
+                      <td className='d-flex align-items-center flex-wrap'>
168
+                        <div className='adminWorkspacePage__workspaceTable__calendaricon mr-2'>
169
+                          <i className='fa fa-fw fa-check-square-o' />
170
+                        </div>
171
+                        Enable
172
+                      </td>
173
+                    */ }
174
+                  <td>3</td>
175
+                  <td>
176
+                    <div className='adminWorkspacePage__workspaceTable__deleteworkspace primaryColorFont primaryColorFontDarkenHover'>
177
+                      <div className='adminWorkspacePage__workspaceTable__deleteworkspace__removalicon mr-3'>
178
+                        <i className='fa fa-fw fa-trash-o' />
179
+                      </div>
180
+                      Delete
181
+                    </div>
182
+                  </td>
183
+                </tr>
184
+              </tbody>
185
+            </table>
186
+          </div>
187
+
188
+        </PageContent>
189
+      </PageWrapper>
190
+    )
191
+  }
192
+}
193
+
194
+export default AdminWorkspace

+ 17 - 17
frontend_app_admin_workspace_user/src/container/AdminWorkspaceUser.jsx View File

@@ -2,15 +2,15 @@ import React from 'react'
2 2
 import { translate } from 'react-i18next'
3 3
 import i18n from '../i18n.js'
4 4
 import {
5
-  addAllResourceI18n,
6
-  // handleFetchResult,
7
-  PageWrapper,
8
-  PageTitle,
9
-  PageContent
5
+  addAllResourceI18n
6
+  // handleFetchResult
10 7
 } from 'tracim_frontend_lib'
11 8
 import { debug } from '../helper.js'
12 9
 import {
13 10
 } from '../action.async.js'
11
+import AdminWorkspace from '../component/AdminWorkspace.jsx'
12
+
13
+require('../css/index.styl')
14 14
 
15 15
 class AdminWorkspaceUser extends React.Component {
16 16
   constructor (props) {
@@ -32,7 +32,10 @@ class AdminWorkspaceUser extends React.Component {
32 32
 
33 33
   customEventReducer = ({ detail: { type, data } }) => { // action: { type: '', data: {} }
34 34
     switch (type) {
35
-      // console.log('%c<AdminWorkspaceUser> Custom event', 'color: #28a745', type, data)
35
+      case 'admin_workspace_user_showApp':
36
+        console.log('%c<AdminWorkspaceUser> Custom event', 'color: #28a745', type, data)
37
+        this.setState({config: data.config})
38
+        break
36 39
       default:
37 40
         break
38 41
     }
@@ -48,6 +51,7 @@ class AdminWorkspaceUser extends React.Component {
48 51
     const { state } = this
49 52
 
50 53
     console.log('%c<AdminWorkspaceUser> did update', `color: ${this.state.config.hexcolor}`, prevState, state)
54
+    if (prevState.config.type !== state.config.type) this.loadContent()
51 55
   }
52 56
 
53 57
   componentWillUnmount () {
@@ -67,17 +71,13 @@ class AdminWorkspaceUser extends React.Component {
67 71
 
68 72
     return (
69 73
       <div>
70
-        <PageWrapper customeClass='admin'>
71
-          <PageTitle
72
-            parentClass='admin__header'
73
-            customClass='justify-content-between'
74
-            title={'Admin'}
75
-          />
76
-
77
-          <PageContent parentClass='workspace__content'>
78
-            woot { this.state.config.type }
79
-          </PageContent>
80
-        </PageWrapper>
74
+        {this.state.config.type === 'workspace' &&
75
+          <AdminWorkspace />
76
+        }
77
+
78
+        {this.state.config.type === 'user' &&
79
+          <div>not yet implemented</div>
80
+        }
81 81
       </div>
82 82
     )
83 83
   }

+ 20 - 0
frontend_app_admin_workspace_user/src/css/index.styl View File

@@ -1 +1,21 @@
1 1
 @import "../../node_modules/tracim_frontend_lib/src/css/Variable.styl"
2
+
3
+.table th
4
+  vertical-align middle
5
+
6
+.adminWorkspacePage
7
+  &__createworkspace
8
+    &__btncreate
9
+      margin 25px 15px
10
+  &__description
11
+    margin 25px 0
12
+    font-size 20px
13
+  &__delimiter
14
+    margin 65px auto
15
+  &__workspaceTable
16
+    margin 25px 15px
17
+    &__deleteworkspace
18
+      display flex
19
+      align-items center
20
+      flex-wrap wrap
21
+      cursor pointer