Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MGF-670-feat(employers_only): when so, link to 'candidatures' are grey and inactive #376

Open
wants to merge 1 commit into
base: review
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions app/components/side_menu_component.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# frozen_string_literal: true

class SideMenuComponent < ApplicationComponent
delegate :employers_only?, to: :helpers

def initialize(candidatures_notice:,
agreements_notice:,
agreements_authorization:,
Expand All @@ -13,12 +11,12 @@ def initialize(candidatures_notice:,
@agreements_notice = agreements_notice
@agreements_authorization = agreements_authorization
@current_page_offers = current_page_offers
@current_page_candidatures = current_page_candidatures
@current_page_candidatures = ENV['EMPLOYERS_ONLY'] == 'true' ? current_page_offers : current_page_candidatures
@current_page_agreements = current_page_agreements
end

def link_options(menu_item)
link_options = { class: 'fr-sidemenu__link' }
link_options = { class: "fr-sidemenu__link #{ENV['EMPLOYERS_ONLY'] == 'true' && menu_item[:label] != 'Offres de stage' ? 'text-muted before-null' : ''}" }
link_options.merge!({ 'aria-current': 'page' }) if menu_item[:current_page]
link_options
end
Expand All @@ -37,12 +35,11 @@ def before_render
current_page: @current_page_offers
}
]
# return if employers_only?

@menu_collection << [
{
label: 'Candidatures',
path: helpers.dashboard_candidatures_path,
path: ENV['EMPLOYERS_ONLY'] == 'true' ? helpers.dashboard_internship_offers_path : helpers.dashboard_candidatures_path,
notice: @candidatures_notice,
authorization: true,
current_page: @current_page_candidatures
Expand Down
5 changes: 5 additions & 0 deletions app/front_assets/stylesheets/components/link.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@ a.red-delete{
.with_blue{
color: $blue-france;
}
}
.fr-sidemenu__link.before-null{
&:before{
content: none;
}
}
Loading