Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 26, 2025

Blocked listings now display moderation context and provide users a path to appeal administrative actions.

Domain Changes

ItemListing entity:

  • Added blockReason and blockDescription optional fields
  • Added block() application service to set block metadata
  • Extended repository interface with getByListingId() for appeal request lookups

GraphQL API:

type ItemListing {
  blockReason: String
  blockDescription: String
  # ... existing fields
}

input BlockListingInput {
  id: ObjectID!
  blockReason: String!
  blockDescription: String!
}

mutation blockListing(input: BlockListingInput!): ItemListingMutationResult!
query getListingAppealRequestByListingId(listingId: ObjectID!): ListingAppealRequest

UI Components

BlockInformationModal:

  • Renders admin-provided block reason and description
  • Actions: Edit Listing, Appeal Block, Cancel
  • Disables appeal button if request already submitted

AppealConfirmationModal:

  • Confirms user intent before submitting appeal
  • Warns to update listing before appealing

ViewListing updates:

  • Red banner displays when listing.state === 'Blocked'
  • "View Details" button triggers block information modal
  • Banner updates to "Your appeal is awaiting approval" post-submission
  • Success alert shows after appeal submission

Security Notes

Placeholder TODOs added for:

  • Role-based authorization on blockListing mutation (admin-only)
  • Authentication checks on getListingAppealRequestByListingId query
  • Blocker ID tracking (currently uses placeholder value)
Original prompt

This section details on the original issue you should resolve

<issue_title>Listing - Appeal Blocked Listing</issue_title>
<issue_description>When a listing is marked as Blocked, the listing detail page should display a red banner at the top stating:
“This listing is blocked.”

When hitting "view details", a Block Information modal appears showing:

  • Reason (e.g., Profanity)
  • Description (admin explanation of the violation)

The modal includes the following actions:

  • Edit Listing – redirects to the edit form
  • Appeal Block – opens a confirmation modal
  • Cancel – closes the modal

The Appeal Confirmation modal displays a message and two buttons (shown in the picture below)

After the user submits an appeal, the banner updates to:
“This listing is blocked. Your appeal is awaiting approval.”

and a success message appears below:
“Appeal requested successfully.”

Functional Requirements:

  • Show the block info modal automatically when listing.status === 'Blocked'
  • Populate reason and description from backend response
  • Edit button navigates to the listing edit screen
  • Appeal button triggers confirmation modal
  • Optionally disable “Appeal” if the listing hasn’t been updated since being blocked
  • After a successful appeal, update the listing banner and show a green success alert
Image Image Image Image

</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 30 commits December 8, 2025 15:43
Co-authored-by: rohit-r-kumar <175348946+rohit-r-kumar@users.noreply.github.com>
Co-authored-by: rohit-r-kumar <175348946+rohit-r-kumar@users.noreply.github.com>
Co-authored-by: rohit-r-kumar <175348946+rohit-r-kumar@users.noreply.github.com>
Co-authored-by: rohit-r-kumar <175348946+rohit-r-kumar@users.noreply.github.com>
…eters

Co-authored-by: rohit-r-kumar <175348946+rohit-r-kumar@users.noreply.github.com>
…pilot/add-block-unblock-listing-buttons-again
…tion or class'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Resolved sourcery-ai comments
…pilot/add-block-unblock-listing-buttons-again
Copilot AI and others added 5 commits December 26, 2025 14:40
… GraphQL schema

Co-authored-by: rohit-r-kumar <175348946+rohit-r-kumar@users.noreply.github.com>
Co-authored-by: rohit-r-kumar <175348946+rohit-r-kumar@users.noreply.github.com>
Co-authored-by: rohit-r-kumar <175348946+rohit-r-kumar@users.noreply.github.com>
Co-authored-by: rohit-r-kumar <175348946+rohit-r-kumar@users.noreply.github.com>
Co-authored-by: rohit-r-kumar <175348946+rohit-r-kumar@users.noreply.github.com>
Copilot AI changed the title [WIP] Add blocked listing appeal functionality Add appeal workflow for blocked listings Dec 26, 2025
Copilot AI requested a review from rohit-r-kumar December 26, 2025 15:04

const handleBlockConfirm = async () => {
if (onBlockListing !== null) {
await (onBlockListing as () => Promise<void>)();

const handleUnblockConfirm = async () => {
if (onUnblockListing !== null) {
await (onUnblockListing as () => Promise<void>)();
const isBlocked = true;
const isAdmin = false;

const opacity = isBlocked && !isAdmin ? 0.5 : 1;
const isBlocked = true;
const isAdmin = true;

const opacity = isBlocked && !isAdmin ? 0.5 : 1;
const isBlocked = true;
const isAdmin = false;

const pointerEvents = isBlocked && !isAdmin ? 'none' : 'auto';
const isBlocked = true;
const isAdmin = true;

const pointerEvents = isBlocked && !isAdmin ? 'none' : 'auto';
const isBlocked = true;
const isAdmin = false;

const opacity = isBlocked && !isAdmin ? 0.5 : 1;
const isAdmin = false;

const opacity = isBlocked && !isAdmin ? 0.5 : 1;
const pointerEvents = isBlocked && !isAdmin ? 'none' : 'auto';
const isBlocked = true;
const isAdmin = true;

const opacity = isBlocked && !isAdmin ? 0.5 : 1;
const isAdmin = true;

const opacity = isBlocked && !isAdmin ? 0.5 : 1;
const pointerEvents = isBlocked && !isAdmin ? 'none' : 'auto';
Rohit Kumar added 2 commits January 2, 2026 23:15
…apters

Instead of throwing TypeError when user, listing, or blocker fields are
unpopulated ObjectIds, return a simple entity reference with just the ID.
This matches the behavior in other domain adapters like Conversation and
allows GraphQL resolvers to properly handle the mutation response.

Fixes: 'Failed to submit appeal request: user is not populated' error
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.

Listing - Appeal Blocked Listing

2 participants