Skip to content

Vouch-gated role application on join page#145

Open
hudsonhrh wants to merge 1 commit intomainfrom
hudsonhrh/vouch-role-apply
Open

Vouch-gated role application on join page#145
hudsonhrh wants to merge 1 commit intomainfrom
hudsonhrh/vouch-role-apply

Conversation

@hudsonhrh
Copy link
Copy Markdown
Member

Summary

Detect when all organization roles require vouching and integrate role application into the join flow. Users now select a role, fill out an application (why they want it, relevant experience), join the org, and apply for the role in a single coherent experience.

Changes

  • RoleApplicationForm: New reusable component with role selector, notes (required), and experience (optional) fields
  • Join page detection: Reads org roles via useOrgStructure; when all roles have vouchingEnabled=true and defaultEligible=false, switches to "Apply & Join" flow
  • handleApplyAndJoin handler: Joins via quickJoin, then applies via applyForRole (IPFS upload + contract call)
  • Loading guard: Shows spinner while org data fetches to prevent UI flashing
  • Auto-select: Single-role orgs auto-select the role on first render
  • Backward compatible: Existing join flow unchanged when roles are freely claimable

Testing

  1. Deploy org with all roles requiring vouching
  2. Visit /user/?userDAO=<orgName> → "Apply to Join" messaging appears
  3. Authenticate → role selector + application form shown
  4. Fill form → click "Apply & Join" → verify join + application both succeed
  5. Verify application appears in org-structure VouchingSection for members to vouch
  6. Test org with freely claimable roles → existing join flow unchanged

…n flow

When all roles require vouching (vouchingEnabled=true, defaultEligible=false), the join page now detects this and presents an integrated "Apply & Join" flow instead of a generic join. Users select a role, fill out an application (why they want it, relevant experience), join the org, and apply for the role in a single coherent flow.

- New RoleApplicationForm component: inline form with role selector, notes (required), and experience (optional) fields
- Vouch detection: useOrgStructure hooks to fetch org roles and eligibilityModuleAddress
- handleApplyAndJoin: joins via quickJoin, then applies via applyForRole with IPFS upload
- Loading guard while org data fetches to avoid UI flashing
- Auto-selects role when only one exists
- Existing join flow unchanged when roles are freely claimable

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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