diff --git a/lib/nexmo_developer/app/presenters/sidenav.rb b/lib/nexmo_developer/app/presenters/sidenav.rb index 898f3eda4..6d6d3b5a2 100644 --- a/lib/nexmo_developer/app/presenters/sidenav.rb +++ b/lib/nexmo_developer/app/presenters/sidenav.rb @@ -20,6 +20,16 @@ def nav_items SidenavItem.new(folder: item, sidenav: self) end end.compact + + if @nav_items.blank? + @nav_items = items.map do |item| + if @product && @product.split('/')[1] && @product.split('/')[1].include?(item[:title]) + SidenavItem.new(folder: item, sidenav: self) + end + end.compact + end + + @nav_items end def namespace diff --git a/lib/nexmo_developer/spec/presenters/sidenav_spec.rb b/lib/nexmo_developer/spec/presenters/sidenav_spec.rb index 7a58d9bbd..389acec13 100644 --- a/lib/nexmo_developer/spec/presenters/sidenav_spec.rb +++ b/lib/nexmo_developer/spec/presenters/sidenav_spec.rb @@ -2,7 +2,7 @@ RSpec.describe Sidenav do let(:request_path) { '/en/documentation' } - let(:product) { nil } + let(:product) { 'voice/voice-api' } let(:locale) { 'en' } let(:navigation) { :documentation } let(:namespace) { nil } diff --git a/lib/nexmo_developer/version.rb b/lib/nexmo_developer/version.rb index d9a6873ca..ff60e200f 100644 --- a/lib/nexmo_developer/version.rb +++ b/lib/nexmo_developer/version.rb @@ -1,3 +1,3 @@ module NexmoDeveloper - VERSION = '0.4.4'.freeze + VERSION = '0.4.5'.freeze end