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:
Sas Swart
2024-12-12 17:25:10 +02:00
committed by GitHub
parent 08f0eaaf3b
commit 0e98c0e456
2 changed files with 14 additions and 5 deletions
@@ -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,
+4 -4
View File
@@ -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