From 0663aa19d52269424ac16764d04de0f67572de0c Mon Sep 17 00:00:00 2001 From: Henriette Dinger Date: Thu, 1 Aug 2019 14:35:43 +0200 Subject: [PATCH] (1) Take care the "cancel" of import redirects to the WP list, (2) A successful import redirects to the import summary page and not directly back to the list, (3) Shorten button labels --- .../app/controllers/bcf/issues_controller.rb | 3 +-- .../issues/configure_invalid_people.html.erb | 2 +- .../bcf/issues/configure_non_members.html.erb | 4 ++-- .../issues/configure_unknown_mails.html.erb | 4 ++-- .../configure_unknown_priorities.html.erb | 2 +- .../configure_unknown_statuses.html.erb | 2 +- .../issues/configure_unknown_types.html.erb | 2 +- .../bcf/issues/diff_on_work_packages.html.erb | 2 +- .../views/bcf/issues/perform_import.html.erb | 22 +++++++++++++------ .../bcf/app/views/bcf/issues/upload.html.erb | 2 +- modules/bcf/config/locales/en.yml | 6 +++-- modules/bcf/config/locales/js-en.yml | 2 +- 12 files changed, 31 insertions(+), 22 deletions(-) diff --git a/modules/bcf/app/controllers/bcf/issues_controller.rb b/modules/bcf/app/controllers/bcf/issues_controller.rb index f0c5cae83f..ab12220f55 100644 --- a/modules/bcf/app/controllers/bcf/issues_controller.rb +++ b/modules/bcf/app/controllers/bcf/issues_controller.rb @@ -81,7 +81,6 @@ module ::Bcf @issues[:successful] << issue end end - redirect_to project_work_packages_bcf_issues_path(@project) rescue StandardError => e flash[:error] = I18n.t('bcf.bcf_xml.import_failed', error: e.message) end @@ -98,7 +97,7 @@ module ::Bcf unknown_mails_action non_members_action].map { |key| params.dig(:import_options, key) }.include? 'cancel' flash[:notice] = I18n.t('bcf.bcf_xml.import_canceled') - redirect_to action: :index + redirect_to project_work_packages_bcf_issues_path(@project) end end diff --git a/modules/bcf/app/views/bcf/issues/configure_invalid_people.html.erb b/modules/bcf/app/views/bcf/issues/configure_invalid_people.html.erb index 4468f5c297..8c307170b1 100644 --- a/modules/bcf/app/views/bcf/issues/configure_invalid_people.html.erb +++ b/modules/bcf/app/views/bcf/issues/configure_invalid_people.html.erb @@ -27,7 +27,7 @@ <%= submit_tag t('bcf.bcf_xml.import.button_proceed'), class: 'button -highlight' %> <%= link_to t(:button_cancel), - { action: :index }, + project_work_packages_bcf_issues_path(@project), class: 'button' %> <% end %> diff --git a/modules/bcf/app/views/bcf/issues/configure_non_members.html.erb b/modules/bcf/app/views/bcf/issues/configure_non_members.html.erb index 0eee0478ed..6ebd19bba0 100644 --- a/modules/bcf/app/views/bcf/issues/configure_non_members.html.erb +++ b/modules/bcf/app/views/bcf/issues/configure_non_members.html.erb @@ -42,14 +42,14 @@ <%= submit_tag t('bcf.bcf_xml.import.button_proceed'), class: 'button -highlight' %> <%= link_to t(:button_cancel), - { action: :index }, + project_work_packages_bcf_issues_path(@project), class: 'button' %> <% else %>

<%= I18n.t('text_no_roles_defined') %>

<%= link_to t(:button_cancel), - { action: :index }, + project_work_packages_bcf_issues_path(@project), class: 'button' %> <% end %> <% end %> diff --git a/modules/bcf/app/views/bcf/issues/configure_unknown_mails.html.erb b/modules/bcf/app/views/bcf/issues/configure_unknown_mails.html.erb index f0f481296b..d78a930713 100644 --- a/modules/bcf/app/views/bcf/issues/configure_unknown_mails.html.erb +++ b/modules/bcf/app/views/bcf/issues/configure_unknown_mails.html.erb @@ -49,14 +49,14 @@ <%= submit_tag t('bcf.bcf_xml.import.button_proceed'), class: 'button -highlight' %> <%= link_to t(:button_cancel), - { action: :index }, + project_work_packages_bcf_issues_path(@project), class: 'button' %> <% else %>

<%= I18n.t('text_no_roles_defined') %>

