mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
Show workspace name in WorkspaceBuildStats component (#1933)
* Show workspace name in WorkspaceBuildStats component Signed-off-by: Spike Curtis <spike@coder.com> * Fix WorkspaceBuildPage tests Signed-off-by: Spike Curtis <spike@coder.com>
This commit is contained in:
@@ -429,6 +429,7 @@ export interface WorkspaceBuild {
|
||||
readonly created_at: string
|
||||
readonly updated_at: string
|
||||
readonly workspace_id: string
|
||||
readonly workspace_name: string
|
||||
readonly template_version_id: string
|
||||
readonly build_number: number
|
||||
readonly name: string
|
||||
|
||||
@@ -19,13 +19,13 @@ export const WorkspaceBuildStats: FC<WorkspaceBuildStatsProps> = ({ build }) =>
|
||||
return (
|
||||
<div className={styles.stats}>
|
||||
<div className={styles.statItem}>
|
||||
<span className={styles.statsLabel}>Workspace ID</span>
|
||||
<span className={styles.statsLabel}>Workspace Name</span>
|
||||
<Link
|
||||
component={RouterLink}
|
||||
to={`/workspaces/${build.workspace_id}`}
|
||||
className={combineClasses([styles.statsValue, styles.link])}
|
||||
>
|
||||
{build.workspace_id}
|
||||
{build.workspace_name}
|
||||
</Link>
|
||||
</div>
|
||||
<div className={styles.statsDivider} />
|
||||
|
||||
@@ -6,7 +6,7 @@ describe("WorkspaceBuildPage", () => {
|
||||
it("renders the stats and logs", async () => {
|
||||
renderWithAuth(<WorkspaceBuildPage />, { route: `/builds/${MockWorkspaceBuild.id}`, path: "/builds/:buildId" })
|
||||
|
||||
await screen.findByText(MockWorkspaceBuild.workspace_id)
|
||||
await screen.findByText(MockWorkspaceBuild.workspace_name)
|
||||
await screen.findByText(MockWorkspaceBuildLogs[0].stage)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -134,7 +134,8 @@ export const MockWorkspaceBuild: TypesGen.WorkspaceBuild = {
|
||||
template_version_id: "",
|
||||
transition: "start",
|
||||
updated_at: "2022-05-17T17:39:01.382927298Z",
|
||||
workspace_id: "test-workspace",
|
||||
workspace_name: "test-workspace",
|
||||
workspace_id: "759f1d46-3174-453d-aa60-980a9c1442f3",
|
||||
deadline: "2022-05-17T23:39:00.00Z",
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user