Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0e98c0e

Browse files
authored
fix(site): remove a misplaced warning banner in the frontend (#15837)
This PR fixes some faulty frontend logic that was introduced in #15686
1 parent 08f0eaa commit 0e98c0e

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

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

+10-1
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

+4-4
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)