commit
ee9c47571f
11 changed files with 33 additions and 20 deletions
1
.github/dependabot.yml
vendored
1
.github/dependabot.yml
vendored
|
@ -5,6 +5,7 @@ version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: "bundler"
|
- package-ecosystem: "bundler"
|
||||||
directory: "/" # Location of package manifests
|
directory: "/" # Location of package manifests
|
||||||
|
open-pull-requests-limit: 0 # disabled for now
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
|
|
||||||
|
|
14
Gemfile.lock
14
Gemfile.lock
|
@ -237,13 +237,13 @@ GEM
|
||||||
ffi (1.13.1)
|
ffi (1.13.1)
|
||||||
ffi-geos (2.1.0)
|
ffi-geos (2.1.0)
|
||||||
ffi (>= 1.0.0)
|
ffi (>= 1.0.0)
|
||||||
flipper (0.18.0)
|
flipper (0.19.0)
|
||||||
flipper-active_record (0.18.0)
|
flipper-active_record (0.19.0)
|
||||||
activerecord (>= 5.0, < 7)
|
activerecord (>= 5.0, < 7)
|
||||||
flipper (~> 0.18.0)
|
flipper (~> 0.19.0)
|
||||||
flipper-ui (0.18.0)
|
flipper-ui (0.19.0)
|
||||||
erubi (>= 1.0.0, < 2.0.0)
|
erubi (>= 1.0.0, < 2.0.0)
|
||||||
flipper (~> 0.18.0)
|
flipper (~> 0.19.0)
|
||||||
rack (>= 1.4, < 3)
|
rack (>= 1.4, < 3)
|
||||||
rack-protection (>= 1.5.3, < 2.1.0)
|
rack-protection (>= 1.5.3, < 2.1.0)
|
||||||
fog-core (2.2.0)
|
fog-core (2.2.0)
|
||||||
|
@ -268,7 +268,7 @@ GEM
|
||||||
geocoder (1.6.3)
|
geocoder (1.6.3)
|
||||||
globalid (0.4.2)
|
globalid (0.4.2)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
gon (6.3.2)
|
gon (6.4.0)
|
||||||
actionpack (>= 3.0.20)
|
actionpack (>= 3.0.20)
|
||||||
i18n (>= 0.7)
|
i18n (>= 0.7)
|
||||||
multi_json
|
multi_json
|
||||||
|
@ -739,7 +739,7 @@ GEM
|
||||||
addressable (>= 2.3.6)
|
addressable (>= 2.3.6)
|
||||||
crack (>= 0.3.2)
|
crack (>= 0.3.2)
|
||||||
hashdiff (>= 0.4.0, < 2.0.0)
|
hashdiff (>= 0.4.0, < 2.0.0)
|
||||||
webpacker (5.1.1)
|
webpacker (5.2.1)
|
||||||
activesupport (>= 5.2)
|
activesupport (>= 5.2)
|
||||||
rack-proxy (>= 0.6.1)
|
rack-proxy (>= 0.6.1)
|
||||||
railties (>= 5.2)
|
railties (>= 5.2)
|
||||||
|
|
|
@ -15,12 +15,7 @@ class InvitesController < ApplicationController
|
||||||
)
|
)
|
||||||
|
|
||||||
if invite.valid?
|
if invite.valid?
|
||||||
if invite.user.present?
|
# The notification is sent through an after commit hook in order to avoir concurrency issues
|
||||||
InviteMailer.invite_user(invite).deliver_later
|
|
||||||
else
|
|
||||||
InviteMailer.invite_guest(invite).deliver_later
|
|
||||||
end
|
|
||||||
|
|
||||||
flash.notice = "Une invitation a été envoyée à #{invite.email}."
|
flash.notice = "Une invitation a été envoyée à #{invite.email}."
|
||||||
else
|
else
|
||||||
flash.alert = invite.errors.full_messages
|
flash.alert = invite.errors.full_messages
|
||||||
|
|
|
@ -54,6 +54,7 @@ module NewAdministrateur
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@procedure = current_administrateur.procedures.find(params[:id])
|
@procedure = current_administrateur.procedures.find(params[:id])
|
||||||
|
@current_administrateur = current_administrateur
|
||||||
if @procedure.brouillon?
|
if @procedure.brouillon?
|
||||||
@procedure_lien = commencer_test_url(path: @procedure.path)
|
@procedure_lien = commencer_test_url(path: @procedure.path)
|
||||||
else
|
else
|
||||||
|
|
|
@ -308,7 +308,7 @@ class Dossier < ApplicationRecord
|
||||||
|
|
||||||
after_save :send_dossier_received
|
after_save :send_dossier_received
|
||||||
after_save :send_web_hook
|
after_save :send_web_hook
|
||||||
after_create :send_draft_notification_email
|
after_create_commit :send_draft_notification_email
|
||||||
|
|
||||||
validates :user, presence: true
|
validates :user, presence: true
|
||||||
validates :individual, presence: true, if: -> { revision.procedure.for_individual? }
|
validates :individual, presence: true, if: -> { revision.procedure.for_individual? }
|
||||||
|
|
|
@ -19,6 +19,8 @@ class Invite < ApplicationRecord
|
||||||
|
|
||||||
before_validation -> { sanitize_email(:email) }
|
before_validation -> { sanitize_email(:email) }
|
||||||
|
|
||||||
|
after_create_commit :send_notification
|
||||||
|
|
||||||
validates :email, presence: true
|
validates :email, presence: true
|
||||||
validates :email, uniqueness: { scope: :dossier_id }
|
validates :email, uniqueness: { scope: :dossier_id }
|
||||||
|
|
||||||
|
@ -32,4 +34,12 @@ class Invite < ApplicationRecord
|
||||||
scope :kept, -> { joins(:dossier).merge(Dossier.kept) }
|
scope :kept, -> { joins(:dossier).merge(Dossier.kept) }
|
||||||
|
|
||||||
default_scope { kept }
|
default_scope { kept }
|
||||||
|
|
||||||
|
def send_notification
|
||||||
|
if self.user.present?
|
||||||
|
InviteMailer.invite_user(self).deliver_later
|
||||||
|
else
|
||||||
|
InviteMailer.invite_guest(self).deliver_later
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -73,9 +73,11 @@ class ProcedureExportService
|
||||||
{ instances: table.last, sheet_name: table.first }
|
{ instances: table.last, sheet_name: table.first }
|
||||||
end.merge(DEFAULT_STYLES)
|
end.merge(DEFAULT_STYLES)
|
||||||
|
|
||||||
# transliterate: convert to ASCII characteres
|
# transliterate: convert to ASCII characters
|
||||||
# to ensure truncate respects 30 bytes
|
# to ensure truncate respects 30 bytes
|
||||||
options[:sheet_name] = I18n.transliterate(options[:sheet_name], '')
|
# /\*?[] are invalid Excel worksheet characters
|
||||||
|
options[:sheet_name] = I18n.transliterate(options[:sheet_name], '', locale: :en)
|
||||||
|
.delete('/\*?[]')
|
||||||
.truncate(30, omission: '')
|
.truncate(30, omission: '')
|
||||||
|
|
||||||
options
|
options
|
||||||
|
|
|
@ -76,8 +76,8 @@
|
||||||
- else
|
- else
|
||||||
Choix du service administratif
|
Choix du service administratif
|
||||||
.card-admin-action
|
.card-admin-action
|
||||||
- if @procedure.service_id.present?
|
- if @procedure.service_id.blank? && current_administrateur.services.present?
|
||||||
= link_to 'Modifier', edit_admin_service_path(@procedure.service, procedure_id: @procedure.id), class: 'button'
|
= link_to 'Modifier', admin_services_path(procedure_id: @procedure.id), class: 'button'
|
||||||
- else
|
- else
|
||||||
= link_to 'Remplir', new_admin_service_path(procedure_id: @procedure.id), class: 'button'
|
= link_to 'Remplir', new_admin_service_path(procedure_id: @procedure.id), class: 'button'
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,10 @@
|
||||||
{ required: champ.mandatory? },
|
{ required: champ.mandatory? },
|
||||||
{ data: { secondary_options: champ.secondary_options } }
|
{ data: { secondary_options: champ.secondary_options } }
|
||||||
%span
|
%span
|
||||||
= form.label :secondary_value, "Valeur secondaire dépendant de la première", class: 'hidden'
|
= form.label :secondary_value, class: 'hidden' do
|
||||||
|
Valeur secondaire dépendant de la première
|
||||||
|
- if champ.mandatory?
|
||||||
|
%span.mandatory *
|
||||||
= form.select :secondary_value,
|
= form.select :secondary_value,
|
||||||
champ.secondary_options[champ.primary_value],
|
champ.secondary_options[champ.primary_value],
|
||||||
{ required: champ.mandatory? },
|
{ required: champ.mandatory? },
|
||||||
|
|
|
@ -359,7 +359,7 @@ describe ProcedureExportService do
|
||||||
context 'with long libelle composed of utf8 characteres' do
|
context 'with long libelle composed of utf8 characteres' do
|
||||||
before do
|
before do
|
||||||
procedure.types_de_champ.each do |c|
|
procedure.types_de_champ.each do |c|
|
||||||
c.update!(libelle: "#{c.id} - éééé ééé ééé ééééééé ééééééé ééééééé éééééééé. ééé éé éééééééé éé ééé. ééééé éééééééé ééé ééé.")
|
c.update!(libelle: "#{c.id} - ?/[] ééé ééé ééééééé ééééééé éééééééé. ééé éé éééééééé éé ééé. ééééé éééééééé ééé ééé.")
|
||||||
end
|
end
|
||||||
champ_repetition.champs.each do |c|
|
champ_repetition.champs.each do |c|
|
||||||
c.type_de_champ.update!(libelle: "#{c.id} - Quam rem nam maiores numquam dolorem nesciunt. Cum et possimus et aut. Fugit voluptas qui qui.")
|
c.type_de_champ.update!(libelle: "#{c.id} - Quam rem nam maiores numquam dolorem nesciunt. Cum et possimus et aut. Fugit voluptas qui qui.")
|
||||||
|
|
|
@ -5,6 +5,7 @@ describe 'new_administrateur/procedures/show.html.haml', type: :view do
|
||||||
before do
|
before do
|
||||||
assign(:procedure, procedure)
|
assign(:procedure, procedure)
|
||||||
assign(:procedure_lien, commencer_url(path: procedure.path))
|
assign(:procedure_lien, commencer_url(path: procedure.path))
|
||||||
|
allow(view).to receive(:current_administrateur).and_return(procedure.administrateurs.first)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'procedure is draft' do
|
describe 'procedure is draft' do
|
||||||
|
|
Loading…
Add table
Reference in a new issue