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

feat: users can view the associated process for a task #18460

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

douglasbouttell-camunda
Copy link
Contributor

@douglasbouttell-camunda douglasbouttell-camunda commented May 13, 2024

Description

Allow users to view the associated process for a task. Highlight the activity which relates to the task.

This allows users to have increased visibility and context for a task.

Related issues

closes #17645 , #18706

@douglasbouttell-camunda douglasbouttell-camunda added the component/tasklist Related to the Tasklist component/team label May 13, 2024
@douglasbouttell-camunda douglasbouttell-camunda requested a review from a team May 13, 2024 12:51
Copy link
Contributor

github-actions bot commented May 13, 2024

Tasklist Test Results

143 files  143 suites   1h 37m 28s ⏱️
549 tests 544 ✅ 5 💤 0 ❌
547 runs  542 ✅ 5 💤 0 ❌

Results for commit cf343d8.

♻️ This comment has been updated with latest results.

@douglasbouttell-camunda douglasbouttell-camunda marked this pull request as ready for review May 13, 2024 15:24
tasklist/client/src/modules/types/index.tsx Outdated Show resolved Hide resolved
tasklist/client/src/modules/request.ts Show resolved Hide resolved
tasklist/client/src/Tasks/Task/ProcessView/index.tsx Outdated Show resolved Hide resolved
Comment on lines 30 to 38
if (error !== null && error.variant === 'failed-response') {
const {status} = error.response;
if (
status === HTTP_STATUS_FORBIDDEN ||
status === HTTP_STATUS_NOT_FOUND
) {
return null;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this special case? I think we should just throw the error like we do everywhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The behaviour for a 404 Not Found error is different to a 500 Internal Server Error. I think we should explicitly handle business cases (not found and forbidden) since it makes it simpler to whoever consumes this hook.

Copy link
Contributor

Choose a reason for hiding this comment

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

The behaviour for a 404 Not Found error is different to a 500 Internal Server Error. I think we should explicitly handle business cases (not found and forbidden) since it makes it simpler to whoever consumes this hook.

but this is basically goes against react-query conventions of throwing errors and it makes harder for the hook to be reused if want to have a different behavior. It would be impossible to build a 404 page for this for example.

I believe this logic should exist in the view layer

tasklist/client/e2e/tests/task-details.spec.ts Outdated Show resolved Hide resolved
<Tag className={styles.version}>Version: {version}</Tag>
</div>
{bpmnXml !== null ? (
<Layer level={1} className={styles.diagramFrame}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you have to explicitly add it because it's was already at level 3?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

--cds-layer only uses the current layer which is the same as the background at level 0. So I need to increase it to level 1 to get the grey background.

Copy link
Contributor

Choose a reason for hiding this comment

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

Then the proper fix should be to wrap somewhere with <Layer /> component

Copy link
Contributor

Choose a reason for hiding this comment

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

@douglasbouttell-camunda This was left unanswered

tasklist/client/e2e/visual/tasks-page.spec.ts Show resolved Hide resolved
@@ -10,3 +10,8 @@
border-top: 1px solid var(--cds-border-subtle);
border-bottom: 1px solid var(--cds-border-subtle);
}

.hidden {
display: none !important;
Copy link
Contributor

@vsgoulart vsgoulart May 15, 2024

Choose a reason for hiding this comment

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

Let's remove the important please. We can use CSS specificity to achieve the same

tasklist/client/e2e/pages/TaskDetailsPage.ts Outdated Show resolved Hide resolved
tasklist/client/src/Tasks/Task/ProcessView/index.tsx Outdated Show resolved Hide resolved
return response.json();
}

throw error ?? new Error('Failed to fetch process instances');
Copy link
Contributor

Choose a reason for hiding this comment

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

error is never null when response is null

Suggested change
throw error ?? new Error('Failed to fetch process instances');
throw error;

Comment on lines 30 to 38
if (error !== null && error.variant === 'failed-response') {
const {status} = error.response;
if (
status === HTTP_STATUS_FORBIDDEN ||
status === HTTP_STATUS_NOT_FOUND
) {
return null;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The behaviour for a 404 Not Found error is different to a 500 Internal Server Error. I think we should explicitly handle business cases (not found and forbidden) since it makes it simpler to whoever consumes this hook.

but this is basically goes against react-query conventions of throwing errors and it makes harder for the hook to be reused if want to have a different behavior. It would be impossible to build a 404 page for this for example.

I believe this logic should exist in the view layer

@vsgoulart
Copy link
Contributor

@douglasbouttell-camunda Could you also rebase this branch?

@vsgoulart
Copy link
Contributor

@douglasbouttell-camunda Could you fix this tooltip issue I mentioned somedays ago on this PR too?
image

There's also an issue with the labels appearing on new vars, which is the wrong behavior. This must have come from a Carbon update, it should be a onliner too:
image

@douglasbouttell-camunda
Copy link
Contributor Author

@douglasbouttell-camunda Could you fix this tooltip issue I mentioned somedays ago on this PR too?

These have been fixed in the latest commit and I added some visual regression snapshots so we catch this in the future.

Copy link
Contributor

@vsgoulart vsgoulart left a comment

Choose a reason for hiding this comment

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

@douglasbouttell-camunda Just some small comments that were left, but it seems like there are some issues with the E2E tests that need to be attended too

tasklist/client/e2e/pages/TaskDetailsPage.ts Outdated Show resolved Hide resolved
<Tag className={styles.version}>Version: {version}</Tag>
</div>
{bpmnXml !== null ? (
<Layer level={1} className={styles.diagramFrame}>
Copy link
Contributor

Choose a reason for hiding this comment

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

@douglasbouttell-camunda This was left unanswered

tasklist/client/src/Tasks/Task/Details/TabListNav.tsx Outdated Show resolved Hide resolved
@douglasbouttell-camunda douglasbouttell-camunda requested review from vsgoulart and removed request for vsgoulart May 17, 2024 08:43
@volodymyr-melnykc
Copy link
Contributor

volodymyr-melnykc commented May 17, 2024

As we discussed in Slack, when a task doesn't have the form but only task variables, then the content with task variables should occupy the full width.

Screenshot 2024-05-17 at 11 05 29

@douglasbouttell-camunda @vsgoulart

@vsgoulart
Copy link
Contributor

@esraagamal6 Can you please test this PR?

@vsgoulart vsgoulart force-pushed the tasklist/17645-process-view branch 3 times, most recently from 9b70b12 to c22e3f7 Compare May 23, 2024 11:48
@vsgoulart vsgoulart force-pushed the tasklist/17645-process-view branch from c22e3f7 to cf343d8 Compare May 27, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/tasklist Related to the Tasklist component/team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Users can view the process model for a task
3 participants