Skip to content

Commit 8158e64

Browse files
committed
Added confirmation dialog for delete task operation
1 parent 0fe3ac5 commit 8158e64

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
# Unreleased
55

6+
* Added confirmation dialog for delete task operation (\#272).
67
* Enabled task info tab and rendered docs info from markdown (\#271).
78
* Update import-workflow feature (\#269).
89
* Revamp home page and user-related layout (\#259).

src/routes/tasks/+page.svelte

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import TaskInfoModal from '$lib/components/tasks/TaskInfoModal.svelte';
1010
import TaskCollection from '$lib/components/tasks/TaskCollection.svelte';
1111
import StandardErrorAlert from '$lib/components/common/StandardErrorAlert.svelte';
12+
import ConfirmActionButton from '$lib/components/common/ConfirmActionButton.svelte';
1213
1314
// Error property to be set in order to show errors in UI
1415
let errorReasons = undefined;
@@ -242,10 +243,15 @@
242243
<i class="bi bi-pencil" />
243244
Edit
244245
</button>
245-
<button class="btn btn-danger" on:click={() => handleDeleteTask(task.id)}>
246-
<i class="bi bi-trash" />
247-
Delete
248-
</button>
246+
<ConfirmActionButton
247+
modalId="confirmTaskDeleteModal{task.id}"
248+
style={'danger'}
249+
btnStyle="danger"
250+
buttonIcon="trash"
251+
label={'Delete'}
252+
message={`Delete task ${task.name}`}
253+
callbackAction={() => handleDeleteTask(task.id)}
254+
/>
249255
</td>
250256
</tr>
251257
{/each}

0 commit comments

Comments
 (0)