Merge branch 'develop' into staging

This commit is contained in:
Xavier J 2016-10-25 12:03:35 +02:00
commit 2eac2d74b4
11 changed files with 90 additions and 54 deletions

View file

@ -4,6 +4,7 @@ class DossiersListFacades
def initialize current_devise_profil, liste, procedure = nil
@current_devise_profil = current_devise_profil
@liste = liste
@liste = 'all_state' if Features.opensimplif
@procedure = procedure
end
@ -190,4 +191,5 @@ class DossiersListFacades
def base_url liste
@procedure.nil? ? backoffice_dossiers_path(liste: liste) : backoffice_dossiers_procedure_path(id: @procedure.id, liste: liste)
end
end

View file

@ -53,6 +53,7 @@ class Dossier < ActiveRecord::Base
EN_INSTRUCTION = %w(submitted received)
A_INSTRUIRE = %w(received)
TERMINE = %w(closed refused without_continuation)
ALL_STATE = %w(draft initiated updated replied validated submitted received closed refused without_continuation)
def retrieve_last_piece_justificative_by_type(type)
pieces_justificatives.where(type_de_piece_justificative_id: type).last
@ -169,6 +170,10 @@ class Dossier < ActiveRecord::Base
state
end
def all_state?
ALL_STATE.include?(state)
end
def brouillon?
BROUILLON.include?(state)
end
@ -209,6 +214,10 @@ class Dossier < ActiveRecord::Base
TERMINE.include?(state)
end
def self.all_state order = 'ASC'
where(state: ALL_STATE, archived: false).order("updated_at #{order}")
end
def self.brouillon order = 'ASC'
where(state: BROUILLON, archived: false).order("updated_at #{order}")
end

View file

@ -11,11 +11,16 @@ class DossiersListGestionnaireService
'en_attente' => waiting_for_user,
'deposes' => deposes,
'a_instruire' => a_instruire,
'termine' => termine}[@liste]
'termine' => termine,
'all_state' => all_state}[@liste]
end
def self.dossiers_liste_libelle
['nouveaux', 'a_traiter', 'en_attente', 'deposes', 'a_instruire', 'termine']
['nouveaux', 'a_traiter', 'en_attente', 'deposes', 'a_instruire', 'termine', 'all_state']
end
def all_state
@all_state ||= filter_dossiers.all_state
end
def nouveaux

View file

@ -10,11 +10,16 @@ class DossiersListUserService
'valides' => valides,
'en_instruction' => en_instruction,
'termine' => termine,
'invite' => invite}[@liste]
'invite' => invite,
'all_state' => all_state}[@liste]
end
def self.dossiers_liste_libelle
['brouillon', 'a_traiter', 'valides', 'en_instruction', 'termine', 'invite']
['brouillon', 'a_traiter', 'valides', 'en_instruction', 'termine', 'invite', 'all_state']
end
def all_state
@all_state ||= @current_devise_profil.dossiers.all_state
end
def brouillon

View file

@ -2,22 +2,26 @@
%table.table
%thead
%th.col-md-4.col-lg-4= smart_listing.sortable 'Email', :email
%th.col-md-4.col-lg-4= smart_listing.sortable 'API Token', :api_token
%th.col-md-4.col-lg-4= smart_listing.sortable 'Date de dernière connexion', :last_sign_in_at
%th.col-md-2.col-lg-2 Procédure active
%th.col-md-2.col-lg-2 Dossier en cours
- @admins.each do |admin|
%tr
%td
= admin.email
%td
= admin.api_token
%td
- unless admin.last_sign_in_at.nil?
= time_ago_in_words(l(admin.last_sign_in_at, format: "%d/%m/%Y %H:%M UTC +02:00"))
(
= admin.last_sign_in_at.to_date.strftime('%d/%m/%Y')
)
%td
= admin.procedures.where(published: true).count
%td
- total_dossier = 0
- admin.procedures.each do |procedure| total_dossier += procedure.dossiers.count end
= total_dossier
= smart_listing.paginate
= smart_listing.pagination_per_page_links

