Insert panel preview is not working for sections

Created on 27 September 2024, 3 months ago

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

🐛 Bug report
Status

Active

Version

0.0

Component

Page builder

Created by

🇫🇮Finland lauriii Finland

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @lauriii
  • First commit to issue fork.
  • Merge request !337#3477199: Fix section preview rendering → (Open) created by ctrladel
  • Pipeline finished with Success
    3 months ago
    Total: 453s
    #294369
  • 🇺🇸United States ctrladel North Carolina, USA

    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": {
        "layout": {
          "nodeType": "root",
          "name": "root",
          "uuid": "root",
          "children": [
            {
              "uuid": "abcde",
              "nodeType": "component",
              "type": "experience_builder:two_column",
              "children": [
                {
                  "uuid": "two-column-uuid-slot-column_one",
                  "name": "column_one",
                  "nodeType": "slot",
                  "children": [
                    {
                      "uuid": "fghij",
                      "nodeType": "component",
                      "type": "experience_builder:my-hero",
                      "children": []
                    }
                  ]
                },
                {
                  "uuid": "two-column-uuid-slot-column_two",
                  "name": "column_two",
                  "nodeType": "slot",
                  "children": [
                    {
                      "uuid": "klmno",
                      "nodeType": "component",
                      "type": "experience_builder:my-hero",
                      "children": []
                    }
                  ]
                }
              ]
            }
          ]
        },
        "model": {
          "abcde": {
            "width": 50,
            "name": "Two column"
          },
          "fghij": {
            "heading": "A hero in slot 1!",
            "subheading": "This text was defined in the section.",
            "cta1": "Yes",
            "cta2": "No",
            "cta1href": "https://drupal.org",
            "cta2href": "https://google.com",
            "name": "Hero"
          },
          "klmno": {
            "heading": "A hero in slot 2!",
            "subheading": "Text saved in the section",
            "cta1": "Up",
            "cta2": "Down",
            "cta1href": "https://drupal.org",
            "cta2href": "https://google.com",
            "name": "Hero"
          }
        }
      },
      "default_markup": "<h1 style=\"background: black; color: white;\">TODO</h1>"
    }
    
  • First commit to issue fork.
  • 🇺🇸United States bnjmnm Ann Arbor, MI

    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.

  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
  • Merge request !353Updated section.ts file with parameters. → (Merged) created by shyam_bhatt
  • Pipeline finished with Failed
    3 months ago
    Total: 433s
    #302669
  • Pipeline finished with Success
    3 months ago
    Total: 508s
    #302674
  • Pipeline finished with Skipped
    2 months ago
    #315782
  • First commit to issue fork.
  • 🇬🇧United Kingdom jessebaker

    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 ( 📌 Allow saving component compositions as sections Postponed )

  • 🇫🇮Finland lauriii Finland

    Let's close this one. We can deal with the rest in 📌 Allow saving component compositions as sections Postponed / follow-ups to that.

  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

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

  • Status changed to Fixed 17 days ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024