Skip to content
Snippets Groups Projects
Commit 90055b74 authored by cjenkscybercom's avatar cjenkscybercom
Browse files

CE-2223: move job detail alerts to top of page, reword messages

parent bcad7798
No related branches found
No related tags found
2 merge requests!407CE-2141: 3.0.0,!405Qa release tasks
Pipeline #164758 passed
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";
......
......@@ -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={() => <></>}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment