Skip to content

Commit

Permalink
fix: breadcrumb params
Browse files Browse the repository at this point in the history
  • Loading branch information
MarceloRobert authored and lfjnascimento committed Nov 18, 2024
1 parent bebe43e commit 54a72fe
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
5 changes: 3 additions & 2 deletions dashboard/src/components/TreeListingPage/TreeTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export function TreeTable({ treeTableRows }: ITreeTable): JSX.Element {
to: '/tree/$treeId',
params: { treeId: row.original.id },

search: {
search: previousSearch => ({
tableFilter: {
bootsTable: possibleTestsTableFilter[0],
buildsTable: possibleBuildsTableFilter[2],
Expand All @@ -234,7 +234,8 @@ export function TreeTable({ treeTableRows }: ITreeTable): JSX.Element {
commitName: row.original.commitName,
headCommitHash: row.original.id,
},
},
intervalInDays: previousSearch.intervalInDays,
}),
};
},
[origin],
Expand Down
10 changes: 9 additions & 1 deletion dashboard/src/pages/TreeDetails/TreeDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,15 @@ function TreeDetails(): JSX.Element {
<Breadcrumb>
<BreadcrumbList>
<BreadcrumbItem>
<BreadcrumbLink to="/tree" search={searchParams}>
<BreadcrumbLink
to="/tree"
search={previousParams => {
return {
intervalInDays: previousParams.intervalInDays,
origin: previousParams.origin,
};
}}
>
<FormattedMessage id="tree.path" />
</BreadcrumbLink>
</BreadcrumbItem>
Expand Down
6 changes: 5 additions & 1 deletion dashboard/src/pages/hardwareDetails/HardwareDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ function HardwareDetails(): JSX.Element {
<BreadcrumbLink
to="/hardware"
search={previousParams => {
return { ...previousParams, searchParams };
return {
intervalInDays: previousParams.intervalInDays,
origin: previousParams.origin,
hardwareSearch: previousParams.hardwareSearch,
};
}}
>
<FormattedMessage id="hardware.path" />
Expand Down
2 changes: 0 additions & 2 deletions dashboard/src/routes/hardware/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ import { z } from 'zod';

import { makeZIntervalInDays } from '@/types/general';
import { DEFAULT_HARDWARE_INTERVAL_IN_DAYS } from '@/utils/constants/hardware';
import { zTableFilterInfoValidator } from '@/types/tree/TreeDetails';

const zHardwareSchema = z.object({
intervalInDays: makeZIntervalInDays(DEFAULT_HARDWARE_INTERVAL_IN_DAYS),
hardwareSearch: z.string().optional().catch(undefined),
tableFilter: zTableFilterInfoValidator,
});

export const Route = createFileRoute('/hardware')({
Expand Down

0 comments on commit 54a72fe

Please sign in to comment.