-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(moderation): add university email cnrs response (#730)
Co-authored-by: Douglas Duteil <[email protected]>
- Loading branch information
1 parent
9511a9f
commit d9d48b2
Showing
4 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
.../~/moderations/ui/src/Actions/responses/__snapshots__/university_email_cnrs.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Bun Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`returns university email agent - cnrs 1`] = ` | ||
"Bonjour, | ||
Nous avons bien reçu votre demande de rattachement à l'organisation « 🦄 » sur ProConnect (anciennement : AgentConnect, MonComptePro). | ||
Votre adresse e-mail universitaire : « 🧿 » ne vous permet pas de rattacher votre compte utilisateur au CNRS - Cnrs moy1601 presidence. | ||
Nous vous invitons à créer à nouveau votre compte utilisateur ProConnect, en le rattachant à l'établissement ou à l’université correspondante à votre adresse e-mail. | ||
Bien cordialement, | ||
L’équipe ProConnect. | ||
" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
packages/~/moderations/ui/src/Actions/responses/university_email_cnrs.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
|
||
import { render_md } from "@~/app.ui/testing"; | ||
import { expect, test } from "bun:test"; | ||
import { context, type Values } from "../context"; | ||
import university_email_cnrs from "./university_email_cnrs"; | ||
|
||
// | ||
|
||
test("returns university email agent - cnrs", async () => { | ||
expect( | ||
await render_md( | ||
<context.Provider | ||
value={ | ||
{ | ||
domain: "🧿", | ||
moderation: { | ||
organization: { cached_libelle: "🦄" }, | ||
}, | ||
} as Values | ||
} | ||
> | ||
<Response /> | ||
</context.Provider>, | ||
), | ||
).toMatchSnapshot(); | ||
}); | ||
|
||
function Response() { | ||
return <>{university_email_cnrs()}</>; | ||
} |
29 changes: 29 additions & 0 deletions
29
packages/~/moderations/ui/src/Actions/responses/university_email_cnrs.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
|
||
import { useContext } from "hono/jsx"; | ||
import { dedent } from "ts-dedent"; | ||
import { context } from "../context"; | ||
|
||
export const label = | ||
"Agent - e-mail universitaire —> CNRS - Cnrs moy1601 presidence"; | ||
|
||
export default function template() { | ||
const { | ||
domain, | ||
moderation: { | ||
organization: { cached_libelle: organization_name }, | ||
}, | ||
} = useContext(context); | ||
|
||
return dedent` | ||
Bonjour, | ||
Nous avons bien reçu votre demande de rattachement à l'organisation « ${organization_name} » sur ProConnect (anciennement : AgentConnect, MonComptePro). | ||
Votre adresse e-mail universitaire : « ${domain} » ne vous permet pas de rattacher votre compte utilisateur au CNRS - Cnrs moy1601 presidence. | ||
Nous vous invitons à créer à nouveau votre compte utilisateur ProConnect, en le rattachant à l'établissement ou à l’université correspondante à votre adresse e-mail. | ||
Bien cordialement, | ||
L’équipe ProConnect. | ||
`; | ||
} |