-
Notifications
You must be signed in to change notification settings - Fork 481
34029 browser component #34126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
34029 browser component #34126
Conversation
…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.
…template integration
…nd template updates
…:dotCMS/core into 34029-task-migrate-pages-vtls-to-new-api
…:dotCMS/core into 34029-task-migrate-pages-vtls-to-new-api
… from native field component
…roved dialog functionality and styling
…ment, enhance data access with new utility methods
…vice for improved data access
…e and DotTruncatePathPipe to improve modularity
|
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. |
|
|
…d components for enhanced dialog management
…d components for enhanced dialog management
…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.
…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.
There was a problem hiding this 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
DotEditContentServiceinto a dedicatedDotBrowsingService - Enhanced type safety by refactoring services to use
DotCMSAPIResponse<T>instead of untyped responses - Extended custom field capabilities with a new
openBrowserModalAPI 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".
core-web/libs/data-access/src/lib/dot-browsing/dot-browsing.service.ts
Outdated
Show resolved
Hide resolved
core-web/libs/data-access/src/lib/dot-browsing/dot-browsing.service.ts
Outdated
Show resolved
Hide resolved
core-web/libs/data-access/src/lib/dot-browsing/dot-browsing.service.ts
Outdated
Show resolved
Hide resolved
… 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.
There was a problem hiding this 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.
There was a problem hiding this 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.
...c/lib/fields/dot-edit-content-custom-field/components/native-field/native-field.component.ts
Show resolved
Hide resolved
...c/lib/fields/dot-edit-content-custom-field/components/iframe-field/iframe-field.component.ts
Show resolved
Hide resolved
core-web/libs/data-access/src/lib/dot-browsing/dot-browsing.service.ts
Outdated
Show resolved
Hide resolved
…eldComponent, and NativeFieldComponent. Updated return type description and field accessibility notes for clarity and consistency.
| 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 | ||
| })); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| 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 | ||
| })); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Proposed Changes
This pull request introduces a new
DotBrowsingServicefor 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
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.DotBrowsingServicein the data access library index for public use.dot-browser-selector.modelto the models index for tree node selection event typing. [1] [2]Refactoring and API consistency
DotContentletServicemethods to use strongly typedDotCMSAPIResponseobjects, 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]DotTagsServiceto use direct HTTP requests, removed dependency onCoreWebService, and added a new method to fetch tags using the v2 API. [1] [2]File upload and content extraction enhancements
DotUploadFileServiceto add methods for uploading assets and automatically extracting text content if the file is editable, streamlining file handling workflows. [1] [2] [3] [4]Checklist