Skip to content

Commit

Permalink
fix(organizations): Correct subheader if organization is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed Oct 11, 2024
1 parent ecda071 commit 51aadc1
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@ export default function OrganizationHeader({ data }: { data: Organization }) {
<Title className="fr-mb-0" as="h1" look="h5">
{getLangFieldValue(locale)(data.label)}
</Title>
{data?.creationYear && (
{data?.endDate && (
<Text className="fr-card__detail" size="sm">
<i>
{intl.formatMessage({ id: "organizations.header.until" })} {data.endDate.slice(0, 4)}
</i>
</Text>
)}
{!data?.endDate && data?.creationYear && (
<Text className="fr-card__detail" size="sm">
<i>
{intl.formatMessage({ id: "organizations.header.since" })} {data.creationYear}
Expand Down
3 changes: 2 additions & 1 deletion client/src/pages/organizations/[id]/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"organizations.section.identifiers.title": "Struktur-Identifikatoren",
"organizations.copy": "Klicken Sie, um in die Zwischenablage zu kopieren",
"organizations.section.share.title": "Seite teilen",
"organizations.header.since": "Aktiv seit",
"organizations.header.since": "Struktur aktiv seit",
"organizations.header.until": "Struktur geschlossen seit",
"organizations.header.description.ia-generated-label": "KI-generierte Beschreibung",
"organizations.header.description.ia-generated-hover": "Lern mehr",
"organizations.header.description.ia-edit-label": "Bearbeiten",
Expand Down
5 changes: 3 additions & 2 deletions client/src/pages/organizations/[id]/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"organizations.notice.not-french": "Attention, this entity being a foreign entity, only its connections with French organizations, funding, and productions will be displayed.",
"organizations.breadcrumb.home": "Home",
"organizations.breadcrumb.search": "Structures",
"organizations.breadcrumb.search": "Organizations",
"organizations.section.leaders.title": "Leadership team",
"organizations.section.networks.title": "Membership and networks",
"organizations.section.networks.supervisors.title": "Supervising institution ({count})",
Expand Down Expand Up @@ -31,7 +31,8 @@
"organizations.section.identifiers.title": "Structure identifiers",
"organizations.copy": "Click to copy to clipboard",
"organizations.section.share.title": "Share the page",
"organizations.header.since": "Active since",
"organizations.header.since": "Organization active since",
"organizations.header.until": "Organization closed since",
"organizations.header.description.ia-generated-label": "IA generated description",
"organizations.header.description.ia-generated-hover": "Learn more",
"organizations.header.description.ia-edit-label": "Edit",
Expand Down
3 changes: 2 additions & 1 deletion client/src/pages/organizations/[id]/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"organizations.section.identifiers.title": "Identificadores de la Estructura",
"organizations.copy": "Haga clic para copiar al portapapeles",
"organizations.section.share.title": "Compartir la página",
"organizations.header.since": "Activo Desde",
"organizations.header.since": "Estructura activa desde",
"organizations.header.until": "Estructura cerrada desde",
"organizations.header.description.ia-generated-label": "Descripción generada por IA",
"organizations.header.description.ia-generated-hover": "Más información",
"organizations.header.description.ia-edit-label": "Editar",
Expand Down
1 change: 1 addition & 0 deletions client/src/pages/organizations/[id]/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"organizations.copy": "Cliquez pour copier dans le presse-papier",
"organizations.section.share.title": "Partager la page",
"organizations.header.since": "Structure active depuis",
"organizations.header.until": "Structure fermée depuis",
"organizations.header.description.ia-generated-label": "Description générée par IA",
"organizations.header.description.ia-generated-hover": "En savoir plus",
"organizations.header.description.ia-edit-label": "Éditer",
Expand Down
39 changes: 20 additions & 19 deletions client/src/types/organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,33 +80,34 @@ export type OrganizationIaDescription = {

export type Organization = {
_id: string;
id: string;
isFrench: boolean;
label: LangField;
creationYear?: number;
acronym: LangField;
description: LangField;
address?: Address[];
agreements: OrganizationAgreementsData[];
ai_description?: OrganizationIaDescription;
awards: OrganizationAwardsData[];
badges?: OrganizationBadgesData[];
creationYear?: number;
description: LangField;
endDate: string;
externalIds: ExternalIdsData[];
id: string;
institutionOf?: RelatedOrganizationData[];
institutions?: RelatedOrganizationData[];
isFrench: boolean;
kind: string[];
nature?: string;
level?: string;
address?: Address[];
badges?: OrganizationBadgesData[];
label: LangField;
leaders?: OrganizationLeaderData[];
institutions?: RelatedOrganizationData[];
institutionOf?: RelatedOrganizationData[];
parents?: RelatedOrganizationData[];
level?: string;
links: OrganizationLinksData;
nature?: string;
parentOf?: RelatedOrganizationData[];
relations?: RelatedOrganizationData[];
parents?: RelatedOrganizationData[];
patents: OrganizationPatentsData;
projects: OrganizationProjectsData;
publications: OrganizationPublicationsData;
relationOf?: RelatedOrganizationData[];
relations?: RelatedOrganizationData[];
socialMedias: OrganizationSocialMediasData;
links: OrganizationLinksData;
publications: OrganizationPublicationsData;
projects: OrganizationProjectsData;
patents: OrganizationPatentsData;
awards: OrganizationAwardsData[];
agreements: OrganizationAgreementsData[];
};

export type OrganizationAggregations = {
Expand Down

0 comments on commit 51aadc1

Please sign in to comment.