From 2c5bcf268d35d9b4195242adf5f8ec3ad56c7da7 Mon Sep 17 00:00:00 2001 From: nixocio Date: Wed, 9 Jun 2021 15:01:42 -0400 Subject: [PATCH] Update UI to reflect new API EE changes * Show resolved EE for job template details. * Do not show EE if a certain job status still running, since EE on the API is not set yet. It was causing the bug to temporarily show `missing resource`. * Fix discrepancy about job types for list and details. See: https://github.com/ansible/awx/issues/10327 Also: https://github.com/ansible/awx/issues/10399 --- .../ExecutionEnvironmentDetail.jsx | 4 ++++ awx/ui_next/src/components/JobList/JobListItem.jsx | 13 ++++++++----- awx/ui_next/src/screens/Job/JobDetail/JobDetail.jsx | 12 +++++++----- .../JobTemplateDetail/JobTemplateDetail.jsx | 6 ++++-- .../screens/Template/shared/data.job_template.json | 6 ++++++ 5 files changed, 29 insertions(+), 12 deletions(-) diff --git a/awx/ui_next/src/components/ExecutionEnvironmentDetail/ExecutionEnvironmentDetail.jsx b/awx/ui_next/src/components/ExecutionEnvironmentDetail/ExecutionEnvironmentDetail.jsx index 720595e013..5a123ebe49 100644 --- a/awx/ui_next/src/components/ExecutionEnvironmentDetail/ExecutionEnvironmentDetail.jsx +++ b/awx/ui_next/src/components/ExecutionEnvironmentDetail/ExecutionEnvironmentDetail.jsx @@ -21,6 +21,7 @@ function ExecutionEnvironmentDetail({ isDefaultEnvironment, virtualEnvironment, verifyMissingVirtualEnv, + helpText, }) { const label = isDefaultEnvironment ? t`Default Execution Environment` @@ -37,6 +38,7 @@ function ExecutionEnvironmentDetail({ {executionEnvironment.name} } + helpText={helpText} dataCy="execution-environment-detail" /> ); @@ -95,6 +97,7 @@ ExecutionEnvironmentDetail.propTypes = { isDefaultEnvironment: bool, virtualEnvironment: string, verifyMissingVirtualEnv: bool, + helpText: string, }; ExecutionEnvironmentDetail.defaultProps = { @@ -102,6 +105,7 @@ ExecutionEnvironmentDetail.defaultProps = { executionEnvironment: null, virtualEnvironment: '', verifyMissingVirtualEnv: true, + helpText: '', }; export default ExecutionEnvironmentDetail; diff --git a/awx/ui_next/src/components/JobList/JobListItem.jsx b/awx/ui_next/src/components/JobList/JobListItem.jsx index ade6f62c20..85d2ade5bd 100644 --- a/awx/ui_next/src/components/JobList/JobListItem.jsx +++ b/awx/ui_next/src/components/JobList/JobListItem.jsx @@ -14,6 +14,7 @@ import ChipGroup from '../ChipGroup'; import CredentialChip from '../CredentialChip'; import ExecutionEnvironmentDetail from '../ExecutionEnvironmentDetail'; import { formatDateString } from '../../util/dates'; +import { isJobRunning } from '../../util/jobs'; import { JOB_TYPE_URL_SEGMENTS } from '../../constants'; import JobCancelButton from '../JobCancelButton'; @@ -32,7 +33,7 @@ function JobListItem({ const jobTypes = { project_update: t`Source Control Update`, inventory_update: t`Inventory Sync`, - job: t`Playbook Run`, + job: job.job_type === 'check' ? t`Playbook Check` : t`Playbook Run`, ad_hoc_command: t`Command`, system_job: t`Management Job`, workflow_job: t`Workflow Job`, @@ -202,10 +203,12 @@ function JobListItem({ dataCy={`job-${job.id}-project`} /> )} - + {job.type !== 'workflow_job' && !isJobRunning(job.status) && ( + + )} {credentials && credentials.length > 0 && ( - + {job.type !== 'workflow_job' && !isJobRunning(job.status) && ( + + )} {instanceGroup && !instanceGroup?.is_container_group && ( ; } - return ( @@ -212,7 +211,10 @@ function JobTemplateDetail({ template }) { )} diff --git a/awx/ui_next/src/screens/Template/shared/data.job_template.json b/awx/ui_next/src/screens/Template/shared/data.job_template.json index fa516d46db..4d4eb77af1 100644 --- a/awx/ui_next/src/screens/Template/shared/data.job_template.json +++ b/awx/ui_next/src/screens/Template/shared/data.job_template.json @@ -139,6 +139,12 @@ "name": "Default EE", "description": "", "image": "quay.io/ansible/awx-ee" + }, + "resolved_environment": { + "id": 1, + "name": "Default EE", + "description": "", + "image": "quay.io/ansible/awx-ee" } }, "created": "2019-09-30T16:18:34.564820Z",