GIn Theme and Webform Analysis admin view is resizing charts

Created on 15 January 2024, 10 months ago
Updated 11 May 2024, 6 months ago

Problem/Motivation

GIn Theme and Webform Analysis admin view is resizing charts, making the charts unreadable.

Steps to reproduce

Install Webform, and Webform Analysis
Create a webform
Generate some results
Go to /admin/structure/webform/manage/your-webform/results/analysis

Proposed resolution

Fix the chart view

πŸ› Bug report
Status

Active

Version

1.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States travisc

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

Comments & Activities

  • Issue created by @travisc
  • πŸ‡ΊπŸ‡ΈUnited States travisc
  • πŸ‡¨πŸ‡­Switzerland saschaeggi Zurich

    I'll move this to the webform module, Cheers ✌️

  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    Now, I am moving this to the Webform Analysis module's issue queue.

  • πŸ‡ΊπŸ‡ΈUnited States mikelutz Michigan, USA

    This is because gin wraps an extra div around tables in its table.html.twig template. There's a few solutions here, but we might need to provide out own table template for stability across admin themes. My immediate workaround is to put the following hook in a custom module in my project:

    /**
     * Implements hook_webform_analysis_component().
     */
    function my_module_preprocess_webform_analysis_component(&$variables) {
      $variables['data']['#attributes']['class'][] = 'field-multiple-table';
    }
    

    For whatever reason, gin's hook_theme_suggestions switches to a simple table template with no wrapper if the 'field-multiple-table' class is in the render array, so the above code surprisingly works just fine in a pinch.

  • πŸ‡³πŸ‡±Netherlands batigolix Utrecht
Production build 0.71.5 2024