Merge pull request #7504 from opf/bim/change-defaults-for-import-dialogue

Change BCF-XML import to import by default.
pull/7526/head
Henriette Dinger 5 years ago committed by GitHub
commit 80af117bd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      modules/bcf/app/views/bcf/issues/_import_errors.html.erb
  2. 21
      modules/bcf/app/views/bcf/issues/_import_solution.html.erb
  3. 6
      modules/bcf/app/views/bcf/issues/_render_issues.html.erb
  4. 33
      modules/bcf/app/views/bcf/issues/configure_invalid_people.html.erb
  5. 63
      modules/bcf/app/views/bcf/issues/configure_non_members.html.erb
  6. 90
      modules/bcf/app/views/bcf/issues/configure_unknown_mails.html.erb
  7. 42
      modules/bcf/app/views/bcf/issues/configure_unknown_priorities.html.erb
  8. 42
      modules/bcf/app/views/bcf/issues/configure_unknown_statuses.html.erb
  9. 42
      modules/bcf/app/views/bcf/issues/configure_unknown_types.html.erb
  10. 26
      modules/bcf/config/locales/en.yml

@ -0,0 +1,23 @@
<%= render 'import_options_hidden_fields' %>
<p>
<span>
<%= op_icon 'icon-context icon-warning' %>
<strong><%= error_message %></strong>
</span>
</p>
<ul>
<% error_objects.each do |obj| %>
<li>
<% if obj.present? %>
<% if obj.instance_of?(User) %>
<%= obj.mail %> (<%= obj.name %>)
<% else %>
<%= obj %>
<% end %>
<% else %>
<%= "(#{error_default_text})"%>
<% end %>
</li>
<% end %>
</ul>

@ -0,0 +1,21 @@
<hr class="form--separator">
<div class="form--field">
<%= hidden_field_tag "import_options[#{hidden_field_identifier}]", 'chose' %>
<%= styled_label_tag "import_options[#{solution_select_id}][]", solution_text %>
<div class="form--field-container">
<%= styled_select_tag "import_options[#{solution_select_id}][]",
options_for_select(solution_options),
no_label: true,
tabIndex: 0,
container_class: '-slim',
id: solution_select_id %>
</div>
</div>
<%= styled_submit_tag t('bcf.bcf_xml.import.button_proceed'), class: '-highlight' %>
<%= link_to t(:button_cancel),
project_work_packages_bcf_issues_path(@project),
class: 'button' %>

@ -2,8 +2,8 @@
<div class="bcf--issues">
<% issues.each do |issue| %>
<% status_id = issue.work_package&.status_id %>
<% hl_classname = status_id.present? ? "__hl_background_status_#{status_id}" : '' %>
<div class="<%= hl_classname %>">
<% highlighting_class = status_id.present? ? "__hl_background_status_#{status_id}" : '' %>
<div class="<%= highlighting_class %>">
<p>
<strong><%= issue.title %></strong>
<br/>
@ -24,7 +24,7 @@
</div>
<% else %>
<% if issue.viewpoints.empty? %>
<p>(No viewpoints)</p>
<p>(<%= t('bcf.no_viewpoints') %>)</p>
<% end %>
<% issue.viewpoints.each do |vp| %>
<img src="<%= API::V3::Utilities::PathHelper::ApiV3Path.attachment_content(vp.snapshot.id) %>" />

@ -1,31 +1,18 @@
<%= stylesheet_link_tag 'bcf/bcf.css' %>
<%= toolbar title: t('bcf.bcf_xml.import_title') %>
<%= form_tag({ action: :configure_import }, multipart: true, method: :post) do %>
<%= render 'import_options_hidden_fields' %>
<h3>Invalid email addresses found</h3>
<ul>
<% @importer.aggregations.invalid_people.each do |name| %>
<li> <%= name %></li>
<% end %>
</ul>
<div class="form--field -full-width">
<div class="form--field-container">
<label class="option-label">
<input type="radio" name="import_options[invalid_people_action]" value="cancel" checked>
Recommended: Correct the data first and try another import.
</label>
</div>
</div>
<div class="form--field -full-width">
<div class="form--field-container">
<label class="option-label">
<input type="radio" name="import_options[invalid_people_action]" value="anonymize">No, import them as <i>System</i> user (not recommended)
</label>
</div>
<%= styled_form_tag({ action: :configure_import }, multipart: true, method: :post) do %>
<%= render partial: 'import_errors', locals: { error_message: t('bcf.bcf_xml.import.invalid_emails_found'),
error_objects: @importer.aggregations.invalid_people,
error_default_text: t('bcf.bcf_xml.import.unknown_property')} %>
<hr class="form--separator">
<div class="form--field">
<input type="hidden" name="import_options[invalid_people_action]" value="anonymize">
<%= t('bcf.bcf_xml.import.import_as_system_user') %>
</div>
<%= submit_tag t('bcf.bcf_xml.import.button_proceed'), class: 'button -highlight' %>
<%= styled_submit_tag t('bcf.bcf_xml.import.button_proceed'), class: '-highlight' %>
<%= link_to t(:button_cancel),
project_work_packages_bcf_issues_path(@project),
class: 'button' %>

