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 {
473473 < Route path = { match . path + '/analytics' } render = { AnalyticsRoute } />
474474 < Redirect exact from = { match . path + '/settings' } to = '/apps/:appId/settings/general' />
475475 < 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 } /> }
483478 </ Switch >
484479 </ AppData >
485480 )
Original file line number Diff line number Diff line change @@ -182,12 +182,10 @@ export default class DashboardView extends React.Component {
182182 link : '/analytics'
183183 } )
184184
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+ } )
191189
192190 moreSubSection . push ( {
193191 name : 'Admin App' ,
Original file line number Diff line number Diff line change 1+ import AccountManager from 'lib/AccountManager' ;
12import PropTypes from 'prop-types'
23import React from 'react'
34import Swal from 'sweetalert2'
@@ -23,6 +24,8 @@ class HubConnections extends DashboardView {
2324 showDisconnectDialog : false ,
2425 isDisconnecting : false
2526 } ;
27+
28+ this . user = AccountManager . currentUser ( ) ;
2629 }
2730
2831 async componentDidMount ( ) {
@@ -33,11 +36,14 @@ class HubConnections extends DashboardView {
3336 renderSidebar ( ) {
3437 const { path } = this . props . match ;
3538 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+ }
3645 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 } />
4147 ) ;
4248 }
4349
You can’t perform that action at this time.
0 commit comments