Skip to content

Commit

Permalink
Apply review suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
aminedhobb committed Feb 3, 2025
1 parent ace1979 commit 3968919
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
8 changes: 8 additions & 0 deletions app/helpers/users_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ def rdv_solidarites_agent_searches_url(
"agent_searches?#{params.to_query}"
end

def structure_rdv_solidarites_url(structure)
if structure.is_a?(Department)
"#{ENV['RDV_SOLIDARITES_URL']}/admin/organisations"
else
structure.rdv_solidarites_url
end
end

def show_parcours?(department, organisation)
return policy(department).parcours? if department_level?

Expand Down
4 changes: 0 additions & 4 deletions app/models/department.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@ class Department < ApplicationRecord
def name_with_region
"#{name}, #{region}"
end

def rdv_solidarites_url
"#{ENV['RDV_SOLIDARITES_URL']}/admin/organisations"
end
end
2 changes: 1 addition & 1 deletion app/views/users/_users_list_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
</h4>

<div class="mt-2">
<%= link_to(current_structure.rdv_solidarites_url, target: "_blank", **with_rdv_solidarites_impersonation_warning(current_structure.rdv_solidarites_url)) do %>
<%= link_to(structure_rdv_solidarites_url(current_structure), target: "_blank", **with_rdv_solidarites_impersonation_warning(structure_rdv_solidarites_url(current_structure))) do %>
<button class="btn btn-blue">Voir sur RDV-Solidarités<i class="ri-external-link-line ms-1"></i></button>
<% end %>
</div>
Expand Down

0 comments on commit 3968919

Please sign in to comment.