Skip to content

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Jan 13, 2025
2 parents 2207b2c + df1e2b1 commit 0a47896
Show file tree
Hide file tree
Showing 16 changed files with 45 additions and 67 deletions.
2 changes: 1 addition & 1 deletion client/src/layout/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function MainFooter() {
<FooterBody>
<Logo
splitCharacter="|"
text="Ministère|de l'enseignement|supérieur|et de la recherche"
text="Ministère|chargé|de l'enseignement|supérieur|et de la recherche"
/>
<Link
className="fr-footer__content-link"
Expand Down
2 changes: 1 addition & 1 deletion client/src/layout/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const Header: React.FC = () => {
<HeaderWrapper>
<Logo
splitCharacter="|"
text="Ministère|de l'enseignement|supérieur|et de la recherche"
text="Ministère|chargé|de l'enseignement|supérieur|et de la recherche"
/>
<Service
name="Le Guichet numérique"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,32 +37,19 @@ const MessagePreview: React.FC<MessagePreviewProps> = ({
<Col>
{data?.objectId && (
<Text size="sm">
ID de l'objet concerné: <strong>{data.objectId}</strong>
<CopyButton
text={data.objectId}
copiedText={copiedText}
onCopy={copyToClipboard}
/>
ID de l'objet concerné:{" "}
<strong>{data.objectId?.length > 50 ? data.objectId.slice(0, 47) + "..." : data.objectId}</strong>
<CopyButton text={data.objectId} copiedText={copiedText} onCopy={copyToClipboard} />
</Text>
)}
<Text size="sm">
Nom: {data?.name ? <strong>{data.name}</strong> : "non renseigné"}
{data?.name && (
<CopyButton
text={data.name}
copiedText={copiedText}
onCopy={copyToClipboard}
/>
)}
{data?.name && <CopyButton text={data.name} copiedText={copiedText} onCopy={copyToClipboard} />}
</Text>
{data?.email && (
<Text size="sm">
Email: <strong>{data?.email}</strong>
<CopyButton
text={data.email}
copiedText={copiedText}
onCopy={copyToClipboard}
/>
<CopyButton text={data.email} copiedText={copiedText} onCopy={copyToClipboard} />
</Text>
)}
</Col>
Expand All @@ -73,13 +60,8 @@ const MessagePreview: React.FC<MessagePreviewProps> = ({
{Object.entries(data.extra).map(([key, value]) => (
<div key={key}>
<Text size="sm">
{capitalizeFirstLetter(key)}:{" "}
<strong>{value as string}</strong>
<CopyButton
text={value as string}
copiedText={copiedText}
onCopy={copyToClipboard}
/>
{capitalizeFirstLetter(key)}: <strong>{value as string}</strong>
<CopyButton text={value as string} copiedText={copiedText} onCopy={copyToClipboard} />
</Text>
</div>
))}
Expand All @@ -93,8 +75,7 @@ const MessagePreview: React.FC<MessagePreviewProps> = ({
<Text size="sm">
Traité par :{" "}
<strong>
{data.team[0]} le{" "}
{new Date(data.treated_at).toLocaleDateString()} à{" "}
{data.team[0]} le {new Date(data.treated_at).toLocaleDateString()} à{" "}
{new Date(data.treated_at).toLocaleTimeString()}
</strong>
</Text>
Expand All @@ -103,14 +84,11 @@ const MessagePreview: React.FC<MessagePreviewProps> = ({
<Col>
{data?.comment && (
<Text size="sm">
Commentaire ({data.team ? data.team[0] : ""}){" "}
<strong>: {data.comment}</strong>
Commentaire ({data.team ? data.team[0] : ""}) <strong>: {data.comment}</strong>
</Text>
)}
</Col>
{["structures", "publications", "persons"].includes(
data?.objectType
) && (
{["structures", "publications", "persons", "network"].includes(data?.objectType) && (
<Row>
{data.objectType === "structures" && (
<>
Expand All @@ -124,11 +102,7 @@ const MessagePreview: React.FC<MessagePreviewProps> = ({
</Link>
</Col>
<Col>
<Link
size="sm"
target="_blank"
href={`http://185.161.45.213/ui/organizations/${data.objectId}`}
>
<Link size="sm" target="_blank" href={`http://185.161.45.213/ui/organizations/${data.objectId}`}>
Sur dataESR
</Link>
</Col>
Expand All @@ -144,11 +118,7 @@ const MessagePreview: React.FC<MessagePreviewProps> = ({
Sur scanR
</Link>
<br />
<Link
size="sm"
target="_blank"
href={`http://185.161.45.213/ui/publications/${data.objectId}`}
>
<Link size="sm" target="_blank" href={`http://185.161.45.213/ui/publications/${data.objectId}`}>
Sur dataESR
</Link>
</>
Expand All @@ -163,24 +133,26 @@ const MessagePreview: React.FC<MessagePreviewProps> = ({
Sur scanR
</Link>
<br />
<Link
size="sm"
target="_blank"
href={`http://185.161.45.213/ui/persons/${data.objectId}`}
>
<Link size="sm" target="_blank" href={`http://185.161.45.213/ui/persons/${data.objectId}`}>
Sur dataESR
</Link>
</>
)}
{data.objectType === "network" && (
<Link
size="sm"
target="_blank"
href={`https://scanr.enseignementsup-recherche.gouv.fr/networks?${data.objectId}`}
>
Sur scanR
</Link>
)}
</Row>
)}
</Container>
<Row className={contributorMessageClassName}>
<Text className="fr-mt-3w">
<HighlightedMessage
message={data?.message}
highlightedQuery={highlightedQuery}
/>
<HighlightedMessage message={data?.message} highlightedQuery={highlightedQuery} />
</Text>
<EditModal
refetch={refetch}
Expand All @@ -192,12 +164,10 @@ const MessagePreview: React.FC<MessagePreviewProps> = ({
/>
</Row>
<Row className="fr-mb-5w fr-mt-3w">
<Button onClick={() => setShowModal(true)}>
Éditer la contribution
</Button>
<Button onClick={() => setShowModal(true)}>Éditer la contribution</Button>
</Row>
</>
);
)
};

export default MessagePreview;
11 changes: 9 additions & 2 deletions client/src/utils/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ export const BadgeColor = ({ type }) => {
case "patent":
badgeColor = "green-tilleul-verveine";
break;
case "network":
badgeColor = "orange-terre-battue";
break;
default:
badgeColor = "purple-glycine";
}
Expand Down Expand Up @@ -78,7 +81,9 @@ export const TypeLabel = ({ type }) => {
case "projects":
typeLabel = "Projets";
break;

case "network":
typeLabel = "Network";
break;
default:
typeLabel = "";
}
Expand All @@ -103,7 +108,9 @@ export const typeIcon = ({ icon }) => {
case "projects":
typeIcon = "recycle-fill";
break;

case "network":
typeIcon = "git-branch-line";
break;
default:
typeIcon = "";
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Elysia, { Static } from "elysia";
import { contactSchema } from "../../../schemas/get:id/contactSchema";
import { contactSchema } from "../../../schemas/get_id/contactSchema";
import db from "../../../libs/mongo";
import { ObjectId } from "mongodb";
import { errorSchema } from "../../../schemas/errors/errorSchema";
Expand Down
2 changes: 1 addition & 1 deletion server/routes/contacts/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import getContactRoutes from "./get";
import getContactByIdRoutes from "./get:id";
import getContactByIdRoutes from "./get_id";
import postContactRoutes from "./post";
import contactPutRoutes from "./patch";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Elysia, { Static, t } from "elysia";
import db from "../../../libs/mongo";
import { ObjectId } from "mongodb";
import { contactSchema } from "../../../schemas/get:id/contactSchema";
import { contactSchema } from "../../../schemas/get_id/contactSchema";

type contributionObjectType = Static<typeof contactSchema>;

Expand Down
2 changes: 1 addition & 1 deletion server/routes/contributionObjectRoutes/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import getContributionObjectRoutes from "./get";
import getContributionObjectByIdRoutes from "./get:id";
import getContributionObjectByIdRoutes from "./get_id";
import postContributionObjectRoutes from "./post";
import contributionObjectPutRoutes from "./patch";

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion server/routes/productions/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import getProductionsRoutes from "./get";
import getProductionByIdRoutes from "./get:id";
import getProductionByIdRoutes from "./get_id";
import postProductionRoutes from "./post";
import productionsPutRoutes from "./patch";

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion server/routes/remove-user/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import getRemoveUserRoutes from "./get";
import getRemoveUserByIdRoutes from "./get:id";
import getRemoveUserByIdRoutes from "./get_id";
import postRemoveUserRoutes from "./post";
import removeUserPutRoutes from "./patch";

Expand Down
2 changes: 1 addition & 1 deletion server/routes/update-user-data/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import getUpdateUserDataRoutes from "./get";
import getUpdateUserDataByIdRoutes from "./get:id";
import getUpdateUserDataByIdRoutes from "./get_id";
import postUpdateUserDataRoutes from "./post";
import updateUserDataPutRoutes from "./patch";

Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion server/schemas/post/contributionByObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ export const postContributionObjectSchema = t.Object(
publications: "publications",
project: "project",
patent: "patent",
network: "network",
}),
extra: t.Optional(t.Record(t.String(), t.String())),
},
{ additionalProperties: false }
);
)

0 comments on commit 0a47896

Please sign in to comment.