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; font-family: Arial;
.show-block { .show-block {
width: 840px;
min-width: 840px;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.5); box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.5);

View file

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

View file

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

View file

@ -5,6 +5,7 @@ class MailTemplateDecorator < Draper::Decorator
case object.type case object.type
when "MailReceived" when "MailReceived"
"E-mail d'accusé de réception" "E-mail d'accusé de réception"
else
object.type object.type
end end
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" = 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 %div.row
= render partial: 'layouts/flash_messages' = render partial: 'layouts/flash_messages'
%div.row %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 = 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 %button.action.refuse-dossier
%i.fa.fa-times %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? - unless @facade.dossier.archived?
= link_to 'Archiver', backoffice_dossier_archive_path(@facade.dossier), method: :post, class: 'btn btn-default btn-block' = 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: "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;" } %div{ style: "vertical-align: middle; margin-right: 10px; margin-top: auto; margin-bottom: auto;" }
= current_administrateur.email = 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 = @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.col-lg-3.col-md-3.col-sm-3.col-xs-3.options
%div.row %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 } %span{ 'data-toggle' => :tooltip, "data-placement" => :bottom, title: @facade.dossier.procedure.libelle }
= @facade.dossier.procedure.libelle = @facade.dossier.procedure.libelle
%div.col-lg-3.col-md-3.col-sm-3.col-xs-3.options .col-xs-3.options
%div.row .row
%div.col-lg-12.col-md-12.col-sm-12.col-xs-12 .col-xs-12
- if current_gestionnaire.follow?(@facade.dossier.id) - 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 = 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 %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 = 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 %i.fa.fa-user-plus
Suivre le dossier Suivre le dossier
%div.row .row
%div.col-lg-12.col-md-12.col-sm-12.col-xs-12 .col-xs-12
%div#invitations.dropdown-toggle{ 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false } #invitations.dropdown-toggle{ 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false }
%i.fa.fa-user %i.fa.fa-user
= t('utils.involved') = t('utils.involved')
.badge.progress-bar-info .badge.progress-bar-info
= @facade.dossier.invites.count = @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') %h4= t('dynamics.dossiers.followers.title')
%ul %ul
- unless @facade.followers.empty? - unless @facade.followers.empty?

View file

@ -1,17 +1,15 @@
-#%span.fa.fa-sign-out
-if user_signed_in? -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: 'users/login_banner'
= render partial: 'layouts/credentials' = render partial: 'layouts/credentials'
-elsif gestionnaire_signed_in? -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: 'gestionnaires/login_banner'
= render partial: 'layouts/credentials' = render partial: 'layouts/credentials'
-elsif administrateur_signed_in? -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: 'administrateurs/login_banner'
= render partial: 'layouts/credentials' = render partial: 'layouts/credentials'
-else -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' = 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 } %span{ 'data-toggle' => :tooltip, "data-placement" => :bottom, title: @facade.dossier.procedure.libelle }
= @facade.dossier.procedure.libelle.truncate(60) = @facade.dossier.procedure.libelle.truncate(60)
%div.col-lg-3.col-md-3.col-sm-3.col-xs-3.options %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 'without_continuation' => 'dossiers#without_continuation'
post 'close' => 'dossiers#close' post 'close' => 'dossiers#close'
post 'archive' => 'dossiers#archive' post 'archive' => 'dossiers#archive'
post 'reopen' => 'dossiers#reopen'
put 'follow' => 'dossiers#follow' put 'follow' => 'dossiers#follow'
resources :commentaires, only: [:index] resources :commentaires, only: [:index]

View file

@ -357,6 +357,23 @@ describe Backoffice::DossiersController, type: :controller do
end end
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 describe 'POST #archive' do
before do before do