ntq_excelsior_engine 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/interactors/ntq_excelsior_engine/imports/import_lines.rb +1 -1
- data/app/interactors/ntq_excelsior_engine/imports/load_lines.rb +1 -1
- data/app/views/ntq_excelsior_engine/imports/status.json.jbuilder +7 -2
- data/lib/generators/templates/ntq_excelsior_engine.rb +4 -0
- data/lib/ntq_excelsior_engine/version.rb +1 -1
- data/lib/ntq_excelsior_engine.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f97f39f7cfb787602db62bacb6b33eeb9ed76d50b17e3d7dd18aad473bba882
|
4
|
+
data.tar.gz: 2730551c18b0f8a283e3b2e06173219b210a31d9e23edc373566d4f99adb4cc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90ec8cffc24567e0f9ff6feb56666a8ce7422a2c1fe9174fc0c832398d0a17831caed7011d2c8393237d435f90059491b16b4290da7c86b45ed6aa2bbfac3b36
|
7
|
+
data.tar.gz: fa9d699c739f3c7cdb6c4cb66fa05c562693199276bceb5832835ce8f2320211866ef05b5c270d4067e807313038df6bce0a097aca7afcfe41aa6517d595fc6f
|
@@ -3,7 +3,7 @@ module NtqExcelsiorEngine
|
|
3
3
|
include Interactor
|
4
4
|
|
5
5
|
around do |interactor|
|
6
|
-
if context.actions && context.actions.include?("import") && context.import && !context.import.error? && context.importer && context.import.import_lines.any?
|
6
|
+
if context.actions && context.actions.include?("import") && context.import && (!NtqExcelsiorEngine.skip_import_on_errors || !context.import.error?) && context.importer && context.import.import_lines.any?
|
7
7
|
interactor.call
|
8
8
|
end
|
9
9
|
end
|
@@ -27,7 +27,7 @@ module NtqExcelsiorEngine
|
|
27
27
|
import.temp_file.unlink
|
28
28
|
rescue Roo::HeaderRowNotFoundError => e
|
29
29
|
message = e.message.gsub("\/i", "").gsub("/", "").slice(1..-1).chop
|
30
|
-
import.update(state: 'error', error_message: 'header_not_found', backtrace: message.split(', ').join('
|
30
|
+
import.update(state: 'error', error_message: 'header_not_found', backtrace: message.split(', ').join(','))
|
31
31
|
rescue => e
|
32
32
|
Appsignal.send_error(e)
|
33
33
|
import.update(state: 'error', backtrace: e.backtrace.join('\n'))
|
@@ -1,10 +1,15 @@
|
|
1
|
+
|
1
2
|
json.set! :data do
|
2
3
|
json.id @import_file.id
|
3
4
|
json.state @import_file.state
|
4
5
|
if @import_file.error?
|
5
|
-
json.error_file download_errors_file_url(@import_file.id)
|
6
6
|
json.error_message @import_file.error_message
|
7
|
-
|
7
|
+
if @import_file.error_message == "header_not_found"
|
8
|
+
json.missing_headers @import_file.backtrace.split(",")
|
9
|
+
else
|
10
|
+
json.error_file download_errors_file_url(@import_file.id)
|
11
|
+
json.backtrace @import_file.backtrace
|
12
|
+
end
|
8
13
|
end
|
9
14
|
if %[checked importing].include? @import_file.state
|
10
15
|
json.errors_count @import_file.import_lines.in_error.count
|
@@ -14,4 +14,8 @@ NtqExcelsiorEngine.setup do |config|
|
|
14
14
|
# config.actions_on_create = [:load, :check, :import]
|
15
15
|
# config.action_cable = false
|
16
16
|
|
17
|
+
# Dont import lines if file have errors
|
18
|
+
# Set this to false for import even if errors are present
|
19
|
+
# skip_import_on_errors = true
|
20
|
+
|
17
21
|
end
|
data/lib/ntq_excelsior_engine.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ntq_excelsior_engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|