Skip to content

Commit

Permalink
Better UX for project deletion modal (#2634)
Browse files Browse the repository at this point in the history
* show project name if asking for confirmation

---------

Co-authored-by: Stuart Corbishley <[email protected]>
  • Loading branch information
taylordowns2000 and stuartc authored Nov 6, 2024
1 parent 96bbd8d commit c209563
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ and this project adheres to
[#2629](https://github.com/OpenFn/lightning/pull/2629)
- JSDoc annotations are removed from code assist descriptions
[#2629](https://github.com/OpenFn/lightning/pull/2629)
- Show project name during delete confirmation
[#2634](https://github.com/OpenFn/lightning/pull/2634)

### Fixed

Expand Down
10 changes: 5 additions & 5 deletions lib/lightning_web/live/components/project_deletion_modal.ex
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,19 @@ defmodule LightningWeb.Components.ProjectDeletionModal do
<div id={"project-#{@id}"}>
<PetalComponents.Modal.modal
max_width="sm"
title="Delete project"
title={"Delete #{@project.name}"}
close_modal_target={@myself}
>
<.p>
Enter the project name to confirm it's deletion
Deleting this project will disable access
for all users, and disable all jobs in the project. The whole project will be deleted
along with all workflows and work order history, <%= human_readable_grace_period() %>.
</.p>
<div class="hidden sm:block" aria-hidden="true">
<div class="py-2"></div>
</div>
<.p>
Deleting this project will disable access
for all users, and disable all jobs in the project. The whole project will be deleted
along with all workflows and work order history, <%= human_readable_grace_period() %>.
Enter the project name to confirm deletion: <b><%= @project.name %></b>
</.p>
<div class="hidden sm:block" aria-hidden="true">
<div class="py-2"></div>
Expand Down
4 changes: 2 additions & 2 deletions test/lightning_web/live/project_live_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ defmodule LightningWeb.ProjectLiveTest do
{:ok, delete_project_modal, html} =
live(conn, ~p"/projects/#{project.id}/settings/delete")

assert html =~ "Enter the project name to confirm it&#39;s deletion"
assert html =~ "Enter the project name to confirm deletion"

{:ok, _delete_project_modal, html} =
delete_project_modal
Expand Down Expand Up @@ -258,7 +258,7 @@ defmodule LightningWeb.ProjectLiveTest do
project: %{name_confirmation: "invalid name"}
)
|> render_change() =~
"Enter the project name to confirm it&#39;s deletion"
"Enter the project name to confirm deletion"

{:ok, _index_live, html} =
form_live
Expand Down

0 comments on commit c209563

Please sign in to comment.