Skip to content

Commit

Permalink
feat: Add opening list items in a new tab with middle mouse button fo…
Browse files Browse the repository at this point in the history
…r Manifests and RequestEventTable (SBOMER-250)
  • Loading branch information
thavlice committed Feb 6, 2025
1 parent 7808d97 commit c8d335d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
8 changes: 7 additions & 1 deletion ui/src/app/components/ManifestsTableTable/ManifestsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { useNavigate } from 'react-router-dom';
import { useSearchParam } from 'react-use';
import { ErrorSection } from '../Sections/ErrorSection/ErrorSection';
import { useManifests } from './useSboms';
import { openInNewTab } from '@app/utils/openInNewTab';

const columnNames = {
id: 'ID',
Expand Down Expand Up @@ -70,7 +71,12 @@ export const ManifestsTable = () => {
</Thead>
<Tbody>
{value.map((manifest) => (
<Tr key={manifest.id} isClickable onRowClick={() => navigate('/manifests/' + manifest.id)}>
<Tr
key={manifest.id}
isClickable
onRowClick={() => navigate('/manifests/' + manifest.id)}
onAuxClick={() => openInNewTab('/manifests/' + manifest.id)}
>
<Td dataLabel={columnNames.id}>
<pre>{manifest.id}</pre>
</Td>
Expand Down
10 changes: 8 additions & 2 deletions ui/src/app/components/RequestEventTable/RequestEventTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { useNavigate } from 'react-router-dom';
import { useSearchParam } from 'react-use';
import { ErrorSection } from '../Sections/ErrorSection/ErrorSection';
import { useRequestEvents } from './useRequestEvents';
import { openInNewTab } from '@app/utils/openInNewTab';

const columnNames = {
id: 'ID',
Expand Down Expand Up @@ -75,12 +76,17 @@ export const RequestEventTable = () => {
</Thead>
<Tbody>
{value.map((requestEvent) => (
<Tr key={requestEvent.id} isClickable onRowClick={() => navigate('/requestevents/' + requestEvent.id)}>
<Tr
key={requestEvent.id}
isClickable
onRowClick={() => navigate('/requestevents/' + requestEvent.id)}
onAuxClick={() => openInNewTab('/requestevents/' + requestEvent.id)}
>
<Td dataLabel={columnNames.id}>
<pre>{requestEvent.id}</pre>
</Td>
<Td dataLabel={columnNames.eventStatus}>
<Tooltip
<Tooltip
isContentLeftAligned={true}
content={
<div>
Expand Down

0 comments on commit c8d335d

Please sign in to comment.