@ -1,53 +1,36 @@
<%= stylesheet_link_tag 'bcf/bcf.css' %>
<%= toolbar title: t('bcf.bcf_xml.import_title') %>
<%= form_tag({ action: :configure_import }, multipart: true, method: :post) do %>
<%= render 'import_options_hidden_fields' %>
<h3>Non project members found</h3>
<ul>
<% @importer.aggregations.non_members.each do |user| %>
<li><%= user.mail %> (<%= user.name %>)</li>
<% end %>
</ul>
<%= styled_form_tag({ action: :configure_import }, multipart: true, method: :post) do %>
<%= render partial: 'import_errors', locals: { error_message: t('bcf.bcf_xml.import.non_members_found'),
error_objects: @importer.aggregations.non_members,
error_default_text: t('bcf.bcf_xml.import.unknown_property')} %>
<% if @roles.any? %>
<p>What do you want to do?</p>
<% if User.current.allowed_to?(:manage_members, @project) %>
<div class="form--field -full-width">
<div class="form--field-container">
<label class="option-label">
<input type="radio" name="import_options[non_members_action]" value="add" checked>
Add them as members to the project "<%= @project.name %>" with role
<% options = @roles.collect { |obj| [obj.name, obj.id] } %>
<%= select_tag 'import_options[non_members_add_role_ids][]', options_for_select(options),
multiple: false,
no_label: true,
title: l(:label_role_search),
tabIndex: 0,
class: 'form--select form--inline-select',
id: 'non_members_add_role_ids' %>
(recommended)
</label>
<%= render partial: 'import_solution', locals: { solution_select_id: 'non_members_add_role_ids',
hidden_field_identifier: 'non_members_action',
solution_text: t('bcf.bcf_xml.import.add_as_members_with_role', project: @project.name),
solution_options: @roles.collect { |obj| [obj.name, obj.id] }} %>
<% else %>
<div class="notification-box -warning">
<div class="notification-box--content">
<input type="hidden" name="import_options[non_members_action]" value="cancel">
<%= t('bcf.bcf_xml.import.contact_project_admin') %>
</div>
</div>
<br/>
<%= link_to t(:button_cancel),
project_work_packages_bcf_issues_path(@project),
class: 'button' %>
<% end %>
<div class="form--field -full-width">
<div class="form--field-container">
<label class="option-label">
<input type="radio" name="import_options[non_members_action]" value="cancel" <%= User.current.allowed_to?(:manage_members, @project) ? '' : 'checked' %>>
I will correct the data first and try another import.
</label>
<% else %>
<div class="notification-box -error">
<div class="notification-box--content">
<%= I18n.t('text_no_roles_defined') %>
</div>
</div>
<%= submit_tag t('bcf.bcf_xml.import.button_proceed'), class: 'button -highlight' %>
<%= link_to t(:button_cancel),
project_work_packages_bcf_issues_path(@project),
class: 'button' %>
<% else %>
<p>
<%= I18n.t('text_no_roles_defined') %>
</p>
<br/>
<%= link_to t(:button_cancel),
project_work_packages_bcf_issues_path(@project),
class: 'button' %>

