-
Notifications
You must be signed in to change notification settings - Fork 480
34029 browser component v2 #34177
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
34029 browser component v2 #34177
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
…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.
… 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.
…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.
…eldComponent, and NativeFieldComponent. Updated return type description and field accessibility notes for clarity and consistency.
…or improved modularity and clarity. Updated service methods to utilize DotCMSAPIResponse for consistent response handling. Enhanced unit tests for DotBrowsingService to ensure robust error handling and folder retrieval functionality.
… 34029-browser-component
…to use providedIn root for improved dependency injection clarity and consistency across services
…gService to enhance modularity and maintainability in the browser store tests and implementation.
|
|
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 comprehensive refactoring of data access services and creates a reusable browser component infrastructure. The main focus is on standardizing API response handling, improving type safety, and consolidating browsing functionality into shared services and components.
Key Changes:
- Created
DotBrowsingServiceto consolidate site/folder browsing logic previously duplicated across components - Introduced
DotBrowserSelectorComponentas a reusable content browser modal - Extended form bridge API with
openBrowserModal()method for custom field integration - Standardized all service methods to use
DotCMSAPIResponse<T>type andmap()operator for consistency - Refactored Velocity redirect custom field to support both legacy Dojo and new Angular modes
Reviewed changes
Copilot reviewed 77 out of 81 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
redirect_custom_field.vtl |
Conditional template dispatch based on edit mode |
redirect_custom_field_new.vtl |
Angular-based redirect field using form bridge API |
redirect_custom_field_old.vtl |
Legacy Dojo-based redirect field implementation |
dot-browsing.service.ts |
New centralized service for site/folder browsing operations |
dot-browsing.service.spec.ts |
Comprehensive test suite for browsing service |
dot-browser-selector.component.ts |
New reusable browser modal component |
browser.store.ts |
NgRx signals store for browser selector state |
dot-contentlet.service.ts |
Added getContentletByInodeWithContent() method and standardized response handling |
dot-folder.service.ts |
Standardized API response handling with DotCMSAPIResponse<T> |
dot-site.service.ts |
Moved ContentByFolderParams to models and standardized responses |
dot-tags.service.ts |
Added getTags() method and standardized response handling |
dot-upload-file.service.ts |
Added uploadDotAssetWithContent() and addContent() methods |
dot-edit-content.service.ts |
Refactored to use DotBrowsingService instead of duplicating logic |
angular-form-bridge.ts |
Implemented openBrowserModal() for custom field browser integration |
form-bridge.interface.ts |
Extended interface with browser modal support |
browser-selector.interface.ts |
New interfaces for browser selector functionality |
| Various test files | Updated tests to use new utilities (createFakeContentlet, createFakeLanguage) |
DotTruncatePathPipe |
Renamed from TruncatePathPipe for consistency |
| Config files | Updated TypeScript, ESLint, and build configurations |
This pull request refactors several data access services to improve consistency, type safety, and test coverage across the codebase. The main changes include standardizing API response handling, updating tests to use new utilities and patterns, and enhancing service methods for contentlets and folders. These improvements should make the services easier to maintain and extend.
Service API response standardization:
dot-contentlet.service.ts,dot-folder.service.ts, anddot-site.service.tsto use theDotCMSAPIResponse<T>type for API responses, replacing manual type assertions andpluckoperators with consistent usage ofmapto extract theentityproperty. This improves type safety and clarity for API responses. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]DotContentletService enhancements:
getContentletByInodeWithContenttodot-contentlet.service.tsthat retrieves a contentlet and augments it with file content using the injectedDotUploadFileService.dot-contentlet.service.tsto accept optionalHttpParams, enabling more flexible API requests.Test improvements and modernization:
dot-contentlet-service.spec.tsto use new test utilities (createFakeContentlet,createFakeLanguage) and themockProviderpattern, improving test readability and maintainability. Added new test cases for methods likegetContentletByInodeWithContent. [1] [2]General code and ESLint configuration updates:
.eslintrc.jsonto excludenode_modulesdirectories, preventing unnecessary linting of dependencies.dot-seo-meta-tags-util.service.tsto correctly iterate over HTMLCollection usingArray.from, preventing potential runtime issues.Type and dependency cleanup:
dot-site.service.ts, relying on shared models for better maintainability.Let me know if you have any questions about these changes or want to discuss how they might affect your work!
This PR fixes: #34029