Merge branch 'dev'

This commit is contained in:
Simon Lehericey 2017-11-20 17:45:27 +01:00
commit 62ebd74e07
15 changed files with 65 additions and 31 deletions

View file

@ -1 +1 @@
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>ic_close_circle_white</title><defs><path id="a" d="M0 0h992v412H0z"/><filter x="-8.1%" y="-4.6%" width="116.2%" height="110.9%" filterUnits="objectBoundingBox" id="b"><feOffset dy="4" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur stdDeviation="8" in="shadowOffsetOuter1" result="shadowBlurOuter1"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0" in="shadowBlurOuter1" result="shadowMatrixOuter1"/><feMerge><feMergeNode in="shadowMatrixOuter1"/><feMergeNode in="SourceGraphic"/></feMerge></filter><path id="c" d="M0 0h320v479H0z"/></defs><g fill="none" fill-rule="evenodd"><g transform="translate(-557 -325)"><use fill="#FFF" xlink:href="#a"/><path stroke="#CCC" d="M.5.5h991v411H.5z"/></g><g filter="url(#b)" transform="translate(-16 -399)"><use fill="#FFF" xlink:href="#c"/><path stroke="#CCC" d="M.5.5h319v478H.5z"/><g><path d="M16 399h24v24H16z"/><path d="M28 400c-6.072 0-11 4.928-11 11s4.928 11 11 11 11-4.928 11-11-4.928-11-11-11zM31.833 407L24 414.833M31.833 414.833L24 407" stroke="#FF5D60" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></g></g></g></svg>
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>close</title><path d="M12 1C5.928 1 1 5.928 1 12s4.928 11 11 11 11-4.928 11-11S18.072 1 12 1zm3.833 7L8 15.833 15.833 8zm0 7.833L8 8l7.833 7.833z" stroke="#FF5D60" stroke-width="2" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"/></svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 357 B

View file

@ -1 +1 @@
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>Imprimer</title><defs><rect id="a" x="3" y="8" width="18" height="7" rx="1"/><path d="M7 3h10a1 1 0 0 1 1 1v2H6V4a1 1 0 0 1 1-1z" id="b"/><path d="M0 0h12v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V0z" id="c"/></defs><g fill="none" fill-rule="evenodd"><path d="M0 0h24v24H0z"/><use fill="#FFF" xlink:href="#a"/><rect stroke="#4393F3" stroke-width="2" x="2" y="7" width="20" height="9" rx="1"/><use fill="#FFF" xlink:href="#b"/><path stroke="#4393F3" stroke-width="2" d="M7 2h10a2 2 0 0 1 2 2v3H5V4a2 2 0 0 1 2-2z"/><g transform="translate(6 14)"><use fill="#FFF" xlink:href="#c"/><path stroke="#4393F3" stroke-width="2" d="M-1-1h14v7a2 2 0 0 1-2 2H1a2 2 0 0 1-2-2v-7z"/><rect fill="#4393F3" x="1" y="4" width="6" height="1.5" rx=".75"/><rect fill="#4393F3" x="1" y="1.5" width="10" height="1.5" rx=".75"/></g></g></svg>
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>printer</title><g fill="none" fill-rule="evenodd"><path d="M0 0h24v24H0z"/><path d="M3 8v7h18V8H3zm0-2h18a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2zm1 9v2h16v-2H4z" fill="#4393F3" fill-rule="nonzero"/><path d="M7 2h10a2 2 0 0 1 2 2v3H5V4a2 2 0 0 1 2-2z" stroke="#4393F3" stroke-width="2"/><g transform="translate(5 13)"><path d="M0 0h14v7a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V0z" stroke="#4393F3" stroke-width="2"/><rect fill="#4393F3" fill-rule="nonzero" x="2" y="5" width="6" height="1.5" rx=".75"/><rect fill="#4393F3" fill-rule="nonzero" x="2" y="2.5" width="10" height="1.5" rx=".75"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 941 B

After

Width:  |  Height:  |  Size: 707 B

View file

