diff options
| -rw-r--r-- | Gemfile | 1 | ||||
| -rw-r--r-- | Gemfile.lock | 5 | ||||
| -rw-r--r-- | app/controllers/compliance_check_messages_controller.rb | 6 | ||||
| -rw-r--r-- | app/controllers/import_messages_controller.rb | 2 | ||||
| -rw-r--r-- | config/locales/compliance_check_messages.en.yml | 1 | ||||
| -rw-r--r-- | config/locales/compliance_check_messages.fr.yml | 1 | ||||
| -rw-r--r-- | config/locales/import_messages.en.yml | 1 | ||||
| -rw-r--r-- | config/locales/import_messages.fr.yml | 1 | ||||
| -rw-r--r-- | package.json | 4 | ||||
| -rw-r--r-- | yarn.lock | 10 | 
10 files changed, 25 insertions, 7 deletions
| @@ -7,6 +7,7 @@ git_source(:af83) { |name| "https://github.com/af83/#{name}.git" }  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'  gem 'rails', '~> 4.2.8' +gem 'rack-protection', '~> 1.5.5'  # Use SCSS for stylesheets  gem 'sass-rails', '~> 4.0.3' diff --git a/Gemfile.lock b/Gemfile.lock index 7bb1c3465..51a72bb32 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -371,10 +371,10 @@ GEM        railties (>= 3.1, < 5.0)      rabl (0.13.1)        activesupport (>= 2.3.14) -    rack (1.6.9) +    rack (1.6.10)      rack-livereload (0.3.16)        rack -    rack-protection (1.5.4) +    rack-protection (1.5.5)        rack      rack-proxy (0.6.3)        rack @@ -668,6 +668,7 @@ DEPENDENCIES    quiet_assets    rabl    rack-livereload +  rack-protection (~> 1.5.5)    rails (~> 4.2.8)    rails-assets-bootstrap-sass-official (~> 3.3.0)!    rails-assets-footable (~> 2.0.3)! diff --git a/app/controllers/compliance_check_messages_controller.rb b/app/controllers/compliance_check_messages_controller.rb index 36745981e..db551cca5 100644 --- a/app/controllers/compliance_check_messages_controller.rb +++ b/app/controllers/compliance_check_messages_controller.rb @@ -7,7 +7,7 @@ class ComplianceCheckMessagesController < ChouetteController    def index      index! do |format|        format.csv { -        send_data ComplianceCheckMessageExport.new(compliance_check_messages: collection).to_csv(:col_sep => "\;", :quote_char=>'"', force_quotes: true, server_url: request.base_url) , :filename => "compliance_check_set_errors_#{line_code}_#{Date.today.to_s}.csv" +        send_data ComplianceCheckMessageExport.new(compliance_check_messages: collection).to_csv(:col_sep => "\;", :quote_char=>'"', force_quotes: true, server_url: request.base_url) , :filename => "#{t('compliance_check_messages.compliance_check_set_errors')}_#{line_code}_#{Time.now.strftime('%d-%m-%Y_%H-%M')}.csv"        }      end    end @@ -22,10 +22,10 @@ class ComplianceCheckMessagesController < ChouetteController    end    def compliance_check_resource -    ComplianceCheckResource.find(params[:compliance_check_resource_id])  +    ComplianceCheckResource.find(params[:compliance_check_resource_id])    end -  private  +  private    def line_code      Chouette::Line.find_by_objectid("#{compliance_check_resource.reference}").get_objectid.local_id diff --git a/app/controllers/import_messages_controller.rb b/app/controllers/import_messages_controller.rb index e9a071177..9f61940a3 100644 --- a/app/controllers/import_messages_controller.rb +++ b/app/controllers/import_messages_controller.rb @@ -9,7 +9,7 @@ class ImportMessagesController < ChouetteController    def index      index! do |format|        format.csv { -        send_data Import::MessageExport.new(:import_messages => @import_messages).to_csv(:col_sep => "\;", :quote_char=>'"', force_quotes: true) , :filename => "import_errors_#{@import_resource.name.gsub('.xml', '')}_#{Date.today.to_s}.csv" +        send_data Import::MessageExport.new(:import_messages => @import_messages).to_csv(:col_sep => "\;", :quote_char=>'"', force_quotes: true) , :filename => "#{t('import_messages.import_errors')}_#{@import_resource.name.gsub('.xml', '')}_#{Time.now.strftime("%d-%m-%Y_%H-%M")}.csv"        }      end    end diff --git a/config/locales/compliance_check_messages.en.yml b/config/locales/compliance_check_messages.en.yml index ade4329a2..ea91c21f2 100644 --- a/config/locales/compliance_check_messages.en.yml +++ b/config/locales/compliance_check_messages.en.yml @@ -30,6 +30,7 @@ en:      3_shape_1: "Tracé %{source_objectid} : le tracé passe trop loin de l'arrêt %{target_0_label} (%{target_0_objectid}) : %{error_value} > %{reference_value}"      3_shape_2: "Tracé %{source_objectid} : le tracé n'est pas défini entre les arrêts %{target_0_label} (%{target_0_objectid}) et %{target_1_label} (%{target_1_objectid})"      3_shape_3: "Le tracé de l'itinéraire %{source_objectid} est en écart avec la voirie sur %{error_value} sections" +    compliance_check_set_errors: compliance_check_set_errors    activerecord:      attributes:        compliance_check_message: diff --git a/config/locales/compliance_check_messages.fr.yml b/config/locales/compliance_check_messages.fr.yml index 21f100f46..6c0b54aec 100644 --- a/config/locales/compliance_check_messages.fr.yml +++ b/config/locales/compliance_check_messages.fr.yml @@ -30,6 +30,7 @@ fr:      3_shape_1: "Tracé %{source_objectid} : le tracé passe trop loin de l'arrêt %{target_0_label} (%{target_0_objectid}) : %{error_value} > %{reference_value}"      3_shape_2: "Tracé %{source_objectid} : le tracé n'est pas défini entre les arrêts %{target_0_label} (%{target_0_objectid}) et %{target_1_label} (%{target_1_objectid})"      3_shape_3: "Le tracé de l'itinéraire %{source_objectid} est en écart avec la voirie sur %{error_value} sections" +    compliance_check_set_errors: erreurs_validation    activerecord:      attributes:        compliance_check_message: diff --git a/config/locales/import_messages.en.yml b/config/locales/import_messages.en.yml index 3ed98aaa6..27035ba84 100644 --- a/config/locales/import_messages.en.yml +++ b/config/locales/import_messages.en.yml @@ -54,6 +54,7 @@ en:      2_netexstif_servicejourneypattern_3_1: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number} : l'objet ServiceJourneyPattern d'identifiant %{source_objectid} n'a pas de valeur pour l'attribut ServiceJourneyPatternType"      2_netexstif_servicejourneypattern_3_2: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number} : l'objet ServiceJourneyPattern d'identifiant %{source_objectid} a une valeur interdite %{error_value} pour l'attribut ServiceJourneyPatternType différente de 'passenger'"      2_netexstif_servicejourneypattern_4: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number}, objet ServiceJourneyPattern d'identifiant %{source_objectid} : les attributs 'order' des StopPointInJourneyPattern ne sont pas croissants." +    import_errors: import_errors    activerecord:      attributes:        import_message: diff --git a/config/locales/import_messages.fr.yml b/config/locales/import_messages.fr.yml index e61980e36..a8dd31f8a 100644 --- a/config/locales/import_messages.fr.yml +++ b/config/locales/import_messages.fr.yml @@ -67,6 +67,7 @@ fr:      2_netexstif_servicejourneypattern_3_1: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number} : l'objet ServiceJourneyPattern d'identifiant %{source_objectid} n'a pas de valeur pour l'attribut ServiceJourneyPatternType"      2_netexstif_servicejourneypattern_3_2: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number} : l'objet ServiceJourneyPattern d'identifiant %{source_objectid} a une valeur interdite %{error_value} pour l'attribut ServiceJourneyPatternType différente de 'passenger'"      2_netexstif_servicejourneypattern_4: "%{source_filename}-Ligne %{source_line_number}-Colonne %{source_column_number}, objet ServiceJourneyPattern d'identifiant %{source_objectid} : les attributs 'order' des StopPointInJourneyPattern ne sont pas croissants." +    import_errors: erreurs_import    activerecord:      attributes:        import_message: diff --git a/package.json b/package.json index ef956105c..2967ad3d3 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,9 @@      "redux-promise": "0.5.3",      "redux-thunk": "2.2.0",      "uglify-js": "3.3.2", -    "whatwg-fetch": "^2.0.4" +    "whatwg-fetch": "^2.0.4", +    "ssri": "~> 5.2.2", +    "hoek": "~> 4.2.1"    },    "license": "MIT",    "engines": { @@ -2898,6 +2898,10 @@ hoek@4.x.x:    version "4.2.0"    resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d" +"hoek@~> 4.2.1": +  version "4.2.1" +  resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb" +  hoist-non-react-statics@^2.2.1:    version "2.3.1"    resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.3.1.tgz#343db84c6018c650778898240135a1420ee22ce0" @@ -6197,6 +6201,12 @@ ssri@^5.0.0:    dependencies:      safe-buffer "^5.1.0" +"ssri@~> 5.2.2": +  version "5.2.4" +  resolved "https://registry.yarnpkg.com/ssri/-/ssri-5.2.4.tgz#9985e14041e65fc397af96542be35724ac11da52" +  dependencies: +    safe-buffer "^5.1.1" +  stack-utils@^1.0.1:    version "1.0.1"    resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.1.tgz#d4f33ab54e8e38778b0ca5cfd3b3afb12db68620" | 
