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 Feb 4, 2025
2 parents 3d141fd + 1188d25 commit b5eabfd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,21 @@ const StaffActions: React.FC<StaffActionsProps> = ({ data, refetch }) => {
?.replace(/De:.*$/s, "")
?.replace(/Objet :.*$/s, "")
?.replace(/Envoyé :.*$/s, "")
?.replace(/> Le.*/s, "")
?.replace(/Le lun.*$/s, "")
?.replace(/Le mar.*$/s, "")
?.replace(/Le mer.*$/s, "")
?.replace(/Le jeu.*$/s, "")
?.replace(/Le ven.*$/s, "")
?.replace(/Le sam.*$/s, "")
?.replace(/Le dim.*$/s, "")
?.replace(/On Monda.*$/s, "")
?.replace(/On Tuesd.*$/s, "")
?.replace(/On Wedne.*$/s, "")
?.replace(/On Thurs.*$/s, "")
?.replace(/On Frida.*$/s, "")
?.replace(/On Satur.*$/s, "")
?.replace(/On Sunda.*$/s, "")
?.replace(/--[a-fA-F0-9_-]+--/g, "")
.replace(/Content-Type:.*$/gs, "")
.replace(/Content-Disposition:.*$/gs, "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
margin-right: 50px;
margin-top: 10px;
margin-bottom: 10px;
word-wrap: break-word;
overflow: hidden;
}

.staffSide {
Expand Down
5 changes: 3 additions & 2 deletions client/src/pages/home/components/generate-links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ export function generateLinkFromAllDatas(
};

let basePath = "";

if (productions?.length > 0 && message === undefined) {
basePath = "/scanr-apioperations";
} else if (objectId) {
basePath = "/scanr-contributionPage";
} else if (fromApplication) {
basePath = "/scanr-contact";
} else if (fromApplication && basePathMap.contacts[fromApplication]) {
basePath = basePathMap.contacts[fromApplication];
} else {
basePath = (basePathMap[collectionName] as string) || "";
}
Expand Down
10 changes: 6 additions & 4 deletions server/routes/receive-email/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ export async function fetchEmails() {
source: true,
envelope: true,
});

const messageList: {
date: string;
source: string;
Expand All @@ -243,10 +242,14 @@ export async function fetchEmails() {
const messageSource = message.source.toString();
const date = formatDate(message.envelope.date?.toISOString() || null);
const subject = message.envelope.subject || "";
const cleanSubject = subject
.replace(/Re:\s*|\[?[*]?PUB[*]?\]?/gi, "")
.trim();

const referenceMatch = subject.match(
/référence\s+([a-zA-Z0-9_-]+)-([a-zA-Z0-9]+)/
const referenceMatch = cleanSubject.match(
/référence[\s:]+([a-zA-Z0-9_-]+)-([a-fA-F0-9]{24})/i
);

let referenceId = referenceMatch ? referenceMatch[2] : null;
let collectionPrefix = referenceMatch ? referenceMatch[1] : "contacts";

Expand All @@ -269,7 +272,6 @@ export async function fetchEmails() {
for (let message of sortedMessages) {
const { referenceId, collectionPrefix, source } = message;
const collectionName = determineCollectionName(collectionPrefix);

if (referenceId) {
await updateContribution(
referenceId,
Expand Down

0 comments on commit b5eabfd

Please sign in to comment.