Skip to content

Commit a9eacce

Browse files
Dr Rai delete action overlay animation (#5691)
**Story card:** [sc-16727](https://app.shortcut.com/simpledotorg/story/16727/dr-rai-loading-animations) ## Because Animation for deleting an action plan. Dashboard currently loads slowly ## This addresses Showing an animation informs users that the site is loading, rather than not working. Improving the user experience and reducing confusion. https://github.com/user-attachments/assets/96b6a5e9-71e3-4f15-973d-d75c551eb3fd _Data shown in this example is randomly generated and not production data; names may be associated with real places._ ## Test instructions - Branch `dr-rai-action-delete-animation` - Add at least 2 actions to a single action plan. - Delete one of the action plans - Ensure the overlay is shown on the action being deleted --------- Co-authored-by: Igbanam <[email protected]>
1 parent 03e1888 commit a9eacce

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

app/assets/stylesheets/dr_rai.scss

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,3 +569,29 @@ $font-condensed: "Roboto Condensed", sans-serif;
569569
-moz-transition: all 0.4s ease-out;
570570
-ms-transition: all 0.4s ease-out;
571571
}
572+
573+
.fa-spin {
574+
-webkit-animation: fa-spin 0.1s infinite linear !important;
575+
animation: fa-spin 1s infinite linear !important;
576+
}
577+
578+
.deleting-overlay {
579+
position: absolute;
580+
top: 0;
581+
left: 0;
582+
right: 0;
583+
bottom: 0;
584+
gap: 8px;
585+
color: white;
586+
background: rgba(77, 78, 54, 0.65);
587+
border-radius: 4px;
588+
display: flex;
589+
justify-content: center;
590+
align-items: center;
591+
opacity: 1;
592+
transition: opacity 0.3s ease-in-out;
593+
transition-behavior: allow-discrete;
594+
@starting-style {
595+
opacity: 0;
596+
}
597+
}

app/components/dashboard/dr_rai_report.html.erb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
</div>
4646
</div>
4747
</div>
48+
<div class="deleting-overlay d-none">
49+
<i class=" fa-solid fa-spinner-third fa-spin fa-fast-spin"></i>
50+
<p >Removing action, this page will refresh shortly...</p>
51+
</div>
4852
</div>
4953
<% end %>
5054
<% else %>
@@ -410,7 +414,14 @@
410414

411415
// Close the offcanvas
412416
$('.bs-canvas-close').trigger('click')
417+
413418
})
419+
420+
// show action delete overlay, takes several seconds to process
421+
$('.dropdown-item.delete').on("click", function(e) {
422+
$(this).closest('.action-card').find('.deleting-overlay').removeClass('d-none'); // show overlay only for this card
423+
});
414424
});
415425
</script>
426+
416427
<% end %>

0 commit comments

Comments
 (0)