From c1b5252864c7043a9531b32c894222f4f0fe5825 Mon Sep 17 00:00:00 2001 From: Kari Lintulaakso Date: Wed, 11 Mar 2026 11:14:22 +0200 Subject: [PATCH 1/2] Fix upper/lower label in time bound time unit tab --- frontend/src/components/TimeBound/Tabs/TimeUnitTab.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/TimeBound/Tabs/TimeUnitTab.tsx b/frontend/src/components/TimeBound/Tabs/TimeUnitTab.tsx index b19cc0fb..907e97ce 100755 --- a/frontend/src/components/TimeBound/Tabs/TimeUnitTab.tsx +++ b/frontend/src/components/TimeBound/Tabs/TimeUnitTab.tsx @@ -44,7 +44,7 @@ export const TimeUnitTab = () => { header: 'Name', }, { - accessorFn: ({ up_bound }) => (up_bound === data.bid ? 'Upper' : 'Lower'), + accessorFn: ({ up_bound }) => (Number(up_bound) === boundId ? 'Upper' : 'Lower'), header: 'Upper/Lower', }, { From 1e1a0b048b53495177e29035b51039560f147aa8 Mon Sep 17 00:00:00 2001 From: Kari Lintulaakso Date: Wed, 11 Mar 2026 15:01:52 +0200 Subject: [PATCH 2/2] Fix bound side labeling for time units in time bound tab --- .../components/TimeBound/Tabs/TimeUnitTab.tsx | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/TimeBound/Tabs/TimeUnitTab.tsx b/frontend/src/components/TimeBound/Tabs/TimeUnitTab.tsx index 907e97ce..1386dea6 100755 --- a/frontend/src/components/TimeBound/Tabs/TimeUnitTab.tsx +++ b/frontend/src/components/TimeBound/Tabs/TimeUnitTab.tsx @@ -1,4 +1,10 @@ import { TimeUnit, TimeBoundDetailsType } from '@/shared/types' + +type TimeBoundTabTimeUnit = TimeUnit & { + up_bnd?: number | string | null + low_bnd?: number | string | null + sequence?: string | null +} import { useGetTimeBoundTimeUnitsQuery } from '@/redux/timeBoundReducer' import { Alert, Button, CircularProgress, Stack } from '@mui/material' import { skipToken } from '@reduxjs/toolkit/query' @@ -34,7 +40,7 @@ export const TimeUnitTab = () => { if (isLoading || isFetching || !timeUnitsData) return - const columns: MRT_ColumnDef[] = [ + const columns: MRT_ColumnDef[] = [ { accessorKey: 'tu_name', header: 'ID', @@ -44,7 +50,16 @@ export const TimeUnitTab = () => { header: 'Name', }, { - accessorFn: ({ up_bound }) => (Number(up_bound) === boundId ? 'Upper' : 'Lower'), + accessorFn: timeUnit => { + const upperBoundId = Number(timeUnit.up_bnd ?? timeUnit.up_bound) + const lowerBoundId = Number(timeUnit.low_bnd ?? timeUnit.low_bound) + + if (boundId === null) return '' + if (upperBoundId === boundId) return 'Upper' + if (lowerBoundId === boundId) return 'Lower' + + return 'Unknown' + }, header: 'Upper/Lower', }, { @@ -52,7 +67,7 @@ export const TimeUnitTab = () => { header: 'Rank', }, { - accessorKey: 'sequence', + accessorFn: ({ sequence, seq_name }) => sequence ?? seq_name ?? '', header: 'Sequence', }, { @@ -62,7 +77,7 @@ export const TimeUnitTab = () => { ] return ( - + mode="read" title="Time Units" columns={columns}