@ -1,63 +1,63 @@
<%= stylesheet_link_tag 'bcf/bcf.css' %>
<%= toolbar title: t('bcf.bcf_xml.import_title') %>
<%= form_tag({ action: :configure_import }, multipart: true, method: :post) do %>
<%= render 'import_options_hidden_fields' %>
<h3>Unknown email addresses found</h3>
<ul>
<% @importer.aggregations.unknown_mails.each do |mail| %>
<li> <%= mail %></li>
<% end %>
</ul>
<%= styled_form_tag({ action: :configure_import }, multipart: true, method: :post) do %>
<%= render partial: 'import_errors', locals: { error_message: t('bcf.bcf_xml.import.unknown_emails_found'),
error_objects: @importer.aggregations.unknown_mails,
error_default_text: t('bcf.bcf_xml.import.unknown_property')} %>
<% if @roles.any? %>
<p>What do you want to do?</p>
<% if User.current.admin? %>
<% if User.current.admin? %>
<hr class="form--separator">
<p><%= t('bcf.bcf_xml.import.what_to_do') %></p>
<div class="form--field -full-width">
<div class="form--field-container">
<label class="option-label">
<input type="radio" name="import_options[unknown_mails_action]" value="invite" checked>
Invite them as members to the project "<%= @project.name %>" with role
<%= t('bcf.bcf_xml.import.invite_as_members_with_role', project: @project.name) %>&nbsp;
<% options = @roles.collect { |obj| [obj.name, obj.id] } %>
<%= select_tag 'import_options[unknown_mails_invite_role_ids][]', options_for_select(options),
multiple: false,
no_label: true,
title: l(:label_role_search),
tabIndex: 0,
class: 'form--select form--inline-select',
id: 'unknown_mails_invite_role_ids' %>
(recommended)
<%= styled_select_tag 'import_options[unknown_mails_invite_role_ids][]',
options_for_select(options),
no_label: true,
title: l(:label_role_search),
tabIndex: 0,
container_class: '-slim',
id: 'unknown_mails_invite_role_ids' %>
(<%= t('bcf.recommended') %>)
</label>
</div>
</div>
<% end %>
<div class="form--field -full-width">
<div class="form--field-container">
<label class="option-label">
<input type="radio" name="import_options[unknown_mails_action]" value="cancel" <%= User.current.admin? ? '' : 'checked' %>>
I will correct the data first and try another import.
</label>
<div class="form--field -full-width">
<div class="form--field-container">
<label class="option-label">
<input type="radio" name="import_options[unknown_mails_action]" value="anonymize">
<%= t('bcf.bcf_xml.import.replace_with_system_user') %> (<%= t('bcf.not_recommended') %>).
</label>
</div>
</div>
</div>
<div class="form--field -full-width">
<div class="form--field-container">
<label class="option-label">
<input type="radio" name="import_options[unknown_mails_action]" value="anonymize">
Replace them with <i>System</i> user (not recommended)
</label>
<% else %>
<div class="notification-box -warning">
<div class="notification-box--content">
<%= t('bcf.bcf_xml.import.no_permission_to_add_members') %>
<%= t('bcf.bcf_xml.import.contact_project_admin') %>
</div>
</div>
</div>
<%= submit_tag t('bcf.bcf_xml.import.button_proceed'), class: 'button -highlight' %>
<%= link_to t(:button_cancel),
project_work_packages_bcf_issues_path(@project),
class: 'button' %>
<div class="form--field">
<%= t('bcf.bcf_xml.import.continue_anyways') %>
<input type="hidden" name="import_options[unknown_mails_action]" value="anonymize">
<%= t('bcf.bcf_xml.import.replace_with_system_user') %>.
</div>
<% end %>
<%= styled_submit_tag t('bcf.bcf_xml.import.button_proceed'), class: '-highlight' %>
<% else %>
<p>
<%= I18n.t('text_no_roles_defined') %>
</p>
<%= link_to t(:button_cancel),
project_work_packages_bcf_issues_path(@project),
class: 'button' %>
<div class="notification-box -error">
<div class="notification-box--content">
<%= I18n.t('text_no_roles_defined') %>
</div>
</div>
<br/>
<% end %>
<%= link_to t(:button_cancel),
project_work_packages_bcf_issues_path(@project),
class: 'button' %>
<% end %>

