Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

- The modal component accepts `close_label` as another name for `close`, which is a reserved word on SQL Server. ([#1070](https://github.com/sqlpage/SQLPage/issues/1070))

- Each item of the tracking component accepts a `link`. ([#900](https://github.com/sqlpage/SQLPage/issues/900))

## v0.47.0 (2026-10-15)
- Redesigned the official website homepage with live SQLPage examples, an interactive database sculpture, flowing section transitions, responsive layouts, and direct links to documentation and deployment guides.
- For sites that store their pages in a database, checking for page updates no longer makes other pages wait when the database is busy. In a test, another page loaded in under 1 ms instead of about 250 ms.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ VALUES (
FALSE,
FALSE
),
(
'tracking',
'link',
'A URL to open when the user clicks on the tracked item.',
'URL',
FALSE,
TRUE
),
(
'tracking',
'center',
Expand Down
6 changes: 5 additions & 1 deletion sqlpage/templates/tracking.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
<div class="mt-2">
<div class="tracking">
{{#each_row}}
<div class="tracking-block{{#if color}} bg-{{color}}{{/if}}" data-bs-toggle="tooltip" data-bs-placement="{{default ../placement "top"}}" title="{{title}}"></div>
{{#if link}}
<a href="{{link}}" class="tracking-block{{#if color}} bg-{{color}}{{/if}}" data-bs-toggle="tooltip" data-bs-placement="{{default ../placement "top"}}" title="{{title}}"></a>
{{else}}
<div class="tracking-block{{#if color}} bg-{{color}}{{/if}}" data-bs-toggle="tooltip" data-bs-placement="{{default ../placement "top"}}" title="{{title}}"></div>
{{/if}}
{{/each_row}}
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions tests/end-to-end/fixtures/tracking/day.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SELECT 'text' AS component, 'Details for ' || $day AS contents;
3 changes: 3 additions & 0 deletions tests/end-to-end/fixtures/tracking/index.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT 'tracking' AS component, 'Server uptime' AS title;
SELECT 'Monday: up' AS title, 'success' AS color, 'day.sql?day=Monday' AS link;
SELECT 'Tuesday: down' AS title, 'danger' AS color;
26 changes: 26 additions & 0 deletions tests/end-to-end/fixtures/tracking/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { expect, test } from "../../fixture.ts";

test("tracking block with a link opens it", async ({ page }) => {
await page.locator(".tracking-block").first().click();
await expect(page).toHaveURL(/\/tracking\/day\.sql\?day=Monday$/);
await expect(page.getByText("Details for Monday")).toBeVisible();
});

test("tracking block without a link is not a link", async ({ page }) => {
await expect(page.locator(".tracking-block").nth(1)).not.toHaveAttribute(
"href",
);
});

test("tracking block with a link looks like one without", async ({ page }) => {
const blocks = page.locator(".tracking-block");
const linked = await blocks.nth(0).boundingBox();
const plain = await blocks.nth(1).boundingBox();
expect(linked?.width).toBe(plain?.width);
expect(linked?.height).toBe(plain?.height);
});

test("tracking block with a link keeps its tooltip", async ({ page }) => {
await page.locator(".tracking-block").first().hover();
await expect(page.getByRole("tooltip")).toHaveText("Monday: up");
});
Loading