Skip to content

Commit

Permalink
Merge pull request #1490 from Nexmo/APIDOC-168_usecases_leftnavbar
Browse files Browse the repository at this point in the history
APIDOC-168: added product for /use-cases
  • Loading branch information
marcoranieri authored Jul 4, 2022
2 parents 11d56db + 0283c46 commit b421fb7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions lib/nexmo_developer/app/presenters/sidenav.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/nexmo_developer/spec/presenters/sidenav_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion lib/nexmo_developer/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module NexmoDeveloper
VERSION = '0.4.4'.freeze
VERSION = '0.4.5'.freeze
end

0 comments on commit b421fb7

Please sign in to comment.