diff --git a/src/api/DataTypes.js b/src/api/DataTypes.js index be3e49086ccac828d19ba20a8a5fa3796282f995..15d1ced089588dfe0c4d93a2af4ea6294661f566 100644 --- a/src/api/DataTypes.js +++ b/src/api/DataTypes.js @@ -1,14 +1,14 @@ const jobMessages = { - queued: "job is queued on job server", + queued: "job is queued on the server", running: "job is running", - failed: "job failed", + failed: "job has failed", successful: "job was successful" }; const typeMap = { DEPLOY: "Deployment", UNDEPLOY: "Undeployment", - START: "Start command", - STOP: "Stop command" + START: "Start Command", + STOP: "Stop Command" }; export class AWXJobDetails { constructor(operationType, job) { @@ -31,7 +31,7 @@ export class AWXJobDetails { return this.job?.status.toLowerCase(); } message() { - const stem = this.job ? `The ${this.typeLabel()}: ` : ""; + const stem = this.job ? `${this.typeLabel()}: ` : ""; const info = this.job ? jobMessages[this.job.status.toLowerCase()] : "Fetching data"; diff --git a/src/components/Job/JobDetails.js b/src/components/Job/JobDetails.js index 7d683b756444a7c1692811b9e5ca5890afb95ee4..16a74f1a0c9548ba9103dbe47bb9cc4592a0219f 100644 --- a/src/components/Job/JobDetails.js +++ b/src/components/Job/JobDetails.js @@ -102,19 +102,32 @@ export function JobDetails({ operation, job }) { : "-" }; + const finishedJobAlerts = finishedJob ? ( + <Grid + item + xs={12} + > + <AlertBannerList alerts={[alert].concat(jobAlert)} /> + </Grid> + ) : null; + + const unFinishedJobsWithAlerts = + !finishedJob && alert ? ( + <Grid + item + xs={12} + > + <AlertBannerList alerts={[alert]} /> + </Grid> + ) : null; + return ( <Grid container spacing={1} > - {finishedJob && ( - <Grid - item - xs={12} - > - <AlertBannerList alerts={[alert].concat(jobAlert)} /> - </Grid> - )} + {finishedJobAlerts} + {unFinishedJobsWithAlerts} <Grid item xs={12} @@ -143,14 +156,6 @@ export function JobDetails({ operation, job }) { </CardContent> </Card> </Grid> - {!finishedJob && alert && ( - <Grid - item - xs={12} - > - <AlertBannerList alerts={[alert]} /> - </Grid> - )} <AccessControl allowedRoles={["DeploymentToolAdmin", "DeploymentToolIntegrator"]} renderNoAccess={() => <></>}