commit
4fccd25c28
11 changed files with 24 additions and 8 deletions
|
@ -777,7 +777,7 @@ Rails/SkipsModelValidations:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Rails/TimeZone:
|
Rails/TimeZone:
|
||||||
Enabled: true
|
EnforcedStyle: strict
|
||||||
|
|
||||||
Rails/UniqBeforePluck:
|
Rails/UniqBeforePluck:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
|
@ -8,7 +8,7 @@ class Administrateurs::ActivateController < ApplicationController
|
||||||
|
|
||||||
if @administrateur
|
if @administrateur
|
||||||
# the administrateur activates its account from an email
|
# the administrateur activates its account from an email
|
||||||
trust_device
|
trust_device(Time.zone.now)
|
||||||
else
|
else
|
||||||
flash.alert = "Le lien de validation d'administrateur a expiré, #{helpers.contact_link('contactez-nous', tags: 'lien expiré')} pour obtenir un nouveau lien."
|
flash.alert = "Le lien de validation d'administrateur a expiré, #{helpers.contact_link('contactez-nous', tags: 'lien expiré')} pour obtenir un nouveau lien."
|
||||||
redirect_to root_path
|
redirect_to root_path
|
||||||
|
|
|
@ -6,7 +6,7 @@ class Gestionnaires::ActivateController < ApplicationController
|
||||||
|
|
||||||
if @gestionnaire
|
if @gestionnaire
|
||||||
# the gestionnaire activates its account from an email
|
# the gestionnaire activates its account from an email
|
||||||
trust_device
|
trust_device(Time.zone.now)
|
||||||
else
|
else
|
||||||
flash.alert = "Le lien de validation du compte instructeur a expiré, #{helpers.contact_link('contactez-nous', tags: 'lien expiré')} pour obtenir un nouveau lien."
|
flash.alert = "Le lien de validation du compte instructeur a expiré, #{helpers.contact_link('contactez-nous', tags: 'lien expiré')} pour obtenir un nouveau lien."
|
||||||
redirect_to root_path
|
redirect_to root_path
|
||||||
|
|
|
@ -34,7 +34,7 @@ class Users::ConfirmationsController < Devise::ConfirmationsController
|
||||||
# Avoid keeping auto-sign-in links in users inboxes for too long.
|
# Avoid keeping auto-sign-in links in users inboxes for too long.
|
||||||
# 95% of users confirm their account within two hours.
|
# 95% of users confirm their account within two hours.
|
||||||
auto_sign_in_timeout = 2.hours
|
auto_sign_in_timeout = 2.hours
|
||||||
resource.confirmation_sent_at + auto_sign_in_timeout > DateTime.current
|
resource.confirmation_sent_at + auto_sign_in_timeout > Time.zone.now
|
||||||
end
|
end
|
||||||
|
|
||||||
# The path used after confirmation.
|
# The path used after confirmation.
|
||||||
|
|
|
@ -2,6 +2,6 @@ class DeletedDossier < ApplicationRecord
|
||||||
belongs_to :procedure
|
belongs_to :procedure
|
||||||
|
|
||||||
def self.create_from_dossier(dossier)
|
def self.create_from_dossier(dossier)
|
||||||
DeletedDossier.create!(dossier_id: dossier.id, procedure: dossier.procedure, state: dossier.state, deleted_at: Time.now.utc)
|
DeletedDossier.create!(dossier_id: dossier.id, procedure: dossier.procedure, state: dossier.state, deleted_at: Time.zone.now)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -456,7 +456,7 @@ class Procedure < ApplicationRecord
|
||||||
def percentile_time(start_attribute, end_attribute, p)
|
def percentile_time(start_attribute, end_attribute, p)
|
||||||
times = dossiers
|
times = dossiers
|
||||||
.state_termine
|
.state_termine
|
||||||
.where(end_attribute => 1.month.ago..DateTime.current)
|
.where(end_attribute => 1.month.ago..Time.zone.now)
|
||||||
.pluck(start_attribute, end_attribute)
|
.pluck(start_attribute, end_attribute)
|
||||||
.map { |(start_date, end_date)| end_date - start_date }
|
.map { |(start_date, end_date)| end_date - start_date }
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
.container
|
.container
|
||||||
|
- if dossier.en_construction_at.present?
|
||||||
|
.card
|
||||||
|
= render partial: "shared/dossiers/horodatage", locals: { dossier: dossier }
|
||||||
|
|
||||||
.tab-title Identité du demandeur
|
.tab-title Identité du demandeur
|
||||||
.card
|
.card
|
||||||
= render partial: "shared/dossiers/user_infos", locals: { user: dossier.user }
|
= render partial: "shared/dossiers/user_infos", locals: { user: dossier.user }
|
||||||
|
|
5
app/views/shared/dossiers/_horodatage.html.haml
Normal file
5
app/views/shared/dossiers/_horodatage.html.haml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
%table.table.vertical.dossier-champs
|
||||||
|
%tbody
|
||||||
|
%tr
|
||||||
|
%th.libelle Déposé le :
|
||||||
|
%td= l(dossier.en_construction_at, format: '%d %B %Y')
|
|
@ -60,7 +60,7 @@ class ProgressReport
|
||||||
|
|
||||||
def format_duration(seconds)
|
def format_duration(seconds)
|
||||||
if seconds.finite?
|
if seconds.finite?
|
||||||
Time.at(seconds).utc.strftime('%H:%M:%S')
|
Time.zone.at(seconds).strftime('%H:%M:%S')
|
||||||
else
|
else
|
||||||
'--:--:--'
|
'--:--:--'
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class AdministrateurMailerPreview < ActionMailer::Preview
|
class AdministrateurMailerPreview < ActionMailer::Preview
|
||||||
def activate_before_expiration
|
def activate_before_expiration
|
||||||
administrateur = Administrateur.new(reset_password_sent_at: Time.now.utc)
|
administrateur = Administrateur.new(reset_password_sent_at: Time.zone.now)
|
||||||
|
|
||||||
AdministrateurMailer.activate_before_expiration(administrateur, "a4d4e4f4b4d445")
|
AdministrateurMailer.activate_before_expiration(administrateur, "a4d4e4f4b4d445")
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,6 +16,7 @@ describe 'new_user/dossiers/demande.html.haml', type: :view do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'renders the dossier infos' do
|
it 'renders the dossier infos' do
|
||||||
|
expect(rendered).to have_text('Déposé le')
|
||||||
expect(rendered).to have_text('Identité')
|
expect(rendered).to have_text('Identité')
|
||||||
expect(rendered).to have_text('Demande')
|
expect(rendered).to have_text('Demande')
|
||||||
expect(rendered).to have_text('Pièces jointes')
|
expect(rendered).to have_text('Pièces jointes')
|
||||||
|
@ -29,4 +30,10 @@ describe 'new_user/dossiers/demande.html.haml', type: :view do
|
||||||
let(:dossier) { create(:dossier, :en_instruction, :with_entreprise, procedure: procedure) }
|
let(:dossier) { create(:dossier, :en_instruction, :with_entreprise, procedure: procedure) }
|
||||||
it { is_expected.not_to have_link('Modifier le dossier') }
|
it { is_expected.not_to have_link('Modifier le dossier') }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when the dossier has no en_construction_at date' do
|
||||||
|
let(:dossier) { create(:dossier, :with_entreprise, procedure: procedure) }
|
||||||
|
|
||||||
|
it { expect(rendered).not_to have_text('Déposé le') }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue