Skip to content

Commit 02b5a8c

Browse files
committed
Address comments
1 parent 94037c0 commit 02b5a8c

5 files changed

Lines changed: 36 additions & 22 deletions

File tree

ui/src/design-system/components/identification/identification-summary/identification-summary.module.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@
4343
}
4444

4545
.details {
46-
display: block;
46+
display: flex;
47+
align-items: center;
48+
justify-content: flex-start;
49+
gap: 8px;
4750
@include mono();
4851
color: $color-neutral-600;
4952
}

ui/src/design-system/components/identification/identification-summary/identification-summary.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { Identification } from 'data-services/models/occurrence-details'
22
import { Tooltip } from 'design-system/components/tooltip/tooltip'
33
import { Link } from 'react-router-dom'
4+
import { APP_ROUTES } from 'utils/constants'
45
import { STRING, translate } from 'utils/language'
56
import { Icon, IconTheme, IconType } from '../../icon/icon'
67
import styles from './identification-summary.module.scss'
7-
88
interface IdentificationSummaryProps {
9+
projectId?: string
910
user?: {
1011
name: string
1112
image?: string
@@ -14,6 +15,7 @@ interface IdentificationSummaryProps {
1415
}
1516

1617
export const IdentificationSummary = ({
18+
projectId,
1719
user,
1820
identification,
1921
}: IdentificationSummaryProps) => (
@@ -38,9 +40,9 @@ export const IdentificationSummary = ({
3840
{user?.name ?? translate(STRING.MACHINE_SUGGESTION)}
3941
</span>
4042
</div>
41-
{identification.algorithm && (
42-
<Link to={identification.algorithm.uri}>
43-
<Tooltip content={identification.algorithm.description}>
43+
{identification.algorithm && projectId && (
44+
<Link to={APP_ROUTES.ALGORITHMS({ projectId })}>
45+
<Tooltip content={identification.algorithm.name}>
4446
<div className={styles.details}>
4547
{identification.algorithm.name}
4648
<Icon

ui/src/pages/algorithm-details/algorithm-details-dialog.tsx

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { Algorithm } from 'data-services/models/algorithm'
44
import * as Dialog from 'design-system/components/dialog/dialog'
55
import { InputValue } from 'design-system/components/input/input'
66
import _ from 'lodash'
7+
import { ExternalLinkIcon } from 'lucide-react'
8+
import { buttonVariants } from 'nova-ui-kit'
79
import { useNavigate, useParams } from 'react-router-dom'
810
import { APP_ROUTES } from 'utils/constants'
911
import { getAppRoute } from 'utils/getAppRoute'
@@ -82,31 +84,38 @@ const AlgorithmDetailsContent = ({ algorithm }: { algorithm: Algorithm }) => (
8284
/>
8385
</FormRow>
8486
<FormRow>
85-
<InputValue
86-
label={translate(STRING.FIELD_LABEL_URI)}
87-
value={algorithm.uri}
88-
to={algorithm.uri}
89-
/>
9087
<InputValue
9188
label={translate(STRING.FIELD_LABEL_VERSION)}
9289
value={algorithm.version}
9390
/>
94-
</FormRow>
95-
<FormRow>
9691
<InputValue
9792
label={translate(STRING.FIELD_LABEL_DESCRIPTION)}
9893
value={algorithm.description}
9994
/>
10095
</FormRow>
101-
</FormSection>
102-
<FormSection title={translate(STRING.CATEGORY_MAP_DETAILS)}>
10396
<FormRow>
10497
<InputValue
105-
label={translate(STRING.FIELD_LABEL_CATEGORY_MAP_ID)}
106-
value={algorithm.categoryMapID}
107-
to={algorithm.categoryMapURI}
98+
label={translate(STRING.FIELD_LABEL_URI)}
99+
value={algorithm.uri || 'None'}
100+
to={algorithm.uri || undefined}
108101
/>
109102
</FormRow>
110103
</FormSection>
104+
{algorithm.categoryMapURI && (
105+
<FormSection title={translate(STRING.CATEGORY_MAP_DETAILS)}>
106+
<a
107+
className={buttonVariants({
108+
size: 'small',
109+
variant: 'outline',
110+
})}
111+
href={algorithm.categoryMapURI}
112+
rel="noreferrer"
113+
target="_blank"
114+
>
115+
<span>View category map API</span>
116+
<ExternalLinkIcon className="w-4 h-4 ml-2" />
117+
</a>
118+
</FormSection>
119+
)}
111120
</>
112121
)

ui/src/pages/occurrence-details/identification-card/identification-card.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ export const IdentificationCard = ({
6464
{identification.applied && (
6565
<StatusLabel label={translate(STRING.ID_APPLIED)} />
6666
)}
67-
<IdentificationSummary user={user} identification={identification} />
67+
<IdentificationSummary
68+
projectId={projectId}
69+
user={user}
70+
identification={identification}
71+
/>
6872
</div>
6973
<div className={styles.content}>
7074
<TaxonInfo

ui/src/pages/project/algorithms/algorithms-columns.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ export const columns: (projectId: string) => TableColumn<Algorithm>[] = (
1010
) => [
1111
{
1212
id: 'id',
13-
sortField: 'id',
1413
name: translate(STRING.FIELD_LABEL_ID),
1514
renderCell: (item: Algorithm) => <BasicTableCell value={item.id} />,
1615
},
1716
{
1817
id: 'name',
1918
name: translate(STRING.FIELD_LABEL_NAME),
20-
sortField: 'name',
2119
renderCell: (item: Algorithm) => (
2220
<Link
2321
to={APP_ROUTES.ALGORITHM_DETAILS({ projectId, algorithmId: item.id })}
@@ -29,13 +27,11 @@ export const columns: (projectId: string) => TableColumn<Algorithm>[] = (
2927
{
3028
id: 'task-type',
3129
name: 'Task type',
32-
sortField: 'task_type',
3330
renderCell: (item: Algorithm) => <BasicTableCell value={item.taskType} />,
3431
},
3532
{
3633
id: 'description',
3734
name: 'Description',
38-
sortField: 'description',
3935
renderCell: (item: Algorithm) => (
4036
<BasicTableCell value={item.description} />
4137
),

0 commit comments

Comments
 (0)