From 9cf24be7dd0567ceb541f23f54ec9670b83c0e02 Mon Sep 17 00:00:00 2001 From: Nick Phura Date: Thu, 15 Aug 2024 10:36:22 -0700 Subject: [PATCH] MIsc fixes --- api/src/paths/telemetry/index.ts | 2 +- .../components/data-grid/StyledDataGrid.tsx | 15 +++++++++--- .../observation/ObservationsListContainer.tsx | 2 +- .../telemetry/TelemetryListContainer.tsx | 3 +-- .../features/surveys/list/SurveysListPage.tsx | 17 +++++++++++++ .../telemetry/table/TelemetryTable.tsx | 6 +++++ .../telemetry/SurveySpatialTelemetry.tsx | 24 ++++++------------- 7 files changed, 45 insertions(+), 24 deletions(-) diff --git a/api/src/paths/telemetry/index.ts b/api/src/paths/telemetry/index.ts index 3c9d8ca7c9..1f2f46cda5 100644 --- a/api/src/paths/telemetry/index.ts +++ b/api/src/paths/telemetry/index.ts @@ -99,7 +99,7 @@ GET.apiDoc = { additionalProperties: false, properties: { telemetry_id: { - type: 'number', + type: 'string', description: 'The BCTW telemetry record ID.' }, acquisition_date: { diff --git a/app/src/components/data-grid/StyledDataGrid.tsx b/app/src/components/data-grid/StyledDataGrid.tsx index 8ad1c1200e..93ec92536a 100644 --- a/app/src/components/data-grid/StyledDataGrid.tsx +++ b/app/src/components/data-grid/StyledDataGrid.tsx @@ -49,9 +49,18 @@ export const StyledDataGrid = (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' }, diff --git a/app/src/features/summary/tabular-data/observation/ObservationsListContainer.tsx b/app/src/features/summary/tabular-data/observation/ObservationsListContainer.tsx index 1ad980da68..5f43fff388 100644 --- a/app/src/features/summary/tabular-data/observation/ObservationsListContainer.tsx +++ b/app/src/features/summary/tabular-data/observation/ObservationsListContainer.tsx @@ -56,7 +56,7 @@ const initialPaginationParams: Required = { page: 0, limit: 10, sort: 'survey_observation_id', - order: 'desc' + order: 'asc' }; /** diff --git a/app/src/features/summary/tabular-data/telemetry/TelemetryListContainer.tsx b/app/src/features/summary/tabular-data/telemetry/TelemetryListContainer.tsx index 16908b8a67..1609839ea1 100644 --- a/app/src/features/summary/tabular-data/telemetry/TelemetryListContainer.tsx +++ b/app/src/features/summary/tabular-data/telemetry/TelemetryListContainer.tsx @@ -103,8 +103,7 @@ const TelemetryListContainer = (props: IAllTelemetryListContainerProps) => { { field: 'telemetry_id', headerName: 'ID', - width: 50, - minWidth: 50, + minWidth: 200, sortable: false, renderHeader: () => ( diff --git a/app/src/features/surveys/list/SurveysListPage.tsx b/app/src/features/surveys/list/SurveysListPage.tsx index 7af0bc0bce..55474b8ba4 100644 --- a/app/src/features/surveys/list/SurveysListPage.tsx +++ b/app/src/features/surveys/list/SurveysListPage.tsx @@ -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'; @@ -59,6 +60,22 @@ const SurveysListPage = () => { const surveys = projectContext.surveysListDataLoader.data?.surveys ?? []; const columns: GridColDef[] = [ + { + field: 'survey_id', + headerName: 'ID', + width: 70, + minWidth: 70, + renderHeader: () => ( + + ID + + ), + renderCell: (params) => ( + + {params.row.survey_id} + + ) + }, { field: 'name', headerName: 'Name', diff --git a/app/src/features/surveys/telemetry/table/TelemetryTable.tsx b/app/src/features/surveys/telemetry/table/TelemetryTable.tsx index ed911cbee4..b01def63f0 100644 --- a/app/src/features/surveys/telemetry/table/TelemetryTable.tsx +++ b/app/src/features/surveys/telemetry/table/TelemetryTable.tsx @@ -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 }} diff --git a/app/src/features/surveys/view/survey-spatial/components/telemetry/SurveySpatialTelemetry.tsx b/app/src/features/surveys/view/survey-spatial/components/telemetry/SurveySpatialTelemetry.tsx index 0c27181261..8e67c232e7 100644 --- a/app/src/features/surveys/view/survey-spatial/components/telemetry/SurveySpatialTelemetry.tsx +++ b/app/src/features/surveys/view/survey-spatial/components/telemetry/SurveySpatialTelemetry.tsx @@ -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. * @@ -124,27 +129,12 @@ export const SurveySpatialTelemetry = () => { <> {/* Display map with telemetry points */} - + {/* Display data table with telemetry details */} - + );