Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc06765b

Browse files
committed
Fix story
1 parenta20827c commitc06765b

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

‎site/src/pages/WorkspacesPage/WorkspacesPageView.stories.tsx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@ const createWorkspaceItemRef = (
2121
transition:WorkspaceTransition="start",
2222
outdated=false,
2323
lastUsedAt="0001-01-01",
24+
id?:string,
2425
):WorkspaceItemMachineRef=>{
26+
constwsId=id??MockWorkspace.id
2527
returnspawn(
2628
workspaceItemMachine.withContext({
2729
data:{
2830
...MockWorkspace,
31+
id:wsId,
2932
outdated,
3033
latest_build:{
3134
...MockWorkspace.latest_build,
@@ -83,6 +86,18 @@ const additionalWorkspaces: Record<string, WorkspaceItemMachineRef> = {
8386
),
8487
}
8588

89+
constfillerWorkspaces=Array(14)
90+
.fill(undefined)
91+
.map((_,i)=>
92+
createWorkspaceItemRef(
93+
"running",
94+
undefined,
95+
true,
96+
dayjs().toString(),
97+
`test-workspace-${i}`,
98+
),
99+
)
100+
86101
exportdefault{
87102
title:"pages/WorkspacesPageView",
88103
component:WorkspacesPageView,
@@ -94,6 +109,18 @@ export default {
94109
],
95110
mapping:{ ...workspaces, ...additionalWorkspaces},
96111
},
112+
onFilter:{
113+
action:"filter",
114+
},
115+
onGoToPage:{
116+
action:"go to page",
117+
},
118+
onNext:{
119+
action:"next",
120+
},
121+
onPrevious:{
122+
action:"previous",
123+
},
97124
},
98125
}asComponentMeta<typeofWorkspacesPageView>
99126

@@ -107,16 +134,29 @@ AllStates.args = {
107134
...Object.values(workspaces),
108135
...Object.values(additionalWorkspaces),
109136
],
137+
count:14,
110138
}
111139

112140
exportconstOwnerHasNoWorkspaces=Template.bind({})
113141
OwnerHasNoWorkspaces.args={
114142
workspaceRefs:[],
143+
count:0,
115144
filter:workspaceFilterQuery.me,
116145
}
117146

118147
exportconstNoResults=Template.bind({})
119148
NoResults.args={
120149
workspaceRefs:[],
150+
count:0,
121151
filter:"searchtearmwithnoresults",
122152
}
153+
154+
exportconstTwoPages=Template.bind({})
155+
TwoPages.args={
156+
workspaceRefs:[
157+
...Object.values(workspaces),
158+
...Object.values(additionalWorkspaces),
159+
...fillerWorkspaces,
160+
],
161+
count:28,
162+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp