Merge pull request #7504 from opf/bim/change-defaults-for-import-dialogue
Change BCF-XML import to import by default.pull/7526/head
commit
80af117bd4
@ -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' %> |
||||
|
@ -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? %> |
||||
<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) %> |
||||
<% options = @roles.collect { |obj| [obj.name, obj.id] } %> |
||||
<%= select_tag 'import_options[unknown_mails_invite_role_ids][]', options_for_select(options), |
||||
multiple: false, |
||||
<%= styled_select_tag 'import_options[unknown_mails_invite_role_ids][]', |
||||
options_for_select(options), |
||||
no_label: true, |
||||
title: l(:label_role_search), |
||||
tabIndex: 0, |
||||
class: 'form--select form--inline-select', |
||||
container_class: '-slim', |
||||
id: 'unknown_mails_invite_role_ids' %> |
||||
(recommended) |
||||
(<%= 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. |
||||
<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 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> |
||||
|
||||
<%= 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> |
||||
<div class="notification-box -error"> |
||||
<div class="notification-box--content"> |
||||
<%= I18n.t('text_no_roles_defined') %> |
||||
</p> |
||||
</div> |
||||
</div> |
||||
<br/> |
||||
<% end %> |
||||
<%= link_to t(:button_cancel), |
||||
project_work_packages_bcf_issues_path(@project), |
||||
class: 'button' %> |
||||
<% end %> |
||||
<% end %> |
||||
|
||||
|
Loading…
Reference in new issue