Skip to content

Commit 6843f36

Browse files
committed
reorder subject page tabs in datahub
1 parent a13ba28 commit 6843f36

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

apps/web/src/routes/_app/datahub/$subjectId/route.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ const RouteComponent = () => {
5353
</Heading>
5454
</PageHeader>
5555
<div className="mb-5 flex">
56+
<TabLink label={t('layout.tabs.table')} pathname={`${basePathname}/table`} testId="subject-table" />
57+
<TabLink label={t('layout.tabs.graph')} pathname={`${basePathname}/graph`} testId="subject-graph" />
5658
{config.setup.isGatewayEnabled && (
5759
<TabLink
5860
label={t('layout.tabs.assignments')}
5961
pathname={`${basePathname}/assignments`}
6062
testId="subject-assignment"
6163
/>
6264
)}
63-
<TabLink label={t('layout.tabs.table')} pathname={`${basePathname}/table`} testId="subject-table" />
64-
<TabLink label={t('layout.tabs.graph')} pathname={`${basePathname}/graph`} testId="subject-graph" />
6565
</div>
6666
<React.Suspense fallback={<LoadingFallback />}>
6767
<Outlet />

apps/web/src/routes/_app/datahub/$subjectId/table.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { TimeDropdown } from '@/components/TimeDropdown';
88
import { useInstrumentVisualization } from '@/hooks/useInstrumentVisualization';
99

1010
const RouteComponent = () => {
11+
const navigate = Route.useNavigate();
1112
const params = Route.useParams();
1213
const { dl, instrumentId, instrumentOptions, records, setInstrumentId, setMinDate } = useInstrumentVisualization({
1314
params: { subjectId: params.subjectId }
@@ -60,6 +61,9 @@ const RouteComponent = () => {
6061
data-testid="subject-table"
6162
entriesPerPage={15}
6263
minRows={15}
64+
onEntryClick={(row) => {
65+
void navigate({ params: { recordId: row.__id__ }, to: '/datahub/$subjectId/$recordId' });
66+
}}
6367
/>
6468
</div>
6569
);

0 commit comments

Comments
 (0)