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
|
||||
@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
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#onglets
|
||||
%ul.nav.nav-tabs
|
||||
-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
|
||||
|
|
|
@ -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'
|
||||
|
||||
= smart_listing_render :dossiers
|
||||
|
||||
%br
|
||||
%br
|
||||
- unless Features.opensimplif
|
||||
= render partial: 'backoffice/dossiers/state_description', locals: {dossiers_list_facade: @dossiers_list_facade}
|
||||
|
|
|
@ -8,4 +8,5 @@
|
|||
|
||||
%br
|
||||
%br
|
||||
- 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)
|
||||
|
||||
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.
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
remote_storage: true
|
||||
unified_login: false
|
||||
opensimplif: false
|
||||
unified_login: true
|
||||
opensimplif: true
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue