Skip to content

Commit f3c7efd

Browse files
authored
[Feature]: Implement links for elements that have details page #2681 (#2772)
1 parent 7ee79ba commit f3c7efd

4 files changed

Lines changed: 27 additions & 7 deletions

File tree

frontend/src/pages/Models/Details/index.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,17 @@ export const ModelDetails: React.FC = () => {
328328
<ColumnLayout columns={4} variant="text-grid">
329329
<div>
330330
<Box variant="awsui-key-label">{t('models.details.run_name')}</Box>
331-
<div>{modelData.run_name}</div>
331+
332+
<div>
333+
<NavigateLink
334+
href={ROUTES.PROJECT.DETAILS.RUNS.DETAILS.FORMAT(
335+
modelData.project_name,
336+
modelData.run_name ?? 'No run name',
337+
)}
338+
>
339+
{modelData.run_name}
340+
</NavigateLink>
341+
</div>
332342
</div>
333343

334344
<div>

frontend/src/pages/Runs/Details/RunDetails/index.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ import { useParams } from 'react-router-dom';
44
import { get as _get } from 'lodash';
55
import { format } from 'date-fns';
66

7-
import { Box, ColumnLayout, Container, Header, Loader, StatusIndicator } from 'components';
7+
import { Box, ColumnLayout, Container, Header, Loader, NavigateLink, StatusIndicator } from 'components';
88

99
import { DATE_TIME_FORMAT } from 'consts';
1010
import { getRunError, getRunPriority, getRunStatusMessage, getStatusIconColor, getStatusIconType } from 'libs/run';
1111
import { useGetRunQuery } from 'services/run';
1212

1313
import { finishedRunStatuses } from 'pages/Runs/constants';
1414

15+
import { ROUTES } from '../../../../routes';
1516
import {
1617
getRunListItemBackend,
1718
getRunListItemInstanceId,
@@ -62,7 +63,12 @@ export const RunDetails = () => {
6263
<ColumnLayout columns={4} variant="text-grid">
6364
<div>
6465
<Box variant="awsui-key-label">{t('projects.run.project')}</Box>
65-
<div>{runData.project_name}</div>
66+
67+
<div>
68+
<NavigateLink href={ROUTES.PROJECT.DETAILS.FORMAT(runData.project_name)}>
69+
{runData.project_name}
70+
</NavigateLink>
71+
</div>
6672
</div>
6773

6874
<div>
@@ -75,7 +81,10 @@ export const RunDetails = () => {
7581

7682
<div>
7783
<Box variant="awsui-key-label">{t('projects.run.hub_user_name')}</Box>
78-
<div>{runData.user}</div>
84+
85+
<div>
86+
<NavigateLink href={ROUTES.USER.DETAILS.FORMAT(runData.user)}>{runData.user}</NavigateLink>
87+
</div>
7988
</div>
8089

8190
<div>

frontend/src/pages/User/Details/Settings/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import { useTranslation } from 'react-i18next';
33
import { useNavigate, useParams } from 'react-router-dom';
44

5-
import { Box, Button, ColumnLayout, Container, Header, Loader, Popover, SpaceBetween, StatusIndicator } from 'components';
5+
import { Box, Button, ColumnLayout, Container, Header, Link, Loader, Popover, SpaceBetween, StatusIndicator } from 'components';
66
import { PermissionGuard } from 'components/PermissionGuard';
77

88
import { useAppSelector, useBreadcrumbs, usePermissionGuard } from 'hooks';
@@ -78,7 +78,7 @@ export const Settings: React.FC = () => {
7878

7979
<div>
8080
<Box variant="awsui-key-label">{t('users.email')}</Box>
81-
<div>{data.email ?? '-'}</div>
81+
<div>{data.email ? <Link href={`mailto:${data.email}`}>{data.email}</Link> : '-'}</div>
8282
</div>
8383

8484
<PermissionGuard allowedGlobalRoles={[GlobalUserRole.ADMIN]}>

frontend/src/pages/User/List/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
Button,
88
ConfirmationDialog,
99
Header,
10+
Link,
1011
ListEmptyMessage,
1112
NavigateLink,
1213
Pagination,
@@ -59,7 +60,7 @@ export const UserList: React.FC = () => {
5960
{
6061
id: 'email',
6162
header: t('users.email'),
62-
cell: (item: IUser) => item.email ?? '-',
63+
cell: (item: IUser) => (item.email ? <Link href={`mailto:${item.email}`}>{item.email}</Link> : '-'),
6364
},
6465
{
6566
id: 'global_role',

0 commit comments

Comments
 (0)