File tree 3 files changed +43
-18
lines changed 3 files changed +43
-18
lines changed Original file line number Diff line number Diff line change 1
1
import { Story } from "@storybook/react"
2
2
import {
3
3
MockWorkspace ,
4
+ MockWorkspaceAgent ,
4
5
MockWorkspaceApp ,
5
6
} from "../../testHelpers/renderHelpers"
6
7
import { AppLink , AppLinkProps } from "./AppLink"
@@ -22,6 +23,7 @@ WithIcon.args = {
22
23
sharing_level : "owner" ,
23
24
health : "healthy" ,
24
25
} ,
26
+ agent : MockWorkspaceAgent ,
25
27
}
26
28
27
29
export const WithoutIcon = Template . bind ( { } )
@@ -33,6 +35,7 @@ WithoutIcon.args = {
33
35
sharing_level : "owner" ,
34
36
health : "healthy" ,
35
37
} ,
38
+ agent : MockWorkspaceAgent ,
36
39
}
37
40
38
41
export const HealthDisabled = Template . bind ( { } )
@@ -44,6 +47,7 @@ HealthDisabled.args = {
44
47
sharing_level : "owner" ,
45
48
health : "disabled" ,
46
49
} ,
50
+ agent : MockWorkspaceAgent ,
47
51
}
48
52
49
53
export const HealthInitializing = Template . bind ( { } )
@@ -54,6 +58,7 @@ HealthInitializing.args = {
54
58
name : "code-server" ,
55
59
health : "initializing" ,
56
60
} ,
61
+ agent : MockWorkspaceAgent ,
57
62
}
58
63
59
64
export const HealthUnhealthy = Template . bind ( { } )
@@ -64,4 +69,5 @@ HealthUnhealthy.args = {
64
69
name : "code-server" ,
65
70
health : "unhealthy" ,
66
71
} ,
72
+ agent : MockWorkspaceAgent ,
67
73
}
Original file line number Diff line number Diff line change
1
+ import { Story } from "@storybook/react"
2
+ import { MockWorkspace , MockWorkspaceAgent } from "testHelpers/entities"
3
+ import { AgentRow , AgentRowProps } from "./AgentRow"
4
+
5
+ export default {
6
+ title : "components/AgentRow" ,
7
+ component : AgentRow ,
8
+ }
9
+
10
+ const Template : Story < AgentRowProps > = ( args ) => < AgentRow { ...args } />
11
+
12
+ export const Example = Template . bind ( { } )
13
+ Example . args = {
14
+ agent : MockWorkspaceAgent ,
15
+ workspace : MockWorkspace ,
16
+ applicationsHost : "" ,
17
+ showApps : true ,
18
+ }
19
+
20
+ export const HideSSHButton = Template . bind ( { } )
21
+ HideSSHButton . args = {
22
+ agent : MockWorkspaceAgent ,
23
+ workspace : MockWorkspace ,
24
+ applicationsHost : "" ,
25
+ showApps : true ,
26
+ hideSSHButton : true ,
27
+ }
28
+
29
+ export const NotShowingApps = Template . bind ( { } )
30
+ NotShowingApps . args = {
31
+ agent : MockWorkspaceAgent ,
32
+ workspace : MockWorkspace ,
33
+ applicationsHost : "" ,
34
+ showApps : false ,
35
+ }
Original file line number Diff line number Diff line change 1
1
import { Story } from "@storybook/react"
2
2
import {
3
- MockWorkspace ,
4
3
MockWorkspaceAgent ,
5
4
MockWorkspaceApp ,
6
5
MockWorkspaceResource ,
7
6
} from "testHelpers/entities"
7
+ import { AgentRowPreview } from "./AgentRowPreview"
8
8
import { ResourceCard , ResourceCardProps } from "./ResourceCard"
9
9
10
10
export default {
@@ -17,23 +17,7 @@ const Template: Story<ResourceCardProps> = (args) => <ResourceCard {...args} />
17
17
export const Example = Template . bind ( { } )
18
18
Example . args = {
19
19
resource : MockWorkspaceResource ,
20
- workspace : MockWorkspace ,
21
- applicationsHost : "https://dev.coder.com" ,
22
- hideSSHButton : false ,
23
- showApps : true ,
24
- serverVersion : MockWorkspaceAgent . version ,
25
- }
26
-
27
- export const NotShowingApps = Template . bind ( { } )
28
- NotShowingApps . args = {
29
- ...Example . args ,
30
- showApps : false ,
31
- }
32
-
33
- export const HideSSHButton = Template . bind ( { } )
34
- HideSSHButton . args = {
35
- ...Example . args ,
36
- hideSSHButton : true ,
20
+ agentRow : ( agent ) => < AgentRowPreview key = { agent . id } agent = { agent } /> ,
37
21
}
38
22
39
23
export const BunchOfApps = Template . bind ( { } )
You can’t perform that action at this time.
0 commit comments