Skip to content

feat(marketplace): add read-only listing and question preview#8481

Open
LWS49 wants to merge 4 commits into
lws49/feat-marketplace-pr4-duplicatefrom
lws49/feat-marketplace-pr5-preview
Open

feat(marketplace): add read-only listing and question preview#8481
LWS49 wants to merge 4 commits into
lws49/feat-marketplace-pr4-duplicatefrom
lws49/feat-marketplace-pr5-preview

Conversation

@LWS49

@LWS49 LWS49 commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

This adds a read-only preview flow for marketplace listings, so course staff can inspect a published assessment (and every question in it) before deciding to duplicate it into their own course. Two new pages, ListingPreview and QuestionPreview, are reachable from the marketplace index's Preview action, backed by new controller/jbuilder endpoints that serialize an assessment and its questions cross-instance via ActsAsTenant.without_tenant. Along the way the duplicate confirmation dialog is reworked to show the destination course and an assessment tree, the old preview link (which opened a new tab and lost the router) now navigates in-app, and the browse flow's origin tab (from_tab) is threaded through breadcrumbs and every intra-marketplace link so duplication lands back where the user started.

Design decisions

  • Question detail is a dedicated full-page route laid out like the edit form's sections, rather than an inline expansion, since it's the most faithful layout for heavy content like Programming test cases; the back button returns to the listing preview.
  • All 7 question types get full-depth read-only detail renderers in this PR rather than a partial subset, since the cross-tenant serialization groundwork is shared across types once it exists for one.
  • The listing row date column shows "Published" (first_published_at) rather than "Updated": the publish button is a publish/remove toggle with no in-place re-publish, so a last-updated timestamp would be actively misleading.
  • The assessment properties table shows a curated subset of the real assessment show page and drops the source course's Starts at/Ends at, since showing them would wrongly imply duplication carries those dates over.

Regression prevention

Tests cover: the cross-tenant listing/question show endpoints and their authorization; all 7 question-type detail renderers dispatching from the type discriminator; from_tab propagating through breadcrumbs, preview links, and the duplicate confirmation; in-app preview navigation (no new tab) with back-button return; the MarketplaceTable's new Published column and Newest sort; empty-state and pagination behaviour; and DuplicationAssessmentTree's shared rendering (now used by both the marketplace and the generic duplication flow it was extracted from).

Manual testing covered the preview flow end-to-end: marketplace index → listing preview → each question type's detail page, the duplicate confirmation dialog, and in-app back navigation.

@LWS49
LWS49 force-pushed the lws49/feat-marketplace-pr5-preview branch 2 times, most recently from a31b07a to 85ab1fc Compare July 17, 2026 07:14
@LWS49
LWS49 marked this pull request as ready for review July 17, 2026 07:34
@LWS49 LWS49 changed the title Lws49/feat marketplace pr5 preview feat(marketplace): add read-only listing and question preview Jul 17, 2026
@LWS49
LWS49 force-pushed the lws49/feat-marketplace-pr4-duplicate branch from d84d375 to 284c2bb Compare July 17, 2026 08:10
LWS49 added 4 commits July 17, 2026 16:11
Add the read-only backend for the marketplace browse flow:

- listings#show serializes a curated, read-only view of a published
  assessment (config + per-question summaries) for the listing preview.
- questions#show serializes a single question's detail, dispatching to
  per-type detail partials (multiple/text/voice/forum/programming/
  rubric/scribing) so each renderer gets exactly the data it needs.
- The listings index gains destination tabs plus preview/duplicate URLs
  so the browse table can link into the flow and target a tab.

Type labels are serialized human-readable (question_type_readable) to
match the real assessment show page, while the demodulized discriminator
is kept for frontend renderer dispatch. The base controller pulls in
AssessmentsHelper so the preview views can reuse display_graded_test_types,
and the sidebar component now uses the :marketplace (storefront) icon.
…port

Extract the assessment/tab/question tree from AssessmentsListing into a
reusable DuplicationAssessmentTree component so both the duplication page
and the marketplace duplicate dialog render an identical tree. The old
DuplicateItemsConfirmation listing is rewired onto it.

Also add the shared table primitives the marketplace index needs:

- renderEmpty flows through TableTemplate -> Body -> MuiTable so a table
  can render a custom empty state when it has no rows.
- hideSelectAll drops the select-all header checkbox while keeping the
  per-row checkboxes.
- Register the storefront icon in COURSE_COMPONENT_ICONS.
Build the read-only browse experience on top of the preview endpoints:

- Marketplace index: single-toolbar table with pagination, empty states,
  hidden select-all, and links into the listing preview / duplicate flow.
- Listing preview page: read-only assessment config, per-question cards
  (type chip, staff-only notes, expandable options) and a Duplicate
  Assessment action.
- Question detail preview: header chip plus a renderer dispatcher with a
  renderer per question type (multiple/text/voice/forum/programming/
  rubric/scribing).
- Duplicate dialog now shows the destination course and the shared
  assessment tree.

Includes the api client, operations, types, translations and locale
strings backing the above.
Thread the origin assessment tab (from_tab) through the whole browse flow (index -> listing -> question preview and back) via withFromTab helpers,
so a duplication always imports into the tab the user started from no matter how they navigate. Add the route data handles that build the
marketplace / listing / question breadcrumbs, preserving from_tab on the crumb links.
@LWS49
LWS49 force-pushed the lws49/feat-marketplace-pr5-preview branch from 85ab1fc to a7086e3 Compare July 17, 2026 08:11
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