aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZakaria BOUZIANE2015-04-28 14:39:50 +0200
committerZakaria BOUZIANE2015-04-28 14:39:50 +0200
commit25493ad2295ca41687fb9f08632585f22ce0b072 (patch)
treea616ef1cac4b589ac896baa855b7afd8b363aea4
parentabdfb2c468c6267bcf3cdc335faa05132e5a6a2a (diff)
downloadchouette-core-25493ad2295ca41687fb9f08632585f22ce0b072.tar.bz2
ComplianceCheckTask to ComplianceCheck
-rw-r--r--app/assets/stylesheets/main/compliance_check_tasks.css.scss164
-rw-r--r--app/assets/stylesheets/main/compliance_checks.css.scss (renamed from app/assets/stylesheets/main/validations.css.scss)41
-rw-r--r--app/controllers/compliance_check_results_controller.rb6
-rw-r--r--app/controllers/compliance_check_tasks_controller.rb63
-rw-r--r--app/controllers/compliance_checks_controller.rb69
-rw-r--r--app/helpers/breadcrumb_helper.rb12
-rw-r--r--app/helpers/compliance_checks_helper.rb36
-rw-r--r--app/helpers/validation_results_helper.rb19
-rw-r--r--app/helpers/validations_helper.rb36
-rw-r--r--app/models/compliance_check.rb132
-rw-r--r--app/models/compliance_check_export.rb (renamed from app/models/compliance_check_task_export.rb)16
-rw-r--r--app/models/compliance_check_service.rb4
-rw-r--r--app/models/import.rb8
-rw-r--r--app/views/compliance_check_results/index.html.erb4
-rw-r--r--app/views/compliance_check_tasks/_compliance_check_task.html.erb35
-rw-r--r--app/views/compliance_check_tasks/_compliance_check_tasks.html.erb9
-rw-r--r--app/views/compliance_check_tasks/detailed_errors_index.csv.erb2
-rw-r--r--app/views/compliance_check_tasks/index.js.erb1
-rw-r--r--app/views/compliance_check_tasks/summary_errors_index.csv.erb3
-rw-r--r--app/views/compliance_checks/_compliance_check.html.erb32
-rw-r--r--app/views/compliance_checks/_compliance_checks.html.erb9
-rw-r--r--app/views/compliance_checks/detailed_errors_index.csv.erb2
-rw-r--r--app/views/compliance_checks/index.html.erb (renamed from app/views/compliance_check_tasks/index.html.erb)2
-rw-r--r--app/views/compliance_checks/index.js.erb1
-rw-r--r--app/views/compliance_checks/show.html.erb (renamed from app/views/compliance_check_tasks/show.html.erb)26
-rw-r--r--app/views/compliance_checks/show.js.coffee (renamed from app/views/compliance_check_tasks/show.js.coffee)14
-rw-r--r--app/views/compliance_checks/summary_errors_index.csv.erb3
-rw-r--r--app/views/shared/_header.erb4
-rw-r--r--config/locales/compliance_check_tasks.yml134
-rw-r--r--config/locales/compliance_checks.yml141
-rw-r--r--config/locales/import_tasks.yml208
-rw-r--r--config/locales/imports.yml198
-rw-r--r--config/locales/referentials.yml12
-rw-r--r--config/routes.rb5
34 files changed, 869 insertions, 582 deletions
diff --git a/app/assets/stylesheets/main/compliance_check_tasks.css.scss b/app/assets/stylesheets/main/compliance_check_tasks.css.scss
index f64a01b34..7fecf0068 100644
--- a/app/assets/stylesheets/main/compliance_check_tasks.css.scss
+++ b/app/assets/stylesheets/main/compliance_check_tasks.css.scss
@@ -1,167 +1,3 @@
-#workspace.compliance_check_tasks.index
-{
-}
-
-#workspace.compliance_check_tasks.show {
-
- .status {
- margin-left: 10px;
- }
-
- .status_failed { color: #a94442;}
- .status_pending { color: #31708f;}
- .status_processing { color: #31708f;}
- .status_completed { color: #3c763d;}
-
- .links{
- margin: 0px 0 20px 0;
-
- img{ margin: 0 5px 0 15px; }
- }
-
- .order{
- margin-bottom: 10px;
- padding: 5px;
- border-top: 1px solid #e4e4e4;
- border-bottom: 1px solid #e4e4e4;
- }
-
- .status_ok_error { color: #8fc861; }
- .status_nok_error { color: #e22b1b; }
- .status_na_error { color: #898e7f; }
-
- .status_ok_warning { color: #8fc861; }
- .status_nok_warning { color: #ffbd2b; }
- .status_na_warning { color: #898e7f; }
-
- .resume {
- &:after{
- content: " ";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden;
- }
-
- .col1 {
- float: left;
- width: 45%;
- }
-
- .col2 {
- margin-left: 10px;
- float: left;
- width: 45%;
- }
-
- .graph { height: 200px; }
-
- .caption {
- text-align :center;
- font-weight: bold;
- }
- }
-
- .report{
- .table { margin-top: 20px; }
-
- }
-
- .severity__improvment, .severity_warning, .severity_error {
- border: 1px solid;
- margin: 10px 0px;
- padding:10px 10px 10px 10px;
- background-repeat: no-repeat;
- background-position: 10px center;-moz-border-radius:.5em;
- -webkit-border-radius:.5em;
- border-radius:.5em;
- height: 100%;
-
- &:after{
- content: " ";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden;
- }
-
- .status_icon {
- float: left;
- width: 20%;
- height: auto;
-
- img {
- vertical-align: middle;
- width: 48px;
- height: 48px;
- }
- }
-
- .status_text{
- float: left;
- width: 70%;
-
- .code{
- font-size: 12px;
- font-weight: bold;
- }
-
- .severity {
- font-size: 10px;
- }
-
- .explanation{
- display: none;
- font-size: 12px;
- margin: 5px 0 0 0;
- }
-
- .attributes{
- font-size: 10px;
- font-weight: bold;
- margin: 5px 0 0px 0;
- }
- }
-
- }
-
- .severity_improvment {
- color: black;
- background-color: #c5cf4c;
- }
-
- .severity_warning {
- color: black;
- background-color: #f1dd30;
- }
-
- .severity_error {
- color: black;
- background-color: #ff9a0c;
- }
-
- .td_error {
- width: 30%;
-
- .title_error i { margin-right: 5px; }
-
- div.details_error{
- margin: 0px 0px 0px 3px !important;
- display: none;
-
- p.detail_error{
- margin: 0px 0px 5px 0px !important;
- }
-
- .file_error{
- margin-left: 26px;
- font-size: 10px;
- color: #898e7f;
- }
- }
- }
-}
-
#workspace.compliance_check_tasks.new, #workspace.compliance_check_tasks.create
{
padding: 0;
diff --git a/app/assets/stylesheets/main/validations.css.scss b/app/assets/stylesheets/main/compliance_checks.css.scss
index 6fea56818..f36108c30 100644
--- a/app/assets/stylesheets/main/validations.css.scss
+++ b/app/assets/stylesheets/main/compliance_checks.css.scss
@@ -1,8 +1,8 @@
-#workspace.validations.index
+#workspace.compliance_checks.index
{
}
-#workspace.validations.show {
+#workspace.compliance_checks.show {
.status {
margin-left: 10px;
@@ -161,40 +161,3 @@
}
}
}
-
-#workspace.validations.new, #workspace.validations.create
-{
- padding: 0;
- margin-top: -0.3em;
- margin-bottom: 1em;
-
-
-
- .inputs ol {
- margin-top: -0.3em;
- margin-bottom: 1em;
- padding: 0;
- width: 100%;
- }
- .inputs ol li { padding : 0.3em 0; }
-
- .inputs ol li textarea {
- width: 54%;
- }
- .inputs ol li label {
- width: 40%;
- margin-top: -0.3em;
- }
-
- .inputs ol li.fl label { width: 40%; margin-top: -0.3em; }
- .inputs ol li.fl input { width: 21%; padding: 0; }
-
- .inputs ol li.fl1 {float: left; width: 70% ;}
- .inputs ol li.fl1 label {width: 57%; margin-top: -0.3em; }
- .inputs ol li.fl1 input { width: 30%; }
-
- .inputs ol li.fl2 {float: left; width: 25% ;}
- .inputs ol li.fl2 label {width: 10%; margin-top: -0.3em;}
- .inputs ol li.fl2 input { width: 85%; }
-
-}
diff --git a/app/controllers/compliance_check_results_controller.rb b/app/controllers/compliance_check_results_controller.rb
index 2829ab749..b1f31844a 100644
--- a/app/controllers/compliance_check_results_controller.rb
+++ b/app/controllers/compliance_check_results_controller.rb
@@ -18,12 +18,12 @@ class ComplianceCheckResultsController < ChouetteController
ComplianceCheckService.new(@referential)
end
- def compliance_check_task
- @compliance_check_task ||= compliance_check_service.find( params[:compliance_check_task_id] )
+ def compliance_check
+ @compliance_check ||= compliance_check_service.find( params[:compliance_check_id] )
end
def compliance_check_result
- @compliance_check_result ||= compliance_check_task.compliance_check_result
+ @compliance_check_result ||= compliance_check.compliance_check_result
end
def collection
diff --git a/app/controllers/compliance_check_tasks_controller.rb b/app/controllers/compliance_check_tasks_controller.rb
index d7db5c912..f1ea267af 100644
--- a/app/controllers/compliance_check_tasks_controller.rb
+++ b/app/controllers/compliance_check_tasks_controller.rb
@@ -1,69 +1,6 @@
-require 'will_paginate/array'
-
class ComplianceCheckTasksController < ChouetteController
defaults :resource_class => ComplianceCheckTask
- respond_to :html, :js
- respond_to :zip, :only => :export
belongs_to :referential
- def index
- begin
- index! do
- build_breadcrumb :index
- end
- rescue Ievkit::Error => error
- logger.error("Iev failure : #{error.message}")
- flash[:error] = t('iev.failure')
- redirect_to referential_path(@referential)
- end
- end
-
- def references
- @references = referential.send(params[:type]).where("name ilike ?", "%#{params[:q]}%")
- respond_to do |format|
- format.json do
- render json: @references.collect { |child| { id: child.id, name: child.name } }
- end
- end
- end
-
- def rule_parameter_set
- @rule_parameter_set = compliance_check_task.rule_parameter_set_archived
- build_breadcrumb :edit
- render "rule_parameter_sets/show"
- end
-
- def create
- create! do |success, failure|
- success.html { flash[:notice] = I18n.t('compliance_check_tasks.new.flash'); redirect_to referential_compliance_check_tasks_path(@referential) }
- end
- end
-
- def export
- respond_to do |format|
- format.zip { send_file ComplianceCheckTaskExport.new(resource, @referential.id, request).export, :type => :zip }
- end
- end
-
- protected
-
- alias_method :compliance_check_task, :resource
-
- def compliance_check_service
- ComplianceCheckService.new(@referential)
- end
-
- def build_resource(attributes = {})
- @compliance_check_task ||= ComplianceCheckTask.new
- end
-
- def resource
- @compliance_check_task ||= compliance_check_service.find(params[:id] )
- end
-
- def collection
- @compliance_check_tasks ||= compliance_check_service.all.paginate(:page => params[:page])
- end
-
end
diff --git a/app/controllers/compliance_checks_controller.rb b/app/controllers/compliance_checks_controller.rb
new file mode 100644
index 000000000..268c1f354
--- /dev/null
+++ b/app/controllers/compliance_checks_controller.rb
@@ -0,0 +1,69 @@
+require 'will_paginate/array'
+
+class ComplianceChecksController < ChouetteController
+ defaults :resource_class => ComplianceCheck
+
+ respond_to :html, :js
+ respond_to :zip, :only => :export
+ belongs_to :referential
+
+ def index
+ begin
+ index! do
+ build_breadcrumb :index
+ end
+ rescue Ievkit::Error => error
+ logger.error("Iev failure : #{error.message}")
+ flash[:error] = t('iev.failure')
+ redirect_to referential_path(@referential)
+ end
+ end
+
+ def references
+ @references = referential.send(params[:type]).where("name ilike ?", "%#{params[:q]}%")
+ respond_to do |format|
+ format.json do
+ render json: @references.collect { |child| { id: child.id, name: child.name } }
+ end
+ end
+ end
+
+ def rule_parameter_set
+ @rule_parameter_set = compliance_check.rule_parameter_set_archived
+ build_breadcrumb :edit
+ render "rule_parameter_sets/show"
+ end
+
+ def create
+ create! do |success, failure|
+ success.html { flash[:notice] = I18n.t('compliance_checks.new.flash'); redirect_to referential_compliance_checks_path(@referential) }
+ end
+ end
+
+ def export
+ respond_to do |format|
+ format.zip { send_file ComplianceCheckExport.new(resource, @referential.id, request).export, :type => :zip }
+ end
+ end
+
+ protected
+
+ alias_method :compliance_check, :resource
+
+ def compliance_check_service
+ ComplianceCheckService.new(@referential)
+ end
+
+ def build_resource(attributes = {})
+ @compliance_check ||= ComplianceCheck.new
+ end
+
+ def resource
+ @compliance_check ||= compliance_check_service.find(params[:id] )
+ end
+
+ def collection
+ @compliance_checks ||= compliance_check_service.all.paginate(:page => params[:page])
+ end
+
+end
diff --git a/app/helpers/breadcrumb_helper.rb b/app/helpers/breadcrumb_helper.rb
index 34e013f8d..d99d4a068 100644
--- a/app/helpers/breadcrumb_helper.rb
+++ b/app/helpers/breadcrumb_helper.rb
@@ -34,10 +34,10 @@ module BreadcrumbHelper
import_breadcrumb action
when "Export"
export_breadcrumb action
- when "Validation"
- validation_breadcrumb action
+ when "ComplianceCheck"
+ compliance_check_breadcrumb action
when "ComplianceCheckTask"
- compliance_breadcrumb action
+ compliance_check_task_breadcrumb action
when "RuleParameterSet"
rule_parameter_breadcrumb action
when "User"
@@ -144,12 +144,12 @@ module BreadcrumbHelper
add_breadcrumb Referential.human_attribute_name("exports"), referential_exports_path(@referential) unless action == :index
end
- def validation_breadcrumb (action)
+ def compliance_check_breadcrumb (action)
referential_breadcrumb
- add_breadcrumb Referential.human_attribute_name("validations"), referential_validations_path(@referential) unless action == :index
+ add_breadcrumb Referential.human_attribute_name("compliance_checks"), referential_compliance_checks_path(@referential) unless action == :index
end
- def compliance_breadcrumb (action)
+ def compliance_check_task_breadcrumb (action)
referential_breadcrumb
add_breadcrumb Referential.human_attribute_name("compliance_check_tasks"), referential_compliance_check_tasks_path(@referential) unless action == :index
add_breadcrumb breadcrumb_label(@compliance_check_task), referential_compliance_check_task_path(@referential, @compliance_check_task),:title => breadcrumb_tooltip(@compliance_check_task) if action == :edit
diff --git a/app/helpers/compliance_checks_helper.rb b/app/helpers/compliance_checks_helper.rb
new file mode 100644
index 000000000..6b2feba89
--- /dev/null
+++ b/app/helpers/compliance_checks_helper.rb
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+module ComplianceChecksHelper
+
+ def fields_for_compliance_check_format(form)
+ begin
+ render :partial => compliance_check_partial_name(form), :locals => { :form => form }
+ rescue ActionView::MissingTemplate
+ ""
+ end
+ end
+
+ def compliance_check_partial_name(form)
+ "fields_#{form.object.format.underscore}_compliance_check"
+ end
+
+ def compliance_icon( compliance_check)
+ return nil unless compliance_check.compliance_check_result
+ compliance_check.compliance_check_result.tap do |cct|
+ if cct.failed? || cct.any_error_severity_failure?
+ return 'icons/link_page_alert.png'
+ else
+ return 'icons/link_page.png'
+ end
+ end
+ end
+
+ def compliance_check_progress_bar_tag(compliance_check)
+ div_class = ""
+ content_tag :div, :class => "progress" do
+ content_tag :div, :class => div_class, role: "progressbar", :'aria-valuenow' => "#{compliance_check.percentage_progress}", :'aria-valuemin' => "0", :'aria-valuemax' => "100", :style => "width: #{compliance_check.percentage_progress}%;" do
+ "#{compliance_check.percentage_progress}% " + I18n.t("compliance_checks.statuses.#{compliance_check.status}")
+ end
+ end
+ end
+
+end
diff --git a/app/helpers/validation_results_helper.rb b/app/helpers/validation_results_helper.rb
index c225039a2..3c7c31e00 100644
--- a/app/helpers/validation_results_helper.rb
+++ b/app/helpers/validation_results_helper.rb
@@ -16,11 +16,11 @@ module ValidationResultsHelper
def object_url (referential_id, error)
location = "/referentials/" + referential_id.to_s
- if error[:source].object_path.kind_of?(Array)
- error[:source].object_path.reverse.each { |sub_path| location = location + "/" + sub_path["type"].to_s.pluralize + "/" + sub_path["id"].to_s }
- else
- location = location + "/" + error[:source].object_path.type.to_s + "s/" + error[:source].object_path.id.to_s
+ object_path = error[:source].object_path
+ if object_path.first[:type] == "vehicle_journey"
+ object_path.delete_at 1
end
+ object_path.reverse.each { |sub_path| location = location + "/" + sub_path[:type].to_s.pluralize + "/" + sub_path[:id].to_s }
return location
end
@@ -49,14 +49,9 @@ module ValidationResultsHelper
end
if error[:target].present?
- if error[:target].kind_of?(Array)
- error[:target].each_with_index do |target, index|
- object_labels_hash["target_#{index}_objectid".to_sym] = target[:objectid] if target[:objectid]
- object_labels_hash["target_#{index}_label".to_sym] = target[:label] if target[:label]
- end
- else
- object_labels_hash[:target_0_objectid] = error[:target][:objectid] if error[:target][:objectid]
- object_labels_hash[:target_0_label] = error[:target][:label] if error[:target][:label]
+ error[:target].each_with_index do |target, index|
+ object_labels_hash["target_#{index}_objectid".to_sym] = target[:objectid] if target[:objectid]
+ object_labels_hash["target_#{index}_label".to_sym] = target[:label] if target[:label]
end
end
if error[:error_value].present?
diff --git a/app/helpers/validations_helper.rb b/app/helpers/validations_helper.rb
deleted file mode 100644
index b655d238d..000000000
--- a/app/helpers/validations_helper.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-# -*- coding: utf-8 -*-
-module ValidationsHelper
-
- def fields_for_validation_task_format(form)
- begin
- render :partial => validation_partial_name(form), :locals => { :form => form }
- rescue ActionView::MissingTemplate
- ""
- end
- end
-
- def validation_partial_name(form)
- "fields_#{form.object.format.underscore}_validation"
- end
-
- def compliance_icon( validation_task)
- return nil unless validation_task.compliance_check_task
- validation_task.compliance_check_task.tap do |cct|
- if cct.failed? || cct.any_error_severity_failure?
- return 'icons/link_page_alert.png'
- else
- return 'icons/link_page.png'
- end
- end
- end
-
- def validation_progress_bar_tag(validation)
- div_class = ""
- content_tag :div, :class => "progress" do
- content_tag :div, :class => div_class, role: "progressbar", :'aria-valuenow' => "#{validation.percentage_progress}", :'aria-valuemin' => "0", :'aria-valuemax' => "100", :style => "width: #{validation.percentage_progress}%;" do
- "#{validation.percentage_progress}% " + I18n.t("validation_tasks.statuses.#{validation.status}")
- end
- end
- end
-
-end
diff --git a/app/models/compliance_check.rb b/app/models/compliance_check.rb
index 37ec3cc66..cc201037f 100644
--- a/app/models/compliance_check.rb
+++ b/app/models/compliance_check.rb
@@ -1,47 +1,123 @@
class ComplianceCheck
extend Enumerize
extend ActiveModel::Naming
- include ActiveModel::Model
+ extend ActiveModel::Translation
+ include ActiveModel::Model
+ attr_reader :datas
+
+ def initialize(response)
+ @datas = response
+ end
+
+ def links
+ {}.tap do |links|
+ datas.links.each do |link|
+ links[link["rel"]] = link["href"]
+ end
+ end
+ end
+
+ def compliance_check_result
+ report_path = links["validation_report"]
+ if report_path
+ response = Ievkit.get(report_path)
+ ComplianceCheckResult.new(response)
+ else
+ raise Ievkit::IevError("Impossible to access report path link for validation")
+ end
+ end
- enumerize :severity, %w{ WARNING ERROR IMPROVMENT }
- enumerize :status, %w{ OK NOK UNCHECK }
+ def rule_parameter_set
+ rule_parameter_set = datas.links.select{ |link| link["rel"] == "validation_params"}.first.href
+ if rule_parameter_set
+ response = Ievkit.get(rule_parameter_set)
+ rule_parameter_set = RuleParameterSet.new.tap { |rps| rps.parameters = response.validation }
+ else
+ raise Ievkit::Error("Impossible to access rule parameter set link for validation")
+ end
+ end
- attr_reader :datas, :errors, :metadatas
-
- def initialize( response )
- @datas = response.datas
- @errors = response.errors
- @metadatas = response.metadatas
+ def destroy
+ delete_path = links["delete"]
+ cancel_path = links["cancel"]
+
+ if delete_path
+ Ievkit.delete(delete_path)
+ elsif cancel_path
+ Ievkit.delete(cancel_path)
+ else
+ raise Ievkit::Error("Impossible to access delete or cancel path link for compliance check")
+ end
+ end
+
+ def id
+ datas.id
end
- def import
- report_path = metadatas.find {|metatadata| "#{metadata.rel}" == "location" }
- response = IevApi.request(:get, report_path, params)
- Import.new(response)
- end
+ def status
+ # pending processing completed failed
+ # CREATED, SCHEDULED, STARTED, TERMINATED, CANCELED, ABORTED, DELETED
+ if datas.status == "CREATED"
+ "pending"
+ elsif datas.status == "SCHEDULED"
+ "pending"
+ elsif datas.status == "STARTED"
+ "processing"
+ elsif datas.status == "TERMINATED"
+ "completed"
+ elsif datas.status == "CANCELED"
+ "failed"
+ elsif datas.status == "ABORTED"
+ "failed"
+ elsif datas.status == "DELETED"
+ "failed"
+ end
+ end
- def warning
- datas.tests.select{ |test| test[:severity] == "WARNING"}
+ def format
+ datas.type
+ end
+
+ def referential_id
+ Referential.where(:slug => referential_name).id
+ end
+
+ def referential_name
+ datas.referential
end
- def error
- datas.tests.select{ |test| test[:severity] == "ERROR"}
+ def name
+ datas.action_parameters.name
end
- def improvment
- datas.tests.select{ |test| test[:severity] == "IMPROVMENT"}
+ def user_name
+ datas.action_parameters.user_name
end
- def ok
- datas.tests.select{ |test| test[:result] == "OK"}
+ def created_at?
+ datas.created?
end
- def nok
- datas.tests.select{ |test| test[:result] == "NOK"}
+ def created_at
+ Time.at(datas.created.to_i / 1000) if created_at?
end
-
- def uncheck
- datas.tests.select{ |test| test[:result] == "UNCHECK"}
+
+ def updated_at?
+ datas.updated?
end
-
+
+ def updated_at
+ Time.at(datas.updated.to_i / 1000) if updated_at?
+ end
+
+ def percentage_progress
+ if %w{created}.include? status
+ 0
+ elsif %w{ terminated canceled aborted }.include? status
+ 100
+ else
+ 20
+ end
+ end
+
end
diff --git a/app/models/compliance_check_task_export.rb b/app/models/compliance_check_export.rb
index 34d210db5..eede11d58 100644
--- a/app/models/compliance_check_task_export.rb
+++ b/app/models/compliance_check_export.rb
@@ -1,25 +1,25 @@
require 'tempfile'
-class ComplianceCheckTaskExport
+class ComplianceCheckExport
include ERB::Util
include ValidationResultsHelper
require 'zip'
attr_accessor :template, :detailed_errors_template, :request
- attr_reader :compliance_check_task
+ attr_reader :compliance_check
- def initialize(compliance_check_task, referential_id, request)
+ def initialize(compliance_check, referential_id, request)
@request = request
- @compliance_check_task = compliance_check_task
+ @compliance_check = compliance_check
@referential_id = referential_id
- @template = File.open('app/views/compliance_check_tasks/summary_errors_index.csv.erb' ) { |f| f.read }
- @detailed_errors_template = File.open('app/views/compliance_check_tasks/detailed_errors_index.csv.erb' ) { |f| f.read }
+ @template = File.open('app/views/compliance_checks/summary_errors_index.csv.erb' ) { |f| f.read }
+ @detailed_errors_template = File.open('app/views/compliance_checks/detailed_errors_index.csv.erb' ) { |f| f.read }
end
def export
begin
- Dir.mktmpdir("#{I18n.t('compliance_check_results.file.zip_name_prefix')}_#{@referential_id}_#{@compliance_check_task.id}_", Dir.tmpdir) { |temp_dir|
+ Dir.mktmpdir("#{I18n.t('compliance_check_results.file.zip_name_prefix')}_#{@referential_id}_#{@compliance_check.id}_", Dir.tmpdir) { |temp_dir|
File.open(temp_dir + "/#{I18n.t('compliance_check_results.file.summary_errors_file_prefix')}" , "a") do |f|
f.write(render)
@@ -31,7 +31,7 @@ class ComplianceCheckTaskExport
f.flush
end
- zip_file = Tempfile.new(["#{I18n.t('compliance_check_results.file.zip_name_prefix')}_#{@referential_id}_#{@compliance_check_task.id}_", ".zip"])
+ zip_file = Tempfile.new(["#{I18n.t('compliance_check_results.file.zip_name_prefix')}_#{@referential_id}_#{@compliance_check.id}_", ".zip"])
::Zip::File.open(zip_file.path, ::Zip::File::CREATE) do |zipfile|
Dir[File.join(temp_dir, '*.csv')].each do |f|
diff --git a/app/models/compliance_check_service.rb b/app/models/compliance_check_service.rb
index e254ac3d5..c27f36894 100644
--- a/app/models/compliance_check_service.rb
+++ b/app/models/compliance_check_service.rb
@@ -8,14 +8,14 @@ class ComplianceCheckService
# Find a validation whith this id
def find(id)
- ComplianceCheckTask.new(Ievkit.scheduled_job(referential.slug, id, { :action => "validator" }))
+ ComplianceCheck.new(Ievkit.scheduled_job(referential.slug, id, { :action => "validator" }))
end
# Find all validations
def all
[].tap do |jobs|
Ievkit.jobs(referential.slug, { :action => "validator" }).each do |job|
- jobs << ComplianceCheckTask.new(job)
+ jobs << ComplianceCheck.new(job)
end
end
end
diff --git a/app/models/import.rb b/app/models/import.rb
index 13e76823f..d7f386bc7 100644
--- a/app/models/import.rb
+++ b/app/models/import.rb
@@ -22,17 +22,17 @@ class Import
report_path = links["action_report"]
if report_path
response = Ievkit.get(report_path)
- ImportReport.new(response)
+ ImportReport.new(response, id)
else
raise Ievkit::IevError("Impossible to access report path link for import")
end
end
- def compliance_check
+ def compliance_check_result
compliance_check_path = links["validation_report"]
if compliance_check_path
response = Ievkit.get(compliance_check_path)
- ComplianceCheck.new(response)
+ ComplianceCheckResult.new(response)
else
raise Ievkit::Error("Impossible to access compliance check path link for import")
end
@@ -64,7 +64,7 @@ class Import
end
def format
- datas.format
+ datas.type
end
def filename
diff --git a/app/views/compliance_check_results/index.html.erb b/app/views/compliance_check_results/index.html.erb
index dd28a531b..2221fa0a4 100644
--- a/app/views/compliance_check_results/index.html.erb
+++ b/app/views/compliance_check_results/index.html.erb
@@ -20,7 +20,7 @@
<% data_content = t ( "activemodel.attributes.compliance_check_result." + compliance_check_result.test_id ) %>
<% data_title = t ( "activemodel.attributes.compliance_check_result.title" ) %>
<button data-content='<%= data_content %>' data-title='<%= data_title %>' rel="popover" data-toggle="popover" class="notice btn btn-info btn-xs" ><i class="fa fa-info"></i></button>
- <%= link_to compliance_check_result.test_id, test_definition(compliance_check_result.test_id), :title => ComplianceCheckResult.human_attribute_name(compliance_check_result.test_id), :target => "compliance_check_task" %></td>
+ <%= link_to compliance_check_result.test_id, test_definition(compliance_check_result.test_id), :title => ComplianceCheckResult.human_attribute_name(compliance_check_result.test_id), :target => "compliance_check" %></td>
<% if @compliance_check_results && @compliance_check_results.first.result == "NOK" %>
<td class="td_error">
<% if compliance_check_result.errors.present? %>
@@ -55,5 +55,5 @@
<% end %>
</tbody>
</table>
-<%= javascript_include_tag referential_compliance_check_task_compliance_check_results_path(@referential, @compliance_check_task.id, :format => :js) %>
+<%= javascript_include_tag referential_compliance_check_compliance_check_results_path(@referential, @compliance_check.id, :format => :js) %>
diff --git a/app/views/compliance_check_tasks/_compliance_check_task.html.erb b/app/views/compliance_check_tasks/_compliance_check_task.html.erb
deleted file mode 100644
index 4a7278b11..000000000
--- a/app/views/compliance_check_tasks/_compliance_check_task.html.erb
+++ /dev/null
@@ -1,35 +0,0 @@
-<div id="index_item" class="panel panel-default">
- <div class="panel-heading">
- <div class="panel-title clearfix">
- <span class="pull-right">
- <% location = compliance_check_task.datas.links.select { |link| link["rel"] == "location" } %>
- <% location = location.first if location %>
- <% location = location.href if location %>
- <%= link_to "#{location}", :method => :delete, :data => {:confirm => t('compliance_check_tasks.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %>
- <span class="fa fa-trash-o"></span>
- <% end %>
- </span>
- <h5>
- <%= link_to( referential_compliance_check_task_path(@referential, compliance_check_task.id), :class => "preview", :title => "#{ComplianceCheckTask.model_name.human.capitalize} #{compliance_check_task.name}") do %>
- <span class="name">
- <%= truncate(compliance_check_task.name, :length => 20) %>
- </span>
- <% end %>
- </h5>
- </div>
- </div>
- <div class="panel-body">
- <% if compliance_check_task.import_task.present? %>
- <p><%= link_to( image_tag('icons/link_page.png') + t("compliance_check_tasks.import_task"), referential_import_task_path(@referential, compliance_check_task.import_task)) %></p>
- <% end %>
- <% if compliance_check_task.rule_parameter_set %>
- <p><%= link_to( image_tag('icons/link_page.png') + t("compliance_check_tasks.actions.rule_parameter_set"), rule_parameter_set_referential_compliance_check_task_path(@referential, compliance_check_task.id)) %></p>
- <% end %>
- </div>
- <div class="panel-footer">
- <%= compliance_check_task_progress_bar_tag(compliance_check_task) %>
- <div class="history">
- <%= l compliance_check_task.created_at, :format => "%d/%m/%Y %H:%M" %> | <%= compliance_check_task.user_name %>
- </div>
- </div>
-</div>
diff --git a/app/views/compliance_check_tasks/_compliance_check_tasks.html.erb b/app/views/compliance_check_tasks/_compliance_check_tasks.html.erb
deleted file mode 100644
index 33c08ffe7..000000000
--- a/app/views/compliance_check_tasks/_compliance_check_tasks.html.erb
+++ /dev/null
@@ -1,9 +0,0 @@
-<div class="page_info">
- <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @compliance_check_tasks %>
-</div>
-<div class="compliance_check_tasks paginated_content">
- <%= paginated_content @compliance_check_tasks, "compliance_check_tasks/compliance_check_task" %>
-</div>
-<div class="pagination">
- <%= will_paginate @compliance_check_tasks, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer %>
-</div>
diff --git a/app/views/compliance_check_tasks/detailed_errors_index.csv.erb b/app/views/compliance_check_tasks/detailed_errors_index.csv.erb
deleted file mode 100644
index f5748ffc6..000000000
--- a/app/views/compliance_check_tasks/detailed_errors_index.csv.erb
+++ /dev/null
@@ -1,2 +0,0 @@
-<%= I18n.t("activemodel.attributes.compliance_check_result.severity") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.rule_code") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.object") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.resource") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.title") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.detail") %>
-<% @compliance_check_task.compliance_check_result.results.each do |r| %><% if r.errors.present? %><% r.errors.first(10).each do |error| %><% case r.severity %><% when "WARNING" %><%= I18n.t "compliance_check_result.severities.warning_txt" %><% when "ERROR" %><%= I18n.t "compliance_check_result.severities.error_txt" %><% end %>;<%= r.test_id %>;<% if error["source"].present? %><%= error["source"]["objectid"] if error["source"]["objectid"].present? %>;<% if error["source"]["object_path"].present? %><%= object_url(@referential_id, error) %><% elsif error["source"]["file"].present? %><%= File.basename(error["source"]["file"]["filename"]) +" - " %><%= I18n.t "compliance_check_results.index.column" %>:<%= error["source"]["file"]["column_number"] %>,<%= I18n.t "compliance_check_results.index.line" %>:<%= error["source"]["file"]["line_number"] %><% end %>;<% else %>;;<% end %><%= I18n.t("activemodel.attributes.compliance_check_result."+r.test_id) %>;<%= I18n.t("compliance_check_result.details.detail_" + error["error_id"], object_labels_hash(error) )%><%= "\n" %><% end %><% end %><% end %> \ No newline at end of file
diff --git a/app/views/compliance_check_tasks/index.js.erb b/app/views/compliance_check_tasks/index.js.erb
deleted file mode 100644
index 08ddf1dc5..000000000
--- a/app/views/compliance_check_tasks/index.js.erb
+++ /dev/null
@@ -1 +0,0 @@
-$('#compliance_check_tasks').html('<%= escape_javascript(render("compliance_check_tasks")) %>'); \ No newline at end of file
diff --git a/app/views/compliance_check_tasks/summary_errors_index.csv.erb b/app/views/compliance_check_tasks/summary_errors_index.csv.erb
deleted file mode 100644
index 451be4276..000000000
--- a/app/views/compliance_check_tasks/summary_errors_index.csv.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<%= I18n.t("activemodel.attributes.compliance_check_result.severity") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.status") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.rule_code") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.title") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.url") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.violation_count_txt") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.objects") %>
-<% @compliance_check_task.compliance_check_result.results.each do |r| %><% case r.severity %><% when "WARNING" %><%= I18n.t "compliance_check_result.severities.warning_txt" %><% when "ERROR" %><%= I18n.t "compliance_check_result.severities.error_txt" %><% end %>;<%= r.result %>;<%= r.test_id %>;<%= I18n.t("activemodel.attributes.compliance_check_result."+r.test_id) %>;<%= Rails.application.config.validation_spec + I18n.locale.to_s + "/" + r.test_id + ".html" %>;<%= r.error_count %><% if r.error_count > 0 %><% if r.errors.present? %>;<% r.errors.first(10).each do |error| %><% if error["source"] %><%= error["source"]["objectid"] + " " %><% else %><%= " " %><% end %><% end %><% end %><% end %>
-<% end %> \ No newline at end of file
diff --git a/app/views/compliance_checks/_compliance_check.html.erb b/app/views/compliance_checks/_compliance_check.html.erb
new file mode 100644
index 000000000..976b7a17b
--- /dev/null
+++ b/app/views/compliance_checks/_compliance_check.html.erb
@@ -0,0 +1,32 @@
+<div id="index_item" class="panel panel-default">
+ <div class="panel-heading">
+ <div class="panel-title clearfix">
+ <span class="pull-right">
+ <%= link_to referential_compliance_check_path(@referential, compliance_check.id), :method => :delete, :data => {:confirm => t('compliance_checks.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %>
+ <span class="fa fa-trash-o"></span>
+ <% end %>
+ </span>
+ <h5>
+ <%= link_to( referential_compliance_check_path(@referential, compliance_check.id), :class => "preview", :title => "#{ComplianceCheck.model_name.human.capitalize} #{compliance_check.name}") do %>
+ <span class="name">
+ <%= truncate(compliance_check.name, :length => 20) %>
+ </span>
+ <% end %>
+ </h5>
+ </div>
+ </div>
+ <div class="panel-body">
+ <!-- % if compliance_check.import.present? % -->
+ <p><!-- %= link_to( image_tag('icons/link_page.png') + t("compliance_checks.import"), referential_import_path(@referential, compliance_check.import)) % --></p>
+ <!-- % end % -->
+ <% if compliance_check.rule_parameter_set %>
+ <p><%= link_to( image_tag('icons/link_page.png') + t("compliance_checks.actions.rule_parameter_set"), rule_parameter_set_referential_compliance_check_path(@referential, compliance_check.id)) %></p>
+ <% end %>
+ </div>
+ <div class="panel-footer">
+ <%= compliance_check_progress_bar_tag(compliance_check) %>
+ <div class="history">
+ <%= l compliance_check.created_at, :format => "%d/%m/%Y %H:%M" %> | <%= compliance_check.user_name %>
+ </div>
+ </div>
+</div>
diff --git a/app/views/compliance_checks/_compliance_checks.html.erb b/app/views/compliance_checks/_compliance_checks.html.erb
new file mode 100644
index 000000000..e28af86fc
--- /dev/null
+++ b/app/views/compliance_checks/_compliance_checks.html.erb
@@ -0,0 +1,9 @@
+<div class="page_info">
+ <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @compliance_checks %>
+</div>
+<div class="compliance_checks paginated_content">
+ <%= paginated_content @compliance_checks, "compliance_checks/compliance_check" %>
+</div>
+<div class="pagination">
+ <%= will_paginate @compliance_checks, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer %>
+</div>
diff --git a/app/views/compliance_checks/detailed_errors_index.csv.erb b/app/views/compliance_checks/detailed_errors_index.csv.erb
new file mode 100644
index 000000000..8e029b634
--- /dev/null
+++ b/app/views/compliance_checks/detailed_errors_index.csv.erb
@@ -0,0 +1,2 @@
+<%= I18n.t("activemodel.attributes.compliance_check_result.severity") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.rule_code") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.object") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.resource") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.title") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.detail") %>
+<% @compliance_check.compliance_check_result.results.each do |r| %><% if r.errors.present? %><% r.errors.first(10).each do |error| %><% case r.severity %><% when "WARNING" %><%= I18n.t "compliance_check_result.severities.warning_txt" %><% when "ERROR" %><%= I18n.t "compliance_check_result.severities.error_txt" %><% end %>;<%= r.test_id %>;<% if error["source"].present? %><%= error["source"]["objectid"] if error["source"]["objectid"].present? %>;<% if error["source"]["object_path"].present? %><%= object_url(@referential_id, error) %><% elsif error["source"]["file"].present? %><%= File.basename(error["source"]["file"]["filename"]) +" - " %><%= I18n.t "compliance_check_results.index.column" %>:<%= error["source"]["file"]["column_number"] %>,<%= I18n.t "compliance_check_results.index.line" %>:<%= error["source"]["file"]["line_number"] %><% end %>;<% else %>;;<% end %><%= I18n.t("activemodel.attributes.compliance_check_result."+r.test_id) %>;<%= I18n.t("compliance_check_result.details.detail_" + error["error_id"], object_labels_hash(error) )%><%= "\n" %><% end %><% end %><% end %> \ No newline at end of file
diff --git a/app/views/compliance_check_tasks/index.html.erb b/app/views/compliance_checks/index.html.erb
index 6cddaeff7..4a3470ad5 100644
--- a/app/views/compliance_check_tasks/index.html.erb
+++ b/app/views/compliance_checks/index.html.erb
@@ -1,7 +1,7 @@
<%= title_tag t('.title') %>
<div class="warning"><%= t('.warning') %> </div>
-<div id="compliance_check_tasks"><%= render 'compliance_check_tasks' %></div>
+<div id="compliance_checks"><%= render 'compliance_checks' %></div>
<% content_for :sidebar do %>
<ul class="actions">
diff --git a/app/views/compliance_checks/index.js.erb b/app/views/compliance_checks/index.js.erb
new file mode 100644
index 000000000..236a9068c
--- /dev/null
+++ b/app/views/compliance_checks/index.js.erb
@@ -0,0 +1 @@
+$('#compliance_checks').html('<%= escape_javascript(render("compliance_checks")) %>'); \ No newline at end of file
diff --git a/app/views/compliance_check_tasks/show.html.erb b/app/views/compliance_checks/show.html.erb
index 7d786f1b1..12d40cd49 100644
--- a/app/views/compliance_check_tasks/show.html.erb
+++ b/app/views/compliance_checks/show.html.erb
@@ -1,24 +1,24 @@
-<%= title_tag "#{@compliance_check_task.name} <span class='status status_#{@compliance_check_task.status}'>#{ t('compliance_check_tasks.show.'+@compliance_check_task.status) }</span>" %>
-<% @title = "#{@compliance_check_task.name}" %>
+<%= title_tag "#{@compliance_check.name} <span class='status status_#{@compliance_check.status}'>#{ t('compliance_checks.show.'+@compliance_check.status) }</span>" %>
+<% @title = "#{@compliance_check.name}" %>
-<div class="compliance_check_task_show">
+<div class="compliance_check_show">
<div class="links">
- <% if @compliance_check_task.import_task %>
- <%= link_to image_tag('icons/link_page.png') + t("compliance_check_tasks.import_task"), referential_import_task_path(@referential, @compliance_check_task.import_task) %>
- <% end %>
- <% if @compliance_check_task.rule_parameter_set %>
- <%= link_to image_tag('icons/link_page.png') + t("compliance_check_tasks.rule_parameter_set"), rule_parameter_set_referential_compliance_check_task_path(@referential, @compliance_check_task.id) %>
+ <!-- % if @compliance_check.import % -->
+ <!-- %= link_to image_tag('icons/link_page.png') + t("compliance_checks.import"), referential_import_path(@referential, @compliance_check.import) % -->
+ <!-- % end % -->
+ <% if @compliance_check.rule_parameter_set %>
+ <%= link_to image_tag('icons/link_page.png') + t("compliance_checks.rule_parameter_set"), rule_parameter_set_referential_compliance_check_path(@referential, @compliance_check.id) %>
<% end %>
<div class="btn-group pull-right">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<%= t(".export") %> <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
- <li><%= link_to t(".export_csv"), export_referential_compliance_check_task_path(@referential, @compliance_check_task.id) %></li>
+ <li><%= link_to t(".export_csv"), export_referential_compliance_check_path(@referential, @compliance_check.id) %></li>
</ul>
</div>
</div>
- <% if @compliance_check_task.status == 'completed'%>
+ <% if @compliance_check.status == 'completed'%>
<div class="resume">
<div class="col1">
<div class="caption"><%= t "error", :scope => "compliance_check_result.severities" %></div>
@@ -35,13 +35,13 @@
<div class="report"></div>
<% end %>
- <%= javascript_include_tag referential_compliance_check_task_path(@referential, @compliance_check_task.id,:format => :js) %>
+ <%= javascript_include_tag referential_compliance_check_path(@referential, @compliance_check.id,:format => :js) %>
</div>
<% content_for :sidebar do %>
<ul class="actions">
- <li><%= link_to t('compliance_check_tasks.actions.destroy'), referential_compliance_check_task_path(@referential, @compliance_check_task.id), :method => :delete, :data => {:confirm => t('compliance_check_tasks.actions.destroy_confirm')}, :class => "remove" %></li>
+ <li><%= link_to t('compliance_checks.actions.destroy'), referential_compliance_check_path(@referential, @compliance_check.id), :method => :delete, :data => {:confirm => t('compliance_checks.actions.destroy_confirm')}, :class => "remove" %></li>
</ul>
-<%= history_tag(@compliance_check_task) %>
+<%= history_tag(@compliance_check) %>
<% end %>
diff --git a/app/views/compliance_check_tasks/show.js.coffee b/app/views/compliance_checks/show.js.coffee
index 88d1faf55..fecf7ef8f 100644
--- a/app/views/compliance_check_tasks/show.js.coffee
+++ b/app/views/compliance_checks/show.js.coffee
@@ -6,7 +6,7 @@ jQuery ->
h["severity"] = severity if severity
$.get(
- "<%= @compliance_check_task.id %>/compliance_check_results",
+ "<%= @compliance_check.id %>/compliance_check_results",
h,
update = (data) ->
html_container.empty()
@@ -16,9 +16,9 @@ jQuery ->
Morris.Donut({
element: 'error',
data: [
- {label: "<%= t 'nok', :scope => 'compliance_check_result.statuses' %>", value: <%= @compliance_check_task.compliance_check_result.nok_error.count %>},
- {label: "<%= t 'na', :scope => 'compliance_check_result.statuses' %>", value: <%= @compliance_check_task.compliance_check_result.na_error.count %>},
- {label: "<%= t 'ok', :scope => 'compliance_check_result.statuses' %>", value: <%= @compliance_check_task.compliance_check_result.ok_error.count %>}
+ {label: "<%= t 'nok', :scope => 'compliance_check_result.statuses' %>", value: <%= @compliance_check.compliance_check_result.nok_error.count %>},
+ {label: "<%= t 'na', :scope => 'compliance_check_result.statuses' %>", value: <%= @compliance_check.compliance_check_result.na_error.count %>},
+ {label: "<%= t 'ok', :scope => 'compliance_check_result.statuses' %>", value: <%= @compliance_check.compliance_check_result.ok_error.count %>}
]
colors: [ "#e22b1b", "#898e7f", "#8fc861" ]
}).on('click', update = (i, row) ->
@@ -31,9 +31,9 @@ jQuery ->
Morris.Donut({
element: 'warning',
data: [
- {label: "<%= t 'nok', :scope => 'compliance_check_result.statuses' %>", value: <%= @compliance_check_task.compliance_check_result.nok_warning.count %>},
- {label: "<%= t 'na', :scope => 'compliance_check_result.statuses' %>", value: <%= @compliance_check_task.compliance_check_result.na_warning.count %>},
- {label: "<%= t 'ok', :scope => 'compliance_check_result.statuses' %>", value: <%= @compliance_check_task.compliance_check_result.ok_warning.count %>}
+ {label: "<%= t 'nok', :scope => 'compliance_check_result.statuses' %>", value: <%= @compliance_check.compliance_check_result.nok_warning.count %>},
+ {label: "<%= t 'na', :scope => 'compliance_check_result.statuses' %>", value: <%= @compliance_check.compliance_check_result.na_warning.count %>},
+ {label: "<%= t 'ok', :scope => 'compliance_check_result.statuses' %>", value: <%= @compliance_check.compliance_check_result.ok_warning.count %>}
]
colors: [ "#ffbd2b", "#898e7f", "#8fc861" ]
}).on('click', update = (i, row) ->
diff --git a/app/views/compliance_checks/summary_errors_index.csv.erb b/app/views/compliance_checks/summary_errors_index.csv.erb
new file mode 100644
index 000000000..a9581bc76
--- /dev/null
+++ b/app/views/compliance_checks/summary_errors_index.csv.erb
@@ -0,0 +1,3 @@
+<%= I18n.t("activemodel.attributes.compliance_check_result.severity") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.status") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.rule_code") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.title") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.url") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.violation_count_txt") %>;<%= I18n.t("activemodel.attributes.compliance_check_result.objects") %>
+<% @compliance_check.compliance_check_result.results.each do |r| %><% case r.severity %><% when "WARNING" %><%= I18n.t "compliance_check_result.severities.warning_txt" %><% when "ERROR" %><%= I18n.t "compliance_check_result.severities.error_txt" %><% end %>;<%= r.result %>;<%= r.test_id %>;<%= I18n.t("activemodel.attributes.compliance_check_result."+r.test_id) %>;<%= Rails.application.config.validation_spec + I18n.locale.to_s + "/" + r.test_id + ".html" %>;<%= r.error_count %><% if r.error_count > 0 %><% if r.errors.present? %>;<% r.errors.first(10).each do |error| %><% if error["source"] %><%= error["source"]["objectid"] + " " %><% else %><%= " " %><% end %><% end %><% end %><% end %>
+<% end %> \ No newline at end of file
diff --git a/app/views/shared/_header.erb b/app/views/shared/_header.erb
index cd43eb528..1ebb78a43 100644
--- a/app/views/shared/_header.erb
+++ b/app/views/shared/_header.erb
@@ -68,8 +68,8 @@
</ul>
</li>
<li><%= link_to Referential.human_attribute_name("imports"), referential_imports_path(@referential) %></li>
- <li><%= link_to Referential.human_attribute_name("export_tasks"), referential_exports_path(@referential) %></li>
- <li><%= link_to Referential.human_attribute_name("validations"), referential_compliance_check_tasks_path(@referential) %></li>
+ <li><%= link_to Referential.human_attribute_name("exports"), referential_exports_path(@referential) %></li>
+ <li><%= link_to Referential.human_attribute_name("compliance_checks"), referential_compliance_checks_path(@referential) %></li>
<% end %>
</ul>
<ul class="nav navbar-nav navbar-right">
diff --git a/config/locales/compliance_check_tasks.yml b/config/locales/compliance_check_tasks.yml
index ddbbdb5e6..45194cfc7 100644
--- a/config/locales/compliance_check_tasks.yml
+++ b/config/locales/compliance_check_tasks.yml
@@ -1,19 +1,5 @@
en:
compliance_check_tasks:
- index:
- title: "Validation"
- warning: ""
- edit:
- title: "Edit the Validation"
- show:
- title: "Neptune Validation"
- summary: "Rapport de conformité à la norme NEPTUNE"
- completed: "[ Completed ]"
- failed: "[ Failed ]"
- pending: "[ In the treatment queue ]"
- processing: "[ In progress... ]"
- export: "Download test report"
- export_csv: "CSV format"
new:
title: "Create a new validation"
submit: "Create a validation"
@@ -21,68 +7,9 @@ en:
flash: "Validation task on queue, refresh page to see progression"
actions:
new: "Add a validation"
- destroy_confirm: "Do you confirm to destroy this validation ?"
- destroy: "Destroy this validation"
- edit: "Edit this validation"
- rule_parameter_set: "Rule parameter set"
- download: "Download"
- statuses:
- pending: "Pending"
- processing: "Processing"
- completed: "Completed"
- failed: "Failed"
- file_validation_log_messages:
- messages:
- undefined: "%{key} undefined"
- TooMuchDetails: ( %{0} erreurs / warnings supplémentaires )
- ONE: "Catégorie 1 : Syntaxe"
- severities:
- uncheck: "Unchecked"
- ok: "Ok"
- warning: "Warning"
- error: "Error"
- fatal: "Fatal"
- import_task: "Import Report"
- rule_parameter_set: "Rule Parameter Set"
- activerecord:
- models:
- file_validation:
- zero: "Validation"
- one: "Validation"
- other: "Validation"
- attributes:
- file_validation:
- created_at: "Executed at"
- references_type: "Associated Data Type"
- reference_ids: "Associated Data"
- rule_parameter_set_id: "Rule parameters set"
- resources: "File to validate"
- status: "Status"
- file_name: "Tested data"
- projection_reference: "Système de projection de référence"
- file_validation_log_message:
- created_at: "Date"
- position: "N."
- full_message: "Message"
fr:
compliance_check_tasks:
- index:
- title: "Validation"
- warning: ""
- edit:
- title: "Editer la validation"
- show:
- title: "Validation Neptune"
- summary: "Rapport de conformité à la norme NEPTUNE"
- details: "Détails"
- parameters: "Paramètres des tests"
- completed: "[ Terminé ]"
- failed: "[ Echoué ]"
- pending: "[ En file d'attente ]"
- processing: "[ En progression... ]"
- export: "Télécharger les résultats"
- export_csv: "Format CSV"
new:
title: "Démarrer une nouvelle validation"
submit: "Lancer la validation"
@@ -90,64 +17,3 @@ fr:
flash: "La demande de validation est mise en file d'attente, veuillez rafraichir régulièrement la page pour en suivre la progression"
actions:
new: "Ajouter une validation"
- destroy_confirm: "Voulez-vous supprimer ce résultat de validation ?"
- destroy: "Supprimer cette validation"
- edit: "Editer cette validation"
- rule_parameter_set: "Jeu de paramètres"
- download: "Télécharger"
- statuses:
- pending: "En attente ..."
- processing: "En cours ..."
- completed: "Achevé"
- failed: "Echoué"
- uncheck_count:
- zero: "aucun inapplicable"
- one: "un inapplicable"
- other: "%{count} inapplicables"
- ok_count:
- zero: "aucun test réussi"
- one: "un test réussi"
- other: "%{count} tests réussis"
- warning_count:
- zero: "aucun warning"
- one: "un warning"
- other: "%{count} warnings"
- error_count:
- zero: "aucune erreur"
- one: "une erreur"
- other: "%{count} erreurs"
- fatal_count:
- zero: "aucune erreur fatale"
- one: "une erreur fatale"
- other: "%{count} erreurs fatales"
- import_task: "Import"
- rule_parameter_set: "Jeu de paramètres"
- file_validation_log_messages:
- messages:
- undefined: "%{key} non défini"
- TooMuchDetails: "( %{0} erreurs / warnings supplémentaires )"
- severities:
- uncheck: "Non testé"
- ok: "Ok"
- warning: "Alerte"
- error: "Erreur"
- fatal: "Fatal"
- activerecord:
- models:
- compliance_check_task:
- zero: "Validation"
- one: "Validation"
- other: "Validations"
- attributes:
- compliance_check_task:
- created_at: "Exécuté le"
- references_type: "Type de données incluses"
- reference_ids: "Données incluses"
- rule_parameter_set_id: "Jeu de paramètres"
- resources: "Fichier à valider"
- status: "Status"
- file_name: "Jeu de données"
- compliance_check_task_log_message:
- created_at: "Date"
- position: "N."
- full_message: "Message"
diff --git a/config/locales/compliance_checks.yml b/config/locales/compliance_checks.yml
new file mode 100644
index 000000000..1255b55a1
--- /dev/null
+++ b/config/locales/compliance_checks.yml
@@ -0,0 +1,141 @@
+en:
+ compliance_checks:
+ index:
+ title: "Validation"
+ warning: ""
+ edit:
+ title: "Edit the Validation"
+ show:
+ title: "Neptune Validation"
+ summary: "Rapport de conformité à la norme NEPTUNE"
+ completed: "[ Completed ]"
+ failed: "[ Failed ]"
+ pending: "[ In the treatment queue ]"
+ processing: "[ In progress... ]"
+ export: "Download test report"
+ export_csv: "CSV format"
+ actions:
+ destroy_confirm: "Do you confirm to destroy this validation ?"
+ destroy: "Destroy this validation"
+ edit: "Edit this validation"
+ rule_parameter_set: "Rule parameter set"
+ download: "Download"
+ statuses:
+ pending: "Pending"
+ processing: "Processing"
+ completed: "Completed"
+ failed: "Failed"
+ file_validation_log_messages:
+ messages:
+ undefined: "%{key} undefined"
+ TooMuchDetails: ( %{0} erreurs / warnings supplémentaires )
+ ONE: "Catégorie 1 : Syntaxe"
+ severities:
+ uncheck: "Unchecked"
+ ok: "Ok"
+ warning: "Warning"
+ error: "Error"
+ fatal: "Fatal"
+ import: "Import Report"
+ rule_parameter_set: "Rule Parameter Set"
+ activemodel:
+ models:
+ file_validation:
+ zero: "Validation"
+ one: "Validation"
+ other: "Validation"
+ attributes:
+ file_validation:
+ created_at: "Executed at"
+ references_type: "Associated Data Type"
+ reference_ids: "Associated Data"
+ rule_parameter_set_id: "Rule parameters set"
+ resources: "File to validate"
+ status: "Status"
+ file_name: "Tested data"
+ projection_reference: "Système de projection de référence"
+ file_validation_log_message:
+ created_at: "Date"
+ position: "N."
+ full_message: "Message"
+
+fr:
+ compliance_checks:
+ index:
+ title: "Validation"
+ warning: ""
+ edit:
+ title: "Editer la validation"
+ show:
+ title: "Validation Neptune"
+ summary: "Rapport de conformité à la norme NEPTUNE"
+ details: "Détails"
+ parameters: "Paramètres des tests"
+ completed: "[ Terminé ]"
+ failed: "[ Echoué ]"
+ pending: "[ En file d'attente ]"
+ processing: "[ En progression... ]"
+ export: "Télécharger les résultats"
+ export_csv: "Format CSV"
+ actions:
+ destroy_confirm: "Voulez-vous supprimer ce résultat de validation ?"
+ destroy: "Supprimer cette validation"
+ edit: "Editer cette validation"
+ rule_parameter_set: "Jeu de paramètres"
+ download: "Télécharger"
+ statuses:
+ pending: "En attente ..."
+ processing: "En cours ..."
+ completed: "Achevé"
+ failed: "Echoué"
+ uncheck_count:
+ zero: "aucun inapplicable"
+ one: "un inapplicable"
+ other: "%{count} inapplicables"
+ ok_count:
+ zero: "aucun test réussi"
+ one: "un test réussi"
+ other: "%{count} tests réussis"
+ warning_count:
+ zero: "aucun warning"
+ one: "un warning"
+ other: "%{count} warnings"
+ error_count:
+ zero: "aucune erreur"
+ one: "une erreur"
+ other: "%{count} erreurs"
+ fatal_count:
+ zero: "aucune erreur fatale"
+ one: "une erreur fatale"
+ other: "%{count} erreurs fatales"
+ import: "Import"
+ rule_parameter_set: "Jeu de paramètres"
+ file_validation_log_messages:
+ messages:
+ undefined: "%{key} non défini"
+ TooMuchDetails: "( %{0} erreurs / warnings supplémentaires )"
+ severities:
+ uncheck: "Non testé"
+ ok: "Ok"
+ warning: "Alerte"
+ error: "Erreur"
+ fatal: "Fatal"
+ activemodel:
+ models:
+ compliance_check:
+ zero: "Validation"
+ one: "Validation"
+ other: "Validations"
+ attributes:
+ compliance_check:
+ created_at: "Exécuté le"
+ references_type: "Type de données incluses"
+ reference_ids: "Données incluses"
+ rule_parameter_set_id: "Jeu de paramètres"
+ resources: "Fichier à valider"
+ status: "Status"
+ file_name: "Jeu de données"
+ compliance_check_log_message:
+ created_at: "Date"
+ position: "N."
+ full_message: "Message"
diff --git a/config/locales/import_tasks.yml b/config/locales/import_tasks.yml
new file mode 100644
index 000000000..d016d9664
--- /dev/null
+++ b/config/locales/import_tasks.yml
@@ -0,0 +1,208 @@
+en:
+ import_tasks:
+ actions:
+ new: "New import"
+ destroy: "Destroy"
+ destroy_confirm: "Are you sure you want destroy this import?"
+ new:
+ title: "New import"
+ all: "All"
+ flash: "Import task on queue, refresh page to see progression"
+ fields_gtfs_import:
+ warning: "Filter on stop areas import only GTFS stops and transfers files, these may contain extra attributes"
+ index:
+ title: "Imports"
+ warning: ""
+ show:
+ report: "Report"
+ not_yet_started: "On queue"
+ imported_file: "Imported file"
+ completed: "[ Completed ]"
+ failed: "[ Failed ]"
+ pending: "[ In the treatment queue ]"
+ processing: "[ In progress... ]"
+ graph:
+ files:
+ title_zip: "Import results for files in zip"
+ title_default: "Import result for %{extension} file"
+ error: "Errors"
+ ignored: "Ignored"
+ ok: "Success"
+ lines:
+ title: "Imported objects"
+ objects_label: "Objects count"
+ lines_stats: "Lines"
+ routes_stats: "Routes"
+ connection_links_stats: "Connection Links"
+ time_tables_stats: "Timetables"
+ stop_areas_stats: "Stop Areas"
+ access_points_stats: "Access Points"
+ vehicle_journeys_stats: "Vehicle Journeys"
+ journey_patterns_stats: "Journey Patterns"
+ statuses:
+ created: "Pending ..."
+ scheduled: "Processing ..."
+ terminated: "Completed"
+ canceled: "Canceled"
+ aborted: "Failed"
+ compliance_check_task: "Validate Report"
+ severities:
+ info: "Information"
+ uncheck: "Unchecked"
+ ok: "Ok"
+ warning: "Warning"
+ error: "Error"
+ fatal: "Fatal"
+ activerecord:
+ models:
+ import_task:
+ zero: "import"
+ one: "import"
+ other: "imports"
+ neptune_import:
+ zero: "import"
+ one: "Neptune import"
+ other: "imports"
+ csv_import:
+ zero: "import"
+ one: "CSV import"
+ other: "imports"
+ gtfs_import:
+ zero: "import"
+ one: "GTFS import"
+ other: "imports"
+ netex_import:
+ zero: "import"
+ one: "NeTEx import"
+ other: "imports"
+ attributes:
+ import_task:
+ resources: "File to import"
+ created_at: "Created on"
+ status: "Status"
+ references_type: "subset"
+ no_save: "No save"
+ rule_parameter_set_id: "Rule parameter set for compliance check"
+ object_id_prefix: "Neptune Id prefix"
+ max_distance_for_commercial: "Max distance for commercial stop"
+ max_distance_for_connection_link: "Max distance for connection link"
+ ignore_last_word: "ignore last word"
+ ignore_end_chars: "ignore last chars"
+ formtastic:
+ titles:
+ import_task:
+ max_distance_for_commercial: "Maximal distance to merge homonymous stops in commercial stop in meter"
+ max_distance_for_connection_link: "Maximal distance to link stops by connection link stop in meter"
+ ignore_last_word: "ignore last word on stop name in homonymous detection (inappliable when just one word occurs)"
+ ignore_end_chars: "ignore some chars at the end of stop names in homonymous detection"
+fr:
+ import_tasks:
+ actions:
+ new: "Nouvel import"
+ destroy: "Supprimer cet import"
+ destroy_confirm: "Etes vous sûr de supprimer cet import ?"
+ new:
+ title: "Nouvel import"
+ all: "Tout"
+ flash: "La demande d'import est mise en file d'attente, veuillez rafraichir régulièrement la page pour en suivre la progression"
+ fields_gtfs_import:
+ warning: "Le filtre sur arrêts importe uniquement les fichiers GTFS stops et transfers gtfs, ceux-ci pouvant contenir des attributs supplémentaires"
+ index:
+ title: "Imports"
+ warning: ""
+ show:
+ report: "Rapport"
+ not_yet_started: "En file d'attente"
+ imported_file: "Fichier importé"
+ completed: "[ Terminé ]"
+ failed: "[ Echoué ]"
+ pending: "[ En file d'attente ]"
+ processing: "[ En progression... ]"
+ graph:
+ files:
+ title_zip: "Résultat d'import des fichiers du zip"
+ title_default: "Résultat d'import du fichier %{extension}"
+ error: "Erreurs"
+ ignored: "Ignorés"
+ ok: "Succès"
+ lines:
+ title: "Volume de données lues par type de donnée"
+ objects_label: "Quantité lue"
+ lines_stats: "Lignes"
+ routes_stats: "Séquences d'arrêts"
+ connection_links_stats: "Correspondances"
+ time_tables_stats: "Calendriers"
+ stop_areas_stats: "Zones d'arrèt"
+ access_points_stats: "Accès"
+ vehicle_journeys_stats: "Courses"
+ journey_patterns_stats: "Missions"
+ table:
+ line:
+ name: "Nom"
+ save: "Sauvegarde"
+ routes: "Séquences d'arrêts"
+ connection_links: "Correspondances"
+ time_tables: "Calendriers"
+ stop_areas: "Zones d'arrèt"
+ access_points: "Accès"
+ vehicle_journeys: "Courses"
+ journey_patterns: "Missions"
+ not_saved: "Non Sauvé"
+ saved: "Sauvé"
+ save_error: "Sauvegarde en erreur"
+ statuses:
+ created: "En attente ..."
+ scheduled: "En cours ..."
+ terminated: "Achevé"
+ canceled: "Annulé"
+ aborted: "Echoué"
+ compliance_check_task: "Validation"
+ severities:
+ info: "Information"
+ uncheck: "Non testé"
+ ok: "Ok"
+ warning: "Alerte"
+ error: "Erreur"
+ fatal: "Fatal"
+ activerecord:
+ models:
+ import_task:
+ zero: "import"
+ one: "import"
+ other: "imports"
+ neptune_import:
+ zero: "import"
+ one: "import Neptune"
+ other: "imports"
+ csv_import:
+ zero: "import"
+ one: "import CSV"
+ other: "imports"
+ gtfs_import:
+ zero: "import"
+ one: "import GTFS"
+ other: "imports"
+ netex_import:
+ zero: "import"
+ one: "import NeTEx"
+ other: "imports"
+ attributes:
+ import_task:
+ resources: "Fichier à importer"
+ created_at: "Créé le"
+ status: "Status"
+ no_save: "Pas de sauvegarde"
+ references_type: "Sous ensemble"
+ rule_parameter_set_id: "Jeu de paramètres pour validation"
+ object_id_prefix: "Préfixe d'identifiants"
+ max_distance_for_commercial: "Distance max pour créer les zones"
+ max_distance_for_connection_link: "Distance max pour créer les correspondances"
+ ignore_last_word: "ignorer le dernier mot"
+ ignore_end_chars: "ignorer les n derniers caractères"
+ formtastic:
+ titles:
+ import_task:
+ max_distance_for_commercial: "Distance maximale entre deux arrêts homonymes pour créer les zones d'arrêt (en mètre)"
+ max_distance_for_connection_link: "Distance maximale entre deux arrêts pour créer les correspondances (en mètre)"
+ ignore_last_word: "Ignorer le dernier mot pour détecter l'homonymie des noms d'arrêt (inapplicable quand le nom ne comporte qu'un mot)"
+ ignore_end_chars: "Ignorer les n derniers caractères du nom de l'arrêt pour détecter l'homonymie"
diff --git a/config/locales/imports.yml b/config/locales/imports.yml
new file mode 100644
index 000000000..5b78bf02c
--- /dev/null
+++ b/config/locales/imports.yml
@@ -0,0 +1,198 @@
+en:
+ imports:
+ actions:
+ new: "New import"
+ destroy: "Destroy"
+ destroy_confirm: "Are you sure you want destroy this import?"
+ new:
+ title: "New import"
+ all: "All"
+ flash: "Import task on queue, refresh page to see progression"
+ fields_gtfs_import:
+ warning: "Filter on stop areas import only GTFS stops and transfers files, these may contain extra attributes"
+ index:
+ title: "Imports"
+ warning: ""
+ show:
+ report: "Report"
+ imported_file: "Imported file"
+ graph:
+ files:
+ title_zip: "Import results for files in zip"
+ title_default: "Import result for %{extension} file"
+ error: "Errors"
+ ignored: "Ignored"
+ ok: "Success"
+ lines:
+ title: "Imported objects"
+ objects_label: "Objects count"
+ lines_stats: "Lines"
+ routes_stats: "Routes"
+ connection_links_stats: "Connection Links"
+ time_tables_stats: "Timetables"
+ stop_areas_stats: "Stop Areas"
+ access_points_stats: "Access Points"
+ vehicle_journeys_stats: "Vehicle Journeys"
+ journey_patterns_stats: "Journey Patterns"
+ statuses:
+ started: "Started"
+ scheduled: "Processing ..."
+ terminated: "Completed"
+ canceled: "Canceled"
+ aborted: "Failed"
+ compliance_check_task: "Validate Report"
+ severities:
+ info: "Information"
+ uncheck: "Unchecked"
+ ok: "Ok"
+ warning: "Warning"
+ error: "Error"
+ fatal: "Fatal"
+ activemodel:
+ models:
+ import:
+ zero: "import"
+ one: "import"
+ other: "imports"
+ neptune_import:
+ zero: "import"
+ one: "Neptune import"
+ other: "imports"
+ csv_import:
+ zero: "import"
+ one: "CSV import"
+ other: "imports"
+ gtfs_import:
+ zero: "import"
+ one: "GTFS import"
+ other: "imports"
+ netex_import:
+ zero: "import"
+ one: "NeTEx import"
+ other: "imports"
+ attributes:
+ import:
+ resources: "File to import"
+ created_at: "Created on"
+ status: "Status"
+ references_type: "subset"
+ no_save: "No save"
+ rule_parameter_set_id: "Rule parameter set for compliance check"
+ object_id_prefix: "Neptune Id prefix"
+ max_distance_for_commercial: "Max distance for commercial stop"
+ max_distance_for_connection_link: "Max distance for connection link"
+ ignore_last_word: "ignore last word"
+ ignore_end_chars: "ignore last chars"
+ formtastic:
+ titles:
+ import:
+ max_distance_for_commercial: "Maximal distance to merge homonymous stops in commercial stop in meter"
+ max_distance_for_connection_link: "Maximal distance to link stops by connection link stop in meter"
+ ignore_last_word: "ignore last word on stop name in homonymous detection (inappliable when just one word occurs)"
+ ignore_end_chars: "ignore some chars at the end of stop names in homonymous detection"
+fr:
+ imports:
+ actions:
+ new: "Nouvel import"
+ destroy: "Supprimer cet import"
+ destroy_confirm: "Etes vous sûr de supprimer cet import ?"
+ new:
+ title: "Nouvel import"
+ all: "Tout"
+ flash: "La demande d'import est mise en file d'attente, veuillez rafraichir régulièrement la page pour en suivre la progression"
+ fields_gtfs_import:
+ warning: "Le filtre sur arrêts importe uniquement les fichiers GTFS stops et transfers gtfs, ceux-ci pouvant contenir des attributs supplémentaires"
+ index:
+ title: "Imports"
+ warning: ""
+ show:
+ report: "Rapport"
+ imported_file: "Fichier importé"
+ graph:
+ files:
+ title_zip: "Résultat d'import des fichiers du zip"
+ title_default: "Résultat d'import du fichier %{extension}"
+ error: "Erreurs"
+ ignored: "Ignorés"
+ ok: "Succès"
+ lines:
+ title: "Volume de données lues par type de donnée"
+ objects_label: "Quantité lue"
+ lines_stats: "Lignes"
+ routes_stats: "Séquences d'arrêts"
+ connection_links_stats: "Correspondances"
+ time_tables_stats: "Calendriers"
+ stop_areas_stats: "Zones d'arrèt"
+ access_points_stats: "Accès"
+ vehicle_journeys_stats: "Courses"
+ journey_patterns_stats: "Missions"
+ table:
+ line:
+ name: "Nom"
+ save: "Sauvegarde"
+ routes: "Séquences d'arrêts"
+ connection_links: "Correspondances"
+ time_tables: "Calendriers"
+ stop_areas: "Zones d'arrèt"
+ access_points: "Accès"
+ vehicle_journeys: "Courses"
+ journey_patterns: "Missions"
+ not_saved: "Non Sauvé"
+ saved: "Sauvé"
+ save_error: "Sauvegarde en erreur"
+ statuses:
+ created: "En file d'attente..."
+ scheduled: "En cours..."
+ terminated: "Achevé"
+ canceled: "Annulé"
+ aborted: "Echoué"
+ compliance_check_task: "Validation"
+ severities:
+ info: "Information"
+ uncheck: "Non testé"
+ ok: "Ok"
+ warning: "Alerte"
+ error: "Erreur"
+ fatal: "Fatal"
+ activemodel:
+ models:
+ import:
+ zero: "import"
+ one: "import"
+ other: "imports"
+ neptune_import:
+ zero: "import"
+ one: "import Neptune"
+ other: "imports"
+ csv_import:
+ zero: "import"
+ one: "import CSV"
+ other: "imports"
+ gtfs_import:
+ zero: "import"
+ one: "import GTFS"
+ other: "imports"
+ netex_import:
+ zero: "import"
+ one: "import NeTEx"
+ other: "imports"
+ attributes:
+ import:
+ resources: "Fichier à importer"
+ created_at: "Créé le"
+ status: "Status"
+ no_save: "Pas de sauvegarde"
+ references_type: "Sous ensemble"
+ rule_parameter_set_id: "Jeu de paramètres pour validation"
+ object_id_prefix: "Préfixe d'identifiants"
+ max_distance_for_commercial: "Distance max pour créer les zones"
+ max_distance_for_connection_link: "Distance max pour créer les correspondances"
+ ignore_last_word: "ignorer le dernier mot"
+ ignore_end_chars: "ignorer les n derniers caractères"
+ formtastic:
+ titles:
+ import:
+ max_distance_for_commercial: "Distance maximale entre deux arrêts homonymes pour créer les zones d'arrêt (en mètre)"
+ max_distance_for_connection_link: "Distance maximale entre deux arrêts pour créer les correspondances (en mètre)"
+ ignore_last_word: "Ignorer le dernier mot pour détecter l'homonymie des noms d'arrêt (inapplicable quand le nom ne comporte qu'un mot)"
+ ignore_end_chars: "Ignorer les n derniers caractères du nom de l'arrêt pour détecter l'homonymie"
diff --git a/config/locales/referentials.yml b/config/locales/referentials.yml
index 1dad5a3c2..f1c0c55e1 100644
--- a/config/locales/referentials.yml
+++ b/config/locales/referentials.yml
@@ -62,9 +62,9 @@ en:
commercial_stops: "commercial stops"
stop_places: "stop places"
itls: "routing contraints"
- import_tasks: "Imports"
- export_tasks: "Exports"
- compliance_check_tasks: "Validations"
+ imports: "Imports"
+ exports: "Exports"
+ compliance_checks: "Validations"
rule_parameter_sets: "Rule parameters sets"
data_format_restrictions: "Data format constraint"
data_format: "Data format"
@@ -140,9 +140,9 @@ fr:
commercial_stops: "arrêts commerciaux"
stop_places: "pôles d'échange"
itls: "ITL"
- import_tasks: "Imports"
- export_tasks: "Exports"
- compliance_check_tasks: "Validations"
+ imports: "Imports"
+ exports: "Exports"
+ compliance_checks: "Validations"
rule_parameter_sets: "Jeux de paramètres"
data_format_restrictions: "Appliquer les contraintes format des données"
data_format: "Format de données"
diff --git a/config/routes.rb b/config/routes.rb
index ded013eb4..5a77f69b9 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -95,8 +95,9 @@ ChouetteIhm::Application.routes.draw do
get "exported_file"
end
end
-
- resources :compliance_check_tasks do
+
+ resources :compliance_check_tasks, :only => [:new, :create]
+ resources :compliance_checks, :only => [:index, :show, :destroy] do
member do
get 'export', defaults: { format: 'zip' }
end