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

Commitfcbdd1a

Browse files
refactor: replace badge by status indicator (#17811)
**Why?**In the workspaces page, it is using the status indicator, and not thebadge anymore, so to keep the UI consistent, I'm replacing the badge bythe indicator in the workspace page too.**Before:**<img width="672" alt="Screenshot 2025-05-13 at 19 14 17"src="https://github.com/user-attachments/assets/0e8ea4bd-68d1-4d27-b81b-f79f15cabb2c"/>**After:**<img width="672" alt="Screenshot 2025-05-13 at 19 14 21"src="https://github.com/user-attachments/assets/45719262-011e-4fc8-9ebe-fe9e33d9d572"/>
1 parent80e1be0 commitfcbdd1a

File tree

7 files changed

+151
-237
lines changed

7 files changed

+151
-237
lines changed

‎site/e2e/helpers.ts

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export const createWorkspace = async (
152152
constuser=currentUser(page);
153153
awaitexpectUrl(page).toHavePathName(`/@${user.username}/${name}`);
154154

155-
awaitpage.waitForSelector("[data-testid='build-status'] >> text=Running",{
155+
awaitpage.waitForSelector("text=Workspacestatus:Running",{
156156
state:"visible",
157157
});
158158
returnname;
@@ -364,7 +364,7 @@ export const stopWorkspace = async (page: Page, workspaceName: string) => {
364364

365365
awaitpage.getByTestId("workspace-stop-button").click();
366366

367-
awaitpage.waitForSelector("*[data-testid='build-status'] >> text=Stopped",{
367+
awaitpage.waitForSelector("text=Workspacestatus:Stopped",{
368368
state:"visible",
369369
});
370370
};
@@ -389,7 +389,7 @@ export const buildWorkspaceWithParameters = async (
389389
awaitpage.getByTestId("confirm-button").click();
390390
}
391391

392-
awaitpage.waitForSelector("*[data-testid='build-status'] >> text=Running",{
392+
awaitpage.waitForSelector("text=Workspacestatus:Running",{
393393
state:"visible",
394394
});
395395
};
@@ -412,11 +412,12 @@ export const startAgent = async (
412412
exportconstdownloadCoderVersion=async(
413413
version:string,
414414
):Promise<string>=>{
415-
if(version.startsWith("v")){
416-
version=version.slice(1);
415+
letversionNumber=version;
416+
if(versionNumber.startsWith("v")){
417+
versionNumber=versionNumber.slice(1);
417418
}
418419

419-
constbinaryName=`coder-e2e-${version}`;
420+
constbinaryName=`coder-e2e-${versionNumber}`;
420421
consttempDir="/tmp/coder-e2e-cache";
421422
// The install script adds `./bin` automatically to the path :shrug:
422423
constbinaryPath=path.join(tempDir,"bin",binaryName);
@@ -438,7 +439,7 @@ export const downloadCoderVersion = async (
438439
path.join(__dirname,"../../install.sh"),
439440
[
440441
"--version",
441-
version,
442+
versionNumber,
442443
"--method",
443444
"standalone",
444445
"--prefix",
@@ -551,11 +552,8 @@ const emptyPlan = new TextEncoder().encode("{}");
551552
* converts it into an uploadable tar file.
552553
*/
553554
constcreateTemplateVersionTar=async(
554-
responses?:EchoProvisionerResponses,
555+
responses:EchoProvisionerResponses={},
555556
):Promise<Buffer>=>{
556-
if(!responses){
557-
responses={};
558-
}
559557
if(!responses.parse){
560558
responses.parse=[
561559
{
@@ -1012,7 +1010,7 @@ export const updateWorkspace = async (
10121010
awaitfillParameters(page,richParameters,buildParameters);
10131011
awaitpage.getByRole("button",{name:/updateparameters/i}).click();
10141012

1015-
awaitpage.waitForSelector("*[data-testid='build-status'] >> text=Running",{
1013+
awaitpage.waitForSelector("text=Workspacestatus:Running",{
10161014
state:"visible",
10171015
});
10181016
};
@@ -1031,7 +1029,7 @@ export const updateWorkspaceParameters = async (
10311029
awaitfillParameters(page,richParameters,buildParameters);
10321030
awaitpage.getByRole("button",{name:/submitandrestart/i}).click();
10331031

1034-
awaitpage.waitForSelector("*[data-testid='build-status'] >> text=Running",{
1032+
awaitpage.waitForSelector("text=Workspacestatus:Running",{
10351033
state:"visible",
10361034
});
10371035
};

‎site/src/modules/workspaces/WorkspaceStatusBadge/WorkspaceStatusBadge.stories.tsx

Lines changed: 0 additions & 93 deletions
This file was deleted.

‎site/src/modules/workspaces/WorkspaceStatusBadge/WorkspaceStatusBadge.tsx

Lines changed: 0 additions & 90 deletions
This file was deleted.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
importtype{Meta,StoryObj}from"@storybook/react";
2+
importtype{Workspace,WorkspaceStatus}from"api/typesGenerated";
3+
import{MockWorkspace}from"testHelpers/entities";
4+
import{WorkspaceStatusIndicator}from"./WorkspaceStatusIndicator";
5+
6+
constmeta:Meta<typeofWorkspaceStatusIndicator>={
7+
title:"modules/workspaces/WorkspaceStatusIndicator",
8+
component:WorkspaceStatusIndicator,
9+
};
10+
11+
exportdefaultmeta;
12+
typeStory=StoryObj<typeofWorkspaceStatusIndicator>;
13+
14+
constcreateWorkspaceWithStatus=(status:WorkspaceStatus):Workspace=>{
15+
return{
16+
...MockWorkspace,
17+
latest_build:{
18+
...MockWorkspace.latest_build,
19+
status,
20+
},
21+
}asWorkspace;
22+
};
23+
24+
exportconstRunning:Story={
25+
args:{
26+
workspace:createWorkspaceWithStatus("running"),
27+
},
28+
};
29+
30+
exportconstStopped:Story={
31+
args:{
32+
workspace:createWorkspaceWithStatus("stopped"),
33+
},
34+
};
35+
36+
exportconstStarting:Story={
37+
args:{
38+
workspace:createWorkspaceWithStatus("starting"),
39+
},
40+
};
41+
42+
exportconstStopping:Story={
43+
args:{
44+
workspace:createWorkspaceWithStatus("stopping"),
45+
},
46+
};
47+
48+
exportconstFailed:Story={
49+
args:{
50+
workspace:createWorkspaceWithStatus("failed"),
51+
},
52+
};
53+
54+
exportconstCanceling:Story={
55+
args:{
56+
workspace:createWorkspaceWithStatus("canceling"),
57+
},
58+
};
59+
60+
exportconstCanceled:Story={
61+
args:{
62+
workspace:createWorkspaceWithStatus("canceled"),
63+
},
64+
};
65+
66+
exportconstDeleting:Story={
67+
args:{
68+
workspace:createWorkspaceWithStatus("deleting"),
69+
},
70+
};
71+
72+
exportconstDeleted:Story={
73+
args:{
74+
workspace:createWorkspaceWithStatus("deleted"),
75+
},
76+
};
77+
78+
exportconstPending:Story={
79+
args:{
80+
workspace:createWorkspaceWithStatus("pending"),
81+
},
82+
};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp