Details
-
Improvement
-
Resolution: Fixed
-
Neutral
-
1.3.2
-
None
-
None
-
-
Empty show more show less
-
DevX 29, DevX 30
-
1
Description
Currently, some actions always have been done on the variant variable. However, we should do some checks to make sure the variable has the correct value for backward compatibility.
const variant = templateAnnotations[path + '/variants/' + selectedVariant]; modified[path] = variant.replace(contentAttributeRegex, comment.match(contentAttributeRegex)[0]); modified[path] = modified[path].concat(' ', comment.match(variantsAttributesRegex).join(' ')); modified[path] = modified[path].concat(' ', `selectedVariant="${selectedVariant}"`);
Note:
- The variant is only null/undefined if the template annotation endpoint definition is wrong.
Technical detail:
When there is a variant on a page and the user uses the Edit page function, there will be an error.
Steps to reproduce on frontend-helper/samples/react-sample:
1. Using frontend-helper 1.3.0:
- Create a page
- Create a title component
- Create some variants on the title component
2. Add and template annotation endpoint definition to light-modules, ex: light-modules/react-lm/restEndpoints/templateAnnotations/website.yaml
implementationClass: info.magnolia.rendering.spa.rest.v1.TemplateAnnotationEndpoint workspace: website endpointPath: template-annotations/v1/website bypassWorkspaceAcls: true
3. Edit .env file to add website
REACT_APP_MGNL_API_TEMPLATES=/.rest/template-annotations/v1/website
4. Using frontend-helper 1.3.2:
- Edit the page above
- Lock at the browser console
Checklists
Attachments
Issue Links
- is depended upon by
-
MGNLFE-409 Release frontend-helpers 1.3.3
-
- Closed
-
- relates to
-
MGNLFE-372 Creating component variant breaks editor JS
-
- Closed
-