Skip to content

Commit

Permalink
Display more info about the request in watchlist
Browse files Browse the repository at this point in the history
In the watchlist, a link to a request used to look like "Request #123".
Now we display a more descriptive text with the action type, something
like "#123 Add Role".
  • Loading branch information
saraycp committed Apr 27, 2022
1 parent 9eba086 commit 2c7e0e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/api/app/components/watched_items_list_component.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
%i.fas.fa-cubes.mr-1
#{item}
- when 'BsRequest'
= link_to(request_show_path(number: item.number), class: 'text-word-break-all') do
= link_to(request_show_path(item.number), class: 'text-word-break-all') do
= image_tag('icons/request-icon.svg', height: 18, class: 'mr-1 color-inverted')
Request ##{item.number}
= "##{item.number} #{helpers.request_type_of_action(item)}"
- else
%p.text-muted= empty_list_text
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

it 'does show the watched request in the list' do
expect(rendered_component).not_to have_text('There are no requests in the watchlist yet.')
expect(rendered_component).to have_text("Request ##{requests.sample.number}")
expect(rendered_component).to have_text("##{requests.sample.number} Submit")
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions src/api/spec/components/watchlist_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
before { render_inline(described_class.new(user: user, bs_request: bs_request)) }

it { expect(rendered_component).to have_text('There are no requests in the watchlist yet.') }
it { expect(rendered_component).not_to have_link("Request ##{bs_request.number}") }
it { expect(rendered_component).not_to have_link("##{bs_request.number} Submit") }
it { expect(rendered_component).to have_text('Watch this request') }
end

Expand All @@ -134,7 +134,7 @@
end

it { expect(rendered_component).not_to have_text('There are no requests in the watchlist yet.') }
it { expect(rendered_component).to have_link("Request ##{bs_request.number}") }
it { expect(rendered_component).to have_link("##{bs_request.number} Submit") }
it { expect(rendered_component).to have_text('Remove this request from Watchlist') }
end
end
Expand Down

0 comments on commit 2c7e0e2

Please sign in to comment.