Refactor DotEditFieldDialogComponent#36341
Conversation
…saving-changes-to-any-field-until-hard-refresh
|
Claude finished @nicobytes's task in 1m 6s —— View job Rollback Safety Analysis
Result: ✅ Safe To RollbackAll 34 changed files are pure frontend (Angular/TypeScript, HTML, Category-by-category check:
The label "AI: Safe To Rollback" has been applied. |
🤖 Bedrock Review —
|
Extract the field edit dialog into a standalone DotEditFieldDialog component and open it via PrimeNG DialogService instead of an inline p-dialog. Moved dialog open/close logic into openFieldDialog(), simplified component state by removing displayDialog/activeTab/dialogActions/renderer usage and related handlers, and updated drag-and-drop flows to call the new dialog flow. Tests were updated to mock DialogService and to assert dialog open/close outcomes; many dialog-related stubs and legacy test scaffolding were removed. Also added providedIn: 'root' to a couple of services (DotEditContentTypeCacheService, DotFieldVariablesService), improved typing and initialization guards in ContentTypeFieldsPropertiesFormComponent, and added a generated spec.json under libs/agentic-tools.
🤖 Bedrock Review —
|
…saving-changes-to-any-field-until-hard-refresh
🤖 dotBot Review (Bedrock)Reviewed 15 file(s); 11 candidate(s) → 10 confirmed, 0 uncertain (unverified, kept for review). Confirmed findings
us.deepseek.r1-v1:0 · Run: #28403940336 · tokens: in: 117640 · out: 22244 · total: 139884 · calls: 32 · est. ~$0.279 |
This feels real if it is correct? |
…saving-changes-to-any-field-until-hard-refresh
Removes the local `FieldService` from the content-types-edit portlet and merges its functionality into the shared `DotFieldService` in `@dotcms/data-access`. Moves the `FieldType` interface to `@dotcms/dotcms-models` as the canonical definition. Scopes `DotEditContentTypeCacheService` to the dialog instance instead of app-wide singleton, and extracts `getFieldIcon` as a pure utility function.
Update DotFieldService.deleteFields to accept string[] of field IDs instead of DotCMSContentTypeField[]. Also replaces http.request('DELETE') with http.delete(), and migrates subscribe() positional callbacks to observer object syntax throughout DotContentTypesEditComponent.
…saving-changes-to-any-field-until-hard-refresh
Tighten the content type builder E2E dialog locator so tests only target the field edit DynamicDialog and wait for that dialog to close, avoiding interference from unrelated PrimeNG dialogs. Also add a default field icon fallback for unknown field classes and correct the generated path entry in `core-web/.gitignore`.
Fixes a dialog bug where switching to Settings could replace the Save button action and leave Overview using the wrong handler. The component now rebuilds a canonical Overview Save button when returning to the Overview tab, preserving the correct form-save action and disabled state. Added a regression test to verify Settings -> Overview restores the original save behavior.
The content-type builder page object waited for the field persistence request but never checked its status, so a 4xx/5xx response would still resolve the wait and let the test pass without the field being saved. Assert response.ok() after the save click to fail fast on API errors. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This pull request refactors the field editing experience in the Content Type Fields Drop Zone component, moving from an inline dialog defined in the template to a dedicated dialog component (
DotEditFieldDialogComponent) opened via the PrimeNGDialogService. It also cleans up unused code and dependencies, and simplifies how icons are determined for draggable field items.Field editing dialog refactor:
content-type-fields-drop-zone.component.html) with a service-based modal dialog, removing all dialog-related state and logic from the component and template. ([[1]](https://github.com/dotCMS/core/pull/36341/files#diff-d9b6e2b0fd6eea4ba0d04be0c7da85b202e97b20584cf7042bcaea398dff26caL27-L138),[[2]](https://github.com/dotCMS/core/pull/36341/files#diff-b1988fdbb798b95d236e7d8fe4d0225c7ae7d153a4490f8a7eb2a7cb197be6d9L46-L77),[[3]](https://github.com/dotCMS/core/pull/36341/files#diff-b1988fdbb798b95d236e7d8fe4d0225c7ae7d153a4490f8a7eb2a7cb197be6d9L105-L126),[[4]](https://github.com/dotCMS/core/pull/36341/files#diff-b1988fdbb798b95d236e7d8fe4d0225c7ae7d153a4490f8a7eb2a7cb197be6d9L169-L187),[[5]](https://github.com/dotCMS/core/pull/36341/files#diff-b1988fdbb798b95d236e7d8fe4d0225c7ae7d153a4490f8a7eb2a7cb197be6d9L199-R140),[[6]](https://github.com/dotCMS/core/pull/36341/files#diff-b1988fdbb798b95d236e7d8fe4d0225c7ae7d153a4490f8a7eb2a7cb197be6d9L234-R215),[[7]](https://github.com/dotCMS/core/pull/36341/files#diff-b1988fdbb798b95d236e7d8fe4d0225c7ae7d153a4490f8a7eb2a7cb197be6d9L276-L289),[[8]](https://github.com/dotCMS/core/pull/36341/files#diff-b1988fdbb798b95d236e7d8fe4d0225c7ae7d153a4490f8a7eb2a7cb197be6d9L310-L311),[[9]](https://github.com/dotCMS/core/pull/36341/files#diff-b1988fdbb798b95d236e7d8fe4d0225c7ae7d153a4490f8a7eb2a7cb197be6d9L326-R286),[[10]](https://github.com/dotCMS/core/pull/36341/files#diff-b1988fdbb798b95d236e7d8fe4d0225c7ae7d153a4490f8a7eb2a7cb197be6d9L351-L355))DialogServiceto open the newDotEditFieldDialogComponentand handle dialog results for saving, converting, or cancelling field edits. ([[1]](https://github.com/dotCMS/core/pull/36341/files#diff-b1988fdbb798b95d236e7d8fe4d0225c7ae7d153a4490f8a7eb2a7cb197be6d9L11-R31),[[2]](https://github.com/dotCMS/core/pull/36341/files#diff-b1988fdbb798b95d236e7d8fe4d0225c7ae7d153a4490f8a7eb2a7cb197be6d9L46-L77),[[3]](https://github.com/dotCMS/core/pull/36341/files#diff-b1988fdbb798b95d236e7d8fe4d0225c7ae7d153a4490f8a7eb2a7cb197be6d9L234-R215))Code cleanup and dependency updates:
FieldServiceandRenderer2, from both the draggable item and drop zone components and their tests. ([[1]](https://github.com/dotCMS/core/pull/36341/files#diff-3235157a5fe0e93e4604adcd0a5a089e768879c9efb1414173819fd9330a8da2L19),[[2]](https://github.com/dotCMS/core/pull/36341/files#diff-3235157a5fe0e93e4604adcd0a5a089e768879c9efb1414173819fd9330a8da2L48-R47),[[3]](https://github.com/dotCMS/core/pull/36341/files#diff-545bf2f6f49386cb122451f7f59a9ceca8a40306d0bafbdf5232a06f5e4b0986L18-R18),[[4]](https://github.com/dotCMS/core/pull/36341/files#diff-545bf2f6f49386cb122451f7f59a9ceca8a40306d0bafbdf5232a06f5e4b0986L36),[[5]](https://github.com/dotCMS/core/pull/36341/files#diff-b1988fdbb798b95d236e7d8fe4d0225c7ae7d153a4490f8a7eb2a7cb197be6d9L11-R31))getFieldIconutility instead of the removedFieldService. ([[1]](https://github.com/dotCMS/core/pull/36341/files#diff-545bf2f6f49386cb122451f7f59a9ceca8a40306d0bafbdf5232a06f5e4b0986L18-R18),[[2]](https://github.com/dotCMS/core/pull/36341/files#diff-545bf2f6f49386cb122451f7f59a9ceca8a40306d0bafbdf5232a06f5e4b0986L86-R85))Template and style improvements:
[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.htmlL1-R5](https://github.com/dotCMS/core/pull/36341/files#diff-d9b6e2b0fd6eea4ba0d04be0c7da85b202e97b20584cf7042bcaea398dff26caL1-R5))These changes make the codebase more modular, maintainable, and easier to extend, while also improving the user experience for editing content type fields.
This PR fixes: #35512