commit
ef10a378a4
18 changed files with 22 additions and 20 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -16,7 +16,6 @@ public/uploads
|
|||
public/downloads
|
||||
doc/*.svg
|
||||
uploads/*
|
||||
.DS_Store
|
||||
.byebug_history
|
||||
.env
|
||||
Procfile.dev
|
||||
|
|
|
@ -144,4 +144,3 @@ $big-number-card-padding: 2 * $segmented-control-item-border-radius;
|
|||
text-align: center;
|
||||
color: $blue;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,14 +42,14 @@ class RootController < ApplicationController
|
|||
end
|
||||
|
||||
type_champ_values = {
|
||||
TypeDeChamp.type_champs.fetch(:date) => '2016-07-26',
|
||||
TypeDeChamp.type_champs.fetch(:datetime) => '26/07/2016 07:35',
|
||||
TypeDeChamp.type_champs.fetch(:textarea) => 'Une description de mon projet'
|
||||
TypeDeChamp.type_champs.fetch(:date) => '2016-07-26',
|
||||
TypeDeChamp.type_champs.fetch(:datetime) => '26/07/2016 07:35',
|
||||
TypeDeChamp.type_champs.fetch(:textarea) => 'Une description de mon projet'
|
||||
}
|
||||
|
||||
type_champ_values.each do |(type_champ, value)|
|
||||
all_champs
|
||||
.select { |champ| champ.type_champ == type_champ.to_s }
|
||||
.select { |champ| champ.type_champ == type_champ }
|
||||
.each { |champ| champ.value = value }
|
||||
end
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ class StatsController < ApplicationController
|
|||
|
||||
def index
|
||||
procedures = Procedure.publiees_ou_archivees
|
||||
dossiers = Dossier.where.not(:state => Dossier.states.fetch(:brouillon))
|
||||
dossiers = Dossier.state_not_brouillon
|
||||
|
||||
@procedures_numbers = procedures_numbers(procedures)
|
||||
@dossiers_numbers = dossiers_numbers(dossiers)
|
||||
|
@ -198,7 +198,7 @@ class StatsController < ApplicationController
|
|||
count_per_administrateur = procedures.group(:administrateur_id).count.values
|
||||
{
|
||||
'Une procédure' => count_per_administrateur.select { |count| count == 1 }.count,
|
||||
'Entre deux et cinq procédures' => count_per_administrateur.select { |count| 2 <= count && count <= 5 }.count,
|
||||
'Entre deux et cinq procédures' => count_per_administrateur.select { |count| count.in?(2..5) }.count,
|
||||
'Plus de cinq procédures' => count_per_administrateur.select { |count| 5 < count }.count
|
||||
}
|
||||
end
|
||||
|
|
|
@ -59,7 +59,7 @@ class Users::CarteController < UsersController
|
|||
|
||||
def self.route_authorization
|
||||
{
|
||||
states: [:brouillon, :en_construction],
|
||||
states: [Dossier.states.fetch(:brouillon), Dossier.states.fetch(:en_construction)],
|
||||
api_carto: true
|
||||
}
|
||||
end
|
||||
|
|
|
@ -149,7 +149,7 @@ class Users::DossiersController < UsersController
|
|||
|
||||
def self.route_authorization
|
||||
{
|
||||
states: [:brouillon]
|
||||
states: [Dossier.states.fetch(:brouillon)]
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -18,7 +18,13 @@ class Users::RecapitulatifController < UsersController
|
|||
|
||||
def self.route_authorization
|
||||
{
|
||||
states: [:en_construction, :en_instruction, :sans_suite, :accepte, :refuse]
|
||||
states: [
|
||||
Dossier.states.fetch(:en_construction),
|
||||
Dossier.states.fetch(:en_instruction),
|
||||
Dossier.states.fetch(:sans_suite),
|
||||
Dossier.states.fetch(:accepte),
|
||||
Dossier.states.fetch(:refuse)
|
||||
]
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module TypeDeChampHelper
|
||||
TOGGLES = {
|
||||
TypeDeChamp.type_champs.fetch(:piece_justificative) => :champ_pj?,
|
||||
TypeDeChamp.type_champs.fetch(:siret) => :champ_siret?,
|
||||
TypeDeChamp.type_champs.fetch(:piece_justificative) => :champ_pj?,
|
||||
TypeDeChamp.type_champs.fetch(:siret) => :champ_siret?,
|
||||
TypeDeChamp.type_champs.fetch(:linked_drop_down_list) => :champ_linked_dropdown?
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ class UserRoutesAuthorizationService
|
|||
def self.authorized_route?(controller, dossier)
|
||||
auth = controller.route_authorization
|
||||
|
||||
auth[:states].include?(dossier.state.to_sym) &&
|
||||
auth[:states].include?(dossier.state) &&
|
||||
(auth[:api_carto].nil? ? true : auth[:api_carto] == dossier.procedure.use_api_carto)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,4 +3,3 @@
|
|||
= render partial: 'header', locals: { avis: @avis, dossier: @dossier }
|
||||
|
||||
= render partial: 'shared/dossiers/show', locals: { dossier: @dossier, demande_seen_at: nil }
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@
|
|||
partenaires
|
||||
%li.number
|
||||
.number-value
|
||||
= number_with_delimiter(Dossier.where.not(:state => Dossier.states.fetch(:brouillon)).count, :locale => :fr)
|
||||
= number_with_delimiter(Dossier.state_not_brouillon.count, :locale => :fr)
|
||||
.number-label<
|
||||
dossiers
|
||||
%br<>
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
partenaires
|
||||
%li.number
|
||||
.number-value
|
||||
= number_with_delimiter(Dossier.where.not(:state => Dossier.states.fetch(:brouillon)).count, :locale => :fr)
|
||||
= number_with_delimiter(Dossier.state_not_brouillon.count, :locale => :fr)
|
||||
.number-label<
|
||||
dossiers
|
||||
%br<>
|
||||
|
|
|
@ -3,4 +3,3 @@
|
|||
- champ_attributes = etablissement.champ.private? ? 'champs_private_attributes' : 'champs_attributes'
|
||||
= fields_for "dossier[#{champ_attributes}][#{position}][etablissement_attributes]", etablissement do |form|
|
||||
= form.hidden_field :_destroy
|
||||
|
||||
|
|
|
@ -170,7 +170,7 @@ describe StatsController, type: :controller do
|
|||
}
|
||||
end
|
||||
|
||||
let (:association) { Dossier.where.not(:state => Dossier.states.fetch(:brouillon)) }
|
||||
let (:association) { Dossier.state_not_brouillon }
|
||||
|
||||
subject { StatsController.new.send(:dossier_instruction_mean_time, association) }
|
||||
|
||||
|
@ -222,7 +222,7 @@ describe StatsController, type: :controller do
|
|||
}
|
||||
end
|
||||
|
||||
let (:association) { Dossier.where.not(:state => Dossier.states.fetch(:brouillon)) }
|
||||
let (:association) { Dossier.state_not_brouillon }
|
||||
|
||||
subject { StatsController.new.send(:dossier_filling_mean_time, association) }
|
||||
|
||||
|
|
Loading…
Reference in a new issue