Skip to content

Commit 3898e40

Browse files
Add list of files being deleted to delete modal (pterodactyl#3299)
Shows the first 15 file names being deleted. If more then 15, the first 15 will be shown then the last line will be ` + ## other(s)`
1 parent bd5472e commit 3898e40

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

resources/scripts/components/server/files/MassActionsBar.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,18 @@ const MassActionsBar = () => {
7474
onConfirmed={onClickConfirmDeletion}
7575
onModalDismissed={() => setShowConfirm(false)}
7676
>
77-
Deleting files is a permanent operation, you cannot undo this action.
77+
Are you sure you want to delete {selectedFiles.length} file(s)?
78+
<br/>
79+
Deleting the file(s) listed below is a permanent operation, you cannot undo this action.
80+
<br/>
81+
<code>
82+
{ selectedFiles.slice(0, 15).map(file => (
83+
<li key={file}>{file}<br/></li>))
84+
}
85+
{ selectedFiles.length > 15 &&
86+
<li> + {selectedFiles.length - 15} other(s) </li>
87+
}
88+
</code>
7889
</ConfirmationModal>
7990
{showMove &&
8091
<RenameFileModal

0 commit comments

Comments
 (0)