Skip to content

Commit

Permalink
Merge pull request #3323 from betagouv/debug-25-01-2024
Browse files Browse the repository at this point in the history
Debug 25 01 2024
  • Loading branch information
clairezed authored Jan 31, 2024
2 parents 97c268b + 34042ad commit cb71d9a
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ DEVELOPMENT_INLINE_JOBS=false
DEVELOPMENT_PREFILL_SOLICITATION_FORM=false
FEATURE_SEND_RETENTION_EMAILS=false
FEATURE_SEND_SATISFACTION_EMAILS=false
FEATURE_HEAVY_CRON_DISABLED=false

IP_INFO_KEY=
IP_OVERRIDE=5.188.92.0
Expand Down
4 changes: 4 additions & 0 deletions app/admin/duplicate_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

page_action :duplicate, method: :post do
old_user = User.find(params[:user_id])
if old_user.deleted?
flash[:alert] = I18n.t('active_admin.duplicate_user.deleted_user')
redirect_to admin_users_path and return
end
user_params = params.require(:user).permit(:full_name, :email, :phone_number, :job, :specifics_territories)
new_user = old_user.duplicate(user_params)
if new_user.valid?
Expand Down
6 changes: 4 additions & 2 deletions app/admin/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@

sidebar I18n.t('active_admin.actions'), only: :show do
ul class: 'actions' do
li link_to t('annuaire.users.table.duplicate_user'), admin_user_duplicate_user_path(user), class: 'action'
li link_to t('annuaire.users.table.reassign_matches'), admin_user_reassign_matches_path(user), class: 'action'
unless resource.deleted?
li link_to t('annuaire.users.table.duplicate_user'), admin_user_duplicate_user_path(user), class: 'action'
li link_to t('annuaire.users.table.reassign_matches'), admin_user_reassign_matches_path(user), class: 'action'
end
li link_to t('active_admin.person.normalize_values'), normalize_values_admin_user_path(user), class: 'action'
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/clockwork.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module Clockwork
every(1.day, 'relaunch_solicitations', at: ('12:00'), tz: 'UTC') do
CompanyEmails::SolicitationsRelaunchJob.perform_later
end
if Rails.env == 'production'
if Rails.env == 'production' && !ENV['FEATURE_HEAVY_CRON_DISABLED'].to_b
every(1.day, 'generate_quarterly_reports', at: '01:00', if: -> (t) { t.day == 20 && (t.month == 1 || t.month == 4 || t.month == 7 || t.month == 10) }, tz: 'UTC') do
QuarterlyReports::FindAntennesJob.perform_later
end
Expand Down
4 changes: 3 additions & 1 deletion app/views/landings/landings/home.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
.fr-col-12.fr-col-md-5#col-image
= image_tag('home.png', alt: "")

.fr-container-fluid.section-grey.fr-py-4w.home.landing
.fr-container-fluid.section-grey.fr-py-7w.home.landing
.fr-container
- unless in_iframe?
- @landing_emphasis.each do |landing|
Expand All @@ -32,6 +32,8 @@
= simple_format(landing.home_description, { class: 'fr-m-0' }, wrapper_tag: 'p')
.fr-col-md-3.fr-col-12.display-flex-center
= link_to t('.discover_measures'), landing, class: 'fr-btn fr-btn--secondary'
- unless in_iframe?
#scroll-section
= render 'multiple_steps', landing_themes: @landing_themes, landing: @landing

.fr-container-fluid.section-partners.fr-py-7w.section-light-grey
Expand Down
2 changes: 1 addition & 1 deletion config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ fr:
cancel_solicitation_with_email: La sollicitation ne peut pas être mise à jour (solicitation ou type d'email invalide)
contact: Contactez-nous
format: "%{attribute} %{message}"
homepage: Page d’accuei
homepage: Page d’accueil
manager_without_managed_antennes: Une antenne doit être attribuée à ce responsable d'antenne
messages:
accepted: doit être accepté(e)
Expand Down
2 changes: 0 additions & 2 deletions config/locales/models.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ fr:
deleted: Antennes supprimées avec succès
stats_reports: Rapports statistiques
territorial_antennes: 'Antennes du territoire : '
duplicate_user:
new_user_details: Coordonnées du nouvel utilisateur
expert:
deep_soft_delete: Supprimer l’expert et ses utilisateurs
deep_soft_delete_confirmation: Voulez-vous supprimer cet expert et tous ses utilisateurs ?
Expand Down
2 changes: 2 additions & 0 deletions config/locales/views.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ fr:
csv_export: Export CSV
csv_export_launched: La génération du CSV a commencé, retrouvez-le dans quelques minutes dans votre espace personnel.
duplicate_user:
deleted_user: Cet utilisateur a été supprimé, cette action n'est donc pas possible
new_user_details: Coordonnées du nouvel utilisateur
title: Dupliquer un utilisateur
reassign_matches:
title: Transférer les mises en relation
Expand Down

0 comments on commit cb71d9a

Please sign in to comment.