[MGNLFE-492] Preview page action does not honor variants Created: 08/Jun/23  Updated: 23/Oct/23  Resolved: 13/Jun/23

Status: Closed
Project: Magnolia Frontend Helpers
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Phong Le Quoc Assignee: Bartosz Staryga
Resolution: Not an issue Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: SPA Maintenance
Team: DeveloperX

 Description   

Steps to reproduce:

  1. Use react-minimal of minimal-headless-spa-demo
  2. Create a paragraph component with some variants
  3. Choose a variant and then "Preview page"

=> Expected: Variant is shown

=> Actual: Original content is shown

Analyze:

The problem should come from GetMagnoliaContext

if (magnoliaContext.isMagnolia && !mgnlPreviewAsVisitor) {
  searchParams.set('variants', 'all');
} 


 Comments   
Comment by Bartosz Staryga [ 08/Jun/23 ]

AFAIK it's that is correct behaviour, in preview the page should behave as regular page. So we see components as they were set in p13n. We can see still different variants by:

  • preview as visitor
  • adding correct traits

But would be good if e.g. czimmermann confirmed that that is the case, or differently

Comment by Bartosz Staryga [ 13/Jun/23 ]

plequoc 👍

Generated at Mon Feb 12 05:47:57 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.