[MGNLFE-101] Fallback component to be used when component ID is not recognized Created: 14/Jul/21  Updated: 25/Apr/23  Resolved: 27/Oct/22

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

Type: Story Priority: Neutral
Reporter: Christopher Zimmermann Assignee: Phong Le Quoc
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: 16d 0.75h Time Spent: 16d 0.75h
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Issue Links:
Problem/Incident
causes MGNLFE-383 Hide fallbackComponent-related warnin... Closed
documentation
to be documented by MGNLFE-171 DOCS: Fallback component Closed
relation
is related to MGNLFE-368 Uses config for angular as vue/react Open
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLFE-343 Implementation Sub-task Completed Phong Le Quoc  
MGNLFE-347 PiQA Sub-task Completed Robert Šiška  
MGNLFE-348 Review Sub-task Completed Canh Nguyen  
MGNLFE-349 QA Sub-task Completed Robert Šiška  
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Epic Link: SaaS TPR - SPA
Sprint: DevX 21, DevX 22
Story Points: 5
Team: DeveloperX

 Description   

As a developer I always want existing content to be rendered in a page, even if the frontend component has not been built yet.

As an author I would like to start entering content and seeing content, even if the developers have not yet provisioned the frontend component.

Notes: 

Supply a simple default fallback component in each of the frontend helper libraries that renders all of the root props it recieves (but not the metadata).

This would be helpful during development - that the page just renders something even if I have not created a frontend component yet. It would also be useful when I make a mistake - such as not supplying the proper mapping configuration, or forgetting it, or making a TYPO - then at least I see that the content is indeed there.

Rendering should be simple, for example.

 

Template not found: my-light-module:/templates/components/booook 

name: Gone with the wind.
pages: 556
description: Some kind of description about the thing I don't know what exactly.
ISBN: 4848493938383
category: [category uuid]

 

In addition to the default fallback compoent, allow a developer to optionally provide their own fallback component.  Which one to use could be included in the 'config' object which is passed to EditablePage .

const config = {  
  componentMappings: {    
    'nextjs-ssr-minimal-lm:pages/basic': Basic,    
    'spa-lm:components/headline': Headline,    
    'spa-lm:components/image': Image,     
  },

  fallbackComponent: MyFallbackComp,

};

 

 

AC:

  • Only is used during development or when authoring. Should not be displayed in production/published context. In that case nothing should be rendered.
  • Only is used when Authoring in PageEditor, when not in page editor then no fallback is rendered.
  • In the default component, only render root nodes, not subnodes - to prevent too much content from being rendered.


 Comments   
Comment by Christopher Zimmermann [ 09/Dec/21 ]

Requested by partner dotfusion: "Fallback template and fallback component with the <EditablePage’s config prop - high priority"

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