Skip to content

Commit

Permalink
Add Tasks link to the top navigation for users not in the beta program
Browse files Browse the repository at this point in the history
This includes a counter. All of this is displayed when the
notifications_redesign feature is not enabled, so for users not in the
beta program.

The Tasks link in the Places menu is not changed.

Fixes #10611
  • Loading branch information
Dany Marcoux committed Jan 12, 2021
1 parent b2a51c0 commit a7dfe34
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ body.notifications-redesign {
}
}

.notifications-counter {
// TODO Remove .tasks-counter once the notifications_redesign feature is rolled out
.tasks-counter, .notifications-counter {
position: relative;
margin: 0 auto;
width: 6rem;
Expand Down
1 change: 0 additions & 1 deletion src/api/app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,6 @@ def to_param
to_s
end

# TODO: Remove once responsive_ux is out of beta
def tasks
Rails.cache.fetch("requests_for_#{cache_key_with_version}") do
declined_requests.count +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
.toggler.text-center.justify-content-center
= link_to(my_notifications_path, id: 'top-notifications-counter', class: 'nav-link text-light p-0 w-100', alt: 'Notifications') do
= render partial: 'layouts/webui/responsive_ux/unread_notifications_counter'
- else # TODO: Remove `else` block when the notifications_redesign is rolled out
.toggler.text-center.justify-content-center
- tasks = User.session!.tasks
= link_to(my_tasks_path, class: 'nav-link text-light p-0 w-100', alt: 'Tasks') do
.tasks-counter
%i.fas.fa-tasks
- unless tasks.zero?
%span.badge.badge-primary.align-text-top= tasks
%span.d-block Tasks
.toggler.text-center.justify-content-center.nav-item.dropdown
= link_to('#', class: 'nav-link dropdown-toggle text-light', id: 'top-navigation-profile-dropdown', role: 'button',
'data-toggle': 'dropdown', aria: { haspopup: true, expanded: false }) do
Expand Down

0 comments on commit a7dfe34

Please sign in to comment.