Skip to content

Experiment: Use Claude to migrate Orgs #248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

Conversation

dauglyon
Copy link
Collaborator

@dauglyon dauglyon commented Jun 24, 2025

Required a good amount of supervision but it's FAST. Accidentally used my usage-billed account for the first few commits, which was about $5

dauglyon and others added 6 commits June 23, 2025 20:55
Migrate core organizations functionality from legacy plugin to modern UI:
- Implement organization browsing with search, filtering, and sorting
- Add create organization form with validation and privacy controls
- Create organization detail view with tabbed interface for members, narratives, and apps
- Set up comprehensive RTK Query API for organizations service
- Add routing support for /orgs, /orgs/new, and /orgs/:orgId paths
- Maintain backwards compatibility with existing LinkOrg component

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Changed orgsApi to export endpoints instead of hooks for consistency
- Updated all organization components to use endpoint.useQuery() pattern
- Converted CreateOrganization form to use react-hook-form with Controller
- Added comprehensive form validation with react-hook-form rules
- Replaced @mui/icons-material with FontAwesome icons
- Fixed TypeScript validation function types for react-hook-form

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Change listOrganizations from POST /organizations/query to GET /group with query params
- Add transformResponse to convert Groups service response format to expected interface
- Fix getOrganization to handle Groups service detailed response structure
- Add proper TypeScript interfaces for Groups service response formats
- Map Groups service User 'name' field to both 'username' and 'realname'
- Convert epoch timestamps to ISO strings and handle custom fields properly

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…name to groupsApi

- Remove transformResponse functions from all endpoints to use raw Groups service data directly
- Rename orgsApi.ts to groupsApi.ts for better accuracy
- Update all imports across the application to use groupsApi instead of orgsApi
- Simplify API interfaces by removing unused types (BriefOrganization, Organization, Member, etc.)
- Improve naming conventions throughout: orgsApi → groupsApi, GroupsServiceResponse → Group
- Update UI components to work with raw Groups service field names (e.g., memcount, rescount, custom.logourl)
- Maintain backwards compatibility with legacy exports for existing functionality
- Fix parameter names: orgId → groupId for consistency
- Clean up unused interfaces and improve type definitions

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Replace @mui/icons-material imports with @fortawesome/react-fontawesome
- Use faUserPlus for user addition icons
- Use faTimes for cancel actions
- Remove unused icon imports
- Ensures TypeScript compilation passes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@dauglyon dauglyon requested review from briehl and dakotablair June 24, 2025 19:09
dauglyon and others added 3 commits June 24, 2025 12:12
- Create EditOrganizationDialog component with form validation:
  - Organization name, logo URL, home URL fields
  - Research interests and description text areas
  - Privacy setting checkbox with explanation
  - URL validation for optional fields
  - Form dirty state detection for save button
  - Loading states and error handling

- Integrate edit dialog with OrganizationDetail component:
  - Add Edit Organization button for admins/owners
  - Wire up dialog open/close state management
  - Pass organization data to dialog form

- Follow existing patterns from CreateOrganization component:
  - Use react-hook-form with Material-UI components
  - Consistent validation rules and error messages
  - Similar field layout and styling
  - Proper TypeScript types with UpdateGroupInput

- Use updateGroup API endpoint with organization ID and changes
- Auto-close dialog on successful update
- Disable save button when no changes made

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Create InviteMemberDialog component with comprehensive invitation features:
  - Username validation with duplicate member checking
  - Role selection (member/admin) with explanations
  - Optional personal message field
  - Success feedback with auto-close
  - Form validation and error handling

- Create RemoveMemberDialog component with safety measures:
  - Confirmation dialog with impact warnings
  - Prevent removal of organization owner
  - Warning for last admin removal
  - List of consequences for member removal
  - Support for both admin and member removal

- Create MemberManagementActions component for unified member operations:
  - Context menu with invite, promote, demote, remove actions
  - Role-based permission checks (Owner vs Admin capabilities)
  - Integration with existing API endpoints
  - Proper error handling for all operations

- Integrate member management into OrganizationDetail:
  - Wire up "Invite Users" button to InviteMemberDialog
  - Add management actions menu to each member list item
  - Support member role changes (promote/demote)
  - Maintain existing member list layout and styling

- Use existing API endpoints: inviteUser, removeMember, memberToAdmin, adminToMember
- Follow Material-UI design patterns with FontAwesome icons
- Implement proper TypeScript types and form validation
- Add comprehensive user feedback and safety checks

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Update LeftNavBar.tsx to point "Orgs" navigation link from /legacy/orgs to /orgs
- This makes the new organizations feature accessible to users
- Verified existing routes in Routes.tsx are already configured correctly for /orgs paths
- No other legacy org references needed updating (other references are to different services)

This completes the migration of organizations functionality from the legacy plugin
to the modern React application. Users can now access:
- Browse organizations (/orgs)
- Create organizations (/orgs/new)
- Organization details with full management (/orgs/:orgId)
- Request management, member management, organization editing

All high-priority migration tasks are now complete.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <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