View file

@ -7,47 +7,48 @@
#onglets
%ul.nav.nav-tabs
%li{ class: (@dossiers_list_facade.nouveaux_class)}
%a{:href => "#{url_for @dossiers_list_facade.nouveaux_url}", 'data-toggle' => :tooltip, title: 'Les nouveaux dossiers non ouverts.'}
%h5.text-info
= "Nouveaux "
.badge.progress-bar-info
=@dossiers_list_facade.nouveaux_total
-unless Features.opensimplif
%li{ class: (@dossiers_list_facade.nouveaux_class)}
%a{:href => "#{url_for @dossiers_list_facade.nouveaux_url}", 'data-toggle' => :tooltip, title: 'Les nouveaux dossiers non ouverts.'}
%h5.text-info
= "Nouveaux "
.badge.progress-bar-info
=@dossiers_list_facade.nouveaux_total
%li{ class: (@dossiers_list_facade.a_traiter_class) }
%a{:href => "#{url_for @dossiers_list_facade.a_traiter_url}", 'data-toggle' => :tooltip, title: 'Les dossiers qui requièrent une action de votre part.'}
%h5.text-danger
= "Action requise"
.badge.progress-bar-danger
=@dossiers_list_facade.a_traiter_total
%li{ class: (@dossiers_list_facade.a_traiter_class) }
%a{:href => "#{url_for @dossiers_list_facade.a_traiter_url}", 'data-toggle' => :tooltip, title: 'Les dossiers qui requièrent une action de votre part.'}
%h5.text-danger
= "Action requise"
.badge.progress-bar-danger
=@dossiers_list_facade.a_traiter_total
%li{ class: (@dossiers_list_facade.en_attente_class) }
%a{:href => "#{url_for @dossiers_list_facade.en_attente_url}", 'data-toggle' => :tooltip, title: 'Les dossiers en attentes d\'une action de la part de l\'usager.'}
%h5.text-default
="Attente usager "
.badge.progress-bar-default
=@dossiers_list_facade.en_attente_total
%li{ class: (@dossiers_list_facade.en_attente_class) }
%a{:href => "#{url_for @dossiers_list_facade.en_attente_url}", 'data-toggle' => :tooltip, title: 'Les dossiers en attentes d\'une action de la part de l\'usager.'}
%h5.text-default
="Attente usager "
.badge.progress-bar-default
=@dossiers_list_facade.en_attente_total
%li{ class: (@dossiers_list_facade.deposes_class) }
%a{:href => "#{url_for @dossiers_list_facade.deposes_url}", 'data-toggle' => :tooltip, title: 'Les dossiers qui ont été validés et déposés par les usager qui attendent une réponse de bonne réception avant examen.'}
%h5.text-purple
="À réceptionner"
.badge.progress-bar-purple
=@dossiers_list_facade.deposes_total
%li{ class: (@dossiers_list_facade.deposes_class) }
%a{:href => "#{url_for @dossiers_list_facade.deposes_url}", 'data-toggle' => :tooltip, title: 'Les dossiers qui ont été validés et déposés par les usager qui attendent une réponse de bonne réception avant examen.'}
%h5.text-purple
="À réceptionner"
.badge.progress-bar-purple
=@dossiers_list_facade.deposes_total
%li{ class: (@dossiers_list_facade.a_instruire_class) }
%a{:href => "#{url_for @dossiers_list_facade.a_instruire_url}", 'data-toggle' => :tooltip, title: 'Les dossiers qui ont été notifiés comme bien réceptionnés et qui attendent un verdict final.'}
%h5.text-warning
= "À instruire"
.badge.progress-bar-warning
=@dossiers_list_facade.a_instruire_total
%li{ class: (@dossiers_list_facade.a_instruire_class) }
%a{:href => "#{url_for @dossiers_list_facade.a_instruire_url}", 'data-toggle' => :tooltip, title: 'Les dossiers qui ont été notifiés comme bien réceptionnés et qui attendent un verdict final.'}
%h5.text-warning
= "À instruire"
.badge.progress-bar-warning
=@dossiers_list_facade.a_instruire_total
%li{ class: (@dossiers_list_facade.termine_class) }
%a{:href => "#{url_for @dossiers_list_facade.termine_url}",'data-toggle' => :tooltip, title: 'Tous les dossiers qui ont été traité avec un statut "Validé", "Refusé" ou "Sans suite "'}
%h5.text-success
= "Terminé"
.badge.progress-bar-success
=@dossiers_list_facade.termine_total
%li{ class: (@dossiers_list_facade.termine_class) }
%a{:href => "#{url_for @dossiers_list_facade.termine_url}",'data-toggle' => :tooltip, title: 'Tous les dossiers qui ont été traité avec un statut "Validé", "Refusé" ou "Sans suite "'}
%h5.text-success
= "Terminé"
.badge.progress-bar-success
=@dossiers_list_facade.termine_total
%ul.nav.nav-tabs.navbar-right{style:'border-bottom: none;'}
%li#search{ class: (@dossiers_list_facade.search_class) }

