Skip to content

The open-source app everyone uses to manage agents at work

fix(ui/invite): make pending-approval admin guidance non-clickable (#6786)

le-czsc1f6698ec540
diff --git a/ui/src/pages/InviteLanding.test.tsx b/ui/src/pages/InviteLanding.test.tsx
index c26174de7e..8dd88e1723 100644
--- a/ui/src/pages/InviteLanding.test.tsx
+++ b/ui/src/pages/InviteLanding.test.tsx
@@ -506,7 +506,7 @@ describe("InviteLandingPage", () => {
});
});
- it("shows the pending approval page with the company icon and linked access instructions", async () => {
+ it("shows the pending approval page with the company icon and non-clickable access instructions", async () => {
acceptInviteMock.mockResolvedValue({
id: "join-1",
companyId: "company-1",
@@ -553,14 +553,18 @@ describe("InviteLandingPage", () => {
expect(container.querySelector('img[alt="Acme Robotics logo"]')).not.toBeNull();
expect(container.textContent).not.toContain("http://localhost/company/settings/members");
- const approvalLinks = Array.from(container.querySelectorAll("a")).filter(
+ // The "Company Settings → Members" guidance addresses the company admin,
+ // not the requester. It must render as plain text so the requester cannot
+ // navigate themselves to /company/settings/members — a route they have no
+ // permission to view, which renders a misleading "No company access"
+ // panel and makes the invite flow look broken. See #6784.
+ const approvalAnchors = Array.from(container.querySelectorAll("a")).filter(
(link) => link.textContent === "Company Settings → Members",
);
- expect(approvalLinks).toHaveLength(2);
- const expectedApprovalUrl = `${window.location.origin}/company/settings/members`;
- for (const link of approvalLinks) {
- expect(link.getAttribute("href")).toBe(expectedApprovalUrl);
- }
+ expect(approvalAnchors).toHaveLength(0);
+ const approvalMentions =
+ container.textContent?.match(/Company Settings → Members/g) ?? [];
+ expect(approvalMentions).toHaveLength(2);
await act(async () => {
root.unmount();
diff --git a/ui/src/pages/InviteLanding.tsx b/ui/src/pages/InviteLanding.tsx
index b540fc7528..f732085361 100644
--- a/ui/src/pages/InviteLanding.tsx
+++ b/ui/src/pages/InviteLanding.tsx
@@ -160,7 +160,6 @@ function AwaitingJoinApprovalPanel({
claimApiKeyPath = null,
onboardingTextUrl = null,
}: AwaitingJoinApprovalPanelProps) {
- const approvalUrl = `${window.location.origin}/company/settings/members`;
const approverLabel = invitedByUserName ?? "A company admin";
return (
@@ -181,15 +180,10 @@ function AwaitingJoinApprovalPanel({
</p>
<div className="border border-zinc-800 p-3">
<p className="text-xs text-zinc-500 mb-1">Approval page</p>
- <a
- href={approvalUrl}
- className="text-sm text-zinc-200 underline underline-offset-2 hover:text-zinc-100"
- >
- Company Settings → Members
- </a>
+ <p className="text-sm text-zinc-200">Company Settings → Members</p>
</div>
<p className="text-sm text-zinc-400">
- Ask them to visit <a href={approvalUrl} className="text-zinc-200 underline underline-offset-2 hover:text-zinc-100">Company Settings → Members</a> to approve your request.
+ Ask them to visit <span className="text-zinc-200">Company Settings → Members</span> to approve your request.
</p>
<p className="text-xs text-zinc-500">
Refresh this page after you've been approved — you'll be redirected automatically.