This commit is contained in:
Simon Lehericey 2017-03-06 18:14:54 +01:00
parent 4de6a9595a
commit a334888363
10 changed files with 25 additions and 24 deletions

View file

@ -13,8 +13,11 @@ class AdminProceduresShowFacades
def dossiers_for_pie_highchart def dossiers_for_pie_highchart
dossiers.where.not(state: :draft, archived: true).group(:state).count dossiers.where.not(state: :draft, archived: true).group(:state).count
.map{|key, value| { (DossierDecorator.case_state_fr key) => value } } .reduce({}) do |acc, (key, val)|
.reduce({}, :merge) translated_key = DossierDecorator.case_state_fr(key)
acc[translated_key].nil? ? acc[translated_key] = val : acc[translated_key] += val
acc
end
end end
def dossiers_archived_by_state_total def dossiers_archived_by_state_total

View file

@ -15,15 +15,13 @@
= smart_listing_render :new_dossiers = smart_listing_render :new_dossiers
.row.center .row.center
.col-xs-2.col-xs-offset-1 .col-xs-3
=link_to 'Tous les états', '?liste=all_state', class: 'text-info', style:"text-decoration: #{@facade_data_view.liste == 'all_state'? 'underline' : ''}" =link_to 'Tous les états', '?liste=all_state', class: 'text-info', style:"text-decoration: #{@facade_data_view.liste == 'all_state'? 'underline' : ''}"
.col-xs-2 .col-xs-3
=link_to 'En construction', '?liste=a_traiter', class: 'text-danger', style:"text-decoration: #{@facade_data_view.liste == 'a_traiter'? 'underline' : ''}" =link_to 'En construction', '?liste=a_traiter', class: 'text-danger', style:"text-decoration: #{@facade_data_view.liste == 'a_traiter'? 'underline' : ''}"
.col-xs-2 .col-xs-3
=link_to 'À receptionner', '?liste=deposes', class: 'text-purple', style:"text-decoration: #{@facade_data_view.liste == 'deposes'? 'underline' : ''}" =link_to 'En instruction', '?liste=a_instruire', class: 'text-warning', style:"text-decoration: #{@facade_data_view.liste == 'a_instruire'? 'underline' : ''}"
.col-xs-2 .col-xs-3
=link_to 'À instruire', '?liste=a_instruire', class: 'text-warning', style:"text-decoration: #{@facade_data_view.liste == 'a_instruire'? 'underline' : ''}"
.col-xs-2
=link_to 'Terminés', '?liste=termine', class: 'text-success', style:"text-decoration: #{@facade_data_view.liste == 'termine'? 'underline' : ''}" =link_to 'Terminés', '?liste=termine', class: 'text-success', style:"text-decoration: #{@facade_data_view.liste == 'termine'? 'underline' : ''}"
.default_data_block.default_visible .default_data_block.default_visible

View file

@ -5,7 +5,7 @@
#action-block #action-block
- if gestionnaire_signed_in? - if gestionnaire_signed_in?
- if !@facade.dossier.read_only? || @facade.dossier.initiated? - if !@facade.dossier.read_only? || @facade.dossier.initiated?
= link_to 'Accuser réception', backoffice_dossier_receive_path(@facade.dossier), method: :post, class: 'btn btn-danger btn-block' = link_to 'Passer en instruction', backoffice_dossier_receive_path(@facade.dossier), method: :post, class: 'btn btn-danger btn-block'
- elsif @facade.dossier.received? - elsif @facade.dossier.received?
= form_tag(url_for({controller: 'backoffice/dossiers', action: :close, dossier_id: @facade.dossier.id}), class: 'form-inline action_button', method: 'POST', style: 'display:inline', 'data-toggle' => :tooltip, title: 'Accepter') do = form_tag(url_for({controller: 'backoffice/dossiers', action: :close, dossier_id: @facade.dossier.id}), class: 'form-inline action_button', method: 'POST', style: 'display:inline', 'data-toggle' => :tooltip, title: 'Accepter') do

View file

