Skip to content

Conversation

@nicobytes
Copy link
Contributor

@nicobytes nicobytes commented Dec 17, 2025

Proposed Changes

This pull request introduces a new DotBrowsingService for browsing sites and folders, refactors several data access services to use consistent API response handling, and adds utility methods for working with file contentlets. The changes improve code consistency, reusability, and support for richer file and folder operations.

New browsing functionality

  • Added dot-browsing.service.ts, providing methods to retrieve sites and folders as tree nodes, build hierarchical tree structures from paths, and fetch content by folder. This service enables more advanced browsing and selection of site/folder data.
  • Exported DotBrowsingService in the data access library index for public use.
  • Added dot-browser-selector.model to the models index for tree node selection event typing. [1] [2]

Refactoring and API consistency

  • Refactored DotContentletService methods to use strongly typed DotCMSAPIResponse objects, improving type safety and consistency. Added support for retrieving contentlet content if editable as a text file, and integrated with the new upload file service methods. [1] [2] [3] [4] [5] [6] [7]
  • Refactored DotTagsService to use direct HTTP requests, removed dependency on CoreWebService, and added a new method to fetch tags using the v2 API. [1] [2]

File upload and content extraction enhancements

  • Updated DotUploadFileService to add methods for uploading assets and automatically extracting text content if the file is editable, streamlining file handling workflows. [1] [2] [3] [4]

Checklist

  • Tests
  • Translations
  • Security Implications Contemplated (add notes if applicable)

…dit mode support

- Updated the title custom field template to support a new edit mode using the `DotCustomFieldApi`.
- Implemented event listeners for the title box to automatically update the URL and friendly name fields based on the title input.
- Improved code structure by separating logic for new edit mode and legacy Dojo implementation.
- Ensured backward compatibility by maintaining the original script for non-edit mode scenarios.

This change enhances user experience by providing real-time updates and a more modern approach to handling custom fields.
…:dotCMS/core into 34029-task-migrate-pages-vtls-to-new-api
…:dotCMS/core into 34029-task-migrate-pages-vtls-to-new-api
…ment, enhance data access with new utility methods
…e and DotTruncatePathPipe to improve modularity
@alwaysmeticulous
Copy link

Meticulous was unable to execute a test run for this PR because the most recent commit is associated with multiple PRs. To execute a test run, please try pushing up a new commit that is only associated with this PR.

Last updated for commit 13bb7af. This comment will update as new commits are pushed.

@mergify
Copy link

mergify bot commented Dec 17, 2025

⚠️ The sha of the head commit of this PR conflicts with #34125. Mergify cannot evaluate rules on this PR. ⚠️

…rity and maintainability. Updated mock responses and added tests for contentlet retrieval, locking, and language suggestions. Enhanced test structure with meaningful variable names and consistent use of async patterns.
… improved clarity and maintainability. Updated mock responses and added tests for various upload scenarios, including handling of abort signals and contentlet uploads. Enhanced test structure with meaningful variable names and consistent use of async patterns.
@nicobytes nicobytes marked this pull request as ready for review December 22, 2025 22:48
@nicobytes nicobytes requested a review from Copilot December 22, 2025 22:49
…arity and maintainability. Implemented tests for site and folder retrieval, error handling, and tree structure transformation. Enhanced test structure with meaningful variable names and consistent use of async patterns.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request introduces a new DotBrowsingService for centralized site and folder browsing functionality, refactors multiple data access services to use consistent API response handling with strongly-typed DotCMSAPIResponse objects, and extends the custom field bridge API to support browser modal selection. The changes improve code reusability, type safety, and enable richer file and folder operations across the application.

  • Centralized browsing logic by extracting site/folder operations from DotEditContentService into a dedicated DotBrowsingService
  • Enhanced type safety by refactoring services to use DotCMSAPIResponse<T> instead of untyped responses
  • Extended custom field capabilities with a new openBrowserModal API for content selection within custom fields

Reviewed changes

