Skip to content

Profile fixes: shift signups for coordinators + Firefox edit buttons (#493, #495)#229

Open
peterdrier wants to merge 3 commits intomainfrom
sprint/20260415/batch-2
Open

Profile fixes: shift signups for coordinators + Firefox edit buttons (#493, #495)#229
peterdrier wants to merge 3 commits intomainfrom
sprint/20260415/batch-2

Conversation

@peterdrier
Copy link
Copy Markdown
Owner

Summary

Two profile-related fixes:

  • Show member shift signups on profile page to Volunteer Coordinators nobodies-collective/Humans#493 — Volunteer coordinators viewing another human's profile now see the ShiftSignups component (previously only visible on the admin detail view). Reuses the existing no-show-history gate (viewerIsCoordinator || ShiftRoleChecks.IsPrivilegedSignupApprover(User)) so the surface is consistent across both blocks. New CanViewShiftSignups flag on ProfileViewModel plus an @if block in Views/Profile/Index.cshtml.

  • Profile/Edit — language and burner CV add buttons don't respond to clicks (Firefox) nobodies-collective/Humans#495+ Add language and + Add entry (burner CV) buttons on /Profile/Me/Edit did nothing on click in Firefox 149. Root cause: every inline <script> block in Views/Profile/Edit.cshtml was missing the nonce="@Context.Items[\"CspNonce\"]" attribute, so the strict script-src policy from CspNonceMiddleware blocked them. The Google Maps loader inside the same file already calls m.querySelector(\"script[nonce]\")?.nonce to copy the page nonce onto its dynamically-injected tag — which only makes sense if the surrounding scripts were intended to carry the nonce. Added the nonce attribute to all eight inline scripts. CSS hover/pressed states still rendering was the giveaway: the page DOM was fine, only the JS handlers were dead.

Test plan

  • Sign in as a non-admin coordinator, visit another volunteer's /Profile/{id}, confirm the ShiftSignups card renders.
  • Sign in as a regular non-coordinator, visit another profile, confirm the card does NOT render.
  • Open /Profile/{id}/Admin as admin, confirm the existing AdminDetail view still shows signups (untouched).
  • In Firefox, open /Profile/Me/Edit, click + Add language and + Add entry, confirm new rows appear and remove buttons work.
  • In Chrome, repeat the same edit-page interactions, confirm nothing regressed and no new CSP violations in the console.

Closes nobodies-collective#493
Closes nobodies-collective#495

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

peterdrier and others added 3 commits April 15, 2026 04:08
- nobodies-collective#497: Catch OperationCanceledException in ProfileController.Picture
  and return 499 without logging when the client aborted.
- nobodies-collective#499: Drop LogWarning wrapping ValidationException from
  UserEmailService.AddEmailAsync; user-input validation is expected.
- nobodies-collective#500: Drop LogWarning wrapping "cannot delete shift with signups"
  in ShiftAdminController.DeleteShift; this is an expected guardrail.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Volunteer coordinators viewing another human's profile page now see
the ShiftSignups component, so they can review and manage that human's
signups without navigating to the admin view. Reuses the same gate as
the existing no-show history block (coordinator of any team or a
privileged signup approver).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
)

The eight inline <script> blocks in Views/Profile/Edit.cshtml were
missing nonce="@Context.Items[\"CspNonce\"]" attributes, so the strict
script-src CSP set by CspNonceMiddleware blocked them in standards-
compliant browsers (Firefox 149 reported by Ysalyne). The "+ Add
language" and "+ Add entry" buttons rely on those scripts to wire up
their click handlers, which is why the buttons appeared dead while CSS
hover/pressed states still worked.

The Google Maps loader script even calls
m.querySelector("script[nonce]")?.nonce to copy the page nonce onto
the dynamically-injected Maps script tag — which only makes sense if
the surrounding inline scripts were intended to carry the nonce in the
first place. Add it to all eight inline scripts so they execute under
the standard CSP policy.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coolify-nuc-humans
Copy link
Copy Markdown

coolify-nuc-humans bot commented Apr 15, 2026

The preview deployment for humans-qa is ready. 🟢

Open Preview | Open Build Logs | Open Application Logs

Last updated at: 2026-04-15 02:32:05 CET

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant