Skip to content

34420 unify component#36172

Open
nicobytes wants to merge 23 commits into
mainfrom
34420-unify-component
Open

34420 unify component#36172
nicobytes wants to merge 23 commits into
mainfrom
34420-unify-component

Conversation

@nicobytes

@nicobytes nicobytes commented Jun 15, 2026

Copy link
Copy Markdown
Member

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-field component, 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:

  • The binary field implementation is unified under the dot-edit-content-file-field component, replacing the previous dot-edit-content-binary-field and 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:

  • Adds comprehensive Playwright E2E tests for the binary field image editor in both the new and legacy editors, including creation of content types, file import, and image editing workflows.
  • Introduces new E2E page objects for the legacy content editor and binary field, improving test structure and maintainability. [1] [2] [3]

Test Helper Improvements:

  • Refactors and extends the binary field test helper to support new selectors, actions (like image upload and editor opening), and improved assertions for button visibility and file handling. [1] [2] [3] [4] [5]

Test Data and Selector Updates:

  • Updates the default import-from-URL image to a stable 800x800 PNG for more robust image editor testing.
  • Aligns data-testid and DOM selectors in helpers with the new unified binary field implementation.

These changes collectively modernize the binary field experience, improve test coverage and reliability, and streamline the codebase for future enhancements.

This PR fixes: #34420

nicobytes added 11 commits June 15, 2026 10:54
…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.
@github-actions github-actions Bot added Area : Backend PR changes Java/Maven backend code Area : Frontend PR changes Angular/TypeScript frontend code labels Jun 15, 2026
@claude

claude Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Claude finished @nicobytes's task in 1m 23s —— View job


Rollback Safety Analysis

  • Read rollback-unsafe categories reference
  • Get the full PR diff
  • Analyze diff against all unsafe categories
  • Post results and apply label

Result: ✅ Safe To Rollback

All 82 changed files are frontend-only (Angular/TypeScript in core-web/) plus one additive Language.properties change. No backend changes were made.

Categories checked and cleared:

Category Status
C-1 Structural Data Model Change ✅ No DB schema changes
C-2 Elasticsearch Mapping Change ✅ No ES mapping changes
C-3 Content JSON Model Version Bump ✅ No ImmutableContentlet changes
C-4 DROP TABLE / DROP COLUMN ✅ No SQL DROP statements
H-1 One-Way Data Migration ✅ No runonce tasks
H-2 RENAME TABLE / RENAME COLUMN ✅ No renames
H-3 PK Restructuring ✅ No PK changes
H-4 New Content Type Field Type ✅ No new Java field type registered
H-5 Binary Storage Provider Change ✅ No storage provider changes
H-6 DROP PROCEDURE / FUNCTION ✅ None
H-7 NOT NULL Column Without Default ✅ None
H-8 VTL Viewtool Contract Change ✅ No viewtool changes
M-1 Non-Broadening Column Type Change ✅ None
M-2 Push Publishing Bundle Format ✅ None
M-3 REST/GraphQL API Contract Change ✅ No REST endpoint changes
M-4 OSGi Plugin API Breakage ✅ None

Summary: This PR is a pure frontend refactor — it removes the legacy dot-edit-content-binary-field Angular component stack and unifies Binary field rendering under the existing dot-edit-content-file-field component. The only backend-adjacent change is adding 3 new i18n keys to Language.properties (additive, safe). Rolling back to the previous release would simply revert the UI to the old component; no database, search index, or API state was altered.

Label AI: Safe To Rollback applied.

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

🤖 Codex Review — openai.gpt-5.5

