-
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-agent-outside-mi…
…n-finance-chorus-pro
- Loading branch information
Showing
10 changed files
with
227 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
...erations/ui/src/Actions/responses/__snapshots__/seconded_agent_min_interior.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,17 @@ | ||
// Bun Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`returns seconded agent diplomatie.gouv - Ministry of the Interior 1`] = ` | ||
"Bonjour, | ||
Nous avons bien reçu votre demande de rattachement à l'organisation « 🦄 » sur ProConnect (anciennement : AgentConnect, MonComptePro). | ||
Vous semblez être un Agent ayant été détaché dans une administration française à l'étranger. | ||
Si tel est le cas, nous vous invitons à créer à nouveau votre compte utilisateur, en le rattachant à l'organisation dans laquelle vous avez été détaché. | ||
Ex : vous avez été détaché dans l'Ambassade de France en IRAK, veuillez rattacher votre compte à celle-ci. | ||
Vous trouverez le SIRET de l'administration dans laquelle vous avez été détaché, sur l’Annuaire des Entreprises : https://annuaire-entreprises.data.gouv.fr/. | ||
Bien cordialement, | ||
L’équipe ProConnect. | ||
" | ||
`; |
14 changes: 14 additions & 0 deletions
14
...oderations/ui/src/Actions/responses/__snapshots__/student_host_organisation.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 student - host organisation (work placement, sandwich course, etc.) 1`] = ` | ||
"Bonjour, | ||
Nous avons bien reçu votre demande de rattachement à l'organisation « 🦄 » sur ProConnect (anciennement : AgentConnect, MonComptePro). | ||
Nous ne pouvons donner suite à votre demande, car les étudiants ne sont pas autorisés à utiliser ProConnect en se rattachant à leur organisation d'accueil. | ||
Veuillez accéder au service souhaité sans passer par ProConnect. | ||
Bien cordialement, | ||
L’équipe ProConnect. | ||
" | ||
`; |
15 changes: 15 additions & 0 deletions
15
...i/src/Actions/responses/__snapshots__/student_school_training_establishment.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,15 @@ | ||
// Bun Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`returns Student School or training establishment response 1`] = ` | ||
"Bonjour, | ||
Nous avons bien reçu votre demande de rattachement à l'organisation « 🦄 » sur ProConnect (anciennement : AgentConnect, MonComptePro). | ||
Nous sommes contraints de refuser votre demande de création de compte ProConnect. | ||
Pour information, les étudiants ne sont pas autorisés à se rattacher à leur établissement scolaire ou de formation sur ProConnect, car cela leur donnerait des droits d'accès à des services et démarches réservés uniquement aux Agents (ou employés) de l'établissement. | ||
Veuillez accéder au service souhaité en vous créant un compte, sans passer par ProConnect. | ||
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
30 changes: 30 additions & 0 deletions
30
packages/~/moderations/ui/src/Actions/responses/seconded_agent_min_interior.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,30 @@ | ||
// | ||
|
||
import { render_md } from "@~/app.ui/testing"; | ||
import { expect, test } from "bun:test"; | ||
import { context, type Values } from "../context"; | ||
import seconded_agent_min_interior from "./seconded_agent_min_interior"; | ||
|
||
// | ||
|
||
test("returns seconded agent diplomatie.gouv - Ministry of the Interior", async () => { | ||
expect( | ||
await render_md( | ||
<context.Provider | ||
value={ | ||
{ | ||
moderation: { | ||
organization: { cached_libelle: "🦄" }, | ||
}, | ||
} as Values | ||
} | ||
> | ||
<Response /> | ||
</context.Provider>, | ||
), | ||
).toMatchSnapshot(); | ||
}); | ||
|
||
function Response() { | ||
return <>{seconded_agent_min_interior()}</>; | ||
} |
30 changes: 30 additions & 0 deletions
30
packages/~/moderations/ui/src/Actions/responses/seconded_agent_min_interior.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,30 @@ | ||
// | ||
|
||
import { useContext } from "hono/jsx"; | ||
import { dedent } from "ts-dedent"; | ||
import { context } from "../context"; | ||
|
||
export const label = "Agent détaché diplomatie.gouv —> Min de l’Intérieur"; | ||
|
||
export default function template() { | ||
const { | ||
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). | ||
Vous semblez être un Agent ayant été détaché dans une administration française à l'étranger. | ||
Si tel est le cas, nous vous invitons à créer à nouveau votre compte utilisateur, en le rattachant à l'organisation dans laquelle vous avez été détaché. | ||
Ex : vous avez été détaché dans l'Ambassade de France en IRAK, veuillez rattacher votre compte à celle-ci. | ||
Vous trouverez le SIRET de l'administration dans laquelle vous avez été détaché, sur l’Annuaire des Entreprises : https://annuaire-entreprises.data.gouv.fr/. | ||
Bien cordialement, | ||
L’équipe ProConnect. | ||
`; | ||
} |
30 changes: 30 additions & 0 deletions
30
packages/~/moderations/ui/src/Actions/responses/student_host_organisation.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,30 @@ | ||
// | ||
|
||
import { render_md } from "@~/app.ui/testing"; | ||
import { expect, test } from "bun:test"; | ||
import { context, type Values } from "../context"; | ||
import student_host_organisation from "./student_host_organisation"; | ||
|
||
// | ||
|
||
test("returns student - host organisation (work placement, sandwich course, etc.)", async () => { | ||
expect( | ||
await render_md( | ||
<context.Provider | ||
value={ | ||
{ | ||
moderation: { | ||
organization: { cached_libelle: "🦄" }, | ||
}, | ||
} as Values | ||
} | ||
> | ||
<Response /> | ||
</context.Provider>, | ||
), | ||
).toMatchSnapshot(); | ||
}); | ||
|
||
function Response() { | ||
return <>{student_host_organisation()}</>; | ||
} |
27 changes: 27 additions & 0 deletions
27
packages/~/moderations/ui/src/Actions/responses/student_host_organisation.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,27 @@ | ||
// | ||
|
||
import { useContext } from "hono/jsx"; | ||
import { dedent } from "ts-dedent"; | ||
import { context } from "../context"; | ||
|
||
export const label = "Étudiant - Organisation d’accueil (stage, alternance…)"; | ||
|
||
export default function template() { | ||
const { | ||
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). | ||
Nous ne pouvons donner suite à votre demande, car les étudiants ne sont pas autorisés à utiliser ProConnect en se rattachant à leur organisation d'accueil. | ||
Veuillez accéder au service souhaité sans passer par ProConnect. | ||
Bien cordialement, | ||
L’équipe ProConnect. | ||
`; | ||
} |
30 changes: 30 additions & 0 deletions
30
...ges/~/moderations/ui/src/Actions/responses/student_school_training_establishment.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,30 @@ | ||
// | ||
|
||
import { render_md } from "@~/app.ui/testing"; | ||
import { expect, test } from "bun:test"; | ||
import { context, type Values } from "../context"; | ||
import student_school_training_establishment from "./student_school_training_establishment"; | ||
|
||
// | ||
|
||
test("returns Student School or training establishment response", async () => { | ||
expect( | ||
await render_md( | ||
<context.Provider | ||
value={ | ||
{ | ||
moderation: { | ||
organization: { cached_libelle: "🦄" }, | ||
}, | ||
} as Values | ||
} | ||
> | ||
<Response /> | ||
</context.Provider>, | ||
), | ||
).toMatchSnapshot(); | ||
}); | ||
|
||
function Response() { | ||
return <>{student_school_training_establishment()}</>; | ||
} |
28 changes: 28 additions & 0 deletions
28
packages/~/moderations/ui/src/Actions/responses/student_school_training_establishment.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,28 @@ | ||
// | ||
|
||
import { useContext } from "hono/jsx"; | ||
import { dedent } from "ts-dedent"; | ||
import { context } from "../context"; | ||
|
||
export const label = "Étudiant —> Etablissement scolaire ou de formation"; | ||
|
||
export default function template() { | ||
const { | ||
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). | ||
Nous sommes contraints de refuser votre demande de création de compte ProConnect. | ||
Pour information, les étudiants ne sont pas autorisés à se rattacher à leur établissement scolaire ou de formation sur ProConnect, car cela leur donnerait des droits d'accès à des services et démarches réservés uniquement aux Agents (ou employés) de l'établissement. | ||
Veuillez accéder au service souhaité en vous créant un compte, sans passer par ProConnect. | ||
Bien cordialement, | ||
L’équipe ProConnect. | ||
`; | ||
} |