Merge branch 'dev'

This commit is contained in:
Simon Lehericey 2017-10-12 16:42:37 +02:00
commit 02f1254c99
17 changed files with 54 additions and 63 deletions

View file

@ -2,9 +2,6 @@ source 'https://rubygems.org'
gem 'rails', '5.0.0.1' gem 'rails', '5.0.0.1'
gem 'actioncable', '5.0.0.1'
gem 'redis'
# Use SCSS for stylesheets # Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0' gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets # Use Uglifier as compressor for JavaScript assets

View file

@ -499,7 +499,6 @@ GEM
nokogiri (~> 1.5) nokogiri (~> 1.5)
trollop (~> 2.1) trollop (~> 2.1)
rdoc (4.3.0) rdoc (4.3.0)
redis (3.3.3)
ref (2.0.0) ref (2.0.0)
request_store (1.3.1) request_store (1.3.1)
responders (2.3.0) responders (2.3.0)
@ -672,7 +671,6 @@ PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
actioncable (= 5.0.0.1)
active_model_serializers active_model_serializers
apipie-rails apipie-rails
bootstrap-datepicker-rails bootstrap-datepicker-rails
@ -728,7 +726,6 @@ DEPENDENCIES
rack-mini-profiler rack-mini-profiler
rails (= 5.0.0.1) rails (= 5.0.0.1)
rails-controller-testing rails-controller-testing
redis
rest-client rest-client
rgeo-geojson rgeo-geojson
rspec-rails (~> 3.0) rspec-rails (~> 3.0)

View file

