Skip to content

Conversation

@nicobytes
Copy link
Contributor

@nicobytes nicobytes commented Nov 21, 2025

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] [2] [3] [4] [5] [6] [7] [8]
    • Updated FieldPropertyService to include newRenderMode in custom field properties. [1] [2]
    • Modified the form property transformation logic to emit the correct structure for fieldVariables when saving custom fields. [1] [2]

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] [2] [3]
    • Updated tests to cover singleton behavior, including instance reuse, warning on parameter mismatch, and proper cleanup. [1] [2]

Developer Experience and Maintenance:

  • Added console logging in key field save/edit methods to aid debugging during development. [1] [2] [3]
  • 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

This PR fixes: #33786

- 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.
@nicobytes nicobytes linked an issue Nov 21, 2025 that may be closed by this pull request
8 tasks
@semgrep-code-dotcms-test
Copy link

Legal Risk

The following dependencies were released under a license that
has been flagged by your organization for consideration.

Recommendation

While 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

Copy link
Contributor

Copilot AI left a 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 NewRenderModePropertyComponent to manage render mode selection via radio buttons
  • Implemented singleton pattern for AngularFormBridge to 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.

…stom-field-properties' of github.com:dotCMS/core into 33786-task-implement-implementation-type-selector-in-custom-field-properties
Copy link
Contributor

Copilot AI left a 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.

@nicobytes nicobytes marked this pull request as ready for review November 24, 2025 18:14
@nicobytes nicobytes enabled auto-merge November 25, 2025 15:03
@nicobytes nicobytes added this pull request to the merge queue Nov 25, 2025
Merged via the queue into main with commit 2a7788f Nov 25, 2025
45 checks passed
@nicobytes nicobytes deleted the 33786-task-implement-implementation-type-selector-in-custom-field-properties branch November 25, 2025 16:33
dsolistorres pushed a commit that referenced this pull request Dec 9, 2025
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TASK] Implement Implementation-Type Selector in Custom Field Properties

4 participants