Skip to content

Migrate dot-select-existing-content (relate-existing picker) to the Content Drive table #36749

Closed

Description

@zJaaal

Summary

Migrate dot-select-existing-content — the relationship field's "relate existing content" dialog picker (libs/edit-content/.../dot-edit-content-relationship-field/components/dot-select-existing-content) — to render with the Content Drive table (dot-folder-list-view) instead of its own p-table. The picker becomes a thin wrapper (dialog + search store + cardinality rules) around the Content Drive table.

Follow-up from #36737 and @nicobytes' review, under the agreed direction that the relationship field's content tables become a constrained subset of Content Drive rather than a parallel implementation. This is the first concrete migration; the inline related-content table (dot-relationship-field) is out of scope here.

The one gap: selection

For this picker, the Content Drive table is already a superset except selection. Everything else the picker renders — typed columns, sortable headers, server-side search/pagination — Content Drive already does (and its lazy/server model is the one the picker's store already feeds). So the migration is: add selection to the Content Drive table, then point the picker at it.

The picker (dot-select-existing-content) today does:

  • selectionMode single or multiple — radio (single) / checkbox (multiple).
  • Constrained/disabled rows with a tooltip (relationship cardinality reached).
  • A custom select-all that excludes constrained rows and preserves selection across pages.
  • A frozen left checkbox column.

Capability to add to the Content Drive table

dot-folder-list-view hardwires multiple-checkbox selection. Generalize it:

  • selectionMode: 'none' | 'single' | 'multiple' — default multiple (today's behavior unchanged when unset); single → radio column.
  • Constrained/disabled rows: an input marking rows non-selectable, with a tooltip; select-all must exclude them.
  • Cross-page selection preserved.
  • Frozen selection column (optional, matches the picker).

The picker's cardinality rules (which rows are constrained) and its dialog/store wiring stay in the picker container and are passed into the table as inputs — the table stays presentational.

The picker's duplicate column model (Column {field, header}) is retired in favor of Content Drive's column typing; the cell widgets it needs are already shared @dotcms/ui atoms.

Architectural decision (blocks the "consume it" step)

The CD table lives in @dotcms/portlets/content-drive/ui; the picker in @dotcms/edit-content. content-drive/portlet already imports edit-content, so edit-content importing the CD table would close an import cycle. Resolve by relocating the table (or a thin table lib) to a lower shared home, or inverting the content-drive→edit-content dependency. Not a blocker for adding selection to the CD table itself.

Phased plan

  1. Selection modes on the Content Drive table — selectionMode: none | single | multiple, radio for single, constrained/disabled rows + tooltip, constrained-aware select-all, cross-page selection preservation, optional frozen selection column. Default multiple; Content Drive behavior unchanged. +tests. (Independent, shippable on its own.)
  2. Lib-home / dependency-direction decision so edit-content can consume the table without a cycle.
  3. Migrate the picker (dot-select-existing-content) onto the Content Drive table; retire its Column model.

Acceptance criteria (draft)

  • CD table supports selectionMode: none | single | multiple (default multiple; current behavior unchanged when unset), radios for single.
  • Rows can be marked non-selectable (with tooltip); select-all excludes them; selection is preserved across pagination.
  • The relate-existing picker renders via the Content Drive table with identical behavior (single/multiple, cardinality constraints, select-all).
  • Picker's duplicate Column model removed; no cyclic dependency (Nx graph clean).
  • No visual/behavioral regression in Content Drive or the picker.

Out of scope

  • The inline related-content table (dot-relationship-field) — reorder / CVA / delete-navigate stay untouched for now.
  • Merging the whole portlets.
  • $safeExtraColumns dev-warning on field-key collision — small separate follow-up.

Drafted by Claude (via Claude Code) at @zJaaal's request — recommended plan grounded in a code investigation of the tables. Direction: the relate-existing content picker becomes a constrained Content Drive table. Origin: @nicobytes' review on #36737.

Activity

  1. changed the title [-]Content Drive table: add single/multi-select selection modes (foundation for the relationship field as a constrained Content Drive subset)[/-] [+]Migrate the relate-existing content picker onto the Content Drive table (add single/multi-select to the CD table)[/+] on Jul 27, 2026
  2. changed the title [-]Migrate the relate-existing content picker onto the Content Drive table (add single/multi-select to the CD table)[/-] [+]Migrate dot-select-existing-content (relate-existing picker) to the Content Drive table[/+] on Jul 27, 2026
  3. moved this from New to Next 2-4 Sprints in dotCMS - Product Planningon Jul 27, 2026
  4. added theissue type on Jul 27, 2026
  5. zJaaal commented on Aug 20, 2026

    @zJaaal
    MemberAuthor

    Already solved on #36944

  6. moved this from Next 2-4 Sprints to Done in dotCMS - Product Planningon Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Team : ScoutType : RefactoringdotCMS : Technical Debt

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions