Skip to content

Commit 55a9f2d

Browse files
committed
Fix
1 parent cd6b0fc commit 55a9f2d

File tree

15 files changed

+220
-262
lines changed

15 files changed

+220
-262
lines changed

site/src/components/PaginationWidget/PaginationWidget.stories.tsx

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,11 @@ import { createPaginationRef } from "./utils"
55
export default {
66
title: "components/PaginationWidget",
77
component: PaginationWidget,
8-
argTypes: {
9-
prevLabel: {
10-
defaultValue: "Previous",
11-
},
12-
nextLabel: {
13-
defaultValue: "Next",
14-
},
15-
paginationRef: {
16-
defaultValue: createPaginationRef({ page: 1, limit: 12 }),
17-
},
18-
numRecords: {
19-
defaultValue: 200,
20-
},
8+
args: {
9+
prevLabel: "Previous",
10+
nextLabel: "Next",
11+
paginationRef: createPaginationRef({ page: 1, limit: 12 }),
12+
numRecords: 200,
2113
},
2214
}
2315

site/src/components/Resources/AgentMetadata.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
useRef,
2020
useState,
2121
} from "react"
22+
import { humanDuration } from "utils/duration"
2223

2324
export const WatchAgentMetadataContext = createContext(watchAgentMetadata)
2425

