Add "Reset account" followed by sample data preload (#163)

* Add reset with sample data option on profile settings

* No need for "member" user in preload

* Cleanup/shorten copy
This commit is contained in:
Juan José Mata
2025-09-25 11:43:23 +02:00
committed by GitHub
parent 3264a96249
commit dfd467ccb5
12 changed files with 138 additions and 10 deletions

View File

@@ -137,9 +137,30 @@
href: reset_user_path(@user),
method: :delete,
confirm: CustomConfirm.new(
title: "Reset account?",
body: "This will delete all data associated with your account. Your user profile will remain active.",
btn_text: "Reset account",
title: t(".confirm_reset.title"),
body: t(".confirm_reset.body"),
btn_text: t(".reset_account"),
destructive: true,
high_severity: true
)
) %>
</div>
<div class="flex flex-col md:flex-row md:items-center md:justify-between gap-4">
<div class="w-full md:w-2/3">
<h3 class="font-medium text-primary"><%= t(".reset_account_with_sample_data") %></h3>
<p class="text-secondary text-sm"><%= t(".reset_account_with_sample_data_warning") %></p>
</div>
<%= render DS::Button.new(
text: t(".reset_account_with_sample_data"),
variant: "destructive",
href: reset_with_sample_data_user_path(@user),
method: :delete,
confirm: CustomConfirm.new(
title: t(".confirm_reset_with_sample_data.title"),
body: t(".confirm_reset_with_sample_data.body"),
btn_text: t(".reset_account_with_sample_data"),
destructive: true,
high_severity: true
)