Skip to content

Commit

Permalink
#67 Add notes field when available (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpailler authored May 5, 2024
1 parent 3ab986a commit 3fecc53
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/SearchProcessor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ const SearchProcessor = (props: SearchProcessorProps): JSX.Element => {
'NamePartial',
'NameSuffix',
'Description',
'Notes',
'Homepage',
'License',
'Version',
Expand Down
11 changes: 9 additions & 2 deletions src/components/SearchResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -99,6 +99,7 @@ const SearchResult = (props: SearchResultProps): JSX.Element => {
favicon,
highlightedName,
highlightedDescription,
notes,
highlightedLicense,
highlightedRepository,
highlightedVersion,
Expand Down Expand Up @@ -179,13 +180,19 @@ const SearchResult = (props: SearchResultProps): JSX.Element => {
)}
{license && (
<span>
<GoBook title="License" className="me-1" />
<GoLaw title="License" className="me-1" />
{(license && spdxLicenses.includes(license) && (
<a href={`https://spdx.org/licenses/${license}.html`}>{displayInnerHtml(highlightedLicense)}</a>
)) ||
displayInnerHtml(highlightedLicense)}
</span>
)}
{notes && (
<span>
<GoBook title="Notes" className="me-1" />
{notes}
</span>
)}
</Row>
</Col>
<Col lg={6} className="mt-4 mt-lg-0">
Expand Down
3 changes: 3 additions & 0 deletions src/serialization/ManifestJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 3fecc53

Please sign in to comment.