Skip to content

Commit 9a8d2f1

Browse files
committed
fix(site): remove a misplaced warning banner in the frontend (#15837)
This PR fixes some faulty frontend logic that was introduced in #15686 (cherry picked from commit 0e98c0e)
1 parent ac75ebc commit 9a8d2f1

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

site/src/pages/WorkspacePage/Workspace.stories.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,16 @@ type Story = StoryObj<typeof Workspace>;
6363

6464
export const Running: Story = {
6565
args: {
66-
workspace: Mocks.MockWorkspace,
66+
workspace: {
67+
...Mocks.MockWorkspace,
68+
latest_build: {
69+
...Mocks.MockWorkspace.latest_build,
70+
matched_provisioners: {
71+
count: 0,
72+
available: 0,
73+
},
74+
},
75+
},
6776
handleStart: action("start"),
6877
handleStop: action("stop"),
6978
buildInfo: Mocks.MockBuildInfo,

site/src/pages/WorkspacePage/Workspace.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ export const Workspace: FC<WorkspaceProps> = ({
110110
(r) => resourceOptionValue(r) === resourcesNav.value,
111111
);
112112

113-
const shouldDisplayBuildLogs =
114-
(buildLogs ?? []).length > 0 && workspace.latest_build.status !== "running";
115-
113+
const workspaceRunning = workspace.latest_build.status === "running";
114+
const haveBuildLogs = (buildLogs ?? []).length > 0;
116115
const provisionersHealthy =
117116
(workspace.latest_build.matched_provisioners?.available ?? 0) > 0;
117+
const shouldDisplayBuildLogs = haveBuildLogs && !workspaceRunning;
118118
const shouldShowProvisionerAlert =
119-
!provisionersHealthy && (!buildLogs || buildLogs.length === 0);
119+
!workspaceRunning && !haveBuildLogs && !provisionersHealthy;
120120

121121
return (
122122
<div

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy