diff --git a/src/components/IndividualSelector.jsx b/src/components/IndividualSelector.jsx index d41983155..de3b92643 100644 --- a/src/components/IndividualSelector.jsx +++ b/src/components/IndividualSelector.jsx @@ -123,7 +123,7 @@ export default function IndividualSelector({ {canShowTable && ( {renderActions} -
- {children} -
+
{children}
); diff --git a/src/components/cards/CollaborationsCard.jsx b/src/components/cards/CollaborationsCard.jsx index b0cbd498e..76dec05b5 100644 --- a/src/components/cards/CollaborationsCard.jsx +++ b/src/components/cards/CollaborationsCard.jsx @@ -15,8 +15,9 @@ export default function CollaborationsCard({ htmlId = null, }) { const intl = useIntl(); - const [activeCollaboration, setActiveCollaboration] = - useState(null); + const [activeCollaboration, setActiveCollaboration] = useState( + null, + ); const [ collabDialogButtonClickLoading, setCollabDialogButtonClickLoading, @@ -24,9 +25,12 @@ export default function CollaborationsCard({ const { data, loading } = useGetMe(); - useEffect(() => { - setCollabDialogButtonClickLoading(false); - }, [data]); + useEffect( + () => { + setCollabDialogButtonClickLoading(false); + }, + [data], + ); const collaborations = get(data, ['collaborations'], []); const tableData = collaborations.map(collaboration => { @@ -139,6 +143,7 @@ export default function CollaborationsCard({ columns={columns} data={tableData} idKey="guid" + tableContainerStyles={{ maxHeight: 600 }} /> ); diff --git a/src/components/cards/CooccurrenceCard.jsx b/src/components/cards/CooccurrenceCard.jsx index f61d197e9..bfd7f8e3d 100644 --- a/src/components/cards/CooccurrenceCard.jsx +++ b/src/components/cards/CooccurrenceCard.jsx @@ -34,6 +34,7 @@ export default function CooccurrenceCard({ }, ]} data={data} + tableContainerStyles={{ maxHeight: 600 }} /> ); diff --git a/src/components/cards/EncountersCard.jsx b/src/components/cards/EncountersCard.jsx index 38ec9e138..fba5fae78 100644 --- a/src/components/cards/EncountersCard.jsx +++ b/src/components/cards/EncountersCard.jsx @@ -34,20 +34,23 @@ export default function EncountersCard({ const mapModeClicked = () => setShowMapView(true); const listModeClicked = () => setShowMapView(false); - const encountersWithLocationData = useMemo(() => { - // hotfix // - if (!encounters) return []; - // hotfix // + const encountersWithLocationData = useMemo( + () => { + // hotfix // + if (!encounters) return []; + // hotfix // - return encounters.map(encounter => ({ - ...encounter, - formattedLocation: formatLocationFromSighting( - encounter, - regionOptions, - intl, - ), - })); - }, [get(encounters, 'length')]); + return encounters.map(encounter => ({ + ...encounter, + formattedLocation: formatLocationFromSighting( + encounter, + regionOptions, + intl, + ), + })); + }, + [get(encounters, 'length')], + ); const tooFewEncounters = encounters.length <= 1; @@ -162,6 +165,7 @@ export default function EncountersCard({ columns={filteredColumns} data={encountersWithLocationData} tableStyles={{ tableLayout: 'fixed' }} + tableContainerStyles={{ maxHeight: 600 }} /> )} {!noEncounters && showMapView &&
Map goes here
} diff --git a/src/components/cards/RelationshipsCard.jsx b/src/components/cards/RelationshipsCard.jsx index d4fc58be2..a2aa7b6bb 100644 --- a/src/components/cards/RelationshipsCard.jsx +++ b/src/components/cards/RelationshipsCard.jsx @@ -341,7 +341,7 @@ export default function RelationshipsCard({ , - + {/* // renderActions={ //
// setShowMapView(true); const listModeClicked = () => setShowMapView(false); - const sightingsWithLocationData = useMemo(() => { - // hotfix // - if (!sightings) return []; - // hotfix // + const sightingsWithLocationData = useMemo( + () => { + // hotfix // + if (!sightings) return []; + // hotfix // - return sightings.map(sighting => ({ - ...sighting, - formattedLocation: formatLocationFromSighting( - sighting, - regionOptions, - intl, - ), - })); - }, [get(sightings, 'length')]); + return sightings.map(sighting => ({ + ...sighting, + formattedLocation: formatLocationFromSighting( + sighting, + regionOptions, + intl, + ), + })); + }, + [get(sightings, 'length')], + ); const allColumns = [ { @@ -149,6 +152,7 @@ export default function SightingsCard({ data={sightings} loading={loading} noResultsTextId={noSightingsMsg} + tableContainerStyles={{ maxHeight: 400 }} /> )} {!noSightings && showMapView && ( diff --git a/src/components/dataDisplays/DataDisplay.jsx b/src/components/dataDisplays/DataDisplay.jsx index 6519d9c7c..18c0fd595 100644 --- a/src/components/dataDisplays/DataDisplay.jsx +++ b/src/components/dataDisplays/DataDisplay.jsx @@ -61,9 +61,10 @@ export default function DataDisplay({ sortExternally, searchParams, setSearchParams, - paperStyles = {}, tableStyles = {}, cellStyles = {}, + stickyHeader = true, + tableContainerStyles = {}, ...rest }) { const intl = useIntl(); @@ -80,8 +81,9 @@ export default function DataDisplay({ ); const [filter, setFilter] = useState(''); const [internalSortColumn, setInternalSortColumn] = useState(null); - const [internalSortDirection, setInternalSortDirection] = - useState(null); + const [internalSortDirection, setInternalSortDirection] = useState( + null, + ); const [anchorEl, setAnchorEl] = useState(null); const filterPopperOpen = Boolean(anchorEl); @@ -258,9 +260,10 @@ export default function DataDisplay({ ); } diff --git a/src/pages/assetGroup/AGSTable.jsx b/src/pages/assetGroup/AGSTable.jsx index 7653a2abf..47f8fd690 100644 --- a/src/pages/assetGroup/AGSTable.jsx +++ b/src/pages/assetGroup/AGSTable.jsx @@ -73,6 +73,7 @@ export default function AGSTable({ assetGroupSightings }) { data={transformedData} columns={columns} style={{ marginTop: 20 }} + tableContainerStyles={{ maxHeight: 600 }} /> ); } diff --git a/src/pages/fieldManagement/settings/CategoryTable.jsx b/src/pages/fieldManagement/settings/CategoryTable.jsx index 4a4342884..f25e15e07 100644 --- a/src/pages/fieldManagement/settings/CategoryTable.jsx +++ b/src/pages/fieldManagement/settings/CategoryTable.jsx @@ -291,6 +291,7 @@ export default function FieldSettings() { variant="secondary" columns={categoryColumns} data={categories} + tableContainerStyles={{ maxHeight: 300 }} /> ); diff --git a/src/pages/fieldManagement/settings/CustomFieldTable.jsx b/src/pages/fieldManagement/settings/CustomFieldTable.jsx index 5eff750bd..2ea09b98a 100644 --- a/src/pages/fieldManagement/settings/CustomFieldTable.jsx +++ b/src/pages/fieldManagement/settings/CustomFieldTable.jsx @@ -47,8 +47,9 @@ export default function CustomFieldTable({ const intl = useIntl(); const [deleteField, setDeleteField] = useState(null); const [previewField, setPreviewField] = useState(null); - const [previewInitialValue, setPreviewInitialValue] = - useState(null); + const [previewInitialValue, setPreviewInitialValue] = useState( + null, + ); const { removeCustomField, needsForce, @@ -101,7 +102,9 @@ export default function CustomFieldTable({ /> ); diff --git a/src/pages/fieldManagement/settings/DefaultFieldTable.jsx b/src/pages/fieldManagement/settings/DefaultFieldTable.jsx index 78bdc4743..e1a63baf7 100644 --- a/src/pages/fieldManagement/settings/DefaultFieldTable.jsx +++ b/src/pages/fieldManagement/settings/DefaultFieldTable.jsx @@ -198,6 +198,7 @@ export default function DefaultFieldTable({ variant="secondary" columns={tableColumns} data={configurableFields} + tableContainerStyles={{ maxHeight: 300 }} /> ); diff --git a/src/pages/fieldManagement/settings/defaultFieldComponents/SpeciesEditor.jsx b/src/pages/fieldManagement/settings/defaultFieldComponents/SpeciesEditor.jsx index 19d224b0e..c5cca2529 100644 --- a/src/pages/fieldManagement/settings/defaultFieldComponents/SpeciesEditor.jsx +++ b/src/pages/fieldManagement/settings/defaultFieldComponents/SpeciesEditor.jsx @@ -167,13 +167,13 @@ export default function SpeciesEditor({ )} + ); } diff --git a/src/pages/match/QueryAnnotationsTable.jsx b/src/pages/match/QueryAnnotationsTable.jsx index 625da4be2..c005dde04 100644 --- a/src/pages/match/QueryAnnotationsTable.jsx +++ b/src/pages/match/QueryAnnotationsTable.jsx @@ -55,6 +55,7 @@ export default function QueryAnnotationsTable({ setSelectedQueryAnnotation(nextSelection); } }} + tableContainerStyles={{ maxHeight: 300 }} /> ); } diff --git a/src/pages/sighting/statusCard/StatusCard.jsx b/src/pages/sighting/statusCard/StatusCard.jsx index 35f5ff712..018358ffe 100644 --- a/src/pages/sighting/statusCard/StatusCard.jsx +++ b/src/pages/sighting/statusCard/StatusCard.jsx @@ -170,7 +170,7 @@ export default function StatusCard({ sightingData }) { } return ( - + {usersError ? ( {collaborationError ? (