Merge pull request #30 from sgmap/simplify_dossier_workflow

Simplify dossier workflow
This commit is contained in:
Mathieu Magnin 2017-03-01 09:50:08 +01:00 committed by GitHub
commit ff435bf4f4
14 changed files with 50 additions and 25 deletions

View file

@ -2,8 +2,6 @@
font-family: Arial;
.show-block {
width: 840px;
min-width: 840px;
margin-left: auto;
margin-right: auto;
box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.5);

View file

@ -34,7 +34,7 @@
}
}
#navbar-body {
height: 60px;
min-height: 60px;
background-color: #FFFFFF;
box-shadow: 0 1px 2px 0 rgba(50,50,50,0.5);
padding-left: 50px;
@ -43,7 +43,7 @@
font-size: 18px;
font-weight: bold;
line-height: 58px;
height: 58px;
min-height: 58px;
color: #000000;
overflow: hidden;
text-overflow: ellipsis;
@ -56,7 +56,7 @@
color: #666666;
padding: 8px;
border-right: 1px solid #C8C6C8;
height: 60px;
min-height: 60px;
.dropdown-toggle {
cursor: pointer;
}

View file

@ -159,6 +159,15 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
redirect_to backoffice_dossiers_path
end
def reopen
create_dossier_facade params[:dossier_id]
@facade.dossier.initiated!
flash.notice = 'Dossier réouvert.'
redirect_to backoffice_dossiers_path
end
private
def create_dossier_facade dossier_id

View file

@ -5,6 +5,7 @@ class MailTemplateDecorator < Draper::Decorator
case object.type
when "MailReceived"
"E-mail d'accusé de réception"
else
object.type
end
end

View file

@ -1,2 +1,2 @@
%div.col-lg-12.col-md-12.col-sm-12.col-xs-12#backoffice_dossier_show
#backoffice_dossier_show.col-xs-12
= render partial: "dossiers/dossier_show"

View file

@ -1,4 +1,4 @@
%div#main-container{class: "col-lg-#{main_container_size} col-md-#{main_container_size}"}
%div#main-container{class: "col-xs-#{main_container_size}"}
%div.row
= render partial: 'layouts/flash_messages'
%div.row

View file

@ -17,6 +17,7 @@
= form_tag(url_for({controller: 'backoffice/dossiers', action: :refuse, dossier_id: @facade.dossier.id}), class: 'form-inline action_button', method: 'POST', style: 'display:inline', 'data-toggle' => :tooltip, title: 'Refuser') do
%button.action.refuse-dossier
%i.fa.fa-times
= link_to 'Reouvrir', backoffice_dossier_reopen_path(@facade.dossier), method: :post, class: 'btn btn-default btn-block'
- unless @facade.dossier.archived?
= link_to 'Archiver', backoffice_dossier_archive_path(@facade.dossier), method: :post, class: 'btn btn-default btn-block'

View file

@ -1,6 +1,6 @@
%div.col-lg-8.col-md-8.col-sm-8.col-xs-8.main-info
.col-xs-7.main-info
%div.col-lg-3.col-md-3.col-sm-3.col-xs-3.options
.col-xs-3.options
%div{ style: "decorate:none; display: flex;box-shadow:none; float:right; display: flex; margin-top: 5px" }
%div{ style: "vertical-align: middle; margin-right: 10px; margin-top: auto; margin-bottom: auto;" }
= current_administrateur.email

View file

@ -1,4 +1,4 @@
%div.col-lg-8.col-md-8.col-sm-8.col-xs-8.main-info
.col-xs-7.main-info
= @facade_data_view.procedure_id.nil? ? "Tous les dossiers" : @facade_data_view.procedure.libelle
%div.col-lg-3.col-md-3.col-sm-3.col-xs-3.options
%div.row

View file

