Skip to content

chore(site): Upgrade storybook to 7.0.4 #7127

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 7 commits into from
Apr 13, 2023
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
  • Loading branch information
BrunoQuaresma committed Apr 13, 2023
commit 55a9f2d4ef66f47b6725331d1b663471759f60c5
18 changes: 5 additions & 13 deletions site/src/components/PaginationWidget/PaginationWidget.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,11 @@ import { createPaginationRef } from "./utils"
export default {
title: "components/PaginationWidget",
component: PaginationWidget,
argTypes: {
prevLabel: {
defaultValue: "Previous",
},
nextLabel: {
defaultValue: "Next",
},
paginationRef: {
defaultValue: createPaginationRef({ page: 1, limit: 12 }),
},
numRecords: {
defaultValue: 200,
},
args: {
prevLabel: "Previous",
nextLabel: "Next",
paginationRef: createPaginationRef({ page: 1, limit: 12 }),
numRecords: 200,
},
}

Expand Down
11 changes: 5 additions & 6 deletions site/src/components/Resources/AgentMetadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
useRef,
useState,
} from "react"
import { humanDuration } from "utils/duration"

export const WatchAgentMetadataContext = createContext(watchAgentMetadata)

Expand Down Expand Up @@ -135,7 +136,6 @@ const MetadataItem: FC<{ item: WorkspaceAgentMetadata }> = ({ item }) => {
<div
className={styles.metadataLabel}
onMouseEnter={() => setIsOpen(true)}
// onMouseLeave={() => setIsOpen(false)}
role="presentation"
ref={labelAnchorRef}
>
Expand Down Expand Up @@ -165,17 +165,16 @@ const MetadataItem: FC<{ item: WorkspaceAgentMetadata }> = ({ item }) => {
{status === "stale" ? (
<HelpTooltipText>
This item is now stale because the agent hasn{"'"}t reported a new
value in {dayjs.duration(item.result.age, "s").humanize()}.
value in {humanDuration(item.result.age, "s")}.
</HelpTooltipText>
) : (
<></>
)}
{status === "valid" ? (
<HelpTooltipText>
The agent collected this value{" "}
{dayjs.duration(item.result.age, "s").humanize()} ago and will
update it in{" "}
{dayjs.duration(Math.min(updatesInSeconds, 0), "s").humanize()}.
The agent collected this value {humanDuration(item.result.age, "s")}{" "}
ago and will update it in{" "}
{humanDuration(Math.min(updatesInSeconds, 0), "s")}.
</HelpTooltipText>
) : (
<></>
Expand Down
14 changes: 4 additions & 10 deletions site/src/components/TemplateLayout/TemplatePageHeader.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@ import {
export default {
title: "Components/TemplatePageHeader",
component: TemplatePageHeader,
argTypes: {
template: {
defaultValue: MockTemplate,
},
activeVersion: {
defaultValue: MockTemplateVersion,
},
args: {
template: MockTemplate,
activeVersion: MockTemplateVersion,
permissions: {
defaultValue: {
canUpdateTemplate: true,
},
canUpdateTemplate: true,
},
},
} as ComponentMeta<typeof TemplatePageHeader>
Expand Down
6 changes: 2 additions & 4 deletions site/src/components/UsersTable/UsersTable.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ import { UsersTable, UsersTableProps } from "./UsersTable"
export default {
title: "components/UsersTable",
component: UsersTable,
argTypes: {
isNonInitialPage: {
defaultValue: false,
},
args: {
isNonInitialPage: false,
},
} as ComponentMeta<typeof UsersTable>

Expand Down
18 changes: 5 additions & 13 deletions site/src/pages/AuditPage/AuditPageView.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,11 @@ import { AuditPageView, AuditPageViewProps } from "./AuditPageView"
export default {
title: "pages/AuditPageView",
component: AuditPageView,
argTypes: {
auditLogs: {
defaultValue: [MockAuditLog, MockAuditLog2],
},
count: {
defaultValue: 1000,
},
paginationRef: {
defaultValue: createPaginationRef({ page: 1, limit: 25 }),
},
isAuditLogVisible: {
defaultValue: true,
},
args: {
auditLogs: [MockAuditLog, MockAuditLog2],
count: 1000,
paginationRef: createPaginationRef({ page: 1, limit: 25 }),
isAuditLogVisible: true,
},
} as ComponentMeta<typeof AuditPageView>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,18 @@ import {
export default {
title: "pages/AppearanceSettingsPageView",
component: AppearanceSettingsPageView,
argTypes: {
args: {
appearance: {
defaultValue: {
logo_url: "https://github.com/coder.png",
service_banner: {
enabled: true,
message: "hello world",
background_color: "white",
},
logo_url: "https://github.com/coder.png",
service_banner: {
enabled: true,
message: "hello world",
background_color: "white",
},
},
isEntitled: {
defaultValue: false,
},
updateAppearance: {
defaultValue: () => {
return undefined
},
isEntitled: false,
updateAppearance: () => {
return undefined
},
},
} as ComponentMeta<typeof AppearanceSettingsPageView>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,22 @@ import {
export default {
title: "pages/GeneralSettingsPageView",
component: GeneralSettingsPageView,
argTypes: {
deploymentOptions: {
defaultValue: [
{
name: "Access URL",
usage:
"External URL to access your deployment. This must be accessible by all provisioned workspaces.",
value: "https://dev.coder.com",
},
{
name: "Wildcard Access URL",
usage:
'Specifies the wildcard hostname to use for workspace applications in the form "*.example.com".',
value: "*--apps.dev.coder.com",
},
],
},
deploymentDAUs: {
defaultValue: MockDeploymentDAUResponse,
},
args: {
deploymentOptions: [
{
name: "Access URL",
description:
"External URL to access your deployment. This must be accessible by all provisioned workspaces.",
value: "https://dev.coder.com",
},
{
name: "Wildcard Access URL",
description:
'Specifies the wildcard hostname to use for workspace applications in the form "*.example.com".',
value: "*--apps.dev.coder.com",
},
],
deploymentDAUs: MockDeploymentDAUResponse,
},
} as ComponentMeta<typeof GeneralSettingsPageView>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ import {
export default {
title: "pages/GitAuthSettingsPageView",
component: GitAuthSettingsPageView,
argTypes: {
args: {
config: {
defaultValue: {
git_auth: [
{
id: "0000-1111",
type: "GitHub",
client_id: "client_id",
regex: "regex",
},
],
},
git_auth: [
{
id: "0000-1111",
type: "GitHub",
client_id: "client_id",
regex: "regex",
},
],
},
},
} as ComponentMeta<typeof GitAuthSettingsPageView>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,50 @@ import {
export default {
title: "pages/NetworkSettingsPageView",
component: NetworkSettingsPageView,
argTypes: {
options: {
defaultValue: [
{
name: "DERP Server Enable",
usage: "Whether to enable or disable the embedded DERP relay server.",
value: true,
group: {
name: "Networking",
},
args: {
options: [
{
name: "DERP Server Enable",
usage: "Whether to enable or disable the embedded DERP relay server.",
value: true,
group: {
name: "Networking",
},
{
name: "DERP Server Region Name",
usage: "Region name that for the embedded DERP server.",
value: "aws-east",
group: {
name: "Networking",
},
},
{
name: "DERP Server Region Name",
usage: "Region name that for the embedded DERP server.",
value: "aws-east",
group: {
name: "Networking",
},
{
name: "DERP Server STUN Addresses",
usage:
"Addresses for STUN servers to establish P2P connections. Set empty to disable P2P connections.",
value: ["stun.l.google.com:19302", "stun.l.google.com:19301"],
group: {
name: "Networking",
},
},
{
name: "DERP Server STUN Addresses",
usage:
"Addresses for STUN servers to establish P2P connections. Set empty to disable P2P connections.",
value: ["stun.l.google.com:19302", "stun.l.google.com:19301"],
group: {
name: "Networking",
},
{
name: "DERP Config URL",
usage:
"URL to fetch a DERP mapping on startup. See: https://tailscale.com/kb/1118/custom-derp-servers/",
value: "https://coder.com",
group: {
name: "Networking",
},
},
{
name: "DERP Config URL",
usage:
"URL to fetch a DERP mapping on startup. See: https://tailscale.com/kb/1118/custom-derp-servers/",
value: "https://coder.com",
group: {
name: "Networking",
},
{
name: "Wildcard Access URL",
value: "https://coder.com",
group: {
name: "Networking",
},
},
{
name: "Wildcard Access URL",
value: "https://coder.com",
group: {
name: "Networking",
},
],
},
},
],
},
} as ComponentMeta<typeof NetworkSettingsPageView>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,34 @@ import {
export default {
title: "pages/SecuritySettingsPageView",
component: SecuritySettingsPageView,
argTypes: {
options: {
defaultValue: [
{
name: "SSH Keygen Algorithm",
usage: "something",
value: "1234",
args: {
options: [
{
name: "SSH Keygen Algorithm",
description: "something",
value: "1234",
},
{
name: "Secure Auth Cookie",
description: "something",
value: "1234",
},
{
name: "Disable Owner Workspace Execution",
description: "something",
value: false,
},
{
name: "TLS Version",
description: "something",
value: ["something"],
group: {
name: "TLS",
},
{
name: "Secure Auth Cookie",
usage: "something",
value: "1234",
},
{
name: "Disable Owner Workspace Execution",
usage: "something",
value: false,
},
{
name: "TLS Version",
usage: "something",
value: ["something"],
group: {
name: "TLS",
},
},
],
},
featureAuditLogEnabled: {
defaultValue: true,
},
featureBrowserOnlyEnabled: {
defaultValue: true,
},
},
],
featureAuditLogEnabled: true,
featureBrowserOnlyEnabled: true,
},
} as ComponentMeta<typeof SecuritySettingsPageView>

Expand Down
Loading