mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
Merge pull request #9642 from mabashian/9640-workflow-output
Only attempt to fetch event options on non workflow jobs SUMMARY link #9640 This was fallout from output search filtering. We need this request for non workflow jobs so that we can build the search options. ISSUE TYPE Bugfix Pull Request COMPONENT NAME UI Reviewed-by: Tiago Góes <tiago.goes2009@gmail.com>
This commit is contained in:
commit
3878d8f7d8
@ -33,11 +33,15 @@ function Job({ i18n, setBreadcrumb }) {
|
||||
result: { jobDetail, eventRelatedSearchableKeys, eventSearchableKeys },
|
||||
} = useRequest(
|
||||
useCallback(async () => {
|
||||
let eventOptions = {};
|
||||
const { data: jobDetailData } = await JobsAPI.readDetail(id, type);
|
||||
const { data: jobEventOptions } = await JobsAPI.readEventOptions(
|
||||
id,
|
||||
type
|
||||
);
|
||||
if (jobDetailData.type !== 'workflow_job') {
|
||||
const { data: jobEventOptions } = await JobsAPI.readEventOptions(
|
||||
id,
|
||||
type
|
||||
);
|
||||
eventOptions = jobEventOptions;
|
||||
}
|
||||
if (
|
||||
jobDetailData?.summary_fields?.credentials?.find(
|
||||
cred => cred.kind === 'vault'
|
||||
@ -54,11 +58,11 @@ function Job({ i18n, setBreadcrumb }) {
|
||||
return {
|
||||
jobDetail: jobDetailData,
|
||||
eventRelatedSearchableKeys: (
|
||||
jobEventOptions?.related_search_fields || []
|
||||
eventOptions?.related_search_fields || []
|
||||
).map(val => val.slice(0, -8)),
|
||||
eventSearchableKeys: Object.keys(
|
||||
jobEventOptions.actions?.GET || {}
|
||||
).filter(key => jobEventOptions.actions?.GET[key].filterable),
|
||||
eventOptions?.actions?.GET || {}
|
||||
).filter(key => eventOptions?.actions?.GET[key].filterable),
|
||||
};
|
||||
}, [id, type, setBreadcrumb]),
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user