-
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.
Merge branch 'master' into rdumazert/feat-moderation-france-travail-r…
…efusal
- Loading branch information
Showing
12 changed files
with
186 additions
and
4 deletions.
There are no files selected for viewing
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
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
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
19 changes: 19 additions & 0 deletions
19
...ations/ui/src/Actions/responses/__snapshots__/min_armees_terre_marine_musee.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,19 @@ | ||
// Bun Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`returns error on 🦄 organization (min armée) email 1`] = ` | ||
"Bonjour, | ||
Nous avons bien reçu votre demande de rattachement à l'organisation « 🦄 » sur ProConnect (anciennement : AgentConnect, MonComptePro). | ||
Nous pensons que vous avez fait erreur sur l'organisation à laquelle vous souhaitez rattacher votre compte utilisateur ProConnect. | ||
L'organisation « 🦄 » est une organisation privée dont l'activité est la suivante : « 👾 ». | ||
Ne souhaitiez-vous pas rattacher votre compte à XXXXXXX ? | ||
Si tel est le cas, d'après nos recherches, XXXXXXXX n'apparaît pas dans le répertoire SIRENE, soit parce qu'elle n'est pas inscrite, soit parce qu'elle a choisi de ne pas diffuser ses informations en raison de la nature sensible de ses activités. | ||
Dans ce contexte, veuillez renouveler votre création de compte en le rattachant au : | ||
MINISTERE DES ARMEES : https://annuaire-entreprises.data.gouv.fr/entreprise/ministere-des-armees-110090016. | ||
Bien cordialement, | ||
L’équipe ProConnect. | ||
" | ||
`; |
18 changes: 18 additions & 0 deletions
18
...~/moderations/ui/src/Actions/responses/__snapshots__/teacher_academic_email.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,18 @@ | ||
// Bun Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`returns invalid teacher email message 1`] = ` | ||
"Bonjour, | ||
Votre demande pour rejoindre l’organisation « 🦄 » a été prise en compte sur https://app.moncomptepro.beta.gouv.fr. | ||
Votre adresse e-mail académique : « 💌 » ne vous permet pas de rattacher votre compte utilisateur MonComptePro au Ministère de l’Éducation Nationale et de la Jeunesse. | ||
En tant qu’enseignant, merci de bien vouloir créer votre compte à nouveau en le rattachant à l’une des organisations suivantes : | ||
- L’établissement scolaire dans lequel vous exercez, | ||
- Le rectorat de votre Académie. | ||
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
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
33 changes: 33 additions & 0 deletions
33
packages/~/moderations/ui/src/Actions/responses/min_armees_terre_marine_musee.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,33 @@ | ||
// | ||
|
||
import { render_md } from "@~/app.ui/testing"; | ||
import { expect, test } from "bun:test"; | ||
import { context, type Values } from "../context"; | ||
import min_armees_terre_marine_musee from "./min_armees_terre_marine_musee"; | ||
|
||
// | ||
|
||
test("returns error on 🦄 organization (min armée) email", async () => { | ||
expect( | ||
await render_md( | ||
<context.Provider | ||
value={ | ||
{ | ||
moderation: { | ||
organization: { | ||
cached_libelle: "🦄", | ||
cached_libelle_categorie_juridique: "👾", | ||
}, | ||
}, | ||
} as Values | ||
} | ||
> | ||
<Response /> | ||
</context.Provider>, | ||
), | ||
).toMatchSnapshot(); | ||
}); | ||
|
||
function Response() { | ||
return <>{min_armees_terre_marine_musee()}</>; | ||
} |
36 changes: 36 additions & 0 deletions
36
packages/~/moderations/ui/src/Actions/responses/min_armees_terre_marine_musee.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,36 @@ | ||
// | ||
|
||
import { useContext } from "hono/jsx"; | ||
import { dedent } from "ts-dedent"; | ||
import { context } from "../context"; | ||
|
||
export const label = | ||
"Agent Min des Armées —> Terre armée, Marine nationale, Musée de la Marine"; | ||
|
||
export default function template() { | ||
const { | ||
moderation: { | ||
organization: { | ||
cached_libelle: organization_name, | ||
cached_libelle_categorie_juridique, | ||
}, | ||
}, | ||
} = useContext(context); | ||
|
||
return dedent` | ||
Bonjour, | ||
Nous avons bien reçu votre demande de rattachement à l'organisation « ${organization_name} » sur ProConnect (anciennement : AgentConnect, MonComptePro). | ||
Nous pensons que vous avez fait erreur sur l'organisation à laquelle vous souhaitez rattacher votre compte utilisateur ProConnect. | ||
L'organisation « ${organization_name} » est une organisation privée dont l'activité est la suivante : « ${cached_libelle_categorie_juridique} ». | ||
Ne souhaitiez-vous pas rattacher votre compte à XXXXXXX ? | ||
Si tel est le cas, d'après nos recherches, XXXXXXXX n'apparaît pas dans le répertoire SIRENE, soit parce qu'elle n'est pas inscrite, soit parce qu'elle a choisi de ne pas diffuser ses informations en raison de la nature sensible de ses activités. | ||
Dans ce contexte, veuillez renouveler votre création de compte en le rattachant au : | ||
MINISTERE DES ARMEES : https://annuaire-entreprises.data.gouv.fr/entreprise/ministere-des-armees-110090016. | ||
Bien cordialement, | ||
L’équipe ProConnect. | ||
`; | ||
} |
31 changes: 31 additions & 0 deletions
31
packages/~/moderations/ui/src/Actions/responses/teacher_academic_email.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 teacher_academic_email from "./teacher_academic_email"; | ||
|
||
// | ||
|
||
test("returns invalid teacher email message", async () => { | ||
expect( | ||
await render_md( | ||
<context.Provider | ||
value={ | ||
{ | ||
moderation: { | ||
organization: { cached_libelle: "🦄" }, | ||
user: { email: "💌" }, | ||
}, | ||
} as Values | ||
} | ||
> | ||
<Response /> | ||
</context.Provider>, | ||
), | ||
).toMatchSnapshot(); | ||
}); | ||
|
||
function Response() { | ||
return <>{teacher_academic_email()}</>; | ||
} |
33 changes: 33 additions & 0 deletions
33
packages/~/moderations/ui/src/Actions/responses/teacher_academic_email.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,33 @@ | ||
// | ||
|
||
import { useContext } from "hono/jsx"; | ||
import { dedent } from "ts-dedent"; | ||
import { context } from "../context"; | ||
|
||
export const label = | ||
"Enseignant : e-mail académique —> Min Edu Nat et Jeunesse"; | ||
|
||
export default function template() { | ||
const { | ||
moderation: { | ||
organization: { cached_libelle: organization_name }, | ||
user: { email }, | ||
}, | ||
} = useContext(context); | ||
|
||
return dedent` | ||
Bonjour, | ||
Votre demande pour rejoindre l’organisation « ${organization_name} » a été prise en compte sur https://app.moncomptepro.beta.gouv.fr. | ||
Votre adresse e-mail académique : « ${email} » ne vous permet pas de rattacher votre compte utilisateur MonComptePro au Ministère de l’Éducation Nationale et de la Jeunesse. | ||
En tant qu’enseignant, merci de bien vouloir créer votre compte à nouveau en le rattachant à l’une des organisations suivantes : | ||
- L’établissement scolaire dans lequel vous exercez, | ||
- Le rectorat de votre Académie. | ||
Bien cordialement, | ||
L’équipe ProConnect. | ||
`; | ||
} |