@ -6,7 +6,7 @@ function initCarto() {
scrollWheelZoom: false scrollWheelZoom: false
}).setView([position.lat, position.lon], position.zoom); }).setView([position.lat, position.lon], position.zoom);
L.tileLayer('http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', { L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors' attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map); }).addTo(map);

View file

@ -2,7 +2,7 @@ var LON = '2.428462';
var LAT = '46.538192'; var LAT = '46.538192';
function initCarto() { function initCarto() {
OSM = L.tileLayer("http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png", { OSM = L.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>' attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}); });

View file

@ -5,7 +5,6 @@
// FIXME: Rename when the header is generalized // FIXME: Rename when the header is generalized
.new-header { .new-header {
height: 72px;
background-color: #FFFFFF; background-color: #FFFFFF;
} }
@ -17,7 +16,7 @@
@extend .container; @extend .container;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
height: 100%; min-height: 72px;
} }
.header-logo { .header-logo {

View file

@ -49,6 +49,10 @@
width: 90px; width: 90px;
position: relative; position: relative;
&:hover {
background-color: rgba(0, 0, 0, 0.05);
}
&:last-child { &:last-child {
border-right: 1px solid $border-grey; border-right: 1px solid $border-grey;
} }

View file

@ -1,5 +0,0 @@
# Be sure to restart your server when you modify this file. Action Cable runs in a loop that does not support auto reloading.
module ApplicationCable
class Channel < ActionCable::Channel::Base
end
end

View file

@ -1,5 +0,0 @@
# Be sure to restart your server when you modify this file. Action Cable runs in a loop that does not support auto reloading.
module ApplicationCable
class Connection < ActionCable::Connection::Base
end
end

View file

@ -1,5 +0,0 @@
class NotificationsChannel < ApplicationCable::Channel
def subscribed
stream_from 'notifications'
end
end

View file

@ -100,7 +100,13 @@ class Users::DescriptionController < UsersController
private private
def redirect_to_description_with_errors(dossier, errors) def redirect_to_description_with_errors(dossier, errors)
flash.alert = errors errors_to_display = if errors.count > 3
errors.take(3) + ['...']
else
errors
end
flash.alert = errors_to_display
redirect_to users_dossier_description_path(dossier_id: dossier.id) redirect_to users_dossier_description_path(dossier_id: dossier.id)
end end

View file

@ -8,7 +8,7 @@ class ChampsService
def build_error_messages(champs) def build_error_messages(champs)
champs.select(&:mandatory_and_blank?) champs.select(&:mandatory_and_blank?)
.map { |c| "Le champ #{c.libelle} doit être rempli." } .map { |c| "Le champ #{c.libelle.truncate(200)} doit être rempli." }
end end
private private

View file

@ -38,7 +38,7 @@ class PiecesJustificativesService
type_de_piece_justificative: tpj, type_de_piece_justificative: tpj,
user: user) user: user)
pj.save ? nil : "le fichier #{content.original_filename} (#{pj.libelle}) n'a pas pu être sauvegardé" pj.save ? nil : "le fichier #{content.original_filename} (#{pj.libelle.truncate(200)}) n'a pas pu être sauvegardé"
end end
def self.missing_pj_error_messages(dossier) def self.missing_pj_error_messages(dossier)
@ -46,6 +46,6 @@ class PiecesJustificativesService
present_pjs = dossier.pieces_justificatives.map(&:type_de_piece_justificative) present_pjs = dossier.pieces_justificatives.map(&:type_de_piece_justificative)
missing_pjs = mandatory_pjs - present_pjs missing_pjs = mandatory_pjs - present_pjs
missing_pjs.map { |pj| "La pièce jointe #{pj.libelle} doit être fournie." } missing_pjs.map { |pj| "La pièce jointe #{pj.libelle.truncate(200)} doit être fournie." }
end end
end end

View file

@ -15,7 +15,6 @@
= javascript_include_tag 'application', 'data-turbolinks-track' => true = javascript_include_tag 'application', 'data-turbolinks-track' => true
= csrf_meta_tags = csrf_meta_tags
= action_cable_meta_tag
%body %body
= render partial: 'layouts/support_navigator_banner' = render partial: 'layouts/support_navigator_banner'
#beta{ class: (Rails.env == 'production' ? '' : 'beta-staging') } #beta{ class: (Rails.env == 'production' ? '' : 'beta-staging') }

View file

@ -5,7 +5,6 @@
%meta{ name: "turbolinks-cache-control", content: "no-cache" } %meta{ name: "turbolinks-cache-control", content: "no-cache" }
%meta{ name: "viewport", content: "width=device-width, initial-scale=1" } %meta{ name: "viewport", content: "width=device-width, initial-scale=1" }
= csrf_meta_tags = csrf_meta_tags
= action_cable_meta_tag
%title %title
= t("dynamics.page_title") = t("dynamics.page_title")

View file

@ -17,37 +17,47 @@
%ul.procedure-stats.flex %ul.procedure-stats.flex
%li %li
- a_suivre_count = @dossiers_a_suivre_count_per_procedure[p.id] || 0 %object
.stats-number = link_to(procedure_path(p, statut: 'a-suivre')) do
= a_suivre_count - a_suivre_count = @dossiers_a_suivre_count_per_procedure[p.id] || 0
.stats-legend .stats-number
à suivre = a_suivre_count
.stats-legend
à suivre
%li %li
- if @notifications_count_per_procedure[p.id].present? %object
%span.notifications{ 'aria-label': "notifications" } = link_to(procedure_path(p, statut: 'suivis')) do
- followed_count = @followed_dossiers_count_per_procedure[p.id] || 0 - if @notifications_count_per_procedure[p.id].present?
.stats-number %span.notifications{ 'aria-label': "notifications" }
= followed_count - followed_count = @followed_dossiers_count_per_procedure[p.id] || 0
.stats-legend .stats-number
= t('pluralize.followed', count: followed_count) = followed_count
.stats-legend
= t('pluralize.followed', count: followed_count)
%li %li
- termines_count = @dossiers_termines_count_per_procedure[p.id] || 0 %object
.stats-number = link_to(procedure_path(p, statut: 'traites')) do
= termines_count - termines_count = @dossiers_termines_count_per_procedure[p.id] || 0
.stats-legend .stats-number
= t('pluralize.processed', count: termines_count) = termines_count
.stats-legend
= t('pluralize.processed', count: termines_count)
%li %li
- dossier_count = @dossiers_count_per_procedure[p.id] || 0 %object
.stats-number = link_to(procedure_path(p, statut: 'tous')) do
= dossier_count - dossier_count = @dossiers_count_per_procedure[p.id] || 0
.stats-legend .stats-number
= t('pluralize.case', count: dossier_count) = dossier_count
.stats-legend
= t('pluralize.case', count: dossier_count)
%li %li
- archived_count = @dossiers_archived_count_per_procedure[p.id] || 0 %object
.stats-number = link_to(procedure_path(p, statut: 'archives')) do
= archived_count - archived_count = @dossiers_archived_count_per_procedure[p.id] || 0
.stats-legend .stats-number
= t('pluralize.archived', count: archived_count) = archived_count
.stats-legend
= t('pluralize.archived', count: archived_count)
- if p.archivee? - if p.archivee?
.procedure-status .procedure-status

View file

@ -2,7 +2,4 @@
require ::File.expand_path('../config/environment', __FILE__) require ::File.expand_path('../config/environment', __FILE__)
# Action Cable requires that all classes are loaded in advance
Rails.application.eager_load!
run Rails.application run Rails.application

View file

@ -57,6 +57,4 @@ Rails.application.configure do
# Raises error for missing translations # Raises error for missing translations
# config.action_view.raise_on_missing_translations = true # config.action_view.raise_on_missing_translations = true
config.action_cable.url = "ws://localhost:3000/cable"
end end