diff --git a/CHANGELOG.md b/CHANGELOG.md index 653be95d..10ab5498 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,11 @@ - Updated sqlparser to [v0.56](https://github.com/apache/datafusion-sqlparser-rs/blob/main/changelog/0.56.0.md), with many improvements including: - Add support for the xmltable(...) function in postgres - Add support for MSSQL IF/ELSE statements. + - Added four optional properties to the `big_number` component: + - title_link (string): the URL or path that the Big Number’s title should link to, if any + - title_link_new_tab (bool): how the title link is opened + - value_link (string): the URL or path that the Big Number’s value should link to, if any + - value_link_new_tab (bool): open the link in a new tab - Add support for nice "switch" checkboxes in the form component using `'switch' as type` - Add support for headers in the form component using diff --git a/examples/official-site/sqlpage/migrations/49_big_number.sql b/examples/official-site/sqlpage/migrations/49_big_number.sql index 001a7e4e..e18db309 100644 --- a/examples/official-site/sqlpage/migrations/49_big_number.sql +++ b/examples/official-site/sqlpage/migrations/49_big_number.sql @@ -12,6 +12,10 @@ INSERT INTO parameter(component, name, description, type, top_level, optional) S ('class', 'An optional CSS class to be added to the component for custom styling', 'TEXT', TRUE, TRUE), -- Item-level parameters (for each big number) ('title', 'The title or label for the big number.', 'TEXT', FALSE, TRUE), + ('title_link', 'A link for the Big Number title. If set, the entire title becomes clickable.', 'TEXT', FALSE, TRUE), + ('title_link_new_tab', 'If true, the title link will open in a new tab/window.', 'BOOLEAN', FALSE, TRUE), + ('value_link', 'A link for the Big Number value. If set, the entire value becomes clickable.', 'TEXT', FALSE, TRUE), + ('value_link_new_tab', 'If true, the value link will open in a new tab/window.', 'BOOLEAN', FALSE, TRUE), ('value', 'The main value to be displayed prominently.', 'TEXT', FALSE, FALSE), ('unit', 'The unit of measurement for the value.', 'TEXT', FALSE, TRUE), ('description', 'A description or additional context for the big number.', 'TEXT', FALSE, TRUE), @@ -30,6 +34,10 @@ INSERT INTO example(component, description, properties) VALUES "title":"Sales", "value":75, "unit":"%", + "title_link": "#sales_dashboard", + "title_link_new_tab": true, + "value_link": "#sales_details", + "value_link_new_tab": false, "description":"Conversion rate", "change_percent": 9, "progress_percent": 75, @@ -48,8 +56,8 @@ INSERT INTO example(component, description, properties) VALUES ('big_number', 'Big numbers with dropdowns and customized layout', json('[ {"component":"big_number", "columns":3, "id":"colorfull_dashboard"}, - {"title":"Users", "value":"1,234", "color": "red" }, - {"title":"Orders", "value":56, "color": "green" }, + {"title":"Users", "value":"1,234", "color": "red", "title_link": "#users", "title_link_new_tab": false, "value_link": "#users_details", "value_link_new_tab": true }, + {"title":"Orders", "value":56, "color": "green", "title_link": "#orders", "title_link_new_tab": true }, {"title":"Revenue", "value":"9,876", "unit": "€", "color": "blue", "change_percent": -7, "dropdown_item": [ {"label":"This week", "link":"?days=7&component=big_number#colorfull_dashboard"}, {"label":"This month", "link":"?days=30&component=big_number#colorfull_dashboard"}, diff --git a/sqlpage/templates/big_number.handlebars b/sqlpage/templates/big_number.handlebars index 272836de..2b689ebe 100644 --- a/sqlpage/templates/big_number.handlebars +++ b/sqlpage/templates/big_number.handlebars @@ -10,9 +10,23 @@ >