-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- use breadcrumb as a prop in test and build details page and move logic to a general component Part of #507 and #508
- Loading branch information
1 parent
65cde46
commit 97520d9
Showing
18 changed files
with
296 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
dashboard/src/pages/HardwareBuildDetails/HardwareBuildDetails.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { FormattedMessage } from 'react-intl'; | ||
|
||
import { useParams, useSearch } from '@tanstack/react-router'; | ||
|
||
import { | ||
Breadcrumb, | ||
BreadcrumbItem, | ||
BreadcrumbLink, | ||
BreadcrumbList, | ||
BreadcrumbPage, | ||
BreadcrumbSeparator, | ||
} from '@/components/Breadcrumb/Breadcrumb'; | ||
|
||
import BuildDetails from '@/components/BuildDetails/BuildDetails'; | ||
|
||
const HardwareBuildDetails = (): JSX.Element => { | ||
const searchParams = useSearch({ | ||
from: '/hardware/$hardwareId/build/$buildId/', | ||
}); | ||
const { buildId, hardwareId } = useParams({ | ||
from: '/hardware/$hardwareId/build/$buildId/', | ||
}); | ||
|
||
return ( | ||
<BuildDetails | ||
buildId={buildId} | ||
breadcrumb={ | ||
<Breadcrumb className="pb-6 pt-6"> | ||
<BreadcrumbList> | ||
<BreadcrumbItem> | ||
<BreadcrumbLink to="/hardware" search={searchParams}> | ||
<FormattedMessage id="hardware.path" /> | ||
</BreadcrumbLink> | ||
</BreadcrumbItem> | ||
<BreadcrumbSeparator /> | ||
<BreadcrumbLink | ||
to="/hardware/$hardwareId" | ||
params={{ hardwareId }} | ||
search={searchParams} | ||
> | ||
<FormattedMessage id="hardware.details" /> | ||
</BreadcrumbLink> | ||
<BreadcrumbSeparator /> | ||
<BreadcrumbItem> | ||
<BreadcrumbPage> | ||
<FormattedMessage id="buildDetails.buildDetails" /> | ||
</BreadcrumbPage> | ||
</BreadcrumbItem> | ||
</BreadcrumbList> | ||
</Breadcrumb> | ||
} | ||
/> | ||
); | ||
}; | ||
|
||
export default HardwareBuildDetails; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import HardwareBuildDetails from './HardwareBuildDetails'; | ||
|
||
export default HardwareBuildDetails; |
56 changes: 56 additions & 0 deletions
56
dashboard/src/pages/HardwareTestDetails/HardwareTestDetails.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { useParams, useSearch } from '@tanstack/react-router'; | ||
|
||
import { FormattedMessage } from 'react-intl'; | ||
|
||
import { | ||
Breadcrumb, | ||
BreadcrumbItem, | ||
BreadcrumbLink, | ||
BreadcrumbList, | ||
BreadcrumbPage, | ||
BreadcrumbSeparator, | ||
} from '@/components/Breadcrumb/Breadcrumb'; | ||
|
||
import TestDetails from '@/components/TestDetails/TestDetails'; | ||
|
||
const HardwareTestDetails = (): JSX.Element => { | ||
const searchParams = useSearch({ | ||
from: '/hardware/$hardwareId/test/$testId/', | ||
}); | ||
const { testId, hardwareId } = useParams({ | ||
from: '/hardware/$hardwareId/test/$testId/', | ||
}); | ||
|
||
return ( | ||
<TestDetails | ||
testId={testId} | ||
breadcrumb={ | ||
<Breadcrumb className="pb-6 pt-6"> | ||
<BreadcrumbList> | ||
<BreadcrumbItem> | ||
<BreadcrumbLink to="/hardware" search={searchParams}> | ||
<FormattedMessage id="hardware.path" /> | ||
</BreadcrumbLink> | ||
</BreadcrumbItem> | ||
<BreadcrumbSeparator /> | ||
<BreadcrumbLink | ||
to={`/hardware/$hardwareId`} | ||
params={{ hardwareId }} | ||
search={searchParams} | ||
> | ||
<FormattedMessage id="hardware.details" /> | ||
</BreadcrumbLink> | ||
<BreadcrumbSeparator /> | ||
<BreadcrumbItem> | ||
<BreadcrumbPage> | ||
<FormattedMessage id="test.details" /> | ||
</BreadcrumbPage> | ||
</BreadcrumbItem> | ||
</BreadcrumbList> | ||
</Breadcrumb> | ||
} | ||
/> | ||
); | ||
}; | ||
|
||
export default HardwareTestDetails; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import HardwareTestDetails from './HardwareTestDetails'; | ||
|
||
export default HardwareTestDetails; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.