@@ -135,7 +136,6 @@ const MetadataItem: FC<{ item: WorkspaceAgentMetadata }> = ({ item }) => {
135136
<div
136137
className={styles.metadataLabel}
137138
onMouseEnter={() => setIsOpen(true)}
138-
// onMouseLeave={() => setIsOpen(false)}
139139
role="presentation"
140140
ref={labelAnchorRef}
141141
>
@@ -165,17 +165,16 @@ const MetadataItem: FC<{ item: WorkspaceAgentMetadata }> = ({ item }) => {
165165
{status === "stale" ? (
166166
<HelpTooltipText>
167167
This item is now stale because the agent hasn{"'"}t reported a new
168-
value in {dayjs.duration(item.result.age, "s").humanize()}.
168+
value in {humanDuration(item.result.age, "s")}.
169169
</HelpTooltipText>
170170
) : (
171171
<></>
172172
)}
173173
{status === "valid" ? (
174174
<HelpTooltipText>
175-
The agent collected this value{" "}
176-
{dayjs.duration(item.result.age, "s").humanize()} ago and will
177-
update it in{" "}
178-
{dayjs.duration(Math.min(updatesInSeconds, 0), "s").humanize()}.
175+
The agent collected this value {humanDuration(item.result.age, "s")}{" "}
176+
ago and will update it in{" "}
177+
{humanDuration(Math.min(updatesInSeconds, 0), "s")}.
179178
</HelpTooltipText>
180179
) : (
181180
<></>

site/src/components/TemplateLayout/TemplatePageHeader.stories.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,11 @@ import {
88
export default {
99
title: "Components/TemplatePageHeader",
1010
component: TemplatePageHeader,
11-
argTypes: {
12-
template: {
13-
defaultValue: MockTemplate,
14-
},
15-
activeVersion: {
16-
defaultValue: MockTemplateVersion,
17-
},
11+
args: {
12+
template: MockTemplate,
13+
activeVersion: MockTemplateVersion,
1814
permissions: {
19-
defaultValue: {
20-
canUpdateTemplate: true,
21-
},
15+
canUpdateTemplate: true,
2216
},
2317
},
2418
} as ComponentMeta<typeof TemplatePageHeader>

site/src/components/UsersTable/UsersTable.stories.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ import { UsersTable, UsersTableProps } from "./UsersTable"
99
export default {
1010
title: "components/UsersTable",
1111
component: UsersTable,
12-
argTypes: {
13-
isNonInitialPage: {
14-
defaultValue: false,
15-
},
12+
args: {
13+
isNonInitialPage: false,
1614
},
1715
} as ComponentMeta<typeof UsersTable>
1816

site/src/pages/AuditPage/AuditPageView.stories.tsx

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,11 @@ import { AuditPageView, AuditPageViewProps } from "./AuditPageView"
66
export default {
77
title: "pages/AuditPageView",
88
component: AuditPageView,
9-
argTypes: {
10-
auditLogs: {
11-
defaultValue: [MockAuditLog, MockAuditLog2],
12-
},
13-
count: {
14-
defaultValue: 1000,
15-
},
16-
paginationRef: {
17-
defaultValue: createPaginationRef({ page: 1, limit: 25 }),
18-
},
19-
isAuditLogVisible: {
20-
defaultValue: true,
21-
},
9+
args: {
10+
auditLogs: [MockAuditLog, MockAuditLog2],
11+
count: 1000,
12+
paginationRef: createPaginationRef({ page: 1, limit: 25 }),
13+
isAuditLogVisible: true,
2214
},
2315
} as ComponentMeta<typeof AuditPageView>
2416

site/src/pages/DeploySettingsPage/AppearanceSettingsPage/AppearanceSettingsPageView.stories.tsx

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,18 @@ import {
77
export default {
88
title: "pages/AppearanceSettingsPageView",
99
component: AppearanceSettingsPageView,
10-
argTypes: {
10+
args: {
1111
appearance: {
12-
defaultValue: {
13-
logo_url: "https://github.com/coder.png",
14-
service_banner: {
15-
enabled: true,
16-
message: "hello world",
17-
background_color: "white",
18-
},
12+
logo_url: "https://github.com/coder.png",
13+
service_banner: {
14+
enabled: true,
15+
message: "hello world",
16+
background_color: "white",
1917
},
2018
},
21-
isEntitled: {
22-
defaultValue: false,
23-
},
24-
updateAppearance: {
25-
defaultValue: () => {
26-
return undefined
27-
},
19+
isEntitled: false,
20+
updateAppearance: () => {
21+
return undefined
2822
},
2923
},
3024
} as ComponentMeta<typeof AppearanceSettingsPageView>

site/src/pages/DeploySettingsPage/GeneralSettingsPage/GeneralSettingsPageView.stories.tsx

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,22 @@ import {
1111
export default {
1212
title: "pages/GeneralSettingsPageView",
1313
component: GeneralSettingsPageView,
14-
argTypes: {
15-
deploymentOptions: {
16-
defaultValue: [
17-
{
18-
name: "Access URL",
19-
usage:
20-
"External URL to access your deployment. This must be accessible by all provisioned workspaces.",
21-
value: "https://dev.coder.com",
22-
},
23-
{
24-
name: "Wildcard Access URL",
25-
usage:
26-
'Specifies the wildcard hostname to use for workspace applications in the form "*.example.com".',
27-
value: "*--apps.dev.coder.com",
28-
},
29-
],
30-
},
31-
deploymentDAUs: {
32-
defaultValue: MockDeploymentDAUResponse,
33-
},
14+
args: {
15+
deploymentOptions: [
16+
{
17+
name: "Access URL",
18+
description:
19+
"External URL to access your deployment. This must be accessible by all provisioned workspaces.",
20+
value: "https://dev.coder.com",
21+
},
22+
{
23+
name: "Wildcard Access URL",
24+
description:
25+
'Specifies the wildcard hostname to use for workspace applications in the form "*.example.com".',
26+
value: "*--apps.dev.coder.com",
27+
},
28+
],
29+
deploymentDAUs: MockDeploymentDAUResponse,
3430
},
3531
} as ComponentMeta<typeof GeneralSettingsPageView>
3632

site/src/pages/DeploySettingsPage/GitAuthSettingsPage/GitAuthSettingsPageView.stories.tsx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,16 @@ import {
77
export default {
88
title: "pages/GitAuthSettingsPageView",
99
component: GitAuthSettingsPageView,
10-
argTypes: {
10+
args: {
1111
config: {
12-
defaultValue: {
13-
git_auth: [
14-
{
15-
id: "0000-1111",
16-
type: "GitHub",
17-
client_id: "client_id",
18-
regex: "regex",
19-
},
20-
],
21-
},
12+
git_auth: [
13+
{
14+
id: "0000-1111",
15+
type: "GitHub",
16+
client_id: "client_id",
17+
regex: "regex",
18+
},
19+
],
2220
},
2321
},
2422
} as ComponentMeta<typeof GitAuthSettingsPageView>

site/src/pages/DeploySettingsPage/NetworkSettingsPage/NetworkSettingsPageView.stories.tsx

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,52 +7,50 @@ import {
77
export default {
88
title: "pages/NetworkSettingsPageView",
99
component: NetworkSettingsPageView,
10-
argTypes: {
11-
options: {
12-
defaultValue: [
13-
{
14-
name: "DERP Server Enable",
15-
usage: "Whether to enable or disable the embedded DERP relay server.",
16-
value: true,
17-
group: {
18-
name: "Networking",
19-
},
10+
args: {
11+
options: [
12+
{
13+
name: "DERP Server Enable",
14+
usage: "Whether to enable or disable the embedded DERP relay server.",
15+
value: true,
16+
group: {
17+
name: "Networking",
2018
},
21-
{
22-
name: "DERP Server Region Name",
23-
usage: "Region name that for the embedded DERP server.",
24-
value: "aws-east",
25-
group: {
26-
name: "Networking",
27-
},
19+
},
20+
{
21+
name: "DERP Server Region Name",
22+
usage: "Region name that for the embedded DERP server.",
23+
value: "aws-east",
24+
group: {
25+
name: "Networking",
2826
},
29-
{
30-
name: "DERP Server STUN Addresses",
31-
usage:
32-
"Addresses for STUN servers to establish P2P connections. Set empty to disable P2P connections.",
33-
value: ["stun.l.google.com:19302", "stun.l.google.com:19301"],
34-
group: {
35-
name: "Networking",
36-
},
27+
},
28+
{
29+
name: "DERP Server STUN Addresses",
30+
usage:
31+
"Addresses for STUN servers to establish P2P connections. Set empty to disable P2P connections.",
32+
value: ["stun.l.google.com:19302", "stun.l.google.com:19301"],
33+
group: {
34+
name: "Networking",
3735
},
38-
{
39-
name: "DERP Config URL",
40-
usage:
41-
"URL to fetch a DERP mapping on startup. See: https://tailscale.com/kb/1118/custom-derp-servers/",
42-
value: "https://coder.com",
43-
group: {
44-
name: "Networking",
45-
},
36+
},
37+
{
38+
name: "DERP Config URL",
39+
usage:
40+
"URL to fetch a DERP mapping on startup. See: https://tailscale.com/kb/1118/custom-derp-servers/",
41+
value: "https://coder.com",
42+
group: {
43+
name: "Networking",
4644
},
47-
{
48-
name: "Wildcard Access URL",
49-
value: "https://coder.com",
50-
group: {
51-
name: "Networking",
52-
},
45+
},
46+
{
47+
name: "Wildcard Access URL",
48+
value: "https://coder.com",
49+
group: {
50+
name: "Networking",
5351
},
54-
],
55-
},
52+
},
53+
],
5654
},
5755
} as ComponentMeta<typeof NetworkSettingsPageView>
5856

site/src/pages/DeploySettingsPage/SecuritySettingsPage/SecuritySettingsPageView.stories.tsx

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,34 @@ import {
88
export default {
99
title: "pages/SecuritySettingsPageView",
1010
component: SecuritySettingsPageView,
11-
argTypes: {
12-
options: {
13-
defaultValue: [
14-
{
15-
name: "SSH Keygen Algorithm",
16-
usage: "something",
17-
value: "1234",
11+
args: {
12+
options: [
13+
{
14+
name: "SSH Keygen Algorithm",
15+
description: "something",
16+
value: "1234",
17+
},
18+
{
19+
name: "Secure Auth Cookie",
20+
description: "something",
21+
value: "1234",
22+
},
23+
{
24+
name: "Disable Owner Workspace Execution",
25+
description: "something",
26+
value: false,
27+
},
28+
{
29+
name: "TLS Version",
30+
description: "something",
31+
value: ["something"],
32+
group: {
33+
name: "TLS",
1834
},
19-
{
20-
name: "Secure Auth Cookie",
21-
usage: "something",
22-
value: "1234",
23-
},
24-
{
25-
name: "Disable Owner Workspace Execution",
26-
usage: "something",
27-
value: false,
28-
},
29-
{
30-
name: "TLS Version",
31-
usage: "something",
32-
value: ["something"],
33-
group: {
34-
name: "TLS",
35-
},
36-
},
37-
],
38-
},
39-
featureAuditLogEnabled: {
40-
defaultValue: true,
41-
},
42-
featureBrowserOnlyEnabled: {
43-
defaultValue: true,
44-
},
35+
},
36+
],
37+
featureAuditLogEnabled: true,
38+
featureBrowserOnlyEnabled: true,
4539
},
4640
} as ComponentMeta<typeof SecuritySettingsPageView>
4741

0 commit comments

Comments
 (0)