Skip to content

Commit

Permalink
Fixed Bug 54082 - Client.Files.Removed change of confirmation text.
Browse files Browse the repository at this point in the history
  • Loading branch information
TatianaLopaeva committed Nov 29, 2021
1 parent bce51d7 commit 9746006
Showing 1 changed file with 45 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,49 @@ class DeleteDialogComponent extends React.Component {
this.props.setDeleteDialogVisible(false);
};

moveToTrashTitle = (checkedSelections) => {
const { unsubscribe, t } = this.props;
const { filesList, foldersList } = this.state;

const itemsCount = filesList.length + foldersList.length;
const checkedSelectionCount = checkedSelections.length;

if (unsubscribe) {
return t("UnsubscribeTitle");
} else {
if (
(checkedSelectionCount < itemsCount && itemsCount > 1) ||
checkedSelectionCount > 1
) {
return t("MoveToTrashItemsTitle");
} else {
return filesList.length === 1
? t("MoveToTrashOneFileTitle")
: t("MoveToTrashOneFolderTitle");
}
}
};

moveToTrashNoteText = (checkedSelections) => {
const { filesList, foldersList } = this.state;
const { t, personal } = this.props;

const itemsCount = filesList.length + foldersList.length;
const checkedSelectionCount = checkedSelections.length;

if (
(checkedSelectionCount < itemsCount && itemsCount > 1) ||
checkedSelectionCount > 1
) {
return t("MoveToTrashItemsNote");
} else {
return filesList.length === 1
? t("MoveToTrashOneFileNote")
: personal
? ""
: t("MoveToTrashOneFolderNote");
}
};
render() {
const {
visible,
Expand All @@ -123,7 +166,6 @@ class DeleteDialogComponent extends React.Component {
unsubscribe,
isPrivacyFolder,
isRecycleBinFolder,
personal,
} = this.props;
const { filesList, foldersList, selection } = this.state;

Expand All @@ -132,23 +174,11 @@ class DeleteDialogComponent extends React.Component {
const title =
isPrivacyFolder || isRecycleBinFolder || checkedSelections[0]?.providerKey
? t("Common:Confirmation")
: unsubscribe
? t("UnsubscribeTitle")
: checkedSelections.length === 1 || isPrivacyFolder
? checkedSelections[0].fileExst
? t("MoveToTrashOneFileTitle")
: t("MoveToTrashOneFolderTitle")
: t("MoveToTrashItemsTitle");
: this.moveToTrashTitle(checkedSelections);

const noteText = unsubscribe
? t("UnsubscribeNote")
: checkedSelections.length === 1 || isPrivacyFolder
? checkedSelections[0].fileExst
? t("MoveToTrashOneFileNote")
: personal
? ""
: t("MoveToTrashOneFolderNote")
: t("MoveToTrashItemsNote");
: this.moveToTrashNoteText(checkedSelections);

const accessButtonLabel =
isPrivacyFolder || isRecycleBinFolder || checkedSelections[0]?.providerKey
Expand Down

0 comments on commit 9746006

Please sign in to comment.