**[> [🟡 Medium] core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/binary-field/binary-field.spec.ts:184 — The test now always expects the dotAI button to be disabled, but the removed isAiButtonEnabled()/test.skip(...) guard handled environments where the dotAI plugin is installed. This makes the suite fail in plugin-enabled environments even though the behavior is valid there.


Run: #27565980035 · tokens: in: 19850 · out: 3914 (reasoning: 3814) · total: 23764

- 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.
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

🤖 Bedrock Review — deepseek.v3.2

[🟡 Medium] core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/binary-field/helpers/binary-field.ts:73expectAiButtonDisabledWithTooltipWhenApplicable method may skip assertion when AI button is enabled, potentially hiding a regression where the button should be disabled but isn't. The test could pass incorrectly.

[🟡 Medium] core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/binary-field/helpers/binary-field.ts:86 — Hovering the p-button host instead of the disabled inner button is a workaround; the test may become flaky if the component's DOM structure changes.

[🟡 Medium] core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/relationship-field/helpers/relationship-field.ts:154getHeaderTexts normalizes headers to lowercase, which could cause false positives if the test expects specific casing (e.g., "Title" vs "title"). This may mask a UI issue.

[🟡 Medium] core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/relationship-field/helpers/relationship-field.ts:176dragRowToPosition uses hardcoded steps: 10 for mouse movement; this could be insufficient for reliable dragging in slower environments or with animations, causing flaky tests.

[🟡 Medium] core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/relationship-field/helpers/select-existing-content-dialog.ts:210expectRowConstrainedByText duplicates logic from expectRowConstrained (line 196). Code duplication increases maintenance cost and risk of inconsistency.

[🟡 Medium] core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/relationship-field/helpers/select-existing-content-dialog.ts:224expectRowSelectableByText duplicates logic from expectRowSelectable (line 215). Should be refactored to avoid duplication.

[🟡 Medium] core-web/apps/dotcms-ui-e2e/src/tests/login/translations.spec.ts:28waitForVisibleAndCallback is called with languageOption but the callback clicks the same locator; this could fail if the element becomes stale between wait and click. Consider using Playwright's built-in retry.

[🟠 High] core-web/libs/edit-content/src/lib/components/dot-edit-content-field/dot-edit-content-field.component.ts:60 — Removed import of DotBinaryFieldWrapperComponent but the component is still referenced in the template (line 103-111 in HTML diff). This will cause a runtime error when rendering a BINARY field. The template must be updated to use the new component (dot-edit-content-file-field).

[🟠 High] core-web/libs/edit-content/src/lib/components/dot-edit-content-field/dot-edit-content-field.component.html:103-111 — The @case (fieldTypes.BINARY) block still references <dot-binary-field-wrapper>, which is removed. This will break binary field rendering. Should be replaced with <dot-edit-content-file-field> as done for FILE and IMAGE fields.

[🟠 High] core-web/libs/edit-content/src/lib/components/dot-edit-content-field/dot-edit-content-field.component.html:175 — The @case (fieldTypes.IMAGE) block adds (valueUpdated)="onBinaryFieldValueUpdated($event)" event binding, but onBinaryFieldValueUpdated is not defined in the component (only onFileFieldValueUpdated exists). This will cause a template compilation error.

[🟠 High] core-web/libs/edit-content/src/lib/components/dot-edit-content-field/dot-edit-content-field.component.html:162 — The @case (fieldTypes.BINARY) block adds (valueUpdated)="onBinaryFieldValueUpdated($event)" event binding, but onBinaryFieldValueUpdated is not defined in the component (only onFileFieldValueUpdated exists). This will cause a template compilation error.

[🟠 High] core-web/libs/edit-content/src/lib/components/dot-edit-content-field/dot-edit-content-field.component.html:168 — The @case (fieldTypes.FILE) block adds (valueUpdated)="onBinaryFieldValueUpdated($event)" event binding, but onBinaryFieldValueUpdated is not defined in the component (only onFileFieldValueUpdated exists). This will cause a template compilation error.

[🟡 Medium] core-web/libs/edit-content/src/lib/components/dot-edit-content-field/dot-edit-content-field.component.spec.ts:183 — Test mock for BINARY field type now uses DotEditContentFileFieldComponent but does not provide all required dependencies (e.g., DotFileFieldUploadService is mocked as empty object). This may cause test failures if the component relies on specific methods.

[🔴 Critical] core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-editor/dot-binary-field-editor.component.ts — File deleted but may still be referenced elsewhere (e.g., in DotBinaryFieldWrapperComponent). This could cause runtime errors if any component or service depends on it. Ensure all references are removed.

[🔴 Critical] core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-preview/dot-binary-field-preview.component.html — File deleted but may still be referenced elsewhere. This could cause runtime errors if any component or service depends on it. Ensure all references are removed.

[🔴 Critical] core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-preview/dot-binary-field-preview.component.ts — File deleted but may still be referenced elsewhere. This could cause runtime errors if any component or service depends on it. Ensure all references are removed.

[🔴 Critical] core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-wrapper/dot-binary-field-wrapper.component.ts — File deleted but may still be referenced elsewhere (e.g., in Angular module declarations). This could cause runtime errors. Ensure all references are removed.

[🔴 Critical] core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/dot-edit-content-binary-field.component.ts — File deleted but may still be referenced elsewhere (e.g., in Angular module declarations or routes). This could cause runtime errors. Ensure all references are removed.

[🟡 Medium] core-web/apps/dotcms-ui-e2e/.eslintrc.json:2-12 — Added strict Playwright linting rules (no-wait-for-timeout, no-force-option, etc.) but existing tests may violate them (e.g., force: true removed in newEditContentForm.page.ts). This could cause lint errors in CI. Ensure all tests are updated to comply.

[🟡 Medium] core-web/apps/dotcms-ui-e2e/src/pages/newEditContentForm.page.ts:29 — Removed await this.page.waitForTimeout(500); which was a "small delay for Dojo widget initialization." This could introduce flakiness if the Dojo widget isn't ready immediately after visibility. Consider replacing with a more robust wait (e.g., for a specific element).

[🟡 Medium] core-web/apps/dotcms-ui-e2e/src/pages/newEditContentForm.page.ts:36 — Removed force: true from clicking the Dojo menu item. This could cause test flakiness if the menu is animating or covered. The change aligns with new lint rules, but may need additional waiting strategies.

[🟡 Medium] core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/binary-field/helpers/legacy-binary-field.ts:27 — Updated fileInput test ID from 'binary-field__file-input' to 'file-field__file-input'. This could break tests if the legacy component still uses the old test ID.

[🟡 Medium] core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/binary-field/helpers/legacy-binary-field.ts:28 — Updated importFromUrlBtn test ID from 'action-url-btn' to 'action-import-from-url'. This could break tests if the legacy component still uses the old test ID.


Run: #27646429691 · tokens: in: 20867 · out: 1893 · total: 22760

@nicobytes

Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved in bc5deab.

@semgrep-code-dotcms-test

Copy link
Copy Markdown
Contributor

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.

GPL-2.0

MPL-2.0

Updated the hover action for the AI button to force it, ensuring it behaves correctly when disabled. Additionally, improved the visibility checks for the legacy image editor iframe, increasing the timeout for better reliability during tests.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request unifies Binary field handling under the dot-edit-content-file-field / dot-file-field implementation, adds legacy image-editor launchers to support both the new Angular editor and the legacy JSP editor bridge, and updates unit/E2E tests and selectors accordingly.

Changes:

  • Replace the legacy dot-edit-content-binary-field implementation with the unified file-field component stack, including a custom-element bridge for legacy JSP usage.
  • Add legacy image-editor launcher services (Dojo DOM-event and dialog-iframe variants) plus store support for image-editor round-trips and editable-as-text hydration.
  • Refactor and expand Playwright E2E helpers/tests for File/Image/Binary fields, including new remove-confirmation flows and editor-opening assertions.

Reviewed changes

Copilot reviewed 71 out of 71 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
dotCMS/src/main/webapp/WEB-INF/messages/Language.properties Adds new i18n keys used by the updated file preview UI (confirm remove, download/info tooltips).
core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/components/dot-uve-contentlet-quick-edit/dot-uve-quick-edit-form/dot-uve-quick-edit-form.component.ts Removes legacy binary field component imports in EMA quick edit.
core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/components/dot-uve-contentlet-quick-edit/dot-uve-quick-edit-form/dot-uve-quick-edit-form.component.spec.ts Updates testbed overrides/mocks after binary→file-field unification.
core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/components/dot-uve-contentlet-quick-edit/dot-uve-quick-edit-form/dot-uve-quick-edit-form.component.html Renders binary/image/file fields via dot-file-field with image editor disabled for EMA quick edit.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/store/file-field.store.ts Extends store for upload-type routing, editable-as-text hydration, image-editor temp application, and contentlet-based preview hydration.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/services/image-editor/legacy-dojo-image-editor-launcher.service.ts Adds Dojo-event-based launcher for legacy JSP editor integration.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/services/image-editor/legacy-dialog-image-editor-launcher.service.ts Adds PrimeNG-dialog + postMessage-based launcher for the legacy JSP editor in the new Angular UI.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/services/image-editor/index.ts Barrel exports for the new image-editor launcher services/components/models.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/services/image-editor/image-editor-launcher.service.spec.ts Adds unit tests for the two launcher implementations.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/services/image-editor/image-editor-launcher.model.ts Introduces the launcher interface + open-params contract.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/services/image-editor/dot-legacy-image-editor-dialog.component.ts Adds dialog iframe component for embedding image-editor-standalone.jsp.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/dot-edit-content-file-field.stories.ts Removes Storybook stories for the file-field wrapper.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/dot-edit-content-file-field.component.ts Adds valueUpdated output to bubble inner field changes to parents (FileAsset autofill).
core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/dot-edit-content-file-field.component.html Forwards valueUpdated from inner dot-file-field.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-file-field/dot-file-field.component.ts Adds image-editor availability rules, legacy launcher routing, contentlet hydration for binary, and valueUpdated emission logic.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-file-field/dot-file-field.component.spec.ts Updates providers to include the new launcher services.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-file-field/dot-file-field.component.scss Removes unused drop-zone active styling block.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-file-field/dot-file-field.component.html Wires preview component edit-image action + adds preview test id.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-file-field-preview/dot-file-field-preview.component.ts Adds remove confirmation popup plumbing, edit-image output, and content propagation for editable-as-text.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-file-field-preview/dot-file-field-preview.component.spec.ts Updates component providers and stabilizes dialog interaction assertions.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-file-field-preview/dot-file-field-preview.component.scss Simplifies styles and aligns with new layout structure.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-file-field-preview/dot-file-field-preview.component.html Refactors preview markup, adds tooltips, adds confirm popup, and introduces edit-image/remove flows.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-file-field/components/dot-binary-field-ce-bridge/dot-binary-field-ce-bridge.component.ts Adds a custom-element bridge for the legacy dotcms-binary-field contract.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/utils/mock.ts Removes legacy binary-field mocks.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/utils/binary-field-utils.ts Removes legacy binary-field utils.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/store/binary-field.store.ts Removes legacy binary-field store implementation.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/store/binary-field.store.spec.ts Removes legacy binary-field store tests.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/service/dot-binary-field-validator/dot-binary-field-validator.service.ts Removes legacy binary-field validator service.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/service/dot-binary-field-validator/dot-binary-field-validator.service.spec.ts Removes legacy binary-field validator tests.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/service/dot-binary-field-edit-image/dot-binary-field-edit-image.service.ts Removes legacy binary-field edit-image service.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/service/dot-binary-field-edit-image/dot-binary-field-edit-image.service.spec.ts Removes legacy binary-field edit-image service tests.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/interfaces/index.ts Removes legacy binary-field interfaces/types.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/dot-edit-content-binary-field.component.ts Removes the legacy binary-field Angular component.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/dot-edit-content-binary-field.component.stories.ts Removes legacy binary-field Storybook stories.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/dot-edit-content-binary-field.component.scss Removes legacy binary-field styles.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/dot-edit-content-binary-field.component.html Removes legacy binary-field template.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-wrapper/dot-binary-field-wrapper.component.ts Removes the legacy wrapper that enabled the old image editor wiring.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-wrapper/dot-binary-field-wrapper.component.html Removes legacy wrapper template.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-url-mode/store/dot-binary-field-url-mode.store.ts Removes legacy “import by URL” store for the old binary field.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-url-mode/store/dot-binary-field-url-mode.spec.ts Removes legacy URL-mode store tests.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-url-mode/dot-binary-field-url-mode.component.ts Removes legacy URL-mode component.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-url-mode/dot-binary-field-url-mode.component.spec.ts Removes legacy URL-mode component tests.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-url-mode/dot-binary-field-url-mode.component.scss Removes legacy URL-mode styles.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-url-mode/dot-binary-field-url-mode.component.html Removes legacy URL-mode template.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-ui-message/dot-binary-field-ui-message.component.ts Removes legacy UI-message component.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-ui-message/dot-binary-field-ui-message.component.spec.ts Removes legacy UI-message component tests.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-ui-message/dot-binary-field-ui-message.component.scss Removes legacy UI-message styles.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-ui-message/dot-binary-field-ui-message.component.html Removes legacy UI-message template.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-preview/dot-binary-field-preview.component.ts Removes legacy preview component.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-preview/dot-binary-field-preview.component.stories.ts Removes legacy preview stories.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-preview/dot-binary-field-preview.component.scss Removes legacy preview styles.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-preview/dot-binary-field-preview.component.html Removes legacy preview template.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-editor/dot-binary-field-editor.component.ts Removes legacy “create/edit file” editor component.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-editor/dot-binary-field-editor.component.spec.ts Removes legacy editor component tests.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-editor/dot-binary-field-editor.component.scss Removes legacy editor styles.
core-web/libs/edit-content/src/lib/fields/dot-edit-content-binary-field/components/dot-binary-field-editor/dot-binary-field-editor.component.html Removes legacy editor template.
core-web/libs/edit-content/src/lib/components/dot-edit-content-field/dot-edit-content-field.component.ts Switches binary fields to render via dot-edit-content-file-field.
core-web/libs/edit-content/src/lib/components/dot-edit-content-field/dot-edit-content-field.component.spec.ts Updates binary-field component mapping/provider setup in tests.
core-web/libs/edit-content/src/lib/components/dot-edit-content-field/dot-edit-content-field.component.html Renders binary fields using dot-edit-content-file-field and forwards valueUpdated consistently.
core-web/libs/edit-content/src/index.ts Updates public exports to expose the new CE bridge instead of the removed binary component.
core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/image-field/image-field.spec.ts Adds assertion that image-field uploads do not show the “Edit image” action and refactors required-field coverage.
core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/file-field/helpers/file-field.ts Extends E2E helper for preview/edit/remove/confirm flows.
core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/file-field/file-field.spec.ts Adds E2E assertion that file-field does not show “Edit image” and refactors required-field coverage.
core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/binary-field/helpers/legacy-binary-field.ts Updates legacy editor locators/selectors to match unified field/test ids.
core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/binary-field/helpers/binary-field.ts Refactors Binary field helper to extend the unified FileField helper and updates image-editor expectations.
core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/binary-field/binary-field.spec.ts Adds new E2E cases for remove confirmation, hydration, and edit-button visibility rules.
core-web/apps/dotcms-ui-e2e/src/tests/edit-content/fields/binary-field/binary-field-image-editor.spec.ts Clarifies and validates the new-editor image-editor launch path (dialog iframe).
core-web/apps/dotcms-binary-field-builder/src/app/app.module.ts Updates the binary-field builder app to register the new CE bridge component.

…e binary field component

Renamed the method for asserting the disabled state of the AI button to `expectAiButtonDisabledWithTooltipWhenApplicable` for clarity. Improved the tooltip assertion logic to handle cases where the button is enabled. Additionally, updated the binary field component to include the `fieldVariable` in the file info structure, ensuring accurate metadata handling. Enhanced the dot-file-field-preview component to utilize the new field variable for resource link fetching.
@nicobytes

nicobytes commented Jun 16, 2026

Copy link
Copy Markdown
Member Author

Manual QA — Unified File/Binary/Image fields

PR: #36172 · Fixes: #34420
Scope: Binary field is now rendered via the unified dot-edit-content-file-field stack (same UI as File/Image). Key regressions to watch: upload/save/reload, import from URL, Edit image (Binary + image only), remove confirmation, required validation, and image editor in CE2 vs legacy.

Important — Binary field must be tested in BOTH editors

Editor How to enable Where to open content
New editor (CE2) CONTENT_EDITOR2_ENABLED = true (default) Content → New → Angular edit form (#/content/...)
Old editor (CE1 / legacy) CONTENT_EDITOR2_ENABLED = false on the Content Type Content listing → New → Dojo iframe form

All Binary TCs marked [CE2 + Legacy] must be executed twice — once per editor. File and Image fields are CE2 only in this plan.

Build: branch 34420-unify-component (or QA build from this PR)


Setup

Item Detail
Access dotAdmin, user with Content Type + content permissions
Workflow System Workflow on all test Content Types

Create 4 Content Types for Binary (2 editors × optional/required) + File + Image:

Content Type Field Variable CE2 Required
QA Binary (new editor) Binary binaryField ✅ enabled No
QA Binary required (new editor) Binary binaryField ✅ enabled Yes
QA Binary (old editor) Binary binaryField ❌ disabled No
QA File File fileField ✅ enabled No (+ required variant)
QA Image Image imageField ✅ enabled No (+ required variant)

Test data

  • Text file: any .txt with content dotCMS E2E test file content
  • Image file: any small .png
  • Import URL: https://placehold.co/800x800.png

Expected copy

Context Text
Required empty This field is mandatory
Remove confirm Are you sure you want to remove this file?
dotAI disabled tooltip Please configure dotAI to enable this feature
Must NOT appear Something went wrong

🔴 Critical (run first)

Binary field — new editor (CE2)

  • TC-BIN-001 — Upload, save, reload [CE2]
    New content → upload .txt → preview visible → Save → reopen contentlet → preview still shows file content (dotCMS E2E test file content).

  • TC-BIN-003 — Required validation [CE2]
    Required Binary CT → fill Title only → Save → stays on form, error This field is mandatory under Binary.

  • TC-BIN-008 — Edit image [CE2 only]
    Import https://placehold.co/800x800.pngEdit image visible → click → PrimeNG dialog opens → legacy editor iframe loads inside dialog.

Binary field — old editor (legacy / CE1)

  • TC-BIN-001-L — Upload, save, reload [Legacy]
    Same as TC-BIN-001 but using the old editor Content Type (CONTENT_EDITOR2_ENABLED = false).

  • TC-BIN-003-L — Required validation [Legacy]
    Same as TC-BIN-003 in the old editor form.

  • TC-BIN-009 — Edit image [Legacy only]
    Import https://placehold.co/800x800.pngEdit imageDojo #dotImageDialog opens with image tool iframe (not the CE2 PrimeNG dialog).

File field [CE2 only]

  • TC-FILE-001 — Upload, save, reload
    Upload .txt → Save → reopen → preview + file content still present.

  • TC-FILE-003 — Import from URL
    Import from URL → paste https://placehold.co/800x800.png → Import → preview visible, no error toast/400.

  • TC-FILE-005 — Required validation
    Required File empty → Save blocked with This field is mandatory.

Image field [CE2 only]

  • TC-IMG-001 — Upload, save, reload
    Upload .png → Save → reopen → preview + thumbnail visible, filename shown in metadata.

  • TC-IMG-003 — Required validation
    Required Image empty → Save blocked with This field is mandatory.


🟡 Regression (field-type rules & UX)

Binary field — run in both editors unless noted

  • TC-BIN-002 — Import from URL [CE2 + Legacy]
    Import image URL → preview/thumbnail without errors.

  • TC-BIN-004 — No Edit image for text file [CE2 + Legacy]
    Upload .txt → preview visible → Edit image must not appear.

  • TC-BIN-005 — Remove with confirmation [CE2 + Legacy]
    Upload file → Remove → confirm popup Are you sure you want to remove this file? → Remove → preview cleared, dropzone back.

  • TC-BIN-006 — Edit existing content (hydration) [CE2 + Legacy]
    Save contentlet with imported image → reopen → preview + thumbnail visible, no Something went wrong.

  • TC-BIN-007 — dotAI tooltip [CE2 + Legacy] (N/A if dotAI is configured)
    Generate With dotAI disabled → hover → tooltip Please configure dotAI to enable this feature.

File field [CE2 only]

  • TC-FILE-002 — Import dialog UI
    Import from URL → dialog shows URL input, Cancel, Import, Close (X) → X closes dialog.

  • TC-FILE-004 — No Edit image on File field
    Import image URL into File field → preview visible → Edit image must not appear.

Image field [CE2 only]

  • TC-IMG-002 — No Edit image on Image field
    Upload .pngEdit image must not appear (editor is Binary-only).

🟢 Smoke

  • TC-IMG-004 — Image field actions [CE2 only]
    Empty Image field dropzone → Generate With dotAI visible → Create New File hidden.

E2E coverage map

Manual ID Editor Playwright spec
TC-BIN-001…007 CE2 binary-field.spec.ts
TC-BIN-008 CE2 binary-field-image-editor.spec.ts (new editor)
TC-BIN-009 / TC-BIN-*-L Legacy binary-field-image-editor.spec.ts (legacy editor)
TC-FILE-001…005 CE2 file-field.spec.ts
TC-IMG-001…004 CE2 image-field.spec.ts

Bug report template

Please include: TC-ID, editor (CE2 / Legacy), Content Type + field variable, steps, expected vs actual, screenshot, browser, instance URL/version.

Tester: _______________ · Date: _______________ · Result: ☐ Pass all critical · ☐ Failures (list TC-IDs + editor)

Updated ESLint configuration for Playwright to enforce stricter rules, including disabling force clicks and requiring visibility checks. Refactored test code to remove forced clicks and added helper methods for better readability. Improved the handling of dropdown interactions and API link clicks in tests, ensuring more reliable UI interactions.

Additionally, optimized relationship field tests by introducing new methods for asserting row constraints and selections, enhancing overall test clarity and maintainability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: Safe To Rollback Area : Frontend PR changes Angular/TypeScript frontend code

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[EPIC] Image Editor Feature Parity Migrate to Angular

4 participants