From dccd19983605e443605f6ea61703070dc1466228 Mon Sep 17 00:00:00 2001 From: Tomi Virkki Date: Thu, 22 Aug 2024 15:45:09 +0300 Subject: [PATCH] testing --- packages/dashboard/src/vaadin-dashboard-layout-mixin.js | 5 ++++- packages/dashboard/src/vaadin-dashboard-section.js | 5 +++-- packages/dashboard/test/dashboard-layout.test.ts | 3 +++ packages/dashboard/test/dashboard.test.ts | 3 +++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/dashboard/src/vaadin-dashboard-layout-mixin.js b/packages/dashboard/src/vaadin-dashboard-layout-mixin.js index 5d3c819b87c..e955b7080be 100644 --- a/packages/dashboard/src/vaadin-dashboard-layout-mixin.js +++ b/packages/dashboard/src/vaadin-dashboard-layout-mixin.js @@ -36,10 +36,13 @@ export const DashboardLayoutMixin = (superClass) => var(--_vaadin-dashboard-default-col-max-width) ); + /* Effective maxcolumn count */ + --_vaadin-dashboard-col-max-count: var(--vaadin-dashboard-col-max-count, 6); + /* Effective column count */ --_vaadin-dashboard-effective-col-count: min( var(--_vaadin-dashboard-col-count), - var(--vaadin-dashboard-col-max-count) + var(--_vaadin-dashboard-col-max-count) ); display: grid; diff --git a/packages/dashboard/src/vaadin-dashboard-section.js b/packages/dashboard/src/vaadin-dashboard-section.js index 72562373dc3..3c0dc01e540 100644 --- a/packages/dashboard/src/vaadin-dashboard-section.js +++ b/packages/dashboard/src/vaadin-dashboard-section.js @@ -34,7 +34,8 @@ class DashboardSection extends ControllerMixin(ElementMixin(PolylitMixin(LitElem :host { display: grid; grid-template-columns: subgrid; - grid-column: 1 / -1 !important; + --_vaadin-dashboard-section-column: 1 / calc(var(--_vaadin-dashboard-effective-col-count) + 1); + grid-column: var(--_vaadin-dashboard-section-column) !important; gap: var(--vaadin-dashboard-gap, 1rem); } @@ -44,7 +45,7 @@ class DashboardSection extends ControllerMixin(ElementMixin(PolylitMixin(LitElem header { display: flex; - grid-column: 1 / -1; + grid-column: var(--_vaadin-dashboard-section-column); justify-content: space-between; align-items: center; } diff --git a/packages/dashboard/test/dashboard-layout.test.ts b/packages/dashboard/test/dashboard-layout.test.ts index adda0513ddb..63ce62ac228 100644 --- a/packages/dashboard/test/dashboard-layout.test.ts +++ b/packages/dashboard/test/dashboard-layout.test.ts @@ -14,6 +14,9 @@ import { setMinimumColumnWidth, } from './helpers.js'; +// eslint-disable-next-line no-console +console.log(navigator.userAgent); + /** * Validates the given grid layout. * diff --git a/packages/dashboard/test/dashboard.test.ts b/packages/dashboard/test/dashboard.test.ts index 373bef276fb..7d0ae152b33 100644 --- a/packages/dashboard/test/dashboard.test.ts +++ b/packages/dashboard/test/dashboard.test.ts @@ -7,6 +7,9 @@ import { getElementFromCell, setGap, setMaximumColumnWidth, setMinimumColumnWidt type TestDashboardItem = DashboardItem & { id: string }; +// eslint-disable-next-line no-console +console.log(navigator.userAgent); + describe('dashboard', () => { let dashboard: Dashboard; const columnWidth = 100;