Merge pull request #2346 from betagouv/dev

2018-08-06-01
This commit is contained in:
Pierre de La Morinerie 2018-08-06 18:17:12 +02:00 committed by GitHub
commit 2a07897b6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 65 additions and 20 deletions

View file

@ -3,7 +3,16 @@
["env", { ["env", {
"modules": false, "modules": false,
"targets": { "targets": {
"browsers": "> 1%", // See config/browser.rb
"browsers": [
"> 1%",
"Chrome 40",
"IE 11",
"Edge 12",
"Firefox 45",
"Safari 8",
"iOS 8"
],
"uglify": true "uglify": true
}, },
"useBuiltIns": true "useBuiltIns": true

View file

@ -146,7 +146,7 @@ Pour les lister: `bin/rake -D support:`.
## Compatibilité navigateurs ## Compatibilité navigateurs
L'application supporte les navigateurs récents Firefox, Chrome, Internet Explorer (Edge, 11). L'application supporte les navigateurs récents : Firefox, Chrome, Safari, Edge et Internet Explorer 11 (voir `config/browser.rb`).
La compatibilité est testée par Browserstack. La compatibilité est testée par Browserstack.

View file

@ -0,0 +1,20 @@
@import "colors";
@import "constants";
#support-navigator-banner {
position: fixed;
width: 100%;
bottom: 0;
left: 0;
margin: 0;
padding: $default-padding;
text-align: center;
color: #FFFFFF;
background-color: $medium-red;
z-index: 1000;
a {
color: #C3D9FF;
text-decoration: underline;
}
}

View file

@ -6,6 +6,11 @@ import Highcharts from 'highcharts';
import Bloodhound from 'bloodhound-js'; import Bloodhound from 'bloodhound-js';
import jQuery from 'jquery'; import jQuery from 'jquery';
// Include runtime-polyfills for older browsers.
// Due to .babelrc's 'useBuiltIns', only polyfills actually
// required by the browsers we support will be included.
import 'babel-polyfill';
import 'select2'; import 'select2';
import 'typeahead.js'; import 'typeahead.js';

View file

@ -6,6 +6,11 @@ import Chartkick from 'chartkick';
import Highcharts from 'highcharts'; import Highcharts from 'highcharts';
import jQuery from 'jquery'; import jQuery from 'jquery';
// Include runtime-polyfills for older browsers.
// Due to .babelrc's 'useBuiltIns', only polyfills actually
// required by the browsers we support will be included.
import 'babel-polyfill';
import 'select2'; import 'select2';
import 'typeahead.js'; import 'typeahead.js';

View file

@ -291,9 +291,11 @@ class Dossier < ApplicationRecord
deleted_dossier = DeletedDossier.create!(dossier_id: id, procedure: procedure, state: state, deleted_at: now) deleted_dossier = DeletedDossier.create!(dossier_id: id, procedure: procedure, state: state, deleted_at: now)
update(hidden_at: now) update(hidden_at: now)
administration_emails = followers_gestionnaires.present? ? followers_gestionnaires.pluck(:email) : [procedure.administrateur.email] if en_construction?
administration_emails.each do |email| administration_emails = followers_gestionnaires.present? ? followers_gestionnaires.pluck(:email) : [procedure.administrateur.email]
DossierMailer.notify_deletion_to_administration(deleted_dossier, email).deliver_later administration_emails.each do |email|
DossierMailer.notify_deletion_to_administration(deleted_dossier, email).deliver_later
end
end end
DossierMailer.notify_deletion_to_user(deleted_dossier, user.email).deliver_later DossierMailer.notify_deletion_to_user(deleted_dossier, user.email).deliver_later
end end

View file

@ -1,8 +0,0 @@
<!--[if lt IE 10]>
.center{ style: 'width: 100%; background-color: white; position: fixed; top: 0; left: 0; z-index: 100000;' }
%h3.text-danger
%b
Votre version d'Internet Explorer est trop ancienne pour être utilisée sur demarches-simplifiees.fr. Version minimum : Internet Explorer 10
<![endif]-->

View file

@ -1,7 +1,13 @@
-# See config/browser.rb
- if !browser.modern? - if !browser.modern?
#support-navigator-banner.row #support-navigator-banner.row
.col-xs-12 .col-xs-12
= browser.name = browser.name
= browser.version = browser.version
\- \-
Attention, votre navigateur n'est pas recommandé pour la navigation sur ce site internet. Aucun support ne pourra vous être prodigué en cas de dysfonctionnement. Attention, votre navigateur est trop ancien pour utiliser Démarches Simplifiées : certaines parties du site ne fonctionneront pas correctement.
%br/
%br/
Nous vous recommendons fortement de
%a{ href: "https://browser-update.org/fr/update.html" }mettre à jour votre navigateur
\.

View file

@ -25,8 +25,6 @@
#beta #beta
Env Test Env Test
= render partial: 'layouts/ie_lt_10'
#wrap #wrap
.row .row
#header.navbar #header.navbar

View file

@ -26,7 +26,6 @@
%body %body
.page-wrapper .page-wrapper
= render partial: "layouts/support_navigator_banner" = render partial: "layouts/support_navigator_banner"
= render partial: "layouts/ie_lt_10"
= render partial: 'layouts/pre_maintenance' = render partial: 'layouts/pre_maintenance'
- if Rails.env == "staging" - if Rails.env == "staging"
#beta #beta

View file

@ -1,6 +1,7 @@
# See .babelrc
Browser.modern_rules.clear Browser.modern_rules.clear
Browser.modern_rules << -> b { b.chrome? && b.version.to_i >= 40 } Browser.modern_rules << -> b { b.chrome? && b.version.to_i >= 40 }
Browser.modern_rules << -> b { b.ie?([">=10"]) } Browser.modern_rules << -> b { b.ie?([">=11"]) }
Browser.modern_rules << -> b { b.edge? } Browser.modern_rules << -> b { b.edge? }
Browser.modern_rules << -> b { b.firefox? && b.version.to_i >= 45 } Browser.modern_rules << -> b { b.firefox? && b.version.to_i >= 45 }
Browser.modern_rules << -> b { b.opera? && b.version.to_i >= 19 } Browser.modern_rules << -> b { b.opera? && b.version.to_i >= 19 }

View file

@ -498,7 +498,7 @@ describe NewUser::DossiersController, type: :controller do
end end
context 'when dossier is owned by signed in user' do context 'when dossier is owned by signed in user' do
let(:dossier) { create(:dossier, user: user, autorisation_donnees: true) } let(:dossier) { create(:dossier, :en_construction, user: user, autorisation_donnees: true) }
it do it do
expect(DossierMailer).to receive(:notify_deletion_to_administration).with(kind_of(DeletedDossier), dossier.procedure.administrateur.email).and_return(double(deliver_later: nil)) expect(DossierMailer).to receive(:notify_deletion_to_administration).with(kind_of(DeletedDossier), dossier.procedure.administrateur.email).and_return(double(deliver_later: nil))

View file

@ -859,7 +859,7 @@ describe Dossier do
end end
context 'where gestionnaires are following the dossier' do context 'where gestionnaires are following the dossier' do
let(:dossier) { create(:dossier, :followed) } let(:dossier) { create(:dossier, :en_construction, :followed) }
let!(:non_following_gestionnaire) do let!(:non_following_gestionnaire) do
non_following_gestionnaire = create(:gestionnaire) non_following_gestionnaire = create(:gestionnaire)
non_following_gestionnaire.procedures << dossier.procedure non_following_gestionnaire.procedures << dossier.procedure
@ -873,11 +873,19 @@ describe Dossier do
end end
context 'when there are no following gestionnaires' do context 'when there are no following gestionnaires' do
let(:dossier) { create(:dossier, :en_construction) }
it 'notifies the procedure administrateur' do it 'notifies the procedure administrateur' do
expect(DossierMailer).to have_received(:notify_deletion_to_administration).once expect(DossierMailer).to have_received(:notify_deletion_to_administration).once
expect(DossierMailer).to have_received(:notify_deletion_to_administration).with(deleted_dossier, dossier.procedure.administrateur.email) expect(DossierMailer).to have_received(:notify_deletion_to_administration).with(deleted_dossier, dossier.procedure.administrateur.email)
end end
end end
context 'when dossier is brouillon' do
let(:dossier) { create(:dossier) }
it 'do not notifies the procedure administrateur' do
expect(DossierMailer).not_to have_received(:notify_deletion_to_administration)
end
end
end end
describe 'webhook' do describe 'webhook' do