Skip to content

Commit

Permalink
Merge branch 'master' into rdumazert/feat-moderation-student-school-t…
Browse files Browse the repository at this point in the history
…raining-establishment
  • Loading branch information
douglasduteil authored Jan 20, 2025
2 parents 43dfc38 + b91742a commit 4ab46fa
Show file tree
Hide file tree
Showing 7 changed files with 152 additions and 0 deletions.
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.
"
`;
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.
"
`;
4 changes: 4 additions & 0 deletions packages/~/moderations/ui/src/Actions/responses/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import * as occupation_incorrectly_entered_not_blocking from "./occupation_incor
import * as public_or_private_organization from "./public_or_private_organization";
import * as refusal_france_travail from "./refusal_france_travail";
import * as student_school_training_establishment from "./student_school_training_establishment";
import * as student_host_organisation from "./student_host_organisation";
import * as seconded_agent_min_interior from "./seconded_agent_min_interior";
import * as teacher_academic_email from "./teacher_academic_email";
import * as university_email_cnrs from "./university_email_cnrs";
import * as use_official_email from "./use_official_email";
Expand Down Expand Up @@ -76,4 +78,6 @@ export const reponse_templates = [
association_with_staff_but_no_domain_name,
association_ordinary_person,
student_school_training_establishment,
student_host_organisation,
seconded_agent_min_interior,
];
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()}</>;
}
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.
`;
}
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()}</>;
}
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.
`;
}

0 comments on commit 4ab46fa

Please sign in to comment.