Skip to content

Commit

Permalink
improve subtitle of authorization
Browse files Browse the repository at this point in the history
  • Loading branch information
JeSuisUnCaillou committed Jan 20, 2025
1 parent 5186fc2 commit 19cc8f4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/models/authorization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Authorization < ApplicationRecord
inverse_of: :authorization,
dependent: :destroy

has_many :authorization_request_event,
has_many :authorization_request_events,
as: :entity,
dependent: :nullify

Expand Down Expand Up @@ -69,7 +69,7 @@ def definition
end

def approving_instructor
authorization_request_event
authorization_request_events
.where(name: 'approve')
.order(created_at: :desc)
.first
Expand Down
6 changes: 3 additions & 3 deletions app/views/authorization_request_forms/build/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@

<% if @authorization && policy([:instruction, @authorization_request]).show? %>
<div class="fr-pb-2w fr-pl-1w">
Cette habilitation a été validée
Cette habilitation est liée à la <%= link_to "demande N°#{@authorization_request.id}", instruction_authorization_request_authorizations_path(@authorization_request), class: 'fr-link' %>
<% if @authorization.approving_instructor %>
par
et a été validée par
<strong><%=@authorization.approving_instructor.email%></strong>
<% end %>
durant la <%= link_to "demande N°#{@authorization_request.id}", instruction_authorization_request_authorizations_path(@authorization_request), class: 'fr-link' %>

</div>
<% end %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion features/instructeurs/consultation_habilitation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Fonctionnalité: Instruction: consultation d'une demande d'habilitation
Quand je me rends sur une demande d'habilitation "API Entreprise" validée
Et que je clique sur "Toutes les habilitations"
Et que je clique sur "Consulter l'habilitation"
Alors la page contient "Cette habilitation a été délivrée suite à la demande N°"
Alors la page contient "Cette habilitation est liée à la demande N°"
Et que je clique sur "demande N°"
Alors la page contient "Toutes les habilitations"

Expand Down

0 comments on commit 19cc8f4

Please sign in to comment.