File: import_work_items_csv_email.text.erb

package info (click to toggle)
gitlab 17.6.5-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 629,368 kB
  • sloc: ruby: 1,915,304; javascript: 557,307; sql: 60,639; xml: 6,509; sh: 4,567; makefile: 1,239; python: 406
file content (48 lines) | stat: -rw-r--r-- 2,405 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<%= s_('Notify|Here are the results for your CSV import for %{project_name} (%{project_link}).') % { project_name: @project.full_name, project_link: project_url(@project) } %>

<% success_lines = @results[:success] %>
<% if success_lines > 0 %>
  <% work_items = n_('%d work item', '%d work items', success_lines) % success_lines %>
  <%= s_('Notify|%{work_items} successfully imported.') % { work_items: work_items } %>
<% else %>
  <%= s_('Notify|No work items have been imported.') %>

  <% if @results[:parse_error] %>
    <%= s_('Notify|Error parsing CSV file. Please make sure it has the correct format: a delimited text file that uses a comma to separate values.') %>
  <% end %>
<% end %>

<% type_errors = @results[:type_errors] %>
<%
  if type_errors
    blank_lines = type_errors[:blank]
    missing_lines = type_errors[:missing]
    disallowed_lines = type_errors[:disallowed]
%>
  <%= s_('Notify|Some values in the "type" column could not be matched with supported work item types:') %>

  <% if blank_lines.present? %>
    <%= s_('Notify|%{singular_or_plural_line} %{error_lines}: Work item type is empty.') % { singular_or_plural_line: n_('Line', 'Lines', blank_lines.size), error_lines: blank_lines.join(', ') } %>
  <% end %>

  <% if missing_lines.present? %>
    <%= s_('Notify|%{singular_or_plural_line} %{error_lines}: Work item type cannot be found or is not supported.') % { singular_or_plural_line: n_('Line', 'Lines', missing_lines.size), error_lines: missing_lines.join(', ') } %>
  <% end %>

  <% if disallowed_lines.present? %>
    <%= s_('Notify|%{singular_or_plural_line} %{error_lines}: Work item type is not available. Please check your license and permissions.') % { singular_or_plural_line: n_('Line', 'Lines', disallowed_lines.size), error_lines: disallowed_lines.join(', ') } %>
  <% end %>
<% end %>

<%
  error_lines = @results[:error_lines]
  if error_lines.present?
%>
  <%= s_('Notify|Errors found on %{singular_or_plural_line}: %{error_lines}. Please check that these lines have the following fields: %{required_headers}.') % { singular_or_plural_line: n_('line', 'lines', error_lines.size), required_headers: WorkItems::ImportCsvService.required_headers.join(', '),
  error_lines: error_lines.join(', ') } %>
<% end %>

<% if error_lines.present? || type_errors %>
  <%= s_('Notify|Please fix the lines with errors and try the CSV import again.') %>
<% end %>