diff options
| author | Carlos Roca <carlos.roca@tecnativa.com> | 2024-09-25 06:19:08 +0000 |
|---|---|---|
| committer | Lucas Lefèvre (lul) <lul@odoo.com> | 2025-02-05 12:54:32 +0000 |
| commit | 2917b4cf37fe8d5d75d550912d0760a89a4b5096 (patch) | |
| tree | 86aeda283eca684cefe6fa28112f3f63f0b71714 | |
| parent | a088b5ffc51697ea3a43d7b5f1c2de99a7224658 (diff) | |
[FIX] spreadsheet_dashboard: Graphs in Mobile view aren't showed correctly
When we display more than one chart in the mobile view, the height of
the elements is being adjusted to fill 100%, which in some cases
causes a size that makes it impossible to view the chart.
To solve this, we have added a div that will encompass the chart
and set a minimum height as defined in the spreadsheets, ensuring that
the elements are always displayed correctly.
closes odoo/odoo#196523
X-original-commit: d22e974ccf82aa6d744ad0fc416c1a66e8530b3e
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2 files changed, 6 insertions, 7 deletions
diff --git a/addons/spreadsheet_dashboard/static/src/bundle/dashboard_action/mobile_figure_container/mobile_figure_container.js b/addons/spreadsheet_dashboard/static/src/bundle/dashboard_action/mobile_figure_container/mobile_figure_container.js index 495249d73b3..713084ca2a8 100644 --- a/addons/spreadsheet_dashboard/static/src/bundle/dashboard_action/mobile_figure_container/mobile_figure_container.js +++ b/addons/spreadsheet_dashboard/static/src/bundle/dashboard_action/mobile_figure_container/mobile_figure_container.js @@ -28,7 +28,6 @@ export class MobileFigureContainer extends Component { .map((figure) => ({ ...figure, width: window.innerWidth, - height: 300, })); } diff --git a/addons/spreadsheet_dashboard/static/src/bundle/dashboard_action/mobile_figure_container/mobile_figure_container.xml b/addons/spreadsheet_dashboard/static/src/bundle/dashboard_action/mobile_figure_container/mobile_figure_container.xml index a7e78a5d66e..4e8e02a47f4 100644 --- a/addons/spreadsheet_dashboard/static/src/bundle/dashboard_action/mobile_figure_container/mobile_figure_container.xml +++ b/addons/spreadsheet_dashboard/static/src/bundle/dashboard_action/mobile_figure_container/mobile_figure_container.xml @@ -4,12 +4,12 @@ <t t-if="!figures.length"> Only chart figures are displayed in small screens but this dashboard doesn't contain any </t> - <t + <div t-foreach="figures" t-as="figure" - t-component="getFigureComponent(figure)" - onFigureDeleted="() => {}" - figure="figure" - t-key="figure.id"/> + t-key="figure.id" + t-attf-style="min-height: #{figure.height}px;" + > + <t t-component="getFigureComponent(figure)" figure="figure" onFigureDeleted="() => {}"/> + </div> </t> </templates> - |