View file

@ -5,11 +5,11 @@
=link_to 'Tous mes dossiers en CSV', backoffice_download_dossiers_tps_path, {class: 'btn btn-success btn-sm', style: 'float: right; margin-right: 4%; margin-top: 7px'}
%h1 Gestion des dossiers
-unless Features.opensimplif
= render partial: 'backoffice/dossiers/onglets'
= render partial: 'backoffice/dossiers/onglets'
= smart_listing_render :dossiers
%br
%br
= render partial: 'backoffice/dossiers/state_description', locals: {dossiers_list_facade: @dossiers_list_facade}
- unless Features.opensimplif
= render partial: 'backoffice/dossiers/state_description', locals: {dossiers_list_facade: @dossiers_list_facade}

View file

@ -8,4 +8,5 @@
%br
%br
= render partial: 'state_description', locals: {dossiers_list_facade: @dossiers_list_facade}
- unless Features.opensimplif
= render partial: 'state_description', locals: {dossiers_list_facade: @dossiers_list_facade}

View file

@ -11,7 +11,7 @@ require 'mina/rbenv' # for rbenv support. (http://rbenv.org)
# branch - Branch name to deploy. (needed by mina/git)
ENV['to'] ||= "staging"
ENV['to'] = "staging" unless ["staging", "production", "opensimplif"].include?(ENV['to'])
ENV['to'] = "staging" unless ["staging", "production", "opensimplif", "tps_v2"].include?(ENV['to'])
raise "missing domain, run with 'rake deploy domain=37.187.154.237'" if ENV['domain'].nil?
@ -51,13 +51,23 @@ elsif ENV["to"] == "opensimplif"
set :deploy_to, '/var/www/opensimplif'
set :user, 'opensimplif' # Username in the server to SSH to.
appname = 'opensimplif'
elsif ENV["to"] == "tps_v2"
if ENV['branch'].nil?
set :branch, 'tps_v2'
else
set :branch, ENV['branch']
end
set :deploy_to, '/var/www/tps_v2'
set :user, 'tps_v2' # Username in the server to SSH to.
appname = 'tps_v2'
end
set :rails_env, ENV["to"]
if ENV["to"] == "opensimplif"
set :rails_env, "production"
elsif ENV["to"] == "tps_v2"
set :rails_env, "production"
end
# For system-wide RVM install.

View file

@ -1,3 +1,3 @@
remote_storage: true
unified_login: false
opensimplif: false
unified_login: true
opensimplif: true

View file

@ -97,8 +97,7 @@ feature 'on click on tabs button' do
end
scenario "it hides the tabs" do
expect(page).to_not have_css('#filter_by_procedure')
expect(page).to_not have_css('#onglets')
expect(page).to_not have_content('Nouveaux')
end
end
end