chore(UVE): Remove unsued variantId in ContainerPayload #34404
Closed
+5,383
−4,857
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes: #34300
Cleanup: Remove container variantId usage and use page-level variantId
Problem
The codebase was attempting to extract
variantIdfrom container objects viacontainer?.parentPermissionable?.variantId, but this property no longer exists after PR #32890. This resulted invariantIdalways beingundefinedwhen used in container operations.Additionally, containers don't actually have
variantId- it's a page-level concept, not a container-level one. The/api/v1/page/copyContentendpoint expects the page-level variantId in theDotTreeNodepayload, not a container's variantId.Changes
Removed
variantIdfromgetContainersDatafunction (libs/sdk/uve/src/lib/dom/dom.utils.ts)variantIdfromparentPermissionable.variantIdRemoved
variantIdfromEditableContainerDatainterface (libs/sdk/types/src/lib/editor/public.ts)variantId?: stringproperty since containers don't have variantIdUpdated
getCurrentTreeNodeto use page-level variantId (libs/portlets/edit-ema/portlet/src/lib/store/features/editor/withEditor.ts)container.variantIdtostore.$variantId()which provides the page-level variantId/api/v1/page/copyContentendpointMade
ContainerPayload.variantIdoptional (libs/portlets/edit-ema/portlet/src/lib/shared/models.ts)variantId: stringtovariantId?: stringwith documentation explaining containers don't have variantIdUpdated tests (
libs/portlets/edit-ema/portlet/src/lib/store/features/editor/withEditor.spec.ts)Impact
/api/v1/page/copyContentendpoint now receives the correct page-level variantId instead ofundefinedContainerPayload.variantIdis now optional, maintaining backward compatibilityTesting
getCurrentTreeNodeuses page-level variantId fromstore.$variantId()Related
parentPermissionablefrom container API responses