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

Commitc827a08

Browse files
authored
refactor: migrate deployment banner to Tailwind and radix (#20479)
before:<img width="1667" height="48" alt="Screenshot 2025-10-25 at 18 02 45"src="https://github.com/user-attachments/assets/1525a01e-5976-4d0e-8280-1b9ae8d91197"/>after:<img width="1662" height="35" alt="Screenshot 2025-10-25 at 18 02 17"src="https://github.com/user-attachments/assets/d0fd7b69-ee88-4986-a539-5917c17a8b85"/>
1 parent1b6556c commitc827a08

File tree

3 files changed

+252
-257
lines changed

3 files changed

+252
-257
lines changed

‎site/src/components/Link/Link.tsx‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,14 @@ interface LinkProps
2727
extendsReact.AnchorHTMLAttributes<HTMLAnchorElement>,
2828
VariantProps<typeoflinkVariants>{
2929
asChild?:boolean;
30+
showExternalIcon?:boolean;
3031
}
3132

3233
exportconstLink=forwardRef<HTMLAnchorElement,LinkProps>(
33-
({ className, children, size, asChild, ...props},ref)=>{
34+
(
35+
{ className, children, size, asChild, showExternalIcon=true, ...props},
36+
ref,
37+
)=>{
3438
constComp=asChild ?Slot :"a";
3539
return(
3640
<Comp
@@ -39,7 +43,7 @@ export const Link = forwardRef<HTMLAnchorElement, LinkProps>(
3943
{...props}
4044
>
4145
<Slottable>{children}</Slottable>
42-
<SquareArrowOutUpRightIconaria-hidden="true"/>
46+
{showExternalIcon&&<SquareArrowOutUpRightIconaria-hidden="true"/>}
4347
</Comp>
4448
);
4549
},

‎site/src/modules/dashboard/DeploymentBanner/DeploymentBannerView.stories.tsx‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
MockDeploymentStats,
44
}from"testHelpers/entities";
55
importtype{Meta,StoryObj}from"@storybook/react-vite";
6+
import{expect,screen,userEvent,waitFor,within}from"storybook/test";
67
import{DeploymentBannerView}from"./DeploymentBannerView";
78

89
constmeta:Meta<typeofDeploymentBannerView>={
@@ -22,6 +23,14 @@ export const WithHealthIssues: Story = {
2223
args:{
2324
health:DeploymentHealthUnhealthy,
2425
},
26+
play:async({ canvasElement})=>{
27+
constcanvas=within(canvasElement);
28+
consttrigger=canvas.getByTestId("deployment-health-trigger");
29+
awaituserEvent.hover(trigger);
30+
awaitwaitFor(()=>
31+
expect(screen.getByRole("tooltip")).toBeInTheDocument(),
32+
);
33+
},
2534
};
2635

2736
exportconstWithDismissedHealthIssues:Story={
@@ -34,4 +43,12 @@ export const WithDismissedHealthIssues: Story = {
3443
},
3544
},
3645
},
46+
play:async({ canvasElement})=>{
47+
constcanvas=within(canvasElement);
48+
consttrigger=canvas.getByTestId("deployment-health-trigger");
49+
awaituserEvent.hover(trigger);
50+
awaitwaitFor(()=>
51+
expect(screen.getByRole("tooltip")).toBeInTheDocument(),
52+
);
53+
},
3754
};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp