feat(folder-search): new site/folder selector - #36449
Conversation
…ce and add corresponding tests - Added the `searchFolders` method to `DotFolderService` to enable searching for folders with pagination and various filter options. - Introduced `FolderSearchView` and `FolderSearchParams` interfaces in `dot-folder.model.ts` to define the structure of search results and parameters. - Updated unit tests in `dot-folder.service.spec.ts` to cover the new search functionality, ensuring correct API calls and response handling. - Enhanced the `DotEditContentHostFolderFieldComponent` to integrate the new search functionality, including UI updates for folder selection. This change improves the folder management capabilities by allowing users to search for folders based on specific criteria, enhancing the overall user experience.
…nt-edit-contentlet
|
Claude finished @nicobytes's task in 12m 5s —— View job PR Review — new site/folder selectorI reviewed the diff against New Issues
Resolved
Notes (non-blocking)
Overall this is in good shape — the only actionable item is the test‑mock string drift, which is Medium and non‑blocking. • |
…st-folder-field.store.spec.ts
…lder selection experience - Added the `onOverlayShow` method to the `DotHostFolderFieldComponent`, which opens the overlay and scrolls the selected folder into view once the tree has finished rendering. - Introduced a new private method `scrollSelectedFolderIntoView` to handle the scrolling logic, ensuring it retries until the folders are fully loaded. - Updated the component's template to reference the new method for overlay display. This change improves the user experience by ensuring that the selected folder is visible when the overlay is opened, enhancing usability in folder management.
…y functionality - Added the Angular CDK Clipboard service to the `DotHostFolderFieldComponent` to enhance the copyPath method. - Updated unit tests to mock the Clipboard service and verify that the correct path is copied to the clipboard. - Refactored the copyPath method to utilize the Clipboard service instead of the deprecated navigator.clipboard API. This change improves the reliability of the copy functionality within the host folder field component, ensuring a smoother user experience.
…tionality - Updated the `DotHostFolderFieldComponent` to include a "Load more" button for both root-level and child folders, improving pagination and user experience. - Refactored the `onLoadMoreNode` method to handle loading more folders based on the clicked sentinel node's parent. - Modified the component's template to display the new "Load more" button and adjusted styles for better layout. - Enhanced unit tests to cover the new loading behavior and ensure correct functionality of the "Load more" feature. This change significantly improves the usability of the folder selection interface by allowing users to load additional folders seamlessly.
- Refactored the `host-folder-field.component.spec.ts` to enhance readability by adjusting the formatting of the `callScroll` function. - Simplified the `host-folder-field.store.ts` by consolidating array operations for better clarity and maintainability. These changes contribute to cleaner code and improved maintainability of the host folder field component.
…r better service management - Changed the `@Injectable` decorator in `DotEditContentTypeCacheService` to remove the `providedIn: 'root'` option, allowing for more flexible service instantiation. - Removed the `spec.json` file from the `agentic-tools` library, cleaning up unused generated files and reducing clutter in the codebase. These changes enhance service management and maintainability within the application.
- Updated the `host-folder-field-load-more.spec.ts` to improve the test for the "Load more" functionality by ensuring the parent folder name is prefixed correctly and verifying the visibility of the target folder after loading more items. - Modified the `host-folder-field.ts` helper to wait for the folder search response and ensure the button click is handled correctly, enhancing the reliability of the tests. These changes improve the accuracy and reliability of the tests related to folder loading and selection in the host folder field component.
…nt-edit-contentlet
…nt-edit-contentlet
…tname - Modified the test for the folder context pre-fill to retrieve the current site hostname using `apiHelpers.getCurrentSite()`. - Updated the expectation to check that the field label contains the current site's hostname instead of matching a pattern. - Ensured the test verifies the form's functionality with the updated logic.
|
Queued — the merge queue status continues in this comment ↓. |
…nt-edit-contentlet
Merge Queue Status
This pull request spent 26 seconds in the queue, including 3 seconds running CI. Required conditions to merge
ReasonPull request #36449 has been dequeued GitHub refused to merge the pull request. Changes must be made through the merge queue. This is usually enforced by a branch protection or ruleset rule. HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Tick the box to put this pull request back in the merge queue (same as
|
…nt-edit-contentlet
…nt-edit-contentlet
…nctionality in DotEditContentHostFolderFieldComponent
…for site resolution - Updated test cases in host-folder-field.store.spec.ts to replace direct calls to service.resolveSiteByHostname with a mock function. - Ensured that the tests handle scenarios where the resolved site cannot be found, improving error handling and test reliability.
…nt-edit-contentlet
…nt-edit-contentlet
- Removed duplicate imports of `patchState` and `unprotected` from `@ngrx/signals` in the host-folder-field component test file. - Cleaned up the test file for better readability and maintainability.
…tentlet' of github.com:dotCMS/core into 36151-implement-new-sitefolder-field-component-edit-contentlet
Use queryEpoch and overlay-open gating so folder/site search refetches after dismissing and reopening the picker with the same term. Co-authored-by: Cursor <cursoragent@cursor.com>
…nt-edit-contentlet
…cated method - Changed the test suite description for clarity by removing the issue number. - Added a call to `searchFolders` in the test to enhance folder selection functionality. - Removed the deprecated `filterTree` method in `HostFolderField` class, promoting the use of `searchFolders` instead.
…tentlet' of github.com:dotCMS/core into 36151-implement-new-sitefolder-field-component-edit-contentlet
…Changes calls - Added `detectChanges` calls in multiple test cases to ensure the component updates correctly after state changes. - Improved the reliability of tests by ensuring the UI reflects the latest state during assertions.
…nt-edit-contentlet
This pull request introduces a new, paginated folder search feature for the host/folder selection field and refactors the UI to use a custom overlay with improved usability. The changes add a new service method and model types for folder searching, update the component template for a modern UX, and provide thorough unit tests for the new functionality.
Folder Search API Integration:
searchFoldersmethod toDotFolderServicethat calls the unified, paginated/api/v1/folder/searchendpoint, supporting filtering, sorting, and pagination.FolderSearchView(API response item) andFolderSearchParams(query params) indot-folder.model.tsfor strong typing and documentation.Component UI Refactor:
p-treeselectdropdown with a custom button-triggered overlay (p-popover) inhost-folder-field.component.html, providing a two-pane layout for sites and folders, search input, improved accessibility, and a copy-to-clipboard button.Testing Enhancements:
DotHostFolderFieldComponent, covering overlay behavior, folder/site selection, search, copy-to-clipboard, and integration with the new store and service methods.DotFolderServicespec to test the newsearchFoldersmethod, including query parameter handling and response mapping.Supporting Changes:
This PR fixes: #36151
This PR fixes: #36151