Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kie-issues#1720] Enhance Process Details UI page to show nodeInstanceId each timer belongs to #2820

Merged
merged 8 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .rat-excludes
Original file line number Diff line number Diff line change
Expand Up @@ -2036,3 +2036,5 @@ scripts.iml
index.test.js
# scripts/check-junit-report-results/tests/reports/empty.xml
empty.xml
# packages/runtime-tools-process-gateway-api/src/graphql/types.tsx
types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,37 @@ export const JobsDetailsModal: React.FC<IOwnProps & OUIAProps> = ({
<div className="kogito-management-console-shared--jobsModal__detailsModal">
<TextContent>
<Flex direction={{ default: "column" }}>
<FlexItem>
<Split hasGutter>
<SplitItem>
<Text component={TextVariants.h6}>Process Id: </Text>{" "}
</SplitItem>
<SplitItem>{job.processId}</SplitItem>
</Split>
</FlexItem>
<FlexItem>
<Split hasGutter>
<SplitItem>
{" "}
<Text component={TextVariants.h6}>Process Instance Id: </Text>{" "}
</SplitItem>
<SplitItem>{job.processInstanceId}</SplitItem>
</Split>
</FlexItem>
{job.processId && (
<FlexItem>
<Split hasGutter>
<SplitItem>
<Text component={TextVariants.h6}>Process Id: </Text>{" "}
</SplitItem>
<SplitItem>{job.processId}</SplitItem>
</Split>
</FlexItem>
)}
{job.processInstanceId && (
<FlexItem>
<Split hasGutter>
<SplitItem>
{" "}
<Text component={TextVariants.h6}>Process Instance Id: </Text>{" "}
</SplitItem>
<SplitItem>{job.processInstanceId}</SplitItem>
</Split>
</FlexItem>
)}
{job.nodeInstanceId && (
<FlexItem>
<Split hasGutter>
<SplitItem>
<Text component={TextVariants.h6}>Node Instance Id: </Text>
</SplitItem>
<SplitItem>{job.nodeInstanceId}</SplitItem>
</Split>
</FlexItem>
)}
<FlexItem>
<Split hasGutter>
<SplitItem>
Expand All @@ -75,78 +89,90 @@ export const JobsDetailsModal: React.FC<IOwnProps & OUIAProps> = ({
<SplitItem>{job.status}</SplitItem>
</Split>
</FlexItem>
<FlexItem>
<Split hasGutter>
<SplitItem>
<Text component={TextVariants.h6}>Priority: </Text>{" "}
</SplitItem>
<SplitItem>{job.priority}</SplitItem>
</Split>
</FlexItem>
{job.repeatInterval && (
{job.priority !== undefined && (
<FlexItem>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Priority still appears even if it's empty... @josedee is on PTO right now, will push a fix asap

@ljmotta ^

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So maybe the priority can have the null value?

<Split hasGutter>
<SplitItem>
<Text component={TextVariants.h6}>RepeatInterval: </Text>
<Text component={TextVariants.h6}>Priority: </Text>{" "}
</SplitItem>
<SplitItem>{job.priority}</SplitItem>
</Split>
</FlexItem>
)}
{job.repeatInterval !== undefined && (
<FlexItem>
<Split hasGutter>
<SplitItem>
<Text component={TextVariants.h6}>Repeat Interval: </Text>
</SplitItem>
<SplitItem>{job.repeatInterval}</SplitItem>
</Split>
</FlexItem>
)}
{job.repeatLimit && (
{job.repeatLimit !== undefined && (
<FlexItem>
<Split hasGutter>
<SplitItem>
<Text component={TextVariants.h6}>RepeatLimit: </Text>
<Text component={TextVariants.h6}>Repeat Limit: </Text>
</SplitItem>
<SplitItem>{job.repeatLimit}</SplitItem>
</Split>
</FlexItem>
)}
<FlexItem>
<Split hasGutter>
<SplitItem>
<Text component={TextVariants.h6}>ScheduledId: </Text>
</SplitItem>
<SplitItem>{job.scheduledId}</SplitItem>
</Split>
</FlexItem>
<FlexItem>
<Split hasGutter>
<SplitItem>
<Text component={TextVariants.h6}>Retries: </Text>
</SplitItem>
<SplitItem>{job.retries}</SplitItem>
</Split>
</FlexItem>
<FlexItem>
<Split hasGutter>
<SplitItem>
<Text component={TextVariants.h6}>Execution counter: </Text>
</SplitItem>
<SplitItem>{job.executionCounter}</SplitItem>
</Split>
</FlexItem>
<FlexItem>
<Split hasGutter>
<SplitItem>
<Text component={TextVariants.h6}>Last Updated: </Text>
</SplitItem>
<SplitItem>
<Moment fromNow>{new Date(`${job.lastUpdate}`)}</Moment>
</SplitItem>
</Split>
</FlexItem>
<FlexItem>
<Split hasGutter>
<SplitItem>
<Text component={TextVariants.h6} className="kogito-management-console-shared--jobsModal__text">
Callback Endpoint:{" "}
</Text>
</SplitItem>
<SplitItem>{job.callbackEndpoint}</SplitItem>
</Split>
</FlexItem>
{job.scheduledId && (
<FlexItem>
<Split hasGutter>
<SplitItem>
<Text component={TextVariants.h6}>Scheduled Id: </Text>
</SplitItem>
<SplitItem>{job.scheduledId}</SplitItem>
</Split>
</FlexItem>
)}
{job.retries !== undefined && (
<FlexItem>
<Split hasGutter>
<SplitItem>
<Text component={TextVariants.h6}>Retries: </Text>
</SplitItem>
<SplitItem>{job.retries}</SplitItem>
</Split>
</FlexItem>
)}
{job.executionCounter !== undefined && (
<FlexItem>
<Split hasGutter>
<SplitItem>
<Text component={TextVariants.h6}>Execution counter: </Text>
</SplitItem>
<SplitItem>{job.executionCounter}</SplitItem>
</Split>
</FlexItem>
)}
{job.lastUpdate !== undefined && (
<FlexItem>
<Split hasGutter>
<SplitItem>
<Text component={TextVariants.h6}>Last Updated: </Text>
</SplitItem>
<SplitItem>
<Moment fromNow>{new Date(`${job.lastUpdate}`)}</Moment>
</SplitItem>
</Split>
</FlexItem>
)}
{job.callbackEndpoint && (
<FlexItem>
<Split hasGutter>
<SplitItem>
<Text component={TextVariants.h6} className="kogito-management-console-shared--jobsModal__text">
Callback Endpoint:{" "}
</Text>
</SplitItem>
<SplitItem>{job.callbackEndpoint}</SplitItem>
</Split>
</FlexItem>
)}
</Flex>
</TextContent>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,23 +342,19 @@ const ProcessDetailsTimelinePanel: React.FC<IOwnProps & OUIAProps> = ({
};

const renderTimerIcon = (id: string) => {
return jobs.length > 0 ? (
jobs.map((job, idx) => {
if (id === job.nodeInstanceId) {
return (
<Tooltip content={"Node has job"} key={idx}>
<OutlinedClockIcon
className="pf-u-ml-sm"
color="var(--pf-global--icon--Color--dark)"
onClick={() => handleJobDetails(job)}
/>
</Tooltip>
);
}
})[0]
) : (
<></>
);
const job = jobs.find((job) => id === job.nodeInstanceId);
if (job) {
return (
<Tooltip content={"Node has job"} key={`${id}-job-tooltip-${job.id}`}>
<OutlinedClockIcon
className="pf-u-ml-sm"
color="var(--pf-global--icon--Color--dark)"
onClick={() => handleJobDetails(job)}
/>
</Tooltip>
);
}
return <></>;
pefernan marked this conversation as resolved.
Show resolved Hide resolved
};

const detailsAction: JSX.Element[] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2110,6 +2110,16 @@
"ofType": null
},
"defaultValue": null
},
{
"name": "variables",
"description": null,
"type": {
"kind": "SCALAR",
"name": "JSON",
"ofType": null
},
"defaultValue": null
}
],
"interfaces": null,
Expand Down Expand Up @@ -2827,6 +2837,18 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "slaDueDate",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "DateTime",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "source",
"description": null,
Expand Down Expand Up @@ -3100,6 +3122,18 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "slaDueDate",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "DateTime",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "type",
"description": null,
Expand Down Expand Up @@ -3695,6 +3729,18 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "externalReferenceId",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "id",
"description": null,
Expand Down Expand Up @@ -3916,6 +3962,18 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "slaDueDate",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "DateTime",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "started",
"description": null,
Expand Down Expand Up @@ -7300,6 +7358,12 @@
}
]
},
{
"name": "oneOf",
"description": "Indicates an Input Object is a OneOf Input Object.",
"locations": ["INPUT_OBJECT"],
"args": []
},
{
"name": "skip",
"description": "Directs the executor to skip this field or fragment when the `if` argument is true.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ export const GET_JOBS_WITH_FILTERS = gql`
retries
lastUpdate
endpoint
nodeInstanceId
executionCounter
}
}
Expand Down Expand Up @@ -400,6 +401,15 @@ export const GET_PROCESS_INSTANCE_SVG = gql`
}
`;

export const GET_PROCESS_DEFINITIONS = gql`
query getProcessDefinitions {
ProcessDefinitions {
id
endpoint
}
}
`;

export const GET_PROCESS_DEFINITION_NODES = gql`
query getProcessDefinitionNodes($processId: String) {
ProcessDefinitions(where: { id: { equal: $processId } }) {
Expand Down
Loading
Loading