Skip to content

Commit da2de21

Browse files
sc-14920 quick fix (#5541)
**Story card:** [sc-14920](https://app.shortcut.com/simpledotorg/story/14920/quick-links-at-district-level-reports) Because At district level, quick links will open the corresponding metabase report for that district This Addresses Will open the quick links for the respective district Test Instructions Enable the flipper "quick_link_for_metabase"
1 parent 1ed85da commit da2de21

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

app/views/reports/regions/show.html.erb

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
<% end %>
44
<% if @is_desktop && Flipper.enabled?(:quick_link_for_metabase, current_admin) %>
55
<% last_month = Date.today.last_month.strftime("%b-%Y") %>
6-
<div class="float-right desktop">
7-
<h4 class="mb-0px">Quick links</h4>
86

9-
<% if @region.facility_region? %>
7+
<% if @region.facility_region? %>
8+
<div class="float-right desktop">
9+
<h4 class="mb-0px">Quick links</h4>
1010
<% district = @region.source.facility_group.slug %>
1111
<% size = @region.source.facility_size.presence || '' %>
1212
<% zone = @region.source.zone %>
1313

14-
<div><a href="<%= ENV.fetch('DRUG_STOCK_REPORT_URL', '') %><%= district %>&zone=<%= zone %>&for_end_of_month=<%= last_month %>&size=<%= size %> " target="_blank">
14+
<div><a href="<%= ENV.fetch('DRUG_STOCK_REPORT_URL', '') %><%= district %>&zone=<%= zone %>&for_end_of_month=<%= last_month %>&size=<%= size %>" target="_blank">
1515
Drug stock report
1616
</a></div>
1717
<div><a href="<%= ENV.fetch('METABASE_TITRATION_URL', '') %><%= @region.name %>" target="_blank">
@@ -20,7 +20,11 @@
2020
<div><a href="<%= ENV.fetch('METABASE_BP_FUDGING_URL', '') %><%= @region.name %>" target="_blank">
2121
Metabase: BP fudging report
2222
</a></div>
23-
<% elsif @region.district_region? %>
23+
</div>
24+
25+
<% elsif @region.district_region? %>
26+
<div class="float-right desktop">
27+
<h4 class="mb-0px">Quick links</h4>
2428
<div><a href="<%= ENV.fetch('DISTRICT_FACILITY_TREND_REPORT_URL', '') %><%= @region.slug %>&for_end_of_month=" target="_blank">
2529
District facility trend report
2630
</a></div>
@@ -30,11 +34,12 @@
3034
<div><a href="<%= ENV.fetch('DISTRICT_METABASE_TITRATION_URL', '') %><%= @region.name %>" target="_blank">
3135
Metabase: Titration report
3236
</a></div>
33-
<% end %>
34-
</div>
37+
</div>
38+
<% end %>
3539
<% end %>
3640

3741

42+
3843
<%= render "header" %>
3944

4045
<% control_graph_denominator_copy = @with_ltfu ? "denominator_with_ltfu_copy" : "denominator_copy" %>

0 commit comments

Comments
 (0)