Skip to content

feat(marketplace): duplicate listings into current course - #8479

Merged
LWS49 merged 1 commit into
lws49/feat-marketplace-pr1-foundationfrom
lws49/feat-marketplace-pr4-duplicate
Jul 30, 2026
Merged

feat(marketplace): duplicate listings into current course#8479
LWS49 merged 1 commit into
lws49/feat-marketplace-pr1-foundationfrom
lws49/feat-marketplace-pr4-duplicate

Conversation

@LWS49

@LWS49 LWS49 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator
  • add DuplicationJob: copies listings into a course tab, writes adoption
  • add bulk duplicate endpoint enqueuing the job for selected listings
  • add DuplicateConfirmation modal with row + bulk triggers, job polling
  • add MarketplaceAPI.duplicate and duplicateListings poll operation
  • serialize and assert live distinct-course adoption count in index

@LWS49
LWS49 force-pushed the lws49/feat-marketplace-pr4-duplicate branch from 0b7f44e to d84d375 Compare July 8, 2026 04:52
@LWS49
LWS49 force-pushed the lws49/feat-marketplace-pr3-page branch from 052b93c to 9169fa1 Compare July 17, 2026 08:09
@LWS49
LWS49 force-pushed the lws49/feat-marketplace-pr4-duplicate branch from d84d375 to 284c2bb Compare July 17, 2026 08:10
@LWS49
LWS49 force-pushed the lws49/feat-marketplace-pr3-page branch from 9169fa1 to e532cc2 Compare July 29, 2026 10:16
@LWS49
LWS49 force-pushed the lws49/feat-marketplace-pr4-duplicate branch from 284c2bb to 0ac76f3 Compare July 29, 2026 10:17
@LWS49
LWS49 force-pushed the lws49/feat-marketplace-pr3-page branch from e532cc2 to 97c5401 Compare July 29, 2026 10:28
@LWS49
LWS49 force-pushed the lws49/feat-marketplace-pr4-duplicate branch from 0ac76f3 to 56b15aa Compare July 29, 2026 10:29
@LWS49
LWS49 force-pushed the lws49/feat-marketplace-pr3-page branch from 97c5401 to 2e480cd Compare July 29, 2026 10:49
destination_course, third_course, copy, current_user: user
)
end.not_to change(Course::Assessment::Marketplace::Adoption, :count)
end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also add tests confirming the following logic:

  • once duplication of a marketplace-listed-assessment is done, the listing itself does not get duplicated (so the total number of listings should not change as adoptions take place)

  • if marketplace-listed-assessment is duplicated manually (e.g. as part of full / partial course duplication), it should follow the same logic steps (listing should not duplicate, adoption should be tracked)

@LWS49
LWS49 force-pushed the lws49/feat-marketplace-pr3-page branch 2 times, most recently from 9eccba7 to c1588e3 Compare July 29, 2026 11:40
Base automatically changed from lws49/feat-marketplace-pr3-page to lws49/feat-marketplace-pr1-foundation July 29, 2026 12:06
@LWS49
LWS49 force-pushed the lws49/feat-marketplace-pr4-duplicate branch from 56b15aa to f25dc28 Compare July 29, 2026 12:08
@adi-herwana-nus
adi-herwana-nus requested a review from Copilot July 29, 2026 13:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds end-to-end “duplicate from marketplace into the current course” functionality: a backend job + endpoint to duplicate selected marketplace listings into a destination course/tab while recording marketplace adoptions, and a frontend confirmation modal that triggers duplication and polls job completion.

Changes:

  • Introduces Course::Assessment::Marketplace::DuplicationJob and a POST #duplicate endpoint to enqueue duplication for selected published listings.
  • Records marketplace adoptions during object/course duplication flows and reports distinct-course adoption counts in marketplace listing index responses.
  • Adds a frontend confirmation modal + row-level trigger, API method, and operation to start duplication and poll job status.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
spec/jobs/course/assessment/marketplace/duplication_job_spec.rb Adds job specs covering duplication behavior, tab placement, and adoption recording.
spec/controllers/course/assessment/marketplace/listings_controller_spec.rb Adds controller specs for live adoption counts and duplicate endpoint enqueue/authorization.
lib/autoload/duplicator.rb Documents and exposes duplicated_objects for duplication bookkeeping.
client/locales/zh.json Adds i18n strings for duplication confirmation and status toasts.
client/locales/ko.json Adds i18n strings for duplication confirmation and status toasts.
client/locales/en.json Adds i18n strings for duplication confirmation and status toasts.
client/app/bundles/course/marketplace/translations.ts Registers new duplication-related message IDs/default messages.
client/app/bundles/course/marketplace/pages/MarketplaceIndex/MarketplaceTable.tsx Adds a row-level Duplicate button to open the confirmation flow.
client/app/bundles/course/marketplace/pages/MarketplaceIndex/index.tsx Wires the duplicate confirmation modal and reads from_tab from URL params.
client/app/bundles/course/marketplace/operations.ts Adds duplicateListings operation (enqueue + job polling).
client/app/bundles/course/marketplace/components/DuplicateConfirmation.tsx Adds confirmation modal that submits duplication and shows toast feedback.
client/app/bundles/course/marketplace/components/test/DuplicationConfirmation.test.tsx Adds frontend test coverage for posting duplication request payload.
client/app/api/course/Marketplace.ts Adds MarketplaceAPI.duplicate POST method.
app/services/course/duplication/object_duplication_service.rb Records marketplace adoptions after object duplication completes.
app/services/course/duplication/course_duplication_service.rb Records marketplace adoptions after course duplication completes.
app/services/course/duplication/base_service.rb Implements record_marketplace_adoptions based on duplicator.duplicated_objects.
app/jobs/course/assessment/marketplace/duplication_job.rb Implements duplication job and redirect behavior after duplication.
app/controllers/course/assessment/marketplace/listings_controller.rb Adds duplicate action with authorization and job submission.
Comments suppressed due to low confidence (1)

client/app/bundles/course/marketplace/components/DuplicateConfirmation.tsx:52

  • duplicateTitle is a pluralized message that references {n}, but it is formatted without providing n, which can cause runtime formatting errors / fallback output.
      open={open}
      primaryLabel={t(translations.duplicateConfirm)}
      title={t(translations.duplicateTitle)}
    >

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread client/app/bundles/course/marketplace/translations.ts
Comment thread client/app/bundles/course/marketplace/operations.ts Outdated
Comment thread app/jobs/course/assessment/marketplace/duplication_job.rb
Comment thread app/services/course/duplication/object_duplication_service.rb Outdated
- add DuplicationJob: copies listings into a course tab, writes adoption
- add bulk duplicate endpoint enqueuing the job for selected listings
- add DuplicateConfirmation modal with row + bulk triggers, job polling
- add MarketplaceAPI.duplicate and duplicateListings poll operation
- serialize and assert live distinct-course adoption count in index
@LWS49
LWS49 force-pushed the lws49/feat-marketplace-pr4-duplicate branch from 0b85578 to b218c92 Compare July 30, 2026 03:02
@LWS49
LWS49 merged commit 49e4c7b into lws49/feat-marketplace-pr1-foundation Jul 30, 2026
1 check passed
@LWS49
LWS49 deleted the lws49/feat-marketplace-pr4-duplicate branch July 30, 2026 03:02
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.

3 participants