@ -1,38 +1,12 @@
<%= stylesheet_link_tag 'bcf/bcf.css' %>
<%= toolbar title: t('bcf.bcf_xml.import_title') %>
<%= form_tag({ action: :configure_import }, multipart: true, method: :post) do %>
<%= render 'import_options_hidden_fields' %>
<h3>Invalid priority names found</h3>
<ul>
<% @importer.aggregations.unknown_priorities.each do |name| %>
<li> <%= name.present? ? name : '(No priority provided)' %></li>
<% end %>
</ul>
<div class="form--field -full-width">
<div class="form--field-container">
<label class="option-label">
<input type="radio" name="import_options[unknown_priorities_action]" value="cancel" checked>
Recommended: Correct the data first and try another import.
</label>
</div>
</div>
<label class="option-label">
<input type="radio" name="import_options[unknown_priorities_action]" value="chose">
Import them all, setting priority to
<% options = IssuePriority.all.collect { |priority| [priority.name, priority.id] } %>
<%= select_tag 'import_options[unknown_priorities_chose_ids][]', options_for_select(options, IssuePriority.default.id),
multiple: false,
no_label: true,
title: l(:label_priority),
tabIndex: 0,
class: 'form--select form--inline-select',
id: 'unknown_priorities_chose_ids' %>
</label>
<%= submit_tag t('bcf.bcf_xml.import.button_proceed'), class: 'button -highlight' %>
<%= link_to t(:button_cancel),
project_work_packages_bcf_issues_path(@project),
class: 'button' %>
<%= styled_form_tag({ action: :configure_import }, multipart: true, method: :post, class: '-vertical') do %>
<%= render partial: 'import_errors', locals: { error_message: t('bcf.bcf_xml.import.invalid_priorities_found'),
error_objects: @importer.aggregations.unknown_priorities,
error_default_text: t('bcf.bcf_xml.import.no_priority_provided')} %>
<%= render partial: 'import_solution', locals: { solution_select_id: 'unknown_priorities_chose_ids',
hidden_field_identifier: 'unknown_priorities_action',
solution_text: t('bcf.bcf_xml.import.import_priorities_as'),
solution_options: IssuePriority.all.collect { |priority| [priority.name, priority.id] }} %>
<% end %>

@ -1,38 +1,12 @@
<%= stylesheet_link_tag 'bcf/bcf.css' %>
<%= toolbar title: t('bcf.bcf_xml.import_title') %>
<%= form_tag({ action: :configure_import }, multipart: true, method: :post) do %>
<%= render 'import_options_hidden_fields' %>
<h3>Invalid topic status names found</h3>
<ul>
<% @importer.aggregations.unknown_statuses.each do |name| %>
<li> <%= name.present? ? name : '(No status provided)' %></li>
<% end %>
</ul>
<div class="form--field -full-width">
<div class="form--field-container">
<label class="option-label">
<input type="radio" name="import_options[unknown_statuses_action]" value="cancel" checked>
Recommended: Correct the data first and try another import.
</label>
</div>
</div>
<label class="option-label">
<input type="radio" name="import_options[unknown_statuses_action]" value="chose">
Import them all setting status to
<% options = Status.all.collect { |status| [status.name, status.id] } %>
<%= select_tag 'import_options[unknown_statuses_chose_ids][]', options_for_select(options),
multiple: false,
no_label: true,
title: l(:label_status),
tabIndex: 0,
class: 'form--select form--inline-select',
id: 'unknown_statuses_chose_ids' %>
</label>
<%= submit_tag t('bcf.bcf_xml.import.button_proceed'), class: 'button -highlight' %>
<%= link_to t(:button_cancel),
project_work_packages_bcf_issues_path(@project),
class: 'button' %>
<%= styled_form_tag({ action: :configure_import }, multipart: true, method: :post, class: '-vertical') do %>
<%= render partial: 'import_errors', locals: { error_message: t('bcf.bcf_xml.import.invalid_statuses_found'),
error_objects: @importer.aggregations.unknown_statuses,
error_default_text: t('bcf.bcf_xml.import.no_status_provided')} %>
<%= render partial: 'import_solution', locals: { solution_select_id: 'unknown_statuses_chose_ids',
hidden_field_identifier: 'unknown_statuses_action',
solution_text: t('bcf.bcf_xml.import.import_statuses_as'),
solution_options: Status.all.collect { |status| [status.name, status.id] }} %>
<% end %>

