diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 948799102..f3d0c71c6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,6 +17,8 @@ jobs: uses: oven-sh/setup-bun@v1 - name: Install dependencies run: bun install --frozen-lockfile + env: + PUPPETEER_SKIP_DOWNLOAD: 1 - name: Cache Next.js build uses: actions/cache@v3 with: @@ -95,6 +97,8 @@ jobs: uses: oven-sh/setup-bun@v1 - name: Install dependencies run: bun install --frozen-lockfile + env: + PUPPETEER_SKIP_DOWNLOAD: 1 - name: Run visual tests run: bun ./tests/pagespeed-testing.ts $DEPLOYMENT_URL env: @@ -110,6 +114,8 @@ jobs: uses: oven-sh/setup-bun@v1 - name: Install dependencies run: bun install --frozen-lockfile + env: + PUPPETEER_SKIP_DOWNLOAD: 1 - run: bun format --check . lint: runs-on: ubuntu-latest @@ -121,6 +127,8 @@ jobs: uses: oven-sh/setup-bun@v1 - name: Install dependencies run: bun install --frozen-lockfile + env: + PUPPETEER_SKIP_DOWNLOAD: 1 - run: bun lint typecheck: runs-on: ubuntu-latest @@ -132,4 +140,6 @@ jobs: uses: oven-sh/setup-bun@v1 - name: Install dependencies run: bun install --frozen-lockfile + env: + PUPPETEER_SKIP_DOWNLOAD: 1 - run: bun typecheck diff --git a/src/components/DocumentView/Table/ViewCards.tsx b/src/components/DocumentView/Table/ViewCards.tsx index 3f0b18724..5e67b45a5 100644 --- a/src/components/DocumentView/Table/ViewCards.tsx +++ b/src/components/DocumentView/Table/ViewCards.tsx @@ -18,9 +18,7 @@ export function ViewCards(props: TableViewProps) { 'gap-4', 'grid-cols-1', 'min-[432px]:grid-cols-2', - view.cardSize === 'large' - ? 'md:grid-cols-2' - : 'md:grid-cols-3', + view.cardSize === 'large' ? 'md:grid-cols-2' : 'md:grid-cols-3', block.data.fullWidth ? ['max-w-full', 'large:flex-column'] : null, )} > diff --git a/src/components/DocumentView/Table/ViewGrid.tsx b/src/components/DocumentView/Table/ViewGrid.tsx index 0e44f0906..74980eebe 100644 --- a/src/components/DocumentView/Table/ViewGrid.tsx +++ b/src/components/DocumentView/Table/ViewGrid.tsx @@ -55,6 +55,11 @@ export function ViewGrid(props: TableViewProps) { const tableTH = columnsOverThreshold ? ['py-3'] : ['py-1', 'pt-0']; + // Only show the header when configured and not empty + const withHeader = + !view.hideHeader && + view.columns.some((columnId) => block.data.definition[columnId].title.trim().length > 0); + return (
) { {/* Table: */} - {view.hideHeader ? null : ( + {withHeader ? ( {view.columns.map((column) => { @@ -172,7 +177,7 @@ export function ViewGrid(props: TableViewProps) { })} - )} + ) : null} *+*]:border-t')}> {records.map((record) => { return ; diff --git a/tests/visual-testing.ts b/tests/visual-testing.ts index f3766cde3..5bf715bdf 100644 --- a/tests/visual-testing.ts +++ b/tests/visual-testing.ts @@ -201,6 +201,10 @@ const testCases: TestsCase[] = [ name: 'Tabs', url: 'blocks/tabs', }, + { + name: 'Tables', + url: 'blocks/tables', + }, { name: 'Expandables', url: 'blocks/expandables',