From 144c7bd8317ba04e6acc630415e60a24cba57219 Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Thu, 27 May 2021 11:15:11 +0200 Subject: [PATCH] Navigate to CSV import from /direct_verifications Closes https://github.com/coopdevs/decidim-coopcat/issues/134. This simply makes it possible to reach the /direct_verifications/imports/new page that was previously introduced and demoed to ICA; the customer requesting this feature. --- .../verification/admin/direct_verifications/index.html.erb | 2 +- config/locales/en.yml | 3 +-- .../direct_verifications/admin/admin_imports_users_spec.rb | 6 ++++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/views/decidim/direct_verifications/verification/admin/direct_verifications/index.html.erb b/app/views/decidim/direct_verifications/verification/admin/direct_verifications/index.html.erb index 79d9dbb..7154c54 100644 --- a/app/views/decidim/direct_verifications/verification/admin/direct_verifications/index.html.erb +++ b/app/views/decidim/direct_verifications/verification/admin/direct_verifications/index.html.erb @@ -7,7 +7,7 @@
-

<%= t("decidim.direct_verifications.verification.admin.new.info") %>

+

<%= t("decidim.direct_verifications.verification.admin.new.info_html", link: new_import_path) %>

<%= form_tag direct_verifications_path, multipart: true, class: "form" do %> <%= label_tag :userslist, t("admin.new.textarea", scope: "decidim.direct_verifications.verification") %> <%= text_area_tag :userslist, @userslist, rows: 10 %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 9216485..0e11e11 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -68,8 +68,7 @@ en: authorization_handler: Verification method authorize: Authorize users check: Check users status - info: Enter the emails here, one per line. If the emails are preceded - by a text, it will be interpreted as the user's name + info_html: You can import a CSV or enter the emails here, one per line. If the emails are preceded by a text, it will be interpreted as the user's name. register: Register users in the platform (if they exist they will be ignored) revoke: Revoke authorization from users submit: Send and process the list diff --git a/spec/system/decidim/direct_verifications/admin/admin_imports_users_spec.rb b/spec/system/decidim/direct_verifications/admin/admin_imports_users_spec.rb index 22b1857..38661f0 100644 --- a/spec/system/decidim/direct_verifications/admin/admin_imports_users_spec.rb +++ b/spec/system/decidim/direct_verifications/admin/admin_imports_users_spec.rb @@ -16,6 +16,12 @@ visit decidim_admin_direct_verifications.new_import_path end + it "can be accessed from direct_verifications_path" do + visit decidim_admin_direct_verifications.direct_verifications_path + click_link "import a CSV" + expect(page).to have_current_path(decidim_admin_direct_verifications.new_import_path) + end + context "when registering users" do it "registers users through a CSV file" do attach_file("CSV file with users data", filename)