-
Notifications
You must be signed in to change notification settings - Fork 480
34029 custom field template #34184
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 custom field template #34184
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.
|
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 159208d. This comment will update as new commits are pushed. |
|
|
…nality - Refactored SCSS for native field component to exclude custom select button from button styles. - Introduced new styles for custom select button and dropdown options in the template custom field. - Improved accessibility and usability of the custom dropdown with enhanced event handling and state management. These changes aim to provide a more consistent and user-friendly experience when interacting with custom fields
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 PR implements a custom field template refactor (#34029) with the following key changes:
- Major refactoring of the template selector custom field from a simple dropdown to a custom-styled button with paginated dropdown
- Introduction of a new
DotBrowsingServiceto consolidate site/folder browsing logic previously duplicated across multiple components - Implementation of a reusable
DotBrowserSelectorComponentfor content selection modals - Enhancement of the form bridge to support opening browser modals from custom fields
- Code cleanup including removal of unused imports, duplicate functions, and dependency consolidation
Reviewed changes
Copilot reviewed 79 out of 84 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| template_custom_field_new.vtl | Complete rewrite from simple select dropdown to custom button with paginated dropdown, added browser modal support |
| redirect_custom_field*.vtl | Split into old/new versions with conditional loading pattern |
| DotBrowsingService | New centralized service for site/folder browsing operations |
| DotBrowserSelectorComponent | New reusable component for content selection with tree navigation |
| angular-form-bridge.ts | Added openBrowserModal method to support custom field modal dialogs |
| Various test files | Updated imports and mocks to use new service structure |
| yarn.lock | Cleaned up duplicate/unused dependencies |
| Config files | TypeScript strictness adjustments for bridge library |
Proposed Changes
This pull request focuses on improving type safety and consistency in API response handling across several data access services. It introduces the use of a shared
DotCMSAPIResponsetype for HTTP responses, updates service methods to use more explicit typing andmapoperators, and refactors related unit tests to use new test utilities for creating mock data. Additionally, minor improvements were made to ESLint configuration and utility code.API Response Handling and Type Safety Improvements:
Updated
DotContentletService,DotFolderService, andDotSiteServiceto use the sharedDotCMSAPIResponsetype for all HTTP responses, ensuring consistent and type-safe extraction of theentityproperty using themapoperator instead ofpluck. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]Refactored
DotContentletServiceto add a new methodgetContentletByInodeWithContent, which retrieves a contentlet and augments it with file content using the injectedDotUploadFileService.Test Refactoring and Utilities:
dot-contentlet-service.spec.tsto use new mock data utilities (createFakeContentlet,createFakeLanguage) andmockProviderfrom@ngneat/spectator/jest, streamlining test setup and improving test readability and maintainability. [1] [2]Dependency Injection and Service Decorators:
providedIn: 'root'forDotFolderService, aligning with Angular best practices for singleton services.Minor Improvements and Fixes:
DotSeoMetaTagsUtilServiceby convertingHTMLCollectionto an array before iteration, ensuring compatibility with modern JavaScript.node_modulesdirectories in the MCP server configuration.DotSiteService, removing redundant interface definitions.Checklist