Skip to content

Commit

Permalink
Show callout in My Stuff if no Person is assigned to User
Browse files Browse the repository at this point in the history
  • Loading branch information
moveson committed Dec 17, 2024
1 parent f0eb33b commit 4508c20
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/presenters/my_stuff_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ def owned_organizations
Organization.where(created_by: current_user.id).order(:name)
end

def person_not_assigned?
Person.where(user_id: current_user.id).none?
end

def steward_organizations
current_user.organizations.where.not(created_by: current_user.id).order(:name)
end
Expand Down
14 changes: 14 additions & 0 deletions app/views/my_stuff/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@
</div>
</header>

<% if @presenter.person_not_assigned? %>
<aside class="container">
<%= render partial: "shared/callout_with_link",
locals: {
icon_name: "info-circle",
icon_color: "info",
callout_color: "info",
main_text: "Your User account is not yet linked to a Person",
detail_paragraphs: "If you are not seeing your results and service requirements here, it may be because your User account is not yet linked to a Person. Search for your name in the People view, then click on your name and click 'This is me' to link your User account to that Person.",
link: link_to("People search", people_path, class: "btn btn-outline-secondary")
} %>
</aside>
<% end %>

<article class="ost-article container">
<div class="row"
data-controller="masonry"
Expand Down

0 comments on commit 4508c20

Please sign in to comment.