mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
fix issues pointed out by copilot
This commit is contained in:
@@ -329,8 +329,9 @@ export const getOccurrenceByCompositeKey = async (lid: number, speciesId: number
|
||||
loc_status: boolean | null
|
||||
loc_name: string
|
||||
country: string
|
||||
order_name: string
|
||||
family_name: string
|
||||
genus_name: string
|
||||
family_name: string | null
|
||||
species_name: string
|
||||
unique_identifier: string | null
|
||||
dms_lat: string | null
|
||||
|
||||
@@ -83,8 +83,9 @@ export const generateOccurrenceDetailSql = (lid: number, speciesId: number) => {
|
||||
now_loc.min_age,
|
||||
now_loc.bfa_max,
|
||||
now_loc.bfa_min,
|
||||
com_species.genus_name,
|
||||
com_species.order_name,
|
||||
com_species.family_name,
|
||||
com_species.genus_name,
|
||||
com_species.species_name,
|
||||
com_species.unique_identifier
|
||||
FROM now_ls
|
||||
|
||||
@@ -96,7 +96,7 @@ export const OccurrenceDetails = () => {
|
||||
if (localityQueryError) return <div>Error loading locality data</div>
|
||||
if (occurrenceDataLoading || localityDataLoading || mutationLoading) return <CircularProgress />
|
||||
|
||||
const initialOccurrence = emptyOccurrence
|
||||
const initialOccurrence: OccurrenceDetailsType = { ...emptyOccurrence }
|
||||
|
||||
if (isNew) {
|
||||
initialOccurrence.lid = parseInt(localityId, 10)
|
||||
|
||||
@@ -107,7 +107,7 @@ export const OccurrenceCoreTab = ({
|
||||
['Family', editData.family_name],
|
||||
['Genus', editData.genus_name],
|
||||
['Species', editData.species_name],
|
||||
['Unique Identifier', editData.unique_identifier],
|
||||
['Unique Identifier', toText(editData.unique_identifier)],
|
||||
['ID status', dropdown('id_status', idStatusOptions, 'ID status')],
|
||||
['Additional Information', textField('orig_entry', { type: 'text' })],
|
||||
['Source name', textField('source_name', { type: 'text' })],
|
||||
|
||||
@@ -201,25 +201,23 @@ export const TableToolBar = <T extends MRT_RowData>({
|
||||
|
||||
return (
|
||||
<div className="table-tool-bar">
|
||||
{showContactButton && (
|
||||
<Box className="left-buttons">
|
||||
<ContactForm<T> buttonText="Contact" noContext={true} />
|
||||
<Box className="left-buttons">
|
||||
{showContactButton && <ContactForm<T> buttonText="Contact" noContext={true} />}
|
||||
{showNewButton && (
|
||||
<Button
|
||||
id="new-button"
|
||||
variant="outlined"
|
||||
component={Link}
|
||||
to="new"
|
||||
className="button"
|
||||
startIcon={<AddCircleIcon />}
|
||||
onClick={() => setPreviousTableUrls([...previousTableUrls, `${location.pathname}`])}
|
||||
>
|
||||
New
|
||||
</Button>
|
||||
)}
|
||||
</Box>
|
||||
|
||||
{showNewButton && (
|
||||
<Button
|
||||
id="new-button"
|
||||
variant="outlined"
|
||||
component={Link}
|
||||
to="new"
|
||||
className="button"
|
||||
startIcon={<AddCircleIcon />}
|
||||
onClick={() => setPreviousTableUrls([...previousTableUrls, `${location.pathname}`])}
|
||||
>
|
||||
New
|
||||
</Button>
|
||||
)}
|
||||
</Box>
|
||||
)}
|
||||
<Box className="icon-buttons">
|
||||
<Tooltip title="Show/hide columns">
|
||||
<IconButton
|
||||
|
||||
@@ -36,14 +36,6 @@ const router = createBrowserRouter([
|
||||
return { Component: OccurrencesPage }
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'occurrence/:id',
|
||||
// Matches occurrence/new
|
||||
lazy: async () => {
|
||||
const { OccurrencesPage } = await import('../pages/OccurrencesPage')
|
||||
return { Component: OccurrencesPage }
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'occurrence',
|
||||
lazy: async () => {
|
||||
|
||||
Reference in New Issue
Block a user