diff --git a/api/src/core/usecases/readWriteSillData/types.ts b/api/src/core/usecases/readWriteSillData/types.ts index b3dcbfbf..19986eca 100644 --- a/api/src/core/usecases/readWriteSillData/types.ts +++ b/api/src/core/usecases/readWriteSillData/types.ts @@ -1,3 +1,4 @@ +import { ScholarlyArticle } from "../../../types/codemeta"; import type { AuthStructure, ExternalDataOrigin, @@ -66,6 +67,7 @@ export type Software = { similarSoftwares: Software.SimilarSoftware[]; keywords: string[]; programmingLanguages: string[]; + referencePublication?: ScholarlyArticle[]; }; export namespace Software { diff --git a/api/src/lib/ApiTypes.ts b/api/src/lib/ApiTypes.ts index 66e0ece1..64db3b78 100644 --- a/api/src/lib/ApiTypes.ts +++ b/api/src/lib/ApiTypes.ts @@ -2,6 +2,7 @@ export type { ExternalDataOrigin } from "../core/ports/GetSoftwareExternalData"; export type { SoftwareExternalDataOption } from "../core/ports/GetSoftwareExternalDataOptions"; export type { GetSoftwareExternalDataOptions } from "../core/ports/GetSoftwareExternalDataOptions"; export type { AuthStructure } from "../core/ports/GetSoftwareExternalData"; +export type { ScholarlyArticle } from "../types/codemeta"; export type { Agent, diff --git a/web/src/core/usecases/softwareCatalog/selectors.ts b/web/src/core/usecases/softwareCatalog/selectors.ts index b2f6060c..4deca67b 100644 --- a/web/src/core/usecases/softwareCatalog/selectors.ts +++ b/web/src/core/usecases/softwareCatalog/selectors.ts @@ -887,7 +887,8 @@ function apiSoftwareToInternalSoftware(params: { userAndReferentCountByOrganization, similarSoftwares, keywords, - programmingLanguages + programmingLanguages, + referencePublication } = apiSoftware; assert< @@ -975,7 +976,8 @@ function apiSoftwareToInternalSoftware(params: { return search; })(), userDeclaration, - programmingLanguages + programmingLanguages, + referencePublication }; } @@ -1007,6 +1009,7 @@ function internalSoftwareToExternalSoftware(params: { softwareType, userDeclaration, programmingLanguages, + referencePublication, ...rest } = internalSoftware; @@ -1042,7 +1045,8 @@ function internalSoftwareToExternalSoftware(params: { }, userDeclaration, programmingLanguages, - applicationCategories + applicationCategories, + referencePublication }; } diff --git a/web/src/core/usecases/softwareCatalog/state.ts b/web/src/core/usecases/softwareCatalog/state.ts index f7946b70..84df397a 100644 --- a/web/src/core/usecases/softwareCatalog/state.ts +++ b/web/src/core/usecases/softwareCatalog/state.ts @@ -89,6 +89,7 @@ export namespace State { | undefined; programmingLanguages: string[]; applicationCategories: string[]; + referencePublication?: ApiTypes.ScholarlyArticle[]; }; export type External = Common & { diff --git a/web/src/core/usecases/softwareDetails/state.ts b/web/src/core/usecases/softwareDetails/state.ts index 59ba820d..db9d5ad8 100644 --- a/web/src/core/usecases/softwareDetails/state.ts +++ b/web/src/core/usecases/softwareDetails/state.ts @@ -104,6 +104,7 @@ export namespace State { programmingLanguages: string[]; keywords: string[]; applicationCategories: string[]; + referencePublication?: ApiTypes.ScholarlyArticle[]; softwareType: ApiTypes.SoftwareType; }; } diff --git a/web/src/core/usecases/softwareDetails/thunks.ts b/web/src/core/usecases/softwareDetails/thunks.ts index b3a61aab..7c808908 100644 --- a/web/src/core/usecases/softwareDetails/thunks.ts +++ b/web/src/core/usecases/softwareDetails/thunks.ts @@ -195,6 +195,7 @@ function apiSoftwareToSoftware(params: { serviceProviders, programmingLanguages, keywords, + referencePublication, applicationCategories } = apiSoftware; @@ -336,6 +337,7 @@ function apiSoftwareToSoftware(params: { programmingLanguages, keywords, applicationCategories, + referencePublication, softwareType }; } diff --git a/web/src/ui/i18n/sill_en.json b/web/src/ui/i18n/sill_en.json index 3246c33c..2d5d9860 100644 --- a/web/src/ui/i18n/sill_en.json +++ b/web/src/ui/i18n/sill_en.json @@ -203,6 +203,8 @@ }, "softwareDetails": { "catalog breadcrumb": "Software catalog", + "tabReferencePublication": "Related Scholar Articles", + "tabReferencePublicationTitle": "Scholar Articles", "tab title overview": "Overview", "tab title instance": "Referenced instance {{instanceCount}}", "tab service providers": "Service providers {{serviceProvidersCount}}", diff --git a/web/src/ui/i18n/sill_fr.json b/web/src/ui/i18n/sill_fr.json index 7b0351db..421852c5 100644 --- a/web/src/ui/i18n/sill_fr.json +++ b/web/src/ui/i18n/sill_fr.json @@ -206,6 +206,8 @@ }, "softwareDetails": { "catalog breadcrumb": "Le catalogue de logiciels", + "tabReferencePublication": "Articles de recherche associés", + "tabReferencePublicationTitle": "Articles de recherche", "tab title overview": "Aperçu", "tab title instance": "Instances référencées {{instanceCount}}", "tab service providers": "Prestataires de services {{serviceProvidersCount}}", diff --git a/web/src/ui/pages/softwareDetails/PublicationTab.tsx b/web/src/ui/pages/softwareDetails/PublicationTab.tsx new file mode 100644 index 00000000..3550eda2 --- /dev/null +++ b/web/src/ui/pages/softwareDetails/PublicationTab.tsx @@ -0,0 +1,40 @@ +import { ScholarlyArticle } from "api/dist/src/types/codemeta"; +import { fr } from "@codegouvfr/react-dsfr"; +import { useTranslation } from "react-i18next"; + +export type Props = { + referencePublication?: ScholarlyArticle[]; +}; + +export const PublicationTab = (props: Props) => { + const { referencePublication } = props; + + const { t } = useTranslation(); + + return ( + <> +