Merge pull request #11534 from marshmalien/7678-inv-sync-link

Link from sync status icon to prefiltered list of inventory source sync jobs
This commit is contained in:
Sarah Akus
2022-01-25 12:03:09 -05:00
committed by GitHub
3 changed files with 25 additions and 5 deletions

View File

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

View File

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

View File

@@ -95,9 +95,19 @@ function InventoryListItem({
)} )}
</TdBreakWord> </TdBreakWord>
<Td dataLabel={t`Status`}> <Td dataLabel={t`Status`}>
{inventory.kind !== 'smart' && ( {inventory.kind !== 'smart' &&
<StatusLabel status={syncStatus} tooltipContent={tooltipContent} /> (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>
<Td dataLabel={t`Type`}> <Td dataLabel={t`Type`}>
{inventory.kind === 'smart' ? t`Smart Inventory` : t`Inventory`} {inventory.kind === 'smart' ? t`Smart Inventory` : t`Inventory`}