@ -1,9 +1,9 @@
%div.col-lg-8.col-md-8.col-sm-8.col-xs-8.main-info
.col-xs-7.main-info
%span{ 'data-toggle' => :tooltip, "data-placement" => :bottom, title: @facade.dossier.procedure.libelle }
= @facade.dossier.procedure.libelle
%div.col-lg-3.col-md-3.col-sm-3.col-xs-3.options
%div.row
%div.col-lg-12.col-md-12.col-sm-12.col-xs-12
.col-xs-3.options
.row
.col-xs-12
- if current_gestionnaire.follow?(@facade.dossier.id)
= link_to backoffice_dossier_follow_path(dossier_id: @facade.dossier.id), "data-method" => :put, class: "button-navbar-action",id: "suivre_dossier_#{@facade.dossier.id}" do
%i.fa.fa-user-times
@ -12,14 +12,14 @@
= link_to backoffice_dossier_follow_path(dossier_id: @facade.dossier.id), 'data-method' => :put, class: 'button-navbar-action', id: "suivre_dossier_#{@facade.dossier.id}" do
%i.fa.fa-user-plus
Suivre le dossier
%div.row
%div.col-lg-12.col-md-12.col-sm-12.col-xs-12
%div#invitations.dropdown-toggle{ 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false }
.row
.col-xs-12
#invitations.dropdown-toggle{ 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false }
%i.fa.fa-user
= t('utils.involved')
.badge.progress-bar-info
= @facade.dossier.invites.count
%div.dropdown-menu.dropdown-menu-right.dropdown-pannel
.dropdown-menu.dropdown-menu-right.dropdown-pannel
%h4= t('dynamics.dossiers.followers.title')
%ul
- unless @facade.followers.empty?

View file

@ -1,17 +1,15 @@
-#%span.fa.fa-sign-out
-if user_signed_in?
.col-lg-1.col-md-1.col-sm-1.col-xs-1#sign_out.no-padding
#sign_out.col-xs-2.no-padding
= render partial: 'users/login_banner'
= render partial: 'layouts/credentials'
-elsif gestionnaire_signed_in?
.col-lg-1.col-md-1.col-sm-1.col-xs-1#sign_out.no-padding
#sign_out.col-xs-2.no-padding
= render partial: 'gestionnaires/login_banner'
= render partial: 'layouts/credentials'
-elsif administrateur_signed_in?
.col-lg-1.col-md-1.col-sm-1.col-xs-1#sign_out.no-padding
#sign_out.col-xs-2.no-padding
= render partial: 'administrateurs/login_banner'
= render partial: 'layouts/credentials'
-else
.col-lg-1.col-md-1.col-sm-1.col-xs-1#sign_in
#sign_in.col-xs-2
= link_to "Connexion", new_user_session_path, :class => 'btn btn-lg btn-primary'

View file

@ -1,4 +1,4 @@
%div.col-lg-8.col-md-8.col-sm-8.col-xs-8.main-info
.col-xs-7.main-info
%span{ 'data-toggle' => :tooltip, "data-placement" => :bottom, title: @facade.dossier.procedure.libelle }
= @facade.dossier.procedure.libelle.truncate(60)
%div.col-lg-3.col-md-3.col-sm-3.col-xs-3.options

View file

@ -163,6 +163,7 @@ Rails.application.routes.draw do
post 'without_continuation' => 'dossiers#without_continuation'
post 'close' => 'dossiers#close'
post 'archive' => 'dossiers#archive'
post 'reopen' => 'dossiers#reopen'
put 'follow' => 'dossiers#follow'
resources :commentaires, only: [:index]

View file

@ -357,6 +357,23 @@ describe Backoffice::DossiersController, type: :controller do
end
end
describe 'POST #reopen' do
before do
dossier.received!
sign_in gestionnaire
end
subject { post :reopen, params: {dossier_id: dossier_id} }
it 'change state to initiated' do
subject
dossier.reload
expect(dossier.state).to eq('initiated')
end
it { is_expected.to redirect_to backoffice_dossiers_path }
end
describe 'POST #archive' do
before do