-
Notifications
You must be signed in to change notification settings - Fork 480
refactor(custom-fields): Update static Custom fields #34106
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
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.
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 refactors custom field implementations for HTML pages by introducing a new edit mode that uses modern JavaScript APIs instead of legacy Dojo/Dijit frameworks. The refactoring creates separate implementations for old and new edit modes, with a Velocity conditional to route between them.
Key changes:
- Migrates from Dojo/Dijit to native JavaScript and DotCustomFieldApi
- Adds styling for native HTML form elements in Angular components
- Separates legacy (_old.vtl) and modern (_new.vtl) implementations
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| title_custom_field.vtl | Conditional routing between old and new implementations |
| title_custom_field_old.vtl | Legacy Dojo-based title field implementation |
| title_custom_field_new.vtl | Modern DotCustomFieldApi-based title field implementation |
| template_custom_field.vtl | Conditional routing between old and new implementations |
| template_custom_field_old.vtl | Legacy Dojo-based template selector implementation |
| template_custom_field_new.vtl | Modern implementation with native select and custom styling |
| cachettl_custom_field.vtl | Conditional routing between old and new implementations |
| cachettl_custom_field_old.vtl | Legacy Dojo-based cache TTL field implementation |
| cachettl_custom_field_new.vtl | Modern DotCustomFieldApi-based cache TTL implementation |
| native-field.component.ts | Added SCSS stylesheet reference |
| native-field.component.scss | Added comprehensive styling for native form elements |
Comments suppressed due to low confidence (1)
dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/template_custom_field_new.vtl:1
- This comment in the SCSS file (line 5 of native-field.component.scss) is in Spanish. Translate to English: "Use ::ng-deep to apply styles to dynamically injected elements" for consistency with the rest of the codebase.
<style>
dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/title_custom_field_new.vtl
Outdated
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/template_custom_field_new.vtl
Outdated
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/template_custom_field_new.vtl
Outdated
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/template_custom_field_new.vtl
Outdated
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/template_custom_field_new.vtl
Outdated
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/template_custom_field_new.vtl
Outdated
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/template_custom_field_new.vtl
Outdated
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/template_custom_field_new.vtl
Outdated
Show resolved
Hide resolved
...lib/fields/dot-edit-content-custom-field/components/native-field/native-field.component.scss
Outdated
Show resolved
Hide resolved
…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
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 15 out of 15 changed files in this pull request and generated 16 comments.
dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/og_preview_new.vtl
Outdated
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/template_custom_field_new.vtl
Outdated
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/og_preview_old.vtl
Outdated
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/og_preview_new.vtl
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/template_custom_field_new.vtl
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/template_custom_field_old.vtl
Outdated
Show resolved
Hide resolved
...lib/fields/dot-edit-content-custom-field/components/native-field/native-field.component.scss
Outdated
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/og_preview_new.vtl
Show resolved
Hide resolved
...lib/fields/dot-edit-content-custom-field/components/native-field/native-field.component.scss
Outdated
Show resolved
Hide resolved
dotCMS/src/main/webapp/WEB-INF/velocity/static/htmlpage_assets/og_preview_old.vtl
Show resolved
Hide resolved
|
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 f3fb68e. This comment will update as new commits are pushed. |
Proposed Changes
This pull request introduces significant improvements to the custom field rendering logic, focusing on modularizing template and cache TTL field implementations for new and old edit modes, and enhancing the styling and maintainability of the
dot-edit-content-custom-fieldnative field component. The most important changes are grouped below:Edit Mode Custom Field Rendering
cachettl_custom_field.vtlandtemplate_custom_field.vtlto delegate rendering to separate files based on whether the new edit mode is enabled, improving maintainability and paving the way for further enhancements. [1] [2]cachettl_custom_field_new.vtlandcachettl_custom_field_old.vtlto separate the logic for the cache TTL custom field between new (usingDotCustomFieldApi) and old (using Dojo/dijit) edit modes, ensuring compatibility and cleaner code. [1] [2]Styling Improvements
native-field.component.scss) for thedot-edit-content-custom-fieldnative field component, centralizing and modernizing the styling for inputs, selects, textareas, and buttons, and making use of design tokens and mixins for consistency.native-field.component.ts) to include the new SCSS file, ensuring the new styles are applied.Checklist
This PR fixes: #34029