Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihoub2 committed Oct 11, 2024
2 parents 6287b1b + ac60cdf commit 61fff06
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 14 deletions.
8 changes: 4 additions & 4 deletions client/src/components/items/message-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ const MessagePreview = ({
Traité par :{" "}
<strong>
{data.team[0]} le{" "}
{new Date(data.modified_at).toLocaleDateString()} à{" "}
{new Date(data.modified_at).toLocaleTimeString()}
{new Date(data.treated_at).toLocaleDateString()} à{" "}
{new Date(data.treated_at).toLocaleTimeString()}
</strong>
</Text>
)}
Expand All @@ -123,7 +123,7 @@ const MessagePreview = ({
<Link
size="sm"
target="_blank"
href={`https://scanr.enseignementsup-recherche.gouv.fr/entite/${data.id}`}
href={`https://scanr.enseignementsup-recherche.gouv.fr/entite/${data.objectId}`}
>
Sur scanR
</Link>
Expand All @@ -132,7 +132,7 @@ const MessagePreview = ({
<Link
size="sm"
target="_blank"
href={`http://185.161.45.213/ui/organizations/${data.id}`}
href={`http://185.161.45.213/ui/organizations/${data.treated_at}`}
>
Sur dataESR
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Production } from "../../../types";

const ContributorRequests: React.FC<{
data: {
objectId: string;
id: string;
name: string;
productions: Production[];
Expand Down Expand Up @@ -69,7 +70,7 @@ const ContributorRequests: React.FC<{
<div style={{ flex: 1 }}>
<SelectWithNames
productionId={production.id}
idRef={data.id}
idRef={data.objectId}
coloredName={coloredName}
contributionId={data.id}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ interface ExcelExportButtonProps {
const ExcelExportButton: React.FC<ExcelExportButtonProps> = ({ refetch }) => {
const { dataList, setDataList } = useDataList();
const [isMinimized, setIsMinimized] = useState(false);

const markAsTreated = async (
contributionIds: any[] | Iterable<unknown> | null | undefined
) => {
Expand All @@ -26,7 +25,7 @@ const ExcelExportButton: React.FC<ExcelExportButtonProps> = ({ refetch }) => {

const isDevelopment = import.meta.env.VITE_HEADER_TAG === "Development";
const urlBase = isDevelopment
? `https://scanr-api.dataesr.ovh/${basePath}`
? `http://localhost:3000/api/${basePath}`
: `${window.location.origin}/api/${basePath}`;

const body = { status: "treated" };
Expand Down Expand Up @@ -59,6 +58,7 @@ const ExcelExportButton: React.FC<ExcelExportButtonProps> = ({ refetch }) => {
};

const handleExportClick = async () => {
console.log(dataList);
const dataToExport = dataList
.filter((item) => item.export === true)
.map((item) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const MessagePreview = ({
setDataList((prevState) => {
let addedToCart = false;
const updatedList = prevState.map((item) => {
if (item.person_id === data.id && !item.export) {
if (item.person_id === data.objectId && !item.export) {
addedToCart = true;
return { ...item, export: true };
} else {
Expand Down
7 changes: 6 additions & 1 deletion server/routes/contacts/post/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,13 @@ postContactsRoutes.post(
templateId: 268,
params: {
date: new Date().toLocaleDateString("fr-FR"),
message: `La contribution avec l'ID ${finalContribution.id} a été ajoutée. Vous pouvez consulter la contribution en cliquant sur le lien suivant : ${contributionLink}`,
title: "Nouvelle contribution créée via formulaire de contact",
id: finalContribution.id,
link: contributionLink,
message: `${finalContribution.message}`,
},
};
console.log(finalContribution);

const response = await fetch("https://api.brevo.com/v3/smtp/email", {
method: "POST",
Expand All @@ -99,6 +103,7 @@ postContactsRoutes.post(
},
body: JSON.stringify(dataForBrevo),
});
console.log(recipients);

if (!response.ok) {
return error(500, {
Expand Down
5 changes: 4 additions & 1 deletion server/routes/contributionObjectRoutes/post/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ postContributionObjectRoutes.post(
templateId: 268,
params: {
date: new Date().toLocaleDateString("fr-FR"),
message: `La contribution avec l'ID ${finalContribution.id} a été ajoutée. Vous pouvez consulter la contribution en cliquant sur le lien suivant : <a href="${contributionLink}">Consulter la contribution</a>`,
title: "Nouvelle contribution créée concernant un objet",
id: finalContribution.id,
link: contributionLink,
message: `${finalContribution.message}`,
},
};

Expand Down
6 changes: 5 additions & 1 deletion server/routes/productions/post/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ postProductionRoutes.post(
templateId: 268,
params: {
date: new Date().toLocaleDateString("fr-FR"),
message: `La contribution avec l'ID ${finalContribution.id} a été ajoutée. Vous pouvez consulter la contribution en cliquant sur le lien suivant : <a href="${contributionLink}">Consulter la contribution</a>`,
title:
"Nouvelle contribution créée pour une affiliation de publication(s)",
link: contributionLink,
message: `La contribution avec l'ID ${finalContribution.id} a été ajoutée.
`,
},
};

Expand Down
5 changes: 4 additions & 1 deletion server/routes/remove-user/post/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ postRemoveUserRoutes.post(
templateId: 268,
params: {
date: new Date().toLocaleDateString("fr-FR"),
message: `La demande avec l'ID ${finalContribution.id} a été ajoutée. Vous pouvez consulter la contribution en cliquant sur le lien suivant : <a href="${contributionLink}">Consulter la contribution</a>`,
title: "Nouvelle demande de suppression de profil",
id: finalContribution.id,
link: contributionLink,
message: `${finalContribution.message}`,
},
};

Expand Down
6 changes: 4 additions & 2 deletions server/routes/update-user-data/post/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ postUpdateUserDataRoutes.post(
templateId: 267,
params: {
date: new Date().toLocaleDateString("fr-FR"),
userResponse: "Une nouvelle demande de modification de profil.",
message: `La demande avec l'ID ${finalContribution.id} a été ajoutée. Vous pouvez consulter la contribution en cliquant sur le lien suivant : <a href="${contributionLink}">Consulter la contribution</a>`,
title: "Nouvelle demande de modification de profil",
id: finalContribution.id,
link: contributionLink,
message: `${finalContribution.message}`,
},
};

Expand Down

0 comments on commit 61fff06

Please sign in to comment.