Skip to content

Commit

Permalink
MIsc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NickPhura committed Aug 15, 2024
1 parent 9c913c7 commit 9cf24be
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 24 deletions.
2 changes: 1 addition & 1 deletion api/src/paths/telemetry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ GET.apiDoc = {
additionalProperties: false,
properties: {
telemetry_id: {
type: 'number',
type: 'string',
description: 'The BCTW telemetry record ID.'
},
acquisition_date: {
Expand Down
15 changes: 12 additions & 3 deletions app/src/components/data-grid/StyledDataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,18 @@ export const StyledDataGrid = <R extends GridValidRowModel = any>(props: StyledD
'& .MuiDataGrid-columnHeader:last-of-type, .MuiDataGrid-cell:last-of-type': {
pr: 2
},
'&.MuiDataGrid-root--densityCompact .MuiDataGrid-cell': { py: '8px' },
'&.MuiDataGrid-root--densityStandard .MuiDataGrid-cell': { py: '15px' },
'&.MuiDataGrid-root--densityComfortable .MuiDataGrid-cell': { py: '22px' },
'&.MuiDataGrid-root--densityCompact .MuiDataGrid-cell': {
py: '8px',
'word-wrap': 'anywhere'
},
'&.MuiDataGrid-root--densityStandard .MuiDataGrid-cell': {
py: '15px',
'word-wrap': 'anywhere'
},
'&.MuiDataGrid-root--densityComfortable .MuiDataGrid-cell': {
py: '22px',
'word-wrap': 'anywhere'
},
'& .MuiDataGrid-columnHeaderDraggableContainer': {
minWidth: '50px'
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const initialPaginationParams: Required<ApiPaginationRequestOptions> = {
page: 0,
limit: 10,
sort: 'survey_observation_id',
order: 'desc'
order: 'asc'
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ const TelemetryListContainer = (props: IAllTelemetryListContainerProps) => {
{
field: 'telemetry_id',
headerName: 'ID',
width: 50,
minWidth: 50,
minWidth: 200,
sortable: false,
renderHeader: () => (
<Typography color={grey[500]} variant="body2" fontWeight={700}>
Expand Down
17 changes: 17 additions & 0 deletions app/src/features/surveys/list/SurveysListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { mdiArrowTopRight, mdiPlus } from '@mdi/js';
import Icon from '@mdi/react';
import Box from '@mui/material/Box';
import Button from '@mui/material/Button';
import { grey } from '@mui/material/colors';
import Divider from '@mui/material/Divider';
import Link from '@mui/material/Link';
import Toolbar from '@mui/material/Toolbar';
Expand Down Expand Up @@ -59,6 +60,22 @@ const SurveysListPage = () => {
const surveys = projectContext.surveysListDataLoader.data?.surveys ?? [];

const columns: GridColDef<SurveyBasicFieldsObject>[] = [
{
field: 'survey_id',
headerName: 'ID',
width: 70,
minWidth: 70,
renderHeader: () => (
<Typography color={grey[500]} variant="body2" fontWeight={700}>
ID
</Typography>
),
renderCell: (params) => (
<Typography color={grey[500]} variant="body2">
{params.row.survey_id}
</Typography>
)
},
{
field: 'name',
headerName: 'Name',
Expand Down
6 changes: 6 additions & 0 deletions app/src/features/surveys/telemetry/table/TelemetryTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ export const TelemetryTable = (props: IManualTelemetryTableProps) => {
noRowsLabel: 'No Records'
}}
getRowHeight={() => 'auto'}
initialState={{
pagination: {
paginationModel: { page: 0, pageSize: 25 }
}
}}
pageSizeOptions={[25, 50, 100]}
slots={{
loadingOverlay: SkeletonTable
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ export const SurveySpatialTelemetry = () => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [deploymentDataLoader.data]);

const isLoading =
deploymentDataLoader.isLoading ||
!deploymentDataLoader.isReady ||
((telemetryDataLoader.isLoading || !telemetryDataLoader.isReady) && !!deploymentDataLoader.data?.length);

/**
* Combines telemetry, deployment, and critter data into a single list of telemetry points.
*
Expand Down Expand Up @@ -124,27 +129,12 @@ export const SurveySpatialTelemetry = () => {
<>
{/* Display map with telemetry points */}
<Box height={{ sm: 300, md: 500 }} position="relative">
<SurveySpatialMap
staticLayers={[telemetryLayer]}
isLoading={
deploymentDataLoader.isLoading ||
!deploymentDataLoader.isReady ||
telemetryDataLoader.isLoading ||
!telemetryDataLoader.isReady
}
/>
<SurveySpatialMap staticLayers={[telemetryLayer]} isLoading={isLoading} />
</Box>

{/* Display data table with telemetry details */}
<Box p={2} position="relative">
<SurveySpatialTelemetryTable
isLoading={
deploymentDataLoader.isLoading ||
!deploymentDataLoader.isReady ||
telemetryDataLoader.isLoading ||
!telemetryDataLoader.isReady
}
/>
<SurveySpatialTelemetryTable isLoading={isLoading} />
</Box>
</>
);
Expand Down

0 comments on commit 9cf24be

Please sign in to comment.