mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(site): remove a misplaced warning banner in the frontend (#15837)
This PR fixes some faulty frontend logic that was introduced in #15686
This commit is contained in:
@@ -63,7 +63,16 @@ type Story = StoryObj<typeof Workspace>;
|
||||
|
||||
export const Running: Story = {
|
||||
args: {
|
||||
workspace: Mocks.MockWorkspace,
|
||||
workspace: {
|
||||
...Mocks.MockWorkspace,
|
||||
latest_build: {
|
||||
...Mocks.MockWorkspace.latest_build,
|
||||
matched_provisioners: {
|
||||
count: 0,
|
||||
available: 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
handleStart: action("start"),
|
||||
handleStop: action("stop"),
|
||||
buildInfo: Mocks.MockBuildInfo,
|
||||
|
||||
@@ -110,13 +110,13 @@ export const Workspace: FC<WorkspaceProps> = ({
|
||||
(r) => resourceOptionValue(r) === resourcesNav.value,
|
||||
);
|
||||
|
||||
const shouldDisplayBuildLogs =
|
||||
(buildLogs ?? []).length > 0 && workspace.latest_build.status !== "running";
|
||||
|
||||
const workspaceRunning = workspace.latest_build.status === "running";
|
||||
const haveBuildLogs = (buildLogs ?? []).length > 0;
|
||||
const provisionersHealthy =
|
||||
(workspace.latest_build.matched_provisioners?.available ?? 0) > 0;
|
||||
const shouldDisplayBuildLogs = haveBuildLogs && !workspaceRunning;
|
||||
const shouldShowProvisionerAlert =
|
||||
!provisionersHealthy && (!buildLogs || buildLogs.length === 0);
|
||||
!workspaceRunning && !haveBuildLogs && !provisionersHealthy;
|
||||
|
||||
return (
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user