From aef7ca1600293a122f800647b95ca57b4be61890 Mon Sep 17 00:00:00 2001 From: Aday BA Date: Wed, 7 Feb 2024 21:31:22 +0000 Subject: [PATCH] Fixes to the nav_bar group selection subcategory order (#3344) --- apps/dashboard/app/apps/nav_bar.rb | 2 +- apps/dashboard/test/apps/nav_bar_test.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/dashboard/app/apps/nav_bar.rb b/apps/dashboard/app/apps/nav_bar.rb index 794a8db93b..523a8bd920 100644 --- a/apps/dashboard/app/apps/nav_bar.rb +++ b/apps/dashboard/app/apps/nav_bar.rb @@ -134,7 +134,7 @@ def self.item_from_token(token) group = OodAppGroup.groups_for(apps: SysRouter.apps).select { |g| g.title.downcase == token.downcase }.first return nil if group.nil? group.apps = extract_links(group.apps) - extend_group(group) + extend_group(group, sort: true) end end diff --git a/apps/dashboard/test/apps/nav_bar_test.rb b/apps/dashboard/test/apps/nav_bar_test.rb index c0b5f39329..675ddc0c46 100644 --- a/apps/dashboard/test/apps/nav_bar_test.rb +++ b/apps/dashboard/test/apps/nav_bar_test.rb @@ -73,7 +73,8 @@ def setup result = NavBar.items([nav_item]) assert_equal 1, result.size assert_equal "layouts/nav/group", result[0].partial_path - assert_equal false, result[0].sort + # sort should be true to order subcategories + assert_equal true, result[0].sort assert_equal "Interactive Apps", result[0].title assert_equal 4, result[0].apps.size end