Skip to content

Commit 439ed1c

Browse files
Adding animation to show loading of different period (#5698)
**Story card:** [sc-16727](https://app.shortcut.com/simpledotorg/story/16727/dr-rai-loading-animations) ## Because Dashboards load slowly, and show the user something is happening when they navigate between different quarters on the action plans. https://github.com/user-attachments/assets/240e2e4f-1b56-4c75-9e8c-52612a6b2968 _*All data shown is demo/dummy data, including facility names._ ## This addresses Showing a 'loading' message to inform users that the website is responsive and something is happening. Reduce the risk of confusion that the website is broken. ## Test instructions - Branch `dr-rai-loading-animation-periods` - Click the navigation options to move between quarters for the action plans. - Test it works for all of the 5 quarter buttons displayed Co-authored-by: Igbanam <[email protected]>
1 parent f034253 commit 439ed1c

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

app/assets/stylesheets/dr_rai.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ $font-condensed: "Roboto Condensed", sans-serif;
5757
text-underline-offset: 6px;
5858
}
5959
}
60+
61+
& .loading {
62+
color: #6c737a;
63+
font-size: 16px;
64+
font-weight: 500;
65+
margin: 0 0 2px;
66+
}
6067
}
6168

6269
.add-action-button {

app/components/dashboard/dr_rai_report.html.erb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
<div class="actions-periods-navigation">
77
<% periods.each do |period| %>
88
<%= link_to human_readable(period), "#{request.path}?#{request.query_parameters.merge(selected_quarter: period.value.to_s).to_param}", class: classes_for_period(period) %>
9-
<% end %>
9+
<% end %>
10+
<p id="period-nav-loading" class="loading d-none"><i class="fa-solid fa-spinner-third fa-spin fa-fast-spin mr-8px"></i>Loading</p>
1011
</div>
1112
<% end %>
1213
<div class="actions-block<%= ' empty' unless action_plans.present? %>">
@@ -421,6 +422,11 @@
421422
$('.dropdown-item.delete').on("click", function(e) {
422423
$(this).closest('.action-card').find('.deleting-overlay').removeClass('d-none'); // show overlay only for this card
423424
});
425+
426+
// show loading on action plan period navigation
427+
$('.period-button').on("click", function(e) {
428+
$('#period-nav-loading').removeClass('d-none');
429+
});
424430
});
425431
</script>
426432

0 commit comments

Comments
 (0)