From 3fecc534b499ab8051542d53302f5bc47ac67ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pailler?= Date: Sun, 5 May 2024 18:40:22 +0200 Subject: [PATCH] #67 Add notes field when available (#83) --- src/components/SearchProcessor.tsx | 1 + src/components/SearchResult.tsx | 11 +++++++++-- src/serialization/ManifestJson.ts | 3 +++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/components/SearchProcessor.tsx b/src/components/SearchProcessor.tsx index 07e6211..84c27b1 100644 --- a/src/components/SearchProcessor.tsx +++ b/src/components/SearchProcessor.tsx @@ -188,6 +188,7 @@ const SearchProcessor = (props: SearchProcessorProps): JSX.Element => { 'NamePartial', 'NameSuffix', 'Description', + 'Notes', 'Homepage', 'License', 'Version', diff --git a/src/components/SearchResult.tsx b/src/components/SearchResult.tsx index 05bc6cc..92ed8b0 100644 --- a/src/components/SearchResult.tsx +++ b/src/components/SearchResult.tsx @@ -4,7 +4,7 @@ import dayjs from 'dayjs'; import localizedFormat from 'dayjs/plugin/localizedFormat'; import relativeTime from 'dayjs/plugin/relativeTime'; import { Card, Col, Container, Form, InputGroup, InputGroupProps, Row } from 'react-bootstrap'; -import { GoLinkExternal, GoBook, GoPackage, GoClock } from 'react-icons/go'; +import { GoLinkExternal, GoBook, GoPackage, GoClock, GoLaw } from 'react-icons/go'; import { Img } from 'react-image'; import deprecatedSpdxLicenses from 'spdx-license-ids/deprecated.json'; import supportedSpdxLicenses from 'spdx-license-ids/index.json'; @@ -99,6 +99,7 @@ const SearchResult = (props: SearchResultProps): JSX.Element => { favicon, highlightedName, highlightedDescription, + notes, highlightedLicense, highlightedRepository, highlightedVersion, @@ -179,13 +180,19 @@ const SearchResult = (props: SearchResultProps): JSX.Element => { )} {license && ( - + {(license && spdxLicenses.includes(license) && ( {displayInnerHtml(highlightedLicense)} )) || displayInnerHtml(highlightedLicense)} )} + {notes && ( + + + {notes} + + )} diff --git a/src/serialization/ManifestJson.ts b/src/serialization/ManifestJson.ts index 68e9cf8..2726d7e 100644 --- a/src/serialization/ManifestJson.ts +++ b/src/serialization/ManifestJson.ts @@ -26,6 +26,9 @@ class ManifestJson { @JsonProperty('Description', String, true) description?: string = undefined; + @JsonProperty('Notes', String, true) + notes?: string = undefined; + @JsonProperty('Homepage', String, true) homepage?: string = undefined;