mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
hide unfinished features from non-dev-environments
This commit is contained in:
+3
-1
@@ -44,7 +44,9 @@ app.use(tokenExtractor)
|
||||
app.use(userExtractor)
|
||||
|
||||
app.use('/user', userRouter)
|
||||
app.use('/crosssearch', crossSearchRouter)
|
||||
if (RUNNING_ENV == 'dev') {
|
||||
app.use('/crosssearch', crossSearchRouter)
|
||||
}
|
||||
app.use('/locality', localityRouter)
|
||||
app.use('/locality-species', localitySpeciesRouter)
|
||||
app.use('/species', speciesRouter)
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
} from './components/pages'
|
||||
import { Notification, NotificationContextProvider } from './components/Notification'
|
||||
import { EmailPage } from './components/EmailPage'
|
||||
import { ENV } from './util/config'
|
||||
|
||||
const App = () => {
|
||||
return (
|
||||
@@ -31,7 +32,9 @@ const App = () => {
|
||||
<Container maxWidth="xl" fixed style={{ marginTop: '2em', marginBottom: '2em' }}>
|
||||
<Grid item>
|
||||
<Routes>
|
||||
<Route element={crossSearchPage} path="/crosssearch/:id?" />
|
||||
{ENV == 'dev' &&
|
||||
<Route element={crossSearchPage} path="/crosssearch/:id?" />
|
||||
}
|
||||
<Route element={localityPage} path="/locality/:id?" />
|
||||
<Route element={speciesPage} path="/species/:id?" />
|
||||
<Route element={referencePage} path="/reference/:id?" />
|
||||
|
||||
@@ -65,6 +65,7 @@ export const NavBar = () => {
|
||||
)
|
||||
|
||||
const renderLink = (link: LinkDefinition) => {
|
||||
if (ENV !== 'dev' && link.title == 'Cross-Search') return null
|
||||
if (link.children) {
|
||||
return (
|
||||
<MenuItem key={`${link.url}-menuitem`} style={{ display: 'inline-block', padding: 0 }}>
|
||||
@@ -127,7 +128,7 @@ export const NavBar = () => {
|
||||
<Typography fontSize={'2.2em'}>NOW Database {getModeText()}</Typography>
|
||||
</MenuItem>
|
||||
<MenuList style={{ alignContent: 'center' }}>
|
||||
{pages
|
||||
{pages
|
||||
.filter(childLink => !childLink.allowedRoles || childLink.allowedRoles.includes(user.role))
|
||||
.map(page => renderLink(page))}
|
||||
</MenuList>
|
||||
|
||||
Reference in New Issue
Block a user