From 8499bcbf863338b8bcafccb83ad818fb0d33599c Mon Sep 17 00:00:00 2001 From: BrunoQuaresma Date: Wed, 6 Sep 2023 19:06:47 +0000 Subject: [PATCH 01/46] Refactor Alert --- site/src/components/Alert/Alert.stories.tsx | 13 ------------- site/src/components/Alert/Alert.tsx | 9 --------- site/src/components/Alert/ErrorAlert.stories.tsx | 11 ----------- 3 files changed, 33 deletions(-) diff --git a/site/src/components/Alert/Alert.stories.tsx b/site/src/components/Alert/Alert.stories.tsx index 42142a77c98c9..797157de85abb 100644 --- a/site/src/components/Alert/Alert.stories.tsx +++ b/site/src/components/Alert/Alert.stories.tsx @@ -1,6 +1,5 @@ import { Alert } from "./Alert"; import Button from "@mui/material/Button"; -import Link from "@mui/material/Link"; import type { Meta, StoryObj } from "@storybook/react"; const meta: Meta = { @@ -21,7 +20,6 @@ export const Success: Story = { args: { children: "You're doing great!", severity: "success", - onRetry: undefined, }, }; @@ -56,14 +54,3 @@ export const WarningWithActionAndDismiss: Story = { severity: "warning", }, }; - -export const WithChildren: Story = { - args: { - severity: "warning", - children: ( -
- This is a message with a link -
- ), - }, -}; diff --git a/site/src/components/Alert/Alert.tsx b/site/src/components/Alert/Alert.tsx index b0cba398c7981..fb3f5e07c170d 100644 --- a/site/src/components/Alert/Alert.tsx +++ b/site/src/components/Alert/Alert.tsx @@ -8,14 +8,12 @@ import Box from "@mui/material/Box"; export type AlertProps = MuiAlertProps & { actions?: ReactNode; dismissible?: boolean; - onRetry?: () => void; onDismiss?: () => void; }; export const Alert: FC = ({ children, actions, - onRetry, dismissible, severity, onDismiss, @@ -34,13 +32,6 @@ export const Alert: FC = ({ {/* CTAs passed in by the consumer */} {actions} - {/* retry CTA */} - {onRetry && ( - - )} - {/* close CTA */} {dismissible && ( , }, }; From 2320111902e6d7bf5f51a94a3aaeed2162fbde5b Mon Sep 17 00:00:00 2001 From: BrunoQuaresma Date: Thu, 7 Sep 2023 16:06:04 +0000 Subject: [PATCH 41/46] Refactor HelpTooltip stories --- .../HelpTooltip/HelpTooltip.stories.tsx | 48 ++++++++----------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/site/src/components/HelpTooltip/HelpTooltip.stories.tsx b/site/src/components/HelpTooltip/HelpTooltip.stories.tsx index 096f63b69e842..3f90452715c68 100644 --- a/site/src/components/HelpTooltip/HelpTooltip.stories.tsx +++ b/site/src/components/HelpTooltip/HelpTooltip.stories.tsx @@ -2,41 +2,35 @@ import { HelpTooltip, HelpTooltipLink, HelpTooltipLinksGroup, - HelpTooltipProps, HelpTooltipText, HelpTooltipTitle, } from "./HelpTooltip"; import type { Meta, StoryObj } from "@storybook/react"; -const Template = (props: HelpTooltipProps) => ( - - What is a template? - - A template is a common configuration for your team's workspaces. - - - - Creating a template - - - Updating a template - - - -); - const meta: Meta = { - title: "components/HelpTooltip/HelpTooltip", - component: Template, + title: "components/HelpTooltip", + component: HelpTooltip, + args: { + children: ( + <> + What is a template? + + A template is a common configuration for your team's workspaces. + + + + Creating a template + + + Updating a template + + + + ), + }, }; export default meta; type Story = StoryObj; -export const Close: Story = {}; - -export const Open: Story = { - args: { - open: true, - }, -}; +export const Example: Story = {}; From 780cb6e2b6ff80f96b2a8dbc6088f888033005dc Mon Sep 17 00:00:00 2001 From: BrunoQuaresma Date: Thu, 7 Sep 2023 16:07:21 +0000 Subject: [PATCH 42/46] Remove not valid ErrorAlert story --- site/src/components/Alert/ErrorAlert.stories.tsx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/site/src/components/Alert/ErrorAlert.stories.tsx b/site/src/components/Alert/ErrorAlert.stories.tsx index e5d0d828ee941..64e6af8435f5b 100644 --- a/site/src/components/Alert/ErrorAlert.stories.tsx +++ b/site/src/components/Alert/ErrorAlert.stories.tsx @@ -53,12 +53,6 @@ export const WithActionAndDismiss: Story = { }, }; -export const WithRetry: Story = { - args: { - dismissible: true, - }, -}; - export const WithNonApiError: Story = { args: { error: new Error("Non API error here"), From 63734083d1b3ffbaa43e826692f56549ca39232a Mon Sep 17 00:00:00 2001 From: BrunoQuaresma Date: Thu, 7 Sep 2023 16:09:59 +0000 Subject: [PATCH 43/46] Fix AvatarData story --- site/src/components/AvatarData/AvatarData.stories.tsx | 2 +- site/src/components/AvatarData/AvatarData.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/site/src/components/AvatarData/AvatarData.stories.tsx b/site/src/components/AvatarData/AvatarData.stories.tsx index 780f6c475e32e..9457395dae09b 100644 --- a/site/src/components/AvatarData/AvatarData.stories.tsx +++ b/site/src/components/AvatarData/AvatarData.stories.tsx @@ -17,6 +17,6 @@ export const WithTitleAndSubtitle: Story = {}; export const WithImage: Story = { args: { - src: "https://AvatarDatas.githubusercontent.com/u/95932066?s=200&v=4", + src: "https://avatars.githubusercontent.com/u/95932066?s=200&v=4", }, }; diff --git a/site/src/components/AvatarData/AvatarData.tsx b/site/src/components/AvatarData/AvatarData.tsx index f7e4264af3bbc..8c0bb55fdc1cf 100644 --- a/site/src/components/AvatarData/AvatarData.tsx +++ b/site/src/components/AvatarData/AvatarData.tsx @@ -1,5 +1,5 @@ import { Avatar } from "components/Avatar/Avatar"; -import { FC, PropsWithChildren } from "react"; +import { FC } from "react"; import { Stack } from "components/Stack/Stack"; import { makeStyles } from "@mui/styles"; @@ -10,7 +10,7 @@ export interface AvatarDataProps { avatar?: React.ReactNode; } -export const AvatarData: FC> = ({ +export const AvatarData: FC = ({ title, subtitle, src, From 1a3e58b2af1e36067da7e61737893cacaea545b7 Mon Sep 17 00:00:00 2001 From: BrunoQuaresma Date: Thu, 7 Sep 2023 16:11:20 +0000 Subject: [PATCH 44/46] Add border back to CodeExample --- site/src/components/CodeExample/CodeExample.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/site/src/components/CodeExample/CodeExample.tsx b/site/src/components/CodeExample/CodeExample.tsx index 22a6548517fef..34cf1cb50a31f 100644 --- a/site/src/components/CodeExample/CodeExample.tsx +++ b/site/src/components/CodeExample/CodeExample.tsx @@ -46,6 +46,7 @@ const useStyles = makeStyles((theme) => ({ borderRadius: theme.shape.borderRadius, padding: theme.spacing(1), lineHeight: "150%", + border: `1px solid ${theme.palette.divider}`, }), code: { padding: theme.spacing(0, 1), From cd65980b45392abd9c38bce5a04cc266b18f62ef Mon Sep 17 00:00:00 2001 From: BrunoQuaresma Date: Thu, 7 Sep 2023 16:12:20 +0000 Subject: [PATCH 45/46] Fix Navbar story --- site/src/components/Dashboard/Navbar/NavbarView.stories.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/components/Dashboard/Navbar/NavbarView.stories.tsx b/site/src/components/Dashboard/Navbar/NavbarView.stories.tsx index f7c6d46acbdb0..a936a75657b89 100644 --- a/site/src/components/Dashboard/Navbar/NavbarView.stories.tsx +++ b/site/src/components/Dashboard/Navbar/NavbarView.stories.tsx @@ -20,7 +20,7 @@ export const ForMember: Story = { user: MockUser2, canViewAuditLog: false, canViewDeployment: false, - canViewAllUsers: true, + canViewAllUsers: false, }, }; From f6dcba8bfc85e5681d2da0ed7b6cbccbebffa3a4 Mon Sep 17 00:00:00 2001 From: BrunoQuaresma Date: Thu, 7 Sep 2023 16:18:36 +0000 Subject: [PATCH 46/46] Fix AgentRow proxy in the stories --- .../components/Resources/AgentRow.stories.tsx | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/site/src/components/Resources/AgentRow.stories.tsx b/site/src/components/Resources/AgentRow.stories.tsx index e4550a90840c2..08a49a2fc0141 100644 --- a/site/src/components/Resources/AgentRow.stories.tsx +++ b/site/src/components/Resources/AgentRow.stories.tsx @@ -109,6 +109,30 @@ const meta: Meta = { showApps: true, storybookAgentMetadata: defaultAgentMetadata, }, + decorators: [ + (Story) => ( + { + return; + }, + clearProxy: () => { + return; + }, + refetchProxyLatencies: (): Date => { + return new Date(); + }, + }} + > + + + ), + ], }; export default meta;