@ -25,13 +25,13 @@
%a{:href => "#{url_for users_dossiers_path(liste: 'en_instruction')}", 'data-toggle' => :tooltip, title: 'Les dossiers en cours d\'examen par l\'administration compétante.'} %a{:href => "#{url_for users_dossiers_path(liste: 'en_instruction')}", 'data-toggle' => :tooltip, title: 'Les dossiers en cours d\'examen par l\'administration compétante.'}
%div.procedure_list_element{ class: @dossiers_list_facade.en_instruction_class, id: 'en_instruction' } %div.procedure_list_element{ class: @dossiers_list_facade.en_instruction_class, id: 'en_instruction' }
="En examen" ="En instruction"
.badge.progress-bar-default .badge.progress-bar-default
= @dossiers_list_facade.en_instruction_total = @dossiers_list_facade.en_instruction_total
%a{:href => "#{url_for users_dossiers_path(liste: 'termine')}", 'data-toggle' => :tooltip, title: 'Les dossiers cloturés qui peuvent être "Accepté", "Refusé" ou "Sans suite".'} %a{:href => "#{url_for users_dossiers_path(liste: 'termine')}", 'data-toggle' => :tooltip, title: 'Les dossiers cloturés qui peuvent être "Accepté", "Refusé" ou "Sans suite".'}
%div.procedure_list_element{ class: @dossiers_list_facade.termine_class, id: 'termine' } %div.procedure_list_element{ class: @dossiers_list_facade.termine_class, id: 'termine' }
= "Cloturé" = "Terminé"
.badge.progress-bar-success .badge.progress-bar-success
= @dossiers_list_facade.termine_total = @dossiers_list_facade.termine_total

View file

@ -9,7 +9,7 @@ fr:
date_previsionnelle: "La date de début prévisionnelle" date_previsionnelle: "La date de début prévisionnelle"
state: state:
draft: "Brouillon" draft: "Brouillon"
initiated: "Nouveau" initiated: "En construction"
replied: "En construction" replied: "En construction"
updated: "En construction" updated: "En construction"
received: "En instruction" received: "En instruction"

View file

@ -24,7 +24,7 @@ describe DossierDecorator do
it 'initiated is initiate' do it 'initiated is initiate' do
dossier.initiated! dossier.initiated!
expect(subject).to eq('Nouveau') expect(subject).to eq('En construction')
end end
it 'replied is repondu' do it 'replied is repondu' do

View file

@ -26,7 +26,7 @@ describe AdminProceduresShowFacades do
describe '.dossiers_for_pie_highchart' do describe '.dossiers_for_pie_highchart' do
subject { super().dossiers_for_pie_highchart } subject { super().dossiers_for_pie_highchart }
it { expect(subject).to eq({'Nouveau' => 1, "En construction"=>1}) } it { expect(subject).to eq({ 'En construction' => 3 }) }
end end
describe '.dossiers_archived_by_state_total' do describe '.dossiers_archived_by_state_total' do

View file

@ -34,7 +34,7 @@ feature 'on click on tabs button' do
context 'when he click on tabs en examen' do context 'when he click on tabs en examen' do
before do before do
visit users_dossiers_url(liste: :en_instruction) visit users_dossiers_url(liste: :en_instruction)
page.click_on 'En examen 1' page.click_on 'En instruction 1'
end end
scenario 'it redirect to users dossier termine' do scenario 'it redirect to users dossier termine' do
@ -45,7 +45,7 @@ feature 'on click on tabs button' do
context 'when he click on tabs termine' do context 'when he click on tabs termine' do
before do before do
visit users_dossiers_url(liste: :termine) visit users_dossiers_url(liste: :termine)
page.click_on 'Cloturé 3' page.click_on 'Terminé 3'
end end
scenario 'it redirect to users dossier termine' do scenario 'it redirect to users dossier termine' do

View file

@ -25,8 +25,8 @@ describe 'layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.htm
context 'button dossier state changements' do context 'button dossier state changements' do
shared_examples 'button Accuser réception is present' do shared_examples 'button Passer en instruction is present' do
it { expect(rendered).to have_link('Accuser réception') } it { expect(rendered).to have_link('Passer en instruction') }
end end
context 'when dossier have state initiated' do context 'when dossier have state initiated' do
@ -36,9 +36,9 @@ describe 'layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.htm
render render
end end
it { expect(rendered).to have_content('Nouveau') } it { expect(rendered).to have_content('En construction') }
include_examples 'button Accuser réception is present' include_examples 'button Passer en instruction is present'
end end
context 'when dossier have state replied' do context 'when dossier have state replied' do
@ -50,7 +50,7 @@ describe 'layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.htm
it { expect(rendered).to have_content('En construction') } it { expect(rendered).to have_content('En construction') }
include_examples 'button Accuser réception is present' include_examples 'button Passer en instruction is present'
end end
context 'when dossier have state update' do context 'when dossier have state update' do
@ -62,7 +62,7 @@ describe 'layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.htm
it { expect(rendered).to have_content('En construction') } it { expect(rendered).to have_content('En construction') }
include_examples 'button Accuser réception is present' include_examples 'button Passer en instruction is present'
end end
context 'when dossier have state received' do context 'when dossier have state received' do

View file

@ -17,7 +17,7 @@ describe 'layouts/left_panels/_left_panel_users_recapitulatifcontroller_show.htm
render render
end end
it { expect(rendered).to have_content('Nouveau') } it { expect(rendered).to have_content('En construction') }
end end
context 'when dossier state is replied' do context 'when dossier state is replied' do