diff options
| -rw-r--r-- | app/services/zip_service.rb | 2 | ||||
| -rw-r--r-- | app/views/imports/_import_messages.html.slim | 9 | ||||
| -rw-r--r-- | app/views/imports/show.html.slim | 3 | ||||
| -rw-r--r-- | lib/stif/netex_file.rb | 2 | ||||
| -rw-r--r-- | spec/lib/stif/netex_file/frame_spec.rb | 4 | 
5 files changed, 16 insertions, 4 deletions
| diff --git a/app/services/zip_service.rb b/app/services/zip_service.rb index 50475f7d3..7166e6448 100644 --- a/app/services/zip_service.rb +++ b/app/services/zip_service.rb @@ -84,7 +84,7 @@ class ZipService    end    def is_foreign_line! entry_name -    STIF::NetexFile::Frame.get_line_object_id(entry_name).tap do | line_object_id | +    STIF::NetexFile::Frame.get_short_id(entry_name).tap do | line_object_id |        return nil unless line_object_id        return nil if line_object_id.in? allowed_lines        foreign_lines << line_object_id diff --git a/app/views/imports/_import_messages.html.slim b/app/views/imports/_import_messages.html.slim new file mode 100644 index 000000000..49440a6d3 --- /dev/null +++ b/app/views/imports/_import_messages.html.slim @@ -0,0 +1,9 @@ + +- if import_messages.any? +  dl +  - import_messages.each do | import_message | +    .error_message +      dt +        = import_message.criticity +      dd +        = t ['imports', import_message.message_key].join('.'), import_message.message_attributes diff --git a/app/views/imports/show.html.slim b/app/views/imports/show.html.slim index 5e22e03e0..90c638d78 100644 --- a/app/views/imports/show.html.slim +++ b/app/views/imports/show.html.slim @@ -11,6 +11,9 @@  - page_header_content_for @import +.error_messages +  = render 'import_messages', import_messages: @import.messages +  .page_content    .container-fluid      .row diff --git a/lib/stif/netex_file.rb b/lib/stif/netex_file.rb index db64ed05e..db0801bbe 100644 --- a/lib/stif/netex_file.rb +++ b/lib/stif/netex_file.rb @@ -43,7 +43,7 @@ module STIF      class Frame        class << self -        def get_line_object_id file_name +        def get_short_id file_name            base_name = File.basename(file_name)            STIF::NetexFile::LINE_FILE_FORMAT.match(base_name).try(:[], 'line_object_id')          end diff --git a/spec/lib/stif/netex_file/frame_spec.rb b/spec/lib/stif/netex_file/frame_spec.rb index eb80e7b14..506da2148 100644 --- a/spec/lib/stif/netex_file/frame_spec.rb +++ b/spec/lib/stif/netex_file/frame_spec.rb @@ -3,11 +3,11 @@ RSpec.describe STIF::NetexFile::Frame do    context "line object id extraction" do      it "gets the line object id if frame describes a line" do -      expect( described_class.get_line_object_id('offre_C00109_10.xml') ).to eq('C00109') +      expect( described_class.get_short_id('offre_C00109_10.xml') ).to eq('C00109')      end      it "gets nil if the frame does not describe a line" do -      expect( described_class.get_line_object_id('commun.xml') ).to be_nil +      expect( described_class.get_short_id('commun.xml') ).to be_nil      end    end  end | 
