Skip to content

Commit

Permalink
Fixed bug 53531 - Web: Files: added toastr when we delete a file or f…
Browse files Browse the repository at this point in the history
…older
  • Loading branch information
dmitry-sychugov committed Nov 12, 2021
1 parent ae0a437 commit 77de505
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class DeleteDialogComponent extends React.Component {
deleteOperation: t("Translations:DeleteOperation"),
deleteFromTrash: t("Translations:DeleteFromTrash"),
deleteSelectedElem: t("Translations:DeleteSelectedElem"),
FileRemoved: t("Home:FileRemoved"),
FolderRemoved: t("Home:FolderRemoved"),
};

const selection = this.state.selection.filter((f) => f.checked);
Expand Down
13 changes: 13 additions & 0 deletions products/ASC.Files/Client/src/store/FilesActionsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,17 @@ class FilesActionStore {
};
await this.uploadDataStore.loopFilesOperations(data, pbData);
this.updateCurrentFolder(selection.length);
if (isRecycleBinFolder) {
return toastr.success(translations.deleteFromTrash);
}

if (selection.length > 1) {
return toastr.success(translations.deleteSelectedElem);
}
if (selection[0].fileExst) {
return toastr.success(translations.FileRemoved);
}
return toastr.success(translations.FolderRemoved);
}
);
} catch (err) {
Expand Down Expand Up @@ -737,6 +748,8 @@ class FilesActionStore {
deleteOperation: t("Translations:DeleteOperation"),
deleteFromTrash: t("Translations:DeleteFromTrash"),
deleteSelectedElem: t("Translations:DeleteSelectedElem"),
FileRemoved: t("Home:FileRemoved"),
FolderRemoved: t("Home:FolderRemoved"),
};

this.deleteAction(translations).catch((err) =>
Expand Down

0 comments on commit 77de505

Please sign in to comment.