Skip to content

Commit

Permalink
feat(contributionByObject): add object network
Browse files Browse the repository at this point in the history
  • Loading branch information
ahonestla committed Jan 8, 2025
1 parent f28533f commit ae023af
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const MessagePreview: React.FC<MessagePreviewProps> = ({
</Text>
)}
</Col>
{["structures", "publications", "persons"].includes(
{["structures", "publications", "persons", "network"].includes(
data?.objectType
) && (
<Row>
Expand Down Expand Up @@ -172,6 +172,15 @@ const MessagePreview: React.FC<MessagePreviewProps> = ({
</Link>
</>
)}
{data.objectType === "network" && (
<Link
size="sm"
target="_blank"
href={`https://scanr.enseignementsup-recherche.gouv.fr/networks?${data.objectId}`}
>
Sur scanR
</Link>
)}
</Row>
)}
</Container>
Expand Down
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
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 ae023af

Please sign in to comment.