Merge branch 'develop' into staging
This commit is contained in:
commit
2eac2d74b4
11 changed files with 90 additions and 54 deletions
|
@ -4,6 +4,7 @@ class DossiersListFacades
|
||||||
def initialize current_devise_profil, liste, procedure = nil
|
def initialize current_devise_profil, liste, procedure = nil
|
||||||
@current_devise_profil = current_devise_profil
|
@current_devise_profil = current_devise_profil
|
||||||
@liste = liste
|
@liste = liste
|
||||||
|
@liste = 'all_state' if Features.opensimplif
|
||||||
@procedure = procedure
|
@procedure = procedure
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -190,4 +191,5 @@ class DossiersListFacades
|
||||||
def base_url liste
|
def base_url liste
|
||||||
@procedure.nil? ? backoffice_dossiers_path(liste: liste) : backoffice_dossiers_procedure_path(id: @procedure.id, liste: liste)
|
@procedure.nil? ? backoffice_dossiers_path(liste: liste) : backoffice_dossiers_procedure_path(id: @procedure.id, liste: liste)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -53,6 +53,7 @@ class Dossier < ActiveRecord::Base
|
||||||
EN_INSTRUCTION = %w(submitted received)
|
EN_INSTRUCTION = %w(submitted received)
|
||||||
A_INSTRUIRE = %w(received)
|
A_INSTRUIRE = %w(received)
|
||||||
TERMINE = %w(closed refused without_continuation)
|
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)
|
def retrieve_last_piece_justificative_by_type(type)
|
||||||
pieces_justificatives.where(type_de_piece_justificative_id: type).last
|
pieces_justificatives.where(type_de_piece_justificative_id: type).last
|
||||||
|
@ -169,6 +170,10 @@ class Dossier < ActiveRecord::Base
|
||||||
state
|
state
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def all_state?
|
||||||
|
ALL_STATE.include?(state)
|
||||||
|
end
|
||||||
|
|
||||||
def brouillon?
|
def brouillon?
|
||||||
BROUILLON.include?(state)
|
BROUILLON.include?(state)
|
||||||
end
|
end
|
||||||
|
@ -209,6 +214,10 @@ class Dossier < ActiveRecord::Base
|
||||||
TERMINE.include?(state)
|
TERMINE.include?(state)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.all_state order = 'ASC'
|
||||||
|
where(state: ALL_STATE, archived: false).order("updated_at #{order}")
|
||||||
|
end
|
||||||
|
|
||||||
def self.brouillon order = 'ASC'
|
def self.brouillon order = 'ASC'
|
||||||
where(state: BROUILLON, archived: false).order("updated_at #{order}")
|
where(state: BROUILLON, archived: false).order("updated_at #{order}")
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,11 +11,16 @@ class DossiersListGestionnaireService
|
||||||
'en_attente' => waiting_for_user,
|
'en_attente' => waiting_for_user,
|
||||||
'deposes' => deposes,
|
'deposes' => deposes,
|
||||||
'a_instruire' => a_instruire,
|
'a_instruire' => a_instruire,
|
||||||
'termine' => termine}[@liste]
|
'termine' => termine,
|
||||||
|
'all_state' => all_state}[@liste]
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.dossiers_liste_libelle
|
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
|
end
|
||||||
|
|
||||||
def nouveaux
|
def nouveaux
|
||||||
|
|
|
@ -10,11 +10,16 @@ class DossiersListUserService
|
||||||
'valides' => valides,
|
'valides' => valides,
|
||||||
'en_instruction' => en_instruction,
|
'en_instruction' => en_instruction,
|
||||||
'termine' => termine,
|
'termine' => termine,
|
||||||
'invite' => invite}[@liste]
|
'invite' => invite,
|
||||||
|
'all_state' => all_state}[@liste]
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.dossiers_liste_libelle
|
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
|
end
|
||||||
|
|
||||||
def brouillon
|
def brouillon
|
||||||
|
|
|
@ -2,22 +2,26 @@
|
||||||
%table.table
|
%table.table
|
||||||
%thead
|
%thead
|
||||||
%th.col-md-4.col-lg-4= smart_listing.sortable 'Email', :email
|
%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-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|
|
- @admins.each do |admin|
|
||||||
%tr
|
%tr
|
||||||
%td
|
%td
|
||||||
= admin.email
|
= admin.email
|
||||||
%td
|
|
||||||
= admin.api_token
|
|
||||||
%td
|
%td
|
||||||
- unless admin.last_sign_in_at.nil?
|
- 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"))
|
= 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')
|
= 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.paginate
|
||||||
= smart_listing.pagination_per_page_links
|
= smart_listing.pagination_per_page_links
|
||||||
|
|
||||||
|
|
|
@ -7,47 +7,48 @@
|
||||||
|
|
||||||
#onglets
|
#onglets
|
||||||
%ul.nav.nav-tabs
|
%ul.nav.nav-tabs
|
||||||
%li{ class: (@dossiers_list_facade.nouveaux_class)}
|
-unless Features.opensimplif
|
||||||
%a{:href => "#{url_for @dossiers_list_facade.nouveaux_url}", 'data-toggle' => :tooltip, title: 'Les nouveaux dossiers non ouverts.'}
|
%li{ class: (@dossiers_list_facade.nouveaux_class)}
|
||||||
%h5.text-info
|
%a{:href => "#{url_for @dossiers_list_facade.nouveaux_url}", 'data-toggle' => :tooltip, title: 'Les nouveaux dossiers non ouverts.'}
|
||||||
= "Nouveaux "
|
%h5.text-info
|
||||||
.badge.progress-bar-info
|
= "Nouveaux "
|
||||||
=@dossiers_list_facade.nouveaux_total
|
.badge.progress-bar-info
|
||||||
|
=@dossiers_list_facade.nouveaux_total
|
||||||
|
|
||||||
%li{ class: (@dossiers_list_facade.a_traiter_class) }
|
%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.'}
|
%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
|
%h5.text-danger
|
||||||
= "Action requise"
|
= "Action requise"
|
||||||
.badge.progress-bar-danger
|
.badge.progress-bar-danger
|
||||||
=@dossiers_list_facade.a_traiter_total
|
=@dossiers_list_facade.a_traiter_total
|
||||||
|
|
||||||
%li{ class: (@dossiers_list_facade.en_attente_class) }
|
%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.'}
|
%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
|
%h5.text-default
|
||||||
="Attente usager "
|
="Attente usager "
|
||||||
.badge.progress-bar-default
|
.badge.progress-bar-default
|
||||||
=@dossiers_list_facade.en_attente_total
|
=@dossiers_list_facade.en_attente_total
|
||||||
|
|
||||||
%li{ class: (@dossiers_list_facade.deposes_class) }
|
%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.'}
|
%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
|
%h5.text-purple
|
||||||
="À réceptionner"
|
="À réceptionner"
|
||||||
.badge.progress-bar-purple
|
.badge.progress-bar-purple
|
||||||
=@dossiers_list_facade.deposes_total
|
=@dossiers_list_facade.deposes_total
|
||||||
|
|
||||||
%li{ class: (@dossiers_list_facade.a_instruire_class) }
|
%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.'}
|
%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
|
%h5.text-warning
|
||||||
= "À instruire"
|
= "À instruire"
|
||||||
.badge.progress-bar-warning
|
.badge.progress-bar-warning
|
||||||
=@dossiers_list_facade.a_instruire_total
|
=@dossiers_list_facade.a_instruire_total
|
||||||
|
|
||||||
%li{ class: (@dossiers_list_facade.termine_class) }
|
%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 "'}
|
%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
|
%h5.text-success
|
||||||
= "Terminé"
|
= "Terminé"
|
||||||
.badge.progress-bar-success
|
.badge.progress-bar-success
|
||||||
=@dossiers_list_facade.termine_total
|
=@dossiers_list_facade.termine_total
|
||||||
|
|
||||||
%ul.nav.nav-tabs.navbar-right{style:'border-bottom: none;'}
|
%ul.nav.nav-tabs.navbar-right{style:'border-bottom: none;'}
|
||||||
%li#search{ class: (@dossiers_list_facade.search_class) }
|
%li#search{ class: (@dossiers_list_facade.search_class) }
|
||||||
|
|
|
@ -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'}
|
=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
|
%h1 Gestion des dossiers
|
||||||
|
|
||||||
-unless Features.opensimplif
|
= render partial: 'backoffice/dossiers/onglets'
|
||||||
= render partial: 'backoffice/dossiers/onglets'
|
|
||||||
|
|
||||||
= smart_listing_render :dossiers
|
= smart_listing_render :dossiers
|
||||||
|
|
||||||
%br
|
%br
|
||||||
%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}
|
||||||
|
|
|
@ -8,4 +8,5 @@
|
||||||
|
|
||||||
%br
|
%br
|
||||||
%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}
|
||||||
|
|
|
@ -11,7 +11,7 @@ require 'mina/rbenv' # for rbenv support. (http://rbenv.org)
|
||||||
# branch - Branch name to deploy. (needed by mina/git)
|
# branch - Branch name to deploy. (needed by mina/git)
|
||||||
|
|
||||||
ENV['to'] ||= "staging"
|
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?
|
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 :deploy_to, '/var/www/opensimplif'
|
||||||
set :user, 'opensimplif' # Username in the server to SSH to.
|
set :user, 'opensimplif' # Username in the server to SSH to.
|
||||||
appname = 'opensimplif'
|
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
|
end
|
||||||
|
|
||||||
|
|
||||||
set :rails_env, ENV["to"]
|
set :rails_env, ENV["to"]
|
||||||
|
|
||||||
if ENV["to"] == "opensimplif"
|
if ENV["to"] == "opensimplif"
|
||||||
set :rails_env, "production"
|
set :rails_env, "production"
|
||||||
|
elsif ENV["to"] == "tps_v2"
|
||||||
|
set :rails_env, "production"
|
||||||
end
|
end
|
||||||
|
|
||||||
# For system-wide RVM install.
|
# For system-wide RVM install.
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
remote_storage: true
|
remote_storage: true
|
||||||
unified_login: false
|
unified_login: true
|
||||||
opensimplif: false
|
opensimplif: true
|
|
@ -97,8 +97,7 @@ feature 'on click on tabs button' do
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "it hides the tabs" do
|
scenario "it hides the tabs" do
|
||||||
expect(page).to_not have_css('#filter_by_procedure')
|
expect(page).to_not have_content('Nouveaux')
|
||||||
expect(page).to_not have_css('#onglets')
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue