@@ -11,35 +11,17 @@ import MenuTitle from '../../widgets/Sidebar/MenuTitle';
11
11
import MenuItem from '../../widgets/Sidebar/MenuItem' ;
12
12
import { LoadingIcon } from '../../icons' ;
13
13
import { getJsData } from '../../../redux/helpers/resourceManager' ;
14
- import { isSupervisorRole , isEmpoweredSupervisorRole , isSuperadminRole } from '../../helpers/usersRoles.js' ;
14
+ import { isSupervisorRole , isSuperadminRole } from '../../helpers/usersRoles.js' ;
15
15
import withLinks from '../../../helpers/withLinks.js' ;
16
- import { getExternalIdForCAS } from '../../../helpers/cas.js' ;
17
16
import { getConfigVar } from '../../../helpers/config.js' ;
18
- import Admin from './Admin.js' ;
19
17
20
18
import './sidebar.css' ;
21
19
22
20
const URL_PREFIX = getConfigVar ( 'URL_PATH_PREFIX' ) ;
23
21
24
22
const getUserData = lruMemoize ( user => getJsData ( user ) ) ;
25
23
26
- const Sidebar = ( {
27
- pendingFetchOperations,
28
- loggedInUser,
29
- effectiveRole = null ,
30
- currentUrl,
31
- links : {
32
- HOME_URI ,
33
- FAQ_URL ,
34
- LOGIN_URI ,
35
- REGISTRATION_URI ,
36
- DASHBOARD_URI ,
37
- EXERCISES_URI ,
38
- PIPELINES_URI ,
39
- ARCHIVE_URI ,
40
- SIS_INTEGRATION_URI ,
41
- } ,
42
- } ) => {
24
+ const Sidebar = ( { pendingFetchOperations, loggedInUser, currentUrl, links : { HOME_URI } } ) => {
43
25
const user = getUserData ( loggedInUser ) ;
44
26
45
27
return (
@@ -84,14 +66,7 @@ const Sidebar = ({
84
66
title = { < FormattedMessage id = "app.sidebar.menu.signIn" defaultMessage = "Sign in" /> }
85
67
icon = "sign-in-alt"
86
68
currentPath = { currentUrl }
87
- link = { LOGIN_URI }
88
- />
89
- < MenuItem
90
- title = { < FormattedMessage id = "app.sidebar.menu.createAccount" defaultMessage = "Create account" /> }
91
- isActive = { false }
92
- icon = "user-plus"
93
- currentPath = { currentUrl }
94
- link = { REGISTRATION_URI }
69
+ link = { HOME_URI }
95
70
/>
96
71
</ ul >
97
72
) }
@@ -104,58 +79,13 @@ const Sidebar = ({
104
79
role = "menu"
105
80
data-accordion = "false" >
106
81
< MenuTitle title = { < FormattedMessage id = "app.sidebar.menu.title" defaultMessage = "Menu" /> } />
107
- < MenuItem
108
- title = { < FormattedMessage id = "app.sidebar.menu.dashboard" defaultMessage = "Dashboard" /> }
109
- icon = "tachometer-alt"
110
- currentPath = { currentUrl }
111
- link = { DASHBOARD_URI }
112
- />
113
-
114
- { isSupervisorRole ( effectiveRole ) && (
115
- < MenuItem
116
- title = { < FormattedMessage id = "app.sidebar.menu.exercises" defaultMessage = "Exercises" /> }
117
- icon = "puzzle-piece"
118
- currentPath = { currentUrl }
119
- link = { EXERCISES_URI }
120
- />
121
- ) }
82
+ < MenuItem title = "TODO" icon = "tachometer-alt" currentPath = { currentUrl } link = "TODO" />
122
83
123
- { isEmpoweredSupervisorRole ( effectiveRole ) && (
124
- < MenuItem
125
- title = { < FormattedMessage id = "app.sidebar.menu.pipelines" defaultMessage = "Pipelines" /> }
126
- icon = "random"
127
- currentPath = { currentUrl }
128
- link = { PIPELINES_URI }
129
- />
130
- ) }
131
-
132
- < MenuItem
133
- title = { < FormattedMessage id = "app.sidebar.menu.archive" defaultMessage = "Archive" /> }
134
- icon = "archive"
135
- currentPath = { currentUrl }
136
- link = { ARCHIVE_URI }
137
- />
138
-
139
- { Boolean ( getExternalIdForCAS ( user ) ) && (
140
- < MenuItem
141
- icon = "id-badge"
142
- title = { < FormattedMessage id = "app.sidebar.menu.admin.sis" defaultMessage = "SIS Integration" /> }
143
- currentPath = { currentUrl }
144
- link = { SIS_INTEGRATION_URI }
145
- />
146
- ) }
147
-
148
- < MenuItem
149
- title = { < FormattedMessage id = "app.sidebar.menu.faq" defaultMessage = "FAQ" /> }
150
- icon = { [ 'far' , 'question-circle' ] }
151
- link = { FAQ_URL }
152
- currentPath = { currentUrl }
153
- />
84
+ { isSupervisorRole ( user . role ) && < > </ > }
85
+ { isSuperadminRole ( user . role ) && < > </ > }
154
86
</ ul >
155
87
</ >
156
88
) }
157
-
158
- { isSuperadminRole ( effectiveRole ) && < Admin currentUrl = { currentUrl } /> }
159
89
</ nav >
160
90
</ div >
161
91
</ div >
@@ -166,7 +96,6 @@ const Sidebar = ({
166
96
Sidebar . propTypes = {
167
97
pendingFetchOperations : PropTypes . bool ,
168
98
loggedInUser : ImmutablePropTypes . map ,
169
- effectiveRole : PropTypes . string ,
170
99
currentUrl : PropTypes . string ,
171
100
links : PropTypes . object ,
172
101
} ;
0 commit comments