File tree Expand file tree Collapse file tree 3 files changed +16
-17
lines changed Expand file tree Collapse file tree 3 files changed +16
-17
lines changed Original file line number Diff line number Diff line change @@ -473,13 +473,8 @@ export default class Dashboard extends React.Component {
473
473
< Route path = { match . path + '/analytics' } render = { AnalyticsRoute } />
474
474
< Redirect exact from = { match . path + '/settings' } to = '/apps/:appId/settings/general' />
475
475
< Route path = { match . path + '/settings' } render = { SettingsRoute } />
476
-
477
- { user . allowHubPublish && (
478
- < >
479
- < Route exact path = { match . path + '/connections' } component = { HubConnections } />
480
- < Route path = { match . path + '/hub-publish' } component = { B4aHubPublishPage } />
481
- </ >
482
- ) }
476
+ < Route exact path = { match . path + '/connections' } component = { HubConnections } />
477
+ { user . allowHubPublish && < Route path = { match . path + '/hub-publish' } component = { B4aHubPublishPage } /> }
483
478
</ Switch >
484
479
</ AppData >
485
480
)
Original file line number Diff line number Diff line change @@ -182,12 +182,10 @@ export default class DashboardView extends React.Component {
182
182
link : '/analytics'
183
183
} )
184
184
185
- if ( user . allowHubPublish ) {
186
- moreSubSection . push ( {
187
- name : 'Database HUB' ,
188
- link : '/connections'
189
- } )
190
- }
185
+ moreSubSection . push ( {
186
+ name : 'Database HUB' ,
187
+ link : '/connections'
188
+ } )
191
189
192
190
moreSubSection . push ( {
193
191
name : 'Admin App' ,
Original file line number Diff line number Diff line change
1
+ import AccountManager from 'lib/AccountManager' ;
1
2
import PropTypes from 'prop-types'
2
3
import React from 'react'
3
4
import Swal from 'sweetalert2'
@@ -23,6 +24,8 @@ class HubConnections extends DashboardView {
23
24
showDisconnectDialog : false ,
24
25
isDisconnecting : false
25
26
} ;
27
+
28
+ this . user = AccountManager . currentUser ( ) ;
26
29
}
27
30
28
31
async componentDidMount ( ) {
@@ -33,11 +36,14 @@ class HubConnections extends DashboardView {
33
36
renderSidebar ( ) {
34
37
const { path } = this . props . match ;
35
38
const current = path . substr ( path . lastIndexOf ( "/" ) + 1 , path . length - 1 ) ;
39
+ const categories = [
40
+ { name : 'Connections' , id : 'connections' } ,
41
+ ] ;
42
+ if ( this . user . allowHubPublish ) {
43
+ categories . push ( { name : 'Publish' , id : 'hub-publish' } )
44
+ }
36
45
return (
37
- < CategoryList current = { current } linkPrefix = { '' } categories = { [
38
- { name : 'Connections' , id : 'connections' } ,
39
- { name : 'Publish' , id : 'hub-publish' }
40
- ] } />
46
+ < CategoryList current = { current } linkPrefix = { '' } categories = { categories } />
41
47
) ;
42
48
}
43
49
You can’t perform that action at this time.
0 commit comments