<%= link_to t(:button_cancel), - { action: :index }, + project_work_packages_bcf_issues_path(@project), class: 'button' %> <% end %> <% end %> diff --git a/modules/bcf/app/views/bcf/issues/configure_unknown_priorities.html.erb b/modules/bcf/app/views/bcf/issues/configure_unknown_priorities.html.erb index b35c9509f7..301b5077ed 100644 --- a/modules/bcf/app/views/bcf/issues/configure_unknown_priorities.html.erb +++ b/modules/bcf/app/views/bcf/issues/configure_unknown_priorities.html.erb @@ -32,7 +32,7 @@ <%= submit_tag t('bcf.bcf_xml.import.button_proceed'), class: 'button -highlight' %> <%= link_to t(:button_cancel), - { action: :index }, + project_work_packages_bcf_issues_path(@project), class: 'button' %> <% end %> diff --git a/modules/bcf/app/views/bcf/issues/configure_unknown_statuses.html.erb b/modules/bcf/app/views/bcf/issues/configure_unknown_statuses.html.erb index b415e20aa2..2c51853ece 100644 --- a/modules/bcf/app/views/bcf/issues/configure_unknown_statuses.html.erb +++ b/modules/bcf/app/views/bcf/issues/configure_unknown_statuses.html.erb @@ -32,7 +32,7 @@ <%= submit_tag t('bcf.bcf_xml.import.button_proceed'), class: 'button -highlight' %> <%= link_to t(:button_cancel), - { action: :index }, + project_work_packages_bcf_issues_path(@project), class: 'button' %> <% end %> diff --git a/modules/bcf/app/views/bcf/issues/configure_unknown_types.html.erb b/modules/bcf/app/views/bcf/issues/configure_unknown_types.html.erb index 443651c321..8d16890973 100644 --- a/modules/bcf/app/views/bcf/issues/configure_unknown_types.html.erb +++ b/modules/bcf/app/views/bcf/issues/configure_unknown_types.html.erb @@ -32,7 +32,7 @@ <%= submit_tag t('bcf.bcf_xml.import.button_proceed'), class: 'button -highlight' %> <%= link_to t(:button_cancel), - { action: :index }, + project_work_packages_bcf_issues_path(@project), class: 'button' %> <% end %> diff --git a/modules/bcf/app/views/bcf/issues/diff_on_work_packages.html.erb b/modules/bcf/app/views/bcf/issues/diff_on_work_packages.html.erb index cd69022eff..087ec80514 100644 --- a/modules/bcf/app/views/bcf/issues/diff_on_work_packages.html.erb +++ b/modules/bcf/app/views/bcf/issues/diff_on_work_packages.html.erb @@ -65,7 +65,7 @@

<%= t('bcf.bcf_xml.import.perform_description') %>

<%= submit_tag t('bcf.bcf_xml.import.button_perform_import'), class: 'button -highlight' %> <%= link_to t(:button_cancel), - { action: :index }, + project_work_packages_bcf_issues_path(@project), class: 'button' %> <% end %> diff --git a/modules/bcf/app/views/bcf/issues/perform_import.html.erb b/modules/bcf/app/views/bcf/issues/perform_import.html.erb index e099536b2d..8af2edf905 100644 --- a/modules/bcf/app/views/bcf/issues/perform_import.html.erb +++ b/modules/bcf/app/views/bcf/issues/perform_import.html.erb @@ -1,13 +1,21 @@ <%= stylesheet_link_tag 'bcf/bcf.css' %> -

Failed imports of BCF topics

-<%= render partial: 'render_issues', locals: { issues: @issues[:failed] } %> -

-

Successfully imported BCF topics

-<%= render partial: 'render_issues', locals: { issues: @issues[:successful] } %> -

-
+<%= toolbar title: l(:label_summary) %> + <%= link_to t('bcf.bcf_xml.import.button_back_to_list'), project_work_packages_bcf_issues_path(@project), class: 'button -highlight' %> + +
+ <%= I18n.t('bcf.label_imported_successfully') %> + + <%= render partial: 'render_issues', locals: { issues: @issues[:successful] } %> +
+ + +
+ <%= I18n.t('bcf.label_imported_failed') %> + <%= render partial: 'render_issues', locals: { issues: @issues[:failed] } %> +
+ diff --git a/modules/bcf/app/views/bcf/issues/upload.html.erb b/modules/bcf/app/views/bcf/issues/upload.html.erb index 8fad27deb6..530bc4574e 100644 --- a/modules/bcf/app/views/bcf/issues/upload.html.erb +++ b/modules/bcf/app/views/bcf/issues/upload.html.erb @@ -14,6 +14,6 @@ <%= submit_tag t('bcf.bcf_xml.import.button_prepare'), class: 'button -highlight' %> <%= link_to t(:button_cancel), - { action: :index }, + project_work_packages_bcf_issues_path(@project), class: 'button' %> <% end %> diff --git a/modules/bcf/config/locales/en.yml b/modules/bcf/config/locales/en.yml index b8d287a2b4..23bb120285 100644 --- a/modules/bcf/config/locales/en.yml +++ b/modules/bcf/config/locales/en.yml @@ -2,6 +2,8 @@ en: bcf: label_bcf: 'BCF' + label_imported_failed: 'Failed imports of BCF topics' + label_imported_successfully: 'Successfully imported BCF topics' issues: "Issues" experimental_badge: "Experimental" exceptions: @@ -14,8 +16,8 @@ en: bcf_xml: xml_file: 'BCF XML File' - import_title: 'Import from BCF file' - export: 'Export all to BCF-XML' + import_title: 'Import' + export: 'Export' import_update_comment: '(Updated in BCF import)' import_failed: 'Cannot import BCF file: %{error}' import_successful: 'Imported %{count} BCF issues' diff --git a/modules/bcf/config/locales/js-en.yml b/modules/bcf/config/locales/js-en.yml index af16342490..22aa9ee97b 100644 --- a/modules/bcf/config/locales/js-en.yml +++ b/modules/bcf/config/locales/js-en.yml @@ -3,7 +3,7 @@ en: js: bcf: import: 'Import' - export: 'Export BCF-XML' + export: 'Export' work_packages: default_queries: bcf: 'BCF issues'