fix: align Host Content Type behavior in New Edit Mode with Old Edit Mode#34970
fix: align Host Content Type behavior in New Edit Mode with Old Edit Mode#34970
Conversation
…eature flag is enabled #34724 The edit-host and create-host custom events were hardcoded to always use the legacy editor, bypassing the New Edit Mode feature flag check. This caused the Sites Portlet to always open Host content types in the old editor even when New Edit Mode was enabled. Now both events follow the same feature-flag-aware routing as edit-contentlet and create-contentlet, checking content type metadata before deciding which editor to use.
|
Claude finished @oidacra's task —— View job PR Review CompleteAnalysis Summary:Reviewed the changes to align Host Content Type behavior between New and Old Edit Mode. Found one potential issue that should be addressed: Issues Found:
'edit-host': contentEditorFeatureFlag
? this.editContentlet.bind(this)
: this.editContentletLegacy.bind(this),
'create-host': contentEditorFeatureFlag
? this.createContentlet.bind(this)
: this.createContentletLegacy.bind(this)Problem: The Risk: If host events don't include the
Recommendation: Add defensive checks in the Test Coverage:✅ New test cases properly cover both feature flag enabled/disabled scenarios for both Code Quality:✅ Changes follow established patterns used for Edge Cases to Consider:
Overall: Clean implementation following established patterns, but verify host event data structure to prevent potential runtime issues. |
…tent type variable The JSP iframe fires edit-host/create-host events without a contentType field in the data payload. The generic editContentlet/createContentlet methods read contentType from the event, resulting in getContentType(undefined) and a 404 error. Added dedicated editHost and createHost methods that always pass 'Host' as the content type variable to getContentType, then route accordingly. Updated tests to match realistic event payloads from the JSP iframe.
|
Claude finished @oidacra's task —— View job PR Review Complete
Issues Found:
'edit-host': contentEditorFeatureFlag
? this.editHost.bind(this) // ❌ Should be this.editContentlet.bind(this)
: this.editContentletLegacy.bind(this),
'create-host': contentEditorFeatureFlag
? this.createHost.bind(this) // ❌ Should be this.createContentlet.bind(this)
: this.createContentletLegacy.bind(this)Problem: The code binds to dedicated Risk: This creates inconsistent behavior:
Other Issues:
Recommendation: Remove the dedicated Test Coverage:✅ Tests adequately cover both feature flag scenarios Edge Cases:
Verdict: The implementation doesn't match the PR description. The code should use the existing generic methods rather than creating Host-specific duplicates. |
… new content #34724 The backend endpoint /api/v1/workflow/initialactions/contenttype/Host explicitly returns an empty array for Host content types (WorkflowAPIImpl.java:2686-2692). This causes the new edit content form to show "Select Workflow" instead of auto-assigning the single available workflow. Added a fallback in initializeNewContent: if getDefaultActions (initialactions) returns empty, it falls back to getWorkFlowActions (defaultactions) which does return the correct workflow schemes.
|
Claude finished @oidacra's task —— View job PR Review Complete
Issues Found:
'edit-host': contentEditorFeatureFlag
? this.editHost.bind(this) // ❌ Should be this.editContentlet.bind(this)
: this.editContentletLegacy.bind(this),
'create-host': contentEditorFeatureFlag
? this.createHost.bind(this) // ❌ Should be this.createContentlet.bind(this)
: this.createContentletLegacy.bind(this)Problem: The code binds to dedicated Risk: This creates inconsistent behavior:
Other Issues:
Recommendation: Remove the dedicated Test Coverage:✅ Tests adequately cover both feature flag scenarios Edge Cases:
Verdict: The implementation doesn't match the PR description. The code should use the existing generic methods rather than creating Host-specific duplicates. |
Summary
Closes #34724
edit-hostandcreate-hostcustom events through the feature-flag-aware editor selection logic, matching howedit-contentletandcreate-contentletalready workChanges
dot-custom-event-handler.service.ts— Replaced hardcoded legacy editor bindings foredit-hostandcreate-hostwith conditional bindings that check thecontentEditorFeatureFlag, identical to the pattern used foredit-contentlet/create-contentlet.dot-custom-event-handler.service.spec.ts— Added 6 test cases covering:edit-host→ new editor (catchall + limited content types)create-host→ new editor (catchall + limited content types)edit-host→ legacy fallback when metadata flag disabledcreate-host→ legacy fallback when metadata flag disabledTest plan