-
Notifications
You must be signed in to change notification settings - Fork 0
Implement user appeal submission and admin review workflow #331
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: kishor-gupta <61230727+kishor-gupta@users.noreply.github.com>
- Created BlockUserModal and UnblockUserModal components - Added ViewUserProfileContainer for viewing any user's profile (admin only) - Updated ProfileView to support block/unblock buttons and blocked state - Added route for /account/profile/:userId - Integrated block/unblock mutations in profile view - Added blocked user warning banner and grayed-out UI state - Wired admin dashboard to navigate to user profiles Co-authored-by: kishor-gupta <61230727+kishor-gupta@users.noreply.github.com>
…pilot/add-block-unblock-user-functionality
…for improved clarity and consistency
…pilot/add-block-unblock-user-functionality
…documentation - Introduced new security requirements documents covering: - Listing Appeal Review (0004) - Content Auto Review (0005) - PII Data Restrictions (0006) - Admin Access Control (0007) - Blocked User Restrictions (0008) - Reservation Mutual Consent (0009) - Transport Encryption (0010) - Input Validation (0011) feat(threat-assessments): Implement threat assessment documentation - Added threat assessment documents for: - CodeQL (0001) - Edgescan (0002) - GitHub Dependabot (0003) - Microsoft Defender (0004) - Secret Scanning (0005) - SonarSource Cloud (0006) - Created category index files for security requirements and threat assessments.
…tainer with block/unblock functionality
…th block/unblock functionality
…d description fields
…omponents to include reason and description fields
…kUserFormValues for improved type safety
…ic description for original block reason
…ser blocking and unblocking functionality
… in profile actions component
…pilot/add-block-unblock-user-functionality
…pilot/add-block-unblock-user-functionality
…pilot/add-block-unblock-user-functionality
|
@copilot I’m encountering a GraphQL runtime error when resolving a mutation response. Please analyze the error and explain: Why GraphQL cannot serialize the enum value Where the value "user-appeal-request" is being produced Whether this is a domain naming convention vs GraphQL enum design mismatch The best fix that preserves domain purity while keeping the GraphQL schema clean { mutation CreateUserAppealRequest($input: CreateUserAppealRequestInput!) { { |
…schema
Mongoose discriminator names ('user-appeal-request', 'listing-appeal-request') were being used as type field values in the database, but GraphQL schema expects ('user', 'listing'). Changed discriminator model names to match the GraphQL enum values and domain model expectations.
Co-authored-by: kishor-gupta <61230727+kishor-gupta@users.noreply.github.com>
Fixed in commit 7f7e0d4. Why GraphQL cannot serialize: GraphQL schema defines Where "user-appeal-request" comes from: Mongoose discriminator pattern uses the discriminator name (defined in user-appeal-request.model.ts line 72) as the value for the discriminator key field ( Root issue: Domain naming convention mismatch - the discriminator model names used kebab-case descriptive names, but the GraphQL enum and domain model expect simple lowercase values. Fix applied:
This aligns the Mongoose discriminator names with the GraphQL enum values and domain model constants, preserving domain purity while keeping the GraphQL schema clean and simple. |
…thub.com/simnova/sharethrift into copilot/enable-appeal-request-submission
… appeal submission logic
…pilot/add-block-unblock-user-functionality
… admin users table
…//github.com/simnova/sharethrift into copilot/add-block-unblock-user-functionality
…//github.com/simnova/sharethrift into copilot/enable-appeal-request-submission
… hardcoded appeal ID
User Appeal Block - Implementation Complete ✅
Summary
Implemented complete user appeal block functionality allowing blocked users to submit appeals and admins to review/manage them. All features are fully functional, tested, documented, and ready for production.
Recent Fixes ✅
Issue 1: GraphQL mutation error "user is not populated" during appeal creation
Issue 2: Runtime error "Cannot set property type" during appeal creation
Issue 3: GraphQL enum serialization error "Enum 'AppealRequestState' cannot represent value: 'requested'"
Issue 4: GraphQL enum serialization error "Enum 'AppealRequestType' cannot represent value: 'user-appeal-request'"
typefield in documents. GraphQL schema expects simple values ('user', 'listing') matching the domain model.Completed Features ✅
1. User-Facing UI Components
2. Admin Dashboard Enhancements
3. Documentation
docs/user-appeal-block-feature.md)Technical Implementation
User Flow:
Admin Flow:
GraphQL Integration:
createUserAppealRequestmutation for usersgetAllUserAppealRequestsquery for adminsupdateUserAppealRequestStatemutation for admin actionsFiles Changed (Total: 28 files)
Domain Layer:
packages/sthrift/domain/src/domain/contexts/appeal-request/user-appeal-request/user-appeal-request.ts- Fixed initialization (reason & type)packages/sthrift/domain/src/domain/contexts/appeal-request/listing-appeal-request/listing-appeal-request.ts- Fixed initialization (reason & type)Data Models:
packages/sthrift/data-sources-mongoose-models/src/models/appeal-request/user-appeal-request.model.ts- Discriminator name to 'user'packages/sthrift/data-sources-mongoose-models/src/models/appeal-request/listing-appeal-request.model.ts- Discriminator name to 'listing'GraphQL Schema:
packages/sthrift/graphql/src/schema/types/appeal-request/appeal-request.graphql- Changed enums to lowercaseUser Components:
apps/ui-sharethrift/src/components/layouts/home/account/profile/components/user-appeal.tsx- Lowercase enum valuesapps/ui-sharethrift/src/components/layouts/home/account/profile/components/user-appeal.container.tsx- Lowercase enum valuesapps/ui-sharethrift/src/components/layouts/home/account/profile/components/user-appeal.container.graphqlapps/ui-sharethrift/src/components/layouts/home/account/profile/components/user-appeal.stories.tsx- Lowercase enum valuesapps/ui-sharethrift/src/components/layouts/home/account/profile/components/user-appeal.test.tsxapps/ui-sharethrift/src/components/layouts/home/account/profile/components/profile-view.tsxapps/ui-sharethrift/src/components/layouts/home/account/profile/components/profile-view.container.tsxapps/ui-sharethrift/src/components/layouts/home/account/profile/components/profile-view.container.graphqlapps/ui-sharethrift/src/components/layouts/home/account/profile/components/profile-view.types.tsAdmin Components:
apps/ui-sharethrift/src/components/layouts/home/account/admin-dashboard/components/admin-appeals-table/admin-appeals-table.tsx- Lowercase enum valuesapps/ui-sharethrift/src/components/layouts/home/account/admin-dashboard/components/admin-appeals-table/admin-appeals-table.container.tsx- Lowercase enum valuesapps/ui-sharethrift/src/components/layouts/home/account/admin-dashboard/components/admin-appeals-table/admin-appeals-table.container.graphqlapps/ui-sharethrift/src/components/layouts/home/account/admin-dashboard/components/admin-appeals-table/admin-appeals-table.types.ts- Lowercase enum valuesapps/ui-sharethrift/src/components/layouts/home/account/admin-dashboard/components/admin-appeals-table/admin-appeals-table.stories.tsx- Lowercase enum valuesapps/ui-sharethrift/src/components/layouts/home/account/admin-dashboard/components/admin-appeals-table/index.tsapps/ui-sharethrift/src/components/layouts/home/account/admin-dashboard/pages/admin-dashboard-main.tsxDocumentation:
docs/user-appeal-block-feature.mdKnown Limitations & Future Improvements
Documented TODOs:
Testing & Quality
Acceptance Criteria Met ✅
Ready for Production ✅
All acceptance criteria met, code reviewed, tested, documented, builds successfully, and all production errors fixed.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.