From 51aadc130ab1a6a2cad35a86051c7036001f27dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anne=20L=27H=C3=B4te?= Date: Fri, 11 Oct 2024 16:51:44 +0200 Subject: [PATCH] fix(organizations): Correct subheader if organization is closed --- .../[id]/components/header/index.tsx | 9 ++++- .../pages/organizations/[id]/locales/de.json | 3 +- .../pages/organizations/[id]/locales/en.json | 5 ++- .../pages/organizations/[id]/locales/es.json | 3 +- .../pages/organizations/[id]/locales/fr.json | 1 + client/src/types/organization.ts | 39 ++++++++++--------- 6 files changed, 36 insertions(+), 24 deletions(-) diff --git a/client/src/pages/organizations/[id]/components/header/index.tsx b/client/src/pages/organizations/[id]/components/header/index.tsx index f13acbcd..3cc7866e 100644 --- a/client/src/pages/organizations/[id]/components/header/index.tsx +++ b/client/src/pages/organizations/[id]/components/header/index.tsx @@ -36,7 +36,14 @@ export default function OrganizationHeader({ data }: { data: Organization }) { {getLangFieldValue(locale)(data.label)} - {data?.creationYear && ( + {data?.endDate && ( + + + {intl.formatMessage({ id: "organizations.header.until" })} {data.endDate.slice(0, 4)} + + + )} + {!data?.endDate && data?.creationYear && ( {intl.formatMessage({ id: "organizations.header.since" })} {data.creationYear} diff --git a/client/src/pages/organizations/[id]/locales/de.json b/client/src/pages/organizations/[id]/locales/de.json index e0c58ef3..b170b1fa 100644 --- a/client/src/pages/organizations/[id]/locales/de.json +++ b/client/src/pages/organizations/[id]/locales/de.json @@ -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", diff --git a/client/src/pages/organizations/[id]/locales/en.json b/client/src/pages/organizations/[id]/locales/en.json index 681c487f..4db77c5e 100644 --- a/client/src/pages/organizations/[id]/locales/en.json +++ b/client/src/pages/organizations/[id]/locales/en.json @@ -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})", @@ -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", diff --git a/client/src/pages/organizations/[id]/locales/es.json b/client/src/pages/organizations/[id]/locales/es.json index 6d60b5cb..e4fc304c 100644 --- a/client/src/pages/organizations/[id]/locales/es.json +++ b/client/src/pages/organizations/[id]/locales/es.json @@ -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", diff --git a/client/src/pages/organizations/[id]/locales/fr.json b/client/src/pages/organizations/[id]/locales/fr.json index a2741868..1c342013 100644 --- a/client/src/pages/organizations/[id]/locales/fr.json +++ b/client/src/pages/organizations/[id]/locales/fr.json @@ -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", diff --git a/client/src/types/organization.ts b/client/src/types/organization.ts index c860206a..fa25824d 100644 --- a/client/src/types/organization.ts +++ b/client/src/types/organization.ts @@ -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 = {