Skip to content

AssetPicker 2/7: Lift folder-tree helpers and harden drive data-access #36832

Description

@nicobytes

Description

Lift Content Drive folder-tree load helpers from the portlet into a shared location (@dotcms/data-access or a shared util usable by both Content Drive and AssetPicker), and harden DotContentDriveService so dialog hosts can provide/use it easily.

Related epic: #36702
Series: AssetPicker 2/7
Depends on / align with: #36733 (shared tree node models)

Helpers to lift (from Content Drive portlet utils/):

  • getFolderHierarchyByPath
  • getFolderNodesByPath
  • tree node builders (buildTreeFolderNodes / createTreeNode equivalents)

Service: DotContentDriveService (POST /api/v1/drive/search) — today not providedIn: 'root'; make it easy to provide from AssetPicker dialog providers or document the required providers clearly (prefer providedIn: 'root' if safe).

Acceptance Criteria

  • Folder hierarchy / load-more helpers live in a shared lib (not portlet-only) and are usable by Content Drive and AssetPicker
  • Helper node shapes align with the shared tree models from Unify folder p-tree into a shared @dotcms/ui component #36733 where applicable
  • Content Drive sidebar still expands, selects, and load-mores as before (tests updated/passing)
  • Unit tests cover the lifted helpers (happy path + edge cases for path hierarchy)
  • DotContentDriveService can be used from a non-route host (dialog/picker) without ad-hoc route provider hacks — either providedIn: 'root' or a documented provider pattern used by Content Drive and AssetPicker
  • No change to the /api/v1/drive/search contract

Priority

Medium

Additional Context

Independent issue in the AssetPicker N/7 series for epic #36702. Not a tracked sub-issue.

Metadata

Metadata

Assignees

Type

Projects

Status
Current Sprint Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions