mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
fix lint
This commit is contained in:
@@ -4,7 +4,7 @@ import { NavBar } from './components/NavBar'
|
||||
import { BrowserRouter, Route, Routes } from 'react-router-dom'
|
||||
import { Login } from './components/Login'
|
||||
import {
|
||||
crossSearchPage,
|
||||
crossSearchPage,
|
||||
localityPage,
|
||||
personPage,
|
||||
projectPage,
|
||||
@@ -31,7 +31,7 @@ const App = () => {
|
||||
<Container maxWidth="xl" fixed style={{ marginTop: '2em', marginBottom: '2em' }}>
|
||||
<Grid item>
|
||||
<Routes>
|
||||
<Route element={crossSearchPage} path="/crosssearch/:id?" />
|
||||
<Route element={crossSearchPage} path="/crosssearch/:id?" />
|
||||
<Route element={localityPage} path="/locality/:id?" />
|
||||
<Route element={speciesPage} path="/species/:id?" />
|
||||
<Route element={referencePage} path="/reference/:id?" />
|
||||
|
||||
@@ -30,7 +30,7 @@ export const NavBar = () => {
|
||||
{ title: 'Front Page', url: '/' },
|
||||
{ title: 'Localities', url: '/locality' },
|
||||
{ title: 'Species', url: '/species' },
|
||||
{ title: 'Cross-Search', url: '/crosssearch' },
|
||||
{ title: 'Cross-Search', url: '/crosssearch' },
|
||||
{ title: 'References', url: '/reference' },
|
||||
{ title: 'Time Units', url: '/time-unit' },
|
||||
{ title: 'Time Bounds', url: '/time-bound', allowedRoles: [Role.Admin, Role.EditUnrestricted] },
|
||||
|
||||
@@ -50,16 +50,16 @@ export const localityPage = (
|
||||
|
||||
export const crossSearchPage = (
|
||||
<Page
|
||||
tableView={<CrossSearchTable />}
|
||||
detailView={<LocalityDetails />}
|
||||
viewName="crosssearch"
|
||||
idFieldName="lid"
|
||||
createTitle={(loc: LocalityDetailsType) => `${loc.loc_name}`}
|
||||
getEditRights={(user: UserState, id: string | number) => {
|
||||
if ([Role.Admin, Role.EditUnrestricted].includes(user.role)) return fullRights
|
||||
if (user.role === Role.EditRestricted && user.localities.includes(id as number)) return limitedRights
|
||||
return noRights
|
||||
}}
|
||||
tableView={<CrossSearchTable />}
|
||||
detailView={<LocalityDetails />}
|
||||
viewName="crosssearch"
|
||||
idFieldName="lid"
|
||||
createTitle={(loc: LocalityDetailsType) => `${loc.loc_name}`}
|
||||
getEditRights={(user: UserState, id: string | number) => {
|
||||
if ([Role.Admin, Role.EditUnrestricted].includes(user.role)) return fullRights
|
||||
if (user.role === Role.EditRestricted && user.localities.includes(id as number)) return limitedRights
|
||||
return noRights
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ export const api = createApi({
|
||||
reducerPath: 'api',
|
||||
tagTypes: [
|
||||
'user',
|
||||
'crosssearch',
|
||||
'crosssearch',
|
||||
'locality',
|
||||
'localities',
|
||||
'species',
|
||||
|
||||
Reference in New Issue
Block a user