-
Notifications
You must be signed in to change notification settings - Fork 480
feat(dot-content-types-edit): add new render mode property component #33886
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
feat(dot-content-types-edit): add new render mode property component #33886
Conversation
- Introduced `NewRenderModePropteryComponent` for managing render mode options in content type fields. - Updated module to include the new component and its template. - Enhanced `FieldPropertyService` to support the new render mode property in custom fields. This addition improves the flexibility of content type configurations by allowing users to specify render modes directly within the form.
…ector-in-custom-field-properties
Legal RiskThe following dependencies were released under a license that RecommendationWhile merging is not directly blocked, it's best to pause and consider what it means to use this license before continuing. If you are unsure, reach out to your security team or Semgrep admin to address this issue. MPL-2.0 |
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 introduces a new render mode property for custom content type fields and implements a singleton pattern for the AngularFormBridge. The changes enable users to specify render modes (recommended vs. deprecated) for custom fields, improving the flexibility of content type configurations.
- Added
NewRenderModePropertyComponentto manage render mode selection via radio buttons - Implemented singleton pattern for
AngularFormBridgeto prevent multiple instances - Updated field properties service to include render mode property for custom fields
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
| core-web/libs/edit-content/src/lib/fields/dot-edit-content-text-field/dot-edit-content-text-field.component.ts | Changed from computed to linkedSignal for value handling |
| core-web/libs/edit-content-bridge/src/lib/factories/form-bridge.factory.ts | Updated to use singleton getInstance method for AngularFormBridge |
| core-web/libs/edit-content-bridge/src/lib/bridges/angular-form-bridge.ts | Implemented singleton pattern with getInstance and resetInstance methods |
| core-web/libs/edit-content-bridge/src/lib/bridges/angular-form-bridge.spec.ts | Added comprehensive tests for singleton pattern behavior |
| core-web/libs/edit-content-bridge/package.json | Removed rxjs and vite dependencies (potential issue - see comments) |
| core-web/apps/dotcms-ui/src/app/portlets/shared/dot-content-types-edit/dot-content-types-edit.module.ts | Added NewRenderModePropteryComponent to module declarations |
| core-web/apps/dotcms-ui/src/app/portlets/shared/dot-content-types-edit/dot-content-types-edit.component.ts | Added debug console.log statements |
| core-web/apps/dotcms-ui/src/app/portlets/shared/dot-content-types-edit/components/fields/service/field-property-info.ts | Added newRenderMode property configuration |
| core-web/apps/dotcms-ui/src/app/portlets/shared/dot-content-types-edit/components/fields/service/field-properties.service.ts | Enhanced to add newRenderMode property to custom fields |
| core-web/apps/dotcms-ui/src/app/portlets/shared/dot-content-types-edit/components/fields/content-type-fields-properties-form/field-properties/new-render-mode-proptery/* | New component files for render mode property with template and exports |
| core-web/apps/dotcms-ui/src/app/portlets/shared/dot-content-types-edit/components/fields/content-type-fields-properties-form/content-type-fields-properties-form.component.ts | Added transformFormValue method to convert newRenderMode to fieldVariables |
| core-web/apps/dotcms-ui/src/app/portlets/shared/dot-content-types-edit/components/fields/content-type-fields-drop-zone/content-type-fields-drop-zone.component.ts | Added debug console.log statement |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...dotcms-ui/src/app/portlets/shared/dot-content-types-edit/dot-content-types-edit.component.ts
Outdated
Show resolved
Hide resolved
...perties-form/field-properties/new-render-mode-proptery/new-render-mode-proptery.component.ts
Outdated
Show resolved
Hide resolved
...perties-form/field-properties/new-render-mode-proptery/new-render-mode-proptery.component.ts
Outdated
Show resolved
Hide resolved
...-content/src/lib/fields/dot-edit-content-text-field/dot-edit-content-text-field.component.ts
Show resolved
Hide resolved
...t-types-edit/components/fields/content-type-fields-properties-form/field-properties/index.ts
Show resolved
Hide resolved
...ps/dotcms-ui/src/app/portlets/shared/dot-content-types-edit/dot-content-types-edit.module.ts
Outdated
Show resolved
Hide resolved
.../fields/content-type-fields-properties-form/content-type-fields-properties-form.component.ts
Outdated
Show resolved
Hide resolved
...rties-form/field-properties/new-render-mode-proptery/new-render-mode-proptery.component.html
Outdated
Show resolved
Hide resolved
.../fields/content-type-fields-properties-form/content-type-fields-properties-form.component.ts
Outdated
Show resolved
Hide resolved
…ector-in-custom-field-properties
…yComponent and add its template
…stom-field-properties' of github.com:dotCMS/core into 33786-task-implement-implementation-type-selector-in-custom-field-properties
…editField methods
…t and improve value retrieval logic
…for improved value retrieval
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 14 out of 15 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.../fields/content-type-fields-properties-form/content-type-fields-properties-form.component.ts
Show resolved
Hide resolved
...t/components/fields/content-type-fields-drop-zone/content-type-fields-drop-zone.component.ts
Outdated
Show resolved
Hide resolved
.../fields/content-type-fields-properties-form/content-type-fields-properties-form.component.ts
Show resolved
Hide resolved
core-web/libs/edit-content-bridge/src/lib/bridges/angular-form-bridge.ts
Show resolved
Hide resolved
...rties-form/field-properties/new-render-mode-proptery/new-render-mode-property.component.html
Outdated
Show resolved
Hide resolved
...t-types-edit/components/fields/content-type-fields-properties-form/field-properties/index.ts
Show resolved
Hide resolved
...ps/dotcms-ui/src/app/portlets/shared/dot-content-types-edit/dot-content-types-edit.module.ts
Show resolved
Hide resolved
…r and add TODO for Signal Forms migration
… field properties initialization
…ector-in-custom-field-properties
…ector-in-custom-field-properties
…import from spec file
...perties-form/field-properties/new-render-mode-proptery/new-render-mode-property.component.ts
Show resolved
Hide resolved
.../fields/content-type-fields-properties-form/content-type-fields-properties-form.component.ts
Show resolved
Hide resolved
…33886) ### Proposed Changes This pull request introduces a new "New Render Mode" property for custom fields in the content type editor and refactors the `AngularFormBridge` to use a singleton pattern for better state management. It also includes some developer-focused logging and dependency cleanup. **Custom Field Properties and UI Enhancements:** * Added a new `newRenderMode` property for custom fields: - Introduced `NewRenderModePropteryComponent` with a radio button UI to select between "Recommended" and "Deprecated" render modes (`new-render-mode-proptery.component.ts`, `.html`, and related exports/imports). [[1]](diffhunk://#diff-47f603d13a0f5f9ed0e88929658db8d2ac93cb578f32db02a8a6bca347dfa3f4R1-R34) [[2]](diffhunk://#diff-04a7bbb9c85442538f0c451a5c6439de10ba254eae598194f0781c4764efbe36R1-R14) [[3]](diffhunk://#diff-6fb71132ce9a54ccb2d7f7f663166ae5df41956373382770f3f40301634455deR1) [[4]](diffhunk://#diff-2fdd49e7cef625ae5d2e851997320147801a93eaa806e6d748b4f56908fdf4ceR9) [[5]](diffhunk://#diff-f8011cbc534292a6c2d0c7dc2f478f2bf225d1b6b6f4f9a51646555191873649L13-R14) [[6]](diffhunk://#diff-f8011cbc534292a6c2d0c7dc2f478f2bf225d1b6b6f4f9a51646555191873649R93-R97) [[7]](diffhunk://#diff-0f3ec14af7770b7e5376a79d0ebe9857b53fd3a61a4afb3725d1f5f515e95753R57) [[8]](diffhunk://#diff-0f3ec14af7770b7e5376a79d0ebe9857b53fd3a61a4afb3725d1f5f515e95753L115-R117) - Updated `FieldPropertyService` to include `newRenderMode` in custom field properties. [[1]](diffhunk://#diff-bde383871412422b64c2a096eeda7acad8858088182afe147943fae6d6113629L4-R4) [[2]](diffhunk://#diff-bde383871412422b64c2a096eeda7acad8858088182afe147943fae6d6113629L23-R33) - Modified the form property transformation logic to emit the correct structure for `fieldVariables` when saving custom fields. [[1]](diffhunk://#diff-3b9565f5bcb92a0cccbfa5df0c0e3675ba748ecfb41381e736bd4c2a8e42efb9L19-R19) [[2]](diffhunk://#diff-3b9565f5bcb92a0cccbfa5df0c0e3675ba748ecfb41381e736bd4c2a8e42efb9L75-R101) **AngularFormBridge Refactor and Testing:** * Refactored `AngularFormBridge` to implement the singleton pattern: - Added `getInstance` and `resetInstance` static methods to ensure only one bridge instance exists at a time, and updated the factory to use this pattern. [[1]](diffhunk://#diff-08b7f2dbb6ec1f4033d7a5801c7f63b080a8f9565b11c3f9b7c40ea512578e6fR17-R63) [[2]](diffhunk://#diff-08b7f2dbb6ec1f4033d7a5801c7f63b080a8f9565b11c3f9b7c40ea512578e6fR164-R175) [[3]](diffhunk://#diff-7e7427e48350646c481f2a6d1653c32ba7e345af017115e8c16ae748689e1bfeL39-R39) - Updated tests to cover singleton behavior, including instance reuse, warning on parameter mismatch, and proper cleanup. [[1]](diffhunk://#diff-56d79fca411f7de0eccc5e1f0b399892ecebc2c9a5148d75ebba52fa1f272639R38-R49) [[2]](diffhunk://#diff-56d79fca411f7de0eccc5e1f0b399892ecebc2c9a5148d75ebba52fa1f272639R220-R309) **Developer Experience and Maintenance:** * Added console logging in key field save/edit methods to aid debugging during development. [[1]](diffhunk://#diff-b1988fdbb798b95d236e7d8fe4d0225c7ae7d153a4490f8a7eb2a7cb197be6d9R265) [[2]](diffhunk://#diff-baf830d0ccf4bb80b652bd323f6c5778e2120b7f2c58b37f6084b3aa2c63c2bcR236) [[3]](diffhunk://#diff-baf830d0ccf4bb80b652bd323f6c5778e2120b7f2c58b37f6084b3aa2c63c2bcR265) * Cleaned up dependencies in `edit-content-bridge/package.json` by removing unused packages. * Minor import update in `dot-edit-content-text-field.component.ts` to use `linkedSignal` instead of `computed`. ### Checklist - [ ] Tests - [ ] Translations - [ ] Security Implications Contemplated (add notes if applicable) ### Additional Info ** any additional useful context or info ** This PR fixes: #33786
Proposed Changes
This pull request introduces a new "New Render Mode" property for custom fields in the content type editor and refactors the
AngularFormBridgeto use a singleton pattern for better state management. It also includes some developer-focused logging and dependency cleanup.Custom Field Properties and UI Enhancements:
newRenderModeproperty for custom fields:NewRenderModePropteryComponentwith a radio button UI to select between "Recommended" and "Deprecated" render modes (new-render-mode-proptery.component.ts,.html, and related exports/imports). [1] [2] [3] [4] [5] [6] [7] [8]FieldPropertyServiceto includenewRenderModein custom field properties. [1] [2]fieldVariableswhen saving custom fields. [1] [2]AngularFormBridge Refactor and Testing:
AngularFormBridgeto implement the singleton pattern:getInstanceandresetInstancestatic methods to ensure only one bridge instance exists at a time, and updated the factory to use this pattern. [1] [2] [3]Developer Experience and Maintenance:
edit-content-bridge/package.jsonby removing unused packages.dot-edit-content-text-field.component.tsto uselinkedSignalinstead ofcomputed.Checklist
Additional Info
** any additional useful context or info **
This PR fixes: #33786
This PR fixes: #33786