Skip to content

Org "Pending" badge: suppress once linked, surface on the link editor#1926

Merged
maebeale merged 1 commit into
mainfrom
maebeale/org-pending-badge
Jun 29, 2026
Merged

Org "Pending" badge: suppress once linked, surface on the link editor#1926
maebeale merged 1 commit into
mainfrom
maebeale/org-pending-badge

Conversation

@maebeale

Copy link
Copy Markdown
Collaborator

🤖 PR, suggested 👤 review level: 👀 Skim — view-only: two ERB views + specs, no logic/data changes

What is the goal of this PR and why is this important?

  • The registrants roster's org "Pending" chip currently shows whenever a registrant's submitted org name doesn't match a linked org — even after an admin has linked one. That's noise: once an admin links any org, they've made the call.
  • Now the chip shows only while nothing is linked. A non-matching submitted name on an already-linked registration is no longer flagged.
  • For continuity, the link-organization editor shows the same amber "Pending" badge next to the submitted org name (while nothing is linked), so when you click through it's clear why the registrant was flagged.

How did you approach the change?

  • Roster (_registrants_results.html.erb): needs_linking now keys off linked_orgs.none? instead of comparing the submitted name against linked names.
  • Editor (link_organization.html.erb): amber "Pending" badge in the "Registration form submission" section, shown only when @linked_organizations.none?.
  • Updated the roster chip spec to the new behavior; added editor specs (badge present with no link, absent once linked).

Anything else to add?

The roster's "Pending" org chip now shows only while a registrant has no
linked organization — once an admin links any org they've made the call,
so a non-matching submitted name no longer reads as pending.

For continuity, the link-organization editor now shows the same amber
"Pending" badge next to the submitted org name while nothing is linked,
so it's clear why the registrant was flagged when you open it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
<%# A submitted org name needs admin attention only while nothing is linked
yet; once an admin links any org they've made the call, so a non-matching
submitted name is no longer treated as pending. %>
<% needs_linking = submitted_org_name.present? && linked_orgs.none? %>

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: The chip now keys off linked_orgs.none? rather than name-matching: once an admin has linked any org they've resolved it, so a different submitted name is no longer noise.

<% end %>
<div class="min-w-0">
<p class="text-base text-gray-800">Organization: <strong><%= entry[:org_name].presence || "—" %></strong><% if entry[:organization]&.city_state.present? %> <span class="text-sm text-gray-500">· <%= entry[:organization].city_state %></span><% end %></p>
<p class="text-base text-gray-800">Organization: <strong><%= entry[:org_name].presence || "—" %></strong><% if entry[:organization]&.city_state.present? %> <span class="text-sm text-gray-500">· <%= entry[:organization].city_state %></span><% end %><%# Mirror the roster's amber "Pending" chip so it's clear why this registrant was flagged — shown only while nothing is linked. %><% if entry[:org_name].present? && @linked_organizations.none? %> <span class="ml-1 inline-flex items-center gap-1 rounded-full border border-amber-200 bg-amber-50 px-2.5 py-0.5 text-xs font-medium text-amber-700" title="The registrant submitted this organization, but none is linked to the registration yet."><i class="fa-solid fa-circle-exclamation text-[0.65rem]"></i>Pending</span><% end %></p>

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: Same amber "Pending" badge as the roster, shown only while @linked_organizations.none?, so opening the editor explains why the registrant was flagged — and it disappears the moment something is linked.

@maebeale maebeale marked this pull request as ready for review June 29, 2026 11:50
@maebeale maebeale merged commit 102845a into main Jun 29, 2026
3 checks passed
@maebeale maebeale deleted the maebeale/org-pending-badge branch June 29, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant