Skip to content
Snippets Groups Projects
Commit 452c2c8c authored by Johanna Szepanski's avatar Johanna Szepanski
Browse files

only show revision for deploy jobs

parent 0ff2a8cb
No related branches found
No related tags found
2 merge requests!612Release 5.0.0,!594CE-3447: Improve batch presentation
import { Stack } from "@mui/material";
import { InternalLink, KeyValueTable } from "@ess-ics/ce-ui-common";
import { calculateHostText } from "./JobUtils";
import { JobGitRefLink } from "./JobGitRefLink";
import { JobGitRefIcon } from "./JobGitRefIcon";
import { calculateHostText, isDeploymentJob } from "./JobUtils";
import { JobRevisionChip } from "./JobRevisionChip";
import { JobDetails } from "../../store/deployApi";
interface JobDetailsSingleJobProps {
job: JobDetails;
}
const getSingleOperationFields = (operation: JobDetails) => {
const getRevision = (operation: JobDetails) => {
return {
revision:
operation.gitReference && operation.gitProjectId ? (
<JobRevisionChip
gitReference={operation.gitReference}
gitProjectId={operation.gitProjectId}
/>
) : (
"Unknown"
)
};
};
const getSingleOperationFields = (
operation: JobDetails,
isDeployJob: boolean
) => {
return {
ioc: (
<InternalLink
......@@ -19,34 +34,16 @@ const getSingleOperationFields = (operation: JobDetails) => {
{operation.iocName}
</InternalLink>
),
revision:
operation.gitReference && operation.gitProjectId ? (
<Stack
flexDirection="row"
alignItems="center"
gap={0.5}
>
<JobGitRefIcon
gitReference={operation.gitReference}
gitProjectId={operation.gitProjectId}
/>
<JobGitRefLink
gitReference={operation.gitReference}
gitProjectId={operation.gitProjectId}
disableExternalLinkIcon
/>
</Stack>
) : (
"Unknown"
),
...(isDeployJob && getRevision(operation)),
host: calculateHostText(operation)
};
};
export const JobDetailsSingleJob = ({ job }: JobDetailsSingleJobProps) => {
const isDeployJob = isDeploymentJob(job.action);
return (
<KeyValueTable
obj={getSingleOperationFields(job)}
obj={getSingleOperationFields(job, isDeployJob)}
variant="overline"
sx={{ border: 0 }}
valueOptions={{ headerName: "" }}
......
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