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: pulsate play buttons on new process instances #219

Merged
merged 1 commit into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
21 changes: 21 additions & 0 deletions src/main/resources/public/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -455,3 +455,24 @@ code {
#tab-resize-handle:hover {
background-color: #666;
}

.pulsate-tasks .btn-group:has(.overlay-button) {
animation: 3s linear 1s infinite pulsate;
}

@keyframes pulsate {
25% {
transform: scale(1);
filter: drop-shadow(0 0 0 #000000aa);
}

50% {
transform: scale(1.2);
filter: drop-shadow(3px 3px 1px #000000aa);
}

75% {
transform: scale(1);
filter: drop-shadow(0 0 0 #000000aa);
}
}
30 changes: 30 additions & 0 deletions src/main/resources/public/js/view-process-instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ function loadProcessInstanceView() {
// wait until BPMN is loaded
loadProcessInstanceDetailsViews();
loadElementInfoOfProcessInstance();

pulsateTasks();
});

bpmnViewIsLoaded = true;
Expand All @@ -110,6 +112,34 @@ function loadProcessInstanceView() {
}
}

function pulsateTasks() {
if (
!history.filter(({ action }) =>
[
"completeJob",
"timeTravel",
"publishMessage",
"failJob",
"throwJob",
].includes(action)
).length
) {
// if we don't have any completed jobs in the instance history
// we add a class to the canvas that makes the overlay buttons pulsate
const canvas = document.querySelector("#canvas");
if (!canvas) return;

canvas.classList.add("pulsate-tasks");

canvas.addEventListener("click", (evt) => {
// stop pulsating when the user clicks a button group with the overlay button
if (evt.target.closest(".btn-group")?.querySelector(".overlay-button")) {
canvas.classList.remove("pulsate-tasks");
}
});
}
}

function loadProcessInstanceDetailsViews() {
loadVariablesOfProcessInstance();
loadParentInstanceOfProcessInstance();
Expand Down