From be7fbe37d522f760da23ce382ac914c2a173909e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Fri, 11 Sep 2026 09:16:24 +0200 Subject: [PATCH] docs(access): the grant card says the invitee needs an account MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A sharing invitation carries no link and nothing is e-mailed — it is addressed to an account that already exists on this instance, and the person accepts it from inside their own session. The card's input hint already named the account requirement and left the rest unsaid, so an inviter looking for a link to send had nothing to find and no reason to stop looking. The card now names where the invitation turns up, in all seven locales. --- messages/de.json | 1 + messages/en.json | 1 + messages/es.json | 1 + messages/fr.json | 1 + messages/it.json | 1 + messages/ko.json | 1 + messages/pl.json | 1 + .../grant-invite-needs-account.test.tsx | 51 +++++++++++++++++++ .../settings/access/grant-invite-card.tsx | 9 +++- 9 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 src/components/settings/access/__tests__/grant-invite-needs-account.test.tsx diff --git a/messages/de.json b/messages/de.json index 15c2e8336..bb63290f5 100644 --- a/messages/de.json +++ b/messages/de.json @@ -10327,6 +10327,7 @@ "invite": { "title": "Jemanden einladen", "description": "Vor der Zustimmung wird nichts geteilt.", + "needsAccount": "Die Person braucht ein eigenes HealthLog-Konto auf dieser Instanz und findet die Einladung dort unter Einstellungen → Geteilter Zugriff.", "identifierLabel": "Benutzername oder E-Mail", "identifierPlaceholder": "Der Name, mit dem sie sich anmeldet", "identifierHint": "Die Person braucht ein Konto auf dieser Instanz. An eine E-Mail-Adresse ohne Registrierung lässt sich keine Einladung schicken.", diff --git a/messages/en.json b/messages/en.json index 4fa5a0ba7..2ecd85fdf 100644 --- a/messages/en.json +++ b/messages/en.json @@ -10327,6 +10327,7 @@ "invite": { "title": "Invite someone", "description": "Nothing is shared until they accept.", + "needsAccount": "The person needs their own HealthLog account on this instance and will find the invitation under Settings → Shared access.", "identifierLabel": "Username or e-mail", "identifierPlaceholder": "The name they sign in with", "identifierHint": "They need an account on this instance. Invitations cannot be sent to an e-mail address that has not registered.", diff --git a/messages/es.json b/messages/es.json index 964f472bf..527610e38 100644 --- a/messages/es.json +++ b/messages/es.json @@ -10327,6 +10327,7 @@ "invite": { "title": "Invitar a alguien", "description": "No se comparte nada hasta que acepte.", + "needsAccount": "La persona necesita su propia cuenta de HealthLog en esta instancia y encontrará la invitación en Ajustes → Acceso compartido.", "identifierLabel": "Usuario o correo electrónico", "identifierPlaceholder": "El nombre con el que inicia sesión", "identifierHint": "Necesita una cuenta en esta instancia. No se pueden enviar invitaciones a una dirección que no se haya registrado.", diff --git a/messages/fr.json b/messages/fr.json index d1c5e8387..b8c3b73d3 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -10327,6 +10327,7 @@ "invite": { "title": "Inviter quelqu'un", "description": "Rien n'est partagé avant son acceptation.", + "needsAccount": "La personne a besoin de son propre compte HealthLog sur cette instance et trouvera l'invitation dans Paramètres → Accès partagé.", "identifierLabel": "Nom d'utilisateur ou e-mail", "identifierPlaceholder": "Le nom avec lequel elle se connecte", "identifierHint": "Cette personne a besoin d'un compte sur cette instance. Une invitation ne peut pas être envoyée à une adresse non inscrite.", diff --git a/messages/it.json b/messages/it.json index c77cff0bc..a1ceb9da9 100644 --- a/messages/it.json +++ b/messages/it.json @@ -10327,6 +10327,7 @@ "invite": { "title": "Invita qualcuno", "description": "Nulla viene condiviso finché non accetta.", + "needsAccount": "La persona ha bisogno di un proprio account HealthLog su questa istanza e troverà l'invito in Impostazioni → Accesso condiviso.", "identifierLabel": "Nome utente o e-mail", "identifierPlaceholder": "Il nome con cui accede", "identifierHint": "Serve un account su questa istanza. Non è possibile inviare inviti a un indirizzo non registrato.", diff --git a/messages/ko.json b/messages/ko.json index 33e6e738a..7772b8576 100644 --- a/messages/ko.json +++ b/messages/ko.json @@ -10327,6 +10327,7 @@ "invite": { "title": "다른 사람 초대", "description": "상대가 수락하기 전에는 아무것도 공유되지 않아요.", + "needsAccount": "상대방에게는 이 인스턴스의 HealthLog 계정이 필요하며, 초대는 설정 → 공유 접근에서 확인할 수 있습니다.", "identifierLabel": "사용자 이름 또는 이메일", "identifierPlaceholder": "로그인에 쓰는 이름", "identifierHint": "이 인스턴스에 계정이 있어야 해요. 가입하지 않은 이메일 주소로는 초대를 보낼 수 없어요.", diff --git a/messages/pl.json b/messages/pl.json index d4ee7da18..cff8897c2 100644 --- a/messages/pl.json +++ b/messages/pl.json @@ -10327,6 +10327,7 @@ "invite": { "title": "Zaproś kogoś", "description": "Nic nie jest udostępniane, dopóki ta osoba nie zaakceptuje.", + "needsAccount": "Ta osoba potrzebuje własnego konta HealthLog na tej instancji i znajdzie zaproszenie w Ustawienia → Udostępniony dostęp.", "identifierLabel": "Nazwa użytkownika lub e-mail", "identifierPlaceholder": "Nazwa, którą się loguje", "identifierHint": "Ta osoba potrzebuje konta na tej instancji. Nie można wysłać zaproszenia na niezarejestrowany adres.", diff --git a/src/components/settings/access/__tests__/grant-invite-needs-account.test.tsx b/src/components/settings/access/__tests__/grant-invite-needs-account.test.tsx new file mode 100644 index 000000000..142bfe887 --- /dev/null +++ b/src/components/settings/access/__tests__/grant-invite-needs-account.test.tsx @@ -0,0 +1,51 @@ +/** + * The grant card says where the invitation will turn up. + * + * A sharing invitation carries no link and nothing is e-mailed: it is + * addressed to a username or e-mail of an account that already exists here, + * and the person accepts it from inside their own session (`POST + * /api/account/grants/[id]/accept`). The card said the first half — the input + * hint already names the account requirement — and left the second half + * unsaid, so an inviter who then goes looking for a link to send has nothing + * to find and no reason to stop looking. + * + * SSR-only, per project convention. + */ +import { describe, expect, it, vi } from "vitest"; +import { renderToStaticMarkup } from "react-dom/server"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; + +import { I18nProvider } from "@/lib/i18n/context"; + +vi.mock("@/hooks/use-auth", () => ({ + useAuth: () => ({ + user: { id: "u1", username: "owner", modules: {} }, + isAuthenticated: true, + isLoading: false, + }), +})); + +import { GrantInviteCard } from "../grant-invite-card"; +import en from "../../../../../messages/en.json"; + +function render(): string { + return renderToStaticMarkup( + + + + + , + ); +} + +describe("grant invite card — the invitee needs an account here", () => { + it("says where the invited person will find the invitation", () => { + const markup = render(); + expect(markup).toContain(en.recordSharing.invite.needsAccount); + }); + + it("names Settings → Shared access rather than a link to send", () => { + expect(en.recordSharing.invite.needsAccount).toMatch(/Settings/); + expect(en.recordSharing.invite.needsAccount).not.toMatch(/https?:/); + }); +}); diff --git a/src/components/settings/access/grant-invite-card.tsx b/src/components/settings/access/grant-invite-card.tsx index 24a336e8b..fbb0872f4 100644 --- a/src/components/settings/access/grant-invite-card.tsx +++ b/src/components/settings/access/grant-invite-card.tsx @@ -150,7 +150,14 @@ export function GrantInviteCard() {