From 5652a89cd651d58b24afd7dacd5835e233272ff3 Mon Sep 17 00:00:00 2001 From: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com> Date: Mon, 28 Feb 2022 13:02:57 -0700 Subject: [PATCH] Update the Copy for all Modals in the Admin Member Detail View (#16708) * Updates the copy for all modals within Admin Member Detail view * Resolve most failing tests within managaUserOptions.spec.js * Update app/views/admin/users/show/profile/actions/_export.html.erb Co-authored-by: Suzanne Aitchison * Update cypress/integration/seededFlows/adminFlows/users/manageUserOptions.spec.js Co-authored-by: Suzanne Aitchison --- .../show/overview/_organizations.html.erb | 6 ++--- .../users/show/profile/_actions.html.erb | 8 +++---- .../show/profile/actions/_banish.html.erb | 19 ++++++++------- .../show/profile/actions/_delete.html.erb | 11 +++++---- .../show/profile/actions/_export.html.erb | 14 ++++------- .../show/profile/actions/_merge.html.erb | 8 +++---- .../profile/actions/_social_accounts.html.erb | 24 +++++++++---------- .../show/profile/actions/_unpublish.html.erb | 3 ++- .../users/manageUserOptions.spec.js | 10 ++++---- 9 files changed, 50 insertions(+), 53 deletions(-) diff --git a/app/views/admin/users/show/overview/_organizations.html.erb b/app/views/admin/users/show/overview/_organizations.html.erb index cb442b39c..ab72395ac 100644 --- a/app/views/admin/users/show/overview/_organizations.html.erb +++ b/app/views/admin/users/show/overview/_organizations.html.erb @@ -28,12 +28,12 @@
<%= form_with model: [:admin, org_membership], method: :delete, local: true, html: { class: "inline" } do |f| %> <%= f.button crayons_icon_tag(:x, class: "c-btn__icon", aria_hidden: true), aria: { label: "Revoke #{org_membership.organization.name} organization membership" }, class: "c-btn c-btn--destructive c-btn--icon-alone", - data: { confirm: "Are you sure you want to remove them from #{org_membership.organization.name}?" } %> + data: { confirm: "Are you sure you want to remove #{org_membership.user.name} from #{org_membership.organization.name}?" } %> <% end %>
@@ -49,7 +49,7 @@ <% end %> <% end %> - + <% end %> diff --git a/app/views/admin/users/show/profile/actions/_banish.html.erb b/app/views/admin/users/show/profile/actions/_banish.html.erb index 366159f3b..0ca9dc6ac 100644 --- a/app/views/admin/users/show/profile/actions/_banish.html.erb +++ b/app/views/admin/users/show/profile/actions/_banish.html.erb @@ -1,20 +1,21 @@
<% if @user.comments.where("created_at < ?", 100.days.ago).empty? && @user.created_at < 100.days.ago %> -

This is extremely destructive. Banishing will delete all the user's existing content and change their username to @spam_###.

-

Do not do this lightly.

- <%= form_for(@user, url: banish_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? This is extremely destructive and irreversible. Banishing will delete all articles and turn their username into @spam_###')", id: nil }) do %> +

This action is irreversible.

+

Once banished, we will delete all content created by <%= @user.name %> and change their username to @spam_###.

+

Be careful with this action.

+ <%= form_for(@user, url: banish_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? This action is irreversible. Banishing will delete all content by #{@user.name} and change their username to @spam_###.')", id: nil }) do %> <% end %> <% elsif current_user.super_admin? || current_user.support_admin? %> -

This is not a new user. You are only allowed to take this action because you are a Super Admin or a Support Admin.

-

This is extremely destructive. Banishing will delete all the user's existing content and change their username to @spam_###.

-

Do not do this lightly.

- <%= form_for(@user, url: banish_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? This is extremely destructive and irreversible. Banishing will delete all articles and turn their username into @spam_###')", id: nil }) do %> - +

This action is irreversible.

+

Once banished, we will delete all content created by <%= @user.name %> and change their username to @spam_###.

+

Be careful with this action.

+ <%= form_for(@user, url: banish_admin_user_path(@user), html: { method: :post, onsubmit: "return confirm('Are you sure? This action is irreversible. Banishing will delete all content by #{@user.name} and change their username to @spam_###.')", id: nil }) do %> + <% end %> <% else %> -
This is not a new user. Only Super Admins or Support Admins are allowed to banish this user.
+
This is not a new user. Only Super Admins or Support Admins are allowed to banish <%= @user.name %>.
<% end %>
diff --git a/app/views/admin/users/show/profile/actions/_delete.html.erb b/app/views/admin/users/show/profile/actions/_delete.html.erb index dae886ced..b11955fce 100644 --- a/app/views/admin/users/show/profile/actions/_delete.html.erb +++ b/app/views/admin/users/show/profile/actions/_delete.html.erb @@ -1,13 +1,14 @@
<% if current_user.super_admin? %> - <%= form_for(@user, url: full_delete_admin_user_path(@user), html: { class: "flex flex-col gap-4", method: :post, onsubmit: "return confirm('Are you sure? This is extremely destructive and irreversible.')", id: nil }) do |f| %> -

This will completely destroy the user and all of their activity from our database. This action is irreversible.

-

Do not do this lightly.

+ <%= form_for(@user, url: full_delete_admin_user_path(@user), html: { class: "flex flex-col gap-4", method: :post, onsubmit: "return confirm('Are you sure? This action is irreversible.')", id: nil }) do |f| %> +

This action is irreversible.

+

Once deleted, all data for <%= @user.name %> will be removed from our database.

+

Be careful with this action.

- +
<% end %> <% else %> -
Only Super Admins are allowed to fully delete users.
+
Only Super Admins are allowed to delete users.
<% end %>
diff --git a/app/views/admin/users/show/profile/actions/_export.html.erb b/app/views/admin/users/show/profile/actions/_export.html.erb index 18ef91d13..705ff104a 100644 --- a/app/views/admin/users/show/profile/actions/_export.html.erb +++ b/app/views/admin/users/show/profile/actions/_export.html.erb @@ -1,19 +1,15 @@

- You can export a user's data here. Currently we only support exporting a user's posts and comments. + Choose betweem sending the exported data to either your Admin contact email, <%= ForemInstance.email %>, + or to <%= @user.name %>'s user email directly.

- You have the option of exporting to your Admin account to send to the user, or exporting to the user directly. -

-

- Exporting the data to your Admin account will send it to your contact - Admin email (<%= ForemInstance.email %>), - and exporting to the user will send it to their email (<%= @user.email %>). + Exported data includes a user's posts and comments.

- <%= button_to "Export to Admin", export_data_admin_user_path(@user.id), data: { confirm: "Are you sure you want to export this user's content to the ADMIN?" }, class: "c-btn c-btn--secondary", params: { send_to_admin: true } %> - <%= button_to "Export to User", export_data_admin_user_path(@user.id), data: { confirm: "Are you sure you want to export this user's content to the USER?" }, class: "c-btn c-btn--secondary", params: { send_to_admin: false } %> + <%= button_to "Export to Admin", export_data_admin_user_path(@user.id), data: { confirm: "Are you sure you want to export this user's content to #{ForemInstance.email}?" }, class: "c-btn c-btn--secondary", params: { send_to_admin: true } %> + <%= button_to "Export to User", export_data_admin_user_path(@user.id), data: { confirm: "Are you sure you want to export this user's content to #{@user.email}?" }, class: "c-btn c-btn--secondary", params: { send_to_admin: false } %>
diff --git a/app/views/admin/users/show/profile/actions/_merge.html.erb b/app/views/admin/users/show/profile/actions/_merge.html.erb index 0409283c7..fa120b299 100644 --- a/app/views/admin/users/show/profile/actions/_merge.html.erb +++ b/app/views/admin/users/show/profile/actions/_merge.html.erb @@ -1,16 +1,14 @@
<%= form_for(@user, url: merge_admin_user_path(@user), html: { class: "flex flex-col gap-4", method: :post, onsubmit: "return confirm('Are you sure? This is extremely destructive and irreversible. Merging will delete all the other users content and combine it with this user')", id: nil }) do |f| %> -

To merge a duplicate account, first make sure you are currently on the page of the user you want to keep. Below, add the user ID of the account to merge information from, and delete.

+

This action is irreversible.

+

Make sure you are currently on the page of the user you want to keep. Once merged, the account entered below will be merged and deleted.

<%= f.label :merge_user_id, "User ID", class: "crayons-field__label" %> -

- User ID for the user that will be deleted and merged. -

<%= f.text_field :merge_user_id, placeholder: "1234", class: "crayons-textfield", type: "number", inputmode: "numeric", aria: { describedby: "merge-user-description" } %>
- <%= f.button "Merge users", class: "c-btn c-btn--destructive c-btn--primary", type: "submit" %> + <%= f.button "Merge and delete", class: "c-btn c-btn--destructive c-btn--primary", type: "submit" %>
<% end %>
diff --git a/app/views/admin/users/show/profile/actions/_social_accounts.html.erb b/app/views/admin/users/show/profile/actions/_social_accounts.html.erb index 8af24daae..509bcaa23 100644 --- a/app/views/admin/users/show/profile/actions/_social_accounts.html.erb +++ b/app/views/admin/users/show/profile/actions/_social_accounts.html.erb @@ -1,21 +1,21 @@
-

At times, removing a user's social account will resolve certain sign-in issues that a user may be experiencing.

-

For example, users may experience issues related to their UID when creating a <%= community_name %> account. If a user creates an account by, first, deleting their original social account and, then, creating their new account with the same Twitter/GitHub username, - the user may be unable to register their new account. This occurs when a user's Twitter/GitHub account's UID does not match their identity's UID. For more information on whether a user's UID does not match their identity UID, the following third party tools can be - helpful: - Tweeter ID for Twitter (username is in URL for reference) - or Caius's GitHub ID Lookup Tool -

+

Sometimes users encounter sign-in issues when they....

+
    +
  1. create an account on <%= community_name %> with a social account, and
  2. +
  3. remove the original social account, and
  4. +
  5. attempt to sign in again using the same, removed social account.
  6. +
+

If this is the case, removing the social accounts below can help restore their social accounts. To verify if this is the case, follow steps 1 and 2 below. If verified, follow through all steps to restore their social accounts.

- How do I remove a social account? + How to restore a social account

    -
  1. To start, click on one of the links provided above to check the user's social account UID.
  2. -
  3. Next, confirm whether or not the user's social account UID matches the user's identity UID.
  4. -
  5. If the social account UID does not match, delete the respective identity.
  6. -
  7. Finally, ask the user to reauthorize their social account via <%= app_url(user_settings_path(:account)) %>
  8. +
  9. Check their social account's UID via these third party tools: Twitter UID and GitHub UID
  10. +
  11. Check whether or not it matches the corresponding UID below.
  12. +
  13. Remove the respective account if it doesn't match.
  14. +
  15. Ask the user to reauthorize their social account via <%= app_url(user_settings_path(:account)) %>
<% @user.identities.each do |identity| %> diff --git a/app/views/admin/users/show/profile/actions/_unpublish.html.erb b/app/views/admin/users/show/profile/actions/_unpublish.html.erb index f722acd27..87813cdd5 100644 --- a/app/views/admin/users/show/profile/actions/_unpublish.html.erb +++ b/app/views/admin/users/show/profile/actions/_unpublish.html.erb @@ -1,6 +1,7 @@
<%= form_for(@user, url: unpublish_all_articles_admin_user_path(@user), html: { class: "flex flex-col gap-4", method: :post, onsubmit: "return confirm('Are you sure? All posts will be unavailable to the community.')", id: nil }) do |f| %> -

This will make any and all of the post links associated with this user unreachable. If the user is not suspended, they will have the ability to republish their posts.

+

Once unpublished, all posts by <%= @user.name %> will become hidden and only accessible to themselves.

+

If <%= @user.name %> is not suspended, they can still re-publish their posts from their dashboard.

diff --git a/cypress/integration/seededFlows/adminFlows/users/manageUserOptions.spec.js b/cypress/integration/seededFlows/adminFlows/users/manageUserOptions.spec.js index 2d1b1e8d6..ee059cf94 100644 --- a/cypress/integration/seededFlows/adminFlows/users/manageUserOptions.spec.js +++ b/cypress/integration/seededFlows/adminFlows/users/manageUserOptions.spec.js @@ -67,22 +67,22 @@ describe('Manage User Options', () => { it(`should merge a user's account with another account`, () => { openUserOptions(() => { - cy.findByRole('button', { name: 'Merge accounts' }).click(); + cy.findByRole('button', { name: 'Merge users' }).click(); }); cy.getModal().within(() => { cy.findByRole('spinbutton', { name: 'User ID' }).type('3'); - cy.findByRole('button', { name: 'Merge users' }).click(); + cy.findByRole('button', { name: 'Merge and delete' }).click(); }); }); it(`should banish a user for spam`, () => { openUserOptions(() => { - cy.findByRole('button', { name: 'Banish for spam' }).click(); + cy.findByRole('button', { name: 'Banish user' }).click(); }); cy.getModal().within(() => { - cy.findByRole('button', { name: 'Banish User for spam' }).click(); + cy.findByRole('button', { name: 'Banish Trusted User 1 \\:/' }).click(); }); verifyAndDismissUserUpdatedMessage( @@ -97,7 +97,7 @@ describe('Manage User Options', () => { cy.getModal().within(() => { cy.findByRole('button', { - name: 'Fully Delete User & All Activity', + name: 'Delete now', }).click(); });