Skip to content

feat: add impending deletion indicators to the workspace page #7588

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 9 commits into from
May 18, 2023
Merged
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
attempting to fix workspace stories
  • Loading branch information
Kira-Pilot committed May 17, 2023
commit 819983c282105fd5f8a4ea7486fff708ff0537e2
42 changes: 29 additions & 13 deletions site/src/components/Workspace/Workspace.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { action } from "@storybook/addon-actions"
import { Story } from "@storybook/react"
import { WatchAgentMetadataContext } from "components/Resources/AgentMetadata"
import { ProvisionerJobLog } from "api/typesGenerated"
import * as Mocks from "../../testHelpers/entities"
import * as Mocks from "testHelpers/entities"
import { Workspace, WorkspaceErrors, WorkspaceProps } from "./Workspace"
import { withReactContext } from "storybook-react-context"
import EventSource from "eventsourcemock"
import { ProxyContext, getPreferredProxy } from "contexts/ProxyContext"
import { MockProxyLatencies } from "../../testHelpers/entities"
import { DashboardProviderContext } from "components/Dashboard/DashboardProvider"

export default {
title: "components/Workspace",
Expand All @@ -24,21 +24,37 @@ export default {
],
}

const MockedAppearance = {
config: Mocks.MockAppearance,
preview: false,
setPreview: () => {},
save: () => {},
}

const Template: Story<WorkspaceProps> = (args) => (
<ProxyContext.Provider
<DashboardProviderContext.Provider
value={{
proxyLatencies: MockProxyLatencies,
proxy: getPreferredProxy([], undefined),
proxies: [],
isLoading: false,
isFetched: true,
setProxy: () => {
return
},
buildInfo: Mocks.MockBuildInfo,
entitlements: Mocks.MockEntitlementsWithScheduling,
experiments: Mocks.MockExperiments,
appearance: MockedAppearance,
}}
>
<Workspace {...args} />
</ProxyContext.Provider>
<ProxyContext.Provider
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I'm correct, but maybe, this ProxyContext is already inside of the DashboardProvider so we don't need that here too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can check!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly both are needed

value={{
proxyLatencies: Mocks.MockProxyLatencies,
proxy: getPreferredProxy([], undefined),
proxies: [],
isLoading: false,
isFetched: true,
setProxy: () => {
return
},
}}
>
<Workspace {...args} />
</ProxyContext.Provider>
</DashboardProviderContext.Provider>
)

export const Running = Template.bind({})
Expand Down