- Notifications
You must be signed in to change notification settings - Fork906
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
10 commits Select commitHold shift + click to select a range
acd5868
feat: add app status tracking to the backend
kylecarbs14ffd6b
Move workspace app and build fetching into errgroup
kylecarbs333d661
Fix linting errors and tests
kylecarbsa60a3b7
gen
kylecarbs1728330
feat: add frontend for app statuses
kylecarbsb47c2b0
Fix linting errors
kylecarbsbf83158
Fix formatting and linting
kylecarbs25809fc
Organize imports
kylecarbs28cc5b6
Fix imports
kylecarbse6bc4de
Fix icon on mock app
kylecarbsFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
108 changes: 108 additions & 0 deletionssite/src/modules/workspaces/WorkspaceAppStatus/WorkspaceAppStatus.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import { ProxyContext, getPreferredProxy } from "contexts/ProxyContext"; | ||
import { | ||
MockProxyLatencies, | ||
MockWorkspace, | ||
MockWorkspaceAgent, | ||
MockWorkspaceApp, | ||
MockWorkspaceAppStatus, | ||
} from "testHelpers/entities"; | ||
import { WorkspaceAppStatus } from "./WorkspaceAppStatus"; | ||
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, | ||
}, | ||
}; |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.