Skip to content

feat: add loaders to ssh and terminal buttons #3820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: add loaders to ssh and terminal buttons
  • Loading branch information
f0ssel committed Sep 1, 2022
commit cdbf322fa69eef5aaca91e680ed88a69abd18711
7 changes: 7 additions & 0 deletions site/src/components/Resources/Resources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import TableCell from "@material-ui/core/TableCell"
import TableContainer from "@material-ui/core/TableContainer"
import TableHead from "@material-ui/core/TableHead"
import TableRow from "@material-ui/core/TableRow"
import { Skeleton } from "@material-ui/lab"
import useTheme from "@material-ui/styles/useTheme"
import { ErrorSummary } from "components/ErrorSummary/ErrorSummary"
import { TableCellDataPrimary } from "components/TableCellData/TableCellData"
Expand Down Expand Up @@ -152,6 +153,12 @@ export const Resources: FC<React.PropsWithChildren<ResourcesProps>> = ({
))}
</>
)}
{canUpdateWorkspace && agent.status === "connecting" && (
<>
<Skeleton width={80} height={60} />
<Skeleton width={120} height={60} />
</>
)}
</div>
</TableCell>
</TableRow>
Expand Down
18 changes: 15 additions & 3 deletions site/src/testHelpers/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,16 @@ export const MockWorkspaceAgentOutdated: TypesGen.WorkspaceAgent = {
operating_system: "Windows",
}

export const MockWorkspaceAgentConnecting: TypesGen.WorkspaceAgent = {
...MockWorkspaceAgent,
id: "test-workspace-agent-2",
name: "another-workspace-agent",
status: "connecting",
version: "",
}

export const MockWorkspaceResource: TypesGen.WorkspaceResource = {
agents: [MockWorkspaceAgent, MockWorkspaceAgentDisconnected, MockWorkspaceAgentOutdated],
agents: [MockWorkspaceAgent, MockWorkspaceAgentConnecting, MockWorkspaceAgentOutdated],
created_at: "",
id: "test-workspace-resource",
job_id: "",
Expand All @@ -343,10 +351,14 @@ export const MockWorkspaceResource: TypesGen.WorkspaceResource = {
],
}

export const MockWorkspaceResource2 = {
...MockWorkspaceResource,
export const MockWorkspaceResource2: TypesGen.WorkspaceResource = {
agents: [MockWorkspaceAgent, MockWorkspaceAgentDisconnected, MockWorkspaceAgentOutdated],
created_at: "",
id: "test-workspace-resource-2",
job_id: "",
name: "another-workspace-resource",
type: "google_compute_disk",
workspace_transition: "start",
metadata: [
{ key: "type", value: "google_compute_disk", sensitive: false },
{ key: "size", value: "32GB", sensitive: false },
Expand Down