@ -1 +1 @@
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>sans-suite</title><defs><path id="a" d="M0 0h992v412H0z"/><filter x="-8.1%" y="-4.6%" width="116.2%" height="110.9%" filterUnits="objectBoundingBox" id="b"><feOffset dy="4" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur stdDeviation="8" in="shadowOffsetOuter1" result="shadowBlurOuter1"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0" in="shadowBlurOuter1" result="shadowMatrixOuter1"/><feMerge><feMergeNode in="shadowMatrixOuter1"/><feMergeNode in="SourceGraphic"/></feMerge></filter><path id="c" d="M0 0h320v479H0z"/></defs><g fill="none" fill-rule="evenodd"><g transform="translate(-557 -229)"><use fill="#FFF" xlink:href="#a"/><path stroke="#CCC" d="M.5.5h991v411H.5z"/></g><g filter="url(#b)" transform="translate(-16 -303)"><use fill="#FFF" xlink:href="#c"/><path stroke="#CCC" d="M.5.5h319v478H.5z"/><g><path d="M16 303h24v24H16z"/><path d="M28 304c-6.072 0-11 4.928-11 11s4.928 11 11 11 11-4.928 11-11-4.928-11-11-11z" stroke="#333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><g fill="#333" transform="translate(16 303)"><circle cx="8" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="16" cy="12" r="1"/></g></g></g></g></svg>
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>without-continuation</title><g fill="none" fill-rule="evenodd"><path d="M12 1C5.928 1 1 5.928 1 12s4.928 11 11 11 11-4.928 11-11S18.072 1 12 1z" stroke="#333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><g transform="translate(7 11)" fill-rule="nonzero" fill="#333"><circle cx="1" cy="1" r="1"/><circle cx="5" cy="1" r="1"/><circle cx="9" cy="1" r="1"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 478 B

View file

