Work item import - email type errors
What does this MR do and why?
Dependent on !112271 (merged) and this branch is based on that one.
In !112271 (merged) we introduced specifying a work item type of Issue or Requirement when importing work items. The emails were created in !112003 (merged) and this MR updates the emails to also display preprocessing errors.
Screenshots or screen recordings
Old screencaps can be found in !112003 (merged)
(yes, some of the console numbers don't match but you get the idea
How to set up and validate locally
the more integration test kind of way
In console:
project = Project.find(1)
user = User.find(1) # user with sufficient access to project
Feature.enable(:import_work_items_csv)
csv_io = FileUploader.new(project)
csv_io.store!(File.open("/path/to/work_items.csv"))
service = ::WorkItems::ImportCsvService.new(user, project, csv_io)
service.execute
the console cheat way
You can also just check the mail bit by feeding it a project and some fake results in console:
project = Project.find(1)
user = User.find(1) # any user, at this level it does not care about auth, only which email to send to
Notify.import_work_items_csv_email(user.id, project.id, {success: 0, parse_error: false, type_errors: { blank: [], missing: [4,5], disallowed: [6]}}).deliver!
Check the letter_opener
for incoming mail.
You can see the text versions by clicking the plaintext link in the top right hand corner of each mail.
the most superficial but also maybe most fun way
You can also view sample mailer with fake info in http://localhost:3000/rails/mailers/notify/import_work_items_csv_email. If you play with the values on your local in app/mailers/previews/notify_preview.rb
you can preview different what different values will look like.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #379153 (closed)