mirror of
https://github.com/ansible/awx.git
synced 2026-05-10 02:47:36 -02:30
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
This commit is contained in:
@@ -21,6 +21,7 @@ function ExecutionEnvironmentDetail({
|
|||||||
isDefaultEnvironment,
|
isDefaultEnvironment,
|
||||||
virtualEnvironment,
|
virtualEnvironment,
|
||||||
verifyMissingVirtualEnv,
|
verifyMissingVirtualEnv,
|
||||||
|
helpText,
|
||||||
}) {
|
}) {
|
||||||
const label = isDefaultEnvironment
|
const label = isDefaultEnvironment
|
||||||
? t`Default Execution Environment`
|
? t`Default Execution Environment`
|
||||||
@@ -37,6 +38,7 @@ function ExecutionEnvironmentDetail({
|
|||||||
{executionEnvironment.name}
|
{executionEnvironment.name}
|
||||||
</Link>
|
</Link>
|
||||||
}
|
}
|
||||||
|
helpText={helpText}
|
||||||
dataCy="execution-environment-detail"
|
dataCy="execution-environment-detail"
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
@@ -95,6 +97,7 @@ ExecutionEnvironmentDetail.propTypes = {
|
|||||||
isDefaultEnvironment: bool,
|
isDefaultEnvironment: bool,
|
||||||
virtualEnvironment: string,
|
virtualEnvironment: string,
|
||||||
verifyMissingVirtualEnv: bool,
|
verifyMissingVirtualEnv: bool,
|
||||||
|
helpText: string,
|
||||||
};
|
};
|
||||||
|
|
||||||
ExecutionEnvironmentDetail.defaultProps = {
|
ExecutionEnvironmentDetail.defaultProps = {
|
||||||
@@ -102,6 +105,7 @@ ExecutionEnvironmentDetail.defaultProps = {
|
|||||||
executionEnvironment: null,
|
executionEnvironment: null,
|
||||||
virtualEnvironment: '',
|
virtualEnvironment: '',
|
||||||
verifyMissingVirtualEnv: true,
|
verifyMissingVirtualEnv: true,
|
||||||
|
helpText: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ExecutionEnvironmentDetail;
|
export default ExecutionEnvironmentDetail;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import ChipGroup from '../ChipGroup';
|
|||||||
import CredentialChip from '../CredentialChip';
|
import CredentialChip from '../CredentialChip';
|
||||||
import ExecutionEnvironmentDetail from '../ExecutionEnvironmentDetail';
|
import ExecutionEnvironmentDetail from '../ExecutionEnvironmentDetail';
|
||||||
import { formatDateString } from '../../util/dates';
|
import { formatDateString } from '../../util/dates';
|
||||||
|
import { isJobRunning } from '../../util/jobs';
|
||||||
import { JOB_TYPE_URL_SEGMENTS } from '../../constants';
|
import { JOB_TYPE_URL_SEGMENTS } from '../../constants';
|
||||||
import JobCancelButton from '../JobCancelButton';
|
import JobCancelButton from '../JobCancelButton';
|
||||||
|
|
||||||
@@ -32,7 +33,7 @@ function JobListItem({
|
|||||||
const jobTypes = {
|
const jobTypes = {
|
||||||
project_update: t`Source Control Update`,
|
project_update: t`Source Control Update`,
|
||||||
inventory_update: t`Inventory Sync`,
|
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`,
|
ad_hoc_command: t`Command`,
|
||||||
system_job: t`Management Job`,
|
system_job: t`Management Job`,
|
||||||
workflow_job: t`Workflow Job`,
|
workflow_job: t`Workflow Job`,
|
||||||
@@ -202,10 +203,12 @@ function JobListItem({
|
|||||||
dataCy={`job-${job.id}-project`}
|
dataCy={`job-${job.id}-project`}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<ExecutionEnvironmentDetail
|
{job.type !== 'workflow_job' && !isJobRunning(job.status) && (
|
||||||
executionEnvironment={execution_environment}
|
<ExecutionEnvironmentDetail
|
||||||
verifyMissingVirtualEnv={false}
|
executionEnvironment={execution_environment}
|
||||||
/>
|
verifyMissingVirtualEnv={false}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{credentials && credentials.length > 0 && (
|
{credentials && credentials.length > 0 && (
|
||||||
<Detail
|
<Detail
|
||||||
fullWidth
|
fullWidth
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ function JobDetail({ job }) {
|
|||||||
inventory_update: t`Inventory Sync`,
|
inventory_update: t`Inventory Sync`,
|
||||||
job: job.job_type === 'check' ? t`Playbook Check` : t`Playbook Run`,
|
job: job.job_type === 'check' ? t`Playbook Check` : t`Playbook Run`,
|
||||||
ad_hoc_command: t`Command`,
|
ad_hoc_command: t`Command`,
|
||||||
management_job: t`Management Job`,
|
system_job: t`Management Job`,
|
||||||
workflow_job: t`Workflow Job`,
|
workflow_job: t`Workflow Job`,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -220,10 +220,12 @@ function JobDetail({ job }) {
|
|||||||
<Detail label={t`Playbook`} value={job.playbook} />
|
<Detail label={t`Playbook`} value={job.playbook} />
|
||||||
<Detail label={t`Limit`} value={job.limit} />
|
<Detail label={t`Limit`} value={job.limit} />
|
||||||
<Detail label={t`Verbosity`} value={VERBOSITY[job.verbosity]} />
|
<Detail label={t`Verbosity`} value={VERBOSITY[job.verbosity]} />
|
||||||
<ExecutionEnvironmentDetail
|
{job.type !== 'workflow_job' && !isJobRunning(job.status) && (
|
||||||
executionEnvironment={executionEnvironment}
|
<ExecutionEnvironmentDetail
|
||||||
verifyMissingVirtualEnv={false}
|
executionEnvironment={executionEnvironment}
|
||||||
/>
|
verifyMissingVirtualEnv={false}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<Detail label={t`Execution Node`} value={job.execution_node} />
|
<Detail label={t`Execution Node`} value={job.execution_node} />
|
||||||
{instanceGroup && !instanceGroup?.is_container_group && (
|
{instanceGroup && !instanceGroup?.is_container_group && (
|
||||||
<Detail
|
<Detail
|
||||||
|
|||||||
@@ -166,7 +166,6 @@ function JobTemplateDetail({ template }) {
|
|||||||
if (isLoadingInstanceGroups || isDeleteLoading) {
|
if (isLoadingInstanceGroups || isDeleteLoading) {
|
||||||
return <ContentLoading />;
|
return <ContentLoading />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CardBody>
|
<CardBody>
|
||||||
<DetailList gutter="sm">
|
<DetailList gutter="sm">
|
||||||
@@ -212,7 +211,10 @@ function JobTemplateDetail({ template }) {
|
|||||||
)}
|
)}
|
||||||
<ExecutionEnvironmentDetail
|
<ExecutionEnvironmentDetail
|
||||||
virtualEnvironment={custom_virtualenv}
|
virtualEnvironment={custom_virtualenv}
|
||||||
executionEnvironment={summary_fields?.execution_environment}
|
executionEnvironment={summary_fields?.resolved_environment}
|
||||||
|
helpText={t`The execution environment that will be used when launching
|
||||||
|
this job template. The resolved execution environment can be overridden by
|
||||||
|
explicitly assigning a different one to this job template.`}
|
||||||
/>
|
/>
|
||||||
<Detail label={t`Source Control Branch`} value={template.scm_branch} />
|
<Detail label={t`Source Control Branch`} value={template.scm_branch} />
|
||||||
<Detail label={t`Playbook`} value={playbook} />
|
<Detail label={t`Playbook`} value={playbook} />
|
||||||
|
|||||||
@@ -139,6 +139,12 @@
|
|||||||
"name": "Default EE",
|
"name": "Default EE",
|
||||||
"description": "",
|
"description": "",
|
||||||
"image": "quay.io/ansible/awx-ee"
|
"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",
|
"created": "2019-09-30T16:18:34.564820Z",
|
||||||
|
|||||||
Reference in New Issue
Block a user