Skip to content

Commit 3ed9859

Browse files
authored
fix(Dr. Rai Report): Remove Quartierles from Progress Tab (#5662)
**Story card:** [sc-16476](https://app.shortcut.com/simpledotorg/story/16476/high-not-showing-in-the-progress-tab-for-the-facility-when-action-plans-are-created-on-bd-production) ## Because The progress tab does not load in BD-PROD. In a bid not to debug in prod, the assumption behind this change is that there is much data to crunch in BD. So things like `quarterlies` which aren't really needed but are still computed may be adding to load time. ## This addresses Removing quarterlies from the lite version of Dr. Rai Reports ## Test instructions n.a
1 parent f1c26be commit 3ed9859

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

app/components/dashboard/dr_rai_report.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def initialize(quarterlies, region_slug, selected_quarter = nil, lite = false)
2222
end
2323

2424
def custom_indicators
25+
return nil if @lite
2526
return [] unless region.source_type == "Facility"
2627
DrRai::Indicator.all.filter do |indicator|
2728
indicator.is_supported?(region)

app/controllers/reports/progress_controller.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def show
1919
start_period = @period.advance(months: months)
2020
range = Range.new(start_period, @period)
2121
@repository = Reports::Repository.new([@region], periods: range)
22-
@quarterlies = quarterly_region_summary(@repository, @region.slug)
2322
@drug_stocks = DrugStock.latest_for_facilities_grouped_by_protocol_drug(current_facility, @for_end_of_month)
2423
unless @drug_stocks.empty?
2524
@drug_stocks_query = DrugStocksQuery.new(facilities: [current_facility],
@@ -67,11 +66,4 @@ def set_period
6766
period_params = report_params[:period].presence || Reports.default_period.attributes
6867
@period = Period.new(period_params)
6968
end
70-
71-
def quarterly_region_summary(repository, region)
72-
data = repository.schema.send(:region_summaries)
73-
quarterlies = Reports::RegionSummary.group_by(grouping: :quarter, data: data)
74-
cut_off = Period.new(type: :quarter, value: 1.year.ago.to_period.to_quarter_period.value.to_s)
75-
quarterlies[region].select { |k, _| k > cut_off }
76-
end
7769
end

app/views/api/v3/analytics/user_analytics/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<body>
2121
<div id="home-page">
2222
<% if Flipper.enabled?(:dr_rai_reports) && Flipper.enabled?(:dr_rai_progress) && @region.facility_region? %>
23-
<% dr_rai_component = Dashboard::DrRaiReport.new(@quarterlies, @region.slug, params[:selected_quarter], true) %>
23+
<% dr_rai_component = Dashboard::DrRaiReport.new(nil, @region.slug, params[:selected_quarter], true) %>
2424
<% unless dr_rai_component.action_plans.empty? %>
2525
<div class="mb-8px p-16px bgc-white bs-card">
2626
<h1 class="m-0px mb-16px fw-bold fs-24px c-black">

0 commit comments

Comments
 (0)