Add prefiltered link to inventory source sync jobs

This commit is contained in:
Marliana Lara 2022-01-13 11:04:43 -05:00
parent b0c59ee330
commit 11cc7e37e1
No known key found for this signature in database
GPG Key ID: 38C73B40DFA809EE
3 changed files with 25 additions and 5 deletions

View File

@ -26,7 +26,11 @@ import JobListItem from './JobListItem';
import JobListCancelButton from './JobListCancelButton';
import useWsJobs from './useWsJobs';
function JobList({ defaultParams, showTypeColumn = false }) {
function JobList({
defaultParams,
showTypeColumn = false,
additionalRelatedSearchableKeys = [],
}) {
const qsConfig = getQSConfig(
'job',
{
@ -243,7 +247,10 @@ function JobList({ defaultParams, showTypeColumn = false }) {
}
clearSelected={clearSelected}
toolbarSearchableKeys={searchableKeys}
toolbarRelatedSearchableKeys={relatedSearchableKeys}
toolbarRelatedSearchableKeys={[
...relatedSearchableKeys,
...additionalRelatedSearchableKeys,
]}
renderToolbar={(props) => (
<DatalistToolbar
{...props}

View File

@ -167,6 +167,9 @@ function Inventory({ setBreadcrumb }) {
inventory.id,
or__workflowjob__inventory: inventory.id,
}}
additionalRelatedSearchableKeys={[
'inventoryupdate__inventory_source__inventory',
]}
/>
</Route>,
<Route path="*" key="not-found">

View File

@ -95,9 +95,19 @@ function InventoryListItem({
)}
</TdBreakWord>
<Td dataLabel={t`Status`}>
{inventory.kind !== 'smart' && (
<StatusLabel status={syncStatus} tooltipContent={tooltipContent} />
)}
{inventory.kind !== 'smart' &&
(inventory.has_inventory_sources ? (
<Link
to={`/inventories/inventory/${inventory.id}/jobs?job.or__inventoryupdate__inventory_source__inventory__id=${inventory.id}`}
>
<StatusLabel
status={syncStatus}
tooltipContent={tooltipContent}
/>
</Link>
) : (
<StatusLabel status={syncStatus} tooltipContent={tooltipContent} />
))}
</Td>
<Td dataLabel={t`Type`}>
{inventory.kind === 'smart' ? t`Smart Inventory` : t`Inventory`}