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: compliance rules highlight activities on popover click #85

Merged
merged 12 commits into from
Sep 21, 2023

Conversation

assynour
Copy link
Contributor

@assynour assynour commented Mar 6, 2023

closes #62

icpm-popover

@assynour assynour added the enhancement New feature or request label Mar 6, 2023
@github-actions
Copy link

github-actions bot commented Mar 6, 2023

♻️ PR Preview b557648 has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

src/compliance-rules.js Outdated Show resolved Hide resolved
@assynour assynour requested a review from tbouffard March 9, 2023 12:52
Comment on lines 227 to 255
tippyInstance.popper.addEventListener("mouseover", (event) => {
if (event.target.nodeName === "TD") {
const selectedRow = event.target.parentElement;
selectedRow.style.backgroundColor = "lightgray";
const activityName = selectedRow.firstElementChild.textContent;
const activityId = getElementIdByName(activityName)
//highlight activity
bpmnVisualization.bpmnElementsRegistry.addCssClasses(activityId, "cause-violation")
// workaround for https://github.com/process-analytics/icpm-demo-2022/issues/87
if(complianceData.has(activityName)){
addRippleCircles(activityId, bpmnVisualization)
}
}
});

tippyInstance.popper.addEventListener("mouseout", (event) => {
if (event.target.nodeName === "TD") {
const selectedRow = event.target.parentElement;
selectedRow.style.backgroundColor = "";
const activityName = selectedRow.firstElementChild.textContent;
const activityId = getElementIdByName(activityName)
//highlight activity
bpmnVisualization.bpmnElementsRegistry.removeCssClasses(activityId, "cause-violation")
// workaround for https://github.com/process-analytics/icpm-demo-2022/issues/87
if(complianceData.has(activityName)){
addRippleCircles(activityId, bpmnVisualization)
}
}
});
Copy link
Member

@tbouffard tbouffard Mar 14, 2023

Choose a reason for hiding this comment

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

issue: the highlight of the rows of the popover should be done with CSS directly, as this is done in https://github.com/process-analytics/bonita-day-demo-2023/pull/10/files.

Copy link
Member

Choose a reason for hiding this comment

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

@assynour did you have time to check the review?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will fix it this week

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in 57b6053

Copy link
Member

@tbouffard tbouffard left a comment

Choose a reason for hiding this comment

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

Design and refactoring to plan

Comment on lines 227 to 229
tippyInstance.popper.addEventListener("mouseover", (event) => {
if (event.target.nodeName === "TD") {
const selectedRow = event.target.parentElement;
Copy link
Member

@tbouffard tbouffard Mar 15, 2023

Choose a reason for hiding this comment

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

suggestion: process-analytics/bonita-day-demo-2023#18 registers the event listener directly in the elements of the HTML of the popover. This is easy to register them directly on the rows (TR elements).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will take this into account

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in 6e0c300

Copy link
Member

@tbouffard tbouffard left a comment

Choose a reason for hiding this comment

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

LGTM, I didn't check the code in details, but it does the job and reuse what has been done in the bonita-day demo
✔️ Tested with the surge preview environment

icpm-demo_compliance_rules_hightlight_activities.mp4

src/compliance-rules.js Outdated Show resolved Hide resolved
@tbouffard tbouffard merged commit f968d47 into main Sep 21, 2023
2 checks passed
@tbouffard tbouffard deleted the compliance_rules_highlight_activities branch September 21, 2023 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] Compliances Rules: highlight the activities involved in the violations
2 participants