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

chore: replace MoreMenu with DropdownMenu#17615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jaaydenh merged 18 commits intomainfromjaaydenh/more-menu-refactor
May 1, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
18 commits
Select commitHold shift + click to select a range
bff8357
chore: refactor more menu
jaaydenhFeb 17, 2025
e825cf0
chore: update EllipsisVertical icon size
jaaydenhApr 30, 2025
732006a
chore: cleanup
jaaydenhApr 30, 2025
47f4839
chore: cleanup
jaaydenhApr 30, 2025
826874b
fix: cleanup
jaaydenhApr 30, 2025
6d2dbe8
fix: cleanup
jaaydenhApr 30, 2025
d337372
fix: fix UsersPage storybook tests
jaaydenhApr 30, 2025
e13f224
fix: fix test
jaaydenhApr 30, 2025
bb25e43
fix: update tests
jaaydenhApr 30, 2025
d56d988
fix: fix tests
jaaydenhApr 30, 2025
d795480
fix: removed unused imports
jaaydenhApr 30, 2025
43afbe4
chore: remove unused dependency
jaaydenhApr 30, 2025
9b7a2e0
fix: fix e2e tests
jaaydenhMay 1, 2025
82b9b09
chore: update to use DropdownMenu
jaaydenhMay 1, 2025
fe820b3
chore: update MoreMenu to use DropdownMenu
jaaydenhMay 1, 2025
fac467a
chore: delete MoreMenu
jaaydenhMay 1, 2025
c57d54a
fix: fix merge
jaaydenhMay 1, 2025
564fedb
fix: fix merge
jaaydenhMay 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletionssite/e2e/tests/groups/removeMember.spec.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,9 +33,8 @@ test("remove member", async ({ page, baseURL }) => {
await expect(page).toHaveTitle(`${group.display_name} - Coder`);

const userRow = page.getByRole("row", { name: member.username });
await userRow.getByRole("button", { name: "More options" }).click();

const menu = page.locator("#more-options");
await userRow.getByRole("button", { name: "Open menu" }).click();
const menu = page.getByRole("menu");
await menu.getByText("Remove").click({ timeout: 1_000 });

await expect(page.getByText("Member removed successfully.")).toBeVisible();
Expand Down
6 changes: 4 additions & 2 deletionssite/e2e/tests/organizationGroups.spec.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -79,8 +79,10 @@ test("create group", async ({ page }) => {
await expect(page.getByText("No users found")).toBeVisible();

// Remove someone from the group
await addedRow.getByLabel("More options").click();
await page.getByText("Remove").click();
await addedRow.getByRole("button", { name: "Open menu" }).click();
const menu = page.getByRole("menu");
await menu.getByText("Remove").click();

await expect(addedRow).not.toBeVisible();

// Delete the group
Expand Down
5 changes: 3 additions & 2 deletionssite/e2e/tests/organizationMembers.spec.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -39,8 +39,9 @@ test("add and remove organization member", async ({ page }) => {
await expect(addedRow.getByText("+1 more")).toBeVisible();

// Remove them from the org
await addedRow.getByLabel("More options").click();
await page.getByText("Remove").click(); // Click the "Remove" option
await addedRow.getByRole("button", { name: "Open menu" }).click();
const menu = page.getByRole("menu");
await menu.getByText("Remove").click();
await page.getByRole("button", { name: "Remove" }).click(); // Click "Remove" in the confirmation dialog
await expect(addedRow).not.toBeVisible();
});
10 changes: 5 additions & 5 deletionssite/e2e/tests/organizations/customRoles/customRoles.spec.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,8 +37,8 @@ test.describe("CustomRolesPage", () => {
await expect(roleRow.getByText(customRole.display_name)).toBeVisible();
await expect(roleRow.getByText("organization_member")).toBeVisible();

await roleRow.getByRole("button", { name: "More options" }).click();
const menu = page.locator("#more-options");
await roleRow.getByRole("button", { name: "Open menu" }).click();
const menu = page.getByRole("menu");
await menu.getByText("Edit").click();

await expect(page).toHaveURL(
Expand DownExpand Up@@ -118,7 +118,7 @@ test.describe("CustomRolesPage", () => {

// Verify that the more menu (three dots) is not present for built-in roles
await expect(
roleRow.getByRole("button", { name: "More options" }),
roleRow.getByRole("button", { name: "Open menu" }),
).not.toBeVisible();

await deleteOrganization(org.name);
Expand DownExpand Up@@ -175,9 +175,9 @@ test.describe("CustomRolesPage", () => {
await page.goto(`/organizations/${org.name}/roles`);

const roleRow = page.getByTestId(`role-${customRole.name}`);
await roleRow.getByRole("button", { name: "More options" }).click();
await roleRow.getByRole("button", { name: "Open menu" }).click();

const menu = page.locator("#more-options");
const menu = page.getByRole("menu");
await menu.getByText("Delete…").click();

const input = page.getByRole("textbox");
Expand Down
6 changes: 4 additions & 2 deletionssite/e2e/tests/updateTemplate.spec.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -53,8 +53,10 @@ test("add and remove a group", async ({ page }) => {
await expect(row).toBeVisible();

// Now remove the group
await row.getByLabel("More options").click();
await page.getByText("Remove").click();
await row.getByRole("button", { name: "Open menu" }).click();
const menu = page.getByRole("menu");
await menu.getByText("Remove").click();

await expect(page.getByText("Group removed successfully!")).toBeVisible();
await expect(row).not.toBeVisible();
});
Expand Down
6 changes: 3 additions & 3 deletionssite/e2e/tests/users/removeUser.spec.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,9 +17,9 @@ test("remove user", async ({ page, baseURL }) => {
await expect(page).toHaveTitle("Users - Coder");

const userRow = page.getByRole("row", { name: user.email });
await userRow.getByRole("button", { name: "More options" }).click();
const menu = page.locator("#more-options");
await menu.getByText("Delete").click();
await userRow.getByRole("button", { name: "Open menu" }).click();
const menu = page.getByRole("menu");
await menu.getByText("Delete").click();

const dialog = page.getByTestId("dialog");
await dialog.getByLabel("Name of the user to delete").fill(user.username);
Expand Down
2 changes: 1 addition & 1 deletionsite/src/components/DropdownMenu/DropdownMenu.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -196,7 +196,7 @@ export const DropdownMenuSeparator = forwardRef<
>(({ className, ...props }, ref) => (
<DropdownMenuPrimitive.Separator
ref={ref}
className={cn(["-mx-1 my-3 h-px bg-border"], className)}
className={cn(["-mx-1 my-2 h-px bg-border"], className)}
{...props}
/>
));
Expand Down
59 changes: 0 additions & 59 deletionssite/src/components/MoreMenu/MoreMenu.stories.tsx
View file
Open in desktop

This file was deleted.

135 changes: 0 additions & 135 deletionssite/src/components/MoreMenu/MoreMenu.tsx
View file
Open in desktop

This file was deleted.

View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,13 +3,14 @@ import Checkbox from "@mui/material/Checkbox";
import TableCell from "@mui/material/TableCell";
import TableRow from "@mui/material/TableRow";
import type { BannerConfig } from "api/typesGenerated";
import { Button } from "components/Button/Button";
import {
MoreMenu,
MoreMenuContent,
MoreMenuItem,
MoreMenuTrigger,
ThreeDotsButton,
} from "components/MoreMenu/MoreMenu";
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from "components/DropdownMenu/DropdownMenu";
import { EllipsisVertical} from "lucide-react";
import type { FC } from "react";

interface AnnouncementBannerItemProps {
Expand DownExpand Up@@ -48,17 +49,25 @@ export const AnnouncementBannerItem: FC<AnnouncementBannerItemProps> = ({
</TableCell>

<TableCell>
<MoreMenu>
<MoreMenuTrigger>
<ThreeDotsButton />
</MoreMenuTrigger>
<MoreMenuContent>
<MoreMenuItem onClick={() => onEdit()}>Edit&hellip;</MoreMenuItem>
<MoreMenuItem onClick={() => onDelete()} danger>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button size="icon-lg" variant="subtle" aria-label="Open menu">
<EllipsisVertical aria-hidden="true" />
<span className="sr-only">Open menu</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem onClick={() => onEdit()}>
Edit&hellip;
</DropdownMenuItem>
<DropdownMenuItem
className="text-content-destructive focus:text-content-destructive"
onClick={() => onDelete()}
>
Delete&hellip;
</MoreMenuItem>
</MoreMenuContent>
</MoreMenu>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</TableCell>
</TableRow>
);
Expand Down
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp