diff options
| author | Luc Donnet | 2017-09-05 11:09:37 +0200 |
|---|---|---|
| committer | Luc Donnet | 2017-09-05 11:09:37 +0200 |
| commit | 70e8e93b0ebf4596c0ffd64620415db2450f4595 (patch) | |
| tree | 3d211dfb6cf7b75e8879e5a0b9d8a5c082961383 /app/views | |
| parent | 7497709ff181bb426eef11e2a7eff44b9b178e9c (diff) | |
| download | chouette-core-70e8e93b0ebf4596c0ffd64620415db2450f4595.tar.bz2 | |
Clean up compliance checks existing code Refs #4389 @1
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/compliance_check_tasks/new.html.erb | 39 | ||||
| -rw-r--r-- | app/views/compliance_check_tasks/new.js.coffee | 7 | ||||
| -rw-r--r-- | app/views/compliance_checks/_compliance_check.html.slim | 17 | ||||
| -rw-r--r-- | app/views/compliance_checks/_compliance_check_results.html.slim | 92 | ||||
| -rw-r--r-- | app/views/compliance_checks/_compliance_checks.html.slim | 9 | ||||
| -rw-r--r-- | app/views/compliance_checks/detailed_errors_index.csv.slim | 37 | ||||
| -rw-r--r-- | app/views/compliance_checks/index.html.slim | 14 | ||||
| -rw-r--r-- | app/views/compliance_checks/index.js.slim | 1 | ||||
| -rw-r--r-- | app/views/compliance_checks/report.html.slim | 41 | ||||
| -rw-r--r-- | app/views/compliance_checks/show.html.slim | 22 | ||||
| -rw-r--r-- | app/views/compliance_checks/summary_errors_index.csv.slim | 34 |
11 files changed, 0 insertions, 313 deletions
diff --git a/app/views/compliance_check_tasks/new.html.erb b/app/views/compliance_check_tasks/new.html.erb deleted file mode 100644 index 3f43a7dd7..000000000 --- a/app/views/compliance_check_tasks/new.html.erb +++ /dev/null @@ -1,39 +0,0 @@ -<%= title_tag t(".title") %> - -<%= semantic_form_for [@referential, @compliance_check_task], :url => referential_compliance_check_tasks_path(@referential) do |form| %> - <%= form.inputs do %> - <%= form.input :user_name, :as => :hidden, :input_html => { :value => current_user.name } %> <%= form.input :user_id, :as => :hidden, :input_html => { :value => current_user.id } %> - <%= form.input :referential_id, :as => :hidden, :input_html => { :value => @referential.id } %> - <%= form.input :name %> - <%= form.input :rule_parameter_set_id, :as => :select, - :collection => @referential.organisation.rule_parameter_sets.map { |rps| [ rps.name, rps.id ] }, :include_blank => false %> - <%= form.input :references_type, :as => :select, :include_blank => t(".all") %> - <% @compliance_check_task.class.references_types.each do |type| %> - <%= form.input :reference_ids, :as => :reference_ids, :json => references_referential_compliance_check_tasks_path(@referential, :format => :json) + "?filter=#{type}", :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :id => "#{type}_reference_ids", :input_html => { :id => "#{type}_reference_ids" }, :wrapper_html => { :style => "display:none;", :id => "#{type}", :"data-type" => "#{type}" } %> - <% end %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button , :label => t( 'formtastic.validate' ) %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> - -<!-- = title_tag t('.title') - -= semantic_form_for [@referential, @compliance_check_task], :url => referential_compliance_check_tasks_path(@referential) do |form| - = form.inputs do - = form.input :user_name, :as => :hidden, :input_html => { :value => current_user.name } - = form.input :user_id, :as => :hidden, :input_html => { :value => current_user.id } - = form.input :referential_id, :as => :hidden, :input_html => { :value => @referential.id } - = form.input :name - = form.input :rule_parameter_set_id, :as => :select, - :collection => @referential.organisation.rule_parameter_sets.map { |rps| [ rps.name, rps.id ] }, :include_blank => false - = form.input :references_type, :as => :select, :include_blank => t(".all") - - @compliance_check_task.class.references_types.each do |type| - - = form.input :reference_ids, as: :reference_ids, json: references_referential_compliance_check_tasks_path(@referential, format: :json) + "?filter=#{type}", hint_text: t('search_hint'), no_result_text: t('no_result_text'), searching_text: t('searching_term'), id: "#{type}_reference_ids", input_html: { :id => "#{type}_reference_ids" }, wrapper_html: { :style => "display:none;", :id => "#{type}", :"data-type" => "#{type}" } - - = form.actions do - = form.action :submit, as: :button, label: t('formtastic.validate') - = form.action :cancel, as: :link --> diff --git a/app/views/compliance_check_tasks/new.js.coffee b/app/views/compliance_check_tasks/new.js.coffee deleted file mode 100644 index ba62f53b2..000000000 --- a/app/views/compliance_check_tasks/new.js.coffee +++ /dev/null @@ -1,7 +0,0 @@ -jQuery -> - <% ComplianceCheckTask.references_types.map { |type| type_ids_model_references_type( ComplianceCheckTask, type)}.each do |rt| %> - $("textarea.<%= rt.input_class %>").tokenInput('<%= references_referential_compliance_check_tasks_path(@referential, :type => rt.relation_name, :format => :json) %>', { prePopulate: $('#').data('pre'), minChars: 1, hintText: '<%= t('search_hint') %>', noResultsText: '<%= t('no_result_text') %>', searchingText: '<%= t('searching_term') %>'}); - <% end %> - - # - ComplianceCheckTask.references_types.map { |type| type_ids_model_references_type( ComplianceCheckTask, type)}.each do |rt| - # $("textarea.#{rt.input_class}").tokenInput("#{references_referential_compliance_check_tasks_path(@referential, :type => rt.relation_name, format: :json)}", { prePopulate: $('#').data('pre'), minChars: 1, hintText: "#{t('search_hint')}", noResultsText: "#{t('no_result_text')}", searchingText: "#{t('searching_term')}"}); diff --git a/app/views/compliance_checks/_compliance_check.html.slim b/app/views/compliance_checks/_compliance_check.html.slim deleted file mode 100644 index 383a7ea82..000000000 --- a/app/views/compliance_checks/_compliance_check.html.slim +++ /dev/null @@ -1,17 +0,0 @@ -#index_item.panel.panel-default - .panel-heading - .panel-title.clearfix - span.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.fa.fa-trash-o - h5 - = link_to referential_compliance_check_path(@referential, compliance_check.id), class: 'preview', title: "#{ComplianceCheck.model_name.human.capitalize} #{compliance_check.name}" do - = job_status_title(compliance_check) - - .panel-body - p - = link_to( font_awesome_classic_tag("fa-external-link") + t("compliance_checks.actions.report"), report_referential_compliance_check_path(@referential, compliance_check.id)) if compliance_check.report? - .panel-footer - .history - = l compliance_check.created_at, :format => "%d/%m/%Y %H:%M" - = " | #{compliance_check.user_name}" diff --git a/app/views/compliance_checks/_compliance_check_results.html.slim b/app/views/compliance_checks/_compliance_check_results.html.slim deleted file mode 100644 index 8e86c174e..000000000 --- a/app/views/compliance_checks/_compliance_check_results.html.slim +++ /dev/null @@ -1,92 +0,0 @@ -p - form.form-inline - .form-group - label = t('shared.ie_report.search') - input#filter.form-control type="text" - - .form-group - label = ComplianceCheckResult.human_attribute_name(:severity) - select.filter-severity.form-control - option - option value="severity-error" - = t('compliance_check_result.severities.error') - option value="severity-warning" - = t('compliance_check_result.severities.warning') - - .form-group - label = ComplianceCheckResult.human_attribute_name(:status) - select.filter-status.form-control - option - option value="status-ok" - = t('compliance_check_result.statuses.ok') - option value="status-nok" - = t('compliance_check_result.statuses.nok') - option value="status-uncheck" - = t('compliance_check_result.statuses.uncheck') - - -table.table.table-hover.toggle-circle.toggle-medium data-filter="#filter" data-page-size="20" data-title-nok="#{t('compliance_check_result.statuses.nok')}" data-title-uncheck="#{t('compliance_check_result.statuses.uncheck')}" data-title-ok="#{t('compliance_check_result.statuses.ok')}" - thead - tr - th data-sort-ignore="true" - = ComplianceCheckResult.human_attribute_name(:status) - th.col-md-1 data-sort-ignore="true" - = ComplianceCheckResult.human_attribute_name(:severity) - th.col-md-3 - = ComplianceCheckResult.human_attribute_name(:rule_code) - th.col-md-2 - = t('compliance_check_results.errors') - th.col-md-6 data-toggle="true" data-sort-ignore="true" - = ComplianceCheckResult.human_attribute_name(:detail) - th data-hide="all" data-sort-ignore="true" - - tbody - - if compliance_check_validation_report - - compliance_check_validation_report.tests.each_with_index do |test, index| - tr class="#{test.result}_#{test.severity}" - td data-value="status-#{test.result}" - = status_icon( test.result, test.severity ) - td data-value="severity-#{test.severity}" - = t("compliance_check_result.severities.#{test.severity}_txt") - td data-value="#{test.result}_#{test.severity}" - = link_to test.test_id, test_definition(test.test_id), title: ComplianceCheckResult.human_attribute_name(test.test_id), target: "compliance_check" - td - = "#{test.error_count || 0} #{ComplianceCheckResult.human_attribute_name(:violation_count)}" if test.errors.present? - td - = truncate(t("activemodel.attributes.compliance_check_result.#{test.test_id}"), length: 50) - td - p - b - = t("activemodel.attributes.compliance_check_result.#{test.test_id}") - - - if test.errors.present? - - test.errors.first(10).each do |error| - dl.inline - dt - - if error["source"].present? - - if error[:source].object_path.present? - - if error[:source].label.present? - = link_to error[:source].label, object_url(@referential.id, error), target: :_blank - - else - = link_to "#{error[:source].object_path.type} (#{error[:source].object_path.id})", object_url(@referential.id, error), target: :_blank - - - if error[:source].file.present? - = error[:source].objectid if error[:source].objectid.present? - - dd = t("compliance_check_result.details.detail_#{error[:error_id]}", object_labels_hash(error)) - - - if error[:source].file.present? - p.file_error - = error[:source].file.filename - = ", li: #{error[:source].file.line_number}" if error[:source].file.line_number.present? - = ", co: #{error[:source].file.column_number}" if error[:source].file.column_number.present? - - - else - tr - td colspan="6" - = t('compliance_check_results.in_progress') - - tfoot.hide-if-no-paging - tr - td colspan="5" - ul.pagination.pagination-centered diff --git a/app/views/compliance_checks/_compliance_checks.html.slim b/app/views/compliance_checks/_compliance_checks.html.slim deleted file mode 100644 index 48db9ae94..000000000 --- a/app/views/compliance_checks/_compliance_checks.html.slim +++ /dev/null @@ -1,9 +0,0 @@ -.page_info - span.search = t('will_paginate.page_entries_info.search') - = page_entries_info @compliance_checks - -.compliance_checks.paginated_content - = paginated_content @compliance_checks, "compliance_checks/compliance_check" - -.pagination - = will_paginate @compliance_checks, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer
\ No newline at end of file diff --git a/app/views/compliance_checks/detailed_errors_index.csv.slim b/app/views/compliance_checks/detailed_errors_index.csv.slim deleted file mode 100644 index 7fe20e282..000000000 --- a/app/views/compliance_checks/detailed_errors_index.csv.slim +++ /dev/null @@ -1,37 +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.compliance_check_validation_report.tests.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') - - = 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"] - - - else - = 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" - -/ <%= 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_validation_report.tests.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 %> diff --git a/app/views/compliance_checks/index.html.slim b/app/views/compliance_checks/index.html.slim deleted file mode 100644 index 392c46663..000000000 --- a/app/views/compliance_checks/index.html.slim +++ /dev/null @@ -1,14 +0,0 @@ -= title_tag t('.title') - -.warning - = t('.warning') - -#compliance_checks - = render 'compliance_checks' - -- content_for :sidebar do - ul.actions - li - = link_to t('compliance_check_tasks.actions.new'), new_referential_compliance_check_task_path(), class: 'add' - li - = link_to t('rule_parameter_sets.actions.index'), organisation_rule_parameter_sets_path, class: 'link'
\ No newline at end of file diff --git a/app/views/compliance_checks/index.js.slim b/app/views/compliance_checks/index.js.slim deleted file mode 100644 index cfd8dc40d..000000000 --- a/app/views/compliance_checks/index.js.slim +++ /dev/null @@ -1 +0,0 @@ -| $('#compliance_checks').html("#{escape_javascript(render('compliance_checks'))}");
\ No newline at end of file diff --git a/app/views/compliance_checks/report.html.slim b/app/views/compliance_checks/report.html.slim deleted file mode 100644 index be2bb8adc..000000000 --- a/app/views/compliance_checks/report.html.slim +++ /dev/null @@ -1,41 +0,0 @@ -= title_tag job_status_title(@compliance_check) - -.compliance_check_show - .links - - if @compliance_check.class == Import - = link_to(font_awesome_classic_tag('fa-eye') + t("compliance_checks.report.action_report"), referential_import_path(@referential, @compliance_check.id)) - = link_to font_awesome_classic_tag("fa-external-link") + t("compliance_checks.rule_parameter_set"), rule_parameter_set_referential_import_path(@referential, @compliance_check.id) if @compliance_check.rule_parameter_set? - - else - = link_to(font_awesome_classic_tag('fa-eye') + t("compliance_checks.report.action_report"), referential_compliance_check_path(@referential, @compliance_check.id)) - = link_to font_awesome_classic_tag("fa-external-link") + t("compliance_checks.rule_parameter_set"), rule_parameter_set_referential_compliance_check_path(@referential, @compliance_check.id) if @compliance_check.rule_parameter_set? - - .btn-group.pull-right - button.btn.btn-default.dropdown-toggle type="button" data-toggle="dropdown" aria-expanded="false" - = t('compliance_checks.show.export') - span.caret - - ul.dropdown-menu role="menu" - li - - if @compliance_check.class == Import - = link_to t('compliance_checks.show.export_csv'), export_referential_import_path(@referential, @compliance_check.id) - - else - = link_to t("compliance_checks.show.export_csv"), export_referential_compliance_check_path(@referential, @compliance_check.id) - - .report data-refresh-interval="#{job_refresh_interval(@compliance_check)}" - = render partial: 'compliance_checks/compliance_check_results', locals: { compliance_check_validation_report: @compliance_check.compliance_check_validation_report } - -- content_for :sidebar do - - if @compliance_check.compliance_check_validation_report && @compliance_check.compliance_check_validation_report.nok_error.blank? - .row - = font_awesome_classic_tag('fa-thumbs-up fa-5x col-md-3') - p#validation_success.col-md-7 - = t('.validation_success') - - ul.actions - li - - if @compliance_check.class != Import - = 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' - - = history_tag(@compliance_check) - #error.graph - #warning.graph
\ No newline at end of file diff --git a/app/views/compliance_checks/show.html.slim b/app/views/compliance_checks/show.html.slim deleted file mode 100644 index 8c6900981..000000000 --- a/app/views/compliance_checks/show.html.slim +++ /dev/null @@ -1,22 +0,0 @@ -.test - = title_tag job_status_title(@compliance_check) - -- if @compliance_check.report.failure_code? - .alert.alert-danger - = t("iev.failure.#{@compliance_check.report.failure_code}") - -.progress_bars - = progress_bar_tag(@compliance_check) - -.compliance_check.show - .links - = link_to font_awesome_classic_tag("fa-external-link") + t("compliance_checks.actions.report"), report_referential_compliance_check_path(@referential, @compliance_check.id) if @compliance_check.compliance_check_validation_report? - - = render partial: "shared/ie_report", locals: { job: @compliance_check, type: :validation, line_items: @line_items } - -- content_for :sidebar do - ul.actions - 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' - - = history_tag(@compliance_check)
\ No newline at end of file diff --git a/app/views/compliance_checks/summary_errors_index.csv.slim b/app/views/compliance_checks/summary_errors_index.csv.slim deleted file mode 100644 index 8c88d5cf6..000000000 --- a/app/views/compliance_checks/summary_errors_index.csv.slim +++ /dev/null @@ -1,34 +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.compliance_check_validation_report.tests.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") - - = 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 - = " " - -/ <%= 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_validation_report.tests.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 %> |
