Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/views/people/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -132,30 +132,30 @@
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div>
<h2 class="text-lg font-semibold text-gray-800 mb-3">Primary sector</h2>
<% if primary_sector_items.any? || other_service_areas.any? %>
<% if primary_sector_items.any? %>
<div class="flex flex-wrap gap-2">
<% primary_sector_items.each do |si| %>
<%= render "sectors/tagging_label",
sector: si.sector,
display_leader: true,
is_leader: si.is_leader %>
<% end %>
<%= render "people/other_responses", responses: other_service_areas %>
</div>
<% else %>
<p class="text-gray-500 italic">None selected.</p>
<% end %>
</div>
<div>
<h2 class="text-lg font-semibold text-gray-800 mb-3">Additional sectors</h2>
<% if additional_sector_items.any? %>
<% if additional_sector_items.any? || other_service_areas.any? %>
<div class="flex flex-wrap gap-2">
<% additional_sector_items.each do |si| %>
<%= render "sectors/tagging_label",
sector: si.sector,
display_leader: true,
is_leader: si.is_leader %>
<% end %>
<%= render "people/other_responses", responses: other_service_areas %>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 From Claude: Moved the read-only "Other" chips here from the Primary sector column — a free-text "Other" answer isn't a concrete sector, so it reads as an additional sector. The section's guard now also fires on other_service_areas.any? so a profile with only an "Other" answer still renders.

</div>
<% else %>
<p class="text-gray-500 italic">None selected.</p>
Expand Down
5 changes: 4 additions & 1 deletion db/seeds/dev/events_management.rb
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,10 @@
# answered on a submission, and only enriches people who have a submission (so the
# "registered but didn't fill the form" scenarios stay answer-free).
age_range_categories = Category.age_ranges.published.order(:position, :name).to_a
service_area_sectors = Sector.published.order(:name).to_a
# Exclude the catch-all "Other" sector: it's the free-text fallback registrants
# type into (surfaced via Person#other_service_area_responses), not a selectable
# service area. Seeding it as a sector tag would list "Other" as a real service area.
service_area_sectors = Sector.published.excluding_other.order(:name).to_a

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 From Claude: Excludes the catch-all "Other" sector from seeded service-area tags using main's new Sector.excluding_other scope, so dev data never lists "Other" as a real service area — it should only appear as a free-text answer (Amy's seeded demo).


record_professional_answers = ->(submission, i) do
person = submission.person
Expand Down
5 changes: 4 additions & 1 deletion spec/requests/people_other_responses_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ def answer(identifier, value)
before { sign_in admin }

describe "profile page" do
it "shows the Other service area beside the sector tags" do
it "shows the Other service area as an additional sector" do
person.update!(profile_show_sectors: true)
answer("primary_service_area", "Other: Equine therapy")

get person_path(person)

expect(response.body).to include("Equine therapy")
# The Other chip sits in the "Additional sectors" column, not "Primary sector".
additional_section = response.body.split("Additional sectors").last
expect(additional_section).to include("Equine therapy")
end
end

Expand Down