34420 unify component#36172
Conversation
…rapper - Added a new `DotLegacyImageEditorLauncherService` to manage the image editor dialog lifecycle. - Introduced `DotLegacyImageEditorDialogComponent` for rendering the image editor iframe. - Updated `DotBinaryFieldWrapperComponent` to utilize the image editor service and handle value updates. - Enhanced the binary field HTML template to include an image editor toggle. - Added unit tests for the new image editor dialog and launcher service. This implementation allows users to edit images directly within the binary field, improving the content editing experience.
…message event handling - Added `dispatchSpy.restore()` calls to ensure proper cleanup after each test case. - Updated the origin check in the message event test to use a variable for invalid origins, improving test reliability. - Enhanced assertions to ensure that only valid events trigger the expected behavior. These changes improve the robustness of the unit tests for the `DotLegacyImageEditorLauncherService`.
- Introduced a new specification for the binary field image editor, verifying the visibility of the Edit button and the opening of the legacy Dojo Image Editor in both new and legacy content editors. - Created helper classes for managing interactions with the binary field and legacy binary field within the tests. - Updated the binary field helper to include methods for image upload and editor interaction. - Enhanced the legacy binary field helper to support image editing in the legacy editor. These changes improve the testing coverage for the binary field image editor functionality, ensuring a seamless user experience across different content editor versions.
…ar' of github.com:dotCMS/core into 34420-epic-image-editor-feature-parity-migrate-to-angular
…ame security handling - Changed the default image URL for import-from-URL tests to a stable 800x800 PNG from `placehold.co`. - Updated the `DotLegacyImageEditorDialogComponent` to use the SafeUrlPipe for iframe URL sanitization, improving security. - Adjusted related documentation to reflect the new image URL and its dimensions. These changes enhance the reliability and security of the binary field image editor functionality.
…file - Deleted the `binary-field-image-editor.md` specification file as it is no longer needed. - This cleanup helps streamline the project documentation and maintain focus on current testing strategies. No functional changes were made to the codebase.
- Replaced the `DotEditContentBinaryFieldComponent` with `DotEditContentFileFieldComponent` to unify the handling of binary and file fields. - Updated related tests and helper classes to reflect the new component structure. - Removed outdated binary field HTML, SCSS, and spec files to streamline the codebase. These changes enhance the maintainability and consistency of the binary field functionality within the content editing framework.
- Introduced `LegacyDialogImageEditorLauncher` to replace the previous Dojo-based image editor integration, allowing the legacy image editor to be opened in a PrimeNG dialog. - Updated the `DotFileFieldComponent` to conditionally expose the image editor action only for binary fields. - Modified related tests and components to accommodate the new image editor launcher and ensure proper functionality. - Enhanced the styling of the file field component for better layout consistency. These changes improve the user experience by modernizing the image editing workflow within the content editing framework.
|
Claude finished @adrianjm-dotCMS's task in 1m 28s —— View job Rollback Safety Analysis
Result: ✅ Safe To RollbackAll 100 changed files are frontend-only (Angular/TypeScript components, E2E tests, i18n). No backend changes are present. Categories checked against the diff:
What changed:
Label |
🤖 Codex Review —
|
- Updated the binary field image editor tests to reflect the new legacy image editor dialog behavior. - Added tests to verify that the "Edit image" button is hidden for non-image file uploads and that the confirmation popup appears when removing a file. - Improved the existing test for editing binary content to ensure it displays the preview without server errors. These changes enhance the test coverage and reliability of the binary field image handling functionality within the content editing framework.
…nd image fields - Refactored the required field tests for binary, file, and image fields to use a consistent structure with `beforeEach` and `afterEach` hooks for setup and teardown. - Improved test readability and maintainability by encapsulating the creation and deletion of content types within dedicated hooks. - Ensured that error handling for required fields is properly tested across all relevant field types. These changes enhance the clarity and organization of the end-to-end tests for required fields in the content editing framework.
🤖 Bedrock Review —
|
|
@copilot resolve the merge conflicts in this pull request |
Resolved in baa2b30. |
…file field preview component
…nce file editor functionality - Changed the event emitted on value update from `valueUpdated` to `onInnerValueUpdated` to ensure proper synchronization with the FormControl. - Added a new method in the file field component to handle value updates directly, improving the reactive form integration. - Enhanced the file editor component to support additional properties for file uploads, including `uploadType` and `acceptedFiles`. - Updated the file preview component to emit an event for editing files when the preview is clicked. - Adjusted styles for better usability and responsiveness in the file preview and editor components.
…into 34420-unify-component
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Increase 'Show Query' dropdown wait from 5 s to 15 s — Dojo popup
transitions take longer under CI load
- Wait for #queryResults in openQueryModal so callers get a fully-loaded
modal rather than a just-opened one
- Replace page.waitForEvent('popup') with page.context().waitForEvent('page')
to reliably capture window.open() calls that originate inside the Dojo
iframe via an async AJAX callback
- Use .dot-api-link CSS selector (stable class) instead of getByText('API')
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Updated `openQueryModal` method to wait for `#queryResults` to ensure the modal is fully rendered, increasing timeout to 15 seconds for better reliability in CI. - Refactored API link handling in the query modal to intercept the API call, allowing for reliable popup handling in Playwright. - Changed `clickQueryModalApiLink` to a getter for better encapsulation and clarity in the test helper class.
- Increase 'Show Query' dropdown wait from 5 s to 15 s — Dojo popup
transitions take longer under CI load
- Wait for #queryResults in openQueryModal so callers get a fully-loaded
modal rather than a just-opened one
- Intercept POST /api/content/_search so window.open() fires instantly
(browsers suppress it when called inside an async XHR callback)
- Use page.context().waitForEvent('page') to capture the new window from
inside the Dojo iframe reliably
- Use .dot-api-link CSS selector instead of getByText('API')
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>



This pull request introduces significant updates to the handling and testing of binary fields (file/image uploads) in the content editing experience. The main focus is on unifying the binary field implementation under the new
dot-edit-content-file-fieldcomponent, updating related imports and tests, and improving Playwright E2E test coverage for both the new and legacy editors. The changes also include new and refactored E2E test helpers for binary fields, and adjustments to test data and selectors.Component and Module Refactoring:
dot-edit-content-file-fieldcomponent, replacing the previousdot-edit-content-binary-fieldand its wrapper throughout the app and tests. This includes updating Angular module imports, dependency injection, and testbed configuration to use the new component and its bridge (DotBinaryFieldCeBridgeComponent). [1] [2] [3] [4] [5] [6] [7] [8]E2E Test Enhancements:
Test Helper Improvements:
Test Data and Selector Updates:
These changes collectively modernize the binary field experience, improve test coverage and reliability, and streamline the codebase for future enhancements.
This PR fixes: #34420