@ -33,17 +33,30 @@
}
.icon.folder {
margin-right: $default-spacer;
position: relative;
.notifications {
top: 0px;
right: -10px;
top: -3px;
right: -6px;
}
}
.notification-col {
width: 30px;
text-align: center;
a {
font-size: 16px;
}
}
.number-col {
width: 110px;
text-align: center;
}
.folder-col {
text-align: center;
}
.status-col {

View file

@ -240,7 +240,16 @@ module NewGestionnaire
includes = ''
where = ''
sorted_ids = nil
case table
when 'notifications'
dossiers_id_with_notification = current_gestionnaire.notifications_for_procedure(procedure)
if order == 'desc'
sorted_ids = dossiers_id_with_notification + (dossiers.order('dossiers.updated_at desc').ids - dossiers_id_with_notification)
else
sorted_ids = (dossiers.order('dossiers.updated_at asc').ids - dossiers_id_with_notification) + dossiers_id_with_notification
end
when 'self'
order = "dossiers.#{column} #{order}"
when'france_connect_information'
@ -255,7 +264,11 @@ module NewGestionnaire
order = "#{table.pluralize}.#{column} #{order}"
end
dossiers.includes(includes).where(where).order(Dossier.sanitize_for_order(order)).pluck(:id)
if sorted_ids.nil?
sorted_ids = dossiers.includes(includes).where(where).order(Dossier.sanitize_for_order(order)).pluck(:id)
end
sorted_ids
end
def current_filters

View file

@ -32,11 +32,6 @@ class RootController < ApplicationController
return redirect_to administrations_path
end
# TODO remove me
if Date.today <= Date.new(2017, 11, 11)
flash.now.notice = ["Une panne nationale de notre hébergeur OVH a rendu le service Téléprocédures Simplifiées inaccessible le jeudi 8 novembre de 7h15 à 11h15.", "Veuillez nous excuser pour la gêne occasionnée."]
end
render 'landing'
end

View file

@ -1,5 +1,3 @@
# encoding: utf-8
class BaseUploader < CarrierWave::Uploader::Base
def cache_dir
if Rails.env.production?

View file

@ -1,5 +1,3 @@
# encoding: utf-8
class CerfaUploader < BaseUploader
before :cache, :set_original_filename

View file

@ -1,5 +1,3 @@
# encoding: utf-8
class PieceJustificativeUploader < BaseUploader
before :cache, :set_original_filename

View file

@ -1,5 +1,3 @@
# encoding: utf-8
class ProcedureLogoUploader < BaseUploader
def root
File.join(Rails.root, "public")

View file

@ -1,11 +1,20 @@
%table.table.vertical.dossier-champs
%tbody
- champs.each do |c|
- champs.reject { |c| c.type_champ == "explication" }.each do |c|
%tr
- if c.type_champ == "header_section"
- case c.type_champ
- when "header_section"
%th.header-section{ colspan: 2 }
= c.libelle
- elsif c.type_champ != "explication"
- when "multiple_drop_down_list"
%th.libelle
= "#{c.libelle} :"
%td.rich-text
%ul
- c.value.split(", ").each do |item|
%li
= item
- else
%th.libelle
= "#{c.libelle} :"
%td.rich-text

View file

@ -74,6 +74,11 @@
%table.table.dossiers-table.hoverable
%thead
%tr
- if @statut == 'suivis' || @statut == 'tous'
= render partial: "header_field", locals: { field: { "label" => "●", "table" => "notifications", "column" => "notifications" }, classname: "notification-col" }
- else
%th.notification-col
= render partial: "header_field", locals: { field: { "label" => "Nº dossier", "table" => "self", "column" => "id" }, classname: "number-col" }
- @displayed_fields.each do |field|
@ -96,11 +101,13 @@
%tbody
- @dossiers.each do |dossier|
%tr
%td.folder-col
.icon.folder
- if current_gestionnaire.notifications_for_procedure(@procedure).include?(dossier.id)
%span.notifications{ 'aria-label': 'notifications' }
%td.number-col
= link_to(dossier_path(@procedure, dossier), class: 'cell-link') do
.icon.folder
- if current_gestionnaire.notifications_for_procedure(@procedure).include?(dossier.id)
%span.notifications{ 'aria-label': 'notifications' }
= dossier.id
- @displayed_fields.each do |field|

View file

@ -0,0 +1,5 @@
class ChangeProcedurePresentationDefault < ActiveRecord::Migration[5.0]
def change
change_column_default :procedure_presentations, :sort, from: { "table" => "self", "column" => "id", "order" => "desc" }.to_json, to: { "table" => "notifications", "column" => "notifications", "order" => "desc" }.to_json
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20171024135653) do
ActiveRecord::Schema.define(version: 20171117165748) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -394,9 +394,9 @@ ActiveRecord::Schema.define(version: 20171024135653) do
create_table "procedure_presentations", force: :cascade do |t|
t.integer "assign_to_id"
t.text "displayed_fields", default: ["{\"label\":\"Demandeur\",\"table\":\"user\",\"column\":\"email\"}"], null: false, array: true
t.json "sort", default: "{\"table\":\"self\",\"column\":\"id\",\"order\":\"desc\"}", null: false
t.json "filters", default: "{\"a-suivre\":[],\"suivis\":[],\"traites\":[],\"tous\":[],\"archives\":[]}", null: false
t.text "displayed_fields", default: ["{\"label\":\"Demandeur\",\"table\":\"user\",\"column\":\"email\"}"], null: false, array: true
t.json "sort", default: "{\"table\":\"notifications\",\"column\":\"notifications\",\"order\":\"desc\"}", null: false
t.json "filters", default: "{\"a-suivre\":[],\"suivis\":[],\"traites\":[],\"tous\":[],\"archives\":[]}", null: false
t.index ["assign_to_id"], name: "index_procedure_presentations_on_assign_to_id", unique: true, using: :btree
end

View file

@ -295,7 +295,7 @@ describe NewGestionnaire::ProceduresController, type: :controller do
let(:statut) { 'tous' }
it { expect(assigns(:statut)).to eq('tous') }
it { expect(assigns(:dossiers)).to match([a_suivre__dossier, new_followed_dossier, termine_dossier].sort_by(&:updated_at)) }
it { expect(assigns(:dossiers)).to match_array([a_suivre__dossier, new_followed_dossier, termine_dossier]) }
end
context 'when statut is archives' do