@ -1,38 +1,12 @@
<%= stylesheet_link_tag 'bcf/bcf.css' %>
<%= toolbar title: t('bcf.bcf_xml.import_title') %>
<%= form_tag({ action: :configure_import }, multipart: true, method: :post) do %>
<%= render 'import_options_hidden_fields' %>
<h3>Invalid topic type names found</h3>
<ul>
<% @importer.aggregations.unknown_types.each do |name| %>
<li> <%= name.present? ? name : '(No type provided)' %></li>
<% end %>
</ul>
<div class="form--field -full-width">
<div class="form--field-container">
<label class="option-label">
<input type="radio" name="import_options[unknown_types_action]" value="cancel" checked>
Recommended: Correct the data first and try another import.
</label>
</div>
</div>
<label class="option-label">
<input type="radio" name="import_options[unknown_types_action]" value="chose">
Import them all setting type to
<% options = Type.all.collect { |type| [type.name, type.id] } %>
<%= select_tag 'import_options[unknown_types_chose_ids][]', options_for_select(options),
multiple: false,
no_label: true,
title: l(:label_type),
tabIndex: 0,
class: 'form--select form--inline-select',
id: 'unknown_types_chose_ids' %>
</label>
<%= submit_tag t('bcf.bcf_xml.import.button_proceed'), class: 'button -highlight' %>
<%= link_to t(:button_cancel),
project_work_packages_bcf_issues_path(@project),
class: 'button' %>
<%= styled_form_tag({ action: :configure_import }, multipart: true, method: :post, class: '-vertical') do %>
<%= render partial: 'import_errors', locals: { error_message: t('bcf.bcf_xml.import.invalid_types_found'),
error_objects: @importer.aggregations.unknown_types,
error_default_text: t('bcf.bcf_xml.import.no_type_provided')} %>
<%= render partial: 'import_solution', locals: { solution_select_id: 'unknown_types_chose_ids',
hidden_field_identifier: 'unknown_types_action',
solution_text: t('bcf.bcf_xml.import.import_types_as'),
solution_options: Type.all.collect { |type| [type.name, type.id] }} %>
<% end %>

@ -5,6 +5,9 @@ en:
label_imported_failed: 'Failed imports of BCF topics'
label_imported_successfully: 'Successfully imported BCF topics'
issues: "Issues"
recommended: 'recommended'
not_recommended: 'not recommended'
no_viewpoints: 'No viewpoints'
experimental_badge: "Experimental"
exceptions:
file_invalid: "BCF file invalid"
@ -30,9 +33,30 @@ en:
button_perform_import: 'Confirm import'
button_proceed: 'Proceed'
button_back_to_list: 'Back to list'
no_permission_to_add_members: 'You do not have sufficient permissions to add them as members to the project.'
contact_project_admin: 'Contact your project admin to add them as members and start this import again.'
continue_anyways: 'Do you want to proceed and finish the import anyways?'
description: "Provide a BCF-XML v2.1 file to import into this project. You can examine its contents before performing the import."
invalid_types_found: 'Invalid topic type names found'
invalid_statuses_found: 'Invalid status names found'
invalid_priorities_found: 'Invalid priority names found'
invalid_emails_found: 'Invalid email addresses found'
unknown_emails_found: 'Unknown email addresses found'
unknown_property: 'Unknown property'
non_members_found: 'Non project members found'
import_types_as: 'Set all these types to'
import_statuses_as: 'Set all these statuses to'
import_priorities_as: 'Set all these priorities to'
invite_as_members_with_role: 'Invite them as members to the project "%{project}" with role'
add_as_members_with_role: 'Add them as members to the project "%{project}" with role'
no_type_provided: 'No type provided'
no_status_provided: 'No status provided'
no_priority_provided: 'No priority provided'
perform_description: "Do you want to import or update the issues listed above?"
work_package_has_newer_changes: "The import for BCF topic %{bcf_uuid} appears to be outdated. The latest changes on the server are newer than the \"MofiedDate\" of the imported topic. However, comments got updated."
replace_with_system_user: 'Replace them with "System" user'
import_as_system_user: 'Import them as "System" user.'
what_to_do: "What do you want to do?"
work_package_has_newer_changes: "Outdated! This topic was not updated as the latest changes on the server were newer than the \"ModifiedDate\" of the imported topic. However, comments to the topic were imported."
export:
format:

Loading…
Cancel
Save