This is an automated email from the ASF dual-hosted git repository.
thiagoelg pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git
The following commit(s) were added to refs/heads/main by this push:
new d29a4e163b9 kie-issues#1859: Clicking on 'View details' after a User
Task fails to be completed crashes jBPM Dev UI and Management Console
interfaces (#2966)
d29a4e163b9 is described below
commit d29a4e163b9dc36b5abee8d6a576013210da8d34
Author: Thiago Lugli <[email protected]>
AuthorDate: Thu Mar 6 18:41:51 2025 -0300
kie-issues#1859: Clicking on 'View details' after a User Task fails to be
completed crashes jBPM Dev UI and Management Console interfaces (#2966)
---
.../src/common/components/FormNotification/FormNotification.tsx | 5 ++++-
.../src/tasks/TaskDetails.tsx | 1 -
.../runtime-tools-management-console-webapp/src/tasks/TaskForm.tsx | 4 ++--
.../src/tasks/components/FormNotification.tsx | 4 +++-
.../components/containers/TaskFormContainer/TaskFormContainer.tsx | 4 ++--
.../src/components/pages/TaskDetailsPage/TaskDetailsPage.tsx | 2 +-
6 files changed, 12 insertions(+), 8 deletions(-)
diff --git
a/packages/runtime-tools-components/src/common/components/FormNotification/FormNotification.tsx
b/packages/runtime-tools-components/src/common/components/FormNotification/FormNotification.tsx
index 468f7fbceb0..0bc5bbace39 100644
---
a/packages/runtime-tools-components/src/common/components/FormNotification/FormNotification.tsx
+++
b/packages/runtime-tools-components/src/common/components/FormNotification/FormNotification.tsx
@@ -42,6 +42,7 @@ export const FormNotification: React.FC<IOwnProps &
OUIAProps> = ({ notification
const variant = notification.type === "error" ? "danger" : "success";
const [showDetails, setShowDetails] = useState<boolean>(false);
+
const content = useMemo(
() => showDetails && notification.details && <p>{notification.details}</p>,
[showDetails, notification.details]
@@ -54,7 +55,9 @@ export const FormNotification: React.FC<IOwnProps &
OUIAProps> = ({ notification
actionLinks={
<React.Fragment>
{notification.details && (
- <AlertActionLink onClick={() => setShowDetails(!showDetails)}>View
details</AlertActionLink>
+ <AlertActionLink onClick={() => setShowDetails((currentValue) =>
!currentValue)}>
+ View details
+ </AlertActionLink>
)}
{notification.customActions &&
notification.customActions.length > 0 &&
diff --git
a/packages/runtime-tools-management-console-webapp/src/tasks/TaskDetails.tsx
b/packages/runtime-tools-management-console-webapp/src/tasks/TaskDetails.tsx
index eacbf522a74..f14bf779b2f 100644
--- a/packages/runtime-tools-management-console-webapp/src/tasks/TaskDetails.tsx
+++ b/packages/runtime-tools-management-console-webapp/src/tasks/TaskDetails.tsx
@@ -31,7 +31,6 @@ import {
import { Card, CardBody } from
"@patternfly/react-core/dist/js/components/Card";
import { Button } from "@patternfly/react-core/dist/js/components/Button";
import { Title } from "@patternfly/react-core/dist/js/components/Title";
-import { PageSection } from "@patternfly/react-core/dist/js/components/Page";
import { Bullseye } from "@patternfly/react-core/dist/js/layouts/Bullseye";
import { Grid, GridItem } from "@patternfly/react-core/dist/js/layouts/Grid";
import { Flex, FlexItem } from "@patternfly/react-core/dist/js/layouts/Flex";
diff --git
a/packages/runtime-tools-management-console-webapp/src/tasks/TaskForm.tsx
b/packages/runtime-tools-management-console-webapp/src/tasks/TaskForm.tsx
index c3cebd1ad73..9070b76be34 100644
--- a/packages/runtime-tools-management-console-webapp/src/tasks/TaskForm.tsx
+++ b/packages/runtime-tools-management-console-webapp/src/tasks/TaskForm.tsx
@@ -63,8 +63,8 @@ export const TaskForm: React.FC<Props> = ({
if (error?.response?.status === 401) {
await onUnauthorized(error);
}
- const message = error.response ? error.response.data :
error.message;
- onSubmitFormError(phase ?? "", message);
+ const details = error.response?.data?.message ?
error.response.data.message : error.message;
+ onSubmitFormError(phase ?? "", details);
});
},
getTaskFormSchema(): Promise<Record<string, any>> {
diff --git
a/packages/runtime-tools-management-console-webapp/src/tasks/components/FormNotification.tsx
b/packages/runtime-tools-management-console-webapp/src/tasks/components/FormNotification.tsx
index cec3595b384..1860961dfa4 100644
---
a/packages/runtime-tools-management-console-webapp/src/tasks/components/FormNotification.tsx
+++
b/packages/runtime-tools-management-console-webapp/src/tasks/components/FormNotification.tsx
@@ -47,7 +47,9 @@ export const FormNotification: React.FC<Props> = ({
notification }) => {
actionLinks={
<React.Fragment>
{notification.details && (
- <AlertActionLink onClick={() => setShowDetails(!showDetails)}>View
details</AlertActionLink>
+ <AlertActionLink onClick={() => setShowDetails((currentValue) =>
!currentValue)}>
+ View details
+ </AlertActionLink>
)}
{notification.customAction && (
<AlertActionLink onClick={notification.customAction.onClick}>
diff --git
a/packages/runtime-tools-process-dev-ui-webapp/src/components/containers/TaskFormContainer/TaskFormContainer.tsx
b/packages/runtime-tools-process-dev-ui-webapp/src/components/containers/TaskFormContainer/TaskFormContainer.tsx
index 7ea2bf88fd3..e5815b77c04 100644
---
a/packages/runtime-tools-process-dev-ui-webapp/src/components/containers/TaskFormContainer/TaskFormContainer.tsx
+++
b/packages/runtime-tools-process-dev-ui-webapp/src/components/containers/TaskFormContainer/TaskFormContainer.tsx
@@ -55,8 +55,8 @@ const TaskFormContainer: React.FC<Props & OUIAProps> = ({
resolve(response);
})
.catch((error) => {
- const message = error.response ? error.response.data :
error.message;
- onSubmitError(phase, message);
+ const details = error.response?.data?.message ?
error.response.data.message : error.message;
+ onSubmitError(phase ?? "", details);
reject(error);
});
});
diff --git
a/packages/runtime-tools-process-dev-ui-webapp/src/components/pages/TaskDetailsPage/TaskDetailsPage.tsx
b/packages/runtime-tools-process-dev-ui-webapp/src/components/pages/TaskDetailsPage/TaskDetailsPage.tsx
index 7d6a0cc5843..e77f008d672 100644
---
a/packages/runtime-tools-process-dev-ui-webapp/src/components/pages/TaskDetailsPage/TaskDetailsPage.tsx
+++
b/packages/runtime-tools-process-dev-ui-webapp/src/components/pages/TaskDetailsPage/TaskDetailsPage.tsx
@@ -165,7 +165,7 @@ const TaskDetailsPage: React.FC<RouteComponentProps<Props>
& OUIAProps> = ({ oui
<Card className={"Dev-ui__card-size"}>
<ServerErrors error={error} variant="large">
<Button variant="primary" onClick={() => goToInbox()}>
- Go to Inbox
+ Go to Tasks
</Button>
</ServerErrors>
</Card>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]