8000 feat: add frontend for app statuses by kylecarbs · Pull Request #17178 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

feat: add frontend for app statuses #17178

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 10 commits into from
Apr 1, 2025
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
Prev Previous commit
Next Next commit
feat: add frontend for app statuses
  • Loading branch information
kylecarbs committed Apr 1, 2025
commit 1728330ec835cb69d7f03216416d731ad0e21034
94 changes: 55 additions & 39 deletions coderd/apidoc/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
import type { Meta, StoryObj } from "@storybook/react";
import {
MockProxyLatencies,
MockWorkspace,
MockWorkspaceAgent,
MockWorkspaceApp,
MockWorkspaceAppStatus,
} from "testHelpers/entities";
import { WorkspaceAppStatus } from "./WorkspaceAppStatus";
import { getPreferredProxy, ProxyContext } from "contexts/ProxyContext";

const meta: Meta<typeof WorkspaceAppStatus> = {
title: "modules/workspaces/WorkspaceAppStatus",
component: WorkspaceAppStatus,
decorators: [
(Story) => (
<ProxyContext.Provider
value={{
proxyLatencies: MockProxyLatencies,
proxy: getPreferredProxy([], undefined),
proxies: [],
isLoading: false,
isFetched: true,
clearProxy: () => {
return;
},
setProxy: () => {
return;
},
refetchProxyLatencies: (): Date => {
return new Date();
},
}}
>
<Story />
</ProxyContext.Provider>
),
],
};

export default meta;
type Story = StoryObj<typeof WorkspaceAppStatus>;

export const Complete: Story = {
args: {
status: MockWorkspaceAppStatus,
},
};

export const Failure: Story = {
args: {
status: {
...MockWorkspaceAppStatus,
state: "failure",
message: "Couldn't figure out how to start the dev server",
},
},
};

export const Working: Story = {
args: {
status: {
...MockWorkspaceAppStatus,
state: "working",
message: "Starting dev server...",
uri: "",
},
},
};

export const LongURI: Story = {
args: {
status: {
...MockWorkspaceAppStatus,
uri: "https://www.google.com/search?q=hello+world+plus+a+lot+of+other+words",
},
},
};

export const FileURI: Story = {
args: {
status: {
...MockWorkspaceAppStatus,
uri: "file:///Users/jason/Desktop/test.txt",
},
},
};

export const LongMessage: Story = {
args: {
status: {
...MockWorkspaceAppStatus,
message:
"This is a long message that will wrap around the component. It should wrap many times because this is very very very very very long.",
},
},
};

export const WithApp: Story = {
args: {
status: MockWorkspaceAppStatus,
app: {
...MockWorkspaceApp,
},
agent: MockWorkspaceAgent,
workspace: MockWorkspace,
},
};
Loading
Loading
0