From a778017efbd96d56bc7d8db4cddad13f1450d69e Mon Sep 17 00:00:00 2001 From: nixocio Date: Tue, 17 May 2022 15:35:55 -0400 Subject: [PATCH] Add job_explanation job details page Add job_explanation job details page See: https://github.com/ansible/awx/issues/12129 --- awx/ui/src/screens/Job/JobDetail/JobDetail.js | 3 +++ awx/ui/src/screens/Job/JobDetail/JobDetail.test.js | 7 ++++++- awx/ui/src/screens/Job/shared/data.job.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/awx/ui/src/screens/Job/JobDetail/JobDetail.js b/awx/ui/src/screens/Job/JobDetail/JobDetail.js index bcc13f0d08..95c7d744c6 100644 --- a/awx/ui/src/screens/Job/JobDetail/JobDetail.js +++ b/awx/ui/src/screens/Job/JobDetail/JobDetail.js @@ -194,6 +194,9 @@ function JobDetail({ job, inventorySourceLabels }) { value={ {job.status && } + {job.job_explanation && job.job_explanation !== job.status + ? job.job_explanation + : null} } /> diff --git a/awx/ui/src/screens/Job/JobDetail/JobDetail.test.js b/awx/ui/src/screens/Job/JobDetail/JobDetail.test.js index 0f80bed33c..44c66e0f48 100644 --- a/awx/ui/src/screens/Job/JobDetail/JobDetail.test.js +++ b/awx/ui/src/screens/Job/JobDetail/JobDetail.test.js @@ -46,7 +46,12 @@ describe('', () => { // StatusIcon adds visibly hidden accessibility text " successful " assertDetail('Job ID', '2'); - assertDetail('Status', 'Successful'); + expect(wrapper.find(`Detail[label="Status"] dd`).text()).toContain( + 'Successful' + ); + expect(wrapper.find(`Detail[label="Status"] dd`).text()).toContain( + 'Job explanation placeholder' + ); assertDetail('Started', '8/8/2019, 7:24:18 PM'); assertDetail('Finished', '8/8/2019, 7:24:50 PM'); assertDetail('Job Template', mockJobData.summary_fields.job_template.name); diff --git a/awx/ui/src/screens/Job/shared/data.job.json b/awx/ui/src/screens/Job/shared/data.job.json index c67083e98e..f94482ec88 100644 --- a/awx/ui/src/screens/Job/shared/data.job.json +++ b/awx/ui/src/screens/Job/shared/data.job.json @@ -168,7 +168,7 @@ "ANSIBLE_SSH_CONTROL_PATH_DIR": "/tmp/awx_2_a4b1afiw/cp", "ANSIBLE_STDOUT_CALLBACK": "awx_display" }, - "job_explanation": "", + "job_explanation": "Job explanation placeholder", "execution_node": "awx", "controller_node": "", "result_traceback": "",