Ajout d'une bannière pour prévenir des perturbations à partir d… (#4617)
Ajout d’une bannière pour prévenir des perturbations liée à la grève
This commit is contained in:
commit
5dbe0722a3
5 changed files with 18 additions and 6 deletions
|
@ -1,5 +1,6 @@
|
|||
#main-container{ class: "col-xs-#{main_container_size}" }
|
||||
.row
|
||||
= render partial: 'layouts/strike_banner'
|
||||
= render partial: 'layouts/outdated_browser_banner'
|
||||
= render partial: 'layouts/pre_maintenance'
|
||||
.row
|
||||
|
|
8
app/views/layouts/_strike_banner.html.haml
Normal file
8
app/views/layouts/_strike_banner.html.haml
Normal file
|
@ -0,0 +1,8 @@
|
|||
#strike-banner.site-banner
|
||||
.container
|
||||
.site-banner-icon ⚠️
|
||||
.site-banner-text
|
||||
%strong
|
||||
En raison d’une grève nationale interprofessionnelle, une partie des personnels ne travaille pas.
|
||||
%br
|
||||
Les délais de réponse aux questions techniques pourront être perturbés pendant les prochains jours.
|
|
@ -26,8 +26,10 @@
|
|||
|
||||
%body{ id: content_for(:page_id), class: browser.platform.ios? ? 'ios' : nil }
|
||||
.page-wrapper
|
||||
= render partial: 'layouts/strike_banner'
|
||||
= render partial: "layouts/outdated_browser_banner"
|
||||
= render partial: 'layouts/pre_maintenance'
|
||||
|
||||
- if staging?
|
||||
#beta
|
||||
Env Test
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
Browser.modern_rules.clear
|
||||
Browser.modern_rules << -> b { b.chrome? && b.version.to_i >= 50 && !b.platform.ios? }
|
||||
Browser.modern_rules << -> b { b.edge? && b.version.to_i >= 14 && !b.compatibility_view? }
|
||||
Browser.modern_rules << -> b { b.ie? && b.version.to_i >= 11 && !b.compatibility_view? }
|
||||
Browser.modern_rules << -> b { b.firefox? && b.version.to_i >= 50 && !b.platform.ios? }
|
||||
Browser.modern_rules << -> b { b.opera? && b.version.to_i >= 40 }
|
||||
Browser.modern_rules << -> b { b.safari? && b.version.to_i >= 8 }
|
||||
|
|
|
@ -3,29 +3,29 @@ require 'spec_helper'
|
|||
feature 'Outdated browsers support:' do
|
||||
context 'when the user browser is outdated' do
|
||||
before(:each) do
|
||||
ie_11_user_agent = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko'
|
||||
Capybara.page.driver.header('user-agent', ie_11_user_agent)
|
||||
ie_10_user_agent = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)'
|
||||
Capybara.page.driver.header('user-agent', ie_10_user_agent)
|
||||
end
|
||||
|
||||
scenario 'a banner is displayed' do
|
||||
visit new_user_session_path
|
||||
expect(page).to have_content('Internet Explorer 11 est trop ancien')
|
||||
expect(page).to have_content('Internet Explorer 10 est trop ancien')
|
||||
end
|
||||
|
||||
scenario 'the banner can be dismissed' do
|
||||
visit new_user_session_path
|
||||
expect(page).to have_content('Internet Explorer 11 est trop ancien')
|
||||
expect(page).to have_content('Internet Explorer 10 est trop ancien')
|
||||
|
||||
# The banner is hidden immediately
|
||||
within '#outdated-browser-banner' do
|
||||
click_on 'Ignorer'
|
||||
end
|
||||
expect(page).not_to have_content('Internet Explorer 11 est trop ancien')
|
||||
expect(page).not_to have_content('Internet Explorer 10 est trop ancien')
|
||||
expect(page).to have_current_path(new_user_session_path)
|
||||
|
||||
# The banner is hidden after a refresh
|
||||
page.refresh
|
||||
expect(page).not_to have_content('Internet Explorer 11 est trop ancien')
|
||||
expect(page).not_to have_content('Internet Explorer 10 est trop ancien')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue