-
-
Notifications
You must be signed in to change notification settings - Fork 154
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Introduction
Shell submenu items with active=false are displayed as if active=true if their parent item is set to active=true.
To Reproduce
This is my shell script.
SELECT 'shell' AS component,
'Standard Manager' AS title,
'/' AS link,
'fluid' AS layout,
TRUE AS sidebar,
'dark' AS theme,
jsonb_build_object('link', '/', 'title', 'Home', 'active', sqlpage.path() IN ('/','/index.sql')) AS menu_item,
jsonb_build_object('title', 'Standards', 'active', starts_with(sqlpage.path(), '/standard/'), 'submenu',
jsonb_build_array(
jsonb_build_object('link', '/standard/', 'title', 'All', 'active', sqlpage.path() IN ('/standard/', '/standard/index.sql')),
jsonb_build_object('link', '/standard/replace_soon.sql', 'title', 'Replace Soon', 'active', sqlpage.path() = '/standard/replace_soon.sql')
)) AS menu_item,
jsonb_build_object('link', '/standard_template/', 'title', 'Templates', 'active', starts_with(sqlpage.path(), '/standard_template/')) AS menu_item,
jsonb_build_object('link', '/admin/', 'title', 'Admin', 'active', starts_with(sqlpage.path(), '/admin/')) AS menu_item,
jsonb_build_object('link', '/logout.sql', 'title', 'Logout', 'icon', 'logout') AS menu_item
;
Create /standard/replace_soon.sql and start it with the following query.
SELECT 'dynamic' AS component,
sqlpage.run_sql('shell.sql', json_object('title', 'Standard Manager')) AS properties;
Run sqlpage and open http://localhost:8080/standard/replace_soon.sql
Open the 'Standards' drop down item.
Actual behavior
The Standards
, Replace Soon
, and All
menu item were all highlighted.
Changing the shell component for 'debug' confirmed that the 'All' menu item should not be active.
Screenshots
The shell menu wihen opening https://localhost:8080/standard/replace_soon.sql

Expected behavior
- The
Standards
menu item and theReplace Soon
menu item should be higlighted, - The
All
menu item should not be highlighted.
Version information
- OS: Windows Server 2022
- Database Postgres 17
- SQLPage Version v0.38.0
Additional context
I changed the shell
component to debug
to make sure that the query was returning "active": false
for the All
menu item. The results below show that this was the case.
{
"component": "debug",
"title": "Standard Manager",
"link": "/",
"layout": "fluid",
"sidebar": true,
"theme": "dark",
"menu_item": [
{
"link": "/",
"title": "Home",
"active": false
},
{
"title": "Standards",
> "active": true,
"submenu": [
{
"link": "/standard/",
"title": "All",
> "active": false
},
{
"link": "/standard/replace_soon.sql",
"title": "Replace Soon",
> "active": true
}
]
},
{
"link": "/standard_template/",
"title": "Templates",
"active": false
},
{
"link": "/admin/",
"title": "Admin",
"active": false
},
{
"icon": "logout",
"link": "/logout.sql",
"title": "Logout"
}
]
}
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working