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_status: boolean | null
|
||||||
loc_name: string
|
loc_name: string
|
||||||
country: string
|
country: string
|
||||||
|
order_name: string
|
||||||
|
family_name: string
|
||||||
genus_name: string
|
genus_name: string
|
||||||
family_name: string | null
|
|
||||||
species_name: string
|
species_name: string
|
||||||
unique_identifier: string | null
|
unique_identifier: string | null
|
||||||
dms_lat: string | null
|
dms_lat: string | null
|
||||||
|
|||||||
@@ -83,8 +83,9 @@ export const generateOccurrenceDetailSql = (lid: number, speciesId: number) => {
|
|||||||
now_loc.min_age,
|
now_loc.min_age,
|
||||||
now_loc.bfa_max,
|
now_loc.bfa_max,
|
||||||
now_loc.bfa_min,
|
now_loc.bfa_min,
|
||||||
com_species.genus_name,
|
com_species.order_name,
|
||||||
com_species.family_name,
|
com_species.family_name,
|
||||||
|
com_species.genus_name,
|
||||||
com_species.species_name,
|
com_species.species_name,
|
||||||
com_species.unique_identifier
|
com_species.unique_identifier
|
||||||
FROM now_ls
|
FROM now_ls
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ export const OccurrenceDetails = () => {
|
|||||||
if (localityQueryError) return <div>Error loading locality data</div>
|
if (localityQueryError) return <div>Error loading locality data</div>
|
||||||
if (occurrenceDataLoading || localityDataLoading || mutationLoading) return <CircularProgress />
|
if (occurrenceDataLoading || localityDataLoading || mutationLoading) return <CircularProgress />
|
||||||
|
|
||||||
const initialOccurrence = emptyOccurrence
|
const initialOccurrence: OccurrenceDetailsType = { ...emptyOccurrence }
|
||||||
|
|
||||||
if (isNew) {
|
if (isNew) {
|
||||||
initialOccurrence.lid = parseInt(localityId, 10)
|
initialOccurrence.lid = parseInt(localityId, 10)
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ export const OccurrenceCoreTab = ({
|
|||||||
['Family', editData.family_name],
|
['Family', editData.family_name],
|
||||||
['Genus', editData.genus_name],
|
['Genus', editData.genus_name],
|
||||||
['Species', editData.species_name],
|
['Species', editData.species_name],
|
||||||
['Unique Identifier', editData.unique_identifier],
|
['Unique Identifier', toText(editData.unique_identifier)],
|
||||||
['ID status', dropdown('id_status', idStatusOptions, 'ID status')],
|
['ID status', dropdown('id_status', idStatusOptions, 'ID status')],
|
||||||
['Additional Information', textField('orig_entry', { type: 'text' })],
|
['Additional Information', textField('orig_entry', { type: 'text' })],
|
||||||
['Source name', textField('source_name', { type: 'text' })],
|
['Source name', textField('source_name', { type: 'text' })],
|
||||||
|
|||||||
@@ -201,10 +201,8 @@ export const TableToolBar = <T extends MRT_RowData>({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="table-tool-bar">
|
<div className="table-tool-bar">
|
||||||
{showContactButton && (
|
|
||||||
<Box className="left-buttons">
|
<Box className="left-buttons">
|
||||||
<ContactForm<T> buttonText="Contact" noContext={true} />
|
{showContactButton && <ContactForm<T> buttonText="Contact" noContext={true} />}
|
||||||
|
|
||||||
{showNewButton && (
|
{showNewButton && (
|
||||||
<Button
|
<Button
|
||||||
id="new-button"
|
id="new-button"
|
||||||
@@ -219,7 +217,7 @@ export const TableToolBar = <T extends MRT_RowData>({
|
|||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
|
||||||
<Box className="icon-buttons">
|
<Box className="icon-buttons">
|
||||||
<Tooltip title="Show/hide columns">
|
<Tooltip title="Show/hide columns">
|
||||||
<IconButton
|
<IconButton
|
||||||
|
|||||||
@@ -36,14 +36,6 @@ const router = createBrowserRouter([
|
|||||||
return { Component: OccurrencesPage }
|
return { Component: OccurrencesPage }
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: 'occurrence/:id',
|
|
||||||
// Matches occurrence/new
|
|
||||||
lazy: async () => {
|
|
||||||
const { OccurrencesPage } = await import('../pages/OccurrencesPage')
|
|
||||||
return { Component: OccurrencesPage }
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: 'occurrence',
|
path: 'occurrence',
|
||||||
lazy: async () => {
|
lazy: async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user