Skip to content

chore(site): upgrade msw to 2.0 #12597

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 16 commits into from
Mar 19, 2024
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
Fix metadata stuff
  • Loading branch information
BrunoQuaresma committed Mar 18, 2024
commit 374f6c41ec78e93a9bfd5545a2d1b4607edeb463
7 changes: 1 addition & 6 deletions site/src/modules/resources/AgentMetadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ import Skeleton from "@mui/material/Skeleton";
import Tooltip from "@mui/material/Tooltip";
import dayjs from "dayjs";
import {
createContext,
type FC,
type HTMLAttributes,
useContext,
useEffect,
useLayoutEffect,
useRef,
Expand All @@ -22,8 +20,6 @@ import { MONOSPACE_FONT_FAMILY } from "theme/constants";

type ItemStatus = "stale" | "valid" | "loading";

export const WatchAgentMetadataContext = createContext(watchAgentMetadata);

export interface AgentMetadataViewProps {
metadata: WorkspaceAgentMetadata[];
}
Expand Down Expand Up @@ -53,7 +49,6 @@ export const AgentMetadata: FC<AgentMetadataProps> = ({
const [metadata, setMetadata] = useState<
WorkspaceAgentMetadata[] | undefined
>(undefined);
const watchAgentMetadata = useContext(WatchAgentMetadataContext);

useEffect(() => {
if (storybookMetadata !== undefined) {
Expand Down Expand Up @@ -88,7 +83,7 @@ export const AgentMetadata: FC<AgentMetadataProps> = ({
};
};
return connect();
}, [agent.id, watchAgentMetadata, storybookMetadata]);
}, [agent.id, storybookMetadata]);

if (metadata === undefined) {
return (
Expand Down
9 changes: 0 additions & 9 deletions site/src/pages/WorkspacePage/Workspace.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { action } from "@storybook/addon-actions";
import type { Meta, StoryObj } from "@storybook/react";
import { withReactContext } from "storybook-react-context";
import type { ProvisionerJobLog } from "api/typesGenerated";
import { ProxyContext, getPreferredProxy } from "contexts/ProxyContext";
import EventSource from "eventsourcemock";
import { DashboardContext } from "modules/dashboard/DashboardProvider";
import { WatchAgentMetadataContext } from "modules/resources/AgentMetadata";
import * as Mocks from "testHelpers/entities";
import type { WorkspacePermissions } from "./permissions";
import { Workspace } from "./Workspace";
Expand Down Expand Up @@ -68,12 +65,6 @@ const meta: Meta<typeof Workspace> = {
</ProxyContext.Provider>
</DashboardContext.Provider>
),
withReactContext({
Context: WatchAgentMetadataContext,
initialState: (_: string): EventSource => {
return new EventSource();
},
}),
],
};

Expand Down