Copilot reviewed 60 out of 65 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
core-web/libs/data-access/src/lib/dot-browsing/dot-browsing.service.ts New service providing centralized methods for browsing sites, folders, and content with tree node transformations
core-web/libs/data-access/src/lib/dot-contentlet/dot-contentlet.service.ts Refactored to use strongly-typed API responses and added method to retrieve contentlets with text content extraction
core-web/libs/data-access/src/lib/dot-tags/dot-tags.service.ts Removed CoreWebService dependency, migrated to direct HTTP calls, added v2 API method
core-web/libs/data-access/src/lib/dot-upload-file/dot-upload-file.service.ts Added methods for uploading assets with automatic content extraction for editable text files
core-web/libs/ui/src/lib/components/dot-browser-selector/* Renamed components and store from "select-existing-file" to "browser-selector" for better semantic clarity
core-web/libs/ui/src/lib/pipes/dot-truncate-path/* Renamed pipe from TruncatePathPipe to DotTruncatePathPipe for consistency with naming conventions
core-web/libs/edit-content-bridge/src/lib/bridges/angular-form-bridge.ts Added openBrowserModal method to enable content selection dialogs from custom fields
core-web/libs/edit-content-bridge/src/lib/interfaces/* New interfaces for browser selector functionality including options, results, and controller
core-web/libs/edit-content/src/lib/services/dot-edit-content.service.ts Delegated browsing operations to DotBrowsingService, reducing service complexity
dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/redirect_custom_field*.vtl Split redirect custom field template to support both legacy and new edit modes
Comments suppressed due to low confidence (1)

core-web/libs/ui/src/lib/components/dot-browser-selector/store/browser.store.ts:37

  • The interface name has a typo. "BrowserSelectorState" is the correct spelling instead of "SelectExisingFileState".

… and error handling. Added lint target in project.json, refined ignore patterns in .eslintrc.json, and adjusted TypeScript configurations for better type safety. Enhanced unit tests in DotBrowsingService for error handling and folder retrieval, ensuring consistent use of async patterns and meaningful variable names.
…settings and focus on testing and build targets.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 72 out of 77 changed files in this pull request and generated no new comments.

…lderParams for improved type safety and clarity. Updated getContentByFolder method signatures and adjusted related components to streamline content retrieval parameters. Enhanced DotBrowserSelectorComponent to manage folder parameters using Angular's signals for better state management.
…to utilize ContentByFolderParams for improved clarity and type safety. Updated test cases to pass parameters directly, ensuring consistent use of the new structure. Enhanced AngularFormBridge to accept params for better content filtering and retrieval. Streamlined test assertions for better maintainability..
…s for the DotCustomFieldApi modal. Updated the onClose callback to handle the new URL structure, improving the functionality of the page selection feature.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 77 out of 81 changed files in this pull request and generated 3 comments.

…eldComponent, and NativeFieldComponent. Updated return type description and field accessibility notes for clarity and consistency.
Comment on lines +50 to +62
return sites.map((site) => ({
key: site.identifier,
label: site.hostname,
data: {
id: site.identifier,
hostname: site.hostname,
path: '',
type: 'site'
},
expandedIcon: 'pi pi-folder-open',
collapsedIcon: 'pi pi-folder',
leaf: false
}));
Copy link
Member

Choose a reason for hiding this comment

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

Why are we adding "UI" to a service inside data-access?

Copy link
Member

Choose a reason for hiding this comment

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

This map needs to happen at the component level.

Copy link
Member

Choose a reason for hiding this comment

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

Or this services needs to go with the component... data-access lib is just our endpoints services.

Comment on lines +50 to +62
return sites.map((site) => ({
key: site.identifier,
label: site.hostname,
data: {
id: site.identifier,
hostname: site.hostname,
path: '',
type: 'site'
},
expandedIcon: 'pi pi-folder-open',
collapsedIcon: 'pi pi-folder',
leaf: false
}));
Copy link
Member

Choose a reason for hiding this comment

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

Or this services needs to go with the component... data-access lib is just our endpoints services.

Copy link
Member

Choose a reason for hiding this comment

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

Same as before, this data-access service looks like it doesn't belong here... seems very use case specific beyond "wraps" the endpoints.

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.

5 participants