Remove “Nombre d'administrations ayant dématérialisé N démarches” graph
This commit is contained in:
parent
93ceb79dd1
commit
0e4b6e1ba2
3 changed files with 0 additions and 56 deletions
|
@ -23,8 +23,6 @@ class StatsController < ApplicationController
|
|||
@dossiers_cumulative = cumulative_hash(dossiers, :en_construction_at)
|
||||
@dossiers_in_the_last_4_months = last_four_months_hash(dossiers, :en_construction_at)
|
||||
|
||||
@procedures_count_per_administrateur = procedures_count_per_administrateur(procedures)
|
||||
|
||||
if administration_signed_in?
|
||||
@dossier_instruction_mean_time = Rails.cache.fetch("dossier_instruction_mean_time", expires_in: 1.day) do
|
||||
dossier_instruction_mean_time(dossiers)
|
||||
|
@ -234,15 +232,6 @@ class StatsController < ApplicationController
|
|||
.reduce({}, :merge)
|
||||
end
|
||||
|
||||
def procedures_count_per_administrateur(procedures)
|
||||
count_per_administrateur = procedures.joins(:administrateurs).group('administrateurs.id').count.values
|
||||
{
|
||||
'Une démarche' => count_per_administrateur.select { |count| count == 1 }.count,
|
||||
'Entre deux et cinq démarches' => count_per_administrateur.select { |count| count.in?(2..5) }.count,
|
||||
'Plus de cinq démarches' => count_per_administrateur.select { |count| count > 5 }.count
|
||||
}
|
||||
end
|
||||
|
||||
def mean(collection)
|
||||
(collection.sum.to_f / collection.size).round(2)
|
||||
end
|
||||
|
|
|
@ -84,15 +84,6 @@
|
|||
.chart.cumulative-dossiers-chart.hidden
|
||||
= area_chart @dossiers_cumulative
|
||||
|
||||
.stat-card.stat-card-half.pull-left
|
||||
%span.stat-card-title
|
||||
Nombre d'administrations ayant dématérialisé N démarches
|
||||
|
||||
.chart-container
|
||||
.chart
|
||||
= pie_chart @procedures_count_per_administrateur,
|
||||
colors: ["rgba(191, 220, 249, 1)", "rgba(113, 176, 239, 1)", "rgba(61, 149, 236, 1)"]
|
||||
|
||||
- if administration_signed_in?
|
||||
.stat-card.stat-card-half.pull-left
|
||||
%span.stat-card-title Temps de traitement moyen d'un dossier
|
||||
|
|
|
@ -93,42 +93,6 @@ describe StatsController, type: :controller do
|
|||
end
|
||||
end
|
||||
|
||||
describe "#procedures_count_per_administrateur" do
|
||||
let!(:administrateur_1) { create(:administrateur) }
|
||||
let!(:administrateur_2) { create(:administrateur) }
|
||||
let!(:administrateur_3) { create(:administrateur) }
|
||||
let!(:administrateur_4) { create(:administrateur) }
|
||||
let!(:administrateur_5) { create(:administrateur) }
|
||||
|
||||
before do
|
||||
3.times do
|
||||
create(:procedure, published_at: Time.zone.now, administrateur: administrateur_1)
|
||||
end
|
||||
|
||||
2.times do
|
||||
create(:procedure, published_at: Time.zone.now, administrateur: administrateur_2)
|
||||
end
|
||||
|
||||
8.times do
|
||||
create(:procedure, published_at: Time.zone.now, administrateur: administrateur_3)
|
||||
end
|
||||
|
||||
create(:procedure, published_at: Time.zone.now, administrateur: administrateur_4)
|
||||
end
|
||||
|
||||
let(:association) { Procedure.all }
|
||||
|
||||
subject { StatsController.new.send(:procedures_count_per_administrateur, association) }
|
||||
|
||||
it do
|
||||
is_expected.to eq({
|
||||
'Une démarche' => 1,
|
||||
'Entre deux et cinq démarches' => 2,
|
||||
'Plus de cinq démarches' => 1
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
describe "#dossier_instruction_mean_time" do
|
||||
# Month-2: mean 3 days
|
||||
# procedure_1: mean 2 days
|
||||
|
|
Loading…
Reference in a new issue