mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
docs(access): the grant card says the invitee needs an account
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.
This commit is contained in:
1 parent
ce3c844a58
commit
be7fbe37d5
9 files changed
+66
-1
No files matched your search
@@ -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.",
|
||||
|
||||
@@ -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.",
|
||||
|
||||
@@ -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.",
|
||||
|
||||
@@ -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.",
|
||||
|
||||
@@ -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.",
|
||||
|
||||
@@ -10327,6 +10327,7 @@
|
||||
"invite": {
|
||||
"title": "다른 사람 초대",
|
||||
"description": "상대가 수락하기 전에는 아무것도 공유되지 않아요.",
|
||||
"needsAccount": "상대방에게는 이 인스턴스의 HealthLog 계정이 필요하며, 초대는 설정 → 공유 접근에서 확인할 수 있습니다.",
|
||||
"identifierLabel": "사용자 이름 또는 이메일",
|
||||
"identifierPlaceholder": "로그인에 쓰는 이름",
|
||||
"identifierHint": "이 인스턴스에 계정이 있어야 해요. 가입하지 않은 이메일 주소로는 초대를 보낼 수 없어요.",
|
||||
|
||||
@@ -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.",
|
||||
|
||||
@@ -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(
|
||||
<QueryClientProvider client={new QueryClient()}>
|
||||
<I18nProvider initialLocale="en">
|
||||
<GrantInviteCard />
|
||||
</I18nProvider>
|
||||
</QueryClientProvider>,
|
||||
);
|
||||
}
|
||||
|
||||
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?:/);
|
||||
});
|
||||
});
|
||||
@@ -150,7 +150,14 @@ export function GrantInviteCard() {
|
||||
<SettingsCardHeader
|
||||
icon={UserPlus}
|
||||
title={t("recordSharing.invite.title")}
|
||||
description={t("recordSharing.invite.description")}
|
||||
// A sharing invitation carries no link and nothing is e-mailed: the
|
||||
// person accepts it from inside their own session. Said here, at the
|
||||
// top of the card, so an inviter never goes looking for a link to
|
||||
// send — the invite-link surface is Admin → Invites, and it is a
|
||||
// different thing entirely.
|
||||
description={`${t("recordSharing.invite.description")} ${t(
|
||||
"recordSharing.invite.needsAccount",
|
||||
)}`}
|
||||
/>
|
||||
<form onSubmit={submit} className="space-y-3">
|
||||
<div className="space-y-1.5">
|
||||
|
||||
Reference in new issue
Block a user