Overview

When I hover over sections in the insert panel, the preview isn't rendering an actual preview of the section.

Proposed resolution

User interface changes

CommentFileSizeAuthor
Screenshot 2024-09-27 at 10.08.42 AM.png208.36 KBlauriii
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lauriii created an issue. See original summary.

ctrladel made their first commit to this issue’s fork.

ctrladel’s picture

Status: Active » Needs review

The section previews are actually rendering correctly but are being pushed outside of the tooltip by "undefined" text which was the preview trying to include the css/js header/js footer. css, js_header, and js_footer weren't defined in the component definition which caused the include statements to ultimately be 'undefined' instead of an html string.

{
  "id": "fakeSection2",
  "name": "Fake Section 2",
  "layoutModel": { ... },
  "default_markup": "<h1 style=\"background: black; color: white;\">TODO</h1>"
}

bnjmnm made their first commit to this issue’s fork.

bnjmnm’s picture

Good find @ctrladel ! Fortunately, I don't think we need to make the css, js_header, and js_footer properties "optional" because these properties are guaranteed to be present in a Drupal-provided component list. The issue here was the dummy data in sections.ts was incomplete so updating just that should be sufficient.

wim leers’s picture

Status: Needs review » Needs work
shyam_bhatt’s picture

Assigned: Unassigned » shyam_bhatt

shyam_bhatt’s picture

Assigned: shyam_bhatt » Unassigned
Status: Needs work » Needs review

jessebaker made their first commit to this issue’s fork.

jessebaker’s picture

I've merged in the change to fix the "fake sections" preview. @lauriii I'm not sure if this issue should remain open until the actual real implementation of sections is complete or if you are happy that it will be address as part of that work (#3459229: Allow saving component compositions as sections (frontend only))

lauriii’s picture

Status: Needs review » Fixed

Let's close this one. We can deal with the rest in #3459229: Allow saving component compositions as sections (frontend only) / follow-ups to that.

kristen pol’s picture

Assigned: lauriii » Unassigned

crediting shyam_bhatt (to match the commit) and jessebaker for code and review and lauri for reporting

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.