Merge branch 'dev'
This commit is contained in:
commit
46312d0989
7 changed files with 37 additions and 6 deletions
2
Gemfile
2
Gemfile
|
@ -127,6 +127,8 @@ gem "administrate"
|
||||||
|
|
||||||
gem 'rack-mini-profiler'
|
gem 'rack-mini-profiler'
|
||||||
|
|
||||||
|
gem 'rake-progressbar', require: false
|
||||||
|
|
||||||
group :test do
|
group :test do
|
||||||
gem 'launchy'
|
gem 'launchy'
|
||||||
gem 'factory_bot'
|
gem 'factory_bot'
|
||||||
|
|
|
@ -468,6 +468,7 @@ GEM
|
||||||
thor (>= 0.19.0, < 2.0)
|
thor (>= 0.19.0, < 2.0)
|
||||||
rainbow (3.0.0)
|
rainbow (3.0.0)
|
||||||
rake (12.3.1)
|
rake (12.3.1)
|
||||||
|
rake-progressbar (0.0.5)
|
||||||
rb-fsevent (0.10.3)
|
rb-fsevent (0.10.3)
|
||||||
rb-inotify (0.9.10)
|
rb-inotify (0.9.10)
|
||||||
ffi (>= 0.5.0, < 2)
|
ffi (>= 0.5.0, < 2)
|
||||||
|
@ -718,6 +719,7 @@ DEPENDENCIES
|
||||||
rails
|
rails
|
||||||
rails-controller-testing
|
rails-controller-testing
|
||||||
rails-i18n
|
rails-i18n
|
||||||
|
rake-progressbar
|
||||||
rbnacl-libsodium
|
rbnacl-libsodium
|
||||||
rest-client
|
rest-client
|
||||||
rgeo-geojson
|
rgeo-geojson
|
||||||
|
|
|
@ -30,7 +30,6 @@ class ApplicationController < ActionController::Base
|
||||||
service = RenderPartialService.new(controller, method)
|
service = RenderPartialService.new(controller, method)
|
||||||
@navbar_url = service.navbar
|
@navbar_url = service.navbar
|
||||||
@left_pannel_url = service.left_panel
|
@left_pannel_url = service.left_panel
|
||||||
@facade_data_view = nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def logged_in?
|
def logged_in?
|
||||||
|
|
|
@ -22,7 +22,7 @@ module Manager
|
||||||
procedure = Procedure.find(params[:id])
|
procedure = Procedure.find(params[:id])
|
||||||
procedure.hide!
|
procedure.hide!
|
||||||
flash[:notice] = "La démarche a bien été supprimée, en cas d'erreur contactez un développeur."
|
flash[:notice] = "La démarche a bien été supprimée, en cas d'erreur contactez un développeur."
|
||||||
redirect_to manager_procedure_path(procedure)
|
redirect_to manager_procedures_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,4 @@
|
||||||
\-
|
\-
|
||||||
= link_to 'CGU / Mentions légales', CGU_URL
|
= link_to 'CGU / Mentions légales', CGU_URL
|
||||||
\-
|
\-
|
||||||
- if @facade.present? && @facade.respond_to?(:dossier)
|
|
||||||
= contact_link 'Contact', dossier_id: @facade.dossier&.id
|
|
||||||
- else
|
|
||||||
= contact_link 'Contact'
|
= contact_link 'Contact'
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
- content_for(:title, "Dossier bien envoyé (#{@dossier.procedure.libelle})")
|
- content_for(:title, "Dossier bien envoyé (#{@dossier.procedure.libelle})")
|
||||||
|
|
||||||
|
- content_for :footer do
|
||||||
|
= render partial: "new_user/dossiers/dossier_footer", locals: { dossier: @dossier }
|
||||||
|
|
||||||
.merci
|
.merci
|
||||||
.container
|
.container
|
||||||
= image_tag('user/envoi-dossier.svg')
|
= image_tag('user/envoi-dossier.svg')
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
require 'rake-progressbar'
|
||||||
|
|
||||||
|
namespace :after_party do
|
||||||
|
desc 'Deployment task: fix_notifications_after_carto_migration'
|
||||||
|
task fix_notifications_after_carto_migration: :environment do
|
||||||
|
def fix_notifications(dossier)
|
||||||
|
updated_at = dossier.champs[1..-1].map(&:updated_at).max
|
||||||
|
champ_carte = dossier.champs.first
|
||||||
|
if updated_at && (!champ_carte.updated_at || champ_carte.updated_at > updated_at)
|
||||||
|
champ_carte.update_columns(updated_at: updated_at, created_at: updated_at)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
dossiers = Dossier.includes(:champs)
|
||||||
|
.joins(procedure: :module_api_carto)
|
||||||
|
.where(procedure: { module_api_cartos: { migrated: true } })
|
||||||
|
|
||||||
|
bar = RakeProgressbar.new(dossiers.count)
|
||||||
|
|
||||||
|
dossiers.find_each do |dossier|
|
||||||
|
fix_notifications(dossier)
|
||||||
|
bar.inc
|
||||||
|
end
|
||||||
|
bar.finished
|
||||||
|
|
||||||
|
AfterParty::TaskRecord.create version: '20181121153709'
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue