Merge pull request #5332 from betagouv/dev
This commit is contained in:
commit
71c59c1085
9 changed files with 63 additions and 27 deletions
|
@ -6,5 +6,5 @@ Opera >= 40
|
|||
Safari >= 8
|
||||
iOS >= 8
|
||||
# Although IE 11 shows a deprecation banner, we still support the transpilation option.
|
||||
# IE 11 support may be removed starting from 01 / 06 / 2020.
|
||||
# IE 11 support will be removed on Jan. 31st, 2021.
|
||||
IE >= 11
|
||||
|
|
|
@ -266,6 +266,7 @@
|
|||
background-size: 14px;
|
||||
background-position: right 10px center;
|
||||
padding-right: 4 * $default-spacer;
|
||||
max-width: 100%;
|
||||
|
||||
&.small {
|
||||
padding-right: 3 * $default-spacer;
|
||||
|
|
|
@ -9,7 +9,7 @@ def format_in_2_lines(pdf, label, text)
|
|||
end
|
||||
|
||||
def render_box(pdf, text, x, width)
|
||||
box = ::Prawn::Text::Box.new(text || '', { document: pdf, width: width, overflow: :expand, at: [x, pdf.cursor] })
|
||||
box = ::Prawn::Text::Box.new(text.to_s, { document: pdf, width: width, overflow: :expand, at: [x, pdf.cursor] })
|
||||
box.render
|
||||
box.height
|
||||
end
|
||||
|
|
|
@ -2,11 +2,19 @@
|
|||
#outdated-browser-banner.site-banner
|
||||
.container
|
||||
.site-banner-icon ⚠️
|
||||
.site-banner-text
|
||||
%strong
|
||||
#{browser.name} #{browser.version} est trop ancien pour utiliser demarches-simplifiees.fr.
|
||||
%br
|
||||
Certaines parties du site ne fonctionneront pas correctement.
|
||||
- if browser.ie?(11)
|
||||
.site-banner-text
|
||||
Internet Explorer 11 est un navigateur trop ancien. Nous cesserons de gérer son fonctionnement à partir du
|
||||
%strong
|
||||
31 janvier 2021.
|
||||
%br
|
||||
Merci de changer pour un navigateur plus récent avant cette date ; il peut être nécessaire de prendre contact avec un responsable informatique.
|
||||
- else
|
||||
.site-banner-text
|
||||
%strong
|
||||
#{browser.name} #{browser.version} est trop ancien pour utiliser demarches-simplifiees.fr.
|
||||
%br
|
||||
Certaines parties du site ne fonctionneront pas correctement.
|
||||
.site-banner-actions
|
||||
= button_to 'Ignorer', dismiss_outdated_browser_path, method: :post, remote: true, class: 'button btn', title: 'Ne plus afficher cet avertissement pendant une semaine'
|
||||
%a.btn.button.primary{ href: "https://browser-update.org/fr/update.html", target: "_blank", rel: "noopener" }
|
||||
|
|
|
@ -526,16 +526,19 @@ describe Instructeurs::DossiersController, type: :controller do
|
|||
describe "#show" do
|
||||
context "when the dossier is exported as PDF" do
|
||||
let(:instructeur) { create(:instructeur) }
|
||||
let(:dossier) {
|
||||
create(:dossier,
|
||||
:accepte,
|
||||
:with_all_champs,
|
||||
:with_all_annotations,
|
||||
:with_motivation,
|
||||
:with_commentaires, procedure: procedure)
|
||||
}
|
||||
let!(:avis) { create(:avis, dossier: dossier, instructeur: instructeur) }
|
||||
let(:dossier) do
|
||||
create(:dossier,
|
||||
:accepte,
|
||||
:with_all_champs,
|
||||
:with_all_annotations,
|
||||
:with_motivation,
|
||||
:with_entreprise,
|
||||
:with_commentaires, procedure: procedure)
|
||||
end
|
||||
let(:avis) { create(:avis, dossier: dossier, instructeur: instructeur) }
|
||||
|
||||
subject do
|
||||
avis
|
||||
get :show, params: {
|
||||
procedure_id: procedure.id,
|
||||
dossier_id: dossier.id,
|
||||
|
@ -543,9 +546,8 @@ describe Instructeurs::DossiersController, type: :controller do
|
|||
}
|
||||
end
|
||||
|
||||
before do
|
||||
subject
|
||||
end
|
||||
before { subject }
|
||||
|
||||
it { expect(assigns(:include_infos_administration)).to eq(true) }
|
||||
it { expect(response).to render_template 'dossiers/show' }
|
||||
end
|
||||
|
|
|
@ -28,7 +28,7 @@ FactoryBot.define do
|
|||
if dossier.procedure.for_individual?
|
||||
raise 'Inconsistent factory: attempting to create a dossier :with_entreprise on a procedure that is `for_individual?`'
|
||||
end
|
||||
etablissement = create(:etablissement)
|
||||
etablissement = create(:etablissement, :with_exercices, :with_effectif_mensuel)
|
||||
dossier.etablissement = etablissement
|
||||
end
|
||||
end
|
||||
|
|
|
@ -30,6 +30,12 @@ FactoryBot.define do
|
|||
end
|
||||
end
|
||||
|
||||
trait :with_effectif_mensuel do
|
||||
entreprise_effectif_mensuel { 100.5 }
|
||||
entreprise_effectif_mois { '03' }
|
||||
entreprise_effectif_annee { '2020' }
|
||||
end
|
||||
|
||||
trait :non_diffusable do
|
||||
diffusable_commercialement { false }
|
||||
end
|
||||
|
|
|
@ -1,29 +1,49 @@
|
|||
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.2; WOW64; Trident/6.0; .NET4.0E; .NET4.0C; InfoPath.3)'
|
||||
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
|
||||
|
||||
context 'when the user browser is about to be 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)
|
||||
end
|
||||
|
||||
scenario 'IE11 gets a dedicated depreciation banner for update before jan 31st 2021' do
|
||||
visit new_user_session_path
|
||||
expect(page).to have_content('31 janvier 2021')
|
||||
expect(page).to have_content('Internet Explorer 11 est un navigateur trop ancien')
|
||||
|
||||
within '#outdated-browser-banner' do
|
||||
click_on 'Ignorer'
|
||||
end
|
||||
|
||||
page.refresh
|
||||
expect(page).not_to have_content('Internet Explorer 11 est un navigateur trop ancien')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -223,7 +223,6 @@ describe Dossier do
|
|||
|
||||
describe '#reset!' do
|
||||
let!(:dossier) { create :dossier, :with_entreprise, autorisation_donnees: true }
|
||||
let!(:exercice) { create :exercice, etablissement: dossier.etablissement }
|
||||
|
||||
subject { dossier.reset! }
|
||||
|
||||
|
|
Loading…
Reference in a new issue