diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c1f00b8..caf0578f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Taiwan flag is now shown on its own instead of in combination with China flag. - On the registration page and other user forms, if something goes wrong, error messages are now shown to the user. +- Leaving family, deleting family and cancelling invitations now prompt confirmation dialog to prevent accidental actions. +- Each pending family invitation now also contain a link to share with the invitee. ## Changed diff --git a/app/views/families/edit.html.erb b/app/views/families/edit.html.erb index 7007d4a3..513767a8 100644 --- a/app/views/families/edit.html.erb +++ b/app/views/families/edit.html.erb @@ -88,7 +88,7 @@ <% if policy(@family).destroy? %> <%= link_to family_path, method: :delete, - data: { turbo_confirm: 'Are you sure you want to delete this family? This action cannot be undone.' }, + data: { turbo_confirm: 'Are you sure you want to delete this family? This action cannot be undone.', turbo_method: :delete }, class: "btn btn-outline btn-error" do %> <%= icon 'trash-2', class: "inline-block w-4" %> Delete Family diff --git a/app/views/families/show.html.erb b/app/views/families/show.html.erb index fd688d15..cd7a074c 100644 --- a/app/views/families/show.html.erb +++ b/app/views/families/show.html.erb @@ -26,7 +26,7 @@ <% if !current_user.family_owner? && current_user.family_membership %> <%= link_to family_member_path(current_user.family_membership), method: :delete, - data: { turbo_confirm: 'Are you sure you want to leave this family?' }, + data: { turbo_confirm: 'Are you sure you want to leave this family?', turbo_method: :delete }, class: "btn btn-outline btm-sm btn-warning" do %> Leave Family <% end %> @@ -35,7 +35,7 @@ <% if policy(@family).destroy? %> <%= link_to family_path, method: :delete, - data: { turbo_confirm: 'Are you sure you want to delete this family? This action cannot be undone.' }, + data: { turbo_confirm: 'Are you sure you want to delete this family? This action cannot be undone.', turbo_method: :delete }, class: "btn btn-outline btm-sm btn-error" do %> <%= icon 'trash-2', class: "inline-block w-4" %> Delete @@ -190,9 +190,9 @@ <% if policy(@family).manage_invitations? %>